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 583835A0322 for ; Wed, 14 Aug 2024 06:31:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1723609853; bh=lttkckhxKQyiUeIEmapw9gLP7chPYaWJrBPJhVqDfak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwkKOzDS5K9S6/wAXCCRszQOP7bP/7dJGScgjbxwtet9J99IVL6Qii815UC7VepFx qa/Zyl+IbQfG1ApWLbTtnnBcaXnzuo8KzFH3TAt1t9Fv+hyeLiyV+dkDm8mbchv3M3 zjG1w9VaALKJCo2LXI/8yoc1CszMjUKrFz5G8Lk9jcH6+wMx3/ze0kdvby1n91AVMz nPsqh4eFM7uY7L6KRJVoLuY0GCDa+OjQiMdXNMbRLkONoWIgJqbbbu5NL99HoSoQNW ncS4Lsyl9gNSaR+NG/1EyLfn1U08zMcY6wi9jK3u/cqGGv7dsYtWNScMsUQ+0Sw7ei ct09sx2bBNsnw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WkFgK2YWrz4xDy; Wed, 14 Aug 2024 14:30:53 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 15/16] Clarify which addresses in ip[46]_ctx are meaningful where Date: Wed, 14 Aug 2024 14:30:49 +1000 Message-ID: <20240814043050.4177037-16-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240814043050.4177037-1-david@gibson.dropbear.id.au> References: <20240814043050.4177037-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: I4MD7WOPOFT5ZDWI4VGINFBQSEAWLR3R X-Message-ID-Hash: I4MD7WOPOFT5ZDWI4VGINFBQSEAWLR3R 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: David Gibson 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: Some are guest visible addresses and may not be valid on the host, others are host visible addresses and may not be valid on the guest. Signed-off-by: David Gibson --- passt.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/passt.h b/passt.h index 5e7e6a04..06754bcc 100644 --- a/passt.h +++ b/passt.h @@ -104,15 +104,18 @@ enum passt_modes { * @no_copy_addrs: Don't copy all addresses when configuring namespace */ struct ip4_ctx { + /* PIF_TAP addresses */ struct in_addr addr; struct in_addr addr_seen; int prefix_len; struct in_addr gw; struct in_addr dns[MAXNS + 1]; struct in_addr dns_match; - struct in_addr dns_host; + /* PIF_HOST addresses */ + struct in_addr dns_host; struct in_addr addr_out; + char ifname_out[IFNAMSIZ]; bool no_copy_routes; @@ -122,12 +125,12 @@ struct ip4_ctx { /** * struct ip6_ctx - IPv6 execution context * @addr: IPv6 address assigned to guest - * @our_tap_ll: Link-local IPv6 address for passt's use on tap * @addr_seen: Latest IPv6 global/site address seen as source from tap * @addr_ll_seen: Latest IPv6 link-local address seen as source from tap * @gw: Default IPv6 gateway * @dns: DNS addresses for DHCPv6 and NDP, zero-terminated * @dns_match: Forward DNS query if sent to this address + * @our_tap_ll: Link-local IPv6 address for passt's use on tap * @dns_host: Use this DNS on the host for forwarding * @addr_out: Optional source address for outbound traffic * @ifname_out: Optional interface name to bind outbound sockets to @@ -135,16 +138,19 @@ struct ip4_ctx { * @no_copy_addrs: Don't copy all addresses when configuring namespace */ struct ip6_ctx { + /* PIF_TAP addresses */ struct in6_addr addr; - struct in6_addr our_tap_ll; struct in6_addr addr_seen; struct in6_addr addr_ll_seen; struct in6_addr gw; struct in6_addr dns[MAXNS + 1]; struct in6_addr dns_match; - struct in6_addr dns_host; + /* PIF_HOST addresses */ + struct in6_addr our_tap_ll; + struct in6_addr dns_host; struct in6_addr addr_out; + char ifname_out[IFNAMSIZ]; bool no_copy_routes; -- 2.46.0