Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: ipv6: Preserve link scope traffic original oif

When ip6_route_me_harder is invoked, it resets outgoing interface of:
- link-local scoped packets sent by neighbor discovery
- multicast packets sent by MLD host
- multicast packets send by MLD proxy daemon that sets outgoing
interface through IPV6_PKTINFO ipi6_ifindex

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

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Alin Nastac and committed by
Pablo Neira Ayuso
508b0904 89259088

+2 -1
+2 -1
net/ipv6/netfilter.c
··· 24 24 unsigned int hh_len; 25 25 struct dst_entry *dst; 26 26 struct flowi6 fl6 = { 27 - .flowi6_oif = sk ? sk->sk_bound_dev_if : 0, 27 + .flowi6_oif = sk && sk->sk_bound_dev_if ? sk->sk_bound_dev_if : 28 + rt6_need_strict(&iph->daddr) ? skb_dst(skb)->dev->ifindex : 0, 28 29 .flowi6_mark = skb->mark, 29 30 .flowi6_uid = sock_net_uid(net, sk), 30 31 .daddr = iph->daddr,