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=fail reason="key not found in DNS" header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202312 header.b=BX5X8Khs; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id D94E95A0275 for ; Mon, 19 Aug 2024 03:35:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1724031318; bh=UMZ1aQKwHdVNPQLnMGJI+eFl2OE3/wLkD6p9bcvpkC0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BX5X8Khszgee1RPgvVZPduPjCCld2nQHXkzkcXeV3oE/IoIr4JeDCDgde4ewe5pn9 37SXPYVQ02uDPLEOQrMBA2rTdSsqyULiZJ4sG7ycJD8Z75mgVzQVNnAORDrt3I6q0j OpAdOCdpFo1+UE/KTw3qhNJ9kgBiZca3ICiOJlppFnEGIj4QCniRt9w0dwXnKXjEC6 L0QGZsjeOBhGhoXG6VpEp2nmjq7V9qZANECHWsV4kCerJkofVLM5or4iHJUOTECuIV dEMpIViw2fW/uHLPIYSIED9Zjh1yb+Iih0O4+PfKIU+yzD5KcIjoVQeASu04ll3iBn LjGxdFpyH+DxA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WnFXQ4Zzpz4wcl; Mon, 19 Aug 2024 11:35:18 +1000 (AEST) Date: Mon, 19 Aug 2024 11:28:11 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 01/22] treewide: Use "our address" instead of "forwarding address" Message-ID: References: <20240816054004.1335006-1-david@gibson.dropbear.id.au> <20240816054004.1335006-2-david@gibson.dropbear.id.au> <20240818174451.76af2636@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="k4jSko83WWjR7EAi" Content-Disposition: inline In-Reply-To: <20240818174451.76af2636@elisabeth> Message-ID-Hash: BB2ANJCJZSDQCHLEEM7GSJM4Y7UMNO4U X-Message-ID-Hash: BB2ANJCJZSDQCHLEEM7GSJM4Y7UMNO4U 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, Paul Holzinger 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: --k4jSko83WWjR7EAi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 18, 2024 at 05:44:51PM +0200, Stefano Brivio wrote: > On Fri, 16 Aug 2024 15:39:42 +1000 > David Gibson wrote: >=20 > > The term "forwarding address" to indicate the local-to-passt address was > > well-intentioned, but ends up being kinda confusing. As discussed on a > > recent call, let's try "our" instead. > >=20 > > Signed-off-by: David Gibson > > --- > > flow.c | 72 +++++++++++++++++++++++++------------------------- > > flow.h | 18 ++++++------- > > fwd.c | 70 ++++++++++++++++++++++++------------------------ > > icmp.c | 4 +-- > > tcp.c | 33 ++++++++++++----------- > > tcp_internal.h | 2 +- > > udp.c | 12 ++++----- > > 7 files changed, 106 insertions(+), 105 deletions(-) > >=20 > > diff --git a/flow.c b/flow.c > > index 93b687dc..8915e366 100644 > > --- a/flow.c > > +++ b/flow.c > > @@ -127,18 +127,18 @@ static struct timespec flow_timer_run; > > * @af: Address family (AF_INET or AF_INET6) > > * @eaddr: Endpoint address (pointer to in_addr or in6_addr) > > * @eport: Endpoint port > > - * @faddr: Forwarding address (pointer to in_addr or in6_addr) > > - * @fport: Forwarding port > > + * @oaddr: Our address (pointer to in_addr or in6_addr) > > + * @oport: Our port > > */ > > static void flowside_from_af(struct flowside *side, sa_family_t af, > > const void *eaddr, in_port_t eport, > > - const void *faddr, in_port_t fport) > > + const void *oaddr, in_port_t oport) > > { > > - if (faddr) > > - inany_from_af(&side->faddr, af, faddr); > > + if (oaddr) > > + inany_from_af(&side->oaddr, af, oaddr); > > else > > - side->faddr =3D inany_any6; > > - side->fport =3D fport; > > + side->oaddr =3D inany_any6; > > + side->oport =3D oport; > > =20 > > if (eaddr) > > inany_from_af(&side->eaddr, af, eaddr); > > @@ -193,8 +193,8 @@ static int flowside_sock_splice(void *arg) > > * @tgt: Target flowside > > * @data: epoll reference portion for protocol handlers > > * > > - * Return: socket fd of protocol @proto bound to the forwarding addres= s and port > > - * from @tgt (if specified). > > + * Return: socket fd of protocol @proto bound to our address and port = =66rom @tgt > > + * (if specified). > > */ > > int flowside_sock_l4(const struct ctx *c, enum epoll_type type, uint8_= t pif, > > const struct flowside *tgt, uint32_t data) > > @@ -205,11 +205,11 @@ int flowside_sock_l4(const struct ctx *c, enum ep= oll_type type, uint8_t pif, > > =20 > > ASSERT(pif_is_socket(pif)); > > =20 > > - pif_sockaddr(c, &sa, &sl, pif, &tgt->faddr, tgt->fport); > > + pif_sockaddr(c, &sa, &sl, pif, &tgt->oaddr, tgt->oport); > > =20 > > switch (pif) { > > case PIF_HOST: > > - if (inany_is_loopback(&tgt->faddr)) > > + if (inany_is_loopback(&tgt->oaddr)) > > ifname =3D NULL; > > else if (sa.sa_family =3D=3D AF_INET) > > ifname =3D c->ip4.ifname_out; > > @@ -309,11 +309,11 @@ static void flow_set_state(struct flow_common *f,= enum flow_state state) > > pif_name(f->pif[INISIDE]), > > inany_ntop(&ini->eaddr, estr0, sizeof(estr0)), > > ini->eport, > > - inany_ntop(&ini->faddr, fstr0, sizeof(fstr0)), > > - ini->fport, > > + inany_ntop(&ini->oaddr, fstr0, sizeof(fstr0)), > > + ini->oport, > > pif_name(f->pif[TGTSIDE]), > > - inany_ntop(&tgt->faddr, fstr1, sizeof(fstr1)), > > - tgt->fport, > > + inany_ntop(&tgt->oaddr, fstr1, sizeof(fstr1)), > > + tgt->oport, > > inany_ntop(&tgt->eaddr, estr1, sizeof(estr1)), > > tgt->eport); > > else if (MAX(state, oldstate) >=3D FLOW_STATE_INI) > > @@ -321,8 +321,8 @@ static void flow_set_state(struct flow_common *f, e= num flow_state state) > > pif_name(f->pif[INISIDE]), > > inany_ntop(&ini->eaddr, estr0, sizeof(estr0)), > > ini->eport, > > - inany_ntop(&ini->faddr, fstr0, sizeof(fstr0)), > > - ini->fport); > > + inany_ntop(&ini->oaddr, fstr0, sizeof(fstr0)), > > + ini->oport); > > } > > =20 > > /** > > @@ -347,7 +347,7 @@ static void flow_initiate_(union flow *flow, uint8_= t pif) > > * flow_initiate_af() - Move flow to INI, setting INISIDE details > > * @flow: Flow to change state > > * @pif: pif of the initiating side > > - * @af: Address family of @eaddr and @faddr > > + * @af: Address family of @eaddr and @oaddr >=20 > Pre-existing, but this made me realise that flow_initiate_af() doesn't > actually take @eaddr and @faddr at all (it's @saddr and @daddr instead). Oops, yes. I've folded a fix for that into this patch. --=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 --k4jSko83WWjR7EAi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmbCn6YACgkQzQJF27ox 2GeAlA/+KMkaBuqTkXkhl2SlZEHWZJD/FQxZo8owbNI9gD75ll912gvPtUEWEwf6 JdiKGK+BGzJZ0bPYa1loBxRH8f4p/OMKvkfz3fTasIRTW4jtDG83ku89YfwlXdqy wFrxuVJiV+puEDxnRgOItYUoPt0whhxhGkzL34rA5mYYnUD4YPD9lIP1NJISqa0h tFri6bCZQZ4sebUSfkBUITvXJpFJwtwzamt9ufeMOV93yZEbn9+FMEA2aFKKWNKQ Lkjs4K5U4fefOyLjjMZ866fRPOVTfIX/SLbLTYplV4+9DPMIPDkrZRKA/6ywhb+z yClun7aSUY5i1oc736rv2+sba0Z/LzRes9KfKuFuYGLgUWP79utWbwWIRPyb4BoH EfRveQQBk9QKobC9WNJKjEG7gQdUkycJkyEks3vo8sfw+Ukgi203RXh/qlqZhBGK J0U+EaQowxrykWa5veYRmj2XjFlFtJrFBZeAhz0IqI7YhMaWLvZst7ACfzEY0EAH xLIhmiq6ndFUyl1ONHyRVwNcUfPm/3Fah5fDm0hfcJtog4Fy7BtllIKJybG6KHqa jhwuU4xXNyje4hsmM33C0cfv9Dup6lwyN0vm4UIKLsWe7WUliJlY4FOLH0Q4BP8S ECaG5vB3CVrxJt4JpkbNYFYzv1U9scRoqaDA2XhJmv9C4unDa2Y= =QpLh -----END PGP SIGNATURE----- --k4jSko83WWjR7EAi--