From 9a6e4e0079a93d0b6169d7c93ea636426fc7ab2c Mon Sep 17 00:00:00 2001 From: Mika Tervonen Date: Fri, 14 Jun 2019 11:44:08 +0300 Subject: [PATCH] disable multicast NS for wisun --- source/6LoWPAN/ws/ws_bootstrap.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/6LoWPAN/ws/ws_bootstrap.c b/source/6LoWPAN/ws/ws_bootstrap.c index ab5459c82ba..f8be05c4625 100644 --- a/source/6LoWPAN/ws/ws_bootstrap.c +++ b/source/6LoWPAN/ws/ws_bootstrap.c @@ -685,6 +685,21 @@ uint16_t ws_etx_read(protocol_interface_info_entry_t *interface, addrtype_t addr //tr_debug("ws_etx_read etx:%d", etx); return etx; } +bool ws_bootstrap_nd_ns_transmit(protocol_interface_info_entry_t *cur, ipv6_neighbour_t *entry, bool unicast, uint8_t seq) +{ + (void)cur; + (void)seq; + + if (unicast) { + // Unicast NS is OK + return false; + } + // Fail the resolution + tr_warn("Link address lost for %s", trace_ipv6(entry->ip_address)); + ipv6_neighbour_entry_remove(&cur->ipv6_neighbour_cache, entry); + // True means we skip the message sending + return true; +} static int8_t ws_bootstrap_up(protocol_interface_info_entry_t *cur) { @@ -728,6 +743,9 @@ static int8_t ws_bootstrap_up(protocol_interface_info_entry_t *cur) /* Disable NUD Probes */ cur->ipv6_neighbour_cache.send_nud_probes = false; cur->ipv6_neighbour_cache.probe_avoided_routers = true; + /*Replace NS handler to disable multicast address queries */ + cur->if_ns_transmit = ws_bootstrap_nd_ns_transmit; + dhcp_client_init(cur->id); dhcp_client_configure(cur->id, true, true, true); //RENEW uses SOLICIT, Interface will use 1 instance for address get, IAID address hint is not used. dhcp_client_solicit_timeout_set(cur->id, WS_DHCP_SOLICIT_TIMEOUT, WS_DHCP_SOLICIT_MAX_RT, WS_DHCP_SOLICIT_MAX_RC);