From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 22:33:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC396901; Tue, 17 Feb 2015 22:33:23 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7191EED; Tue, 17 Feb 2015 22:33:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1HMXNU1081109; Tue, 17 Feb 2015 22:33:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1HMXNru081108; Tue, 17 Feb 2015 22:33:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201502172233.t1HMXNru081108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 Feb 2015 22:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278925 - head/sys/netpfil/pf 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.18-1 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: Tue, 17 Feb 2015 22:33:24 -0000 Author: glebius Date: Tue Feb 17 22:33:22 2015 New Revision: 278925 URL: https://svnweb.freebsd.org/changeset/base/278925 Log: Even more fixes to !INET and !INET6 kernels. In collaboration with: pluknet Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Tue Feb 17 21:59:15 2015 (r278924) +++ head/sys/netpfil/pf/pf_norm.c Tue Feb 17 22:33:22 2015 (r278925) @@ -134,25 +134,23 @@ static int pf_frag_compare(struct pf_f static RB_PROTOTYPE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare); static RB_GENERATE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare); +static void pf_flush_fragments(void); static void pf_free_fragment(struct pf_fragment *); static void pf_remove_fragment(struct pf_fragment *); static int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *, struct tcphdr *, int, sa_family_t); -struct pf_frent *pf_create_fragment(u_short *); -static struct pf_fragment * - pf_find_fragment(struct pf_fragment_cmp *key, +static struct pf_frent *pf_create_fragment(u_short *); +static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree); -static struct pf_fragment * - pf_fillup_fragment(struct pf_fragment_cmp *, struct pf_frent *, u_short *); +static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, + struct pf_frent *, u_short *); static int pf_isfull_fragment(struct pf_fragment *); -struct mbuf *pf_join_fragment(struct pf_fragment *); +static struct mbuf *pf_join_fragment(struct pf_fragment *); #ifdef INET static void pf_scrub_ip(struct mbuf **, uint32_t, uint8_t, uint8_t); -static void pf_flush_fragments(void); static int pf_reassemble(struct mbuf **, struct ip *, int, u_short *); -static struct mbuf * - pf_fragcache(struct mbuf **, struct ip*, struct pf_fragment **, - int, int, int *); +static struct mbuf *pf_fragcache(struct mbuf **, struct ip*, + struct pf_fragment **, int, int, int *); #endif /* INET */ #ifdef INET6 static int pf_reassemble6(struct mbuf **, struct ip6_hdr *, @@ -267,7 +265,6 @@ pf_purge_expired_fragments(void) PF_FRAG_UNLOCK(); } -#ifdef INET /* * Try to flush old fragments to make space for new ones */ @@ -292,7 +289,6 @@ pf_flush_fragments(void) break; } } -#endif /* INET */ /* Frees the fragments and all associated entries */ static void @@ -329,7 +325,6 @@ pf_free_fragment(struct pf_fragment *fra pf_remove_fragment(frag); } -#ifdef INET static struct pf_fragment * pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree) { @@ -352,10 +347,8 @@ pf_find_fragment(struct pf_fragment_cmp return (frag); } -#endif /* INET */ /* Removes a fragment from the fragment queue and frees the fragment */ - static void pf_remove_fragment(struct pf_fragment *frag) { @@ -373,7 +366,7 @@ pf_remove_fragment(struct pf_fragment *f } } -struct pf_frent * +static struct pf_frent * pf_create_fragment(u_short *reason) { struct pf_frent *frent; @@ -570,7 +563,7 @@ pf_isfull_fragment(struct pf_fragment *f return (1); } -struct mbuf * +static struct mbuf * pf_join_fragment(struct pf_fragment *frag) { struct mbuf *m, *m2; @@ -666,6 +659,7 @@ pf_reassemble(struct mbuf **m0, struct i DPFPRINTF(("complete: %p(%d)\n", m, ntohs(ip->ip_len))); return (PF_PASS); } +#endif /* INET */ #ifdef INET6 static int @@ -789,6 +783,7 @@ fail: } #endif /* INET6 */ +#ifdef INET static struct mbuf * pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, int drop, int *nomem) @@ -1090,6 +1085,7 @@ pf_fragcache(struct mbuf **m0, struct ip m_freem(m); return (NULL); } +#endif /* INET */ #ifdef INET6 int @@ -1162,6 +1158,7 @@ pf_refragment6(struct ifnet *ifp, struct } #endif /* INET6 */ +#ifdef INET int pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kif *kif, u_short *reason, struct pf_pdesc *pd)