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=Q51SWXcw; 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 BEE445A0262 for ; Sat, 20 Jun 2026 00:10:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781907014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sa8l3H5QlhaPhtjy0sLBWthxmbiHnznDs/Z7mYvmM2E=; b=Q51SWXcwBSAMRbmpLsxcViCEcYu3joxzaALaB3JgNEMebJpv38uJHecEHdJ9JQYrVwp0r9 ZZIyzGGqjRZke5QO1RwoWjQRjqZVZKi+kg2ti8FtCTe0zNOvO+butWy+CgTNuXYejX772n T3WtKHvc3LBEIiligdMW/5LWwfJp5U8= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-320-n3x_nFW2M5yZF7NscAYN4A-1; Fri, 19 Jun 2026 18:10:13 -0400 X-MC-Unique: n3x_nFW2M5yZF7NscAYN4A-1 X-Mimecast-MFC-AGG-ID: n3x_nFW2M5yZF7NscAYN4A_1781907012 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4924725bec9so2077855e9.1 for ; Fri, 19 Jun 2026 15:10:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781907012; x=1782511812; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Sa8l3H5QlhaPhtjy0sLBWthxmbiHnznDs/Z7mYvmM2E=; b=CBj7Qktxl7hiKHT4eEadVgeWJ/hy3SsbvkYk4p+NL9/4OLtrxHAigGeao+HmpQjeBy e6HiKA1CaVgB5Uvrp7kGE+TN0eZl4308304fMrwvlffpviiU1Y7nSmaSytl9P1fxcd46 jihKq6Jo+9M32qknPzJbaw2lSkYE2lbYtVtJgLJUbmf8WwNmEqrT/ziP1fb26ebHT7u8 cGfPISZOQPGwzSqy/+bfHpHQbLV9DYdLqNPsX1ZcC+mW1VT7xd60HCnBwI1TwV5OWr6c Vd58lEP+/vyn74RS3WrJAq46uBe7ANiaNbhIBPXihxKaZGv1jTTjamqBTIGLiCjo/6fz xNZg== X-Forwarded-Encrypted: i=1; AFNElJ/3jiIjUjzwvaR3hgxXsrMI9O4DOXlfIqxAmmGFx8ACTXpo6qIHVz/hO+OJ539MF0Y/KMc3FxGTZ7I=@passt.top X-Gm-Message-State: AOJu0YxAfG6YDEQsLN5k3WACNN5Q4EoeVW1GQlvK5+fd9ghLFEChaKGa wQDQU5eKd8AY8Ox6xEGG03DK+0geNMkB8yyx60Vr7UNgPKCJS+Od2bMe/masOfxxOKrmmoAQhJ5 K5YyalnTn0pfU05K3pveO0xqGuGiElCt6YGQcCmZHwNYkfZi1Leu5aA== X-Gm-Gg: AfdE7ckny0Dd/2cZ7BRi2DBQVZTgRiacodMC+Y9PbWyCL//NOBrgo5XBeM9nQx12/y8 /fAAcgV5Az/c748rx2MQcFsVOBn6K1qiDIGVqbZdI/+Yl5Vx68VL4Q/nYvhkJe8RqRgwpJg8AWA gBITPjpb5gMcre8NBi9jiHNb87fSrFSYMa1LyJ02u1kD/jc+igLtExgxIJxfzh8rXr2rZJSJn5j 6cGphcYycDm/LfV/aKAz6kS5tHXN7xkeNBmXraGWa0XVrM2rUkne0WTtPn5JLqdwdzD+QwPHNAm fDnzUwuUCMVMKl6SiMfwlFQEIM2AeTvLwgsoyeY1xXFmgwj5E1H02+R1gWntuxx05RupfP0GjHe IilDBMyZ+bP1gy3dv2npzxrPUaaTXFZGRE6jOt9s= X-Received: by 2002:a05:600c:8519:b0:492:34f5:94cb with SMTP id 5b1f17b1804b1-492490af432mr12664225e9.26.1781907012093; Fri, 19 Jun 2026 15:10:12 -0700 (PDT) X-Received: by 2002:a05:600c:8519:b0:492:34f5:94cb with SMTP id 5b1f17b1804b1-492490af432mr12663885e9.26.1781907011622; Fri, 19 Jun 2026 15:10:11 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49249238900sm14407195e9.4.2026.06.19.15.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2026 15:10:11 -0700 (PDT) From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH v7 04/13] arp: Check all configured addresses in ARP filtering Message-ID: <20260620001009.79bc69e1@elisabeth> In-Reply-To: <20260413005319.3295910-5-jmaloy@redhat.com> References: <20260413005319.3295910-1-jmaloy@redhat.com> <20260413005319.3295910-5-jmaloy@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Sat, 20 Jun 2026 00:10:10 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2JKQcmsg0oQ2cqv-EzG4Vmli4v3DJCC_PUY6e3uDGF4_1781907012 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 5IOJW3F2363NXD4PIYGNAS765IYYUA6C X-Message-ID-Hash: 5IOJW3F2363NXD4PIYGNAS765IYYUA6C X-MailFrom: sbrivio@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 CC: david@gibson.dropbear.id.au, passt-dev@passt.top 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: On Sun, 12 Apr 2026 20:53:10 -0400 Jon Maloy wrote: > 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 > v6: -Made loop in ignore_arp() a little more palatable, > but not entirely as suggested by David. > v7: -Curly brackets in ignore_arp(), as suggested by Stefano. > -I did not modify the for_each_addr(), macro, as Stefano suggested, > since it also would require us to add an extra parameter indicating > the array length. > --- > arp.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/arp.c b/arp.c > index a7fd82f..a3fdeb6 100644 > --- a/arp.c > +++ b/arp.c > @@ -42,6 +42,7 @@ static bool ignore_arp(const struct ctx *c, > const struct arphdr *ah, const struct arpmsg *am) > { > const struct guest_addr *a; > + union inany_addr addr; > > if (ah->ar_hrd != htons(ARPHRD_ETHER) || > ah->ar_pro != htons(ETH_P_IP) || > @@ -55,11 +56,12 @@ 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. */ > - a = fwd_get_addr(c, AF_INET, 0, 0); > - if (a && !memcmp(am->tip, inany_v4(&a->addr), sizeof(am->tip))) > - return true; > - > + /* Don't resolve any of the guest's addresses */ > + inany_from_af(&addr, AF_INET, am->tip); > + for_each_addr(a, c->addrs, c->addr_count, AF_INET) { > + if (inany_equals(&addr, &a->addr)) > + return true; > + } ...same here about a lookup function. > return false; > } > -- Stefano