mirror of
https://github.com/opnsense/src.git
synced 2026-04-28 09:37:08 -04:00
Don't attempt to optimize the space allocated for bpf headers if
sizeof(struct bpf_hdr) > 20. 20 is normal on 32-bit systems with 32-bit alignment, but we still assume that the last 2 bytes of the struct are unnecessary padding on such systems. On systems with 64-bit longs, struct timeval is bloated to 16 bytes, so bpf headers certainly don't fit in 18 bytes.
This commit is contained in:
parent
9bffbcd4f5
commit
c086febef5
1 changed files with 3 additions and 2 deletions
|
|
@ -38,7 +38,7 @@
|
|||
* @(#)bpf.h 8.1 (Berkeley) 6/10/93
|
||||
* @(#)bpf.h 1.34 (LBL) 6/16/96
|
||||
*
|
||||
* $Id$
|
||||
* $Id: bpf.h,v 1.12 1997/02/22 09:40:55 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NET_BPF_H_
|
||||
|
|
@ -128,7 +128,8 @@ struct bpf_hdr {
|
|||
* Only the kernel needs to know about it; applications use bh_hdrlen.
|
||||
*/
|
||||
#ifdef KERNEL
|
||||
#define SIZEOF_BPF_HDR 18
|
||||
#define SIZEOF_BPF_HDR (sizeof(struct bpf_hdr) <= 20 ? 18 : \
|
||||
sizeof(struct bpf_hdr))
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue