pf used as a module from buildkernel can't log in -current ?

Yar Tikhiy yar at comp.chem.msu.su
Fri Nov 4 06:11:21 PST 2005


On Mon, Oct 31, 2005 at 11:01:15AM +0100, Antoine Brodin wrote:
> I wrote:
> > Hi,
> > 
> > I use pf as a module on -current and it worked well until recently.
> > Today I noticed that pflogd didn't log anything.  It worked correctly
> > a month ago.
> > 
> > This seems to be related to revision 1.8 of sys/modules/pf/Makefile
> > 
> > pf says it logs packets :
> > 
> > %%%
> > # pfctl -sr -v | grep -A1 log
> > ...
> > block return-rst log inet proto tcp all
> >   [ Evaluations: 847       Packets: 8         Bytes: 408         States: 0     ]
> > block return-icmp(port-unr) log inet proto udp all
> >   [ Evaluations: 847       Packets: 58        Bytes: 27811       States: 0     ]
> > ...
> > %%%
> > 
> > but /var/log/pflog stays empty
> > 
> > opt_pf.h is empty too (that's why I say it's probably related to
> > revision 1.8 of sys/modules/pf/Makefile) :
> > 
> > %%%
> > % file /usr/obj/usr/src/sys/BARTON/opt_pf.h
> > /usr/obj/usr/src/sys/BARTON/opt_pf.h: empty
> > %%%
> > 
> > If I rebuild pf.ko in /sys/modules/pf , unload the other one and reload
> > this one pflogd does his job.
> > 
> > Is this behaviour expected ?
> 
> The attached patch solves this problem
> 
> Cheers,
> 
> 
> Antoine

> Index: sys/modules/pf/Makefile
> ===================================================================
> RCS file: /home/ncvs/src/sys/modules/pf/Makefile,v
> retrieving revision 1.8
> diff -u -r1.8 Makefile
> --- sys/modules/pf/Makefile	14 Oct 2005 23:30:14 -0000	1.8
> +++ sys/modules/pf/Makefile	31 Oct 2005 09:34:57 -0000
> @@ -12,11 +12,11 @@
>  
>  CFLAGS+=  -I${.CURDIR}/../../contrib/pf
>  
> -.if !defined(KERNBUILDDIR)
>  opt_pf.h:
>  	echo "#define DEV_PF 1" > opt_pf.h
>  	echo "#define DEV_PFLOG 1" >> opt_pf.h
>  
> +.if !defined(KERNBUILDDIR)
>  opt_inet.h:
>  	echo "#define INET 1" > opt_inet.h
>  

This patch just masks the real problem.  As I've told here already,
the problem is having a single module for 2 devices, pf and pflog.

-- 
Yar


More information about the freebsd-pf mailing list