On Sun, Jan 18, 2026 at 05:16:08PM -0500, Jon Maloy wrote:
As a preparation for handling multiple addresses, we update ignore_arp() to check against all addresses in the addrs[] array.
Signed-off-by: Jon Maloy
LGTM, except insofar as I'm still not convinced the v4 only array of inany_addrs makes sense.
--- arp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arp.c b/arp.c index bc77a9f..d8063e2 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,11 @@ 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, inany_v4(&c->ip4.addrs[0].addr), sizeof(am->tip))) - return true; + /* Don't resolve any of the guest's addresses */ + for (i = 0; i < c->ip4.addr_count; i++) + if (!memcmp(am->tip, inany_v4(&c->ip4.addrs[i].addr), + sizeof(am->tip))) + return true;
return false; } -- 2.52.0
-- 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