aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2016-12-14 13:31:29 +0100
committerNeale Ranns <nranns@cisco.com>2016-12-14 16:09:14 +0000
commitcb630ff691264f7ea4a0f52cc6faa87fcdaa1a40 (patch)
tree175e4d58ed65a0c8606bdf85e1b2aab008f2b8e1 /vnet
parent8c2f05c2dc5d87f64ce03916d1b8341ec0397b15 (diff)
Ping response in a VRF context uses correct FIB for response
Change-Id: I3b626a1fb9d74ebc609ded14c16c5e3d5a1655ab Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/dpo/lookup_dpo.c10
-rw-r--r--vnet/vnet/ip/ip4_forward.c7
2 files changed, 17 insertions, 0 deletions
diff --git a/vnet/vnet/dpo/lookup_dpo.c b/vnet/vnet/dpo/lookup_dpo.c
index e5043663960..96fedd27ce9 100644
--- a/vnet/vnet/dpo/lookup_dpo.c
+++ b/vnet/vnet/dpo/lookup_dpo.c
@@ -385,6 +385,9 @@ lookup_dpo_ip4_inline (vlib_main_t * vm,
lb0 = load_balance_get(lbi0);
lb1 = load_balance_get(lbi1);
+ vnet_buffer(b0)->sw_if_index[VLIB_TX] = fib_index0;
+ vnet_buffer(b1)->sw_if_index[VLIB_TX] = fib_index1;
+
/* Use flow hash to compute multipath adjacency. */
hash_c0 = vnet_buffer (b0)->ip.flow_hash = 0;
hash_c1 = vnet_buffer (b1)->ip.flow_hash = 0;
@@ -500,6 +503,8 @@ lookup_dpo_ip4_inline (vlib_main_t * vm,
ip4_src_fib_lookup_one (fib_index0, input_addr, &lbi0);
lb0 = load_balance_get(lbi0);
+ vnet_buffer(b0)->sw_if_index[VLIB_TX] = fib_index0;
+
/* Use flow hash to compute multipath adjacency. */
hash_c0 = vnet_buffer (b0)->ip.flow_hash = 0;
@@ -722,6 +727,9 @@ lookup_dpo_ip6_inline (vlib_main_t * vm,
lb0 = load_balance_get(lbi0);
lb1 = load_balance_get(lbi1);
+ vnet_buffer(b0)->sw_if_index[VLIB_TX] = fib_index0;
+ vnet_buffer(b1)->sw_if_index[VLIB_TX] = fib_index1;
+
/* Use flow hash to compute multipath adjacency. */
hash_c0 = vnet_buffer (b0)->ip.flow_hash = 0;
hash_c1 = vnet_buffer (b1)->ip.flow_hash = 0;
@@ -837,6 +845,8 @@ lookup_dpo_ip6_inline (vlib_main_t * vm,
input_addr0);
lb0 = load_balance_get(lbi0);
+ vnet_buffer(b0)->sw_if_index[VLIB_TX] = fib_index0;
+
/* Use flow hash to compute multipath adjacency. */
hash_c0 = vnet_buffer (b0)->ip.flow_hash = 0;
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c
index 6a9e066027c..6e91b9e91e1 100644
--- a/vnet/vnet/ip/ip4_forward.c
+++ b/vnet/vnet/ip/ip4_forward.c
@@ -1500,8 +1500,13 @@ ip4_local (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
fib_index0 = vec_elt (im->fib_index_by_sw_if_index,
vnet_buffer (p0)->sw_if_index[VLIB_RX]);
+ fib_index0 = (vnet_buffer (p0)->sw_if_index[VLIB_TX] == (u32) ~ 0) ?
+ fib_index0 : vnet_buffer (p0)->sw_if_index[VLIB_TX];
+
fib_index1 = vec_elt (im->fib_index_by_sw_if_index,
vnet_buffer (p1)->sw_if_index[VLIB_RX]);
+ fib_index1 = (vnet_buffer (p1)->sw_if_index[VLIB_TX] == (u32) ~ 0) ?
+ fib_index1 : vnet_buffer (p1)->sw_if_index[VLIB_TX];
mtrie0 = &ip4_fib_get (fib_index0)->mtrie;
mtrie1 = &ip4_fib_get (fib_index1)->mtrie;
@@ -1721,6 +1726,8 @@ ip4_local (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
fib_index0 = vec_elt (im->fib_index_by_sw_if_index,
vnet_buffer (p0)->sw_if_index[VLIB_RX]);
+ fib_index0 = (vnet_buffer (p0)->sw_if_index[VLIB_TX] == (u32) ~ 0) ?
+ fib_index0 : vnet_buffer (p0)->sw_if_index[VLIB_TX];
mtrie0 = &ip4_fib_get (fib_index0)->mtrie;