From 902474657dbc33b85aae1d0fe2c5b8f345d4d601 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Fri, 10 Jun 2016 20:42:44 +0200 Subject: Copy missing buffer metadata for ESP transport mode packets Change-Id: I3f5113533b365366cc3f6ef87858e19879f703cf Signed-off-by: Damjan Marion --- vnet/vnet/ipsec/esp_encrypt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vnet') diff --git a/vnet/vnet/ipsec/esp_encrypt.c b/vnet/vnet/ipsec/esp_encrypt.c index d1dbcf96f84..c81a87812ea 100644 --- a/vnet/vnet/ipsec/esp_encrypt.c +++ b/vnet/vnet/ipsec/esp_encrypt.c @@ -203,6 +203,7 @@ esp_encrypt_node_fn (vlib_main_t * vm, last_empty_buffer = vec_len (empty_buffers) - 1; o_bi0 = empty_buffers[last_empty_buffer]; o_b0 = vlib_get_buffer (vm, o_bi0); + o_b0->flags = VLIB_BUFFER_TOTAL_LENGTH_VALID; o_b0->current_data = sizeof(ethernet_header_t); ih0 = vlib_buffer_get_current (i_b0); vlib_prefetch_buffer_with_index (vm, empty_buffers[last_empty_buffer-1], STORE); @@ -271,8 +272,11 @@ esp_encrypt_node_fn (vlib_main_t * vm, else { next0 = ESP_ENCRYPT_NEXT_INTERFACE_OUTPUT; + o_b0->flags |= BUFFER_OUTPUT_FEAT_DONE; vnet_buffer (o_b0)->sw_if_index[VLIB_TX] = vnet_buffer (i_b0)->sw_if_index[VLIB_TX]; + vnet_buffer(o_b0)->output_features.bitmap = + vnet_buffer(i_b0)->output_features.bitmap; } ASSERT(sa0->crypto_alg < IPSEC_CRYPTO_N_ALG); @@ -301,7 +305,6 @@ esp_encrypt_node_fn (vlib_main_t * vm, vnet_buffer (o_b0)->sw_if_index[VLIB_RX] = vnet_buffer (i_b0)->sw_if_index[VLIB_RX]; - o_b0->flags = VLIB_BUFFER_TOTAL_LENGTH_VALID; u8 iv[16]; RAND_bytes(iv, sizeof(iv)); -- cgit 1.2.3-korg