Skip to content

Commit

Permalink
For all files including net/vnet.h directly include opt_route.h and
Browse files Browse the repository at this point in the history
net/route.h.

Remove the hidden include of opt_route.h and net/route.h from net/vnet.h.

We need to make sure that both opt_route.h and net/route.h are included
before net/vnet.h because of the way MRT figures out the number of FIBs
from the kernel option. If we do not, we end up with the default number
of 1 when including net/vnet.h and array sizes are wrong.

This does not change the list of files which depend on opt_route.h
but we can identify them now more easily.
  • Loading branch information
bz authored and bz committed Feb 27, 2009
1 parent 5e1ae49 commit df2be82
Show file tree
Hide file tree
Showing 49 changed files with 83 additions and 8 deletions.
2 changes: 2 additions & 0 deletions sys/compat/linprocfs/linprocfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
*/

#include "opt_route.h"
#include "opt_compat.h"

#include <sys/cdefs.h>
Expand Down Expand Up @@ -76,6 +77,7 @@ __FBSDID("$FreeBSD$");
#include <sys/vimage.h>

#include <net/if.h>
#include <net/route.h>
#include <net/vnet.h>

#include <vm/vm.h>
Expand Down
2 changes: 2 additions & 0 deletions sys/compat/linux/linux_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "opt_route.h"
#include "opt_compat.h"

#include <sys/cdefs.h>
Expand Down Expand Up @@ -63,6 +64,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/route.h>
#include <net/vnet.h>

#ifdef COMPAT_LINUX32
Expand Down
3 changes: 3 additions & 0 deletions sys/compat/svr4/svr4_sockio.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include "opt_route.h"

#include <sys/param.h>
#include <sys/proc.h>
#include <sys/systm.h>
Expand All @@ -39,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/vimage.h>

#include <net/if.h>
#include <net/route.h>
#include <net/vnet.h>

#include <compat/svr4/svr4.h>
Expand Down
4 changes: 4 additions & 0 deletions sys/contrib/altq/altq/altq_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "opt_inet.h"
#ifdef __FreeBSD__
#include "opt_inet6.h"
#include "opt_route.h"
#endif
#endif /* __FreeBSD__ || __NetBSD__ */

Expand All @@ -54,7 +55,10 @@
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#ifdef __FreeBSD__
#include <net/route.h>
#include <net/vnet.h>
#endif

#include <netinet/in.h>
#include <netinet/in_systm.h>
Expand Down
2 changes: 2 additions & 0 deletions sys/contrib/pf/net/pf_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#if defined(__FreeBSD__)
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_route.h"

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
Expand All @@ -61,6 +62,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_types.h>
#ifdef __FreeBSD__
#include <net/route.h>
#include <net/vnet.h>
#endif

Expand Down
8 changes: 3 additions & 5 deletions sys/contrib/pf/net/pf_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@
*/

#ifdef __FreeBSD__
#include "opt_inet.h"
#include "opt_inet6.h"

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#endif

#ifdef __FreeBSD__
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_route.h"
#include "opt_bpf.h"
#include "opt_pf.h"

Expand Down
3 changes: 3 additions & 0 deletions sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
Expand Down Expand Up @@ -63,6 +65,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_var.h>
#if __FreeBSD_version >= 800056
#include <net/route.h>
#include <net/vnet.h>
#endif

Expand Down
2 changes: 2 additions & 0 deletions sys/kern/kern_poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include "opt_route.h"
#include "opt_device_polling.h"

#include <sys/param.h>
Expand All @@ -44,6 +45,7 @@ __FBSDID("$FreeBSD$");

#include <net/if.h> /* for IFF_* flags */
#include <net/netisr.h> /* for NETISR_POLL */
#include <net/route.h>
#include <net/vnet.h>

static void netisr_poll(void); /* the two netisr handlers */
Expand Down
3 changes: 3 additions & 0 deletions sys/kern/kern_uuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include "opt_route.h"

#include <sys/param.h>
#include <sys/endian.h>
#include <sys/kernel.h>
Expand All @@ -42,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/route.h>
#include <net/vnet.h>

/*
Expand Down
3 changes: 3 additions & 0 deletions sys/net/bridgestp.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
Expand All @@ -56,6 +58,7 @@ __FBSDID("$FreeBSD$");
#include <net/if_types.h>
#include <net/if_llc.h>
#include <net/if_media.h>
#include <net/route.h>
#include <net/vnet.h>

#include <netinet/in.h>
Expand Down
1 change: 1 addition & 0 deletions sys/net/if.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "opt_compat.h"
#include "opt_inet6.h"
#include "opt_inet.h"
#include "opt_route.h"
#include "opt_mac.h"
#include "opt_carp.h"

Expand Down
1 change: 1 addition & 0 deletions sys/net/if_ef.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "opt_inet.h"
#include "opt_ipx.h"
#include "opt_ef.h"
#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
Expand Down
1 change: 1 addition & 0 deletions sys/net/if_ethersubr.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipx.h"
#include "opt_route.h"
#include "opt_mac.h"
#include "opt_netgraph.h"
#include "opt_carp.h"
Expand Down
1 change: 1 addition & 0 deletions sys/net/if_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipx.h"
#include "opt_route.h"
#include "opt_mac.h"

#include <sys/param.h>
Expand Down
3 changes: 3 additions & 0 deletions sys/net/if_mib.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* $FreeBSD$
*/

