pflog: align header to 4 bytes, not 8

6d4baa0d01 incorrectly rounded the lenght of the pflog header up to 8
bytes, rather than 4.

PR:		261566
Reported by:	Guy Harris <gharris@sonic.net>
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost 2022-02-01 08:56:49 +01:00
parent 84d7b8e75f
commit 4daa31c108

View File

@ -33,7 +33,6 @@
#include <sys/types.h>
#include <net/bpf.h>
#include <net/if.h>
#define PFLOGIFS_MAX 16
@ -60,7 +59,9 @@ struct pfloghdr {
u_int8_t pad2[3];
};
#define PFLOG_HDRLEN BPF_WORDALIGN(offsetof(struct pfloghdr, pad2))
#define PFLOG_ALIGNMENT sizeof(uint32_t)
#define PFLOG_ALIGN(x) (((x) + PFLOG_ALIGNMENT - 1) & ~(PFLOG_ALIGNMENT - 1))
#define PFLOG_HDRLEN PFLOG_ALIGN(offsetof(struct pfloghdr, pad2))
/* minus pad, also used as a signature */
#define PFLOG_REAL_HDRLEN offsetof(struct pfloghdr, pad2)