Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Apr 2015 06:17:35 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r281191 - projects/ifnet/sys/net
Message-ID:  <201504070617.t376HZLo025117@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Apr  7 06:17:34 2015
New Revision: 281191
URL: https://svnweb.freebsd.org/changeset/base/281191

Log:
  Make if_var.h a kernel-only include.
  
  Ideally the header should #error, but since FreeBSD 3.0 we have taught
  many third party applications to always include if_var.h along with if.h
  on FreeBSD, thus #error lives under BURN_BRIDGES.
  
  Sponsored by:	Netflix
  Sponsored by:	Nginx, Inc.

Modified:
  projects/ifnet/sys/net/if_var.h

Modified: projects/ifnet/sys/net/if_var.h
==============================================================================
--- projects/ifnet/sys/net/if_var.h	Tue Apr  7 06:11:57 2015	(r281190)
+++ projects/ifnet/sys/net/if_var.h	Tue Apr  7 06:17:34 2015	(r281191)
@@ -32,6 +32,11 @@
 
 #ifndef	_NET_IF_VAR_H_
 #define	_NET_IF_VAR_H_
+#ifndef _KERNEL
+#ifdef BURN_BRIDGES
+#error "no user-servicable parts inside"
+#endif
+#else
 
 struct	rtentry;		/* ifa_rtrequest */
 struct	rt_addrinfo;		/* ifa_rtrequest */
@@ -41,11 +46,9 @@ struct  ifvlantrunk;
 struct	ifmedia;
 struct	netmap_adapter;
 
-#ifdef _KERNEL
 #include <sys/mbuf.h>		/* ifqueue only? */
 #include <sys/buf_ring.h>
 #include <net/vnet.h>
-#endif /* _KERNEL */
 #include <sys/counter.h>
 #include <sys/lock.h>		/* XXX */
 #include <sys/mutex.h>		/* struct ifqueue */
@@ -59,10 +62,8 @@ TAILQ_HEAD(ifaddrhead, ifaddr);	/* insta
 TAILQ_HEAD(ifmultihead, ifmultiaddr);
 TAILQ_HEAD(ifgrouphead, ifg_group);
 
-#ifdef _KERNEL
 VNET_DECLARE(struct pfil_head, link_pfil_hook);	/* packet filter hooks */
 #define	V_link_pfil_hook	VNET(link_pfil_hook)
-#endif /* _KERNEL */
 
 typedef	void (*iftype_attach_t)(if_t ifp, struct if_attach_args *args);
 typedef	void (*iftype_detach_t)(if_t ifp);
@@ -202,7 +203,6 @@ struct ifnet {
 #define	IF_ADDR_LOCK_ASSERT(ifp)	IF_LOCK_ASSERT(ifp)
 #define	IF_ADDR_WLOCK_ASSERT(ifp)	IF_WLOCK_ASSERT(ifp)
 
-#ifdef _KERNEL
 #ifdef _SYS_EVENTHANDLER_H_
 /* interface link layer address change event */
 typedef void (*iflladdr_event_handler_t)(void *, struct ifnet *);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504070617.t376HZLo025117>