aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2026-11-24 02:09:04 +0100
committerStefano Brivio <sbrivio@redhat.com>2026-11-30 00:37:09 +0100
commit04623ac947118f7466fde7a7d399ce495608d5af (patch)
treec038b6c362b9e818e210698b8aa91101ab982a16
parent1bae956a89c8330bb872a90f782566bcf1605f48 (diff)
downloadpasst-04623ac947118f7466fde7a7d399ce495608d5af.tar
passt-04623ac947118f7466fde7a7d399ce495608d5af.tar.gz
passt-04623ac947118f7466fde7a7d399ce495608d5af.tar.bz2
passt-04623ac947118f7466fde7a7d399ce495608d5af.tar.lz
passt-04623ac947118f7466fde7a7d399ce495608d5af.tar.xz
passt-04623ac947118f7466fde7a7d399ce495608d5af.tar.zst
passt-04623ac947118f7466fde7a7d399ce495608d5af.zip
tap: Don't drop all packets with extension headers in ipv6_l4hdr()
The loop in ipv6_l4hdr() was intended to skip extension headers (which we can't forward), but as we exit that function without dropping the last one we find (if any), we'll actually discard packets because the last extension header is used as Layer-4 header, which is later handled as having an unknown protocol number. This is in contrast with the recommendation from RFC 7045, which says that any forwarding node should forward packets regardless of any extension header. Notably, that RFC, and no current normative standards for that matter, doesn't introduce any particular requirement regarding the forwarding of extension headers themselves, so it's probably fine that we drop them (we have no choice anyway). Drop the last extension header we find, before leaving ipv6_l4hdr(). Fixing this carries the unintendend consequence that IPv6 fragments would be forwarded (not as fragments though), but, just like we do for IPv4, we want to drop them instead. The next patch will take care of that. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--tap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tap.c b/tap.c
index 8386dbf..03cd886 100644
--- a/tap.c
+++ b/tap.c
@@ -935,9 +935,9 @@ static bool ipv6_l4hdr(struct iov_tail *data, uint8_t *proto, size_t *dlen)
nh = o->nexthdr;
hdrlen = (o->hdrlen + 1) * 8;
- if (IPV6_NH_OPT(nh))
- iov_drop_header(data, hdrlen);
- else
+ iov_drop_header(data, hdrlen);
+
+ if (!IPV6_NH_OPT(nh))
goto found;
}