aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44-ed/nat44_ed.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2021-02-17 18:48:35 +0100
committerOle Tr�an <otroan@employees.org>2021-02-26 13:15:32 +0000
commit5599fc2dae024bcf150fa4b3b4584e19419f8079 (patch)
treeeb5f6ac95b62de0cf2e017ad04340ee391c4e6f2 /src/plugins/nat/nat44-ed/nat44_ed.c
parente7a80a98bc1deba86a41cf66280101766e04a310 (diff)
nat: optimize flow matching in ED NAT
This saves 6 clocks in nat44-ed-in2out node. (112->106 per packet) Type: improvement Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: I48e757e7f4b6b0d250a432a4659fe6955fc52a07
Diffstat (limited to 'src/plugins/nat/nat44-ed/nat44_ed.c')
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/nat/nat44-ed/nat44_ed.c b/src/plugins/nat/nat44-ed/nat44_ed.c
index d9d35fc55bc..fcc3e6bf0b5 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed.c
+++ b/src/plugins/nat/nat44-ed/nat44_ed.c
@@ -3318,15 +3318,15 @@ nat_6t_l3_l4_csum_calc (nat_6t_flow_t *f)
f->rewrite.dport = f->match.dport;
}
if (f->ops & NAT_FLOW_OP_ICMP_ID_REWRITE &&
- f->rewrite.icmp_id != f->match.icmp_id)
+ f->rewrite.icmp_id != f->match.sport)
{
f->l4_csum_delta =
ip_csum_add_even (f->l4_csum_delta, f->rewrite.icmp_id);
- f->l4_csum_delta = ip_csum_sub_even (f->l4_csum_delta, f->match.icmp_id);
+ f->l4_csum_delta = ip_csum_sub_even (f->l4_csum_delta, f->match.sport);
}
else
{
- f->rewrite.icmp_id = f->match.icmp_id;
+ f->rewrite.icmp_id = f->match.sport;
}
if (f->ops & NAT_FLOW_OP_TXFIB_REWRITE)
{