Skip to contentSkip to conversation

packet: propagate sock_cmsg_send() error

PATCH Applied Soheil Hassas Yeganeh 2 participants 2 messages Jul 20, 2016 – Jul 22, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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")
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
index 53e87ce..b43c401 100644
@@ -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
maintainer Applied
#1 lore raw

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")
Cc Willem de Bruijn <[email protected]>

Applied, thanks.