{
ethernet_arp_header_t *a = va_arg (*va, ethernet_arp_header_t *);
u32 max_header_bytes = va_arg (*va, u32);
- uword indent;
+ u32 indent;
u16 l2_type, l3_type;
if (max_header_bytes != 0 && sizeof (a[0]) > max_header_bytes)
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,
*/
if (0 == memcmp (e->ethernet_address,
a->ethernet, sizeof (e->ethernet_address)))
- return -1;
+ goto check_customers;
/* Update time stamp and ethernet address. */
clib_memcpy (e->ethernet_address, a->ethernet,
adj_nbr_walk_nh4 (sw_if_index, &e->ip4_address, arp_mk_complete_walk, e);
+check_customers:
/* Customer(s) waiting for this address to be resolved? */
p = hash_get (am->pending_resolutions_by_address, a->ip4.as_u32);
if (p)
/*
* 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.
&arp0->ip4_over_ethernet[0]);
goto drop1;
}
+ else if (arp0->opcode ==
+ clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_request) &&
+ (dst_is_local0 == 0))
+ {
+ goto drop1;
+ }
send_reply:
/* Send a reply.
{
ethernet_arp_main_t *am = ðernet_arp_main;
ethernet_arp_ip4_entry_t *e;
+ adj_index_t ai;
/* *INDENT-OFF* */
pool_foreach (e, am->ip4_entry_pool,
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 static
-send_ip4_garp (vlib_main_t * vm, vnet_hw_interface_t * hi)
+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_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)
{
}
}
-static vlib_node_registration_t send_garp_na_proc_node;
-
-static uword
-send_garp_na_process (vlib_main_t * vm,
- vlib_node_runtime_t * rt, vlib_frame_t * f)
-{
- vnet_main_t *vnm = vnet_get_main ();
- uword event_type, *event_data = 0;
-
- send_garp_na_process_node_index = send_garp_na_proc_node.index;
-
- while (1)
- {
- vlib_process_wait_for_event (vm);
- event_type = vlib_process_get_events (vm, &event_data);
- if ((event_type == SEND_GARP_NA) && (vec_len (event_data) >= 1))
- {
- u32 hw_if_index = event_data[0];
- vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, hw_if_index);
- send_ip4_garp (vm, hi);
- send_ip6_na (vm, hi);
- }
- vec_reset_length (event_data);
- }
- return 0;
-}
-
-
-/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (send_garp_na_proc_node, static) = {
- .function = send_garp_na_process,
- .type = VLIB_NODE_TYPE_PROCESS,
- .name = "send-garp-na-process",
-};
-/* *INDENT-ON* */
-
/*
* fd.io coding-style-patch-verification: ON
*