From owner-svn-src-all@FreeBSD.ORG Sat Apr 30 11:04:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41037106564A; Sat, 30 Apr 2011 11:04:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 305058FC0C; Sat, 30 Apr 2011 11:04:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UB4ZgJ042833; Sat, 30 Apr 2011 11:04:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UB4ZuC042830; Sat, 30 Apr 2011 11:04:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201104301104.p3UB4ZuC042830@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 30 Apr 2011 11:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221247 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2011 11:04:35 -0000 Author: bz Date: Sat Apr 30 11:04:34 2011 New Revision: 221247 URL: http://svn.freebsd.org/changeset/base/221247 Log: Make the PCB code compile without INET support by adding #ifdef INETs and correcting few #includes. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 4 days Modified: head/sys/netinet/in_pcb.c head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sat Apr 30 10:59:55 2011 (r221246) +++ head/sys/netinet/in_pcb.c Sat Apr 30 11:04:34 2011 (r221247) @@ -65,17 +65,22 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(INET) || defined(INET6) #include #include -#include #include #include #include #include +#endif +#ifdef INET +#include +#endif #ifdef INET6 #include -#include #include +#include +#include #endif /* INET6 */ @@ -117,12 +122,13 @@ static VNET_DEFINE(int, ipport_tcplastco #define V_ipport_tcplastcount VNET(ipport_tcplastcount) +static void in_pcbremlists(struct inpcb *inp); + +#ifdef INET #define RANGECHK(var, min, max) \ if ((var) < (min)) { (var) = (min); } \ else if ((var) > (max)) { (var) = (max); } -static void in_pcbremlists(struct inpcb *inp); - static int sysctl_net_ipport_check(SYSCTL_HANDLER_ARGS) { @@ -179,6 +185,7 @@ SYSCTL_VNET_INT(_net_inet_ip_portrange, &VNET_NAME(ipport_randomtime), 0, "Minimum time to keep sequental port " "allocation before switching to a random one"); +#endif /* * in_pcb.c: manage the Protocol Control Blocks. @@ -291,6 +298,7 @@ out: return (error); } +#ifdef INET int in_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) { @@ -316,6 +324,7 @@ in_pcbbind(struct inpcb *inp, struct soc inp->inp_flags |= INP_ANONPORT; return (0); } +#endif #if defined(INET) || defined(INET6) int @@ -396,6 +405,7 @@ in_pcb_lport(struct inpcb *inp, struct i laddr = *laddrp; } #endif + tmpinp = NULL; /* Make compiler happy. */ lport = *lportp; if (dorandom) @@ -435,6 +445,7 @@ in_pcb_lport(struct inpcb *inp, struct i } #endif /* INET || INET6 */ +#ifdef INET /* * Set up a bind operation on a PCB, performing port allocation * as required, but do not actually modify the PCB. Callers can @@ -998,6 +1009,7 @@ in_pcbdisconnect(struct inpcb *inp) inp->inp_fport = 0; in_pcbrehash(inp); } +#endif /* * in_pcbdetach() is responsibe for disassociating a socket from an inpcb. @@ -1046,8 +1058,10 @@ in_pcbfree_internal(struct inpcb *inp) #endif if (inp->inp_options) (void)m_free(inp->inp_options); +#ifdef INET if (inp->inp_moptions != NULL) inp_freemoptions(inp->inp_moptions); +#endif inp->inp_vflag = 0; crfree(inp->inp_cred); @@ -1164,6 +1178,7 @@ in_pcbdrop(struct inpcb *inp) } } +#ifdef INET /* * Common routines to return the socket addresses associated with inpcbs. */ @@ -1527,6 +1542,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbi return (NULL); } +#endif /* INET */ /* * Insert PCB onto various hash lists. Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sat Apr 30 10:59:55 2011 (r221246) +++ head/sys/netinet6/in6_pcb.c Sat Apr 30 11:04:34 2011 (r221247) @@ -204,6 +204,7 @@ in6_pcbbind(register struct inpcb *inp, == 0) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); +#ifdef INET if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 && IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct sockaddr_in sin; @@ -222,6 +223,7 @@ in6_pcbbind(register struct inpcb *inp, t->inp_cred->cr_uid)) return (EADDRINUSE); } +#endif } t = in6_pcblookup_local(pcbinfo, &sin6->sin6_addr, lport, wild, cred); @@ -229,6 +231,7 @@ in6_pcbbind(register struct inpcb *inp, intotw(t)->tw_so_options : t->inp_socket->so_options)) == 0) return (EADDRINUSE); +#ifdef INET if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 && IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct sockaddr_in sin; @@ -252,6 +255,7 @@ in6_pcbbind(register struct inpcb *inp, INP_SOCKAF(t->inp_socket))) return (EADDRINUSE); } +#endif } inp->in6p_laddr = sin6->sin6_addr; } @@ -496,11 +500,14 @@ in6_mapped_sockaddr(struct socket *so, s inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_mapped_sockaddr: inp == NULL")); +#ifdef INET if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_getsockaddr(so, nam); if (error == 0) in6_sin_2_v4mapsin6_in_sock(nam); - } else { + } else +#endif + { /* scope issues will be handled in in6_getsockaddr(). */ error = in6_getsockaddr(so, nam); } @@ -517,11 +524,13 @@ in6_mapped_peeraddr(struct socket *so, s inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_mapped_peeraddr: inp == NULL")); +#ifdef INET if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_getpeeraddr(so, nam); if (error == 0) in6_sin_2_v4mapsin6_in_sock(nam); } else +#endif /* scope issues will be handled in in6_getpeeraddr(). */ error = in6_getpeeraddr(so, nam);