All of lore.kernel.org
 help / color / mirror / Atom feed
* ARP resolving for switch drivers
@ 2015-02-22  6:11 David Miller
  2015-02-22  6:28 ` Scott Feldman
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2015-02-22  6:11 UTC (permalink / raw)
  To: sfeldma; +Cc: netdev


Scott I looked into the current state of affairs and you should
be able to use generic infrastructure to resolve a neighbour
entry and even trigger the state machine.

For ipv4:

	n = __ipv4_neigh_lookup(dev, ip_addr);
	if (!n)
		n = neigh_create(&arp_tbl, &ip_addr, dev, true);
	if (!n)
		goto error;

	if (!(n->nud_state & NUD_VALID))
		neigh_event_send(n, NULL);
	else
		memcpy(&hw_entry->mac_addr, n->ha, dev_addr_len);

If you have to take the neigh_event_send() path, you have to wait for
the notifier to be invoked.  And in the notifier you can fetch the
MAC address.

You shouldn't have to hand craft ARP requests and listen for responses
or anything like that.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-27 22:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-22  6:11 ARP resolving for switch drivers David Miller
2015-02-22  6:28 ` Scott Feldman
2015-02-26  5:08   ` Scott Feldman
2015-02-26  5:56     ` roopa
2015-02-26 12:03       ` Scott Feldman
2015-02-27 22:26         ` David Miller
2015-02-26  6:18     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.