fix(lwip): fix LwIP IPv6 maxresp calculation error

When recieving the IPv6 ICMP multicast listener query message, system will crash.
This commit is contained in:
dongheng
2019-08-14 10:32:21 +08:00
parent b9bb3c4ab2
commit ed03e868a5
2 changed files with 4 additions and 1 deletions

Binary file not shown.

View File

@ -499,7 +499,10 @@ mld6_delayed_report(struct mld_group *group, u16_t maxresp)
#ifdef LWIP_RAND
/* Randomize maxresp. (if LWIP_RAND is supported) */
maxresp = (LWIP_RAND() % (maxresp - 1)) + 1;
maxresp = LWIP_RAND() % maxresp;
if (maxresp == 0) {
maxresp = 1;
}
#endif /* LWIP_RAND */
/* Apply timer value if no report has been scheduled already. */