]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
if_pflog: fix packet length
authorKristof Provost <kp@FreeBSD.org>
Thu, 2 Dec 2021 07:22:34 +0000 (08:22 +0100)
committerKristof Provost <kp@FreeBSD.org>
Sat, 4 Dec 2021 07:42:55 +0000 (08:42 +0100)
commit6d4baa0d011cb3e78b4b08415568e71c0aab00fe
treeabba2062e850502f1f68554f63018c51bca79558
parent98470f0e0bc72d5e6a9aaeff42ed72f92972365d
if_pflog: fix packet length

There were two issues with the new pflog packet length.
The first is that the length is expected to be a multiple of
sizeof(long), but we'd assumed it had to be a multiple of
sizeof(uint32_t).

The second is that there's some broken software out there (such as
Wireshark) that makes incorrect assumptions about the amount of padding.
That is, Wireshark assumes there's always three bytes of padding, rather
than however much is needed to get to a multiple of sizeof(long).

Fix this by adding extra padding, and a fake field to maintain
Wireshark's assumption.

Reported by: Ozkan KIRIK <ozkan.kirik@gmail.com>
Tested by: Ozkan KIRIK <ozkan.kirik@gmail.com>
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33236
sys/net/if_pflog.h
sys/netpfil/pf/if_pflog.c