From owner-svn-src-all@FreeBSD.ORG Tue Oct 15 10:19:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0FD5AF29; Tue, 15 Oct 2013 10:19:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB5B422BE; Tue, 15 Oct 2013 10:19:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9FAJPab098888; Tue, 15 Oct 2013 10:19:25 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9FAJOgB098850; Tue, 15 Oct 2013 10:19:24 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310151019.r9FAJOgB098850@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 15 Oct 2013 10:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256518 - in head: contrib/ipfilter sys/net sys/netinet sys/netinet6 sys/netipx usr.sbin/ifmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Oct 2013 10:19:26 -0000 Author: glebius Date: Tue Oct 15 10:19:24 2013 New Revision: 256518 URL: http://svnweb.freebsd.org/changeset/base/256518 Log: Hide 'struct ifaddr' definition from userland. Two tools left that use it, namely ipftest(1) and ifmcstat(1). These sniff structure definition using _WANT_IFADDR define. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/contrib/ipfilter/ipf.h head/sys/net/if_var.h head/sys/netinet/in_var.h head/sys/netinet6/in6_var.h head/sys/netipx/ipx_if.h head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/contrib/ipfilter/ipf.h ============================================================================== --- head/contrib/ipfilter/ipf.h Tue Oct 15 10:12:19 2013 (r256517) +++ head/contrib/ipfilter/ipf.h Tue Oct 15 10:19:24 2013 (r256518) @@ -42,9 +42,10 @@ struct file; #include #include #include -#if __FreeBSD_version >= 300000 -# include -#endif + +#define _WANT_IFADDR +#include + #include #include #include Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Oct 15 10:12:19 2013 (r256517) +++ head/sys/net/if_var.h Tue Oct 15 10:19:24 2013 (r256518) @@ -788,6 +788,7 @@ drbr_inuse(struct ifnet *ifp, struct buf * 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 */ @@ -806,6 +807,8 @@ struct ifaddr { (struct ifaddr *, struct sockaddr *); struct mtx ifa_mtx; }; +#endif + #define IFA_ROUTE RTF_UP /* route installed */ #define IFA_RTSELF RTF_HOST /* loopback route to self installed */ Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Tue Oct 15 10:12:19 2013 (r256517) +++ head/sys/netinet/in_var.h Tue Oct 15 10:19:24 2013 (r256518) @@ -50,6 +50,7 @@ struct in_ifinfo { struct in_multi *ii_allhosts; /* 224.0.0.1 membership */ }; +#if defined(_KERNEL) || defined(_WANT_IFADDR) /* * Interface address, Internet version. One of these structures * is allocated for each Internet address on an interface. @@ -70,6 +71,7 @@ struct in_ifaddr { #define ia_broadaddr ia_dstaddr struct sockaddr_in ia_sockmask; /* reserve space for general netmask */ }; +#endif 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 Tue Oct 15 10:12:19 2013 (r256517) +++ head/sys/netinet6/in6_var.h Tue Oct 15 10:19:24 2013 (r256518) @@ -110,6 +110,7 @@ struct in6_ifextra { #define LLTABLE6(ifp) (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->lltable) +#if defined(_KERNEL) || defined(_WANT_IFADDR) struct in6_ifaddr { struct ifaddr ia_ifa; /* protocol-independent info */ #define ia_ifp ia_ifa.ifa_ifp @@ -140,6 +141,7 @@ struct in6_ifaddr { /* List of in6_ifaddr's. */ TAILQ_HEAD(in6_ifaddrhead, in6_ifaddr); LIST_HEAD(in6_ifaddrlisthead, in6_ifaddr); +#endif /* control structure to manage address selection policy */ struct in6_addrpolicy { Modified: head/sys/netipx/ipx_if.h ============================================================================== --- head/sys/netipx/ipx_if.h Tue Oct 15 10:12:19 2013 (r256517) +++ head/sys/netipx/ipx_if.h Tue Oct 15 10:19:24 2013 (r256518) @@ -70,7 +70,7 @@ * The ifaddr structure contains the protocol-independent part * of the structure and is assumed to be first. */ - +#ifdef _KERNEL struct ipx_ifaddr { struct ifaddr ia_ifa; /* protocol-independent info */ #define ia_ifp ia_ifa.ifa_ifp @@ -81,6 +81,7 @@ struct ipx_ifaddr { #define ia_broadaddr ia_dstaddr struct sockaddr_ipx ia_netmask; /* space for my network mask */ }; +#endif /* _KERNEL */ struct ipx_aliasreq { char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Tue Oct 15 10:12:19 2013 (r256517) +++ head/usr.sbin/ifmcstat/ifmcstat.c Tue Oct 15 10:19:24 2013 (r256518) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define _WANT_IFADDR #include #include #include