#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
Expand All @@ -38,6 +40,7 @@

#include <net/if.h>
#include <net/if_mib.h>
#include <net/route.h>
#include <net/vnet.h>

/*
Expand Down
2 changes: 2 additions & 0 deletions sys/net/if_vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* and ask it to send them.
*/

#include "opt_route.h"
#include "opt_vlan.h"

#include <sys/param.h>
Expand All @@ -64,6 +65,7 @@
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/if_vlan_var.h>
#include <net/route.h>
#include <net/vnet.h>

#define VLANNAME "vlan"
Expand Down
3 changes: 3 additions & 0 deletions sys/net/raw_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
* $FreeBSD$
*/

#include "opt_route.h"

#include <sys/param.h>
#include <sys/domain.h>
#include <sys/lock.h>
Expand All @@ -46,6 +48,7 @@

#include <net/if.h>
#include <net/raw_cb.h>
#include <net/route.h>
#include <net/vnet.h>

/*
Expand Down
3 changes: 3 additions & 0 deletions sys/net/raw_usrreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
* $FreeBSD$
*/

#include "opt_route.h"

#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/lock.h>
Expand All @@ -48,6 +50,7 @@

#include <net/if.h>
#include <net/raw_cb.h>
#include <net/route.h>
#include <net/vnet.h>

MTX_SYSINIT(rawcb_mtx, &rawcb_mtx, "rawcb", MTX_DEF);
Expand Down
3 changes: 0 additions & 3 deletions sys/net/vnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@
#ifndef _NET_VNET_H_
#define _NET_VNET_H_

#include "opt_route.h"

#include <net/if_var.h>
#include <net/route.h>

struct vnet_net {
int _if_index;
Expand Down
2 changes: 2 additions & 0 deletions sys/net80211/ieee80211_ddb.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
__FBSDID("$FreeBSD$");

#include "opt_ddb.h"
#include "opt_route.h"
#include "opt_wlan.h"

#ifdef DDB
Expand All @@ -44,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <net/if_media.h>
#include <net/if_types.h>
#include <net/ethernet.h>
#include <net/route.h>
#include <net/vnet.h>

#include <net80211/ieee80211_var.h>
Expand Down
3 changes: 3 additions & 0 deletions sys/netgraph/atm/ng_atm.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
Expand All @@ -54,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include <net/if_var.h>
#include <net/if_media.h>
#include <net/if_atm.h>
#include <net/route.h>
#include <net/vnet.h>

#include <netgraph/ng_message.h>
Expand Down
3 changes: 3 additions & 0 deletions sys/netgraph/ng_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
* ng_ether(4) netgraph node type
*/

#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
Expand All @@ -63,6 +65,7 @@
#include <net/if_var.h>
#include <net/ethernet.h>
#include <net/if_bridgevar.h>
#include <net/route.h>
#include <net/vnet.h>

#include <netgraph/ng_message.h>
Expand Down
1 change: 1 addition & 0 deletions sys/netgraph/ng_gif.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
/*
* ng_gif(4) netgraph node type
*/
#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
Expand Down
1 change: 1 addition & 0 deletions sys/netinet/if_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
__FBSDID("$FreeBSD$");

#include "opt_inet.h"
#include "opt_route.h"
#include "opt_mac.h"
#include "opt_carp.h"

Expand Down
1 change: 1 addition & 0 deletions sys/netinet/igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
__FBSDID("$FreeBSD$");

#include "opt_mac.h"
#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
Expand Down
2 changes: 2 additions & 0 deletions sys/netinet/in_mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
Expand Down
1 change: 1 addition & 0 deletions sys/netinet/in_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include "opt_mrouting.h"
#include "opt_ipsec.h"
#include "opt_inet6.h"
#include "opt_route.h"
#include "opt_pf.h"
#include "opt_carp.h"
#include "opt_sctp.h"
Expand Down
2 changes: 2 additions & 0 deletions sys/netinet/in_rmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
Expand Down
1 change: 1 addition & 0 deletions sys/netinet/ip_fw2.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include "opt_inet6.h"
#include "opt_ipsec.h"
#include "opt_mac.h"
#include "opt_route.h"

#include <sys/param.h>
#include <sys/systm.h>
Expand Down
1 change: 1 addition & 0 deletions sys/netinet/ip_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include "opt_ipfw.h"
#include "opt_ipstealth.h"
#include "opt_ipsec.h"
#include "opt_route.h"
#include "opt_mac.h"
#include "opt_carp.h"

Expand Down
Loading

0 comments on commit df2be82

Please sign in to comment.