Module Name: src Committed By: rin Date: Wed Aug 23 13:21:17 UTC 2023
Modified Files: src/sys/net: bpf.h Log Message: bpf: Fix SIZEOF_BPF_HDR (for LP64 userland) on mips64 It cannot fit within 18 bytes, of course ;) As we had never provided working bpf(4) implementation for LP64 userland on mips, just use natural structure size here. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/net/bpf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/bpf.h diff -u src/sys/net/bpf.h:1.81 src/sys/net/bpf.h:1.82 --- src/sys/net/bpf.h:1.81 Thu Aug 17 22:10:37 2023 +++ src/sys/net/bpf.h Wed Aug 23 13:21:17 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: bpf.h,v 1.81 2023/08/17 22:10:37 christos Exp $ */ +/* $NetBSD: bpf.h,v 1.82 2023/08/23 13:21:17 rin Exp $ */ /* * Copyright (c) 1990, 1991, 1993 @@ -204,7 +204,10 @@ struct bpf_hdr32 { * XXX fail-safe: on new machines, we just use the 'safe' sizeof. */ #ifdef _KERNEL -#if defined(__arm32__) || defined(__i386__) || defined(__m68k__) || \ +#if defined(__mips64) +#define SIZEOF_BPF_HDR sizeof(struct bpf_hdr) +#define SIZEOF_BPF_HDR32 18 +#elif defined(__arm32__) || defined(__i386__) || defined(__m68k__) || \ defined(__mips__) || defined(__ns32k__) || defined(__vax__) || \ defined(__sh__) || (defined(__sparc__) && !defined(__sparc64__)) #define SIZEOF_BPF_HDR 18