examples/ipsec-secgw: fix packet length
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Tue, 25 Jun 2019 23:16:46 +0000 (00:16 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Fri, 5 Jul 2019 13:28:14 +0000 (15:28 +0200)
commita135e050ad5b6d20fa18e6e18dcc86443be6cc30
tree9ea377deb4aed3886d11475e62f75acb09337002
parentb1a3ac782d6020e6877e97a067613bbb2b8564b1
examples/ipsec-secgw: fix packet length

for packets smaller then 64B some NICs reports pkt_len=64B.
As ipsec-secgw (and librte_ipsec) relies on pkt_len value to determine
payload length, that causes problems for small packets.
To fix the issue, check that pkt_len matches values in IPv4/IPv6 header
and re-adjust pkt_len if necessary.

Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6")
Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/ipsec-secgw/ipsec-secgw.c