summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2011-04-19 11:29:09 +0000
committerae <ae@FreeBSD.org>2011-04-19 11:29:09 +0000
commitdb0a98ce0ace63f8ca353c274ccf793407172901 (patch)
treedde0038c3cc424e9f71afb658c48a0730e9a3c46 /sys/netinet
parentccce60bdebf47a73c06de1dee77e181afbcaf538 (diff)
downloadFreeBSD-src-db0a98ce0ace63f8ca353c274ccf793407172901.zip
FreeBSD-src-db0a98ce0ace63f8ca353c274ccf793407172901.tar.gz
ipdn_bound_var() functions is designed to bound a variable between
specified minimum and maximum. In case when specified default value is out of bounds it does not work as expected and does not limit variable. Check that default value is in range and limit it if needed. Also bump max_hash_size value to 65536 to correspond with manual page. PR: kern/152887 MFC after: 2 weeks
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ipfw/ip_dummynet.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/ipfw/ip_dummynet.c b/sys/netinet/ipfw/ip_dummynet.c
index 6494768..d44fd10 100644
--- a/sys/netinet/ipfw/ip_dummynet.c
+++ b/sys/netinet/ipfw/ip_dummynet.c
@@ -108,6 +108,10 @@ ipdn_bound_var(int *v, int dflt, int lo, int hi, const char *msg)
{
int oldv = *v;
const char *op = NULL;
+ if (dflt < lo)
+ dflt = lo;
+ if (dflt > hi)
+ dflt = hi;
if (oldv < lo) {
*v = dflt;
op = "Bump";
@@ -2128,7 +2132,7 @@ ip_dn_init(void)
dn_cfg.red_max_pkt_size = 1500; /* default max packet size */
/* hash tables */
- dn_cfg.max_hash_size = 1024; /* max in the hash tables */
+ dn_cfg.max_hash_size = 65536; /* max in the hash tables */
dn_cfg.hash_size = 64; /* default hash size */
/* create hash tables for schedulers and flowsets.
OpenPOWER on IntegriCloud