After a transport mode SA has processed an inbound IPv6 packet,
ipsec6_common_input_cb() walks the remaining header chain itself and
calls ip6_protox[] for each next header. AH, ESP and IPComp have had no
entry in ip6_protox[] since the projects/ipsec merge; ip6_input() reaches
them through IPSEC_INPUT() instead. The callback did not, so when the
next header was another IPsec header the packet went to rip6_input() and
was never decapsulated. The receiving side of a bundle such as ESP
beneath a transport mode AH, or ESP with IPComp, did not work over IPv6.
Hand such a header back to ipsec_common_input() from the loop. Look up
the offset of the preceding next header field with ip6_get_prevhdr(),
since extension headers may sit between the two IPsec headers.
The bundle cases of the flowlabel test had to ignore the result of ping
because of this. Have them check it, and give the second target, which
no host owned, an address on hostB.
Reported by: llm-postcr
Fixes: fcf596178b5f ("Merge projects/ipsec into head/.")
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")