aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/npt66
diff options
context:
space:
mode:
authorOle Troan <otroan@employees.org>2023-09-01 14:15:39 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2023-09-04 15:14:46 +0000
commit34850e01876005422ba9523df5ae0400964e1c91 (patch)
treeb0d538e9dd54d6fa183e9e8fedb587edd41bae79 /src/plugins/npt66
parent77812045e720d1434dd36a1db90c35daad0c8e00 (diff)
npt66: checksum applied to src address instead of dst address on rx
Applied the checksum delta to the source address instead of the destination address in the RX direction. Cleaned up tests a little. Type: fix Change-Id: I871f3448365587e5319dfbca6ea356935321ff9b Signed-off-by: Ole Troan <otroan@employees.org>
Diffstat (limited to 'src/plugins/npt66')
-rw-r--r--src/plugins/npt66/npt66_node.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/npt66/npt66_node.c b/src/plugins/npt66/npt66_node.c
index 95fe8594dbb..21dddee3951 100644
--- a/src/plugins/npt66/npt66_node.c
+++ b/src/plugins/npt66/npt66_node.c
@@ -121,7 +121,6 @@ static int
npt66_translate (ip6_header_t *ip, npt66_binding_t *binding, int dir)
{
int rv = 0;
- clib_warning ("npt66_translate: before: %U", format_ip6_header, ip, 40);
if (dir == VLIB_TX)
{
if (!ip6_prefix_cmp (ip->src_address, binding->internal,
@@ -147,9 +146,8 @@ npt66_translate (ip6_header_t *ip, npt66_binding_t *binding, int dir)
ip->dst_address = ip6_prefix_copy (ip->dst_address, binding->internal,
binding->internal_plen);
rv = npt66_adjust_checksum (binding->internal_plen, true, binding->delta,
- &ip->src_address);
+ &ip->dst_address);
}
- clib_warning ("npt66_translate: after: %U", format_ip6_header, ip, 40);
done:
return rv;
}