From 97e80ee4a86d4097fda78a01d8b64ad2085008f3 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 30 Nov 2021 17:58:40 +0900 Subject: [PATCH] sd-dhcp6-client: fix error handling --- src/libsystemd-network/sd-dhcp6-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 4035a1c784..663e2d64b4 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -1479,10 +1479,10 @@ static int client_receive_message( len = recvmsg_safe(fd, &msg, MSG_DONTWAIT); if (len < 0) { /* see comment above for why we shouldn't error out on ENETDOWN. */ - if (IN_SET(errno, EAGAIN, EINTR, ENETDOWN)) + if (IN_SET(len, -EAGAIN, -EINTR, -ENETDOWN)) return 0; - return log_dhcp6_client_errno(client, errno, "Could not receive message from UDP socket: %m"); + return log_dhcp6_client_errno(client, len, "Could not receive message from UDP socket: %m"); } if ((size_t) len < sizeof(DHCP6Message)) {