summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2014-06-27 22:05:21 +0000
committergjb <gjb@FreeBSD.org>2014-06-27 22:05:21 +0000
commitfc21f40567ac7485e9e987cf5a539bd0d11c7155 (patch)
treefce5301b062a855bc68b9cb76c6b5966c5a2acbe /sys/netgraph
parent2f456747e010bfa5a9dd3498aa5650e0ade39f22 (diff)
downloadFreeBSD-src-fc21f40567ac7485e9e987cf5a539bd0d11c7155.zip
FreeBSD-src-fc21f40567ac7485e9e987cf5a539bd0d11c7155.tar.gz
Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/ng_base.c3
-rw-r--r--sys/netgraph/ng_mppc.c9
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index 1970965..e83967b 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -2954,10 +2954,13 @@ static int numthreads = 0; /* number of queue threads */
static int maxalloc = 4096;/* limit the damage of a leak */
static int maxdata = 512; /* limit the damage of a DoS */
+TUNABLE_INT("net.graph.threads", &numthreads);
SYSCTL_INT(_net_graph, OID_AUTO, threads, CTLFLAG_RDTUN, &numthreads,
0, "Number of queue processing threads");
+TUNABLE_INT("net.graph.maxalloc", &maxalloc);
SYSCTL_INT(_net_graph, OID_AUTO, maxalloc, CTLFLAG_RDTUN, &maxalloc,
0, "Maximum number of non-data queue items to allocate");
+TUNABLE_INT("net.graph.maxdata", &maxdata);
SYSCTL_INT(_net_graph, OID_AUTO, maxdata, CTLFLAG_RDTUN, &maxdata,
0, "Maximum number of data queue items to allocate");
diff --git a/sys/netgraph/ng_mppc.c b/sys/netgraph/ng_mppc.c
index 76f4c3b..14d44de 100644
--- a/sys/netgraph/ng_mppc.c
+++ b/sys/netgraph/ng_mppc.c
@@ -111,15 +111,18 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "netgraph_mppc", "netgraph mppc node");
SYSCTL_NODE(_net_graph, OID_AUTO, mppe, CTLFLAG_RW, 0, "MPPE");
static int mppe_block_on_max_rekey = 0;
-SYSCTL_INT(_net_graph_mppe, OID_AUTO, block_on_max_rekey, CTLFLAG_RWTUN,
+TUNABLE_INT("net.graph.mppe.block_on_max_rekey", &mppe_block_on_max_rekey);
+SYSCTL_INT(_net_graph_mppe, OID_AUTO, block_on_max_rekey, CTLFLAG_RW,
&mppe_block_on_max_rekey, 0, "Block node on max MPPE key re-calculations");
static int mppe_log_max_rekey = 1;
-SYSCTL_INT(_net_graph_mppe, OID_AUTO, log_max_rekey, CTLFLAG_RWTUN,
+TUNABLE_INT("net.graph.mppe.log_max_rekey", &mppe_log_max_rekey);
+SYSCTL_INT(_net_graph_mppe, OID_AUTO, log_max_rekey, CTLFLAG_RW,
&mppe_log_max_rekey, 0, "Log max MPPE key re-calculations event");
static int mppe_max_rekey = MPPE_MAX_REKEY;
-SYSCTL_INT(_net_graph_mppe, OID_AUTO, max_rekey, CTLFLAG_RWTUN,
+TUNABLE_INT("net.graph.mppe.max_rekey", &mppe_max_rekey);
+SYSCTL_INT(_net_graph_mppe, OID_AUTO, max_rekey, CTLFLAG_RW,
&mppe_max_rekey, 0, "Maximum number of MPPE key re-calculations");
/* MPPC packet header bits */
OpenPOWER on IntegriCloud