Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2632616b authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

sock: propagate __sock_cmsg_send() error



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

Fixes: 24025c46 ("ipv4: process socket-level control messages in IPv4")
Fixes: ad1e46a8 ("ipv6: process socket-level control messages in IPv6")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a986a05d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;
		}

+3 −2
Original line number Diff line number Diff line
@@ -746,8 +746,9 @@ int ip6_datagram_send_ctl(struct net *net, struct sock *sk,
		}

		if (cmsg->cmsg_level == SOL_SOCKET) {
			if (__sock_cmsg_send(sk, msg, cmsg, sockc))
				return -EINVAL;
			err = __sock_cmsg_send(sk, msg, cmsg, sockc);
			if (err)
				return err;
			continue;
		}