Skip to content

Commit f8e7718

Browse files
soheilhydavem330
authored andcommitted
packet: propagate sock_cmsg_send() error
sock_cmsg_send() can return different error codes and not only -EINVAL, and we should properly propagate them. Fixes: c14ac94 ("sock: enable timestamping using control messages") Signed-off-by: Soheil Hassas Yeganeh <[email protected]> Cc: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 882b0f2 commit f8e7718

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/packet/af_packet.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,10 +1930,8 @@ static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,
19301930
sockc.tsflags = sk->sk_tsflags;
19311931
if (msg->msg_controllen) {
19321932
err = sock_cmsg_send(sk, msg, &sockc);
1933-
if (unlikely(err)) {
1934-
err = -EINVAL;
1933+
if (unlikely(err))
19351934
goto out_unlock;
1936-
}
19371935
}
19381936

19391937
skb->protocol = proto;

0 commit comments

Comments
 (0)