svn commit: r193926 - in head/sys: kern net

Bjoern A. Zeeb bz at FreeBSD.org
Wed Jun 10 14:37:00 UTC 2009


Author: bz
Date: Wed Jun 10 14:36:59 2009
New Revision: 193926
URL: http://svn.freebsd.org/changeset/base/193926

Log:
  SCTP needs either IPv4 or IPv6 as lower layer[1].
  So properly hide the already #ifdef SCTP code with
  #if defined(INET) || defined(INET6) as well to get us
  closer to a non-INET/INET6 kernel.
  
  Discussed with:	tuexen [1]

Modified:
  head/sys/kern/uipc_syscalls.c
  head/sys/net/rtsock.c

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Wed Jun 10 14:34:56 2009	(r193925)
+++ head/sys/kern/uipc_syscalls.c	Wed Jun 10 14:36:59 2009	(r193926)
@@ -35,6 +35,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "opt_inet.h"
+#include "opt_inet6.h"
 #include "opt_sctp.h"
 #include "opt_compat.h"
 #include "opt_ktrace.h"
@@ -77,10 +79,12 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_kern.h>
 #include <vm/vm_extern.h>
 
+#if defined(INET) || defined(INET6)
 #ifdef SCTP
 #include <netinet/sctp.h>
 #include <netinet/sctp_peeloff.h>
 #endif /* SCTP */
+#endif /* INET || INET6 */
 
 static int sendit(struct thread *td, int s, struct msghdr *mp, int flags);
 static int recvit(struct thread *td, int s, struct msghdr *mp, void *namelenp);
@@ -2269,7 +2273,7 @@ sctp_peeloff(td, uap)
 		caddr_t	name;
 	} */ *uap;
 {
-#ifdef SCTP
+#if (defined(INET) || defined(INET6)) && defined(SCTP)
 	struct filedesc *fdp;
 	struct file *nfp = NULL;
 	int error;
@@ -2358,7 +2362,7 @@ sctp_generic_sendmsg (td, uap)
 		int flags
 	} */ *uap;
 {
-#ifdef SCTP
+#if (defined(INET) || defined(INET6)) && defined(SCTP)
 	struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL;
 	struct socket *so;
 	struct file *fp = NULL;
@@ -2459,7 +2463,7 @@ sctp_generic_sendmsg_iov(td, uap)
 		int flags
 	} */ *uap;
 {
-#ifdef SCTP
+#if (defined(INET) || defined(INET6)) && defined(SCTP)
 	struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL;
 	struct socket *so;
 	struct file *fp = NULL;
@@ -2570,7 +2574,7 @@ sctp_generic_recvmsg(td, uap)
 		int *msg_flags
 	} */ *uap;
 {
-#ifdef SCTP
+#if (defined(INET) || defined(INET6)) && defined(SCTP)
 	u_int8_t sockbufstore[256];
 	struct uio auio;
 	struct iovec *iov, *tiov;

Modified: head/sys/net/rtsock.c
==============================================================================
--- head/sys/net/rtsock.c	Wed Jun 10 14:34:56 2009	(r193925)
+++ head/sys/net/rtsock.c	Wed Jun 10 14:36:59 2009	(r193926)
@@ -65,9 +65,11 @@
 #include <netinet6/scope6_var.h>
 #endif
 
+#if defined(INET) || defined(INET6)
 #ifdef SCTP
 extern void sctp_addr_change(struct ifaddr *ifa, int cmd);
 #endif /* SCTP */
+#endif
 
 MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables");
 
@@ -1063,6 +1065,7 @@ rt_newaddrmsg(int cmd, struct ifaddr *if
 
 	KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE,
 		("unexpected cmd %u", cmd));
+#if defined(INET) || defined(INET6)
 #ifdef SCTP
 	/*
 	 * notify the SCTP stack
@@ -1071,6 +1074,7 @@ rt_newaddrmsg(int cmd, struct ifaddr *if
 	 */
 	sctp_addr_change(ifa, cmd);
 #endif /* SCTP */
+#endif
 	if (route_cb.any_count == 0)
 		return;
 	for (pass = 1; pass < 3; pass++) {


More information about the svn-src-all mailing list