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=GNs/6VZ4; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 884ED5A061A for ; Sun, 22 Feb 2026 18:44:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771782298; 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=U7hdI7QHRygK2iqrfBa277dGrrNfNscLwq1j9iz4gL8=; b=GNs/6VZ4qhtfYoTD5WANY/cxn3XCzl0pmcb1uj2LGsGh4Corona1/1cH0TF8dXlVWlpARx ZQp1BkMSTrEcDqsizEPiFWtQFLgp9ilX9nO+VBYrX9Ex6eHKUD2nNkNj5PanUMfCGVj3oE UlvzA7O69HEpfDUtr99YcvV3n3zWS0A= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-91--EkXElzXMHSpKkGyeqSaMw-1; Sun, 22 Feb 2026 12:44:56 -0500 X-MC-Unique: -EkXElzXMHSpKkGyeqSaMw-1 X-Mimecast-MFC-AGG-ID: -EkXElzXMHSpKkGyeqSaMw_1771782295 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 459571800366; Sun, 22 Feb 2026 17:44:55 +0000 (UTC) Received: from jmaloy-thinkpadp16vgen1.rmtcaqc.csb (unknown [10.22.64.49]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B15B61800370; Sun, 22 Feb 2026 17:44:53 +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 v5 04/13] arp: Check all configured addresses in ARP filtering Date: Sun, 22 Feb 2026 12:44:36 -0500 Message-ID: <20260222174445.743845-5-jmaloy@redhat.com> In-Reply-To: <20260222174445.743845-1-jmaloy@redhat.com> References: <20260222174445.743845-1-jmaloy@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: bUityL6qJkA8o7W6xBV2YjjdaL1NjBVOv_j0IQURX-0_1771782295 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: XZKBQYVFSNPZZMH723YQVEELZ3KOV3IA X-Message-ID-Hash: XZKBQYVFSNPZZMH723YQVEELZ3KOV3IA 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 unified addrs[] array using the for_each_addr() macro. Signed-off-by: Jon Maloy Reviewed-by: David Gibson --- v3: Adapted to single-array changes earlier in this series --- arp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arp.c b/arp.c index 99a6a67..8beb2dd 100644 --- a/arp.c +++ b/arp.c @@ -41,7 +41,7 @@ static bool ignore_arp(const struct ctx *c, const struct arphdr *ah, const struct arpmsg *am) { - struct inany_addr_entry *e = first_v4(c); + const struct inany_addr_entry *e; if (ah->ar_hrd != htons(ARPHRD_ETHER) || ah->ar_pro != htons(ETH_P_IP) || @@ -55,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 (e && !memcmp(am->tip, inany_v4(&e->addr), sizeof(am->tip))) - return true; + /* Don't resolve any of the guest's addresses */ + for_each_addr(e, c, AF_INET) + if (!memcmp(am->tip, inany_v4(&e->addr), sizeof(am->tip))) + return true; return false; } -- 2.52.0