Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Aug 2012 11:02:23 +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: r239093 - head/sys/netinet/ipfw
Message-ID:  <201208061102.q76B2NDn028309@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Mon Aug  6 11:02:23 2012
New Revision: 239093
URL: http://svn.freebsd.org/changeset/base/239093

Log:
  move functions outside the SYSBEGIN/SYSEND block
  
  (SYSBEGIN/SYSEND are specific to ipfw/dummynet and are used to
  emulate sysctl on platforms that do not have them, and they work
  by creating an array which contains all the sysctl-ed symbols.)

Modified:
  head/sys/netinet/ipfw/ip_dn_io.c

Modified: head/sys/netinet/ipfw/ip_dn_io.c
==============================================================================
--- head/sys/netinet/ipfw/ip_dn_io.c	Mon Aug  6 10:50:43 2012	(r239092)
+++ head/sys/netinet/ipfw/ip_dn_io.c	Mon Aug  6 11:02:23 2012	(r239093)
@@ -98,17 +98,11 @@ extern	void (*bridge_dn_p)(struct mbuf *
 
 #ifdef SYSCTL_NODE
 
-SYSBEGIN(f4)
-
-SYSCTL_DECL(_net_inet);
-SYSCTL_DECL(_net_inet_ip);
-static SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet");
-
-/* wrapper to pass dn_cfg fields to SYSCTL_* */
-//#define DC(x)	(&(VNET_NAME(_base_dn_cfg).x))
-#define DC(x)	(&(dn_cfg.x))
-/* parameters */
-
+/*
+ * Because of the way the SYSBEGIN/SYSEND macros work on other
+ * platforms, there should not be functions between them.
+ * So keep the handlers outside the block.
+ */
 static int
 sysctl_hash_size(SYSCTL_HANDLER_ARGS)
 {
@@ -124,10 +118,6 @@ sysctl_hash_size(SYSCTL_HANDLER_ARGS)
 	return (0);
 }
 
-SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, hash_size,
-    CTLTYPE_INT | CTLFLAG_RW, 0, 0, sysctl_hash_size,
-    "I", "Default hash table size");
-
 static int
 sysctl_limits(SYSCTL_HANDLER_ARGS)
 {
@@ -154,6 +144,23 @@ sysctl_limits(SYSCTL_HANDLER_ARGS)
 	return (0);
 }
 
+SYSBEGIN(f4)
+
+SYSCTL_DECL(_net_inet);
+SYSCTL_DECL(_net_inet_ip);
+static SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet");
+
+/* wrapper to pass dn_cfg fields to SYSCTL_* */
+//#define DC(x)	(&(VNET_NAME(_base_dn_cfg).x))
+#define DC(x)	(&(dn_cfg.x))
+/* parameters */
+
+
+SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, hash_size,
+    CTLTYPE_INT | CTLFLAG_RW, 0, 0, sysctl_hash_size,
+    "I", "Default hash table size");
+
+
 SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, pipe_slot_limit,
     CTLTYPE_LONG | CTLFLAG_RW, 0, 1, sysctl_limits,
     "L", "Upper limit in slots for pipe queue.");



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