From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202606 header.b=lJ3lE+lV; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 0EFC15A0262 for ; Fri, 17 Jul 2026 03:53:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1784253232; bh=JN1GWHvK3NlFHhZz6XQ55iD711fP0nv9n8IAcbD/caw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lJ3lE+lVyx0bx9Kb8eOGnizQDFYOu0jfsilKlmNxDa0SSyZVA9bEkPGtScsqFrUSa L8aJd1EBNtZMk86T2ws0EodMKSMEzzrcVWx+k1+68TS58W9EDWt/R/hjlc9+k8i31M DJAHK5R8WS/JM+IBJhpVn9qO8b/0kKh1c/zkuhS3GdAqJrvxRgSNR1Vz2sYzOOINYZ IYkBCbfImbl0cSNZS3p3e6aosnfNEkjWPnOfGU57GOD9lDnrRQXjgnZDV9AWz+7ADe dZ3j9dIjWnrcdJadyExYfSfMJUwHfAtGiWWP2OPsO1WJE1QLRuuJNdTQMSTO/DwHQA xfh62NQiMFJfQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4h1Xy84D4Wz4w9Z; Fri, 17 Jul 2026 11:53:52 +1000 (AEST) Date: Fri, 17 Jul 2026 11:30:42 +1000 From: David Gibson To: Hayato Kiwata Subject: Re: [PATCH] tap: Fix EAGAIN/EWOULDBLOCK check in tap_pasta_input() Message-ID: References: <20260716172121.80216-1-dev@haytok.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2lB1Fl9i+nmQHR05" Content-Disposition: inline In-Reply-To: <20260716172121.80216-1-dev@haytok.jp> Message-ID-Hash: TKFAGSXZB766LRQZJIP4HWL33HSI3O6O X-Message-ID-Hash: TKFAGSXZB766LRQZJIP4HWL33HSI3O6O X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --2lB1Fl9i+nmQHR05 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 17, 2026 at 02:21:21AM +0900, Hayato Kiwata wrote: > On Linux, EAGAIN and EWOULDBLOCK have the same value. Commit > d2a1dc744b10 ("tap: Restructure in tap_pasta_input()") added a check for > EWOULDBLOCK on purpose: >=20 > > - Check for EWOULDBLOCK as well as EAGAIN for the benefit of any future > > ports where those might not have the same value >=20 > However, the condition uses && instead of ||, so it can never be true on a > platform where EAGAIN and EWOULDBLOCK are different. >=20 > Use || instead so that the check works as intended on such platforms. >=20 > Fixes: d2a1dc744b10 ("tap: Restructure in tap_pasta_input()") >=20 > Signed-off-by: Hayato Kiwata Oops, mea culpa. Reviewed-by: David Gibson > --- > tap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 st= ruct timespec *now) > continue; > } > =20 > - if (errno =3D=3D EAGAIN && errno =3D=3D EWOULDBLOCK) > + if (errno =3D=3D EAGAIN || errno =3D=3D EWOULDBLOCK) > break; /* all done for now */ > =20 > die("Error on tap device, exiting"); > --=20 > 2.39.5 (Apple Git-154) >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --2lB1Fl9i+nmQHR05 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmpZhbIACgkQzQJF27ox 2Gc0Gw//cD4eTk4m6JI3d9iQtLEIura8ecyh9xG1GSNhx55QkETtorTpCM4B4Ca/ 5+JFmW0TBwjIpc4lqLBR9owpVjoqX2i5tg4g4xgOerTXiUbt3oIMNiYkdvj8IQV3 RswC63J6UuEriRmvfGAz/vAr+px2CxekhJWlYax+wwi6NMwfIWF+mfqWy5S8ZLDD NqlROiMkefH0FSK/8BcSn7xcBSLFeW1IjTBD3ESkRwc5VJOJqRHmWhIKb9xN+nlf zPPbSndOuOSDA/NsfPSekT0xYZgFegO9tJ7LLuXSZjaHTbEaRmpg7vgRPz89tLKu JuuHLbMxN4CxFRVHMrJczM/i/9rwARZ2fR89mEiLq1SxW5vqYFKsyYhgvUsb7aT9 eHOog3rDgj99Ej7yLz6w5Wn4euOWb4yQsjrogWd1R68XqyQTYdXKvyvVhvsCpS8I /ICl8YQ8mr3+badO1hADQpr09K2zVkV5gQNl2SbV+TWsyMcSHSouBICOuUwEj6NN nzIHoPB4ucw29xbGh5UDNxHCQFyeFOpVBQlBnhbBzVsC9qA32I44+EcFgMFvcA3Q fYWmzmIoWE7H1/cuL0B14xomLZcxRzYXKiu0fwqmzkNrbkr23zPYFKtScx1ZzSRh ZFcnVVR070WW2yOOeN301xhUbyUtYVpBiglw57QkJ5JmVGdfKlA= =L6U+ -----END PGP SIGNATURE----- --2lB1Fl9i+nmQHR05--