]> The Tcpdump Group git mirrors - tcpdump/commitdiff
pflog: Fix the minimum header length
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 27 Oct 2023 13:20:35 +0000 (15:20 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 27 Oct 2023 13:27:58 +0000 (15:27 +0200)
The minimum header length (without padding) is: 61.
Move it in pflog.h.

[skip ci]

pflog.h
print-pflog.c

diff --git a/pflog.h b/pflog.h
index 6680b4246697b052a042b23c39e079f3009d5cbb..dda3e48603149328fc20ca3f1371f01b44c1c9a1 100644 (file)
--- a/pflog.h
+++ b/pflog.h
@@ -128,6 +128,8 @@ struct pfloghdr {
        nd_uint32_t     rule_uid;
        nd_int32_t      rule_pid;
        nd_uint8_t      dir;
+/* Minimum header length (without padding): 61 */
+#define MIN_PFLOG_HDRLEN 61
 #if defined(__OpenBSD__)
        nd_uint8_t      rewritten;
        nd_uint8_t      naf;
@@ -146,6 +148,3 @@ struct pfloghdr {
        nd_uint16_t     dport;
 #endif
 };
-
-
-
index 4081135340ae6521a014000baf9b8b9a029cf558..2752c7c37551d6d71aad6bd5d30ad31dc70fdb8f 100644 (file)
@@ -142,7 +142,6 @@ pflog_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
                return;
        }
 
-#define MIN_PFLOG_HDRLEN       45
        hdr = (const struct pfloghdr *)p;
        hdrlen = GET_U_1(hdr->length);
        if (hdrlen < MIN_PFLOG_HDRLEN) {