summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/esp.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-05-29 18:49:25 +0200
committerDamjan Marion <damarion@cisco.com>2019-05-29 18:53:29 +0200
commit30b8b4a5d49e7884dcb830ffb1167ec4ddcdb931 (patch)
treee8f2a50e85b2d73c515048e38cec46c8604ed153 /src/vnet/ipsec/esp.h
parentef8711b3b2aa3c25baea5bce5d0f1626aa74fc7d (diff)
ipsec: fix perf issue in esp_aad_fill
Type: fix Fixes: 47feb11 Change-Id: I6b3b97cd361eef19c910c14fd06edb001a4c191b Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/esp.h')
-rw-r--r--src/vnet/ipsec/esp.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vnet/ipsec/esp.h b/src/vnet/ipsec/esp.h
index 070726faa34..f36f52a4752 100644
--- a/src/vnet/ipsec/esp.h
+++ b/src/vnet/ipsec/esp.h
@@ -137,18 +137,21 @@ esp_aad_fill (vnet_crypto_op_t * op,
esp_aead_t *aad;
aad = (esp_aead_t *) op->aad;
- clib_memcpy_fast (aad, esp, 8);
+ aad->data[0] = esp->spi;
if (ipsec_sa_is_set_USE_ESN (sa))
{
/* SPI, seq-hi, seq-low */
- aad->data[2] = aad->data[1];
aad->data[1] = clib_host_to_net_u32 (sa->seq_hi);
+ aad->data[2] = esp->seq;
op->aad_len = 12;
}
else
- /* SPI, seq-low */
- op->aad_len = 8;
+ {
+ /* SPI, seq-low */
+ aad->data[1] = esp->seq;
+ op->aad_len = 8;
+ }
}
#endif /* __ESP_H__ */