VPP-137: VPP sends ARP with wrong requested IP 47/1547/2
authorNeale <[email protected]>
Tue, 14 Jun 2016 17:44:02 +0000 (18:44 +0100)
committerDamjan Marion <[email protected]>
Wed, 15 Jun 2016 09:18:26 +0000 (09:18 +0000)
Change-Id: I01802f3dab04c940e65236ba6e680f1e504a0a5f
Signed-off-by: Neale <[email protected]>
vpp/api/api.c

index f398e4f..77635a9 100644 (file)
@@ -974,7 +974,18 @@ static int ip4_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
         }
 
         nh_adj = ip_get_adjacency (lm, ai);
-        vec_add1 (add_adj, nh_adj[0]);
+       if (nh_adj->lookup_next_index == IP_LOOKUP_NEXT_ARP &&
+           nh_adj->arp.next_hop.ip4.as_u32 == 0) {
+           /* the next-hop resovles via a glean adj. create and use
+            * a ARP adj for the next-hop */
+           a.adj_index = vnet_arp_glean_add(fib_index, &next_hop_address);
+           a.add_adj = NULL;
+           a.n_add_adj = 0;
+           ip4_add_del_route (im, &a);
+
+           goto done;
+       }
+       vec_add1 (add_adj, nh_adj[0]);
         if (mp->lookup_in_vrf) {
             p = hash_get (im->fib_index_by_table_id, ntohl(mp->lookup_in_vrf));
             if (p)
@@ -1016,6 +1027,7 @@ do_add_del:
 
     vec_free (add_adj);
 
+done:
     dsunlock (sm);
     return 0;
 }