* Danix <da...@kernel-panic.it> [2009-07-09 23:13]: > Hi all, > > I'm running the OpenBSD 4.6 snapshot from June 26th and I can't get > pfctl(8) to set the debug level: > > # pfctl -si | grep Debug > Status: Enabled for 0 days 01:37:04 Debug: Urgent > # pfctl -x loud > debug level set to 'loud' > # pfctl -si | grep Debug > Status: Enabled for 0 days 01:37:12 Debug: Urgent > > I've seen that there have recently been some changes in how the debug > level is set in pf_ioctl.c... is it still a work in progress? Am I > missing something?
shit. I forgot to commit a chunk. Index: pfctl.c =================================================================== RCS file: /cvs/src/sbin/pfctl/pfctl.c,v retrieving revision 1.282 diff -u -p -r1.282 pfctl.c --- pfctl.c 16 Apr 2009 04:40:19 -0000 1.282 +++ pfctl.c 9 Jul 2009 21:33:36 -0000 @@ -1900,8 +1900,15 @@ pfctl_set_interface_flags(struct pfctl * void pfctl_debug(int dev, u_int32_t level, int opts) { - if (ioctl(dev, DIOCSETDEBUG, &level)) - err(1, "DIOCSETDEBUG"); + struct pfr_buffer t; + + memset(&t, 0, sizeof(t)); + t.pfrb_type = PFRB_TRANS; + if (pfctl_trans(dev, &t, DIOCXBEGIN, 0) || + ioctl(dev, DIOCSETDEBUG, &level) || + pfctl_trans(dev, &t, DIOCXCOMMIT, 0)) + err(1, "pfctl_debug ioctl"); + if ((opts & PF_OPT_QUIET) == 0) { fprintf(stderr, "debug level set to '"); switch (level) { -- Henning Brauer, h...@bsws.de, henn...@openbsd.org BS Web Services, http://bsws.de Full-Service ISP - Secure Hosting, Mail and DNS Services Dedicated Servers, Rootservers, Application Hosting - Hamburg & Amsterdam