Commit f8e7718c authored by Soheil Hassas Yeganeh's avatar Soheil Hassas Yeganeh Committed by David S. Miller

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: c14ac945 ("sock: enable timestamping using control messages")
Signed-off-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 882b0f2f
...@@ -1930,11 +1930,9 @@ static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg, ...@@ -1930,11 +1930,9 @@ static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,
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;
skb->dev = dev; skb->dev = dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment