summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip4_forward.c23
-rw-r--r--src/vnet/ip/ip6_forward.c27
2 files changed, 25 insertions, 25 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index c1bfc7d4ce5..33ab341f93b 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -1538,14 +1538,14 @@ ip4_local_check_src (vlib_buffer_t *b, ip4_header_t *ip0,
vnet_buffer (b)->sw_if_index[VLIB_TX] != ~0 ?
vnet_buffer (b)->sw_if_index[VLIB_TX] : vnet_buffer (b)->ip.fib_index;
+ vnet_buffer (b)->ip.rx_sw_if_index = vnet_buffer (b)->sw_if_index[VLIB_RX];
if (is_receive_dpo)
{
receive_dpo_t *rd;
rd = receive_dpo_get (vnet_buffer (b)->ip.adj_index[VLIB_TX]);
- vnet_buffer (b)->ip.rx_sw_if_index = rd->rd_sw_if_index;
+ if (rd->rd_sw_if_index != ~0)
+ vnet_buffer (b)->ip.rx_sw_if_index = rd->rd_sw_if_index;
}
- else
- vnet_buffer (b)->ip.rx_sw_if_index = vnet_buffer (b)->sw_if_index[VLIB_RX];
/*
* vnet_buffer()->ip.adj_index[VLIB_RX] will be set to the index of the
@@ -1628,20 +1628,19 @@ ip4_local_check_src_x2 (vlib_buffer_t **b, ip4_header_t **ip,
not_last_hit |= vnet_buffer (b[0])->ip.fib_index ^ last_check->fib_index;
not_last_hit |= vnet_buffer (b[1])->ip.fib_index ^ last_check->fib_index;
+ vnet_buffer (b[0])->ip.rx_sw_if_index =
+ vnet_buffer (b[0])->sw_if_index[VLIB_RX];
+ vnet_buffer (b[1])->ip.rx_sw_if_index =
+ vnet_buffer (b[1])->sw_if_index[VLIB_RX];
if (is_receive_dpo)
{
const receive_dpo_t *rd0, *rd1;
rd0 = receive_dpo_get (vnet_buffer (b[0])->ip.adj_index[VLIB_TX]);
rd1 = receive_dpo_get (vnet_buffer (b[1])->ip.adj_index[VLIB_TX]);
- vnet_buffer (b[0])->ip.rx_sw_if_index = rd0->rd_sw_if_index;
- vnet_buffer (b[1])->ip.rx_sw_if_index = rd1->rd_sw_if_index;
- }
- else
- {
- vnet_buffer (b[0])->ip.rx_sw_if_index =
- vnet_buffer (b[0])->sw_if_index[VLIB_RX];
- vnet_buffer (b[1])->ip.rx_sw_if_index =
- vnet_buffer (b[1])->sw_if_index[VLIB_RX];
+ if (rd0->rd_sw_if_index != ~0)
+ vnet_buffer (b[0])->ip.rx_sw_if_index = rd0->rd_sw_if_index;
+ if (rd1->rd_sw_if_index != ~0)
+ vnet_buffer (b[1])->ip.rx_sw_if_index = rd1->rd_sw_if_index;
}
/*
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index 5951de45908..44b0052225b 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -1475,6 +1475,11 @@ ip6_local_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
vnet_buffer (b[1])->sw_if_index[VLIB_TX] != ~0 ?
vnet_buffer (b[1])->sw_if_index[VLIB_TX] :
vnet_buffer (b[1])->ip.fib_index;
+
+ vnet_buffer (b[0])->ip.rx_sw_if_index =
+ vnet_buffer (b[0])->sw_if_index[VLIB_RX];
+ vnet_buffer (b[1])->ip.rx_sw_if_index =
+ vnet_buffer (b[1])->sw_if_index[VLIB_RX];
if (is_receive_dpo)
{
const receive_dpo_t *rd0, *rd1;
@@ -1482,15 +1487,10 @@ ip6_local_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
receive_dpo_get (vnet_buffer (b[0])->ip.adj_index[VLIB_TX]);
rd1 =
receive_dpo_get (vnet_buffer (b[1])->ip.adj_index[VLIB_TX]);
- vnet_buffer (b[0])->ip.rx_sw_if_index = rd0->rd_sw_if_index;
- vnet_buffer (b[1])->ip.rx_sw_if_index = rd1->rd_sw_if_index;
- }
- else
- {
- vnet_buffer (b[0])->ip.rx_sw_if_index =
- vnet_buffer (b[0])->ip.adj_index[VLIB_RX];
- vnet_buffer (b[1])->ip.rx_sw_if_index =
- vnet_buffer (b[1])->ip.adj_index[VLIB_RX];
+ if (rd0->rd_sw_if_index != ~0)
+ vnet_buffer (b[0])->ip.rx_sw_if_index = rd0->rd_sw_if_index;
+ if (rd1->rd_sw_if_index != ~0)
+ vnet_buffer (b[1])->ip.rx_sw_if_index = rd1->rd_sw_if_index;
}
} /* head_of_feature_arc */
@@ -1619,15 +1619,16 @@ ip6_local_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
vnet_buffer (b[0])->sw_if_index[VLIB_TX] != ~0 ?
vnet_buffer (b[0])->sw_if_index[VLIB_TX] :
vnet_buffer (b[0])->ip.fib_index;
+
+ vnet_buffer (b[0])->ip.rx_sw_if_index =
+ vnet_buffer (b[0])->sw_if_index[VLIB_RX];
if (is_receive_dpo)
{
receive_dpo_t *rd;
rd = receive_dpo_get (vnet_buffer (b[0])->ip.adj_index[VLIB_TX]);
- vnet_buffer (b[0])->ip.rx_sw_if_index = rd->rd_sw_if_index;
+ if (rd->rd_sw_if_index != ~0)
+ vnet_buffer (b[0])->ip.rx_sw_if_index = rd->rd_sw_if_index;
}
- else
- vnet_buffer (b[0])->ip.rx_sw_if_index =
- vnet_buffer (b[0])->ip.adj_index[VLIB_RX];
} /* head_of_feature_arc */
next[0] = lm->local_next_by_ip_protocol[ip->protocol];