aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/snat-plugin/snat/in2out.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/snat-plugin/snat/in2out.c')
-rw-r--r--plugins/snat-plugin/snat/in2out.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/snat-plugin/snat/in2out.c b/plugins/snat-plugin/snat/in2out.c
index 25dad934cad..9a4aeb01fd4 100644
--- a/plugins/snat-plugin/snat/in2out.c
+++ b/plugins/snat-plugin/snat/in2out.c
@@ -19,6 +19,7 @@
#include <vnet/ip/ip.h>
#include <vnet/ethernet/ethernet.h>
+#include <vnet/fib/ip4_fib.h>
#include <snat/snat.h>
#include <vppinfra/hash.h>
@@ -1004,7 +1005,8 @@ static inline u32 icmp_in2out_static_map (snat_main_t *sm,
icmp46_header_t * icmp0,
u32 sw_if_index0,
vlib_node_runtime_t * node,
- u32 next0)
+ u32 next0,
+ u32 rx_fib_index0)
{
snat_session_key_t key0, sm0;
icmp_echo_header_t *echo0;
@@ -1017,6 +1019,7 @@ static inline u32 icmp_in2out_static_map (snat_main_t *sm,
key0.addr = ip0->src_address;
key0.port = echo0->identifier;
+ key0.fib_index = rx_fib_index0;
if (snat_static_mapping_match(sm, key0, &sm0, 0))
{
@@ -1106,6 +1109,7 @@ snat_in2out_fast_static_map_fn (vlib_main_t * vm,
icmp46_header_t * icmp0;
snat_session_key_t key0, sm0;
u32 proto0;
+ u32 rx_fib_index0;
/* speculatively enqueue b0 to the current next frame */
bi0 = from[0];
@@ -1124,6 +1128,7 @@ snat_in2out_fast_static_map_fn (vlib_main_t * vm,
icmp0 = (icmp46_header_t *) udp0;
sw_if_index0 = vnet_buffer(b0)->sw_if_index[VLIB_RX];
+ rx_fib_index0 = ip4_fib_table_get_index_for_sw_if_index(sw_if_index0);
proto0 = ~0;
proto0 = (ip0->protocol == IP_PROTOCOL_UDP)
@@ -1155,12 +1160,13 @@ snat_in2out_fast_static_map_fn (vlib_main_t * vm,
goto trace0;
next0 = icmp_in2out_static_map
- (sm, b0, ip0, icmp0, sw_if_index0, node, next0);
+ (sm, b0, ip0, icmp0, sw_if_index0, node, next0, rx_fib_index0);
goto trace0;
}
key0.addr = ip0->src_address;
key0.port = udp0->src_port;
+ key0.fib_index = rx_fib_index0;
if (snat_static_mapping_match(sm, key0, &sm0, 0))
{