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