]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: Do not cache routing failures due to disabled forwarding.
authorNicolas Cavallari <nicolas.cavallari@green-communications.fr>
Thu, 30 Oct 2014 09:09:53 +0000 (10:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Oct 2014 23:20:40 +0000 (19:20 -0400)
commit42c9f04b86900e503f2ac16d139d8cdd1efc36dc
tree17263248a697a04a00ac4b128df7ed4c34287ba2
parent6dc27c5dba4b7b65f03dd88de37a5d49748d3987
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