diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-10-29 11:13:05 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-10-31 22:30:49 +0000 |
commit | c520fe7ab9db6fa60f9e69be990dd5c83eb40522 (patch) | |
tree | c47117b2a1e1c6fc26a4219af85ec0b91e9a92f2 /src/vnet/ipsec/ipsec_tun_in.c | |
parent | 09220b8d0095400028db81e5773d009284d2ab40 (diff) |
ipsec: fix esp trace seq number overflow
Do not copy invalid seq number if packet is too small.
Type: fix
Change-Id: I1e78f5920e9645521f57efccaf35bbf9ce0676a8
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_tun_in.c')
-rw-r--r-- | src/vnet/ipsec/ipsec_tun_in.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vnet/ipsec/ipsec_tun_in.c b/src/vnet/ipsec/ipsec_tun_in.c index 04f7a9296ab..d88cc08ddbd 100644 --- a/src/vnet/ipsec/ipsec_tun_in.c +++ b/src/vnet/ipsec/ipsec_tun_in.c @@ -376,7 +376,9 @@ ipsec_tun_protect_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, else clib_memcpy (&tr->key4, &key40, sizeof (tr->key4)); tr->is_ip6 = is_ip6; - tr->seq = clib_host_to_net_u32 (esp0->seq); + tr->seq = + len0 >= + sizeof (*esp0) ? clib_host_to_net_u32 (esp0->seq) : ~0; } } |