aboutgitcodebugslistschat
path: root/passt.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-07-22 15:31:12 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-07-30 21:50:41 +0200
commit4b2e018d70f33d1e337b039d620823a020711ba5 (patch)
treef72ac2374fc672988aa7f9d0a086d26f41bc9ac3 /passt.h
parent0aae39d73a09eb32adc621acbbc98ac6f86b4ad1 (diff)
downloadpasst-4b2e018d70f33d1e337b039d620823a020711ba5.tar
passt-4b2e018d70f33d1e337b039d620823a020711ba5.tar.gz
passt-4b2e018d70f33d1e337b039d620823a020711ba5.tar.bz2
passt-4b2e018d70f33d1e337b039d620823a020711ba5.tar.lz
passt-4b2e018d70f33d1e337b039d620823a020711ba5.tar.xz
passt-4b2e018d70f33d1e337b039d620823a020711ba5.tar.zst
passt-4b2e018d70f33d1e337b039d620823a020711ba5.zip
Allow different external interfaces for IPv4 and IPv6 connectivity
It's quite plausible for a host to have both IPv4 and IPv6 connectivity, but only via different interfaces. For example, this will happen in the case that IPv6 connectivity is via a tunnel (e.g. 6in4 or 6rd). It would also happen in the case that IPv4 access is via a tunnel on an otherwise IPv6 only local network, which is a setup that might become more common in the post IPv4 address exhaustion world. In turns out there's no real need for passt/pasta to get its IPv4 and IPv6 connectivity via the same interface, so we can handle this situation fairly easily. Change the core to allow eparate external interfaces for IPv4 and IPv6. We don't actually set these separately for now. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'passt.h')
-rw-r--r--passt.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/passt.h b/passt.h
index e541341..23145c6 100644
--- a/passt.h
+++ b/passt.h
@@ -122,6 +122,7 @@ enum passt_modes {
* @mac: Host MAC address
* @mac_guest: MAC address of guest or namespace, seen or configured
* @v4: Enable IPv4 transport
+ * @ifi4: Index of routable interface for IPv4
* @addr4: IPv4 address for external, routable interface
* @addr4_seen: Latest IPv4 address seen as source from tap
* @mask4: IPv4 netmask, network order
@@ -130,6 +131,7 @@ enum passt_modes {
* @dns4_fwd: Address forwarded (UDP) to first IPv4 DNS, network order
* @dns_search: DNS search list
* @v6: Enable IPv6 transport
+ * @ifi6: Index of routable interface for IPv6
* @addr6: IPv6 address for external, routable interface
* @addr6_ll: Link-local IPv6 address on external, routable interface
* @addr6_seen: Latest IPv6 global/site address seen as source from tap
@@ -137,7 +139,6 @@ enum passt_modes {
* @gw6: Default IPv6 gateway
* @dns6: IPv6 DNS addresses, zero-terminated
* @dns6_fwd: Address forwarded (UDP) to first IPv6 DNS, network order
- * @ifi: Index of routable interface
* @pasta_ifn: Name of namespace interface for pasta
* @pasta_ifn: Index of namespace interface for pasta
* @pasta_conf_ns: Configure namespace interface after creating it
@@ -193,6 +194,7 @@ struct ctx {
unsigned char mac_guest[ETH_ALEN];
int v4;
+ unsigned int ifi4;
uint32_t addr4;
uint32_t addr4_seen;
uint32_t mask4;
@@ -203,6 +205,7 @@ struct ctx {
struct fqdn dns_search[MAXDNSRCH];
int v6;
+ unsigned int ifi6;
struct in6_addr addr6;
struct in6_addr addr6_ll;
struct in6_addr addr6_seen;
@@ -211,7 +214,6 @@ struct ctx {
struct in6_addr dns6[MAXNS + 1];
struct in6_addr dns6_fwd;
- unsigned int ifi;
char pasta_ifn[IF_NAMESIZE];
unsigned int pasta_ifi;
int pasta_conf_ns;