summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf.h
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-07-13 10:44:02 +0000
committerbde <bde@FreeBSD.org>1998-07-13 10:44:02 +0000
commit1155b43c0527a92ce1d08d76493481fc211600e7 (patch)
tree963d32731d65152e89a14e2031da0a0eefde94dc /sys/net/bpf.h
parent925110cd2319780c323091d214a7840895264611 (diff)
downloadFreeBSD-src-1155b43c0527a92ce1d08d76493481fc211600e7.zip
FreeBSD-src-1155b43c0527a92ce1d08d76493481fc211600e7.tar.gz
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.
Diffstat (limited to 'sys/net/bpf.h')
-rw-r--r--sys/net/bpf.h5
1 files changed, 3 insertions, 2 deletions
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
/*
OpenPOWER on IntegriCloud