Date: Wed, 27 Apr 2011 19:34:01 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r221132 - head/sys/contrib/pf/net Message-ID: <201104271934.p3RJY1Fq086054@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <net/route.h> #include <net/bpf.h> -#ifdef INET +#if defined(INET) || defined(INET6) #include <netinet/in.h> +#endif +#ifdef INET #include <netinet/in_var.h> #include <netinet/in_systm.h> #include <netinet/ip.h> #endif #ifdef INET6 -#ifndef INET -#include <netinet/in.h> -#endif +#include <netinet6/in6_var.h> #include <netinet6/nd6.h> #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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104271934.p3RJY1Fq086054>