X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fethernet%2Farp.c;h=149f0a5dc96e4484aabc0e6d571f95babdc2b41e;hb=438f63094465d35c278155484fe85153e438873e;hp=e974d2551e5b5cc91578deee9bd9dc5bd82a3727;hpb=c125eccc10db9c0b9c5d161d3ad20b4fc8c69b26;p=vpp.git diff --git a/src/vnet/ethernet/arp.c b/src/vnet/ethernet/arp.c index e974d2551e5..149f0a5dc96 100644 --- a/src/vnet/ethernet/arp.c +++ b/src/vnet/ethernet/arp.c @@ -203,7 +203,7 @@ format_ethernet_arp_header (u8 * s, va_list * va) { 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) @@ -615,7 +615,7 @@ vnet_arp_set_ip4_over_ethernet_internal (vnet_main_t * vnm, */ 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, @@ -630,6 +630,7 @@ vnet_arp_set_ip4_over_ethernet_internal (vnet_main_t * vnm, 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) @@ -1122,6 +1123,12 @@ arp_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) &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. @@ -2482,7 +2489,7 @@ ethernet_arp_change_mac (u32 sw_if_index) /* *INDENT-ON* */ } -void static +void send_ip4_garp (vlib_main_t * vm, vnet_hw_interface_t * hi) { ip4_main_t *i4m = &ip4_main; @@ -2526,42 +2533,6 @@ send_ip4_garp (vlib_main_t * vm, vnet_hw_interface_t * hi) } } -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 *