Skip to content

Commit a9a8f75

Browse files
committed
pflog: note why we can't handle this all at run time. [skip ci]
I.e., we could handle *some* differences between pflog types at run time by looking at the length of the header, but we can't handle all of them, because the NetBSD, DragonFly BSD, and Darwin headers are all the same length, and there's at least one way that NetBSD and Darwin pflog files would have to be dissected differently.
1 parent a271c5e commit a9a8f75

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

print-pflog.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ struct pf_addr {
4747
#define v6 pfa.v6
4848
};
4949

50+
/*
51+
* This header is:
52+
*
53+
* 61 bytes long on NetBSD, DragonFly BSD. and Darwin;
54+
* 84 bytes lon on OpenBSD;
55+
* 72 bytes long on FreeBSD;
56+
*
57+
* which, unfortunately, does not allow us to distinguish, based on
58+
* the header length, between the three OSes listed as having 61-byte
59+
* headers. As the action values differ between them, this makes it
60+
* impossible to correctly dissect the reason values that differ
61+
* between NetBSD and Darwin (reason value 15) without having some
62+
* way to explicitly tell tcpdump what to do.
63+
*
64+
* (We could, I guess, label reason value 15 as
65+
* "state-locked (NetBSD)/dummynet (macOS etc.)" or something such as
66+
* that.)
67+
*/
5068
struct pfloghdr {
5169
nd_uint8_t length;
5270
nd_uint8_t af;

0 commit comments

Comments
 (0)