Make LWIP_RAND optional (useful for small targets)

This commit is contained in:
Simon Goldschmidt 2011-09-03 22:27:30 +02:00
parent e27d34d118
commit 5e8ee7e006
2 changed files with 5 additions and 1 deletions

View File

@ -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 */
}
/**

View File

@ -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) ||