Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 2014 05:21:37 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273453 - head/sys/netpfil/ipfw
Message-ID:  <201410220521.s9M5LbGK029337@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Wed Oct 22 05:21:36 2014
New Revision: 273453
URL: https://svnweb.freebsd.org/changeset/base/273453

Log:
  remove/fix old code for building ipfw and dummynet in userspace

Modified:
  head/sys/netpfil/ipfw/ip_dn_io.c
  head/sys/netpfil/ipfw/ip_fw_private.h
  head/sys/netpfil/ipfw/ip_fw_sockopt.c

Modified: head/sys/netpfil/ipfw/ip_dn_io.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_dn_io.c	Wed Oct 22 04:16:09 2014	(r273452)
+++ head/sys/netpfil/ipfw/ip_dn_io.c	Wed Oct 22 05:21:36 2014	(r273453)
@@ -283,7 +283,7 @@ mq_append(struct mq *q, struct mbuf *m)
 		*m_new = *m;	// copy
 		m_new->m_flags &= ~M_STACK;
 		m_new->__m_extbuf = p; // point to new buffer
-		pkt_copy(m->__m_extbuf, p, m->__m_extlen);
+		_pkt_copy(m->__m_extbuf, p, m->__m_extlen);
 		m_new->m_data = p + ofs;
 		m = m_new;
 	}

Modified: head/sys/netpfil/ipfw/ip_fw_private.h
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw_private.h	Wed Oct 22 04:16:09 2014	(r273452)
+++ head/sys/netpfil/ipfw/ip_fw_private.h	Wed Oct 22 05:21:36 2014	(r273453)
@@ -354,29 +354,6 @@ struct ipfw_ifc {
 };
 
 /* Macro for working with various counters */
-#ifdef USERSPACE
-#define	IPFW_INC_RULE_COUNTER(_cntr, _bytes)	do {	\
-	(_cntr)->pcnt++;				\
-	(_cntr)->bcnt += _bytes;			\
-	(_cntr)->timestamp = time_uptime;		\
-	} while (0)
-
-#define	IPFW_INC_DYN_COUNTER(_cntr, _bytes)	do {		\
-	(_cntr)->pcnt++;				\
-	(_cntr)->bcnt += _bytes;			\
-	} while (0)
-
-#define	IPFW_ZERO_RULE_COUNTER(_cntr) do {		\
-	(_cntr)->pcnt = 0;				\
-	(_cntr)->bcnt = 0;				\
-	(_cntr)->timestamp = 0;				\
-	} while (0)
-
-#define	IPFW_ZERO_DYN_COUNTER(_cntr) do {		\
-	(_cntr)->pcnt = 0;				\
-	(_cntr)->bcnt = 0;				\
-	} while (0)
-#else
 #define	IPFW_INC_RULE_COUNTER(_cntr, _bytes)	do {	\
 	counter_u64_add((_cntr)->cntr, 1);		\
 	counter_u64_add((_cntr)->cntr + 1, _bytes);	\
@@ -399,7 +376,6 @@ struct ipfw_ifc {
 	(_cntr)->pcnt = 0;				\
 	(_cntr)->bcnt = 0;				\
 	} while (0)
-#endif
 
 #define	TARG_VAL(ch, k, f)	((struct table_value *)((ch)->valuestate))[k].f
 #define	IP_FW_ARG_TABLEARG(ch, a, f)	\

Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw_sockopt.c	Wed Oct 22 04:16:09 2014	(r273452)
+++ head/sys/netpfil/ipfw/ip_fw_sockopt.c	Wed Oct 22 05:21:36 2014	(r273453)
@@ -152,8 +152,6 @@ static struct ipfw_sopt_handler	scodes[]
  * static variables followed by global ones
  */
 
-#ifndef USERSPACE
-
 static VNET_DEFINE(uma_zone_t, ipfw_cntr_zone);
 #define	V_ipfw_cntr_zone		VNET(ipfw_cntr_zone)
 
@@ -191,35 +189,6 @@ free_rule(struct ip_fw *rule)
 	uma_zfree(V_ipfw_cntr_zone, rule->cntr);
 	free(rule, M_IPFW);
 }
-#else
-void
-ipfw_init_counters()
-{
-}
-
-void
-ipfw_destroy_counters()
-{
-}
-
-struct ip_fw *
-ipfw_alloc_rule(struct ip_fw_chain *chain, size_t rulesize)
-{
-	struct ip_fw *rule;
-
-	rule = malloc(rulesize, M_IPFW, M_WAITOK | M_ZERO);
-
-	return (rule);
-}
-
-static void
-free_rule(struct ip_fw *rule)
-{
-
-	free(rule, M_IPFW);
-}
-
-#endif
 
 
 /*



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