* [PATCH net] packet: propagate sock_cmsg_send() error
@ 2016-07-20 22:01 Soheil Hassas Yeganeh
2016-07-22 5:42 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Soheil Hassas Yeganeh @ 2016-07-20 22:01 UTC (permalink / raw)
To: davem, netdev; +Cc: willemb, Soheil Hassas Yeganeh
From: Soheil Hassas Yeganeh <soheil@google.com>
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")
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Cc: Willem de Bruijn <willemb@google.com>
---
net/packet/af_packet.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 53e87ce..b43c401 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -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;
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net] packet: propagate sock_cmsg_send() error
2016-07-20 22:01 [PATCH net] packet: propagate sock_cmsg_send() error Soheil Hassas Yeganeh
@ 2016-07-22 5:42 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-22 5:42 UTC (permalink / raw)
To: soheil.kdev; +Cc: netdev, willemb, soheil
From: Soheil Hassas Yeganeh <soheil.kdev@gmail.com>
Date: Wed, 20 Jul 2016 18:01:18 -0400
> From: Soheil Hassas Yeganeh <soheil@google.com>
>
> 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")
> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
> Cc: Willem de Bruijn <willemb@google.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-22 5:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-20 22:01 [PATCH net] packet: propagate sock_cmsg_send() error Soheil Hassas Yeganeh
2016-07-22 5:42 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).