Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108337337
D33236.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33236.diff
View Options
diff --git a/sys/net/if_pflog.h b/sys/net/if_pflog.h
--- a/sys/net/if_pflog.h
+++ b/sys/net/if_pflog.h
@@ -31,6 +31,8 @@
#ifndef _NET_IF_PFLOG_H_
#define _NET_IF_PFLOG_H_
+#include <net/bpf.h>
+
#define PFLOGIFS_MAX 16
#define PFLOG_RULESET_NAME_SIZE 16
@@ -51,11 +53,13 @@
u_int8_t dir;
u_int8_t pad[3];
u_int32_t ridentifier;
+ u_int8_t reserve; /* Appease broken software like Wireshark. */
+ u_int8_t pad2[3];
};
-#define PFLOG_HDRLEN sizeof(struct pfloghdr)
+#define PFLOG_HDRLEN BPF_WORDALIGN(offsetof(struct pfloghdr, pad2))
/* minus pad, also used as a signature */
-#define PFLOG_REAL_HDRLEN offsetof(struct pfloghdr, pad)
+#define PFLOG_REAL_HDRLEN offsetof(struct pfloghdr, pad2)
#ifdef _KERNEL
struct pf_rule;
diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c
--- a/sys/netpfil/pf/if_pflog.c
+++ b/sys/netpfil/pf/if_pflog.c
@@ -215,7 +215,7 @@
return (0);
bzero(&hdr, sizeof(hdr));
- hdr.length = PFLOG_HDRLEN;
+ hdr.length = PFLOG_REAL_HDRLEN;
hdr.af = af;
hdr.action = rm->action;
hdr.reason = reason;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 11:52 PM (16 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16110239
Default Alt Text
D33236.diff (1 KB)
Attached To
Mode
D33236: if_pflog: fix packet length
Attached
Detach File
Event Timeline
Log In to Comment