From owner-svn-src-head@FreeBSD.ORG Fri Nov 22 05:01:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76314FCB; Fri, 22 Nov 2013 05:01:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C915280D; Fri, 22 Nov 2013 05:01:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAM51dEk022241; Fri, 22 Nov 2013 05:01:39 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAM51dTb022240; Fri, 22 Nov 2013 05:01:39 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311220501.rAM51dTb022240@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 22 Nov 2013 05:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258466 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Nov 2013 05:01:39 -0000 Author: luigi Date: Fri Nov 22 05:01:38 2013 New Revision: 258466 URL: http://svnweb.freebsd.org/changeset/base/258466 Log: disable some ipfw match options when compiling in userspace Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 22 05:00:18 2013 (r258465) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 22 05:01:38 2013 (r258466) @@ -370,7 +370,7 @@ iface_match(struct ifnet *ifp, ipfw_insn return(1); } } else { -#ifdef __FreeBSD__ /* and OSX too ? */ +#if !defined(USERSPACE) && defined(__FreeBSD__) /* and OSX too ? */ struct ifaddr *ia; if_addr_rlock(ifp); @@ -413,7 +413,7 @@ iface_match(struct ifnet *ifp, ipfw_insn static int verify_path(struct in_addr src, struct ifnet *ifp, u_int fib) { -#ifndef __FreeBSD__ +#if defined(USERSPACE) || !defined(__FreeBSD__) return 0; #else struct route ro; @@ -664,6 +664,9 @@ static int check_uidgid(ipfw_insn_u32 *insn, struct ip_fw_args *args, int *ugid_lookupp, struct ucred **uc) { +#if defined(USERSPACE) + return 0; // not supported in userspace +#else #ifndef __FreeBSD__ /* XXX */ return cred_check(insn, proto, oif, @@ -766,6 +769,7 @@ check_uidgid(ipfw_insn_u32 *insn, struct match = ((*uc)->cr_prison->pr_id == (int)insn->d[0]); return (match); #endif /* __FreeBSD__ */ +#endif /* not supported in userspace */ } /* @@ -1464,6 +1468,7 @@ do { \ key = htonl(dst_port); else if (v == 3) key = htonl(src_port); +#ifndef USERSPACE else if (v == 4 || v == 5) { check_uidgid( (ipfw_insn_u32 *)cmd, @@ -1483,6 +1488,7 @@ do { \ #endif /* !__FreeBSD__ */ key = htonl(key); } else +#endif /* !USERSPACE */ break; } match = ipfw_lookup_table(chain, @@ -1946,6 +1952,7 @@ do { \ break; case O_SOCKARG: { +#ifndef USERSPACE /* not supported in userspace */ struct inpcb *inp = args->inp; struct inpcbinfo *pi; @@ -1986,6 +1993,7 @@ do { \ match = 1; } } +#endif /* !USERSPACE */ break; }