From 99d992cac3e9d7614ba30ac75f6df35adb59f2e1 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Tue, 18 Sep 2018 10:37:25 +0800 Subject: [PATCH] fix the bug that IPv6 TCP connection fail The code didn't create an new mld group when netif is up, this will lead to the server can't find the matching netif when receiving NS(neighbor solicitation) packet --- src/core/ipv6/nd6.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c index 91cd4ed9..0b03ee84 100644 --- a/src/core/ipv6/nd6.c +++ b/src/core/ipv6/nd6.c @@ -890,6 +890,15 @@ nd6_tmr(void) #endif /* @todo implement preferred and valid lifetimes. */ } else if (netif->flags & NETIF_FLAG_UP) { +#if ESP_LWIP +#if LWIP_IPV6_MLD + if ((netif_ip6_addr_state(netif, i) & IP6_ADDR_TENTATIVE_COUNT_MASK) == 0) { + /* Join solicited node multicast group. */ + ip6_addr_set_solicitednode(&multicast_address, netif_ip6_addr(netif, i)->addr[3]); + mld6_joingroup(netif_ip6_addr(netif, i), &multicast_address); + } +#endif /* LWIP_IPV6_MLD */ +#endif /* Send a NS for this address. */ nd6_send_ns(netif, netif_ip6_addr(netif, i), ND6_SEND_FLAG_MULTICAST_DEST); /* tentative: set next state by increasing by one */