From: Evgeny Vereshchagin Date: Mon, 1 Oct 2018 22:37:17 +0000 (+0000) Subject: icmp6-util: stop ignoring EAGAIN and EINTR in icmp6_receive X-Git-Tag: v240~651 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14f37112c86b573cf7f1f557e6d1be4c322290a4;p=thirdparty%2Fsystemd.git icmp6-util: stop ignoring EAGAIN and EINTR in icmp6_receive The code handling the errors was originally part of ndisc_recv, which, being an event handler, would be simply turned off if it returned a negative error code. It's no longer necessary. Plus, it helps avoid passing an uninitialized value to radv_send. Closes https://github.com/systemd/systemd/issues/10223. --- diff --git a/src/libsystemd-network/icmp6-util.c b/src/libsystemd-network/icmp6-util.c index 736df222f03..8bee24e5689 100644 --- a/src/libsystemd-network/icmp6-util.c +++ b/src/libsystemd-network/icmp6-util.c @@ -174,12 +174,8 @@ int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *dst, iov.iov_len = size; len = recvmsg(fd, &msg, MSG_DONTWAIT); - if (len < 0) { - if (IN_SET(errno, EAGAIN, EINTR)) - return 0; - + if (len < 0) return -errno; - } if ((size_t) len != size) return -EINVAL;