Tomasz Duszynski 3417350e7f examples/ipsec-secgw: fix IP version check
Since new_ip and ip4 are overlapping buffers copying ip4 over new_ip
using memmove() might overwrite memory at ip4. This could happen if
following condition holds:

ip_hdr_len > sizeof(struct esp_hdr) + sa->iv_len

Thus using ip4 to check ip version is wrong as it might not contain
proper value.

Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Reviewed-by: Aviad Yehezkel <aviadye@mellanox.com>
2017-10-25 18:10:32 +02:00
..
2017-10-06 18:23:25 +02:00
2017-06-14 23:54:13 +02:00
2017-10-13 21:57:49 +02:00
2017-10-13 21:57:49 +02:00
2017-10-06 18:23:25 +02:00
2017-10-13 21:57:49 +02:00
2017-10-13 21:57:49 +02:00
2017-10-06 18:23:25 +02:00
2017-10-13 21:57:49 +02:00
2017-10-13 21:57:49 +02:00
2017-10-13 21:57:49 +02:00
2017-10-06 18:23:25 +02:00
2017-06-14 23:54:13 +02:00
2017-10-06 18:23:25 +02:00
2017-10-13 21:57:49 +02:00
2017-10-13 21:57:49 +02:00