netfilter: netns: fix {ip,6}_route_me_harder() in netns
Take netns from skb->dst->dev. It should be safe because, they are called from LOCAL_OUT hook where dst is valid (though, I'm not exactly sure about IPVS and queueing packets to userspace). [Patrick: its safe everywhere since they already expect skb->dst to be set] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
committed by
Patrick McHardy
parent
400dad39d1
commit
b21f890193
@@ -23,7 +23,7 @@ int ip6_route_me_harder(struct sk_buff *skb)
|
||||
.saddr = iph->saddr, } },
|
||||
};
|
||||
|
||||
dst = ip6_route_output(&init_net, skb->sk, &fl);
|
||||
dst = ip6_route_output(dev_net(skb->dst->dev), skb->sk, &fl);
|
||||
|
||||
#ifdef CONFIG_XFRM
|
||||
if (!(IP6CB(skb)->flags & IP6SKB_XFRM_TRANSFORMED) &&
|
||||
|
Reference in New Issue
Block a user