From 0ead10e79a1c5b0bd36947778a6bfd4925b9e898 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 13 Aug 2021 21:30:31 +0200 Subject: [PATCH] gnrc_ipv6_nib: handle route information option with ltime = 0 --- sys/net/gnrc/network_layer/ipv6/nib/nib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib.c b/sys/net/gnrc/network_layer/ipv6/nib/nib.c index d5ca625d03cd..c70886d5624f 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/nib.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/nib.c @@ -1633,8 +1633,12 @@ static uint32_t _handle_rio(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6, (UINT32_MAX - 1) : route_ltime * MS_PER_SEC; } - gnrc_ipv6_nib_ft_add(&rio->prefix, rio->prefix_len, &ipv6->src, - netif->pid, route_ltime); + if (route_ltime == 0) { + gnrc_ipv6_nib_ft_del(&rio->prefix, rio->prefix_len); + } else { + gnrc_ipv6_nib_ft_add(&rio->prefix, rio->prefix_len, &ipv6->src, + netif->pid, route_ltime); + } return route_ltime; }