From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none 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=fDSWi1gu; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 1CE285A0275 for ; Sun, 18 Aug 2024 17:45:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723995901; 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=HhwmohHUaZYwOUte5v27ds4zfvjdthbdojUOHXlhEuU=; b=fDSWi1guL7pYoK0BPq78UyF3EK3jdrnV+dwZ7u7CNNAVLjQ/rHiIEtocm30OtbD5nEnbJH FwVI/ZoG59ZShNzKTPG9dcZCd+juUnCGxgeBegz5z18TJBjcFjRmYmOTirQm/3PB8fGU2O E4Aj2WVAcZ4npS+KHq415fMkhlNG2l8= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-141-unSiiPaCNM6qbaMf-CW_sw-1; Sun, 18 Aug 2024 11:44:56 -0400 X-MC-Unique: unSiiPaCNM6qbaMf-CW_sw-1 Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-7cbe272efa6so789461a12.3 for ; Sun, 18 Aug 2024 08:44:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723995895; x=1724600695; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HhwmohHUaZYwOUte5v27ds4zfvjdthbdojUOHXlhEuU=; b=a3tfoji6hJ3wfyqO6ysNGTfnoOkrw6+u6PmsEdLs0lpNnCPvia+FkR0LDLaAgTk0kH SIfQ/v4cyTmb928hieQkQSYUpG0o6QHlZn94OQBG8vaGt88eUz9bCx+WUcsqNuYzwjDr cdRiFn3PptmYX7oPFH+zW+cEAo2i4RGWvozGLQcKXfaYWC9PEfXD85ehs+c24G2kDs1C nQlxc4XbchZWtzf7sF2VrFc3Pwusgto/yagqSxAufLW1miX4Hd+DIBP+Kgml2/AtVitT fCH7dGp7maASZQOFUckaQRNfTZTXDcHVN+zMJLBcigzAKEV2vmivysBprN6yKsJKh1Pi vMew== X-Gm-Message-State: AOJu0Yx1pMZob6wExTwk55kXCF9A4dIPueGy3mx7y6oC8hg9v1t2EmLv 0v/wmXd7Gz64oGHE2WnD+hBgJODHSAUDwh+YPL7SPb5V07caF3je62Wyxj9yqWo506w6Wfjbzu6 gLjs9gUMvtbUdG7l3oPXnsu2kXtoiexpDh1ObBSwqRZ1TJBHZPw== X-Received: by 2002:a05:6a20:439e:b0:1c6:fa3a:c798 with SMTP id adf61e73a8af0-1caa3660774mr6353709637.32.1723995895350; Sun, 18 Aug 2024 08:44:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFv9j9fiYRqv5lXdRe7ffYIyHuyFSxiYGiscSESNA1SW8T9U5bO7L+mQLhs6SrACIUVWBnvxw== X-Received: by 2002:a05:6a20:439e:b0:1c6:fa3a:c798 with SMTP id adf61e73a8af0-1caa3660774mr6353690637.32.1723995894859; Sun, 18 Aug 2024 08:44:54 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7c6b61a6d0fsm6129105a12.18.2024.08.18.08.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2024 08:44:54 -0700 (PDT) Date: Sun, 18 Aug 2024 17:44:51 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 01/22] treewide: Use "our address" instead of "forwarding address" Message-ID: <20240818174451.76af2636@elisabeth> In-Reply-To: <20240816054004.1335006-2-david@gibson.dropbear.id.au> References: <20240816054004.1335006-1-david@gibson.dropbear.id.au> <20240816054004.1335006-2-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: Y4RZH63PQAWDZLISD3CXD6LUJ57I4JDZ X-Message-ID-Hash: Y4RZH63PQAWDZLISD3CXD6LUJ57I4JDZ 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: 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: On Fri, 16 Aug 2024 15:39:42 +1000 David Gibson wrote: > 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. > > 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(-) > > 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 = inany_any6; > - side->fport = fport; > + side->oaddr = inany_any6; > + side->oport = oport; > > 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 address and port > - * from @tgt (if specified). > + * Return: socket fd of protocol @proto bound to our address and port from @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 epoll_type type, uint8_t pif, > > ASSERT(pif_is_socket(pif)); > > - pif_sockaddr(c, &sa, &sl, pif, &tgt->faddr, tgt->fport); > + pif_sockaddr(c, &sa, &sl, pif, &tgt->oaddr, tgt->oport); > > switch (pif) { > case PIF_HOST: > - if (inany_is_loopback(&tgt->faddr)) > + if (inany_is_loopback(&tgt->oaddr)) > ifname = NULL; > else if (sa.sa_family == AF_INET) > ifname = 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) >= FLOW_STATE_INI) > @@ -321,8 +321,8 @@ 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); > } > > /** > @@ -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 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). -- Stefano