aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2016-09-21 05:13:01 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2016-09-21 15:12:38 +0000
commitfe9473f3b5f59a2c63e3bd1c51d915d99cd49252 (patch)
tree54d948bdfe7dbbccf697ace6954b869381960632
parentf304552665ddd0658b361698424b815ff8237ef0 (diff)
VPP-414: Fixed IPSec transport mode in esp_encrypt.c
Change-Id: I27accb0c87d6bf2fbbe90d8d1bc074697299e639 Signed-off-by: Matus Fabian <matfabia@cisco.com>
-rw-r--r--vnet/vnet/ipsec/esp_encrypt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/vnet/vnet/ipsec/esp_encrypt.c b/vnet/vnet/ipsec/esp_encrypt.c
index 193c0849b71..ba7579de8b5 100644
--- a/vnet/vnet/ipsec/esp_encrypt.c
+++ b/vnet/vnet/ipsec/esp_encrypt.c
@@ -299,13 +299,15 @@ esp_encrypt_node_fn (vlib_main_t * vm,
}
else
{
- vlib_buffer_advance (i_b0, ip_hdr_size);
next_hdr_type = ip_proto;
if (vnet_buffer (i_b0)->sw_if_index[VLIB_TX] != ~0)
{
transport_mode = 1;
ethernet_header_t *ieh0, *oeh0;
- ieh0 = (ethernet_header_t *) i_b0->data;
+ ieh0 =
+ (ethernet_header_t *) ((u8 *)
+ vlib_buffer_get_current (i_b0) -
+ sizeof (ethernet_header_t));
oeh0 = (ethernet_header_t *) o_b0->data;
clib_memcpy (oeh0, ieh0, sizeof (ethernet_header_t));
next0 = ESP_ENCRYPT_NEXT_INTERFACE_OUTPUT;
@@ -315,6 +317,7 @@ esp_encrypt_node_fn (vlib_main_t * vm,
vnet_buffer (o_b0)->output_features.bitmap =
vnet_buffer (i_b0)->output_features.bitmap;
}
+ vlib_buffer_advance (i_b0, ip_hdr_size);
}
ASSERT (sa0->crypto_alg < IPSEC_CRYPTO_N_ALG);