From 8f39d55a298e08ac808da6988032f14d542627c6 Mon Sep 17 00:00:00 2001 From: Juraj Sloboda Date: Wed, 26 Sep 2018 14:25:32 +0200 Subject: Update code to compute checksum for buffer chains Compute ICMP checksum for buffer chains Fix checksum function for buffer chains Change-Id: I39b845b94a63c3ab5fc9f6f9ab36cadbc67c104f Signed-off-by: Juraj Sloboda --- src/plugins/nat/out2in.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/plugins/nat/out2in.c') diff --git a/src/plugins/nat/out2in.c b/src/plugins/nat/out2in.c index 985333fc765..67d831a850c 100755 --- a/src/plugins/nat/out2in.c +++ b/src/plugins/nat/out2in.c @@ -508,9 +508,11 @@ icmp_out2in (snat_main_t * sm, if (PREDICT_TRUE (!ip4_is_fragment (ip0))) { - sum0 = ip_incremental_checksum (0, icmp0, - ntohs (ip0->length) - - ip4_header_bytes (ip0)); + sum0 = ip_incremental_checksum_buffer (sm->vlib_main, b0, (u8 *) icmp0 - + (u8 *) + vlib_buffer_get_current (b0), + ntohs (ip0->length) - + ip4_header_bytes (ip0), 0); checksum0 = ~ip_csum_fold (sum0); if (checksum0 != 0 && checksum0 != 0xffff) { -- cgit 1.2.3-korg