rtentry and rtrequest
Bruce M. Simpson
bms at incunabulum.net
Wed Apr 18 18:56:56 UTC 2007
Alan Garfield wrote:
> Hi all!
>
> One word.... HOW! :)
>
> I've no clue what this FreeBSD ARP stuff is all about, there is little
> or no documentation, there are 14 different sock_addr's which seem to
> have a bazillion different fields, and I cannot output a simple debug
> statement without getting 'error: dereferencing pointer to incomplete
> type' errors!
>
The ARP code is pretty well documented in TCP/IP Illustrated Volume 2
and hasn't really significantly changed. Whilst I personally dislike how
reentry happens in some of the paths, it works. In BSD, ARP lives in the
routing table, which can be confusing to newcomers; such entries have
the RTF_LLINFO flag set.
From the sounds of it, if you are having to fake MAC addresses, you
would be better off just enabling static mode ARP on the interface,
possibly also enabling IFF_SMART ('manages own routes') on your
interface and explicitly purging and re-adding your ARP entries from
within your driver rather than trying to hack the rtrequest code to
munge things on the fly. arp_rtrequest() is driver-independent code and
will get hooked up to your code anyway when the net/ framework notices
that your driver is one of IFT_ETHER.
Regards,
BMS
More information about the freebsd-net
mailing list