Skip to content

Commit e7d58d5

Browse files
ip6: fix ip6 address deletion
We couldn't add a previously added IPv6 on an interface, either through the command line, or for link local ip when we add/delete/add an interface. In rib6_cleanup, call rib6_delete with the prefixlen instead of the max prefix. Add these checks in the existing test. Signed-off-by: Christophe Fontaine <[email protected]>
1 parent 50aec94 commit e7d58d5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

modules/ip6/control/route.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ void rib6_cleanup(struct nexthop *nh) {
393393
struct rte_rib6 *rib;
394394
uintptr_t nh_id;
395395

396-
rib6_delete(nh->vrf_id, nh->iface_id, &nh->ipv6, RTE_IPV6_MAX_DEPTH);
396+
rib6_delete(nh->vrf_id, nh->iface_id, &nh->ipv6, nh->prefixlen);
397397
local_ip = nh->ipv6;
398398
local_depth = nh->prefixlen;
399399

smoke/ip6_add_del_test.sh

+4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66

77
p0=${run_id}0
88

9+
grcli add interface port $p0 devargs net_tap0,iface=$p0 mac f0:0d:ac:dc:00:00
10+
grcli del interface $p0
911
grcli add interface port $p0 devargs net_tap0,iface=$p0 mac f0:0d:ac:dc:00:00
1012

1113
grcli add ip6 address 2001::1/64 iface $p0
1214
grcli show ip6 address
1315
grcli del ip6 address 2001::1/64 iface $p0
1416
grcli show ip6 address
17+
grcli add ip6 address 2001::1/64 iface $p0
18+
grcli show ip6 address

0 commit comments

Comments
 (0)