diff options
author | Ole Troan <ot@cisco.com> | 2018-06-22 22:36:46 +0200 |
---|---|---|
committer | Ole Troan <ot@cisco.com> | 2018-06-22 22:37:55 +0200 |
commit | e0d2bd6bd7fc59c0c6ac48195d7f825dc99bfd91 (patch) | |
tree | 1b6f7af08cd0ba04001a0da13efb8ba9d937472f /src/vnet/ipsec/ah_encrypt.c | |
parent | c8efa29b6f9a91381897b54f1147daf922ed7164 (diff) |
Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums"
This reverts commit a98346f664aae148d26a8e158008b773d73db96f.
Change-Id: Iee5b3a5ddff0e8fd3a30fe5973cee24de434fe12
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ah_encrypt.c')
-rw-r--r-- | src/vnet/ipsec/ah_encrypt.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/vnet/ipsec/ah_encrypt.c b/src/vnet/ipsec/ah_encrypt.c index 898c0f27547..6619d872013 100644 --- a/src/vnet/ipsec/ah_encrypt.c +++ b/src/vnet/ipsec/ah_encrypt.c @@ -263,17 +263,19 @@ ah_encrypt_node_fn (vlib_main_t * vm, u8 sig[64]; memset (sig, 0, sizeof (sig)); - u8 *digest = - vlib_buffer_get_current (i_b0) + ip_hdr_size + icv_size; - memset (digest, 0, icv_size); + u8 *digest = NULL; + { + digest = vlib_buffer_get_current (i_b0) + ip_hdr_size + icv_size; + memset (digest, 0, icv_size); + } - unsigned size = hmac_calc (sa0->integ_alg, sa0->integ_key, - sa0->integ_key_len, - vlib_buffer_get_current (i_b0), - i_b0->current_length, sig, sa0->use_esn, - sa0->seq_hi); + hmac_calc (sa0->integ_alg, sa0->integ_key, + sa0->integ_key_len, + (u8 *) vlib_buffer_get_current (i_b0), + i_b0->current_length, sig, sa0->use_esn, sa0->seq_hi); + + memcpy (digest, (char *) &sig[0], 12); - memcpy (digest, sig, size); if (PREDICT_FALSE (is_ipv6)) { } @@ -285,7 +287,7 @@ ah_encrypt_node_fn (vlib_main_t * vm, } if (transport_mode) - vlib_buffer_advance (i_b0, -sizeof (ethernet_header_t)); + vlib_buffer_advance (i_b0, -sizeof (ethernet_header_t));; trace: if (PREDICT_FALSE (i_b0->flags & VLIB_BUFFER_IS_TRACED)) |