diff options
author | Nicolas Cavallari <nicolas.cavallari@green-communications.fr> | 2014-10-30 10:09:53 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-14 10:10:21 -0800 |
commit | 86449f087b4c5f77afd9b86c6e1d5d121754d583 (patch) | |
tree | 017510a3b5cfa1ae753f2c0049d965666bd32617 /net | |
parent | 8400be4d70d0894447986843b509d3c2cf50257c (diff) |
ipv4: Do not cache routing failures due to disabled forwarding.
[ Upstream commit fa19c2b050ab5254326f5fc07096dd3c6a8d5d58 ]
If we cache them, the kernel will reuse them, independently of
whether forwarding is enabled or not. Which means that if forwarding is
disabled on the input interface where the first routing request comes
from, then that unreachable result will be cached and reused for
other interfaces, even if forwarding is enabled on them. The opposite
is also true.
This can be verified with two interfaces A and B and an output interface
C, where B has forwarding enabled, but not A and trying
ip route get $dst iif A from $src && ip route get $dst iif B from $src
Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
Reviewed-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/route.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index cbadb942c332..29836f8f86a6 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1798,6 +1798,7 @@ local_input: no_route: RT_CACHE_STAT_INC(in_no_route); res.type = RTN_UNREACHABLE; + res.fi = NULL; goto local_input; /* |