GBP V2
[vpp.git] / src / vnet / ethernet / arp.c
index 149f0a5..9114d7a 100644 (file)
@@ -455,8 +455,10 @@ arp_update_adjacency (vnet_main_t * vnm, u32 sw_if_index, u32 ai)
 
   switch (adj->lookup_next_index)
     {
-    case IP_LOOKUP_NEXT_ARP:
     case IP_LOOKUP_NEXT_GLEAN:
+      adj_glean_update_rewrite (ai);
+      break;
+    case IP_LOOKUP_NEXT_ARP:
       if (NULL != e)
        {
          adj_nbr_walk_nh4 (sw_if_index,
@@ -977,7 +979,7 @@ arp_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
            /*
             * we're looking for FIB entries that indicate the source
             * is attached. There may be more specific non-attached
-            * routes tht match the source, but these do not influence
+            * routes that match the source, but these do not influence
             * whether we respond to an ARP request, i.e. they do not
             * influence whether we are the correct way for the sender
             * to reach us, they only affect how we reach the sender.
@@ -2480,6 +2482,7 @@ ethernet_arp_change_mac (u32 sw_if_index)
 {
   ethernet_arp_main_t *am = &ethernet_arp_main;
   ethernet_arp_ip4_entry_t *e;
+  adj_index_t ai;
 
   /* *INDENT-OFF* */
   pool_foreach (e, am->ip4_entry_pool,
@@ -2487,14 +2490,30 @@ ethernet_arp_change_mac (u32 sw_if_index)
     change_arp_mac (sw_if_index, e);
   }));
   /* *INDENT-ON* */
+
+  ai = adj_glean_get (FIB_PROTOCOL_IP4, sw_if_index);
+
+  if (ADJ_INDEX_INVALID != ai)
+    adj_glean_update_rewrite (ai);
+}
+
+void
+send_ip4_garp (vlib_main_t * vm, const vnet_hw_interface_t * hi)
+{
+  ip4_main_t *i4m = &ip4_main;
+  ip4_address_t *ip4_addr =
+    ip4_interface_first_address (i4m, hi->sw_if_index, 0);
+
+  send_ip4_garp_w_addr (vm, ip4_addr, hi);
 }
 
 void
-send_ip4_garp (vlib_main_t * vm, vnet_hw_interface_t * hi)
+send_ip4_garp_w_addr (vlib_main_t * vm,
+                     const ip4_address_t * ip4_addr,
+                     const vnet_hw_interface_t * hi)
 {
   ip4_main_t *i4m = &ip4_main;
   u32 sw_if_index = hi->sw_if_index;
-  ip4_address_t *ip4_addr = ip4_interface_first_address (i4m, sw_if_index, 0);
 
   if (ip4_addr)
     {