Author: glebius
Date: Thu Feb 19 23:16:10 2015
New Revision: 279030
URL: https://svnweb.freebsd.org/changeset/base/279030

Log:
  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.

Modified:
  head/sys/net/if_var.h
  head/sys/netinet/in_var.h
  head/sys/netinet6/in6_var.h

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h       Thu Feb 19 23:14:35 2015        (r279029)
+++ head/sys/net/if_var.h       Thu Feb 19 23:16:10 2015        (r279030)
@@ -365,8 +365,6 @@ EVENTHANDLER_DECLARE(group_change_event,
 
 #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,
  * 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

Modified: head/sys/netinet/in_var.h
==============================================================================
--- head/sys/netinet/in_var.h   Thu Feb 19 23:14:35 2015        (r279029)
+++ head/sys/netinet/in_var.h   Thu Feb 19 23:16:10 2015        (r279030)
@@ -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" */

Modified: head/sys/netinet6/in6_var.h
==============================================================================
--- head/sys/netinet6/in6_var.h Thu Feb 19 23:14:35 2015        (r279029)
+++ head/sys/netinet6/in6_var.h Thu Feb 19 23:16:10 2015        (r279030)
@@ -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 {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to