clat: add support for ESP, mirroring existing GRE support
This relies on some pretty heavy duty magic on the side of the PLAT
nat gateway in order to be useful.
It might not even work... but it already doesn't work, so it can't
be worse then the current state where we simply discard these packets.
Test: builds
Bug: 139499742
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3adfae6251c66125ff31c23c7967feacafb805a0
diff --git a/ipv4.c b/ipv4.c
index 56d83ac..c052d03 100644
--- a/ipv4.c
+++ b/ipv4.c
@@ -131,7 +131,7 @@
} else if (nxthdr == IPPROTO_UDP) {
iov_len =
udp_packet(out, pos + 2, (const struct udphdr *)next_header, old_sum, new_sum, len_left);
- } else if (nxthdr == IPPROTO_GRE) {
+ } else if (nxthdr == IPPROTO_GRE || nxthdr == IPPROTO_ESP) {
iov_len = generic_packet(out, pos + 2, next_header, len_left);
} else {
#if CLAT_DEBUG