fix bug #53971 Lwip sends Router Solicitation on address changes

... and add a unit test for it.

Moved resetting netif->rs_count from all reports to link-up and netif-up only.
While at it, clean up the interface a bit so that netif->rs_count is touched
from nd6.c only.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
Simon Goldschmidt
2018-06-08 22:18:50 +02:00
parent d4845abac6
commit fd050b8a97
6 changed files with 202 additions and 7 deletions

View File

@@ -2405,4 +2405,14 @@ nd6_adjust_mld_membership(struct netif *netif, s8_t addr_idx, u8_t new_state)
}
#endif /* LWIP_IPV6_MLD */
/** Netif was added, set up, or reconnected (link up) */
void
nd6_restart_netif(struct netif *netif)
{
#if LWIP_IPV6_SEND_ROUTER_SOLICIT
/* Send Router Solicitation messages (see RFC 4861, ch. 6.3.7). */
netif->rs_count = LWIP_ND6_MAX_MULTICAST_SOLICIT;
#endif /* LWIP_IPV6_SEND_ROUTER_SOLICIT */
}
#endif /* LWIP_IPV6 */