diff --git a/src/core/ipv4/igmp.c b/src/core/ipv4/igmp.c index 22a1e161..bd52744f 100644 --- a/src/core/ipv4/igmp.c +++ b/src/core/ipv4/igmp.c @@ -699,8 +699,10 @@ igmp_start_timer(struct igmp_group *group, u8_t max_time) if (max_time == 0) { max_time = 1; } +#ifdef LWIP_RAND /* ensure the random value is > 0 */ group->timer = (LWIP_RAND() % (max_time - 1)) + 1; +#endif /* LWIP_RAND */ } /** diff --git a/src/core/ipv6/mld6.c b/src/core/ipv6/mld6.c index 9db25bab..1cb2dd9c 100644 --- a/src/core/ipv6/mld6.c +++ b/src/core/ipv6/mld6.c @@ -493,8 +493,10 @@ mld6_delayed_report(struct mld_group *group, u16_t maxresp) maxresp = 1; } - /* Randomize maxresp. */ +#ifdef LWIP_RAND + /* Randomize maxresp. (if LWIP_RAND is supported) */ maxresp = (LWIP_RAND() % (maxresp - 1)) + 1; +#endif /* LWIP_RAND */ /* Apply timer value if no report has been scheduled already. */ if ((group->group_state == MLD6_GROUP_IDLE_MEMBER) ||