aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2016-09-05 19:54:17 +0200
committerDave Barach <openvpp@barachs.net>2016-09-06 18:10:34 +0000
commitdf9d3bc3c4d9a2ed2611ea4eba03510a5eb4bacd (patch)
tree36587ef009d568f3244074cbd239d7a462a67fd5 /vnet
parent0c6a6750daae0008f29c17be766514fdfe848b72 (diff)
VPP-385: Fix ARP for indirect adjacencies
Change-Id: I48cffb8acbd9e6655d7ec661ee8f7e0689b12a2d Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/ip/ip4_forward.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c
index 8113cd72219..8a49854966c 100644
--- a/vnet/vnet/ip/ip4_forward.c
+++ b/vnet/vnet/ip/ip4_forward.c
@@ -884,6 +884,15 @@ ip4_lookup_inline (vlib_main_t * vm,
vnet_buffer (p0)->ip.adj_index[VLIB_TX] = adj_index0;
vnet_buffer (p1)->ip.adj_index[VLIB_TX] = adj_index1;
+ if (is_indirect)
+ {
+ /* ARP for next-hop not packet's destination address */
+ if (adj0->lookup_next_index == IP_LOOKUP_NEXT_ARP)
+ ip0->dst_address.as_u32 = dst_addr0->as_u32;
+ if (adj1->lookup_next_index == IP_LOOKUP_NEXT_ARP)
+ ip1->dst_address.as_u32 = dst_addr1->as_u32;
+ }
+
vlib_increment_combined_counter
(cm, cpu_index, adj_index0, 1,
vlib_buffer_length_in_chain (vm, p0)
@@ -1027,6 +1036,13 @@ ip4_lookup_inline (vlib_main_t * vm,
vnet_buffer (p0)->ip.adj_index[VLIB_TX] = adj_index0;
+ if (is_indirect)
+ {
+ /* ARP for next-hop not packet's destination address */
+ if (adj0->lookup_next_index == IP_LOOKUP_NEXT_ARP)
+ ip0->dst_address.as_u32 = dst_addr0->as_u32;
+ }
+
vlib_increment_combined_counter
(cm, cpu_index, adj_index0, 1,
vlib_buffer_length_in_chain (vm, p0)