aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-08-21 14:20:10 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-08-21 12:00:19 +0200
commit8d4baa4446c6482d66aa09dfcd6cdbe94f616f76 (patch)
treef99411d6046c1fcaf9ecda94f68b9170ba6bfb71
parenta42fb9c000ac760617d7db722c355d094c298018 (diff)
downloadpasst-8d4baa4446c6482d66aa09dfcd6cdbe94f616f76.tar
passt-8d4baa4446c6482d66aa09dfcd6cdbe94f616f76.tar.gz
passt-8d4baa4446c6482d66aa09dfcd6cdbe94f616f76.tar.bz2
passt-8d4baa4446c6482d66aa09dfcd6cdbe94f616f76.tar.lz
passt-8d4baa4446c6482d66aa09dfcd6cdbe94f616f76.tar.xz
passt-8d4baa4446c6482d66aa09dfcd6cdbe94f616f76.tar.zst
passt-8d4baa4446c6482d66aa09dfcd6cdbe94f616f76.zip
Clarify which addresses in ip[46]_ctx are meaningful where
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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--passt.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/passt.h b/passt.h
index 5e7e6a0..3b8a628 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;