sock: propagate __sock_cmsg_send() error

__sock_cmsg_send() might return different error codes, not only -EINVAL.

Fixes: 24025c465f ("ipv4: process socket-level control messages in IPv4")
Fixes: ad1e46a837 ("ipv6: process socket-level control messages in IPv6")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet
2016-05-13 06:14:37 -07:00
کامیت شده توسط David S. Miller
والد a986a05de9
کامیت 2632616bc4
2فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده

مشاهده پرونده

@@ -247,8 +247,9 @@ int ip_cmsg_send(struct sock *sk, struct msghdr *msg, struct ipcm_cookie *ipc,
}
#endif
if (cmsg->cmsg_level == SOL_SOCKET) {
if (__sock_cmsg_send(sk, msg, cmsg, &ipc->sockc))
return -EINVAL;
err = __sock_cmsg_send(sk, msg, cmsg, &ipc->sockc);
if (err)
return err;
continue;
}