看板 DFBSD_kernel 關於我們 聯絡資訊
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