git: 275f412b070f - stable/12 - pflog: align header to 4 bytes, not 8
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 09 Feb 2022 09:56:51 UTC
The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=275f412b070f0d23b028f8bde85182a1f6d0fe7c commit 275f412b070f0d23b028f8bde85182a1f6d0fe7c Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2022-02-01 07:56:49 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2022-02-09 09:56:36 +0000 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") (cherry picked from commit 4daa31c10867b133bdc2a424e1e60d280384dc56) --- sys/net/if_pflog.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/net/if_pflog.h b/sys/net/if_pflog.h index 0406f78474a8..443c1cc36cf6 100644 --- a/sys/net/if_pflog.h +++ b/sys/net/if_pflog.h @@ -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)