diff options
author | Julian Anastasov <ja@ssi.bg> | 2014-04-28 03:51:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-28 14:47:03 -0400 |
commit | e374c618b1465f0292047a9f4c244bd71ab5f1f0 (patch) | |
tree | b6eab50bf0d9bf655128edf7f13c5359c806a215 | |
parent | 8c2eab9097dba50bcd73ed4632baccc3f34857f9 (diff) |
net: ipv6: more places need LOOPBACK_IFINDEX for flowi6_iif
To properly match iif in ip rules we have to provide
LOOPBACK_IFINDEX in flowi6_iif, not 0. Some ip6mr_fib_lookup
and fib6_rule_lookup callers need such fix.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/ip6mr.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_rpfilter.c | 1 | ||||
-rw-r--r-- | net/ipv6/route.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 8659067da28e..8250474ab7dc 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -1633,7 +1633,7 @@ struct sock *mroute6_socket(struct net *net, struct sk_buff *skb) | |||
1633 | { | 1633 | { |
1634 | struct mr6_table *mrt; | 1634 | struct mr6_table *mrt; |
1635 | struct flowi6 fl6 = { | 1635 | struct flowi6 fl6 = { |
1636 | .flowi6_iif = skb->skb_iif, | 1636 | .flowi6_iif = skb->skb_iif ? : LOOPBACK_IFINDEX, |
1637 | .flowi6_oif = skb->dev->ifindex, | 1637 | .flowi6_oif = skb->dev->ifindex, |
1638 | .flowi6_mark = skb->mark, | 1638 | .flowi6_mark = skb->mark, |
1639 | }; | 1639 | }; |
diff --git a/net/ipv6/netfilter/ip6t_rpfilter.c b/net/ipv6/netfilter/ip6t_rpfilter.c index e0983f3648a6..790e0c6b19e1 100644 --- a/net/ipv6/netfilter/ip6t_rpfilter.c +++ b/net/ipv6/netfilter/ip6t_rpfilter.c | |||
@@ -33,6 +33,7 @@ static bool rpfilter_lookup_reverse6(const struct sk_buff *skb, | |||
33 | struct ipv6hdr *iph = ipv6_hdr(skb); | 33 | struct ipv6hdr *iph = ipv6_hdr(skb); |
34 | bool ret = false; | 34 | bool ret = false; |
35 | struct flowi6 fl6 = { | 35 | struct flowi6 fl6 = { |
36 | .flowi6_iif = LOOPBACK_IFINDEX, | ||
36 | .flowlabel = (* (__be32 *) iph) & IPV6_FLOWINFO_MASK, | 37 | .flowlabel = (* (__be32 *) iph) & IPV6_FLOWINFO_MASK, |
37 | .flowi6_proto = iph->nexthdr, | 38 | .flowi6_proto = iph->nexthdr, |
38 | .daddr = iph->saddr, | 39 | .daddr = iph->saddr, |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 4011617cca68..004fffb6c221 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1273,6 +1273,7 @@ void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark) | |||
1273 | struct flowi6 fl6; | 1273 | struct flowi6 fl6; |
1274 | 1274 | ||
1275 | memset(&fl6, 0, sizeof(fl6)); | 1275 | memset(&fl6, 0, sizeof(fl6)); |
1276 | fl6.flowi6_iif = LOOPBACK_IFINDEX; | ||
1276 | fl6.flowi6_oif = oif; | 1277 | fl6.flowi6_oif = oif; |
1277 | fl6.flowi6_mark = mark; | 1278 | fl6.flowi6_mark = mark; |
1278 | fl6.daddr = iph->daddr; | 1279 | fl6.daddr = iph->daddr; |
@@ -1294,6 +1295,7 @@ void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif, | |||
1294 | struct flowi6 fl6; | 1295 | struct flowi6 fl6; |
1295 | 1296 | ||
1296 | memset(&fl6, 0, sizeof(fl6)); | 1297 | memset(&fl6, 0, sizeof(fl6)); |
1298 | fl6.flowi6_iif = LOOPBACK_IFINDEX; | ||
1297 | fl6.flowi6_oif = oif; | 1299 | fl6.flowi6_oif = oif; |
1298 | fl6.flowi6_mark = mark; | 1300 | fl6.flowi6_mark = mark; |
1299 | fl6.daddr = msg->dest; | 1301 | fl6.daddr = msg->dest; |