From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id B0F3F5A031A for ; Thu, 25 Jul 2024 05:47:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1721879255; bh=yLKbBqSAZ7PUnEUSXMigrAp30WtDLPy8t+qddmYl6ng=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XaFCGzQtmPWYPTr+2PzYAOwy1yqbWUJ0khDdwI4k+hbLAyZ5e15ed6b9m9wUMgnkp yuQRo6upVLxPGQwUORJ4RakzsJlucGdWI1dP+IVtFt7P++Vmvmk8GEvM5W7WczV4/Z tUNUjvZZ3SSsW6OTms7gry3xSXZOwA1yohYxGF60dHpDuxleB6/A40gPRObL3X8dX2 ooDdZfvD6t14rd359dne8b5RGW3eQPj+9uuBPvyHrPutRUMMY3UnzsjNfiIdSEQWB1 zWBXnnxb15V1ea18EjEHb7vjlIr0c8Qclr7g5yeHfTK96l8Rs+Pvl0m8Ew7fHtWimN P/ayXsrsLfJMA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WTxfb41tKz4x0C; Thu, 25 Jul 2024 13:47:35 +1000 (AEST) Date: Thu, 25 Jul 2024 13:21:19 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 01/11] tap: Don't quit if pasta gets EIO on writev() to tap, interface might be down Message-ID: References: <20240724215021.3366863-1-sbrivio@redhat.com> <20240724215021.3366863-2-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0zm5IfFScXeG8GAr" Content-Disposition: inline In-Reply-To: <20240724215021.3366863-2-sbrivio@redhat.com> Message-ID-Hash: T7WTZIHFIOJMMSVEAKYK7RUNJRYDY34J X-Message-ID-Hash: T7WTZIHFIOJMMSVEAKYK7RUNJRYDY34J 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: --0zm5IfFScXeG8GAr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 24, 2024 at 11:50:07PM +0200, Stefano Brivio wrote: > If we start pasta with some ports forwarded, but no --config-net, say: >=20 > $ ./pasta -u 10001 >=20 > and then use a local, non-loopback address to send traffic to that > port, say: >=20 > $ socat -u FILE:test UDP4:192.0.2.1:10001 >=20 > pasta writes to the tap file descriptor, but if the interface is down, > we get EIO and terminate. >=20 > By itself, what I'm doing in this case is not very useful (I simply > forgot to pass --config-net), but if we happen to have a DHCP client > in the network namespace, the interface might still be down while > somebody tries to send traffic to it, and exiting in that case is not > really helpful. >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tap.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/tap.c b/tap.c > index 32a7b09..6930ad8 100644 > --- a/tap.c > +++ b/tap.c > @@ -324,6 +324,7 @@ static size_t tap_send_frames_pasta(const struct ctx = *c, > case EINTR: > case ENOBUFS: > case ENOSPC: > + case EIO: /* interface down? */ > break; > default: > die("Write error on tap device, exiting"); --=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 --0zm5IfFScXeG8GAr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmahxKEACgkQzQJF27ox 2GeFwQ/5AWOmRnTLmu8alUy9d4w1LVZk31B+6mkXDmt6jCT1IghCLkfGOAYH2hKl gCC8A33F/2XyQc63fDWaK9MDp0DZ+wiO6C6fCdwDdSPP2O78g6lwsaOtiSitrkxH uRA+TvyIWuTGENF21747s1FFQq2HaNYSZ1ZQM8om+blFELDwghHyWlZbthn6dlg5 +A+GxMuWus0N9hNdKscGqCeYSlGL8vwBSB+exBGghxIOQdjY19hpVhW4kztraLWB gni6qt7pXl20dyhuTdh3r3SpHtZL+BMeRdwDRj0WQPpHxo5YiEbeuatOb7Z77V7X ZThC0AANamPUw0acM1PM+5PC7k479z1nmLHDabKDvHj4pZH24cgeWb8mNw8sIj4d GOFIyDFLgekdnxNnSUosToXtWa3+FgGVxxTcntvVeuN48sKlPeFkfhF0MVx2dnvo RXcTRLzFCCXmIiIvox+fxqo1VXoFpv/YgAiUhIUeGMBfMGcBZ7pL+8uwNWE3ri4i JdDAudUBMN/DxyhcfTvnN98UePEftHy8UG94SfZJe0qFy6RB2h/wDfmvWxXD7Iua u+SwkQ9biRAIcgZ9xl+kkSnZzPkJ99GNvLGnMZATSN4JtIlfcFpmBNLM8vG3doQA YORezFYq7OnCGcnva+kFuXLzEowRPBBybF+BRWubuswBb+Tkkx8= =wtVc -----END PGP SIGNATURE----- --0zm5IfFScXeG8GAr--