Skip to contentSkip to conversation

ipv6: Preserve link scope traffic original oif

PATCH New Alin Nastac 1 participant 1 message Mar 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: Preserve link scope traffic original oif

Link-local and multicast packets must keep their original oif after ip6_route_me_harder is called.

---
 net/ipv6/netfilter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/netfilter.c +2 -1
index 39970e2..02811c5 100644
@@ -24,7 +24,8 @@ int ip6_route_me_harder(struct net *net, struct sk_buff *skb)
 	unsigned int hh_len;
 	struct dst_entry *dst;
 	struct flowi6 fl6 = {
-		.flowi6_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0,
+		.flowi6_oif = skb->sk ? skb->sk->sk_bound_dev_if :
+			rt6_need_strict(&iph->daddr) ? skb_dst(skb)->dev->ifindex : 0,
 		.flowi6_mark = skb->mark,
 		.flowi6_uid = sock_net_uid(net, skb->sk),
 		.daddr = iph->daddr,
Signature · 1 line
1.7.12.4