summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2022-08-18 16:49:17 +0200
committerMatthew Smith <mgsmith@netgate.com>2022-08-18 15:34:40 +0000
commitfa7441ffc2552529784d15bb4c8450cf164281d6 (patch)
tree76e008c8f6c7ff7b53f780fa17273ac71465b308
parent32b93d4800bf6165708b068e12b63cebb5bdc1fe (diff)
wireguard: fix ipv6 handshake packet
IPv6 payload length should not include the size of the IPv6 header. Type: fix Change-Id: Iedcd17d0af8d72d9b5f8f9b605da7c99e151bc9d Signed-off-by: Benoît Ganne <bganne@cisco.com>
-rw-r--r--src/plugins/wireguard/wireguard_send.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/wireguard/wireguard_send.c b/src/plugins/wireguard/wireguard_send.c
index 93e808ad050..91d993bee15 100644
--- a/src/plugins/wireguard/wireguard_send.c
+++ b/src/plugins/wireguard/wireguard_send.c
@@ -70,10 +70,8 @@ wg_buffer_prepend_rewrite (vlib_buffer_t *b0, const u8 *rewrite, u8 is_ip4)
/* copy only ip6 and udp header; wireguard header not needed */
clib_memcpy (hdr6, rewrite, sizeof (ip6_udp_header_t));
- hdr6->udp.length =
+ hdr6->ip6.payload_length = hdr6->udp.length =
clib_host_to_net_u16 (b0->current_length - sizeof (ip6_header_t));
-
- hdr6->ip6.payload_length = clib_host_to_net_u16 (b0->current_length);
}
}