On Sun, 12 Apr 2026 20:53:17 -0400
Jon Maloy
We introduce a CONF_ADDR_DHCP flag to mark if an added address is eligible for DHCP advertisement. By doing this once and for all in the fwd_set_addr() function, the DHCP code only needs to check for this flag to know that all criteria for advertisement are fulfilled. Hence, we update the code in dhcp.c correspondingly.
We also let the conf_print() function use this flag to determine and print the selected address.
Signed-off-by: Jon Maloy
[...]
--- a/passt.h +++ b/passt.h @@ -83,6 +83,7 @@ struct guest_addr { #define CONF_ADDR_GENERATED BIT(2) /* Generated by PASST/PASTA */ #define CONF_ADDR_LINKLOCAL BIT(3) /* Link-local address */ #define CONF_ADDR_OBSERVED BIT(4) /* Seen in guest traffic */ +#define CONF_ADDR_DHCP BIT(5) /* Advertise via DHCP (IPv4) */
I think the name might lead to confusion, especially the day we get a netlink monitoring for addresses, as it might seem to imply that this comes from an address dynamically configured on the host. Perhaps CONF_ADDR_DHCPOFFER? -- Stefano