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=l+P+U/XI; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 88FA65A0276 for ; Fri, 16 Aug 2024 07:40:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1723786807; bh=QFvhtt8N/R8/QJyRsBY//CNJRKR/J8h94z9PKAtGuHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l+P+U/XI2UTPzpWbUGh08CMs4YKXIc7K0SeqQlJD+PTtxm84WlEYhCWh3mhUiUSB9 nq58IonjA3kdkZi3T0Mfe04D0/r4b4LvZOc7vAn1DvB2LEaJgG26RtkY5jcfcoFXcl v0i5m4FKRAj44Ki08gwj/NceUgVM9okpLTOfTnTqtZpJR6+dW2wW1q9TC0p+qwJvSA NN+PL7CGBQmxs2TQUPSKRNV3RrU8TsbiSgYiL0BDr1nhSn3zVf4nDACbKv+X82Twra aq66kcQOGlTt7/IV7pq9Ca/fl4qzTnaL7PEg9IbPOWrqEOz2kW+jPftgpyPHrY/cxy OFWHeUAx/Z7bA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4WlW6H0t3vz4x6l; Fri, 16 Aug 2024 15:40:07 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 14/22] Clarify which addresses in ip[46]_ctx are meaningful where Date: Fri, 16 Aug 2024 15:39:55 +1000 Message-ID: <20240816054004.1335006-15-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240816054004.1335006-1-david@gibson.dropbear.id.au> References: <20240816054004.1335006-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: TZXXXBCVZRJTDYJFUHF4MRNWFVYCEPFR X-Message-ID-Hash: TZXXXBCVZRJTDYJFUHF4MRNWFVYCEPFR 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: Paul Holzinger , 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. Rearrange and comment the ip[46]_ctx definitions to make it clearer which is which. 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..3b8a6283 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; + struct in6_addr our_tap_ll; + /* PIF_HOST addresses */ + struct in6_addr dns_host; struct in6_addr addr_out; + char ifname_out[IFNAMSIZ]; bool no_copy_routes; -- 2.46.0