diff options
| author | Jon Maloy <jmaloy@redhat.com> | 2025-11-26 19:53:16 -0500 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-11-27 22:29:25 +0100 |
| commit | 2002c7d39c9d4fa01099d7f780b66cfb213b6454 (patch) | |
| tree | 3358e60e554c0bb8f5e9781fdc2d3d6a9b853127 /test/lib | |
| parent | 391c15afedacbc4c5e01bfd05ef73be5ab1770ac (diff) | |
| download | passt-2002c7d39c9d4fa01099d7f780b66cfb213b6454.tar passt-2002c7d39c9d4fa01099d7f780b66cfb213b6454.tar.gz passt-2002c7d39c9d4fa01099d7f780b66cfb213b6454.tar.bz2 passt-2002c7d39c9d4fa01099d7f780b66cfb213b6454.tar.lz passt-2002c7d39c9d4fa01099d7f780b66cfb213b6454.tar.xz passt-2002c7d39c9d4fa01099d7f780b66cfb213b6454.tar.zst passt-2002c7d39c9d4fa01099d7f780b66cfb213b6454.zip | |
arp/ndp: don't send messages on uninitialized tap interface
When running pasta without --config-net, the tap interface is opened
and assigned a valid file descriptor, but intentionally not brought
up in the namespace. This is the expected behavior when the user wants
to configure the namespace manually.
However, in PASTA mode the code is attempting to send ARP announcements
and NDP messages (initial requests and unsolicited NAs) based solely on
whether c->fd_tap is valid, without checking if the interface actually
is up and ready to transmit. This results in send failures, and when
debug is activated (pasta -d) we see error printouts for these early
messages.
We now add new function tap_is_ready() which checks both conditions:
- Whether fd_tap is valid (all modes)
- Whether the tap interface is up (pasta mode only). In this mode, we
use the existing c->pasta_conf_ns flag, which indicates whether
pasta_ns_conf() configured and brought up the interface. This test
is simple, and good enough for now.
We update all functions that send unsolicited ARP/NDP messages to
check with the new function before making any send attempt.
This eliminates spurious send errors when starting pasta without
--config-net, while preserving correct behavior when the interface
is properly initialized.
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/lib')
0 files changed, 0 insertions, 0 deletions
