Hi,
I encountered this issue few months back, and thought I'd share
the observation. igmp_set_timer() can still set it's timer value to 0,
which is not good. At least for me. My random number generator can
return 0.
[marko@Markos-MacBook-Pro:~/src2/module/ext/LwIP/src/core/ipv4]$ diff -C 3
~/lwip/src/core/ipv4/igmp.c igmp.c
*** /Users/marko/lwip/src/core/ipv4/igmp.c 2014-03-13 16:47:44.000000000
-0700
--- igmp.c 2014-03-14 11:59:05.000000000 -0700
***************
*** 699,709 ****
{
/* ensure the input value is > 0 */
#ifdef LWIP_RAND
! if (max_time == 0) {
! max_time = 1;
! }
/* 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;
--- 699,710 ----
{
/* ensure the input value is > 0 */
#ifdef LWIP_RAND
! if (max_time <= 1) {
! group->timer = 1;
! } else {
/* ensure the random value is > 0 */
! group->timer = (LWIP_RAND() % (max_time - 1)) + 1;
! }
#else /* LWIP_RAND */
/* ATTENTION: use this only if absolutely necessary! */
group->timer = max_time / 2;
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users