Skip to content

Commit

Permalink
Wi-SUN Neighbour ARO registration failure handling update:
Browse files Browse the repository at this point in the history
Node only black list when status is ARO_FULL othetwise neighbour
and RPL candidate is removed.
  • Loading branch information
Juha Heiuskanen committed Jan 14, 2021
1 parent 1e1f9c6 commit fde325e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
8 changes: 7 additions & 1 deletion source/6LoWPAN/ws/ws_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,16 @@ void ws_common_neighbor_update(protocol_interface_info_entry_t *cur, const uint8
}
}

void ws_common_black_list_neighbour(const uint8_t *ll_address, uint8_t nd_status)
{
if (nd_status == ARO_FULL) {
blacklist_update(ll_address, false);
}
}

void ws_common_aro_failure(protocol_interface_info_entry_t *cur, const uint8_t *ll_address)
{
tr_warn("ARO registration Failure %s", trace_ipv6(ll_address));
blacklist_update(ll_address, false);
ws_bootstrap_aro_failure(cur, ll_address);
}

Expand Down
3 changes: 3 additions & 0 deletions source/6LoWPAN/ws/ws_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ void ws_common_fast_timer(protocol_interface_info_entry_t *cur, uint16_t ticks);

void ws_common_neighbor_update(protocol_interface_info_entry_t *cur, const uint8_t *ll_address);

void ws_common_black_list_neighbour(const uint8_t *ll_address, uint8_t nd_status);

void ws_common_aro_failure(protocol_interface_info_entry_t *cur, const uint8_t *ll_address);

void ws_common_neighbor_remove(protocol_interface_info_entry_t *cur, const uint8_t *ll_address);
Expand All @@ -176,6 +178,7 @@ uint8_t ws_common_temporary_entry_size(uint8_t mac_table_size);
#define ws_info(cur) ((ws_info_t *) NULL)
#define ws_common_seconds_timer(cur, seconds)
#define ws_common_neighbor_update(cur, ll_address) ((void) 0)
#define ws_common_black_list_neighbour(ll_address, nd_status) ((void) 0)
#define ws_common_aro_failure(cur, ll_address)
#define ws_common_neighbor_remove(cur, ll_address)
#define ws_common_fast_timer(cur, ticks) ((void) 0)
Expand Down
3 changes: 2 additions & 1 deletion source/Common_Protocols/icmpv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ static void icmpv6_na_wisun_aro_handler(protocol_interface_info_entry_t *cur_int

(void)life_time;
if (nd_status != ARO_SUCCESS) {
ws_common_black_list_neighbour(src_addr, nd_status);
ws_common_aro_failure(cur_interface, src_addr);
}
}
Expand Down Expand Up @@ -1447,7 +1448,7 @@ static void icmpv6_aro_cb(buffer_t *buf, uint8_t status)
ll_address[8] ^= 2;
}
if (rpl_control_address_register_done(buf->interface, ll_address, status)) {
// When RPL returns true neighbor should be blacklisted
// When RPL returns true neighbor should be deleted
ws_common_aro_failure(buf->interface, ll_address);
}
}
Expand Down
7 changes: 7 additions & 0 deletions test/nanostack/unittest/stub/ws_common_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ uint8_t ws_common_allow_child_registration(protocol_interface_info_entry_t *inte
(void) interface;
return 0;
}

void ws_common_black_list_neighbour(const uint8_t *ll_address, uint8_t nd_status)
{
(void) ll_address;
(void) nd_status;
}

void ws_common_aro_failure(protocol_interface_info_entry_t *cur, const uint8_t *ll_address)
{
(void) cur;
Expand Down

0 comments on commit fde325e

Please sign in to comment.