mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
IGMP: fixed !define LWIP_RAND case
This commit is contained in:
parent
4d774e275d
commit
0f24fba28a
@ -696,12 +696,18 @@ static void
|
|||||||
igmp_start_timer(struct igmp_group *group, u8_t max_time)
|
igmp_start_timer(struct igmp_group *group, u8_t max_time)
|
||||||
{
|
{
|
||||||
/* ensure the input value is > 0 */
|
/* ensure the input value is > 0 */
|
||||||
|
#ifdef LWIP_RAND
|
||||||
if (max_time == 0) {
|
if (max_time == 0) {
|
||||||
max_time = 1;
|
max_time = 1;
|
||||||
}
|
}
|
||||||
#ifdef LWIP_RAND
|
|
||||||
/* ensure the random value is > 0 */
|
/* ensure the random value is > 0 */
|
||||||
group->timer = (LWIP_RAND() % max_time);
|
group->timer = (LWIP_RAND() % max_time);
|
||||||
|
#else /* LWIP_RAND */
|
||||||
|
/* ATTENTION: use this only if absolutely necessary! */
|
||||||
|
group->timer = max_time / 2;
|
||||||
|
if (group->timer == 0) {
|
||||||
|
group->timer = 1;
|
||||||
|
}
|
||||||
#endif /* LWIP_RAND */
|
#endif /* LWIP_RAND */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user