Skip to content

Commit 68c3d7b

Browse files
author
Juha Heiskanen
committed
Fix missing RPL Prefix Slaac delete handler.
Change-Id: Ifaaaaa15c09c8d26e33285fa23dace75601924c8
1 parent 588c385 commit 68c3d7b

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,16 +1859,21 @@ static void ws_rpl_prefix_callback(prefix_entry_t *prefix, void *handle, uint8_t
18591859
* from a prefix advertised by a parent.
18601860
*/
18611861
if (prefix->options & PIO_A) {
1862-
if (icmpv6_slaac_prefix_update(cur, prefix->prefix, prefix->prefix_len, prefix->lifetime, prefix->preftime) != 0) {
1863-
ipv6_interface_slaac_handler(cur, prefix->prefix, prefix->prefix_len, prefix->lifetime, prefix->preftime);
1864-
/*
1865-
* Give SLAAC addresses a different label and low precedence to indicate that
1866-
* they probably shouldn't be used for external traffic. SLAAC use in Wi-SUN is non-standard,
1867-
* and we use it for mesh-local traffic we should prefer any DHCP-assigned addresses
1868-
* for talking to the outside world
1869-
*
1870-
*/
1871-
addr_policy_table_add_entry(prefix->prefix, prefix->prefix_len, 2, WS_NON_PREFFRED_LABEL);
1862+
1863+
if (parent_link_local) {
1864+
if (icmpv6_slaac_prefix_update(cur, prefix->prefix, prefix->prefix_len, prefix->lifetime, prefix->preftime) != 0) {
1865+
ipv6_interface_slaac_handler(cur, prefix->prefix, prefix->prefix_len, prefix->lifetime, prefix->preftime);
1866+
/*
1867+
* Give SLAAC addresses a different label and low precedence to indicate that
1868+
* they probably shouldn't be used for external traffic. SLAAC use in Wi-SUN is non-standard,
1869+
* and we use it for mesh-local traffic we should prefer any DHCP-assigned addresses
1870+
* for talking to the outside world
1871+
*
1872+
*/
1873+
addr_policy_table_add_entry(prefix->prefix, prefix->prefix_len, 2, WS_NON_PREFFRED_LABEL);
1874+
}
1875+
} else {
1876+
icmpv6_slaac_prefix_update(cur, prefix->prefix, prefix->prefix_len, 0, 0);
18721877
}
18731878
} else if (prefix->prefix_len) {
18741879
// Create new address using DHCP

0 commit comments

Comments
 (0)