[3.16.y-ckt extended stable] Patch "ipv4: Do not cache routing failures due to disabled forwarding." has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Nov 10 11:32:24 UTC 2014


This is a note to let you know that I have just added a patch titled

    ipv4: Do not cache routing failures due to disabled forwarding.

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt1.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 78c36d5588ca7f1828b6c28fe8da724ae591592c Mon Sep 17 00:00:00 2001
From: Nicolas Cavallari <nicolas.cavallari at green-communications.fr>
Date: Thu, 30 Oct 2014 10:09:53 +0100
Subject: ipv4: Do not cache routing failures due to disabled forwarding.

commit fa19c2b050ab5254326f5fc07096dd3c6a8d5d58 upstream.

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 at green-communications.fr>
Reviewed-by: Julian Anastasov <ja at ssi.bg>
Signed-off-by: David S. Miller <davem at davemloft.net>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 net/ipv4/route.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 4b340c30a037..ca0d8cca21dc 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;
 	if (err == -ESRCH)
 		err = -ENETUNREACH;
 	goto local_input;
--
2.1.0





More information about the kernel-team mailing list