Skip to content

Commit 9a6e4e0

Browse files
author
Mika Tervonen
committed
disable multicast NS for wisun
1 parent 6e13d81 commit 9a6e4e0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,21 @@ uint16_t ws_etx_read(protocol_interface_info_entry_t *interface, addrtype_t addr
685685
//tr_debug("ws_etx_read etx:%d", etx);
686686
return etx;
687687
}
688+
bool ws_bootstrap_nd_ns_transmit(protocol_interface_info_entry_t *cur, ipv6_neighbour_t *entry, bool unicast, uint8_t seq)
689+
{
690+
(void)cur;
691+
(void)seq;
692+
693+
if (unicast) {
694+
// Unicast NS is OK
695+
return false;
696+
}
697+
// Fail the resolution
698+
tr_warn("Link address lost for %s", trace_ipv6(entry->ip_address));
699+
ipv6_neighbour_entry_remove(&cur->ipv6_neighbour_cache, entry);
700+
// True means we skip the message sending
701+
return true;
702+
}
688703

689704
static int8_t ws_bootstrap_up(protocol_interface_info_entry_t *cur)
690705
{
@@ -728,6 +743,9 @@ static int8_t ws_bootstrap_up(protocol_interface_info_entry_t *cur)
728743
/* Disable NUD Probes */
729744
cur->ipv6_neighbour_cache.send_nud_probes = false;
730745
cur->ipv6_neighbour_cache.probe_avoided_routers = true;
746+
/*Replace NS handler to disable multicast address queries */
747+
cur->if_ns_transmit = ws_bootstrap_nd_ns_transmit;
748+
731749
dhcp_client_init(cur->id);
732750
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.
733751
dhcp_client_solicit_timeout_set(cur->id, WS_DHCP_SOLICIT_TIMEOUT, WS_DHCP_SOLICIT_MAX_RT, WS_DHCP_SOLICIT_MAX_RC);

0 commit comments

Comments
 (0)