ipsec: fixed chaining ops after add footer and icv 42/27242/2
authorPiotrX Kleski <piotrx.kleski@intel.com>
Tue, 5 May 2020 12:14:22 +0000 (14:14 +0200)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Mon, 25 May 2020 16:01:25 +0000 (16:01 +0000)
commit8b4221ee8f6cd4564dc9b91d1887e88035abca84
treee1808f92b9b93c4c742a5ba2c87f0688a42be025
parent04d4d92f961905d93da313a89ecd0951a2a12bc6
ipsec: fixed chaining ops after add footer and icv

In case there is no free space in first buffer for ICV and footer,
additional buffer will be added, but esp_encrypt will stay in single
buffer mode.
The issue happens for the following payload sizes:
 - TCP packets with payload 1992
 - ICMP packets with payload 2004

This fix moves the single/chained buffer ops selection to after
esp_add_footer_and_icv call.

Type: fix

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: PiotrX Kleski <piotrx.kleski@intel.com>
Change-Id: Ic5ceba418f738933f96edb3e489ca2d149033b79
(cherry picked from commit fdca4dd1a1a817e65bf44e435261d893fc0c51d6)
src/vnet/ipsec/esp_encrypt.c
test/test_ipsec_esp.py