IGMP: fixed !define LWIP_RAND case

This commit is contained in:
Simon Goldschmidt 2014-02-20 22:07:58 +01:00
parent 4d774e275d
commit 0f24fba28a

View File

@ -696,12 +696,18 @@ static void
igmp_start_timer(struct igmp_group *group, u8_t max_time)
{
/* ensure the input value is > 0 */
#ifdef LWIP_RAND
if (max_time == 0) {
max_time = 1;
}
#ifdef LWIP_RAND
/* ensure the random value is > 0 */
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 */
}