Date: Tue, 19 Apr 2011 11:29:09 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r220831 - head/sys/netinet/ipfw Message-ID: <201104191129.p3JBT9Sb006181@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Tue Apr 19 11:29:09 2011 New Revision: 220831 URL: http://svn.freebsd.org/changeset/base/220831 Log: 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 Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Tue Apr 19 10:57:40 2011 (r220830) +++ head/sys/netinet/ipfw/ip_dummynet.c Tue Apr 19 11:29:09 2011 (r220831) @@ -108,6 +108,10 @@ ipdn_bound_var(int *v, int dflt, int lo, { 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104191129.p3JBT9Sb006181>