On Sun, Dec 14, 2025 at 08:54:35PM -0500, Jon Maloy wrote:
We update ignore_arp() to check against all addresses in the addrs[] array, not just addrs[0]. This ensures ARP requests for any of the guest's configured addresses are properly ignored.
Signed-off-by: Jon Maloy
--- arp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arp.c b/arp.c index 7eaf517..61c309e 100644 --- a/arp.c +++ b/arp.c @@ -41,6 +41,8 @@ static bool ignore_arp(const struct ctx *c, const struct arphdr *ah, const struct arpmsg *am) { + int i; + if (ah->ar_hrd != htons(ARPHRD_ETHER) || ah->ar_pro != htons(ETH_P_IP) || ah->ar_hln != ETH_ALEN || @@ -53,9 +55,10 @@ static bool ignore_arp(const struct ctx *c, !memcmp(am->sip, am->tip, sizeof(am->sip))) return true;
- /* Don't resolve the guest's assigned address, either. */ - if (!memcmp(am->tip, &c->ip4.addrs[0].addr, sizeof(am->tip))) - return true; + /* Don't resolve any of the guest's assigned addresses, either */ + for (i = 0; i < c->ip4.addr_count; i++) + if (!memcmp(am->tip, &c->ip4.addrs[i].addr, sizeof(am->tip))) + return true;
Ah, right. I think this needs to move earlier in the series, otherwise things are broken in between allowing multiple addresses and this change.
return false; } -- 2.51.1
-- 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