* [net PATCH] ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules
@ 2017-01-02 21:32 Alexander Duyck
2017-01-03 14:39 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Duyck @ 2017-01-02 21:32 UTC (permalink / raw)
To: netdev, jjk, davem, dsa
From: Alexander Duyck <alexander.h.duyck@intel.com>
In the case of custom rules being present we need to handle the case of the
LOCAL table being intialized after the new rule has been added. To address
that I am adding a new check so that we can make certain we don't use an
alias of MAIN for LOCAL when allocating a new table.
Fixes: 0ddcf43d5d4a ("ipv4: FIB Local/MAIN table collapse")
Reported-by: Oliver Brunel <jjk@jjacky.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
net/ipv4/fib_frontend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 3ff8938893ec..eae0332b0e8c 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -85,7 +85,7 @@ struct fib_table *fib_new_table(struct net *net, u32 id)
if (tb)
return tb;
- if (id == RT_TABLE_LOCAL)
+ if (id == RT_TABLE_LOCAL && !net->ipv4.fib_has_custom_rules)
alias = fib_new_table(net, RT_TABLE_MAIN);
tb = fib_trie_table(id, alias);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net PATCH] ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules
2017-01-02 21:32 [net PATCH] ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules Alexander Duyck
@ 2017-01-03 14:39 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-01-03 14:39 UTC (permalink / raw)
To: alexander.duyck; +Cc: netdev, jjk, dsa
From: Alexander Duyck <alexander.duyck@gmail.com>
Date: Mon, 02 Jan 2017 13:32:54 -0800
> From: Alexander Duyck <alexander.h.duyck@intel.com>
>
> In the case of custom rules being present we need to handle the case of the
> LOCAL table being intialized after the new rule has been added. To address
> that I am adding a new check so that we can make certain we don't use an
> alias of MAIN for LOCAL when allocating a new table.
>
> Fixes: 0ddcf43d5d4a ("ipv4: FIB Local/MAIN table collapse")
> Reported-by: Oliver Brunel <jjk@jjacky.com>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Applied and queued up for -stable, thanks Alex.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-03 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-02 21:32 [net PATCH] ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules Alexander Duyck
2017-01-03 14:39 ` 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).