netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv4: Fix table id reference in fib_sync_down_addr
@ 2019-11-07 18:29 David Ahern
  2019-11-08  0:15 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2019-11-07 18:29 UTC (permalink / raw)
  To: netdev; +Cc: hd, mark.tomlinson, David Ahern

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")
Reported-by: Hendrik Donner <hd@os-cillation.de>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
 net/ipv4/fib_semantics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 0913a090b2bf..f1888c683426 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -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)
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ipv4: Fix table id reference in fib_sync_down_addr
  2019-11-07 18:29 [PATCH net] ipv4: Fix table id reference in fib_sync_down_addr David Ahern
@ 2019-11-08  0:15 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-11-08  0:15 UTC (permalink / raw)
  To: dsahern; +Cc: netdev, hd, mark.tomlinson

From: David Ahern <dsahern@kernel.org>
Date: Thu,  7 Nov 2019 18:29:52 +0000

> 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")
> Reported-by: Hendrik Donner <hd@os-cillation.de>
> Signed-off-by: David Ahern <dsahern@kernel.org>

Applied and queued up for -stable, thanks David.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-08  0:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 18:29 [PATCH net] ipv4: Fix table id reference in fib_sync_down_addr David Ahern
2019-11-08  0:15 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).