1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc/ipv6_auto_subnets: bail out early if adding prefix fails

This commit is contained in:
Benjamin Valentin 2022-03-29 15:54:15 +02:00
parent 3993fd75d0
commit 5785856fe7

View File

@ -306,6 +306,10 @@ static void _configure_subnets(uint8_t subnets, uint8_t start_idx, gnrc_netif_t
/* configure subnet on downstream interface */
idx = gnrc_netif_ipv6_add_prefix(downstream, &new_prefix, new_prefix_len,
valid_ltime, pref_ltime);
if (idx < 0) {
DEBUG("auto_subnets: adding prefix to %u failed\n", downstream->pid);
continue;
}
/* start advertising subnet */
gnrc_ipv6_nib_change_rtr_adv_iface(downstream, true);
@ -320,9 +324,7 @@ static void _configure_subnets(uint8_t subnets, uint8_t start_idx, gnrc_netif_t
}
/* configure RPL root if applicable */
if (idx >= 0) {
gnrc_rpl_configure_root(downstream, &downstream->ipv6.addrs[idx]);
}
gnrc_rpl_configure_root(downstream, &downstream->ipv6.addrs[idx]);
}
/* immediately send an RA with RIO */