aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid McCullough <david_mccullough@mcafee.com>2012-06-25 11:42:26 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-26 02:54:32 -0400
commit4dc27d1cf3b3027b9ce654221c559e88b2f41b33 (patch)
tree2f7d6b83a4cca199ac78ee98cc8769d25a012ed6 /net/ipv6
parent91fa0cbc0c47930f771bf5425109956cc99c6b0b (diff)
net/ipv6/route.c: packets originating on device match lo
Fix to allow IPv6 packets originating locally to match rules with the "iff" set to "lo". This allows IPv6 rule matching work the same as it does for IPv4. From the iproute2 man page: iif NAME select the incoming device to match. If the interface is loop‐ back, the rule only matches packets originating from this host. This means that you may create separate routing tables for for‐ warded and local packets and, hence, completely segregate them. Signed-off-by: David McCullough <david_mccullough@mcafee.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/route.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c5bbece7f9f2..c518e4ec0cea 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -937,6 +937,8 @@ struct dst_entry * ip6_route_output(struct net *net, const struct sock *sk,
937{ 937{
938 int flags = 0; 938 int flags = 0;
939 939
940 fl6->flowi6_iif = net->loopback_dev->ifindex;
941
940 if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr)) 942 if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr))
941 flags |= RT6_LOOKUP_F_IFACE; 943 flags |= RT6_LOOKUP_F_IFACE;
942 944