From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id F27425A004E for ; Mon, 24 Jun 2024 03:21:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1719192098; bh=o2WG+32EecJdJ66i2vRTIb9WAP/hEIqMfrgOIAdEGdY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aKZcYZtMUBSep67x4bJWsK5s1sn9zSYy03yEWBpbJPpbE65RFmWZiE6Z2KxW3r5Uv Zt183RN1Qr+pss9PncftCgKE82RuSd8NcfssPMCCtE1jy+azPKuWQKlq8BOf7/sLj/ kSJPU3iRAmfFGGERjogPzEndgy7ClGxo23HYp84dpDDh/oc4YHZINZCeZShlNhNaxJ ZOiz9AReER932BXBgvl9XFdYo8iUAz+yLxKE5r/7yEmF8mV3LhRzE5rgOfhrBf6FOu cdbUrEqnRNMLbwpSa2C9H9IZSIEhIt1zQ2R9PVruUeLR1hjTTd8GO4sClquO/KDp2J +BJA5Ukq6vbLw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4W6qtV06Fjz4wny; Mon, 24 Jun 2024 11:21:38 +1000 (AEST) Date: Mon, 24 Jun 2024 11:20:48 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 1/2] Revert "udp: Make rport calculation more local" Message-ID: References: <20240621155323.1313483-1-sbrivio@redhat.com> <20240621155323.1313483-2-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q0oDAIPpJpS8/pTF" Content-Disposition: inline In-Reply-To: <20240621155323.1313483-2-sbrivio@redhat.com> Message-ID-Hash: MJVW5A2UDOWU3QS3QET4QWWELAPYH4SJ X-Message-ID-Hash: MJVW5A2UDOWU3QS3QET4QWWELAPYH4SJ 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: passt-dev@passt.top, Laurent Jacquot 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: --q0oDAIPpJpS8/pTF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 21, 2024 at 05:53:22PM +0200, Stefano Brivio wrote: > This reverts commit c80fa6a6bb4415ad48f9e11424310875d0d99bc7, as it > reintroduces the issue fixed by commit 1e6f92b995a9 ("udp: Fix 16-bit > overflow in udp_invert_portmap()"). >=20 > Reported-by: Laurent Jacquot > Link: https://bugs.passt.top/show_bug.cgi?id=3D80 > Signed-off-by: Stefano Brivio Argh, dammit. So, Reviewed-by: David Gibson =2E. but I think we really need to put a comment on this, otherwise one of us is likely to make the same mistake again, because that particular promotion rule is truly arcane. > --- > udp.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/udp.c b/udp.c > index e79ca93..8181900 100644 > --- a/udp.c > +++ b/udp.c > @@ -279,9 +279,10 @@ static void udp_invert_portmap(struct udp_fwd_ports = *fwd) > "Forward and reverse delta arrays must have same size"); > for (i =3D 0; i < ARRAY_SIZE(fwd->f.delta); i++) { > in_port_t delta =3D fwd->f.delta[i]; > + in_port_t rport =3D i + delta; > =20 > if (delta) > - fwd->rdelta[i + delta] =3D NUM_PORTS - delta; > + fwd->rdelta[rport] =3D NUM_PORTS - delta; > } > } > =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 --q0oDAIPpJpS8/pTF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZ4yewACgkQzQJF27ox 2Gehsw//bkVz+b9tNk6Brx/ZXbcUc+IrkMug98nE9BZoHsl8/J0baDHpTAbKMQ3Z +Wl1WzX/sMDeFU6EgTboelHvrUI2NGVJlVdHub+FWrYzX6YUkGxWqKnsK5EElT1t faxOo4H84mwTHwTvXXTmZVH0vN4XdjUi1nj3mhVhGu+wlZVbN6ebv6DQ0/eN2S6W xaWyic8V8E53RO8+oPopM9jVcn73PJhXiWvxC6UQK92YxLE2r3mibwjf2VhTqy+1 eD8JSgnKZygFYJCWzSkBnCF1DCJbAuYzycZmhs1MFNQin7IV6As7cuBCMcSAEV0c AKCGLLR44dMDl4nc/pEJSCWOVlqf9XqDtIh3svNQKP7WeHPdAKT/h5eGUVvfw1OR QxnilG3p1YBHvf5ZyRWa3KT4jdjwK/qEBBsvdbwY/n7oKhyo76AM5QiueqNnTSH4 rtnSkB7wqvXcBUXcP34D6gRK7Pzcpzg2INTsx//+NNd7SkXA8EPwxvvJGrcCWfs8 U4X2BGcqcvMFYqAS0MtnsjTAf3NhvYUfpCjDWRCe7btgIdZMIlzfD72HW1r5SPDu dIJXqbu0JBosyYDtI48TmMwtPMahxU2I9J0+pWbb7G9wwox1Z/MOR+Zng2mFiJUz i2Ksx3mOob1uBRnZNMrZcJWchBgb5NDTksh8pHykaWuR618jUFE= =POZ5 -----END PGP SIGNATURE----- --q0oDAIPpJpS8/pTF--