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. Commit31c70d5956("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:31c70d5956("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>
This commit is contained in:
committed by
David S. Miller
parent
1dd333f470
commit
b0270e9101
@@ -487,7 +487,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
|
||||
|
||||
xmit:
|
||||
/* Queue the packet to IP for output */
|
||||
rc = ip_queue_xmit(skb, &inet->cork.fl);
|
||||
rc = ip_queue_xmit(sk, skb, &inet->cork.fl);
|
||||
rcu_read_unlock();
|
||||
|
||||
error:
|
||||
|
||||
Reference in New Issue
Block a user