mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-25 07:33:11 +00:00
Make LWIP_RAND optional (useful for small targets)
This commit is contained in:
parent
e27d34d118
commit
5e8ee7e006
@ -699,8 +699,10 @@ igmp_start_timer(struct igmp_group *group, u8_t max_time)
|
|||||||
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 - 1)) + 1;
|
group->timer = (LWIP_RAND() % (max_time - 1)) + 1;
|
||||||
|
#endif /* LWIP_RAND */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -493,8 +493,10 @@ mld6_delayed_report(struct mld_group *group, u16_t maxresp)
|
|||||||
maxresp = 1;
|
maxresp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Randomize maxresp. */
|
#ifdef LWIP_RAND
|
||||||
|
/* Randomize maxresp. (if LWIP_RAND is supported) */
|
||||||
maxresp = (LWIP_RAND() % (maxresp - 1)) + 1;
|
maxresp = (LWIP_RAND() % (maxresp - 1)) + 1;
|
||||||
|
#endif /* LWIP_RAND */
|
||||||
|
|
||||||
/* Apply timer value if no report has been scheduled already. */
|
/* Apply timer value if no report has been scheduled already. */
|
||||||
if ((group->group_state == MLD6_GROUP_IDLE_MEMBER) ||
|
if ((group->group_state == MLD6_GROUP_IDLE_MEMBER) ||
|
||||||
|
Loading…
Reference in New Issue
Block a user