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=E8roWFXQ; 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 D52B35A0262 for ; Mon, 30 Mar 2026 23:57:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774907858; 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=rPd1mv0XylUYykQHU47ahg2efPrTX+86TdNINIlkSCk=; b=E8roWFXQDvjkebX3wmdjWRizvNOvjq2lSwBpdUl7ZW+hK25Sybp/DtnchylzfTSsZ3DANi EIq/iQVrJKIySeWbV5ky8/nrcnOU6OjNlJpWu4yv+NbxgdxtpzS0rRnmxVUQSAvoEv3TyJ aWhlB+Pl9n6lrw5c71Ih8ogCr21sVwA= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-578-90U691zMP4W7QYUH0kA9tA-1; Mon, 30 Mar 2026 17:57:37 -0400 X-MC-Unique: 90U691zMP4W7QYUH0kA9tA-1 X-Mimecast-MFC-AGG-ID: 90U691zMP4W7QYUH0kA9tA_1774907856 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-43d034589d0so813590f8f.1 for ; Mon, 30 Mar 2026 14:57:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774907856; x=1775512656; 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=rPd1mv0XylUYykQHU47ahg2efPrTX+86TdNINIlkSCk=; b=TytnX6nFYrDM5nL4ICpELF49g+xkmepjFU37PlXTtEMW1XIBuKHO4RctKomGK1gQHY aSpaOs+wwZAir8LpFj3OOXoWQhuwXDAd6oYEQPg+tLJyns8rM6RO96aT7VHHYgTiDPaH /3AqUfLiCCqokTOGfiv1ReJ9KtW1mKXk3tAgiSus6ugXBrC5m8zEfRUtNAEyeUkpZBnk Uz516HGz0ttHZFCDNrUxeeCm+RxzjyNpfW1MSzuTSUOVgN50pNP1SPJ3lCQpdHXlo87V tlpUcXbCWJEtaFGAvFeXGfCJMzUscJbc9S8t3cXAHMrOr1nzmjiE19/5P6nqu4EIi++3 ugtg== X-Forwarded-Encrypted: i=1; AJvYcCX4Mmnj3KV1OHM9734v/ZgFyJW7sMjzSGgdOkF+X21llC5bUQqomDDlx+MOj2gvQH1/vS4Pqp0bing=@passt.top X-Gm-Message-State: AOJu0YwCi0+hKOvUlggEz7yOcvix5f88JhG1pveVO7rLzcwzTAxVWx+z vJYYo9r1VsVG+XbEwh9WKdHD/38+dUe8MgrNZ0sbllukWUWLuAhYTe++r9QH3bQc/N7hfvVudlj ehho91vNr93dLOQDGZYJ5YfTPBB/EGUwqx8Va7IrcaLCvyuKw0fjw1g== X-Gm-Gg: ATEYQzzq7JrEFcx43QKexJOM28tgZxLdlAh1B1pezOmxsRF/MiBNBiTNATdXW+wYBhE YPjPuizwzYiG833b2jylSbDOGxJ2PLMKzbppc0/pjegoR4BQ5H2TTc/mYuVvMEKVA1mPcyJdQy5 DvAQ/40aN09qDUCXkEJG/EtrUBxsRCZm9qY/oJjXR/yhq9n8kofTRboMQdMBgoUubycmDRdCbVi +RcReJkgxLNAmY+hZmI7Khw731kEAJWkUvT4j5VxZKOMBdgj2dCCfNNVgFjm5BNgcg09I46o+3C DMBmAVSh6OD48Uuzq5DccUpkX76njk1USBiZUFAiYG2vekRG212LxqkdL09UHJgbBy5juFgqVsY dZN1DrrtPevrVwOgqWCnYJVN5ssWZV4rBB6GfZJHSF2W8opEcWw== X-Received: by 2002:a05:6000:430c:b0:43b:4273:a6d2 with SMTP id ffacd0b85a97d-43b9e98f267mr25264212f8f.13.1774907855972; Mon, 30 Mar 2026 14:57:35 -0700 (PDT) X-Received: by 2002:a05:6000:430c:b0:43b:4273:a6d2 with SMTP id ffacd0b85a97d-43b9e98f267mr25264168f8f.13.1774907855438; Mon, 30 Mar 2026 14:57:35 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43cf21e2628sm24330450f8f.6.2026.03.30.14.57.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 14:57:34 -0700 (PDT) From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH v6 04/13] arp: Check all configured addresses in ARP filtering Message-ID: <20260330235733.40af1f71@elisabeth> In-Reply-To: <20260322004333.365713-5-jmaloy@redhat.com> References: <20260322004333.365713-1-jmaloy@redhat.com> <20260322004333.365713-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: Mon, 30 Mar 2026 23:57:34 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: BExRIDo9FG3XIDdyRN2q6lskLHK4mgkA3aMK0UQTBIM_1774907856 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: Z2KKHIPVKH7DK6XTMSZ7II5LMAXKEMHS X-Message-ID-Hash: Z2KKHIPVKH7DK6XTMSZ7II5LMAXKEMHS 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 Sat, 21 Mar 2026 20:43:24 -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. > --- > arp.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/arp.c b/arp.c > index 18ff5de..6614804 100644 > --- a/arp.c > +++ b/arp.c > @@ -41,7 +41,8 @@ > static bool ignore_arp(const struct ctx *c, > const struct arphdr *ah, const struct arpmsg *am) > { > - const struct guest_addr *a = fwd_get_addr(c, AF_INET, 0, 0); > + const struct guest_addr *a; > + union inany_addr addr; > > if (ah->ar_hrd != htons(ARPHRD_ETHER) || > ah->ar_pro != htons(ETH_P_IP) || > @@ -55,9 +56,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 (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, AF_INET) It's not really obvious that this iterates over c->addrs. I think it might be clearer to build for_each_addr() to take c->addrs instead, even if it's slightly more verbose (but it shouldn't add lines either). Nit: curly brackets around blocks with multiple lines. > + if (inany_equals(&addr, &a->addr)) > + return true; > > return false; > } -- Stefano