From 1155b43c0527a92ce1d08d76493481fc211600e7 Mon Sep 17 00:00:00 2001 From: bde Date: Mon, 13 Jul 1998 10:44:02 +0000 Subject: 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. --- sys/net/bpf.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/net/bpf.h') diff --git a/sys/net/bpf.h b/sys/net/bpf.h index 7847d72..9bcd100 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -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 /* -- cgit v1.1