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 | |
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')
-rw-r--r-- | sys/net/if_arp.h | 6 | ||||
-rw-r--r-- | sys/net/if_ethersubr.c | 1 | ||||
-rw-r--r-- | sys/net/if_fddisubr.c | 1 | ||||
-rw-r--r-- | sys/net/if_iso88025subr.c | 1 | ||||
-rw-r--r-- | sys/net/if_var.h | 4 |
5 files changed, 9 insertions, 4 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_ */ diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 93791df..7bf473d 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -114,7 +114,6 @@ static int ether_resolvemulti(struct ifnet *, struct sockaddr **, struct sockaddr *); #define senderr(e) do { error = (e); goto bad;} while (0) -#define IFP2AC(IFP) ((struct arpcom *)IFP) int ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 1003208..2e89840 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -98,7 +98,6 @@ static int fddi_output(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); static void fddi_input(struct ifnet *ifp, struct mbuf *m); -#define IFP2AC(IFP) ((struct arpcom *)IFP) #define senderr(e) do { error = (e); goto bad; } while (0) /* diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index 7062632..5f1b802 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -85,7 +85,6 @@ static const u_char iso88025_broadcastaddr[ISO88025_ADDR_LEN] = static int iso88025_resolvemulti (struct ifnet *, struct sockaddr **, struct sockaddr *); -#define IFP2AC(IFP) ((struct arpcom *)IFP) #define senderr(e) do { error = (e); goto bad; } while (0) /* diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 9494129..989f8c5 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -187,6 +187,10 @@ struct ifnet { typedef void if_init_f_t(void *); +/* + * XXX These aliases are terribly dangerous because they could apply + * to anything. + */ #define if_mtu if_data.ifi_mtu #define if_type if_data.ifi_type #define if_physical if_data.ifi_physical |