提交 f8e7718c 编写于 作者: S Soheil Hassas Yeganeh 提交者: 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: NSoheil Hassas Yeganeh <soheil@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 882b0f2f
......@@ -1930,10 +1930,8 @@ static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册