diff options
author | David Miller <davem@davemloft.net> | 2015-04-05 22:19:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-07 15:29:08 -0400 |
commit | 79b16aadea32cce077acbe9e229fcb58a7801687 (patch) | |
tree | 8cfacda45a2b3d12a3831511199a13d33f245890 | |
parent | 7026b1ddb6b8d4e6ee33dc2bd06c0ca8746fa7ab (diff) |
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>
-rw-r--r-- | drivers/net/vxlan.c | 14 | ||||
-rw-r--r-- | include/net/ip6_tunnel.h | 5 | ||||
-rw-r--r-- | include/net/ipv6.h | 1 | ||||
-rw-r--r-- | include/net/udp_tunnel.h | 5 | ||||
-rw-r--r-- | include/net/vxlan.h | 2 | ||||
-rw-r--r-- | net/ipv4/geneve.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_tunnel.c | 2 | ||||
-rw-r--r-- | net/ipv4/udp_tunnel.c | 4 | ||||
-rw-r--r-- | net/ipv6/ip6_gre.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_udp_tunnel.c | 5 | ||||
-rw-r--r-- | net/ipv6/output_core.c | 21 | ||||
-rw-r--r-- | net/openvswitch/vport-vxlan.c | 5 | ||||
-rw-r--r-- | net/tipc/udp_media.c | 6 |
14 files changed, 48 insertions, 28 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index b5fecb49a0c6..51baac725a48 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -1672,7 +1672,8 @@ static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, u32 vxflags, | |||
1672 | } | 1672 | } |
1673 | 1673 | ||
1674 | #if IS_ENABLED(CONFIG_IPV6) | 1674 | #if IS_ENABLED(CONFIG_IPV6) |
1675 | static int vxlan6_xmit_skb(struct dst_entry *dst, struct sk_buff *skb, | 1675 | static int vxlan6_xmit_skb(struct dst_entry *dst, struct sock *sk, |
1676 | struct sk_buff *skb, | ||
1676 | struct net_device *dev, struct in6_addr *saddr, | 1677 | struct net_device *dev, struct in6_addr *saddr, |
1677 | struct in6_addr *daddr, __u8 prio, __u8 ttl, | 1678 | struct in6_addr *daddr, __u8 prio, __u8 ttl, |
1678 | __be16 src_port, __be16 dst_port, | 1679 | __be16 src_port, __be16 dst_port, |
@@ -1748,7 +1749,7 @@ static int vxlan6_xmit_skb(struct dst_entry *dst, struct sk_buff *skb, | |||
1748 | 1749 | ||
1749 | skb_set_inner_protocol(skb, htons(ETH_P_TEB)); | 1750 | skb_set_inner_protocol(skb, htons(ETH_P_TEB)); |
1750 | 1751 | ||
1751 | udp_tunnel6_xmit_skb(dst, skb, dev, saddr, daddr, prio, | 1752 | udp_tunnel6_xmit_skb(dst, sk, skb, dev, saddr, daddr, prio, |
1752 | ttl, src_port, dst_port, | 1753 | ttl, src_port, dst_port, |
1753 | !!(vxflags & VXLAN_F_UDP_ZERO_CSUM6_TX)); | 1754 | !!(vxflags & VXLAN_F_UDP_ZERO_CSUM6_TX)); |
1754 | return 0; | 1755 | return 0; |
@@ -1758,7 +1759,7 @@ err: | |||
1758 | } | 1759 | } |
1759 | #endif | 1760 | #endif |
1760 | 1761 | ||
1761 | int vxlan_xmit_skb(struct rtable *rt, struct sk_buff *skb, | 1762 | int vxlan_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb, |
1762 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, | 1763 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, |
1763 | __be16 src_port, __be16 dst_port, | 1764 | __be16 src_port, __be16 dst_port, |
1764 | struct vxlan_metadata *md, bool xnet, u32 vxflags) | 1765 | struct vxlan_metadata *md, bool xnet, u32 vxflags) |
@@ -1827,7 +1828,7 @@ int vxlan_xmit_skb(struct rtable *rt, struct sk_buff *skb, | |||
1827 | 1828 | ||
1828 | skb_set_inner_protocol(skb, htons(ETH_P_TEB)); | 1829 | skb_set_inner_protocol(skb, htons(ETH_P_TEB)); |
1829 | 1830 | ||
1830 | return udp_tunnel_xmit_skb(rt, skb, src, dst, tos, | 1831 | return udp_tunnel_xmit_skb(rt, sk, skb, src, dst, tos, |
1831 | ttl, df, src_port, dst_port, xnet, | 1832 | ttl, df, src_port, dst_port, xnet, |
1832 | !(vxflags & VXLAN_F_UDP_CSUM)); | 1833 | !(vxflags & VXLAN_F_UDP_CSUM)); |
1833 | } | 1834 | } |
@@ -1882,6 +1883,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, | |||
1882 | struct vxlan_rdst *rdst, bool did_rsc) | 1883 | struct vxlan_rdst *rdst, bool did_rsc) |
1883 | { | 1884 | { |
1884 | struct vxlan_dev *vxlan = netdev_priv(dev); | 1885 | struct vxlan_dev *vxlan = netdev_priv(dev); |
1886 | struct sock *sk = vxlan->vn_sock->sock->sk; | ||
1885 | struct rtable *rt = NULL; | 1887 | struct rtable *rt = NULL; |
1886 | const struct iphdr *old_iph; | 1888 | const struct iphdr *old_iph; |
1887 | struct flowi4 fl4; | 1889 | struct flowi4 fl4; |
@@ -1961,7 +1963,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, | |||
1961 | md.vni = htonl(vni << 8); | 1963 | md.vni = htonl(vni << 8); |
1962 | md.gbp = skb->mark; | 1964 | md.gbp = skb->mark; |
1963 | 1965 | ||
1964 | err = vxlan_xmit_skb(rt, skb, fl4.saddr, | 1966 | err = vxlan_xmit_skb(rt, sk, skb, fl4.saddr, |
1965 | dst->sin.sin_addr.s_addr, tos, ttl, df, | 1967 | dst->sin.sin_addr.s_addr, tos, ttl, df, |
1966 | src_port, dst_port, &md, | 1968 | src_port, dst_port, &md, |
1967 | !net_eq(vxlan->net, dev_net(vxlan->dev)), | 1969 | !net_eq(vxlan->net, dev_net(vxlan->dev)), |
@@ -2021,7 +2023,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, | |||
2021 | md.vni = htonl(vni << 8); | 2023 | md.vni = htonl(vni << 8); |
2022 | md.gbp = skb->mark; | 2024 | md.gbp = skb->mark; |
2023 | 2025 | ||
2024 | err = vxlan6_xmit_skb(ndst, skb, dev, &fl6.saddr, &fl6.daddr, | 2026 | err = vxlan6_xmit_skb(ndst, sk, skb, dev, &fl6.saddr, &fl6.daddr, |
2025 | 0, ttl, src_port, dst_port, &md, | 2027 | 0, ttl, src_port, dst_port, &md, |
2026 | !net_eq(vxlan->net, dev_net(vxlan->dev)), | 2028 | !net_eq(vxlan->net, dev_net(vxlan->dev)), |
2027 | vxlan->flags); | 2029 | vxlan->flags); |
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 1668be5937e6..b8529aa1dae7 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
@@ -73,13 +73,14 @@ __u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr, | |||
73 | struct net *ip6_tnl_get_link_net(const struct net_device *dev); | 73 | struct net *ip6_tnl_get_link_net(const struct net_device *dev); |
74 | int ip6_tnl_get_iflink(const struct net_device *dev); | 74 | int ip6_tnl_get_iflink(const struct net_device *dev); |
75 | 75 | ||
76 | static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | 76 | static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb, |
77 | struct net_device *dev) | ||
77 | { | 78 | { |
78 | struct net_device_stats *stats = &dev->stats; | 79 | struct net_device_stats *stats = &dev->stats; |
79 | int pkt_len, err; | 80 | int pkt_len, err; |
80 | 81 | ||
81 | pkt_len = skb->len; | 82 | pkt_len = skb->len; |
82 | err = ip6_local_out(skb); | 83 | err = ip6_local_out_sk(sk, skb); |
83 | 84 | ||
84 | if (net_xmit_eval(err) == 0) { | 85 | if (net_xmit_eval(err) == 0) { |
85 | struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); | 86 | struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index b6ae959824ff..27470cd1d5f8 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -827,6 +827,7 @@ int ip6_input(struct sk_buff *skb); | |||
827 | int ip6_mc_input(struct sk_buff *skb); | 827 | int ip6_mc_input(struct sk_buff *skb); |
828 | 828 | ||
829 | int __ip6_local_out(struct sk_buff *skb); | 829 | int __ip6_local_out(struct sk_buff *skb); |
830 | int ip6_local_out_sk(struct sock *sk, struct sk_buff *skb); | ||
830 | int ip6_local_out(struct sk_buff *skb); | 831 | int ip6_local_out(struct sk_buff *skb); |
831 | 832 | ||
832 | /* | 833 | /* |
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h index 1a20d33d56bc..c491c1221606 100644 --- a/include/net/udp_tunnel.h +++ b/include/net/udp_tunnel.h | |||
@@ -77,13 +77,14 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock, | |||
77 | struct udp_tunnel_sock_cfg *sock_cfg); | 77 | struct udp_tunnel_sock_cfg *sock_cfg); |
78 | 78 | ||
79 | /* Transmit the skb using UDP encapsulation. */ | 79 | /* Transmit the skb using UDP encapsulation. */ |
80 | int udp_tunnel_xmit_skb(struct rtable *rt, struct sk_buff *skb, | 80 | int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb, |
81 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, | 81 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, |
82 | __be16 df, __be16 src_port, __be16 dst_port, | 82 | __be16 df, __be16 src_port, __be16 dst_port, |
83 | bool xnet, bool nocheck); | 83 | bool xnet, bool nocheck); |
84 | 84 | ||
85 | #if IS_ENABLED(CONFIG_IPV6) | 85 | #if IS_ENABLED(CONFIG_IPV6) |
86 | int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sk_buff *skb, | 86 | int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk, |
87 | struct sk_buff *skb, | ||
87 | struct net_device *dev, struct in6_addr *saddr, | 88 | struct net_device *dev, struct in6_addr *saddr, |
88 | struct in6_addr *daddr, | 89 | struct in6_addr *daddr, |
89 | __u8 prio, __u8 ttl, __be16 src_port, | 90 | __u8 prio, __u8 ttl, __be16 src_port, |
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 756e4636bad8..0082b5d33d7d 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h | |||
@@ -145,7 +145,7 @@ struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, | |||
145 | 145 | ||
146 | void vxlan_sock_release(struct vxlan_sock *vs); | 146 | void vxlan_sock_release(struct vxlan_sock *vs); |
147 | 147 | ||
148 | int vxlan_xmit_skb(struct rtable *rt, struct sk_buff *skb, | 148 | int vxlan_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb, |
149 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, | 149 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, |
150 | __be16 src_port, __be16 dst_port, struct vxlan_metadata *md, | 150 | __be16 src_port, __be16 dst_port, struct vxlan_metadata *md, |
151 | bool xnet, u32 vxflags); | 151 | bool xnet, u32 vxflags); |
diff --git a/net/ipv4/geneve.c b/net/ipv4/geneve.c index e64f8e9785d1..b77f5e84c623 100644 --- a/net/ipv4/geneve.c +++ b/net/ipv4/geneve.c | |||
@@ -136,7 +136,7 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt, | |||
136 | 136 | ||
137 | skb_set_inner_protocol(skb, htons(ETH_P_TEB)); | 137 | skb_set_inner_protocol(skb, htons(ETH_P_TEB)); |
138 | 138 | ||
139 | return udp_tunnel_xmit_skb(rt, skb, src, dst, | 139 | return udp_tunnel_xmit_skb(rt, gs->sock->sk, skb, src, dst, |
140 | tos, ttl, df, src_port, dst_port, xnet, | 140 | tos, ttl, df, src_port, dst_port, xnet, |
141 | !csum); | 141 | !csum); |
142 | } | 142 | } |
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 6d364ab8e14e..4c2c3ba4ba65 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -782,7 +782,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | |||
782 | return; | 782 | return; |
783 | } | 783 | } |
784 | 784 | ||
785 | err = iptunnel_xmit(skb->sk, rt, skb, fl4.saddr, fl4.daddr, protocol, | 785 | err = iptunnel_xmit(NULL, rt, skb, fl4.saddr, fl4.daddr, protocol, |
786 | tos, ttl, df, !net_eq(tunnel->net, dev_net(dev))); | 786 | tos, ttl, df, !net_eq(tunnel->net, dev_net(dev))); |
787 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); | 787 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); |
788 | 788 | ||
diff --git a/net/ipv4/udp_tunnel.c b/net/ipv4/udp_tunnel.c index c83b35485056..6bb98cc193c9 100644 --- a/net/ipv4/udp_tunnel.c +++ b/net/ipv4/udp_tunnel.c | |||
@@ -75,7 +75,7 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock, | |||
75 | } | 75 | } |
76 | EXPORT_SYMBOL_GPL(setup_udp_tunnel_sock); | 76 | EXPORT_SYMBOL_GPL(setup_udp_tunnel_sock); |
77 | 77 | ||
78 | int udp_tunnel_xmit_skb(struct rtable *rt, struct sk_buff *skb, | 78 | int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb, |
79 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, | 79 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, |
80 | __be16 df, __be16 src_port, __be16 dst_port, | 80 | __be16 df, __be16 src_port, __be16 dst_port, |
81 | bool xnet, bool nocheck) | 81 | bool xnet, bool nocheck) |
@@ -92,7 +92,7 @@ int udp_tunnel_xmit_skb(struct rtable *rt, struct sk_buff *skb, | |||
92 | 92 | ||
93 | udp_set_csum(nocheck, skb, src, dst, skb->len); | 93 | udp_set_csum(nocheck, skb, src, dst, skb->len); |
94 | 94 | ||
95 | return iptunnel_xmit(skb->sk, rt, skb, src, dst, IPPROTO_UDP, | 95 | return iptunnel_xmit(sk, rt, skb, src, dst, IPPROTO_UDP, |
96 | tos, ttl, df, xnet); | 96 | tos, ttl, df, xnet); |
97 | } | 97 | } |
98 | EXPORT_SYMBOL_GPL(udp_tunnel_xmit_skb); | 98 | EXPORT_SYMBOL_GPL(udp_tunnel_xmit_skb); |
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index f724329d7436..b5e6cc1d4a73 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -760,7 +760,7 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb, | |||
760 | 760 | ||
761 | skb_set_inner_protocol(skb, protocol); | 761 | skb_set_inner_protocol(skb, protocol); |
762 | 762 | ||
763 | ip6tunnel_xmit(skb, dev); | 763 | ip6tunnel_xmit(NULL, skb, dev); |
764 | if (ndst) | 764 | if (ndst) |
765 | ip6_tnl_dst_store(tunnel, ndst); | 765 | ip6_tnl_dst_store(tunnel, ndst); |
766 | return 0; | 766 | return 0; |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index b6a211a150b2..5cafd92c2312 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -1100,7 +1100,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb, | |||
1100 | ipv6h->nexthdr = proto; | 1100 | ipv6h->nexthdr = proto; |
1101 | ipv6h->saddr = fl6->saddr; | 1101 | ipv6h->saddr = fl6->saddr; |
1102 | ipv6h->daddr = fl6->daddr; | 1102 | ipv6h->daddr = fl6->daddr; |
1103 | ip6tunnel_xmit(skb, dev); | 1103 | ip6tunnel_xmit(NULL, skb, dev); |
1104 | if (ndst) | 1104 | if (ndst) |
1105 | ip6_tnl_dst_store(t, ndst); | 1105 | ip6_tnl_dst_store(t, ndst); |
1106 | return 0; | 1106 | return 0; |
diff --git a/net/ipv6/ip6_udp_tunnel.c b/net/ipv6/ip6_udp_tunnel.c index 32d9b268e7d8..bba8903e871f 100644 --- a/net/ipv6/ip6_udp_tunnel.c +++ b/net/ipv6/ip6_udp_tunnel.c | |||
@@ -62,7 +62,8 @@ error: | |||
62 | } | 62 | } |
63 | EXPORT_SYMBOL_GPL(udp_sock_create6); | 63 | EXPORT_SYMBOL_GPL(udp_sock_create6); |
64 | 64 | ||
65 | int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sk_buff *skb, | 65 | int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk, |
66 | struct sk_buff *skb, | ||
66 | struct net_device *dev, struct in6_addr *saddr, | 67 | struct net_device *dev, struct in6_addr *saddr, |
67 | struct in6_addr *daddr, | 68 | struct in6_addr *daddr, |
68 | __u8 prio, __u8 ttl, __be16 src_port, | 69 | __u8 prio, __u8 ttl, __be16 src_port, |
@@ -97,7 +98,7 @@ int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sk_buff *skb, | |||
97 | ip6h->daddr = *daddr; | 98 | ip6h->daddr = *daddr; |
98 | ip6h->saddr = *saddr; | 99 | ip6h->saddr = *saddr; |
99 | 100 | ||
100 | ip6tunnel_xmit(skb, dev); | 101 | ip6tunnel_xmit(sk, skb, dev); |
101 | return 0; | 102 | return 0; |
102 | } | 103 | } |
103 | EXPORT_SYMBOL_GPL(udp_tunnel6_xmit_skb); | 104 | EXPORT_SYMBOL_GPL(udp_tunnel6_xmit_skb); |
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c index 7d1131dc29fe..85892af57364 100644 --- a/net/ipv6/output_core.c +++ b/net/ipv6/output_core.c | |||
@@ -136,7 +136,7 @@ int ip6_dst_hoplimit(struct dst_entry *dst) | |||
136 | EXPORT_SYMBOL(ip6_dst_hoplimit); | 136 | EXPORT_SYMBOL(ip6_dst_hoplimit); |
137 | #endif | 137 | #endif |
138 | 138 | ||
139 | int __ip6_local_out(struct sk_buff *skb) | 139 | static int __ip6_local_out_sk(struct sock *sk, struct sk_buff *skb) |
140 | { | 140 | { |
141 | int len; | 141 | int len; |
142 | 142 | ||
@@ -146,19 +146,30 @@ int __ip6_local_out(struct sk_buff *skb) | |||
146 | ipv6_hdr(skb)->payload_len = htons(len); | 146 | ipv6_hdr(skb)->payload_len = htons(len); |
147 | IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); | 147 | IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); |
148 | 148 | ||
149 | return nf_hook(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb->sk, skb, | 149 | return nf_hook(NFPROTO_IPV6, NF_INET_LOCAL_OUT, sk, skb, |
150 | NULL, skb_dst(skb)->dev, dst_output_sk); | 150 | NULL, skb_dst(skb)->dev, dst_output_sk); |
151 | } | 151 | } |
152 | |||
153 | int __ip6_local_out(struct sk_buff *skb) | ||
154 | { | ||
155 | return __ip6_local_out_sk(skb->sk, skb); | ||
156 | } | ||
152 | EXPORT_SYMBOL_GPL(__ip6_local_out); | 157 | EXPORT_SYMBOL_GPL(__ip6_local_out); |
153 | 158 | ||
154 | int ip6_local_out(struct sk_buff *skb) | 159 | int ip6_local_out_sk(struct sock *sk, struct sk_buff *skb) |
155 | { | 160 | { |
156 | int err; | 161 | int err; |
157 | 162 | ||
158 | err = __ip6_local_out(skb); | 163 | err = __ip6_local_out_sk(sk, skb); |
159 | if (likely(err == 1)) | 164 | if (likely(err == 1)) |
160 | err = dst_output(skb); | 165 | err = dst_output_sk(sk, skb); |
161 | 166 | ||
162 | return err; | 167 | return err; |
163 | } | 168 | } |
169 | EXPORT_SYMBOL_GPL(ip6_local_out_sk); | ||
170 | |||
171 | int ip6_local_out(struct sk_buff *skb) | ||
172 | { | ||
173 | return ip6_local_out_sk(skb->sk, skb); | ||
174 | } | ||
164 | EXPORT_SYMBOL_GPL(ip6_local_out); | 175 | EXPORT_SYMBOL_GPL(ip6_local_out); |
diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c index 3277a7520e31..6d39766e7828 100644 --- a/net/openvswitch/vport-vxlan.c +++ b/net/openvswitch/vport-vxlan.c | |||
@@ -222,7 +222,8 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb) | |||
222 | { | 222 | { |
223 | struct net *net = ovs_dp_get_net(vport->dp); | 223 | struct net *net = ovs_dp_get_net(vport->dp); |
224 | struct vxlan_port *vxlan_port = vxlan_vport(vport); | 224 | struct vxlan_port *vxlan_port = vxlan_vport(vport); |
225 | __be16 dst_port = inet_sk(vxlan_port->vs->sock->sk)->inet_sport; | 225 | struct sock *sk = vxlan_port->vs->sock->sk; |
226 | __be16 dst_port = inet_sk(sk)->inet_sport; | ||
226 | const struct ovs_key_ipv4_tunnel *tun_key; | 227 | const struct ovs_key_ipv4_tunnel *tun_key; |
227 | struct vxlan_metadata md = {0}; | 228 | struct vxlan_metadata md = {0}; |
228 | struct rtable *rt; | 229 | struct rtable *rt; |
@@ -255,7 +256,7 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb) | |||
255 | vxflags = vxlan_port->exts | | 256 | vxflags = vxlan_port->exts | |
256 | (tun_key->tun_flags & TUNNEL_CSUM ? VXLAN_F_UDP_CSUM : 0); | 257 | (tun_key->tun_flags & TUNNEL_CSUM ? VXLAN_F_UDP_CSUM : 0); |
257 | 258 | ||
258 | err = vxlan_xmit_skb(rt, skb, fl.saddr, tun_key->ipv4_dst, | 259 | err = vxlan_xmit_skb(rt, sk, skb, fl.saddr, tun_key->ipv4_dst, |
259 | tun_key->ipv4_tos, tun_key->ipv4_ttl, df, | 260 | tun_key->ipv4_tos, tun_key->ipv4_ttl, df, |
260 | src_port, dst_port, | 261 | src_port, dst_port, |
261 | &md, false, vxflags); | 262 | &md, false, vxflags); |
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index ef3d7aa2854a..66deebc66aa1 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c | |||
@@ -176,7 +176,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb, | |||
176 | goto tx_error; | 176 | goto tx_error; |
177 | } | 177 | } |
178 | ttl = ip4_dst_hoplimit(&rt->dst); | 178 | ttl = ip4_dst_hoplimit(&rt->dst); |
179 | err = udp_tunnel_xmit_skb(rt, clone, src->ipv4.s_addr, | 179 | err = udp_tunnel_xmit_skb(rt, ub->ubsock->sk, clone, |
180 | src->ipv4.s_addr, | ||
180 | dst->ipv4.s_addr, 0, ttl, 0, | 181 | dst->ipv4.s_addr, 0, ttl, 0, |
181 | src->udp_port, dst->udp_port, | 182 | src->udp_port, dst->udp_port, |
182 | false, true); | 183 | false, true); |
@@ -197,7 +198,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb, | |||
197 | if (err) | 198 | if (err) |
198 | goto tx_error; | 199 | goto tx_error; |
199 | ttl = ip6_dst_hoplimit(ndst); | 200 | ttl = ip6_dst_hoplimit(ndst); |
200 | err = udp_tunnel6_xmit_skb(ndst, clone, ndst->dev, &src->ipv6, | 201 | err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, clone, |
202 | ndst->dev, &src->ipv6, | ||
201 | &dst->ipv6, 0, ttl, src->udp_port, | 203 | &dst->ipv6, 0, ttl, src->udp_port, |
202 | dst->udp_port, false); | 204 | dst->udp_port, false); |
203 | #endif | 205 | #endif |