[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-head
Subject:    ipv4: Do not cache routing failures due to disabled forwarding.
From:       "Linux Kernel Mailing List" <linux-kernel () vger ! kernel ! org>
Date:       2014-10-31 22:19:57
Message-ID: 20141031221957.1475B661107 () gitolite ! kernel ! org
[Download RAW message or body]

Gitweb:     http://git.kernel.org/linus/;a=commit;h=fa19c2b050ab5254326f5fc07096dd3c6a8d5d58
Commit:     fa19c2b050ab5254326f5fc07096dd3c6a8d5d58
Parent:     e327c225c911529898ec300cb96d2088893de3df
Refname:    refs/heads/master
Author:     Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
AuthorDate: Thu Oct 30 10:09:53 2014 +0100
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Thu Oct 30 19:20:40 2014 -0400

    ipv4: Do not cache routing failures due to disabled forwarding.
    
    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>
---
 net/ipv4/route.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 2d4ae46..6a2155b 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;
 
 	/*
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic