aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-06-09 02:33:30 -0700
committerOle Trøan <otroan@employees.org>2017-06-13 08:19:10 +0000
commit4b30ceb1b4f9174d528525059d7fd52d585f059d (patch)
tree1bc96c94b566acf5d9d60054c49f7cc03b6b4ce1 /src
parent3b20ee4e2b66c287d7a67aff1a304b45be55a4a8 (diff)
SNAT: fix 1:1 NAT without port hairpinning TCP checksum update
Change-Id: I5077fcf3671a6116b475f87e43120efc10ecaa08 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/snat/in2out.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/snat/in2out.c b/src/plugins/snat/in2out.c
index ddde702a50c..685cdca8045 100644
--- a/src/plugins/snat/in2out.c
+++ b/src/plugins/snat/in2out.c
@@ -854,6 +854,16 @@ snat_hairpinning (snat_main_t *sm,
udp0->checksum = 0;
}
}
+ else
+ {
+ if (PREDICT_TRUE(proto0 == SNAT_PROTOCOL_TCP))
+ {
+ sum0 = tcp0->checksum;
+ sum0 = ip_csum_update (sum0, old_dst_addr0, new_dst_addr0,
+ ip4_header_t, dst_address);
+ tcp0->checksum = ip_csum_fold(sum0);
+ }
+ }
}
}