- // Trash ARP packets whose ARP-level source addresses do not
- // match their L2-frame-level source addresses */
- if (PREDICT_FALSE (
- memcmp (eth0->src_address, arp0->ip4_over_ethernet[0].ethernet,
- sizeof (eth0->src_address))))
- {
- error0 = ETHERNET_ARP_ERROR_l2_address_mismatch;
- goto drop;
- }
-
- // Check if anyone want ARP request events for L2 BDs
- {
- pending_resolution_t * mc;
- ethernet_arp_main_t * am = ðernet_arp_main;
- uword *p = hash_get (am->mac_changes_by_address, 0);
- if (p && (vnet_buffer(p0)->l2.shg == 0))
- { // Only SHG 0 interface which is more likely local
- u32 next_index = p[0];
- while (next_index != (u32)~0)
- {
- int (*fp)(u32, u8 *, u32, u32);
- int rv = 1;
- mc = pool_elt_at_index (am->mac_changes, next_index);
- fp = mc->data_callback;
- // Call the callback, return 1 to suppress dup events */
- if (fp) rv = (*fp)(mc->data,
- arp0->ip4_over_ethernet[0].ethernet,
- sw_if_index0,
- arp0->ip4_over_ethernet[0].ip4.as_u32);
- // Signal the resolver process
- if (rv == 0)
- vlib_process_signal_event (vm, mc->node_index,
- mc->type_opaque,
- mc->data);
- next_index = mc->next_index;
- }
+ /* Trash ARP packets whose ARP-level source addresses do not
+ match their L2-frame-level source addresses */
+ if (PREDICT_FALSE
+ (memcmp
+ (eth0->src_address, arp0->ip4_over_ethernet[0].ethernet,
+ sizeof (eth0->src_address))))
+ {
+ error0 = ETHERNET_ARP_ERROR_l2_address_mismatch;
+ goto drop;