-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGMP - Timer bug in igmp_start_timer() #3498
Comments
Using os_random() instead of r_randr() is the best solution I've found. PR submitted #3499 |
Thanks for merging the PR! |
Is it possible for someone to provide some symptoms of the fault this fixed if possible? |
The symptom was that devices would stop receiving multicast traffic after a while if associated with an AP that had IGMP snooping enabled. I noticed it while testing a 720 pixel matrix being driven via multicast in my ESPixelStick project - https://github.com/forkineye/ESPixelStick. I tested the fix for 48hrs streaming E1.31 data at 50ms refresh rates. |
Issue
igmp_start_timer() sometimes assigns excessive times to group->timer, causing IGMP memberships to expire. The problem is related to the usage of
r_rand()
via theLWIP_RAND()
macro in the following function: https://github.com/esp8266/Arduino/blob/master/tools/sdk/lwip/src/core/ipv4/igmp.c#L703.group->timer
should never exceed 100. Debug output in the function produces the following:Fix
Assigning the output of
LWIP_RAND()
to auint32_t
variable and using that in place for the modulus fixes the issue.Also, using RANDOM_REG32 in place of r_rand() works as well:
Not sure why its breaking as is, but the above two fixes work for me.
The text was updated successfully, but these errors were encountered: