From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Hua1PeQX; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 825675A0626 for ; Sun, 18 Jan 2026 23:16:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768774586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oXJYagmRaA8V6s03jBgc+ALnM71uOxLge3y12ZGBAUs=; b=Hua1PeQX7QrQZjioczugQ/xtLoeJ2OaAcFQCHNbIMuTjuFLtUfg2JAywlPx8k8CpiOn5i4 RE7aM1EuumkjP/xlBiSb0fk73H15ogS6xKMk4Qxef3ew86PwnW/Feopg3pOsnYtemXPl7X NP3S2jkcOvHbGKR6YFiXLjzRXtI/2/Y= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-Tu0QvwphNGW5kYXZMOPmbw-1; Sun, 18 Jan 2026 17:16:23 -0500 X-MC-Unique: Tu0QvwphNGW5kYXZMOPmbw-1 X-Mimecast-MFC-AGG-ID: Tu0QvwphNGW5kYXZMOPmbw_1768774582 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AD7DA1956046; Sun, 18 Jan 2026 22:16:22 +0000 (UTC) Received: from jmaloy-thinkpadp16vgen1.rmtcaqc.csb (unknown [10.22.80.38]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CC23419541B0; Sun, 18 Jan 2026 22:16:20 +0000 (UTC) From: Jon Maloy To: sbrivio@redhat.com, dgibson@redhat.com, david@gibson.dropbear.id.au, jmaloy@redhat.com, passt-dev@passt.top Subject: [PATCH v2 5/9] arp: Check all configured addresses in ARP filtering Date: Sun, 18 Jan 2026 17:16:08 -0500 Message-ID: <20260118221612.2115386-6-jmaloy@redhat.com> In-Reply-To: <20260118221612.2115386-1-jmaloy@redhat.com> References: <20260118221612.2115386-1-jmaloy@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: jEm5oVKlWg_ikbNor0xaAEP00NVhAtSBmJ4tM-iZ3IA_1768774582 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: 5AKAX5MAKE3N5VK5ZM6XK6AG3PQCUSV5 X-Message-ID-Hash: 5AKAX5MAKE3N5VK5ZM6XK6AG3PQCUSV5 X-MailFrom: jmaloy@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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