Skip to content

Commit

Permalink
disable multicast NS for wisun
Browse files Browse the repository at this point in the history
  • Loading branch information
Mika Tervonen committed Jun 14, 2019
1 parent 6e13d81 commit 9a6e4e0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9a6e4e0

Please sign in to comment.