Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Sep 2015 15:15:26 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 202996] pfctl: unitialized variable level in pfctl_set_debug
Message-ID:  <bug-202996-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202996

            Bug ID: 202996
           Summary: pfctl: unitialized variable level in pfctl_set_debug
           Product: Base System
           Version: 10.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: andrej.kolontai@verwaltung.uni-muenchen.de

In pfctl.c, there is a function named pfctl_set_debug. 

The variable "level" in that function is declared but not initialized and used
in 

if (ioctl(dev, DIOCSETDEBUG, &level))

This can effectively set the pf debug level to loud (in my case it always does)
causing lots of messages on the console and syslog while the ruleset is loaded. 

In my case, this seems to have a serious impact on performance. 

I've made a patch:

--- /home/kolontai/pfctl.c    2015-09-09 17:11:05.016276000 +0200
+++ pfctl.c    2015-09-09 15:37:05.849986000 +0200
@@ -1845,6 +1845,8 @@
     }

     pf->debug_set = 1;
+    level = pf->debug;
+

     if ((pf->opts & PF_OPT_NOACTION) == 0)
         if (ioctl(dev, DIOCSETDEBUG, &level))

-- 
You are receiving this mail because:
You are the assignee for the bug.



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