svn commit: r185937 - in head/sys: net netinet netinet6

Bjoern A. Zeeb bz at FreeBSD.org
Thu Dec 11 08:26:39 PST 2008


Author: bz
Date: Thu Dec 11 16:26:38 2008
New Revision: 185937
URL: http://svn.freebsd.org/changeset/base/185937

Log:
  Put a global variables, which were virtualized but formerly
  missed under VIMAGE_GLOBAL.
  
  Start putting the extern declarations of the  virtualized globals
  under VIMAGE_GLOBAL as the globals themsevles are already.
  This will help by the time when we are going to remove the globals
  entirely.
  
  While there garbage collect a few dead externs from ip6_var.h.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/net/raw_cb.h
  head/sys/netinet/in_pcb.h
  head/sys/netinet/ip_fw2.c
  head/sys/netinet/ip_fw_nat.c
  head/sys/netinet/ip_fw_pfil.c
  head/sys/netinet/ip_var.h
  head/sys/netinet/tcp_var.h
  head/sys/netinet/udp_var.h
  head/sys/netinet6/in6_proto.c
  head/sys/netinet6/in6_var.h
  head/sys/netinet6/ip6_var.h
  head/sys/netinet6/nd6.h
  head/sys/netinet6/tcp6_var.h
  head/sys/netinet6/vinet6.h

