From ab64a5cb5e141edea1a41a3c3e40fb804e1880b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Sj=C3=B6lund?= Date: Tue, 3 Sep 2024 14:04:39 +0200 Subject: [PATCH] linux: fix recvfrom error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/containers/crun/issues/1531 Signed-off-by: Erik Sjölund --- src/libcrun/linux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libcrun/linux.c b/src/libcrun/linux.c index fefdb4aedc..9c350e65eb 100644 --- a/src/libcrun/linux.c +++ b/src/libcrun/linux.c @@ -5545,8 +5545,7 @@ libcrun_configure_network (libcrun_container_t *container, libcrun_error_t *err) /* The first 4 bytes in the data are the negative error code in native endianness. */ errno = -(*(int32_t *) (buf + sizeof (struct nlmsghdr))); - if (UNLIKELY (errno < 0)) - return crun_make_error (err, errno, "recvfrom(PF_NETLINK)"); + return crun_make_error (err, errno, "recvfrom(PF_NETLINK)"); } }