aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2026-11-24 00:31:12 +0100
committerStefano Brivio <sbrivio@redhat.com>2026-11-30 00:37:09 +0100
commit1bae956a89c8330bb872a90f782566bcf1605f48 (patch)
treec992114852595338e5a42b4c1611e09f5a321933
parent40ce82daa14ed6497fb1468fb3d2e9c6ee9f19bf (diff)
downloadpasst-1bae956a89c8330bb872a90f782566bcf1605f48.tar
passt-1bae956a89c8330bb872a90f782566bcf1605f48.tar.gz
passt-1bae956a89c8330bb872a90f782566bcf1605f48.tar.bz2
passt-1bae956a89c8330bb872a90f782566bcf1605f48.tar.lz
passt-1bae956a89c8330bb872a90f782566bcf1605f48.tar.xz
passt-1bae956a89c8330bb872a90f782566bcf1605f48.tar.zst
passt-1bae956a89c8330bb872a90f782566bcf1605f48.zip
tap: Drop IPv6 packets with outbound v4-mapped addresses as well
...not just ones with loopback addresses. It was a convenient way to try out stuff, but I don't think anybody is using this (also judging from the current KubeVirt integration), while Anders reported it as unexpected, and David points out that even though this never became an RFC: https://datatracker.ietf.org/doc/html/draft-itojun-v6ops-v4mapped-harmful-02 it's actually mentioned by RFC 4038 as a draft presenting legitimate concerns. In the context of this draft, it's not obvious whether we are a router, or a node, but, arguably, we implement at least some notion of "wire". So, while we don't really have any formal requirement to drop those, err on the side of caution and filter them out just like we do with packets with loopback addresses. Document it as well, just in case somebody else used that trick. Reported-by: Anders Ingemann <anders@ingemann.de> Suggested-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--passt.116
-rw-r--r--tap.c3
2 files changed, 18 insertions, 1 deletions
diff --git a/passt.1 b/passt.1
index 5d236bd..daceba1 100644
--- a/passt.1
+++ b/passt.1
@@ -1126,6 +1126,22 @@ appear to come from loopback in the namespace as well. The latter
behaviour used to be the default, but is usually undesirable, since it
can unintentionally expose namespace local services to the host.
+.SS Handling of IPv6 packets with IPv4-mapped addresses
+
+\fBpasst\fR and \fBpasta\fR implement some of the recommendations from the
+expired draft-itojun-v6ops-v4mapped-harmful-02 Internet-Draft:
+
+.nf
+ https://datatracker.ietf.org/doc/draft-itojun-v6ops-v4mapped-harmful/02/
+.fi
+
+by silently discarding outbound IPv6 packets with IPv4-mapped addresses used as
+source or destination. This means that IPv4 destinations can't be reached from
+the guest or container via IPv6 using their IPv4-mapped representation.
+
+If you have any use for traffic forwarding using IPv4-mapped addresses, refer to
+\fBREPORTING BUGS\fR below.
+
.SS Binding to low numbered ports (well-known or system ports, up to 1023)
If the port forwarding configuration requires binding to ports with numbers
diff --git a/tap.c b/tap.c
index b37d778..8386dbf 100644
--- a/tap.c
+++ b/tap.c
@@ -684,7 +684,8 @@ static bool tap_filter_address(const struct timespec *now, sa_family_t af,
return false;
if (af == AF_INET6 &&
- !IN6_IS_ADDR_LOOPBACK(saddr) && !IN6_IS_ADDR_LOOPBACK(daddr))
+ !IN6_IS_ADDR_LOOPBACK(saddr) && !IN6_IS_ADDR_LOOPBACK(daddr) &&
+ !IN6_IS_ADDR_V4MAPPED(saddr) && !IN6_IS_ADDR_V4MAPPED(daddr))
return false;
debug_ratelimit(now, "Invalid address on tap interface: %s -> %s",