From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 6222F5A0268 for ; Wed, 14 Dec 2022 02:47:34 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4NWyst3CTxz4xcm; Wed, 14 Dec 2022 12:47:30 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1670982450; bh=1NK5TrOORiLjxFhD4ri2qk0yCS4EpJazKxSp8HS/sYE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LkQptT7JK1dKGVQFpUcp5YRAfA7qeLC2UNUzuLhYdBEIHKICtd1pttf/0/hoAQCvj fp+c9ck7u7ZL+GEoNTpsVwgHJh6FYoJV8jLUiNZx0+W2R5PRa6A/q8Ih+UG1xTHkv9 oLMuefgEkEKIvvaFwKskOXRbyH4istYUX+LrOA8I= Date: Wed, 14 Dec 2022 12:22:23 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 5/8] udp: Pre-populate msg_names with local address Message-ID: References: <20221205081425.2614425-1-david@gibson.dropbear.id.au> <20221205081425.2614425-6-david@gibson.dropbear.id.au> <20221213234852.31c05833@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mycxshxLV1oTB7XY" Content-Disposition: inline In-Reply-To: <20221213234852.31c05833@elisabeth> Message-ID-Hash: SBEFVUZXX4J36DL66GLJRDOEPT2AVV2F X-Message-ID-Hash: SBEFVUZXX4J36DL66GLJRDOEPT2AVV2F 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 X-Mailman-Version: 3.3.3 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: --mycxshxLV1oTB7XY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 13, 2022 at 11:48:52PM +0100, Stefano Brivio wrote: > On Mon, 5 Dec 2022 19:14:22 +1100 > David Gibson wrote: >=20 > > udp_splice_namebuf is now used only for spliced sending, and so it only > > ever populated with the localhost address, either IPv4 or IPv6. So, > > replace the awkward initialization in udp_sock_handler_splice() with > > statically initialized versions for IPv4 and IPv6. We then just need to > > update the port number in udp_sock_handler_splice(). > >=20 > > Signed-off-by: David Gibson > > --- > > udp.c | 40 ++++++++++++++++++---------------------- > > util.h | 7 +++++++ > > 2 files changed, 25 insertions(+), 22 deletions(-) > >=20 > > diff --git a/udp.c b/udp.c > > index 24fa984..7c601cc 100644 > > --- a/udp.c > > +++ b/udp.c > > @@ -232,11 +232,18 @@ static struct mmsghdr udp4_l2_mh_tap [UDP_MAX_FR= AMES]; > > static struct mmsghdr udp6_l2_mh_tap [UDP_MAX_FRAMES]; > > =20 > > /* recvmmsg()/sendmmsg() data for "spliced" connections */ > > -static struct sockaddr_storage udp_splice_namebuf; > > - > > static struct iovec udp4_iov_splice [UDP_MAX_FRAMES]; > > static struct iovec udp6_iov_splice [UDP_MAX_FRAMES]; > > =20 > > +static struct sockaddr_in udp_localname4 =3D { > > + .sin_family =3D AF_INET, > > + .sin_addr =3D IN4ADDR_LOOPBACK_INIT, > > +}; > > +static struct sockaddr_in6 udp_localname6 =3D { > > + .sin6_family =3D AF_INET6, > > + .sin6_addr =3D IN6ADDR_LOOPBACK_INIT, > > +}; >=20 > Nit, not a strong preference and not worth re-spinning just for this: I > think udp4_localname and udp6_localname would be more consistent with > everything else here, hence easier to type without double checking. Good point. I'll change it only if I need a respin for other reasons. --=20 David Gibson | 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 --mycxshxLV1oTB7XY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoULxWu4/Ws0dB+XtgypY4gEwYSIFAmOZJUgACgkQgypY4gEw YSJoTw//fMfd5iZ79krftm8q5XRNByxBORoTCpZtSj/fZ9zSOjVvAeEHECWnqhfR r4SCjmEAPw++00arCds/oxhuXyCufeIHf5aSEIdwy4CJpCLYPMGf4z+z47IsfR8C f8E+TTjnG7/Gdd/r7UPGsOvf3+mL9M1rrdLEZhiPlvKBgR4JTT2I1urxrGfsUvXx NFcLlrkLO2+TXhaOGeDbPQYPW0cfN1togQ9O0f70x9WUuT9QLLFWVJzYMPp0BLw9 ysHF1iFNouBkG9MSrpZBpzxHrl0oauyKj8OUC661XXG/D5ghAL1m77VSgmtH0QZ0 V9zinmq4mOx0BgnmzRh131o/hntISWihAKIDro9Q25J1X6gAS8pZ58j5QfN7Kq9n sQAVGKFviat2TvO6EbfSz/W5T1/HR3rveujYZ7XTHpwTl2j9evwSQQBco3IrZibz H9j2IZKU70h7iJp0Zx8DfZRAZC7853QYFkKS3+4AO+EenTaOtVBsm7Oosla5RVDP 9lBtw8PMYlFkB2TpoR4RWFIfEOxnxLs1Vo6atxsfc7dx9LYrougf040lMtusFb0F H/hgo0c20039BGQzU2cQzskp55MeL4nn4XZRgRz5SfEaMYIAmkfHW4/vm1dGgT2P PgToS0aGiwI6xZRVasxmkTfoQO0lN701wfpeN/5r5kdBxm++CiQ= =N2OI -----END PGP SIGNATURE----- --mycxshxLV1oTB7XY--