diff options
author | luigi <luigi@FreeBSD.org> | 2004-04-18 01:15:32 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2004-04-18 01:15:32 +0000 |
commit | 9cffdfc5cab4dbd32d0b1fe590e1d003682a5359 (patch) | |
tree | 58bf4f0462dd776e1be5a5e165421ceb64f27085 /sys/net/if_arp.h | |
parent | b84b33b31dbab93dce7ee1430680b1b94cad517c (diff) | |
download | FreeBSD-src-9cffdfc5cab4dbd32d0b1fe590e1d003682a5359.zip FreeBSD-src-9cffdfc5cab4dbd32d0b1fe590e1d003682a5359.tar.gz |
+ rename and document an unused field in struct arpcom (field is still
there so there are no ABI changes);
+ replace 5 redefinitions of the IPF2AC macro with one in if_arp.h
Eventually (but before freezing the ABI) we need to get rid of
struct arpcom (initially with the help of some smart #defines
to avoid having to touch each and every driver, see below).
Apart from the struct ifnet, struct arpcom now only stores a copy
of the MAC address (ac_enaddr, but we already have another copy in
the struct ifnet -- if_addrhead), and a netgraph-specific field
which is _always_ accessed through the ifp, so it might well go
into the struct ifnet too (where, besides, there is already an entry
for AF_NETGRAPH data...)
Too bad ac_enaddr is widely referenced by all drivers. But
this can be fixed as follows:
#define ac_enaddr ac_if.the_original_ac_enaddr_in_struct_ifnet
(note that the right hand side would likely be a pointer rather than
the base address of an array.)
Diffstat (limited to 'sys/net/if_arp.h')
-rw-r--r-- | sys/net/if_arp.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h index 9afea76..6cc3ce9 100644 --- a/sys/net/if_arp.h +++ b/sys/net/if_arp.h @@ -100,6 +100,8 @@ struct arpreq { * Structure shared between the ethernet driver modules and * the address resolution code. For example, each ec_softc or il_softc * begins with this structure. + * The code is written so that each *_softc _must_ begin with a + * struct arpcom, which in turn _must_ begin with a struct ifnet. */ struct arpcom { /* @@ -107,9 +109,11 @@ struct arpcom { */ struct ifnet ac_if; /* network-visible interface */ u_char ac_enaddr[6]; /* ethernet hardware address */ - int ac_multicnt; /* length of ac_multiaddrs list */ + int now_unused; /* XXX was length of ac_multiaddrs list */ void *ac_netgraph; /* ng_ether(4) netgraph node info */ }; +#define IFP2AC(ifp) ((struct arpcom *)(ifp)) + #endif #endif /* !_NET_IF_ARP_H_ */ |