From owner-svn-src-head@FreeBSD.ORG Wed Apr 27 19:34:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA29106564A; Wed, 27 Apr 2011 19:34:01 +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 C33F58FC13; Wed, 27 Apr 2011 19:34:01 +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 p3RJY1Bn086058; Wed, 27 Apr 2011 19:34:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RJY1Fq086054; Wed, 27 Apr 2011 19:34:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201104271934.p3RJY1Fq086054@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 27 Apr 2011 19:34:01 +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: r221132 - head/sys/contrib/pf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 27 Apr 2011 19:34:02 -0000 Author: bz Date: Wed Apr 27 19:34:01 2011 New Revision: 221132 URL: http://svn.freebsd.org/changeset/base/221132 Log: Make pf 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/contrib/pf/net/if_pflog.c head/sys/contrib/pf/net/pf.c head/sys/contrib/pf/net/pf_ioctl.c Modified: head/sys/contrib/pf/net/if_pflog.c ============================================================================== --- head/sys/contrib/pf/net/if_pflog.c Wed Apr 27 19:32:27 2011 (r221131) +++ head/sys/contrib/pf/net/if_pflog.c Wed Apr 27 19:34:01 2011 (r221132) @@ -82,17 +82,17 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef INET +#if defined(INET) || defined(INET6) #include +#endif +#ifdef INET #include #include #include #endif #ifdef INET6 -#ifndef INET -#include -#endif +#include #include #endif /* INET6 */ Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Wed Apr 27 19:32:27 2011 (r221131) +++ head/sys/contrib/pf/net/pf.c Wed Apr 27 19:34:01 2011 (r221132) @@ -2039,8 +2039,10 @@ pf_send_icmp(struct mbuf *m, u_int8_t ty struct pf_mtag *pf_mtag; struct mbuf *m0; #ifdef __FreeBSD__ +#ifdef INET struct ip *ip; #endif +#endif #ifdef __FreeBSD__ m0 = m_copypacket(m, M_DONTWAIT); Modified: head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- head/sys/contrib/pf/net/pf_ioctl.c Wed Apr 27 19:32:27 2011 (r221131) +++ head/sys/contrib/pf/net/pf_ioctl.c Wed Apr 27 19:34:01 2011 (r221132) @@ -216,10 +216,12 @@ static void pf_clear_srcnodes(void); /* * Wrapper functions for pfil(9) hooks */ +#ifdef INET static int pf_check_in(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, struct inpcb *inp); static int pf_check_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, struct inpcb *inp); +#endif #ifdef INET6 static int pf_check6_in(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, struct inpcb *inp); @@ -3622,6 +3624,7 @@ shutdown_pf(void) return (error); } +#ifdef INET static int pf_check_in(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, struct inpcb *inp) @@ -3696,6 +3699,7 @@ pf_check_out(void *arg, struct mbuf **m, } return chk; } +#endif #ifdef INET6 static int @@ -3761,15 +3765,19 @@ hook_pf(void) pfh_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); if (pfh_inet == NULL) return (ESRCH); /* XXX */ +#ifdef INET pfil_add_hook(pf_check_in, NULL, PFIL_IN | PFIL_WAITOK, pfh_inet); pfil_add_hook(pf_check_out, NULL, PFIL_OUT | PFIL_WAITOK, pfh_inet); +#endif #ifdef INET6 pfh_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); if (pfh_inet6 == NULL) { +#ifdef INET pfil_remove_hook(pf_check_in, NULL, PFIL_IN | PFIL_WAITOK, pfh_inet); pfil_remove_hook(pf_check_out, NULL, PFIL_OUT | PFIL_WAITOK, pfh_inet); +#endif return (ESRCH); /* XXX */ } pfil_add_hook(pf_check6_in, NULL, PFIL_IN | PFIL_WAITOK, pfh_inet6); @@ -3796,10 +3804,12 @@ dehook_pf(void) pfh_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); if (pfh_inet == NULL) return (ESRCH); /* XXX */ +#ifdef INET pfil_remove_hook(pf_check_in, NULL, PFIL_IN | PFIL_WAITOK, pfh_inet); pfil_remove_hook(pf_check_out, NULL, PFIL_OUT | PFIL_WAITOK, pfh_inet); +#endif #ifdef INET6 pfh_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); if (pfh_inet6 == NULL)