summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2015-02-19 23:16:10 +0000
committerglebius <glebius@FreeBSD.org>2015-02-19 23:16:10 +0000
commit90eb9ef3d2a7e3442f2fe0a5a49a823f00dc0689 (patch)
treed1a73e3b79a17ded7bbfee5736d483701c497ca7
parent896e3f467bb1988d34b0711c1ccc64990fab0ce7 (diff)
downloadFreeBSD-src-90eb9ef3d2a7e3442f2fe0a5a49a823f00dc0689.zip
FreeBSD-src-90eb9ef3d2a7e3442f2fe0a5a49a823f00dc0689.tar.gz
Now that all users of _WANT_IFADDR are fixed, remove this crutch and
hide ifaddr, in_ifaddr and in6_ifaddr under _KERNEL. Sponsored by: Netflix Sponsored by: Nginx, Inc.
-rw-r--r--sys/net/if_var.h10
-rw-r--r--sys/netinet/in_var.h4
-rw-r--r--sys/netinet6/in6_var.h4
3 files changed, 6 insertions, 12 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 98e9828..e7166f2 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -365,8 +365,6 @@ EVENTHANDLER_DECLARE(group_change_event, group_change_event_handler_t);
#define TOEDEV(ifp) ((ifp)->if_llsoftc)
-#endif /* _KERNEL */
-
/*
* The ifaddr structure contains information about one address
* of an interface. They are maintained by the different address families,
@@ -377,7 +375,6 @@ EVENTHANDLER_DECLARE(group_change_event, group_change_event_handler_t);
* chunk of malloc'ed memory, where we store the three addresses
* (ifa_addr, ifa_dstaddr and ifa_netmask) referenced here.
*/
-#if defined(_KERNEL) || defined(_WANT_IFADDR)
struct ifaddr {
struct sockaddr *ifa_addr; /* address of interface */
struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */
@@ -389,6 +386,8 @@ struct ifaddr {
void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */
(int, struct rtentry *, struct rt_addrinfo *);
u_short ifa_flags; /* mostly rt_flags for cloning */
+#define IFA_ROUTE RTF_UP /* route installed */
+#define IFA_RTSELF RTF_HOST /* loopback route to self installed */
u_int ifa_refcnt; /* references to this structure */
counter_u64_t ifa_ipackets;
@@ -396,11 +395,6 @@ struct ifaddr {
counter_u64_t ifa_ibytes;
counter_u64_t ifa_obytes;
};
-#endif
-
-#ifdef _KERNEL
-#define IFA_ROUTE RTF_UP /* route installed */
-#define IFA_RTSELF RTF_HOST /* loopback route to self installed */
/* For compatibility with other BSDs. SCTP uses it. */
#define ifa_list ifa_link
diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h
index 2a8e28e..a3fbd14 100644
--- a/sys/netinet/in_var.h
+++ b/sys/netinet/in_var.h
@@ -50,7 +50,7 @@ struct in_ifinfo {
struct in_multi *ii_allhosts; /* 224.0.0.1 membership */
};
-#if defined(_KERNEL) || defined(_WANT_IFADDR)
+#ifdef _KERNEL
/*
* Interface address, Internet version. One of these structures
* is allocated for each Internet address on an interface.
@@ -71,7 +71,7 @@ struct in_ifaddr {
#define ia_broadaddr ia_dstaddr
struct sockaddr_in ia_sockmask; /* reserve space for general netmask */
};
-#endif
+#endif /* _KERNEL */
struct in_aliasreq {
char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h
index 7da67bb..7d1551b 100644
--- a/sys/netinet6/in6_var.h
+++ b/sys/netinet6/in6_var.h
@@ -110,7 +110,7 @@ struct in6_ifextra {
#define LLTABLE6(ifp) (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->lltable)
-#if defined(_KERNEL) || defined(_WANT_IFADDR)
+#ifdef _KERNEL
struct in6_ifaddr {
struct ifaddr ia_ifa; /* protocol-independent info */
#define ia_ifp ia_ifa.ifa_ifp
@@ -141,7 +141,7 @@ struct in6_ifaddr {
/* List of in6_ifaddr's. */
TAILQ_HEAD(in6_ifaddrhead, in6_ifaddr);
LIST_HEAD(in6_ifaddrlisthead, in6_ifaddr);
-#endif
+#endif /* _KERNEL */
/* control structure to manage address selection policy */
struct in6_addrpolicy {
OpenPOWER on IntegriCloud