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:
bde 1998-07-13 10:44:02 +00:00
parent 925110cd23
commit 1155b43c05

View File

@ -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
/*