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: > > $ ./pasta -u 10001 > > and then use a local, non-loopback address to send traffic to that > port, say: > > $ socat -u FILE:test UDP4:192.0.2.1:10001 > > pasta writes to the tap file descriptor, but if the interface is down, > we get EIO and terminate. > > 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. > > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tap.c | 1 + > 1 file changed, 1 insertion(+) > > 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"); -- 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