Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2012 06:50:25 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r240186 - projects/pf/head/sys/contrib/pf/net
Message-ID:  <201209070650.q876oPi8054487@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Fri Sep  7 06:50:25 2012
New Revision: 240186
URL: http://svn.freebsd.org/changeset/base/240186

Log:
  Fix NOINET build.

Modified:
  projects/pf/head/sys/contrib/pf/net/pf.c
  projects/pf/head/sys/contrib/pf/net/pf_norm.c

Modified: projects/pf/head/sys/contrib/pf/net/pf.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf.c	Fri Sep  7 06:12:28 2012	(r240185)
+++ projects/pf/head/sys/contrib/pf/net/pf.c	Fri Sep  7 06:50:25 2012	(r240186)
@@ -219,13 +219,6 @@ static void		 pf_change_ap(struct pf_add
 			    u_int16_t, u_int8_t, sa_family_t);
 static int		 pf_modulate_sack(struct mbuf *, int, struct pf_pdesc *,
 			    struct tcphdr *, struct pf_state_peer *);
-#ifdef INET6
-static void		 pf_change_a6(struct pf_addr *, u_int16_t *,
-			    struct pf_addr *, u_int8_t);
-static void		 pf_route6(struct mbuf **, struct pf_rule *, int,
-			    struct ifnet *, struct pf_state *,
-			    struct pf_pdesc *);
-#endif /* INET6 */
 static void		 pf_change_icmp(struct pf_addr *, u_int16_t *,
 			    struct pf_addr *, struct pf_addr *, u_int16_t,
 			    u_int16_t *, u_int16_t *, u_int16_t *,
@@ -277,9 +270,6 @@ static int		 pf_test_state_icmp(struct p
 			    void *, struct pf_pdesc *, u_short *);
 static int		 pf_test_state_other(struct pf_state **, int,
 			    struct pfi_kif *, struct mbuf *, struct pf_pdesc *);
-static void		 pf_route(struct mbuf **, struct pf_rule *, int,
-			    struct ifnet *, struct pf_state *,
-			    struct pf_pdesc *);
 static u_int8_t		 pf_get_wscale(struct mbuf *, int, u_int16_t,
 			    sa_family_t);
 static u_int16_t	 pf_get_mss(struct mbuf *, int, u_int16_t,
@@ -304,6 +294,18 @@ static int		 pf_purge_expired_states(int
 static void		 pf_purge_unlinked_rules(void);
 static int		 pf_mtag_init(void *, int, int);
 static void		 pf_mtag_free(struct m_tag *);
+#ifdef INET
+static void		 pf_route(struct mbuf **, struct pf_rule *, int,
+			    struct ifnet *, struct pf_state *,
+			    struct pf_pdesc *);
+#endif /* INET */
+#ifdef INET6
+static void		 pf_change_a6(struct pf_addr *, u_int16_t *,
+			    struct pf_addr *, u_int8_t);
+static void		 pf_route6(struct mbuf **, struct pf_rule *, int,
+			    struct ifnet *, struct pf_state *,
+			    struct pf_pdesc *);
+#endif /* INET6 */
 
 int in4_cksum(struct mbuf *m, u_int8_t nxt, int off, int len);
 

Modified: projects/pf/head/sys/contrib/pf/net/pf_norm.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf_norm.c	Fri Sep  7 06:12:28 2012	(r240185)
+++ projects/pf/head/sys/contrib/pf/net/pf_norm.c	Fri Sep  7 06:50:25 2012	(r240186)
@@ -121,19 +121,21 @@ static RB_PROTOTYPE(pf_frag_tree, pf_fra
 static RB_GENERATE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare);
 
 /* Private prototypes */
-static void		 pf_ip2key(struct pf_fragment *, struct ip *);
+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);
+#ifdef INET
+static void		 pf_ip2key(struct pf_fragment *, struct ip *);
+static void		 pf_scrub_ip(struct mbuf **, u_int32_t, u_int8_t,
+			    u_int8_t);
 static void		 pf_flush_fragments(void);
-static void		 pf_free_fragment(struct pf_fragment *);
 static struct pf_fragment *pf_find_fragment(struct ip *, struct pf_frag_tree *);
 static struct mbuf	*pf_reassemble(struct mbuf **, struct pf_fragment **,
 			    struct pf_frent *, int);
 static struct mbuf	*pf_fragcache(struct mbuf **, struct ip*,
 			    struct pf_fragment **, int, int, int *);
-static int		 pf_normalize_tcpopt(struct pf_rule *, struct mbuf *,
-			    struct tcphdr *, int, sa_family_t);
-static void		 pf_scrub_ip(struct mbuf **, u_int32_t, u_int8_t,
-			    u_int8_t);
+#endif /* INET */
 #ifdef INET6
 static void		 pf_scrub_ip6(struct mbuf **, u_int8_t);
 #endif
@@ -231,10 +233,10 @@ pf_purge_expired_fragments(void)
 	PF_FRAG_UNLOCK();
 }
 
+#ifdef INET
 /*
  * Try to flush old fragments to make space for new ones
  */
-
 static void
 pf_flush_fragments(void)
 {
@@ -256,9 +258,9 @@ pf_flush_fragments(void)
 			break;
 	}
 }
+#endif /* INET */
 
 /* Frees the fragments and all associated entries */
-
 static void
 pf_free_fragment(struct pf_fragment *frag)
 {
@@ -293,6 +295,7 @@ pf_free_fragment(struct pf_fragment *fra
 	pf_remove_fragment(frag);
 }
 
+#ifdef INET
 static void
 pf_ip2key(struct pf_fragment *key, struct ip *ip)
 {
@@ -327,6 +330,7 @@ pf_find_fragment(struct ip *ip, struct p
 
 	return (frag);
 }
+#endif /* INET */
 
 /* Removes a fragment from the fragment queue and frees the fragment */
 
@@ -347,6 +351,7 @@ pf_remove_fragment(struct pf_fragment *f
 	}
 }
 
+#ifdef INET
 #define FR_IP_OFF(fr)	((ntohs((fr)->fr_ip->ip_off) & IP_OFFMASK) << 3)
 static struct mbuf *
 pf_reassemble(struct mbuf **m0, struct pf_fragment **frag,
@@ -854,7 +859,6 @@ pf_fragcache(struct mbuf **m0, struct ip
 	return (NULL);
 }
 
-#ifdef INET
 int
 pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kif *kif, u_short *reason,
     struct pf_pdesc *pd)
@@ -1937,6 +1941,7 @@ pf_normalize_tcpopt(struct pf_rule *r, s
 	return (rewrite);
 }
 
+#ifdef INET
 static void
 pf_scrub_ip(struct mbuf **m0, u_int32_t flags, u_int8_t min_ttl, u_int8_t tos)
 {
@@ -1978,6 +1983,7 @@ pf_scrub_ip(struct mbuf **m0, u_int32_t 
 		h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_id, h->ip_id, 0);
 	}
 }
+#endif /* INET */
 
 #ifdef INET6
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209070650.q876oPi8054487>