Updating PF to OpenBSD Release 4,1

Aggelos Economopoulos aoiko at cc.ece.ntua.gr
Fri May 14 08:53:26 PDT 2010

On 13/05/2010 07:14 μμ, Jan Lentfer wrote:
I am trying (and I mean >trying<) to update our version of PF to the PF
in OpenBSD 4.1. I have hit one obstacle (many more to come I am sure) I
don't know how to solve:
In sys/net/pf/if_pflog.c in function pflog_packet() we used to have
BPF_MTAP(ifn, &m1);
in OpenBSD 3.5 (which our version is based on) this was:
bpf_mtap(ifn->if_bpf, &m1);
In OpenBSD 4.1 this changed to:
bpf_mtap_hdr(ifn->if_bpf, (char *)&hdr, PFLOG_HDRLEN, m,
What happens is that for the pflog interface we add an additional header 
to the packet (pfloghdr). OpenBSD has bpf_mtap_hdr() to do that, FreeBSD 
probably uses BPF_MTAP2() for the same purpose. We just opencode the 
thing in pflog_packet(). I think we should import one of the two 
implementations (I haven't looked at the FreeBSD source). I much, much, 
prefer the OpenBSD name.


More information about the Kernel mailing list