DragonFly BSD
DragonFly kernel List (threaded) for 2010-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Updating PF to OpenBSD Release 4,1


From: Aggelos Economopoulos <aoiko@xxxxxxxxxxxxxx>
Date: Fri, 14 May 2010 18:49:16 +0300

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,
BPF_DIRECTION_OUT);

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.


HTH,
Aggelos





[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]