diff options
author | luigi <luigi@FreeBSD.org> | 2004-04-15 19:45:59 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2004-04-15 19:45:59 +0000 |
commit | fa9222585e2ae94c9da702e4b6a4fd959416bd33 (patch) | |
tree | 079de2d7c5216872dc81320aec60a2f4b045794a | |
parent | 6bcd1e85ae8a8c05c66fbb66971141ef97697a64 (diff) | |
download | FreeBSD-src-fa9222585e2ae94c9da702e4b6a4fd959416bd33.zip FreeBSD-src-fa9222585e2ae94c9da702e4b6a4fd959416bd33.tar.gz |
Document the way if_addrhead and struct ifaddr are used.
Remove a member from 'struct ifaddr' which has been in an
#ifdef notdef block since rev 1.1
No ABI changes -- no need to recompile anything.
-rw-r--r-- | sys/net/if_var.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 83abad6..1d40470 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -131,6 +131,13 @@ struct ifnet { const char *if_dname; /* driver name */ int if_dunit; /* unit or IF_DUNIT_NONE */ struct ifaddrhead if_addrhead; /* linked list of addresses per if */ + /* + * if_addrhead is the list of all addresses associated to + * an interface. The first element of the list must be + * of type AF_LINK, and contains sockaddr_dl addresses, + * which include the link-level address and the name + * of the interface. + */ struct klist if_klist; /* events attached to this if */ int if_pcount; /* number of promiscuous listeners */ struct bpf_if *if_bpf; /* packet filter structure */ @@ -338,6 +345,10 @@ if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust) * of an interface. They are maintained by the different address families, * are allocated and attached when an address is set, and are linked * together so all addresses for an interface can be located. + * + * NOTE: a 'struct ifaddr' is always at the beginning of a larger + * chunk of malloc'ed memory, where we store the three addresses + * (ifa_addr, ifa_dstaddr and ifa_netmask) referenced here. */ struct ifaddr { struct sockaddr *ifa_addr; /* address of interface */ @@ -352,9 +363,6 @@ struct ifaddr { u_short ifa_flags; /* mostly rt_flags for cloning */ u_int ifa_refcnt; /* references to this structure */ int ifa_metric; /* cost of going out this interface */ -#ifdef notdef - struct rtentry *ifa_rt; /* XXXX for ROUTETOIF ????? */ -#endif int (*ifa_claim_addr) /* check if an addr goes to this if */ (struct ifaddr *, struct sockaddr *); struct mtx ifa_mtx; |