net/lwip: add exception for NS message
Silently discard the multicast NS message without src address.
@@ -385,6 +385,13 @@ void nd6_input(struct pbuf *p, struct netif *inp)
/* Check for ANY address in src (DAD algorithm). */
if (ip6_addr_isany(ip6_current_src_addr())) {
+ if (ip6_addr_ismulticast(ip6_current_dest_addr())) {
+ /* @todo debug message */
+ pbuf_free(p);
+ ND6_STATS_INC(nd6.lenerr);
+ ND6_STATS_INC(nd6.drop);
+ return;
+ } else {
/* Sender is validating this address. */
for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) {
if (!ip6_addr_isinvalid(netif_ip6_addr_state(inp, i)) && ip6_addr_cmp(&(ns_hdr->target_address), netif_ip6_addr(inp, i))) {
@@ -396,6 +403,7 @@ void nd6_input(struct pbuf *p, struct netif *inp)
}
}
}
+ }
} else {
ip6_addr_t target_address;
