Skip to contentSkip to conversation

ipv4: Fix table id reference in fib_sync_down_addr

PATCH In review David Ahern 2 participants 2 messages Nov 7, 2019 – Nov 8, 2019

Subsystems (3)
lore
Share & tools
lore

David Ahern

author maintainer
#0 lore raw

PATCH 1/1 ipv4: Fix table id reference in fib_sync_down_addr

Hendrik reported routes in the main table using source address are not removed when the address is removed. The problem is that fib_sync_down_addr does not account for devices in the default VRF which are associated with the main table. Fix by updating the table id reference.

Fixes 5a56a0b3a45d ("net: Don't delete routes in different VRFs")
---
 net/ipv4/fib_semantics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/fib_semantics.c +1 -1
index 0913a090b2bf..f1888c683426 100644
@@ -1814,8 +1814,8 @@ int fib_sync_down_addr(struct net_device *dev, __be32 local)
 	int ret = 0;
 	unsigned int hash = fib_laddr_hashfn(local);
 	struct hlist_head *head = &fib_info_laddrhash[hash];
+	int tb_id = l3mdev_fib_table(dev) ? : RT_TABLE_MAIN;
 	struct net *net = dev_net(dev);
-	int tb_id = l3mdev_fib_table(dev);
 	struct fib_info *fi;
 
 	if (!fib_info_laddrhash || local == 0)
Signature · 1 line
2.21.0
maintainer
#1 lore raw

From: David Ahern <[email protected]>
Date: Thu, 7 Nov 2019 18:29:52 +0000

Quoted 8 lines

Hendrik reported routes in the main table using source address are not removed when the address is removed. The problem is that fib_sync_down_addr does not account for devices in the default VRF which are associated with the main table. Fix by updating the table id reference.

Fixes 5a56a0b3a45d ("net: Don't delete routes in different VRFs")

Applied and queued up for -stable, thanks David.