packet: propagate sock_cmsg_send() error
Subsystems (3)
PATCH 1/1 packet: propagate sock_cmsg_send() error
From: Soheil Hassas Yeganeh <[email protected]>
sock_cmsg_send() can return different error codes and not only -EINVAL, and we should properly propagate them.
Fixes c14ac9451c34 ("sock: enable timestamping using control messages")
Signed-off-by Soheil Hassas Yeganeh <[email protected]>
Cc Willem de Bruijn <[email protected]>
--- net/packet/af_packet.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/packet/af_packet.c +1 -3
@@ -1930,10 +1930,8 @@ retry: sockc.tsflags = sk->sk_tsflags;if (msg->msg_controllen) { err =sock_cmsg_send (sk, msg, &sockc); -if (unlikely (err)) { - err = -EINVAL ; +if (unlikely (err)) goto out_unlock; - } } skb->protocol = proto;
Signature · 1 line
2.8.0.rc3.226.g39d4020
From: Soheil Hassas Yeganeh <[email protected]>
Date: Wed, 20 Jul 2016 18:01:18 -0400
Quoted 8 lines
From: Soheil Hassas Yeganeh <[email protected]>
sock_cmsg_send()can return different error codes and not only-EINVAL, and we should properly propagate them.Fixes c14ac9451c34 ("sock: enable timestamping using control messages")Signed-off-by Soheil Hassas Yeganeh <[email protected]>Cc Willem de Bruijn <[email protected]>
Applied, thanks.