Modified: head/sys/net/raw_cb.h
==============================================================================
--- head/sys/net/raw_cb.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/net/raw_cb.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -55,7 +55,9 @@ struct rawcb {
 #define	RAWRCVQ		8192
 
 #ifdef _KERNEL
+#ifdef VIMAGE_GLOBALS
 extern LIST_HEAD(rawcb_list_head, rawcb) rawcb_list;
+#endif
 extern struct mtx rawcb_mtx;
 
 /*

Modified: head/sys/netinet/in_pcb.h
==============================================================================
--- head/sys/netinet/in_pcb.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet/in_pcb.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -450,6 +450,7 @@ void 	inp_4tuple_get(struct inpcb *inp, 
 #define	INP_CHECK_SOCKAF(so, af)	(INP_SOCKAF(so) == af)
 
 #ifdef _KERNEL
+#ifdef VIMAGE_GLOBALS
 extern int	ipport_reservedhigh;
 extern int	ipport_reservedlow;
 extern int	ipport_lowfirstauto;
@@ -463,6 +464,7 @@ extern int	ipport_randomcps;
 extern int	ipport_randomtime;
 extern int	ipport_stoprandom;
 extern int	ipport_tcpallocs;
+#endif
 extern struct callout ipport_tick_callout;
 
 void	in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *);

Modified: head/sys/netinet/ip_fw2.c
==============================================================================
--- head/sys/netinet/ip_fw2.c	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet/ip_fw2.c	Thu Dec 11 16:26:38 2008	(r185937)
@@ -149,7 +149,9 @@ struct ip_fw_ugid {
 /*
  * list of rules for layer 3
  */
+#ifdef VIMAGE_GLOBALS
 struct ip_fw_chain layer3_chain;
+#endif
 
 MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's");
 MALLOC_DEFINE(M_IPFW_TBL, "ipfw_tbl", "IpFw tables");

Modified: head/sys/netinet/ip_fw_nat.c
==============================================================================
--- head/sys/netinet/ip_fw_nat.c	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet/ip_fw_nat.c	Thu Dec 11 16:26:38 2008	(r185937)
@@ -69,9 +69,8 @@ __FBSDID("$FreeBSD$");
 
 MALLOC_DECLARE(M_IPFW);
 
-extern struct ip_fw_chain layer3_chain;
-
 #ifdef VIMAGE_GLOBALS
+extern struct ip_fw_chain layer3_chain;
 static eventhandler_tag ifaddr_event_tag;
 #endif
 

Modified: head/sys/netinet/ip_fw_pfil.c
==============================================================================
--- head/sys/netinet/ip_fw_pfil.c	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet/ip_fw_pfil.c	Thu Dec 11 16:26:38 2008	(r185937)
@@ -68,10 +68,12 @@ __FBSDID("$FreeBSD$");
 
 #include <machine/in_cksum.h>
 
+#ifdef VIMAGE_GLOBALS
 int fw_enable = 1;
 #ifdef INET6
 int fw6_enable = 1;
 #endif
+#endif
 
 int ipfw_chg_hook(SYSCTL_HANDLER_ARGS);
 

Modified: head/sys/netinet/ip_var.h
==============================================================================
--- head/sys/netinet/ip_var.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet/ip_var.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -175,6 +175,7 @@ struct inpcb;
 struct route;
 struct sockopt;
 
+#ifdef VIMAGE_GLOBALS
 extern struct	ipstat	ipstat;
 extern u_short	ip_id;			/* ip packet ctr, for ids */
 extern int	ip_do_randomid;
@@ -183,12 +184,13 @@ extern int	ipforwarding;		/* ip forwardi
 #ifdef IPSTEALTH
 extern int	ipstealth;		/* stealth forwarding */
 #endif
-extern u_char	ip_protox[];
+extern int rsvp_on;
 extern struct socket *ip_rsvpd;		/* reservation protocol daemon */
 extern struct socket *ip_mrouter;	/* multicast routing daemon */
+#endif
+extern u_char	ip_protox[];
 extern int	(*legal_vif_num)(int);
 extern u_long	(*ip_mcast_src)(int);
-extern int rsvp_on;
 extern struct	pr_usrreqs rip_usrreqs;
 
 void	inp_freemoptions(struct ip_moptions *);

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet/tcp_var.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -513,10 +513,12 @@ SYSCTL_DECL(_net_inet_tcp_sack);
 MALLOC_DECLARE(M_TCPLOG);
 #endif
 
+extern	int tcp_log_in_vain;
+
+#ifdef VIMAGE_GLOBALS
 extern	struct inpcbhead tcb;		/* head of queue of active tcpcb's */
 extern	struct inpcbinfo tcbinfo;
 extern	struct tcpstat tcpstat;	/* tcp statistics */
-extern	int tcp_log_in_vain;
 extern	int tcp_mssdflt;	/* XXX */
 extern	int tcp_minmss;
 extern	int tcp_delack_enabled;
@@ -548,6 +550,7 @@ extern	int tcp_sack_globalholes;
 extern	int tcp_sc_rst_sock_fail;	/* RST on sock alloc failure */
 extern	int tcp_do_ecn;			/* TCP ECN enabled/disabled */
 extern	int tcp_ecn_maxretries;
+#endif /* VIMAGE_GLOBALS */
 
 int	 tcp_addoptions(struct tcpopt *, u_char *);
 struct tcpcb *

Modified: head/sys/netinet/udp_var.h
==============================================================================
--- head/sys/netinet/udp_var.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet/udp_var.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -94,12 +94,15 @@ struct udpstat {
 SYSCTL_DECL(_net_inet_udp);
 
 extern struct pr_usrreqs	udp_usrreqs;
+
+#ifdef VIMAGE_GLOBALS
 extern struct inpcbhead		udb;
 extern struct inpcbinfo		udbinfo;
-extern u_long			udp_sendspace;
-extern u_long			udp_recvspace;
 extern struct udpstat		udpstat;
 extern int			udp_blackhole;
+#endif
+extern u_long			udp_sendspace;
+extern u_long			udp_recvspace;
 extern int			udp_log_in_vain;
 
 void		 udp_ctlinput(int, struct sockaddr *, void *);

Modified: head/sys/netinet6/in6_proto.c
==============================================================================
--- head/sys/netinet6/in6_proto.c	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet6/in6_proto.c	Thu Dec 11 16:26:38 2008	(r185937)
@@ -390,9 +390,7 @@ int	ip6_keepfaith;
 time_t	ip6_log_time;
 int	ip6stealth;
 int	nd6_onlink_ns_rfc4861;
-#endif
 
-#ifdef VIMAGE_GLOBALS
 /* icmp6 */
 /*
  * BSDI4 defines these variables in in_proto.c...

Modified: head/sys/netinet6/in6_var.h
==============================================================================
--- head/sys/netinet6/in6_var.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet6/in6_var.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -470,9 +470,11 @@ struct	in6_rrenumreq {
 #endif
 
 #ifdef _KERNEL
+#ifdef VIMAGE_GLOBALS
 extern struct in6_ifaddr *in6_ifaddr;
 
 extern struct icmp6stat icmp6stat;
+#endif /* VIMAGE_GLOBALS */
 #define in6_ifstat_inc(ifp, tag) \
 do {								\
 	if (ifp)						\

Modified: head/sys/netinet6/ip6_var.h
==============================================================================
--- head/sys/netinet6/ip6_var.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet6/ip6_var.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -279,6 +279,7 @@ struct ip6aux {
 #define IP6_HDR_ALIGNED_P(ip)	((((intptr_t) (ip)) & 3) == 0)
 #endif
 
+#ifdef VIMAGE_GLOBALS
 extern struct	ip6stat ip6stat;	/* statistics */
 extern int	ip6_defhlim;		/* default hop limit */
 extern int	ip6_defmcasthlim;	/* default multicast hop limit */
@@ -290,8 +291,10 @@ extern int	ip6_rr_prune;		/* router renu
 					 * walk list every 5 sec.    */
 extern int	ip6_mcast_pmtu;		/* enable pMTU discovery for multicast? */
 extern int	ip6_v6only;
+#endif /* VIMAGE_GLOBALS */
 
 extern struct socket *ip6_mrouter;	/* multicast routing daemon */
+#ifdef VIMAGE_GLOBALS
 extern int	ip6_sendredirects;	/* send IP redirects when forwarding? */
 extern int	ip6_maxfragpackets; /* Maximum packets in reassembly queue */
 extern int	ip6_maxfrags;	/* Maximum fragments in reassembly queue */
@@ -304,17 +307,13 @@ extern time_t	ip6_log_time;
 extern int	ip6_hdrnestlimit; /* upper limit of # of extension headers */
 extern int	ip6_dad_count;		/* DupAddrDetectionTransmits */
 
-extern int ip6_auto_flowlabel;
-extern int ip6_auto_linklocal;
-
-extern int   ip6_anonportmin;		/* minimum ephemeral port */
-extern int   ip6_anonportmax;		/* maximum ephemeral port */
-extern int   ip6_lowportmin;		/* minimum reserved port */
-extern int   ip6_lowportmax;		/* maximum reserved port */
+extern int	ip6_auto_flowlabel;
+extern int	ip6_auto_linklocal;
 
 extern int	ip6_use_tempaddr; /* whether to use temporary addresses. */
 extern int	ip6_prefer_tempaddr; /* whether to prefer temporary addresses
 					in the source address selection */
+#endif /* VIMAGE_GLOBALS */
 
 extern int	ip6_use_defzone; /* whether to use the default scope zone
 				    when unspecified */

Modified: head/sys/netinet6/nd6.h
==============================================================================
--- head/sys/netinet6/nd6.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet6/nd6.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -328,6 +328,7 @@ struct nd_pfxrouter {
 LIST_HEAD(nd_prhead, nd_prefix);
 
 /* nd6.c */
+#ifdef VIMAGE_GLOBALS
 extern int nd6_prune;
 extern int nd6_delay;
 extern int nd6_umaxtries;
@@ -341,8 +342,6 @@ extern struct nd_prhead nd_prefix;
 extern int nd6_debug;
 extern int nd6_onlink_ns_rfc4861;
 
-#define nd6log(x)	do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0)
-
 extern struct callout nd6_timer_ch;
 
 /* nd6_rtr.c */
@@ -351,6 +350,9 @@ extern int ip6_desync_factor;	/* seconds
 extern u_int32_t ip6_temp_preferred_lifetime; /* seconds */
 extern u_int32_t ip6_temp_valid_lifetime; /* seconds */
 extern int ip6_temp_regen_advance; /* seconds */
+#endif /* VIMAGE_GLOBALS */
+
+#define nd6log(x)	do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0)
 
 union nd_opts {
 	struct nd_opt_hdr *nd_opt_array[8];	/* max = target address list */

Modified: head/sys/netinet6/tcp6_var.h
==============================================================================
--- head/sys/netinet6/tcp6_var.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet6/tcp6_var.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -67,7 +67,9 @@
 SYSCTL_DECL(_net_inet6_tcp6);
 #endif
 
+#ifdef VIMAGE_GLOBALS
 extern	int tcp_v6mssdflt;	/* XXX */
+#endif
 
 struct	ip6_hdr;
 void	tcp6_ctlinput __P((int, struct sockaddr *, void *));

Modified: head/sys/netinet6/vinet6.h
==============================================================================
--- head/sys/netinet6/vinet6.h	Thu Dec 11 16:13:17 2008	(r185936)
+++ head/sys/netinet6/vinet6.h	Thu Dec 11 16:26:38 2008	(r185937)
@@ -77,6 +77,7 @@ struct vnet_inet6 {
 
 	int				_nd6_inuse;
 	int				_nd6_allocated;
+	int				_nd6_onlink_ns_rfc4861;
 	struct llinfo_nd6		_llinfo_nd6;
 	struct nd_drhead		_nd_defrouter;
 	struct nd_prhead 		_nd_prefix;
@@ -109,7 +110,6 @@ struct vnet_inet6 {
 	int				_ip6_keepfaith;
 	int				_ip6stealth;
 	time_t				_ip6_log_time;
-	int				_nd6_onlink_ns_rfc4861;
 
 	int				_pmtu_expire;
 	int				_pmtu_probe;


More information about the svn-src-all mailing list