diff options
author | Florin Coras <fcoras@cisco.com> | 2021-11-09 18:29:03 -0800 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2022-02-03 20:38:18 +0000 |
commit | f840880c2fd8fbd6acfa79948224aafe6e4a62d1 (patch) | |
tree | 6ffe2362c468c4eace54767f86889d4e70a64b6e /src/vnet | |
parent | 7285be2aabf4ba9915a23085e63efb896c5a8896 (diff) |
ip nat: use ip rx sw_if_index in ip-local arc start
This also changes the behavior of the nat44-ei hairpinning feature.
Rather then enabling the feature on every nat interface, it is enabled
only on local0.
Type: improvement
Signed-off-by: Filip Varga <fivarga@cisco.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I4e16a83c9e328aa75fc61df508b620ef743ca775
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/ip/ip4_forward.c | 5 | ||||
-rw-r--r-- | src/vnet/ip/ip6_forward.c | 12 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c index 4d0638209e5..3c67bb3d4e7 100644 --- a/src/vnet/ip/ip4_forward.c +++ b/src/vnet/ip/ip4_forward.c @@ -1508,9 +1508,8 @@ ip4_local_set_next_and_error (vlib_node_runtime_t * error_node, next_index = *next; if (PREDICT_TRUE (error == (u8) IP4_ERROR_UNKNOWN_PROTOCOL)) { - vnet_feature_arc_start (arc_index, - vnet_buffer (b)->sw_if_index[VLIB_RX], - &next_index, b); + vnet_feature_arc_start ( + arc_index, vnet_buffer (b)->ip.rx_sw_if_index, &next_index, b); *next = next_index; } } diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c index b876b6f2a78..5951de45908 100644 --- a/src/vnet/ip/ip6_forward.c +++ b/src/vnet/ip/ip6_forward.c @@ -1513,16 +1513,16 @@ ip6_local_inline (vlib_main_t *vm, vlib_node_runtime_t *node, { u32 next32 = next[0]; vnet_feature_arc_start (arc_index, - vnet_buffer (b[0])->sw_if_index - [VLIB_RX], &next32, b[0]); + vnet_buffer (b[0])->ip.rx_sw_if_index, + &next32, b[0]); next[0] = next32; } if (PREDICT_TRUE (ip6_unknown[1])) { u32 next32 = next[1]; vnet_feature_arc_start (arc_index, - vnet_buffer (b[1])->sw_if_index - [VLIB_RX], &next32, b[1]); + vnet_buffer (b[1])->ip.rx_sw_if_index, + &next32, b[1]); next[1] = next32; } } @@ -1642,8 +1642,8 @@ ip6_local_inline (vlib_main_t *vm, vlib_node_runtime_t *node, { u32 next32 = next[0]; vnet_feature_arc_start (arc_index, - vnet_buffer (b[0])->sw_if_index - [VLIB_RX], &next32, b[0]); + vnet_buffer (b[0])->ip.rx_sw_if_index, + &next32, b[0]); next[0] = next32; } } |