From ae389bc4a10180aa35010725d525fc440da6f67e Mon Sep 17 00:00:00 2001 From: Matus Fabian Date: Fri, 23 Mar 2018 03:42:06 -0700 Subject: NAT44: fix ICMP checksum update crash (VPP-1205) Change-Id: I3e4bbfe205c86cb0839dd5c542f083dbe6bea881 Signed-off-by: Matus Fabian (cherry picked from commit 3f2dd30b0bf7cf3d82c720d5065178c1fa628c6b) --- src/plugins/nat/in2out.c | 3 +++ src/plugins/nat/out2in.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src/plugins/nat') diff --git a/src/plugins/nat/in2out.c b/src/plugins/nat/in2out.c index f29e1575e16..b3b205acbda 100755 --- a/src/plugins/nat/in2out.c +++ b/src/plugins/nat/in2out.c @@ -727,6 +727,9 @@ static inline u32 icmp_in2out (snat_main_t *sm, src_address /* changed member */); ip0->checksum = ip_csum_fold (sum0); + if (icmp0->checksum == 0) + icmp0->checksum = 0xffff; + if (!icmp_is_error_message (icmp0)) { new_id0 = sm0.port; diff --git a/src/plugins/nat/out2in.c b/src/plugins/nat/out2in.c index 97cd2903a9d..397344d769a 100755 --- a/src/plugins/nat/out2in.c +++ b/src/plugins/nat/out2in.c @@ -580,6 +580,9 @@ static inline u32 icmp_out2in (snat_main_t *sm, dst_address /* changed member */); ip0->checksum = ip_csum_fold (sum0); + if (icmp0->checksum == 0) + icmp0->checksum = 0xffff; + if (!icmp_is_error_message (icmp0)) { new_id0 = sm0.port; -- cgit 1.2.3-korg