diff options
author | Klement Sekera <ksekera@cisco.com> | 2021-03-24 16:46:22 +0100 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-03-25 09:37:13 +0000 |
commit | 07bc8bb1edff6d50b45116a36bb973d06968c3c5 (patch) | |
tree | c7316b9e061a8fe67095428b9130d60ce6651684 /src/plugins | |
parent | e0b63b2978552cd21ed23343232de720157a282d (diff) |
nat: fix vnet_feature_next in source hairpinning
Avoid erroneous double vnet_feature_next if routing buffer manually.
Type: fix
Change-Id: I3f56c12bf57f59a1e5ddad63a2565fa195934cf6
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/nat/nat44-ei/nat44_ei_hairpinning.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/nat/nat44-ei/nat44_ei_hairpinning.c b/src/plugins/nat/nat44-ei/nat44_ei_hairpinning.c index 0de2de1faf4..a049e4659a7 100644 --- a/src/plugins/nat/nat44-ei/nat44_ei_hairpinning.c +++ b/src/plugins/nat/nat44-ei/nat44_ei_hairpinning.c @@ -440,7 +440,6 @@ VLIB_NODE_FN (nat44_ei_hairpin_src_node) b0 = vlib_get_buffer (vm, bi0); sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX]; - vnet_feature_next (&next0, b0); pool_foreach (i, nm->output_feature_interfaces) { @@ -452,14 +451,23 @@ VLIB_NODE_FN (nat44_ei_hairpin_src_node) NAT44_EI_FLAG_HAIRPINNING)) { if (PREDICT_TRUE (nm->num_workers > 1)) - next0 = NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH; + { + next0 = NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT_WH; + goto skip_feature_next; + } else - next0 = NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT; + { + next0 = NAT44_EI_HAIRPIN_SRC_NEXT_SNAT_IN2OUT; + goto skip_feature_next; + } } break; } } + vnet_feature_next (&next0, b0); + skip_feature_next: + if (next0 != NAT44_EI_HAIRPIN_SRC_NEXT_DROP) { vlib_increment_simple_counter ( |