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: c14ac9451c
("sock: enable timestamping using control messages")
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
882b0f2fba
commit
f8e7718cc0
@ -1930,10 +1930,8 @@ retry:
|
|||||||
sockc.tsflags = sk->sk_tsflags;
|
sockc.tsflags = sk->sk_tsflags;
|
||||||
if (msg->msg_controllen) {
|
if (msg->msg_controllen) {
|
||||||
err = sock_cmsg_send(sk, msg, &sockc);
|
err = sock_cmsg_send(sk, msg, &sockc);
|
||||||
if (unlikely(err)) {
|
if (unlikely(err))
|
||||||
err = -EINVAL;
|
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
skb->protocol = proto;
|
skb->protocol = proto;
|
||||||
|
Loading…
Reference in New Issue
Block a user