diff options
| author | Eric Dumazet <edumazet@google.com> | 2014-04-15 12:58:34 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-04-15 12:58:34 -0400 |
| commit | b0270e91014dabfceaf37f5b40ad51bbf21a1302 (patch) | |
| tree | 6bebc58cf422a4493d306a1a6fd658d0f02a411e /include | |
| parent | 1dd333f470b4e1767c9c0a14b05b5104e56b2930 (diff) | |
ipv4: add a sock pointer to ip_queue_xmit()
ip_queue_xmit() assumes the skb it has to transmit is attached to an
inet socket. Commit 31c70d5956fc ("l2tp: keep original skb ownership")
changed l2tp to not change skb ownership and thus broke this assumption.
One fix is to add a new 'struct sock *sk' parameter to ip_queue_xmit(),
so that we do not assume skb->sk points to the socket used by l2tp
tunnel.
Fixes: 31c70d5956fc ("l2tp: keep original skb ownership")
Reported-by: Zhan Jianyu <nasa4836@gmail.com>
Tested-by: Zhan Jianyu <nasa4836@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/inet6_connection_sock.h | 2 | ||||
| -rw-r--r-- | include/net/inet_connection_sock.h | 2 | ||||
| -rw-r--r-- | include/net/ip.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index f981ba7adeed..74af137304be 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
| @@ -40,7 +40,7 @@ void inet6_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req, | |||
| 40 | 40 | ||
| 41 | void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 41 | void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
| 42 | 42 | ||
| 43 | int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl); | 43 | int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl); |
| 44 | 44 | ||
| 45 | struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu); | 45 | struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu); |
| 46 | #endif /* _INET6_CONNECTION_SOCK_H */ | 46 | #endif /* _INET6_CONNECTION_SOCK_H */ |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index c55aeed41ace..7a4313887568 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
| @@ -36,7 +36,7 @@ struct tcp_congestion_ops; | |||
| 36 | * (i.e. things that depend on the address family) | 36 | * (i.e. things that depend on the address family) |
| 37 | */ | 37 | */ |
| 38 | struct inet_connection_sock_af_ops { | 38 | struct inet_connection_sock_af_ops { |
| 39 | int (*queue_xmit)(struct sk_buff *skb, struct flowi *fl); | 39 | int (*queue_xmit)(struct sock *sk, struct sk_buff *skb, struct flowi *fl); |
| 40 | void (*send_check)(struct sock *sk, struct sk_buff *skb); | 40 | void (*send_check)(struct sock *sk, struct sk_buff *skb); |
| 41 | int (*rebuild_header)(struct sock *sk); | 41 | int (*rebuild_header)(struct sock *sk); |
| 42 | void (*sk_rx_dst_set)(struct sock *sk, const struct sk_buff *skb); | 42 | void (*sk_rx_dst_set)(struct sock *sk, const struct sk_buff *skb); |
diff --git a/include/net/ip.h b/include/net/ip.h index 25064c28e059..77e73d293e09 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -111,7 +111,7 @@ int ip_do_nat(struct sk_buff *skb); | |||
| 111 | void ip_send_check(struct iphdr *ip); | 111 | void ip_send_check(struct iphdr *ip); |
| 112 | int __ip_local_out(struct sk_buff *skb); | 112 | int __ip_local_out(struct sk_buff *skb); |
| 113 | int ip_local_out(struct sk_buff *skb); | 113 | int ip_local_out(struct sk_buff *skb); |
| 114 | int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl); | 114 | int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl); |
| 115 | void ip_init(void); | 115 | void ip_init(void); |
| 116 | int ip_append_data(struct sock *sk, struct flowi4 *fl4, | 116 | int ip_append_data(struct sock *sk, struct flowi4 *fl4, |
| 117 | int getfrag(void *from, char *to, int offset, int len, | 117 | int getfrag(void *from, char *to, int offset, int len, |
