svn commit: r220880 - head/sys/netinet

Bjoern A. Zeeb bz at FreeBSD.org
Wed Apr 20 08:03:22 UTC 2011


Author: bz
Date: Wed Apr 20 08:03:22 2011
New Revision: 220880
URL: http://svn.freebsd.org/changeset/base/220880

Log:
  MFp4 CH=191760:
  
  When compiling out INET we still need the initialization routines
  as well as the tuning and montoring sysctls shared with IPv6.
  
  Move the two send/recvspace variables up from the middle of the
  file to ease compiling out the INET only code.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	3 days

Modified:
  head/sys/netinet/raw_ip.c

Modified: head/sys/netinet/raw_ip.c
==============================================================================
--- head/sys/netinet/raw_ip.c	Wed Apr 20 08:00:29 2011	(r220879)
+++ head/sys/netinet/raw_ip.c	Wed Apr 20 08:03:22 2011	(r220880)
@@ -33,6 +33,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "opt_inet.h"
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
 
@@ -93,6 +94,7 @@ void	(*ip_divert_ptr)(struct mbuf *, int
 int	(*ng_ipfw_input_p)(struct mbuf **, int,
 			struct ip_fw_args *, int);
 
+#ifdef INET
 /*
  * Hooks for multicast routing. They all default to NULL, so leave them not
  * initialized and rely on BSS being set to 0.
@@ -118,6 +120,15 @@ u_long (*ip_mcast_src)(int);
 void (*rsvp_input_p)(struct mbuf *m, int off);
 int (*ip_rsvp_vif)(struct socket *, struct sockopt *);
 void (*ip_rsvp_force_done)(struct socket *);
+#endif /* INET */
+
+u_long	rip_sendspace = 9216;
+SYSCTL_ULONG(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW,
+    &rip_sendspace, 0, "Maximum outgoing raw IP datagram size");
+
+u_long	rip_recvspace = 9216;
+SYSCTL_ULONG(_net_inet_raw, OID_AUTO, recvspace, CTLFLAG_RW,
+    &rip_recvspace, 0, "Maximum space for incoming raw IP datagrams");
 
 /*
  * Hash functions
@@ -127,6 +138,7 @@ void (*ip_rsvp_force_done)(struct socket
 #define INP_PCBHASH_RAW(proto, laddr, faddr, mask) \
         (((proto) + (laddr) + (faddr)) % (mask) + 1)
 
+#ifdef INET
 static void
 rip_inshash(struct inpcb *inp)
 {
@@ -157,6 +169,7 @@ rip_delhash(struct inpcb *inp)
 
 	LIST_REMOVE(inp, inp_hash);
 }
+#endif /* INET */
 
 /*
  * Raw interface to IP protocol.
@@ -200,6 +213,7 @@ rip_destroy(void)
 }
 #endif
 
+#ifdef INET
 static int
 rip_append(struct inpcb *last, struct ip *ip, struct mbuf *n,
     struct sockaddr_in *ripsrc)
@@ -748,14 +762,6 @@ rip_ctlinput(int cmd, struct sockaddr *s
 	}
 }
 
-u_long	rip_sendspace = 9216;
-u_long	rip_recvspace = 9216;
-
-SYSCTL_ULONG(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW,
-    &rip_sendspace, 0, "Maximum outgoing raw IP datagram size");
-SYSCTL_ULONG(_net_inet_raw, OID_AUTO, recvspace, CTLFLAG_RW,
-    &rip_recvspace, 0, "Maximum space for incoming raw IP datagrams");
-
 static int
 rip_attach(struct socket *so, int proto, struct thread *td)
 {
@@ -980,6 +986,7 @@ rip_send(struct socket *so, int flags, s
 	}
 	return (rip_output(m, so, dst));
 }
+#endif /* INET */
 
 static int
 rip_pcblist(SYSCTL_HANDLER_ARGS)
@@ -1086,6 +1093,7 @@ SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX
     CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0,
     rip_pcblist, "S,xinpcb", "List of active raw IP sockets");
 
+#ifdef INET
 struct pr_usrreqs rip_usrreqs = {
 	.pru_abort =		rip_abort,
 	.pru_attach =		rip_attach,
@@ -1101,3 +1109,4 @@ struct pr_usrreqs rip_usrreqs = {
 	.pru_sosetlabel =	in_pcbsosetlabel,
 	.pru_close =		rip_close,
 };
+#endif /* INET */


More information about the svn-src-head mailing list