udp_tunnel: Pass UDP socket down through udp_tunnel{, 6}_xmit_skb().
That was we can make sure the output path of ipv4/ipv6 operate on the UDP socket rather than whatever random thing happens to be in skb->sk. Based upon a patch by Jiri Pirko. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
This commit is contained in:

committed by
David S. Miller

parent
7026b1ddb6
commit
79b16aadea
@@ -75,7 +75,7 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(setup_udp_tunnel_sock);
|
||||
|
||||
int udp_tunnel_xmit_skb(struct rtable *rt, struct sk_buff *skb,
|
||||
int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb,
|
||||
__be32 src, __be32 dst, __u8 tos, __u8 ttl,
|
||||
__be16 df, __be16 src_port, __be16 dst_port,
|
||||
bool xnet, bool nocheck)
|
||||
@@ -92,7 +92,7 @@ int udp_tunnel_xmit_skb(struct rtable *rt, struct sk_buff *skb,
|
||||
|
||||
udp_set_csum(nocheck, skb, src, dst, skb->len);
|
||||
|
||||
return iptunnel_xmit(skb->sk, rt, skb, src, dst, IPPROTO_UDP,
|
||||
return iptunnel_xmit(sk, rt, skb, src, dst, IPPROTO_UDP,
|
||||
tos, ttl, df, xnet);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(udp_tunnel_xmit_skb);
|
||||
|
Reference in New Issue
Block a user