diff options
| author | David S. Miller <davem@davemloft.net> | 2015-04-07 15:29:30 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-04-07 15:29:30 -0400 |
| commit | e0e8db2f89bac4529fa12dde2595d6295e313952 (patch) | |
| tree | 8cfacda45a2b3d12a3831511199a13d33f245890 /include | |
| parent | a3786a5ff7551d03029219f93306106d0a6bdf55 (diff) | |
| parent | 79b16aadea32cce077acbe9e229fcb58a7801687 (diff) | |
Merge branch 'udp_tunnel_sk'
Prevent UDP tunnels from operating on garbage socket
So this should do the rest of the work such that when we encapsulate
into a UDP tunnel, the output path works on the UDP tunnel's socket
rather than skb->sk.
Part of this work is based upon changes done by Jiri Pirko some time
ago.
Basically the first step is to pass the socket through the nf_hook
okfn(), and then next we do the same for the UDP tunnel xmit routines.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/netdevice.h | 14 | ||||
| -rw-r--r-- | include/linux/netfilter.h | 89 | ||||
| -rw-r--r-- | include/linux/netfilter_bridge.h | 2 | ||||
| -rw-r--r-- | include/net/dn_neigh.h | 6 | ||||
| -rw-r--r-- | include/net/ip.h | 3 | ||||
| -rw-r--r-- | include/net/ip6_route.h | 3 | ||||
| -rw-r--r-- | include/net/ip6_tunnel.h | 5 | ||||
| -rw-r--r-- | include/net/ipv6.h | 3 | ||||
| -rw-r--r-- | include/net/udp_tunnel.h | 5 | ||||
| -rw-r--r-- | include/net/vxlan.h | 2 | ||||
| -rw-r--r-- | include/net/xfrm.h | 8 |
11 files changed, 87 insertions, 53 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 41bf58a2b936..45823db2efb0 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2165,8 +2165,12 @@ int dev_open(struct net_device *dev); | |||
| 2165 | int dev_close(struct net_device *dev); | 2165 | int dev_close(struct net_device *dev); |
| 2166 | int dev_close_many(struct list_head *head, bool unlink); | 2166 | int dev_close_many(struct list_head *head, bool unlink); |
| 2167 | void dev_disable_lro(struct net_device *dev); | 2167 | void dev_disable_lro(struct net_device *dev); |
| 2168 | int dev_loopback_xmit(struct sk_buff *newskb); | 2168 | int dev_loopback_xmit(struct sock *sk, struct sk_buff *newskb); |
| 2169 | int dev_queue_xmit(struct sk_buff *skb); | 2169 | int dev_queue_xmit_sk(struct sock *sk, struct sk_buff *skb); |
| 2170 | static inline int dev_queue_xmit(struct sk_buff *skb) | ||
| 2171 | { | ||
| 2172 | return dev_queue_xmit_sk(skb->sk, skb); | ||
| 2173 | } | ||
| 2170 | int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv); | 2174 | int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv); |
| 2171 | int register_netdevice(struct net_device *dev); | 2175 | int register_netdevice(struct net_device *dev); |
| 2172 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); | 2176 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); |
| @@ -2927,7 +2931,11 @@ static inline void dev_consume_skb_any(struct sk_buff *skb) | |||
| 2927 | 2931 | ||
| 2928 | int netif_rx(struct sk_buff *skb); | 2932 | int netif_rx(struct sk_buff *skb); |
| 2929 | int netif_rx_ni(struct sk_buff *skb); | 2933 | int netif_rx_ni(struct sk_buff *skb); |
| 2930 | int netif_receive_skb(struct sk_buff *skb); | 2934 | int netif_receive_skb_sk(struct sock *sk, struct sk_buff *skb); |
| 2935 | static inline int netif_receive_skb(struct sk_buff *skb) | ||
| 2936 | { | ||
| 2937 | return netif_receive_skb_sk(skb->sk, skb); | ||
| 2938 | } | ||
| 2931 | gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb); | 2939 | gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb); |
| 2932 | void napi_gro_flush(struct napi_struct *napi, bool flush_old); | 2940 | void napi_gro_flush(struct napi_struct *napi, bool flush_old); |
| 2933 | struct sk_buff *napi_get_frags(struct napi_struct *napi); | 2941 | struct sk_buff *napi_get_frags(struct napi_struct *napi); |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index c480c43ad8f7..63560d0a8dfe 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
| @@ -45,15 +45,35 @@ struct sk_buff; | |||
| 45 | 45 | ||
| 46 | struct nf_hook_ops; | 46 | struct nf_hook_ops; |
| 47 | 47 | ||
| 48 | struct sock; | ||
| 49 | |||
| 48 | struct nf_hook_state { | 50 | struct nf_hook_state { |
| 49 | unsigned int hook; | 51 | unsigned int hook; |
| 50 | int thresh; | 52 | int thresh; |
| 51 | u_int8_t pf; | 53 | u_int8_t pf; |
| 52 | struct net_device *in; | 54 | struct net_device *in; |
| 53 | struct net_device *out; | 55 | struct net_device *out; |
| 54 | int (*okfn)(struct sk_buff *); | 56 | struct sock *sk; |
| 57 | int (*okfn)(struct sock *, struct sk_buff *); | ||
| 55 | }; | 58 | }; |
| 56 | 59 | ||
| 60 | static inline void nf_hook_state_init(struct nf_hook_state *p, | ||
| 61 | unsigned int hook, | ||
| 62 | int thresh, u_int8_t pf, | ||
| 63 | struct net_device *indev, | ||
| 64 | struct net_device *outdev, | ||
| 65 | struct sock *sk, | ||
| 66 | int (*okfn)(struct sock *, struct sk_buff *)) | ||
| 67 | { | ||
| 68 | p->hook = hook; | ||
| 69 | p->thresh = thresh; | ||
| 70 | p->pf = pf; | ||
| 71 | p->in = indev; | ||
| 72 | p->out = outdev; | ||
| 73 | p->sk = sk; | ||
| 74 | p->okfn = okfn; | ||
| 75 | } | ||
| 76 | |||
| 57 | typedef unsigned int nf_hookfn(const struct nf_hook_ops *ops, | 77 | typedef unsigned int nf_hookfn(const struct nf_hook_ops *ops, |
| 58 | struct sk_buff *skb, | 78 | struct sk_buff *skb, |
| 59 | const struct nf_hook_state *state); | 79 | const struct nf_hook_state *state); |
| @@ -136,31 +156,29 @@ int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state); | |||
| 136 | * value indicates the packet has been consumed by the hook. | 156 | * value indicates the packet has been consumed by the hook. |
| 137 | */ | 157 | */ |
| 138 | static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, | 158 | static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, |
| 159 | struct sock *sk, | ||
| 139 | struct sk_buff *skb, | 160 | struct sk_buff *skb, |
| 140 | struct net_device *indev, | 161 | struct net_device *indev, |
| 141 | struct net_device *outdev, | 162 | struct net_device *outdev, |
| 142 | int (*okfn)(struct sk_buff *), int thresh) | 163 | int (*okfn)(struct sock *, struct sk_buff *), |
| 164 | int thresh) | ||
| 143 | { | 165 | { |
| 144 | if (nf_hooks_active(pf, hook)) { | 166 | if (nf_hooks_active(pf, hook)) { |
| 145 | struct nf_hook_state state = { | 167 | struct nf_hook_state state; |
| 146 | .hook = hook, | ||
| 147 | .thresh = thresh, | ||
| 148 | .pf = pf, | ||
| 149 | .in = indev, | ||
| 150 | .out = outdev, | ||
| 151 | .okfn = okfn | ||
| 152 | }; | ||
| 153 | 168 | ||
| 169 | nf_hook_state_init(&state, hook, thresh, pf, | ||
| 170 | indev, outdev, sk, okfn); | ||
| 154 | return nf_hook_slow(skb, &state); | 171 | return nf_hook_slow(skb, &state); |
| 155 | } | 172 | } |
| 156 | return 1; | 173 | return 1; |
| 157 | } | 174 | } |
| 158 | 175 | ||
| 159 | static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, | 176 | static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sock *sk, |
| 160 | struct net_device *indev, struct net_device *outdev, | 177 | struct sk_buff *skb, struct net_device *indev, |
| 161 | int (*okfn)(struct sk_buff *)) | 178 | struct net_device *outdev, |
| 179 | int (*okfn)(struct sock *, struct sk_buff *)) | ||
| 162 | { | 180 | { |
| 163 | return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN); | 181 | return nf_hook_thresh(pf, hook, sk, skb, indev, outdev, okfn, INT_MIN); |
| 164 | } | 182 | } |
| 165 | 183 | ||
| 166 | /* Activate hook; either okfn or kfree_skb called, unless a hook | 184 | /* Activate hook; either okfn or kfree_skb called, unless a hook |
| @@ -181,35 +199,36 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, | |||
| 181 | */ | 199 | */ |
| 182 | 200 | ||
| 183 | static inline int | 201 | static inline int |
| 184 | NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct sk_buff *skb, | 202 | NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct sock *sk, |
| 185 | struct net_device *in, struct net_device *out, | 203 | struct sk_buff *skb, struct net_device *in, |
| 186 | int (*okfn)(struct sk_buff *), int thresh) | 204 | struct net_device *out, |
| 205 | int (*okfn)(struct sock *, struct sk_buff *), int thresh) | ||
| 187 | { | 206 | { |
| 188 | int ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, thresh); | 207 | int ret = nf_hook_thresh(pf, hook, sk, skb, in, out, okfn, thresh); |
| 189 | if (ret == 1) | 208 | if (ret == 1) |
| 190 | ret = okfn(skb); | 209 | ret = okfn(sk, skb); |
| 191 | return ret; | 210 | return ret; |
| 192 | } | 211 | } |
| 193 | 212 | ||
| 194 | static inline int | 213 | static inline int |
| 195 | NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb, | 214 | NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sock *sk, |
| 196 | struct net_device *in, struct net_device *out, | 215 | struct sk_buff *skb, struct net_device *in, struct net_device *out, |
| 197 | int (*okfn)(struct sk_buff *), bool cond) | 216 | int (*okfn)(struct sock *, struct sk_buff *), bool cond) |
| 198 | { | 217 | { |
| 199 | int ret; | 218 | int ret; |
| 200 | 219 | ||
| 201 | if (!cond || | 220 | if (!cond || |
| 202 | ((ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN)) == 1)) | 221 | ((ret = nf_hook_thresh(pf, hook, sk, skb, in, out, okfn, INT_MIN)) == 1)) |
| 203 | ret = okfn(skb); | 222 | ret = okfn(sk, skb); |
| 204 | return ret; | 223 | return ret; |
| 205 | } | 224 | } |
| 206 | 225 | ||
| 207 | static inline int | 226 | static inline int |
| 208 | NF_HOOK(uint8_t pf, unsigned int hook, struct sk_buff *skb, | 227 | NF_HOOK(uint8_t pf, unsigned int hook, struct sock *sk, struct sk_buff *skb, |
| 209 | struct net_device *in, struct net_device *out, | 228 | struct net_device *in, struct net_device *out, |
| 210 | int (*okfn)(struct sk_buff *)) | 229 | int (*okfn)(struct sock *, struct sk_buff *)) |
| 211 | { | 230 | { |
| 212 | return NF_HOOK_THRESH(pf, hook, skb, in, out, okfn, INT_MIN); | 231 | return NF_HOOK_THRESH(pf, hook, sk, skb, in, out, okfn, INT_MIN); |
| 213 | } | 232 | } |
| 214 | 233 | ||
| 215 | /* Call setsockopt() */ | 234 | /* Call setsockopt() */ |
| @@ -309,19 +328,21 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) | |||
| 309 | } | 328 | } |
| 310 | 329 | ||
| 311 | #else /* !CONFIG_NETFILTER */ | 330 | #else /* !CONFIG_NETFILTER */ |
| 312 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) | 331 | #define NF_HOOK(pf, hook, sk, skb, indev, outdev, okfn) (okfn)(sk, skb) |
| 313 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb) | 332 | #define NF_HOOK_COND(pf, hook, sk, skb, indev, outdev, okfn, cond) (okfn)(sk, skb) |
| 314 | static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, | 333 | static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, |
| 334 | struct sock *sk, | ||
| 315 | struct sk_buff *skb, | 335 | struct sk_buff *skb, |
| 316 | struct net_device *indev, | 336 | struct net_device *indev, |
| 317 | struct net_device *outdev, | 337 | struct net_device *outdev, |
| 318 | int (*okfn)(struct sk_buff *), int thresh) | 338 | int (*okfn)(struct sock *sk, struct sk_buff *), int thresh) |
| 319 | { | 339 | { |
| 320 | return okfn(skb); | 340 | return okfn(sk, skb); |
| 321 | } | 341 | } |
| 322 | static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, | 342 | static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sock *sk, |
| 323 | struct net_device *indev, struct net_device *outdev, | 343 | struct sk_buff *skb, struct net_device *indev, |
| 324 | int (*okfn)(struct sk_buff *)) | 344 | struct net_device *outdev, |
| 345 | int (*okfn)(struct sock *, struct sk_buff *)) | ||
| 325 | { | 346 | { |
| 326 | return 1; | 347 | return 1; |
| 327 | } | 348 | } |
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index 2734977199ca..5fc0a0fe244b 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
| @@ -30,7 +30,7 @@ static inline unsigned int nf_bridge_mtu_reduction(const struct sk_buff *skb) | |||
| 30 | return 0; | 30 | return 0; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | int br_handle_frame_finish(struct sk_buff *skb); | 33 | int br_handle_frame_finish(struct sock *sk, struct sk_buff *skb); |
| 34 | 34 | ||
| 35 | static inline void br_drop_fake_rtable(struct sk_buff *skb) | 35 | static inline void br_drop_fake_rtable(struct sk_buff *skb) |
| 36 | { | 36 | { |
diff --git a/include/net/dn_neigh.h b/include/net/dn_neigh.h index 0f26aa707e62..d0424269313f 100644 --- a/include/net/dn_neigh.h +++ b/include/net/dn_neigh.h | |||
| @@ -18,11 +18,11 @@ struct dn_neigh { | |||
| 18 | 18 | ||
| 19 | void dn_neigh_init(void); | 19 | void dn_neigh_init(void); |
| 20 | void dn_neigh_cleanup(void); | 20 | void dn_neigh_cleanup(void); |
| 21 | int dn_neigh_router_hello(struct sk_buff *skb); | 21 | int dn_neigh_router_hello(struct sock *sk, struct sk_buff *skb); |
| 22 | int dn_neigh_endnode_hello(struct sk_buff *skb); | 22 | int dn_neigh_endnode_hello(struct sock *sk, struct sk_buff *skb); |
| 23 | void dn_neigh_pointopoint_hello(struct sk_buff *skb); | 23 | void dn_neigh_pointopoint_hello(struct sk_buff *skb); |
| 24 | int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n); | 24 | int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n); |
| 25 | int dn_to_neigh_output(struct sk_buff *skb); | 25 | int dn_to_neigh_output(struct sock *sk, struct sk_buff *skb); |
| 26 | 26 | ||
| 27 | extern struct neigh_table dn_neigh_table; | 27 | extern struct neigh_table dn_neigh_table; |
| 28 | 28 | ||
diff --git a/include/net/ip.h b/include/net/ip.h index 69cd9cb8400c..d14af7edd197 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -108,7 +108,8 @@ int ip_local_deliver(struct sk_buff *skb); | |||
| 108 | int ip_mr_input(struct sk_buff *skb); | 108 | int ip_mr_input(struct sk_buff *skb); |
| 109 | int ip_output(struct sock *sk, struct sk_buff *skb); | 109 | int ip_output(struct sock *sk, struct sk_buff *skb); |
| 110 | int ip_mc_output(struct sock *sk, struct sk_buff *skb); | 110 | int ip_mc_output(struct sock *sk, struct sk_buff *skb); |
| 111 | int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | 111 | int ip_fragment(struct sock *sk, struct sk_buff *skb, |
| 112 | int (*output)(struct sock *, struct sk_buff *)); | ||
| 112 | int ip_do_nat(struct sk_buff *skb); | 113 | int ip_do_nat(struct sk_buff *skb); |
| 113 | void ip_send_check(struct iphdr *ip); | 114 | void ip_send_check(struct iphdr *ip); |
| 114 | int __ip_local_out(struct sk_buff *skb); | 115 | int __ip_local_out(struct sk_buff *skb); |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index eda131d179d9..5e192068e6cb 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -170,7 +170,8 @@ static inline bool ipv6_anycast_destination(const struct sk_buff *skb) | |||
| 170 | return rt->rt6i_flags & RTF_ANYCAST; | 170 | return rt->rt6i_flags & RTF_ANYCAST; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | 173 | int ip6_fragment(struct sock *sk, struct sk_buff *skb, |
| 174 | int (*output)(struct sock *, struct sk_buff *)); | ||
| 174 | 175 | ||
| 175 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | 176 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) |
| 176 | { | 177 | { |
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 65142e6af440..27470cd1d5f8 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -769,7 +769,7 @@ static inline u8 ip6_tclass(__be32 flowinfo) | |||
| 769 | int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, | 769 | int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, |
| 770 | struct packet_type *pt, struct net_device *orig_dev); | 770 | struct packet_type *pt, struct net_device *orig_dev); |
| 771 | 771 | ||
| 772 | int ip6_rcv_finish(struct sk_buff *skb); | 772 | int ip6_rcv_finish(struct sock *sk, struct sk_buff *skb); |
| 773 | 773 | ||
| 774 | /* | 774 | /* |
| 775 | * upper-layer output functions | 775 | * upper-layer output functions |
| @@ -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/include/net/xfrm.h b/include/net/xfrm.h index 461f83539493..36ac102c97c7 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -332,7 +332,7 @@ struct xfrm_state_afinfo { | |||
| 332 | int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); | 332 | int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); |
| 333 | int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); | 333 | int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); |
| 334 | int (*output)(struct sock *sk, struct sk_buff *skb); | 334 | int (*output)(struct sock *sk, struct sk_buff *skb); |
| 335 | int (*output_finish)(struct sk_buff *skb); | 335 | int (*output_finish)(struct sock *sk, struct sk_buff *skb); |
| 336 | int (*extract_input)(struct xfrm_state *x, | 336 | int (*extract_input)(struct xfrm_state *x, |
| 337 | struct sk_buff *skb); | 337 | struct sk_buff *skb); |
| 338 | int (*extract_output)(struct xfrm_state *x, | 338 | int (*extract_output)(struct xfrm_state *x, |
| @@ -1503,7 +1503,7 @@ int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb); | |||
| 1503 | int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type); | 1503 | int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type); |
| 1504 | int xfrm_input_resume(struct sk_buff *skb, int nexthdr); | 1504 | int xfrm_input_resume(struct sk_buff *skb, int nexthdr); |
| 1505 | int xfrm_output_resume(struct sk_buff *skb, int err); | 1505 | int xfrm_output_resume(struct sk_buff *skb, int err); |
| 1506 | int xfrm_output(struct sk_buff *skb); | 1506 | int xfrm_output(struct sock *sk, struct sk_buff *skb); |
| 1507 | int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb); | 1507 | int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1508 | void xfrm_local_error(struct sk_buff *skb, int mtu); | 1508 | void xfrm_local_error(struct sk_buff *skb, int mtu); |
| 1509 | int xfrm4_extract_header(struct sk_buff *skb); | 1509 | int xfrm4_extract_header(struct sk_buff *skb); |
| @@ -1524,7 +1524,7 @@ static inline int xfrm4_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi) | |||
| 1524 | int xfrm4_extract_output(struct xfrm_state *x, struct sk_buff *skb); | 1524 | int xfrm4_extract_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1525 | int xfrm4_prepare_output(struct xfrm_state *x, struct sk_buff *skb); | 1525 | int xfrm4_prepare_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1526 | int xfrm4_output(struct sock *sk, struct sk_buff *skb); | 1526 | int xfrm4_output(struct sock *sk, struct sk_buff *skb); |
| 1527 | int xfrm4_output_finish(struct sk_buff *skb); | 1527 | int xfrm4_output_finish(struct sock *sk, struct sk_buff *skb); |
| 1528 | int xfrm4_rcv_cb(struct sk_buff *skb, u8 protocol, int err); | 1528 | int xfrm4_rcv_cb(struct sk_buff *skb, u8 protocol, int err); |
| 1529 | int xfrm4_protocol_register(struct xfrm4_protocol *handler, unsigned char protocol); | 1529 | int xfrm4_protocol_register(struct xfrm4_protocol *handler, unsigned char protocol); |
| 1530 | int xfrm4_protocol_deregister(struct xfrm4_protocol *handler, unsigned char protocol); | 1530 | int xfrm4_protocol_deregister(struct xfrm4_protocol *handler, unsigned char protocol); |
| @@ -1549,7 +1549,7 @@ __be32 xfrm6_tunnel_spi_lookup(struct net *net, const xfrm_address_t *saddr); | |||
| 1549 | int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); | 1549 | int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1550 | int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); | 1550 | int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1551 | int xfrm6_output(struct sock *sk, struct sk_buff *skb); | 1551 | int xfrm6_output(struct sock *sk, struct sk_buff *skb); |
| 1552 | int xfrm6_output_finish(struct sk_buff *skb); | 1552 | int xfrm6_output_finish(struct sock *sk, struct sk_buff *skb); |
| 1553 | int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, | 1553 | int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, |
| 1554 | u8 **prevhdr); | 1554 | u8 **prevhdr); |
| 1555 | 1555 | ||
