aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/esp_encrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ipsec/esp_encrypt.c')
-rw-r--r--src/vnet/ipsec/esp_encrypt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/ipsec/esp_encrypt.c b/src/vnet/ipsec/esp_encrypt.c
index 0ce5e54aaeb..5f633011491 100644
--- a/src/vnet/ipsec/esp_encrypt.c
+++ b/src/vnet/ipsec/esp_encrypt.c
@@ -393,7 +393,8 @@ esp_encrypt_node_fn (vlib_main_t * vm,
if (sa0->udp_encap)
{
ouh0->udp.length =
- clib_host_to_net_u16 (oh0->ip4.length -
+ clib_host_to_net_u16 (clib_net_to_host_u16
+ (oh0->ip4.length) -
ip4_header_bytes (&oh0->ip4));
}
}