From 5418bd9a06c71f5c8e47a71aa460baf6d2a4f32e Mon Sep 17 00:00:00 2001 From: Hayato Kiwata Date: Fri, 17 Jul 2026 02:21:21 +0900 Subject: tap: Fix EAGAIN/EWOULDBLOCK check in tap_pasta_input() On Linux, EAGAIN and EWOULDBLOCK have the same value. Commit d2a1dc744b10 ("tap: Restructure in tap_pasta_input()") added a check for EWOULDBLOCK on purpose: > - Check for EWOULDBLOCK as well as EAGAIN for the benefit of any future > ports where those might not have the same value However, the condition uses && instead of ||, so it can never be true on a platform where EAGAIN and EWOULDBLOCK are different. Use || instead so that the check works as intended on such platforms. Fixes: d2a1dc744b10 ("tap: Restructure in tap_pasta_input()") Signed-off-by: Hayato Kiwata Reviewed-by: David Gibson Signed-off-by: Stefano Brivio --- tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tap.c b/tap.c index d418961..cf87591 100644 --- a/tap.c +++ b/tap.c @@ -1329,7 +1329,7 @@ static void tap_pasta_input(struct ctx *c, const struct timespec *now) continue; } - if (errno == EAGAIN && errno == EWOULDBLOCK) + if (errno == EAGAIN || errno == EWOULDBLOCK) break; /* all done for now */ die("Error on tap device, exiting"); -- cgit v1.2.3