From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202512 header.b=Y8O+ByAK; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id B35685A0774 for ; Mon, 15 Dec 2025 11:08:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202512; t=1765793302; bh=31EDVfIqSZ70KnJiob6f+8ZT8CVX5vC85jkNvyJmxh0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y8O+ByAKMe6wWzODOK4F5jEZZWNVwW06jTG18ExOa8JqOW62KQQ06QY4pgo9t64TW K34uywXCJ6YkAUcVEZXQsfh5jRsZX8iGfv9NUGWbRMfE0t+rB4Wh/b51YEt+qKvVJj /6IkW8+btDQDzN6nzrSHlsJ4ZG4WrzG/wX7uIskdLNGLVDXVPhwJvJ0+nuRPygfftM 3SU/8utQsW9YhGPzZlP2Ue3u7xlrc4/lEUyF2h0uGWab7SjN5fCRwQ/cui90lgJPz+ FH9iCD82VZyxl2pCBn2CkowEhiuWNKNaw+qfOBxCkSi62XheQiXyMdsjSRKF37NrlK /FUBQ34lG9tZg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dVG3V2TXBz4wGK; Mon, 15 Dec 2025 21:08:22 +1100 (AEDT) Date: Mon, 15 Dec 2025 21:07:17 +1100 From: David Gibson To: Jon Maloy Subject: Re: [RFC 06/12] arp: Check all configured addresses in ARP filtering Message-ID: References: <20251215015441.887736-1-jmaloy@redhat.com> <20251215015441.887736-7-jmaloy@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="seQNDyy2cwcrOzFV" Content-Disposition: inline In-Reply-To: <20251215015441.887736-7-jmaloy@redhat.com> Message-ID-Hash: L3YKUZ3V5IOPLQU6CY6B4JOCU2Z6EQQX X-Message-ID-Hash: L3YKUZ3V5IOPLQU6CY6B4JOCU2Z6EQQX X-MailFrom: dgibson@gandalf.ozlabs.org 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: sbrivio@redhat.com, dgibson@redhat.com, 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: --seQNDyy2cwcrOzFV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 14, 2025 at 08:54:35PM -0500, Jon Maloy wrote: > We update ignore_arp() to check against all addresses in the addrs[] > array, not just addrs[0]. This ensures ARP requests for any of the > guest's configured addresses are properly ignored. >=20 > Signed-off-by: Jon Maloy > --- > arp.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) >=20 > diff --git a/arp.c b/arp.c > index 7eaf517..61c309e 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 !=3D htons(ARPHRD_ETHER) || > ah->ar_pro !=3D htons(ETH_P_IP) || > ah->ar_hln !=3D ETH_ALEN || > @@ -53,9 +55,10 @@ static bool ignore_arp(const struct ctx *c, > !memcmp(am->sip, am->tip, sizeof(am->sip))) > return true; > =20 > - /* Don't resolve the guest's assigned address, either. */ > - if (!memcmp(am->tip, &c->ip4.addrs[0].addr, sizeof(am->tip))) > - return true; > + /* Don't resolve any of the guest's assigned addresses, either */ > + for (i =3D 0; i < c->ip4.addr_count; i++) > + if (!memcmp(am->tip, &c->ip4.addrs[i].addr, sizeof(am->tip))) > + return true; Ah, right. I think this needs to move earlier in the series, otherwise things are broken in between allowing multiple addresses and this change. > =20 > return false; > } > --=20 > 2.51.1 >=20 --=20 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 --seQNDyy2cwcrOzFV Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmk/3dQACgkQzQJF27ox 2GcWRw//dAGeBm31GIaQWXyW59gcQHFUUkGupALu2kMPJKuGI0i/A0VfOXlujSkB RDD7RMUHrdCBfsqddZyrasryX82oXbkgC1IW9TvfRS1L9QjIaVjBOWJMOTri7fju 2ZZsYE+IIkC+wlIStJeMXw4n6Lk5Cewg7+v6fMCox8mgFuknv5+BE7rsvJ7JS1Ji ynxPJn7uXvotbSLctK7Q3Keu004dxTr39H9+ZW18ldiEfD1mU4FjkpTvLeKp7n0u K2s1iscVMX9n0SZh3xsjWDfF9i1bmiITbJkZQuNnHGcfXvHH9PBrrpCCqAog/576 6k/LAF1gwKigQSaiHDLtw83odagXvFbDft3UiCgJd/pADTypQdSJ+WOA4wEWwYZK BtLFX0QVZMK6QqkkSjwf7NvzPhA8fgnoqAd/Wl4p6qlmPnwmCxfEbf74kqdyAzYQ 76OeyDAEreEYxNfMeZCXYD04dYpRAKcurSNYcwPtxR7aREzwJ7ckEfgQ4F1CJaQ3 bFyA9aj3LB0z0IRFfM0PcpjfEroS/4cDNWiylq5F9KeJ8A04n8Vtq1YNMiSMmcN1 UMz62HA/Bm33oSDLCLmBjBrJvEXhgYTnm8ICoQx0uV5XBPhBkm3palCPoMSAgHg6 eKQs8hOTzMfCCgfMY2PTlYzvSEOYcdOawh4cj9h5dMrb5bQOsHs= =YkGm -----END PGP SIGNATURE----- --seQNDyy2cwcrOzFV--