CVS commit: src/sys/arch
Module Name:src Committed By: maxv Date: Thu Jan 18 07:25:34 UTC 2018 Modified Files: src/sys/arch/amd64/amd64: amd64_trap.S genassym.cf locore.S machdep.c src/sys/arch/amd64/include: frameasm.h src/sys/arch/x86/include: cpu.h pmap.h src/sys/arch/x86/x86: vm_machdep.c Log Message: Unmap the kernel heap from the user page tables (SVS). This implementation is optimized and organized in such a way that we don't need to copy the kernel stack to a safe place during user<->kernel transitions. We create two VAs that point to the same physical page; one will be mapped in userland and is offset in order to contain only the trapframe, the other is mapped in the kernel and maps the entire stack. Sent on tech-kern@ a week ago. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/amd64/amd64/amd64_trap.S cvs rdiff -u -r1.66 -r1.67 src/sys/arch/amd64/amd64/genassym.cf cvs rdiff -u -r1.146 -r1.147 src/sys/arch/amd64/amd64/locore.S cvs rdiff -u -r1.290 -r1.291 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amd64/include/frameasm.h cvs rdiff -u -r1.88 -r1.89 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.74 -r1.75 src/sys/arch/x86/include/pmap.h cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x86/x86/vm_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amd64/amd64/amd64_trap.S diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.17 src/sys/arch/amd64/amd64/amd64_trap.S:1.18 --- src/sys/arch/amd64/amd64/amd64_trap.S:1.17 Sun Jan 7 16:10:16 2018 +++ src/sys/arch/amd64/amd64/amd64_trap.S Thu Jan 18 07:25:34 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: amd64_trap.S,v 1.17 2018/01/07 16:10:16 maxv Exp $ */ +/* $NetBSD: amd64_trap.S,v 1.18 2018/01/18 07:25:34 maxv Exp $ */ /* * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ #if 0 #include -__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.17 2018/01/07 16:10:16 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.18 2018/01/18 07:25:34 maxv Exp $"); #endif /* @@ -120,8 +120,8 @@ IDTVEC(trap02) #else ZTRAP_NJ(T_NMI) subq $TF_REGSIZE,%rsp - SVS_ENTER INTR_SAVE_GPRS + SVS_ENTER_ALTSTACK cld SMAP_ENABLE movw %gs,TF_GS(%rsp) @@ -138,7 +138,7 @@ IDTVEC(trap02) movq %rsp,%rdi incq CPUVAR(NTRAP) call _C_LABEL(nmitrap) - SVS_LEAVE + SVS_LEAVE_ALTSTACK swapgs jmp .Lnmileave Index: src/sys/arch/amd64/amd64/genassym.cf diff -u src/sys/arch/amd64/amd64/genassym.cf:1.66 src/sys/arch/amd64/amd64/genassym.cf:1.67 --- src/sys/arch/amd64/amd64/genassym.cf:1.66 Sun Jan 7 16:47:22 2018 +++ src/sys/arch/amd64/amd64/genassym.cf Thu Jan 18 07:25:34 2018 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.66 2018/01/07 16:47:22 christos Exp $ +# $NetBSD: genassym.cf,v 1.67 2018/01/18 07:25:34 maxv Exp $ # # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -239,6 +239,9 @@ define CPU_INFO_TSS offsetof(struct cpu ifdef SVS define CPU_INFO_UPDIRPA offsetof(struct cpu_info, ci_svs_updirpa) define CPU_INFO_KPDIRPA offsetof(struct cpu_info, ci_svs_kpdirpa) +define CPU_INFO_RSP0 offsetof(struct cpu_info, ci_svs_rsp0) +define CPU_INFO_URSP0 offsetof(struct cpu_info, ci_svs_ursp0) +define CPU_INFO_KRSP0 offsetof(struct cpu_info, ci_svs_krsp0) endif define CPU_INFO_NSYSCALL offsetof(struct cpu_info, ci_data.cpu_nsyscall) define CPU_INFO_NTRAP offsetof(struct cpu_info, ci_data.cpu_ntrap) Index: src/sys/arch/amd64/amd64/locore.S diff -u src/sys/arch/amd64/amd64/locore.S:1.146 src/sys/arch/amd64/amd64/locore.S:1.147 --- src/sys/arch/amd64/amd64/locore.S:1.146 Thu Jan 11 09:00:04 2018 +++ src/sys/arch/amd64/amd64/locore.S Thu Jan 18 07:25:34 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.146 2018/01/11 09:00:04 maxv Exp $ */ +/* $NetBSD: locore.S,v 1.147 2018/01/18 07:25:34 maxv Exp $ */ /* * Copyright-o-rama! @@ -1112,7 +1112,11 @@ ENTRY(cpu_switchto) jnz .Lswitch_return /* Switch ring0 stack */ -#ifndef XEN +#ifdef SVS + movq CPUVAR(RSP0),%rax + movq CPUVAR(TSS),%rdi + movq %rax,TSS_RSP0(%rdi) +#elif !defined(XEN) movq PCB_RSP0(%r14),%rax movq CPUVAR(TSS),%rdi movq %rax,TSS_RSP0(%rdi) @@ -1268,14 +1272,20 @@ IDTVEC(syscall) * is ignored as well. */ swapgs - SVS_ENTER_NOSTACK + +#ifdef SVS + movq %rax,SVS_UTLS+UTLS_SCRATCH + movq SVS_UTLS+UTLS_RSP0,%rax +#define SP(x) (x)-(TF_SS+8)(%rax) +#else movq %r15,CPUVAR(SCRATCH) movq CPUVAR(CURLWP),%r15 movq L_PCB(%r15),%r15 movq PCB_RSP0(%r15),%r15 /* LWP's kernel stack pointer */ +#define SP(x) (x)-(TF_SS+8)(%r15) +#endif /* Make stack look like an 'int nn' frame */ -#define SP(x) (x)-(TF_SS+8)(%r15) movq $(LSEL(LUDATA_SEL, SEL_UPL)),SP(TF_SS) /* user %ss */ movq %rsp,SP(TF_RSP)/* user %rsp */ movq %r11,SP(TF_RFLAGS) /* user %rflags */ @@ -1283,8 +1293,11 @@ IDTVEC(syscall) movq %rcx,SP(TF_RIP)/* user %rip */ leaq
CVS commit: src/doc
Module Name:src Committed By: mrg Date: Thu Jan 18 00:34:05 UTC 2018 Modified Files: src/doc: CHANGES Log Message: note netbsd32 support for raid(4). To generate a diff of this commit: cvs rdiff -u -r1.2348 -r1.2349 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2348 src/doc/CHANGES:1.2349 --- src/doc/CHANGES:1.2348 Wed Jan 17 13:52:12 2018 +++ src/doc/CHANGES Thu Jan 18 00:34:05 2018 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2348 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2349 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -102,3 +102,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0: cpuctl(8): Add cpuctl identify support for sparc and sparc64. [mrg 20180116] macppc: Enable Veriexec support in the GENERIC kernel [sevan 20180117] + raid(4): Add support for 32-bit on 64-bit kernel. [mrg 20180117]
CVS commit: src
Module Name:src Committed By: mrg Date: Thu Jan 18 00:32:49 UTC 2018 Modified Files: src/sbin/raidctl: raidctl.8 raidctl.c rf_configure.c src/sys/conf: files src/sys/dev/raidframe: files.raidframe raidframeio.h raidframevar.h rf_compat50.c rf_decluster.c rf_decluster.h rf_kintf.h rf_netbsdkintf.c rf_reconutil.c src/sys/modules/raid: Makefile src/sys/rump: Makefile.rump src/sys/rump/dev/lib/libraidframe: Makefile src/tests/dev/raidframe: t_raid.sh Added Files: src/sys/dev/raidframe: rf_compat32.c rf_compat32.h rf_compat80.c rf_compat80.h Log Message: implement 32-bit compat support for raidframe. convert several raidframe ioctls to be bitsize idempotent so that they work the same in 32 and 64 bit worlds, allowing netbsd32 to configure and query raid properly. remove useless 'row' in a few places. add COMPAT_80 and put the old ioctls there. raidframeio.h: RAIDFRAME_TEST_ACC - remove, unused RAIDFRAME_GET_COMPONENT_LABEL - convert to label not pointer to label RAIDFRAME_CHECK_RECON_STATUS_EXT RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT RAIDFRAME_CHECK_COPYBACK_STATUS_EXT - convert to progress info not pointer to info RAIDFRAME_GET_INFO - version entirely. raidframevar.h: - rf_recon_req{} has row, flags and raidPtr removed (they're not a useful part of this interface.) - RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed. - RF_RaidDisk_s{} is re-ordered slightly to fix alignment padding - the actual data was already OK. - InstallSpareTable() loses row argument rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32. rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK, RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT, RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT, RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO. move several of the per-ioctl code blocks into separate functions. add rf_recon_req_internal{} to replace old usage of global rf_recon_req{} that had unused void * in the structure, ruining it's 32/64 bit ABI. add missing case for RAIDFRAME_GET_INFO50. adjust raid tests to use the new .conf format, and add a case to test the old method as well. raidctl: deal with lack of 'row' members in a couple of places. fail request no longer takes row. handle "START array" sections with just "numCol numSpare", ie no "numRow" specified. for now, generate old-style configuration but update raidctl.8 to specify the new style (keeping reference to the old style.) note that: RF_ComponentLabel_s::{row,num_rows} and RF_SingleComponent_s::row are obsolete but not removed yet. To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sbin/raidctl/raidctl.8 cvs rdiff -u -r1.65 -r1.66 src/sbin/raidctl/raidctl.c cvs rdiff -u -r1.32 -r1.33 src/sbin/raidctl/rf_configure.c cvs rdiff -u -r1.1191 -r1.1192 src/sys/conf/files cvs rdiff -u -r1.9 -r1.10 src/sys/dev/raidframe/files.raidframe cvs rdiff -u -r1.7 -r1.8 src/sys/dev/raidframe/raidframeio.h \ src/sys/dev/raidframe/rf_decluster.h cvs rdiff -u -r1.17 -r1.18 src/sys/dev/raidframe/raidframevar.h cvs rdiff -u -r0 -r1.1 src/sys/dev/raidframe/rf_compat32.c \ src/sys/dev/raidframe/rf_compat32.h src/sys/dev/raidframe/rf_compat80.c \ src/sys/dev/raidframe/rf_compat80.h cvs rdiff -u -r1.2 -r1.3 src/sys/dev/raidframe/rf_compat50.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/raidframe/rf_decluster.c \ src/sys/dev/raidframe/rf_kintf.h cvs rdiff -u -r1.352 -r1.353 src/sys/dev/raidframe/rf_netbsdkintf.c cvs rdiff -u -r1.35 -r1.36 src/sys/dev/raidframe/rf_reconutil.c cvs rdiff -u -r1.1 -r1.2 src/sys/modules/raid/Makefile cvs rdiff -u -r1.122 -r1.123 src/sys/rump/Makefile.rump cvs rdiff -u -r1.10 -r1.11 src/sys/rump/dev/lib/libraidframe/Makefile cvs rdiff -u -r1.12 -r1.13 src/tests/dev/raidframe/t_raid.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/raidctl/raidctl.8 diff -u src/sbin/raidctl/raidctl.8:1.73 src/sbin/raidctl/raidctl.8:1.74 --- src/sbin/raidctl/raidctl.8:1.73 Mon Nov 20 18:37:56 2017 +++ src/sbin/raidctl/raidctl.8 Thu Jan 18 00:32:49 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: raidctl.8,v 1.73 2017/11/20 18:37:56 kardel Exp $ +.\" $NetBSD: raidctl.8,v 1.74 2018/01/18 00:32:49 mrg Exp $ .\" .\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -364,17 +364,21 @@ and the configuration parameters associa The first section is the .Sq array section, and it specifies -the number of rows, columns, and spare disks in the RAID set. +the number of columns, and spare disks in the RAID set. For example: .Bd -literal -offset indent START array -1 3 0 +3 0 .Ed .Pp -indicates an array with 1 row, 3 columns, and 0 spare disks.
CVS commit: src/sys/arch/sparc64/dev
Module Name:src Committed By: mrg Date: Thu Jan 18 00:31:22 UTC 2018 Modified Files: src/sys/arch/sparc64/dev: ebus.c Log Message: merge the ebus@pci attach output to be like most PCI drivers: ebus0 at pci1 dev 1 function 0 ebus0: Sun Microsystems PCIO Ebus2, revision 0x01 becomes: ebus0 at pci1 dev 1 function 0: Sun Microsystems PCIO Ebus2, revision 0x01 To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/arch/sparc64/dev/ebus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/dev/ebus.c diff -u src/sys/arch/sparc64/dev/ebus.c:1.62 src/sys/arch/sparc64/dev/ebus.c:1.63 --- src/sys/arch/sparc64/dev/ebus.c:1.62 Sat Oct 18 08:33:27 2014 +++ src/sys/arch/sparc64/dev/ebus.c Thu Jan 18 00:31:22 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ebus.c,v 1.62 2014/10/18 08:33:27 snj Exp $ */ +/* $NetBSD: ebus.c,v 1.63 2018/01/18 00:31:22 mrg Exp $ */ /* * Copyright (c) 1999, 2000, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.62 2014/10/18 08:33:27 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.63 2018/01/18 00:31:22 mrg Exp $"); #include "opt_ddb.h" @@ -148,11 +148,10 @@ ebus_attach(device_t parent, device_t se sc->sc_dev = self; - aprint_normal("\n"); aprint_naive("\n"); pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); - aprint_normal_dev(self, "%s, revision 0x%02x\n", devinfo, + aprint_normal(": %s, revision 0x%02x\n", devinfo, PCI_REVISION(pa->pa_class)); sc->sc_memtag = pa->pa_memt;
CVS commit: src/sys/arch
Module Name:src Committed By: skrll Date: Wed Jan 17 20:30:17 UTC 2018 Modified Files: src/sys/arch/arm/arm32: db_interface.c pmap.c src/sys/arch/arm/conf: files.arm src/sys/arch/cats/conf: std.cats src/sys/arch/epoc32/conf: std.epoc32 src/sys/arch/evbarm/conf: std.hdl_g std.integrator std.integrator_cp std.iq31244 std.iq80321 std.ixdp425 std.ixm1200 std.mini2440 std.npwr_fc std.smdk2410 std.smdk2800 src/sys/arch/iyonix/conf: std.iyonix src/sys/arch/shark/conf: std.shark Log Message: G/C ARM32_NEW_VM_LAYOUT To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/arch/arm/arm32/db_interface.c cvs rdiff -u -r1.361 -r1.362 src/sys/arch/arm/arm32/pmap.c cvs rdiff -u -r1.136 -r1.137 src/sys/arch/arm/conf/files.arm cvs rdiff -u -r1.9 -r1.10 src/sys/arch/cats/conf/std.cats cvs rdiff -u -r1.1 -r1.2 src/sys/arch/epoc32/conf/std.epoc32 cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/std.hdl_g cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/std.integrator cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/std.integrator_cp cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/conf/std.iq31244 cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/std.iq80321 \ src/sys/arch/evbarm/conf/std.smdk2800 cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/conf/std.ixdp425 cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/conf/std.ixm1200 cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/std.mini2440 cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/std.npwr_fc cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/std.smdk2410 cvs rdiff -u -r1.6 -r1.7 src/sys/arch/iyonix/conf/std.iyonix cvs rdiff -u -r1.10 -r1.11 src/sys/arch/shark/conf/std.shark Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm32/db_interface.c diff -u src/sys/arch/arm/arm32/db_interface.c:1.56 src/sys/arch/arm/arm32/db_interface.c:1.57 --- src/sys/arch/arm/arm32/db_interface.c:1.56 Fri Jun 30 08:10:50 2017 +++ src/sys/arch/arm/arm32/db_interface.c Wed Jan 17 20:30:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: db_interface.c,v 1.56 2017/06/30 08:10:50 skrll Exp $ */ +/* $NetBSD: db_interface.c,v 1.57 2018/01/17 20:30:16 skrll Exp $ */ /* * Copyright (c) 1996 Scott K. Stevens @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.56 2017/06/30 08:10:50 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.57 2018/01/17 20:30:16 skrll Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -203,11 +203,7 @@ db_validate_address(vaddr_t addr) struct pmap *pmap; if (!p || !p->p_vmspace || !p->p_vmspace->vm_map.pmap || -#ifndef ARM32_NEW_VM_LAYOUT - addr >= VM_MAXUSER_ADDRESS -#else addr >= VM_MIN_KERNEL_ADDRESS -#endif ) pmap = pmap_kernel(); else Index: src/sys/arch/arm/arm32/pmap.c diff -u src/sys/arch/arm/arm32/pmap.c:1.361 src/sys/arch/arm/arm32/pmap.c:1.362 --- src/sys/arch/arm/arm32/pmap.c:1.361 Wed Nov 1 21:13:26 2017 +++ src/sys/arch/arm/arm32/pmap.c Wed Jan 17 20:30:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.361 2017/11/01 21:13:26 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.362 2018/01/17 20:30:16 skrll Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -217,7 +217,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.361 2017/11/01 21:13:26 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.362 2018/01/17 20:30:16 skrll Exp $"); //#define PMAP_DEBUG #ifdef PMAP_DEBUG @@ -6573,15 +6573,6 @@ pmap_postinit(void) * Note that the following routines are used by board-specific initialisation * code to configure the initial kernel page tables. * - * If ARM32_NEW_VM_LAYOUT is *not* defined, they operate on the assumption that - * L2 page-table pages are 4KB in size and use 4 L1 slots. This mimics the - * behaviour of the old pmap, and provides an easy migration path for - * initial bring-up of the new pmap on existing ports. Fortunately, - * pmap_bootstrap() compensates for this hackery. This is only a stop-gap and - * will be deprecated. - * - * If ARM32_NEW_VM_LAYOUT *is* defined, these functions deal with 1KB L2 page - * tables. */ /* Index: src/sys/arch/arm/conf/files.arm diff -u src/sys/arch/arm/conf/files.arm:1.136 src/sys/arch/arm/conf/files.arm:1.137 --- src/sys/arch/arm/conf/files.arm:1.136 Fri Nov 10 22:07:30 2017 +++ src/sys/arch/arm/conf/files.arm Wed Jan 17 20:30:16 2018 @@ -1,4 +1,4 @@ -# $NetBSD: files.arm,v 1.136 2017/11/10 22:07:30 matt Exp $ +# $NetBSD: files.arm,v 1.137 2018/01/17 20:30:16 skrll Exp $ # temporary define to allow easy moving to ../arch/arm/arm32 defflagARM32 @@ -105,7 +105,7 @@ file arch/arm/arm/psci_arm.S psci defflagPMAP_DEBUG # New PMAP options -defflag opt_arm32_pmap.h ARM32_NEW_VM_LAYOUT PMAPCOUNTERS +defflag opt_arm32_pmap.h PMAPCOUNTERS PMAP_STEAL_MEMORY PMAP_NEED_ALLOC_POOLPAGE PMAP_TLB
CVS commit: src/sys/net80211
Module Name:src Committed By: maxv Date: Wed Jan 17 17:41:38 UTC 2018 Modified Files: src/sys/net80211: ieee80211_crypto.c ieee80211_crypto_ccmp.c ieee80211_crypto_tkip.c ieee80211_crypto_wep.c Log Message: Style, and fix two pretty bad mistakes in the crypto functions: * They call M_PREPEND, but don't pass the updated pointer back to the caller. * They use memmove on the mbuf data, but they don't ensure that the area they touch is contiguous. This fix is not complete, ieee80211_crypto_encap too needs to pass back the updated pointer. This will be done in another commit. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/net80211/ieee80211_crypto.c cvs rdiff -u -r1.11 -r1.12 src/sys/net80211/ieee80211_crypto_ccmp.c cvs rdiff -u -r1.12 -r1.13 src/sys/net80211/ieee80211_crypto_tkip.c cvs rdiff -u -r1.9 -r1.10 src/sys/net80211/ieee80211_crypto_wep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net80211/ieee80211_crypto.c diff -u src/sys/net80211/ieee80211_crypto.c:1.19 src/sys/net80211/ieee80211_crypto.c:1.20 --- src/sys/net80211/ieee80211_crypto.c:1.19 Tue Jan 16 09:04:30 2018 +++ src/sys/net80211/ieee80211_crypto.c Wed Jan 17 17:41:38 2018 @@ -1,5 +1,6 @@ -/* $NetBSD: ieee80211_crypto.c,v 1.19 2018/01/16 09:04:30 maxv Exp $ */ -/*- +/* $NetBSD: ieee80211_crypto.c,v 1.20 2018/01/17 17:41:38 maxv Exp $ */ + +/* * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting * All rights reserved. @@ -36,7 +37,7 @@ __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto.c,v 1.12 2005/08/08 18:46:35 sam Exp $"); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto.c,v 1.19 2018/01/16 09:04:30 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto.c,v 1.20 2018/01/17 17:41:38 maxv Exp $"); #endif #ifdef _KERNEL_OPT @@ -68,22 +69,22 @@ __KERNEL_RCSID(0, "$NetBSD: ieee80211_cr /* * Table of registered cipher modules. */ -static const struct ieee80211_cipher *ciphers[IEEE80211_CIPHER_MAX]; +static const struct ieee80211_cipher *ciphers[IEEE80211_CIPHER_MAX]; #ifdef INET #include #include #endif -static int _ieee80211_crypto_delkey(struct ieee80211com *, - struct ieee80211_key *); +static int _ieee80211_crypto_delkey(struct ieee80211com *, +struct ieee80211_key *); /* * Default "null" key management routines. */ static int null_key_alloc(struct ieee80211com *ic, const struct ieee80211_key *k, - ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) +ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) { if (!(>ic_nw_keys[0] <= k && k < >ic_nw_keys[IEEE80211_WEP_NKID])) { @@ -106,20 +107,25 @@ null_key_alloc(struct ieee80211com *ic, *rxkeyix = IEEE80211_KEYIX_NONE; /* XXX maybe *keyix? */ return 1; } + static int -null_key_delete(struct ieee80211com *ic, -const struct ieee80211_key *k) +null_key_delete(struct ieee80211com *ic, const struct ieee80211_key *k) { return 1; } -static int -null_key_set(struct ieee80211com *ic, -const struct ieee80211_key *k, + +static int +null_key_set(struct ieee80211com *ic, const struct ieee80211_key *k, const u_int8_t mac[IEEE80211_ADDR_LEN]) { return 1; } -static void null_key_update(struct ieee80211com *ic) {} + +static void +null_key_update(struct ieee80211com *ic) +{ + ; +} /* * Write-arounds for common operations. @@ -134,23 +140,21 @@ cipher_detach(struct ieee80211_key *key) * Wrappers for driver key management methods. */ static __inline int -dev_key_alloc(struct ieee80211com *ic, - const struct ieee80211_key *key, - ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) +dev_key_alloc(struct ieee80211com *ic, const struct ieee80211_key *key, +ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) { return ic->ic_crypto.cs_key_alloc(ic, key, keyix, rxkeyix); } static __inline int -dev_key_delete(struct ieee80211com *ic, - const struct ieee80211_key *key) +dev_key_delete(struct ieee80211com *ic, const struct ieee80211_key *key) { return ic->ic_crypto.cs_key_delete(ic, key); } static __inline int dev_key_set(struct ieee80211com *ic, const struct ieee80211_key *key, - const u_int8_t mac[IEEE80211_ADDR_LEN]) +const u_int8_t mac[IEEE80211_ADDR_LEN]) { return ic->ic_crypto.cs_key_set(ic, key, mac); } @@ -260,8 +264,8 @@ static const char *cipher_modnames[] = { * ieee80211_key_update_end(ic); */ int -ieee80211_crypto_newkey(struct ieee80211com *ic, - int cipher, int flags, struct ieee80211_key *key) +ieee80211_crypto_newkey(struct ieee80211com *ic, int cipher, int flags, +struct ieee80211_key *key) { #define N(a) (sizeof(a) / sizeof(a[0])) const struct ieee80211_cipher *cip; @@ -279,6 +283,7 @@ ieee80211_crypto_newkey(struct ieee80211 return 0; } cip = ciphers[cipher]; + if (cip == NULL) { /* * Auto-load cipher module if we have a
CVS commit: src/doc
Module Name:src Committed By: mlelstv Date: Wed Jan 17 17:22:14 UTC 2018 Modified Files: src/doc: 3RDPARTY Log Message: Track 3rd party firmware in our tree. To generate a diff of this commit: cvs rdiff -u -r1.1493 -r1.1494 src/doc/3RDPARTY Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1493 src/doc/3RDPARTY:1.1494 --- src/doc/3RDPARTY:1.1493 Sun Jan 14 20:07:02 2018 +++ src/doc/3RDPARTY Wed Jan 17 17:22:14 2018 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1493 2018/01/14 20:07:02 christos Exp $ +# $NetBSD: 3RDPARTY,v 1.1494 2018/01/17 17:22:14 mlelstv Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -1726,3 +1726,329 @@ Mailing List: mailto:devicet...@vger.ker Responsible: jmcneill License: GPLv2 and dual GPLv2/X11 license Location: sys/external/gpl2/dts + +Package: iscsi +Version: 4.12.4 +Current Vers: 4.12.4 +Maintainer: Intel Corporation +Archive Site: +Home Page: +Mailing List: +Responsible: +License: BSD-like (4-clause) +Location: external/bsd/iscsi +Notes: + +Package: rpi-firmware +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Broadcom, Raspberry Pi (Trading) Ltd +Responsible: +Location: external/broadcom/rpi-firmware +Notes: + +Package: rtwn +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Realtek Semiconductor Corporation +Responsible: +Location: external/realtek/rtwn +Notes: + +Package: urtwn +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Realtek Semiconductor Corporation +Responsible: +Location: external/realtek/urtwn/ +Notes: + +Package: repulse +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: ALiENDESiGN GbR +Responsible: +Location: sys/arch/amiga/dev/repulse_firmware.h +Notes: + +Package: cxgb +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Chelsio Inc. +Responsible: +Location: sys/dev/pci/cxgb/cxgb_firmware_exports.h +Notes: + +Package: athn +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Atheros Communicatios, Inc. +Responsible: +Location: external/atheros/athn +Notes: + +Package: otus +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Atheros Communicatios, Inc. +Responsible: +Location: external/atheros/otus +Notes: + +Package: intel-fw-eula +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Intel Corporation +Responsible: +Location: external/intel-fw-eula +Notes: + +Package: intel-fw-public +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Intel Corporation +Responsible: +Location: external/intel-fw-public +Notes: + +Package: aic7xxx +Version: +Current Vers: +Maintainer: Justin T. Gibbs +Archive Site: +Home Page: +Mailing List: +License: Adaptec Inc or LGPL2 +Responsible: +Location: sys/dev/microcode/aic7xxx +Notes: + +Package: atmel +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Atmel Corporation +Responsible: +Location: sys/dev/microcode/atmel +Notes: + +Package: bge +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Broadcom Corporation +Responsible: +Location: sys/dev/microcode/bge +Notes: + +Package: bnx +Version: +Current Vers: +Maintainer: David Christensen+Archive Site: +Home Page: +Mailing List: +License: Broadcom Corporation +Responsible: +Location: sys/dev/microcode/bnx +Notes: + +Package: cylades-z +Version: +Current Vers: +Maintainer: Cyclades Corp +Archive Site: +Home Page: +Mailing List: +License: unknown +Responsible: +Location: sys/dev/microcode/cyclades-z +Notes: + +Package: i8255x +Version: 3.28 +Current Vers: +Maintainer: Patrick J Luhmann (PJL) +Archive Site: +Home Page: +Mailing List: +License: Intel Corporation +Responsible: +Location: sys/dev/microcode/i8255x +Notes: + +Package: isp +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: QLogic, Inc. +Responsible: +Location: sys/dev/microcode/isp +Notes: + +Package: radeon +Version: +Current Vers: +Maintainer: +Archive Site: +Home Page: +Mailing List: +License: Advanced Micro Devices, Inc. +Responsible: +Location: sys/dev/microcode/radeon +Notes: + +Package: ral +Version: +Current Vers: +Maintainer: +Archive Site: http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git +Home Page: +Mailing List: +License: Ralink Technology Corp +Responsible: +Location: external/realtek/ral +Notes: + +Package: rum +Version: +Current Vers: +Maintainer: Paul Lin +Archive Site:
CVS commit: src/sys/net80211
Module Name:src Committed By: maxv Date: Wed Jan 17 16:03:16 UTC 2018 Modified Files: src/sys/net80211: ieee80211_input.c Log Message: Several changes: * Style in several places, to make the code more readable or easier to understand. * Instead of checking m->m_pkthdr.len, check m->m_len. m_pkthdr.len is the total size of the packet, not the size of the current mbuf (which may be smaller). * Add a missing length check when handling QoS frames. * Cast the lengths passed in IEEE80211_VERIFY_LENGTH to size_t. * Remove the length check on scan.sp_xrates, that I added yesterday. xrates gets silently truncated in ieee80211_setup_rates(). * Fix several buffer overflows in the parsers of the MANAGEMENT frames. To generate a diff of this commit: cvs rdiff -u -r1.108 -r1.109 src/sys/net80211/ieee80211_input.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net80211/ieee80211_input.c diff -u src/sys/net80211/ieee80211_input.c:1.108 src/sys/net80211/ieee80211_input.c:1.109 --- src/sys/net80211/ieee80211_input.c:1.108 Tue Jan 16 18:53:32 2018 +++ src/sys/net80211/ieee80211_input.c Wed Jan 17 16:03:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211_input.c,v 1.108 2018/01/16 18:53:32 maxv Exp $ */ +/* $NetBSD: ieee80211_input.c,v 1.109 2018/01/17 16:03:16 maxv Exp $ */ /* * Copyright (c) 2001 Atsushi Onoe @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.81 2005/08/10 16:22:29 sam Exp $"); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.108 2018/01/16 18:53:32 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.109 2018/01/17 16:03:16 maxv Exp $"); #endif #ifdef _KERNEL_OPT @@ -354,8 +354,7 @@ ieee80211_input_data(struct ieee80211com * any non-PAE frames received without encryption. */ if ((ic->ic_flags & IEEE80211_F_DROPUNENC) && - key == NULL && - eh->ether_type != htons(ETHERTYPE_PAE)) { + key == NULL && eh->ether_type != htons(ETHERTYPE_PAE)) { /* * Drop unencrypted frames. */ @@ -407,10 +406,9 @@ ieee80211_input_management(struct ieee80 ic->ic_stats.is_rx_wrongdir++; goto err; } - if (m->m_pkthdr.len < sizeof(struct ieee80211_frame)) { - IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_ANY, - ni->ni_macaddr, "mgt", "too short: len %u", - m->m_pkthdr.len); + if (m->m_len < sizeof(struct ieee80211_frame)) { + IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_ANY, ni->ni_macaddr, + "mgt", "too short: len %u", m->m_len); ic->ic_stats.is_rx_tooshort++; goto out; } @@ -542,10 +540,10 @@ ieee80211_input(struct ieee80211com *ic, if (ic->ic_opmode == IEEE80211_M_MONITOR) goto out; - if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { + if (m->m_len < sizeof(struct ieee80211_frame_min)) { IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_ANY, ni->ni_macaddr, NULL, - "too short (1): len %u", m->m_pkthdr.len); + "too short (1): len %u", m->m_len); ic->ic_stats.is_rx_tooshort++; goto out; } @@ -607,11 +605,11 @@ ieee80211_input(struct ieee80211com *ic, else if (type == IEEE80211_FC0_TYPE_CTL) bssid = wh->i_addr1; else { -if (m->m_pkthdr.len < sizeof(struct ieee80211_frame)) { +if (m->m_len < sizeof(struct ieee80211_frame)) { IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_ANY, ni->ni_macaddr, NULL, "too short (2): len %u", - m->m_pkthdr.len); + m->m_len); ic->ic_stats.is_rx_tooshort++; goto out; } @@ -674,7 +672,14 @@ ieee80211_input(struct ieee80211com *ic, if (ieee80211_has_qos(wh)) { struct ieee80211_qosframe *qosf; -/* XXX mbuf length check */ +if (m->m_len < sizeof(struct ieee80211_qosframe)) { + IEEE80211_DISCARD_MAC(ic, + IEEE80211_MSG_ANY, + ni->ni_macaddr, NULL, + "too short (1): len %u", m->m_len); + ic->ic_stats.is_rx_tooshort++; + goto out; +} qosf = mtod(m, struct ieee80211_qosframe *); tid = qosf->i_qos[0] & IEEE80211_QOS_TID; @@ -1089,6 +1094,7 @@ ieee80211_auth_open(struct ieee80211com ni->ni_macaddr, "open auth", "bad sta auth mode %u", ni->ni_authmode); ic->ic_stats.is_rx_bad_auth++; /* XXX */ + if (ic->ic_opmode == IEEE80211_M_HOSTAP) { /* XXX hack to workaround calling convention */ ieee80211_send_error(ic, ni, wh->i_addr2, @@ -1097,6 +1103,7 @@ ieee80211_auth_open(struct ieee80211com } return; } + switch (ic->ic_opmode) { case IEEE80211_M_IBSS: case IEEE80211_M_AHDEMO: @@ -1114,13 +1121,16 @@ ieee80211_auth_open(struct ieee80211com ic->ic_stats.is_rx_bad_auth++; return; } + /* always accept open authentication requests */ if (ni == ic->ic_bss) { ni = ieee80211_dup_bss(>ic_sta, wh->i_addr2); if (ni == NULL) return; - } else if ((ni->ni_flags & IEEE80211_NODE_AREF) == 0) - (void)
CVS commit: src/doc
Module Name:src Committed By: sevan Date: Wed Jan 17 13:52:12 UTC 2018 Modified Files: src/doc: CHANGES Log Message: Note veriexec being enabed by default on macppc port To generate a diff of this commit: cvs rdiff -u -r1.2347 -r1.2348 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2347 src/doc/CHANGES:1.2348 --- src/doc/CHANGES:1.2347 Tue Jan 16 08:37:43 2018 +++ src/doc/CHANGES Wed Jan 17 13:52:12 2018 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2347 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2348 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -101,3 +101,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0: [christos 20180114] cpuctl(8): Add cpuctl identify support for sparc and sparc64. [mrg 20180116] + macppc: Enable Veriexec support in the GENERIC kernel [sevan 20180117]
CVS commit: src/share/man/man8
Module Name:src Committed By: sevan Date: Wed Jan 17 12:49:06 UTC 2018 Modified Files: src/share/man/man8: veriexec.8 Log Message: Note fileassoc(9) support is a dependency Veriexec. Resolves PR kern/52909 To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/share/man/man8/veriexec.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man8/veriexec.8 diff -u src/share/man/man8/veriexec.8:1.7 src/share/man/man8/veriexec.8:1.8 --- src/share/man/man8/veriexec.8:1.7 Wed Sep 13 22:24:42 2017 +++ src/share/man/man8/veriexec.8 Wed Jan 17 12:49:06 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: veriexec.8,v 1.7 2017/09/13 22:24:42 sevan Exp $ +.\" $NetBSD: veriexec.8,v 1.8 2018/01/17 12:49:06 sevan Exp $ .\" .\" Copyright (c) 2008 Elad Efrat.\" All rights reserved. @@ -65,8 +65,11 @@ below), this list can be loaded manually .Ed .Ss Kernel Configuration .Em Veriexec -requires a pseudo-device to run: +requires a kernel with +.Xr fileassoc 9 +support and a pseudo-device to run: .Bd -literal -offset indent +options FILEASSOC pseudo-device veriexec .Ed .Pp
CVS commit: src
Module Name:src Committed By: sevan Date: Wed Jan 17 12:41:48 UTC 2018 Modified Files: src/share/man/man4: veriexec.4 src/sys/arch/macppc/conf: GENERIC Log Message: Enable veriexec(4) support by default on the macppc port and update the manual to mention it. Closes PR port-powerpc/52908 To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/share/man/man4/veriexec.4 cvs rdiff -u -r1.337 -r1.338 src/sys/arch/macppc/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/veriexec.4 diff -u src/share/man/man4/veriexec.4:1.25 src/share/man/man4/veriexec.4:1.26 --- src/share/man/man4/veriexec.4:1.25 Wed Aug 30 05:47:24 2017 +++ src/share/man/man4/veriexec.4 Wed Jan 17 12:41:48 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: veriexec.4,v 1.25 2017/08/30 05:47:24 wiz Exp $ +.\" $NetBSD: veriexec.4,v 1.26 2018/01/17 12:41:48 sevan Exp $ .\" .\" Copyright 2005 Elad Efrat.\" Copyright 2005 Brett Lymn @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 30, 2017 +.Dd January 17, 2018 .Dt VERIEXEC 4 .Os .Sh NAME @@ -153,7 +153,7 @@ are not permitted once the strict level .Sh NOTES .Nm is part of the default configuration on the following architectures: amd64, -i386, prep, sparc64. +i386, macppc, prep, sparc64. .Sh AUTHORS .An Brett Lymn Aq Mt bl...@netbsd.org .An Elad Efrat Aq Mt e...@netbsd.org Index: src/sys/arch/macppc/conf/GENERIC diff -u src/sys/arch/macppc/conf/GENERIC:1.337 src/sys/arch/macppc/conf/GENERIC:1.338 --- src/sys/arch/macppc/conf/GENERIC:1.337 Wed Dec 27 18:30:02 2017 +++ src/sys/arch/macppc/conf/GENERIC Wed Jan 17 12:41:48 2018 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.337 2017/12/27 18:30:02 sevan Exp $ +# $NetBSD: GENERIC,v 1.338 2018/01/17 12:41:48 sevan Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/macppc/conf/std.macppc" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.337 $" +#ident "GENERIC-$Revision: 1.338 $" maxusers 32 @@ -650,17 +650,19 @@ pseudo-device putter # for puffs and p # userland interface to drivers, including autoconf and properties retrieval pseudo-device drvctl +options FILEASSOC # fileassoc(9) - needed by Veriexec + # Veriexec # # a pseudo device needed for veriexec -#pseudo-device veriexec +pseudo-device veriexec # # Uncomment the fingerprint methods below that are desired. Note that # removing fingerprint methods will have almost no impact on the kernel # code size. # -#options VERIFIED_EXEC_FP_SHA256 -#options VERIFIED_EXEC_FP_SHA384 -#options VERIFIED_EXEC_FP_SHA512 +options VERIFIED_EXEC_FP_SHA256 +options VERIFIED_EXEC_FP_SHA384 +options VERIFIED_EXEC_FP_SHA512 #options PAX_MPROTECT=0 # PaX mprotect(2) restrictions
CVS commit: src/share/man/man9
Module Name:src Committed By: uwe Date: Wed Jan 17 08:34:15 UTC 2018 Modified Files: src/share/man/man9: pfil.9 Log Message: Use more semantic markup. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/share/man/man9/pfil.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/pfil.9 diff -u src/share/man/man9/pfil.9:1.37 src/share/man/man9/pfil.9:1.38 --- src/share/man/man9/pfil.9:1.37 Wed Jan 17 04:31:59 2018 +++ src/share/man/man9/pfil.9 Wed Jan 17 08:34:15 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: pfil.9,v 1.37 2018/01/17 04:31:59 pgoyette Exp $ +.\" $NetBSD: pfil.9,v 1.38 2018/01/17 08:34:15 uwe Exp $ .\" .\" Copyright (c) 1996 Matthew R. Green .\" All rights reserved. @@ -82,16 +82,20 @@ transformations. .Pp Packet filtering points are registered with .Fn pfil_head_register . -Filtering points are identified by a key (void *) and a data link type -(int) in the -.Em pfil_head +Filtering points are identified by a key +.Vt ( void * ) +and a data link type +.Vt ( int ) +in the +.Vt pfil_head structure. Packet filters use the key and data link type to look up the filtering point with which they register themselves. The key is unique to the filtering point. The data link type is a .Xr bpf 4 -DLT constant indicating what kind of header is present on the packet +.Dv DLT_ Ns Ar type +constant indicating what kind of header is present on the packet at the filtering point. Filtering points may be unregistered with the .Fn pfil_head_unregister @@ -120,26 +124,29 @@ interface that the packet is traversing, or .Dv PFIL_OUT , see also below) that the packet is traveling. -The filter may change which mbuf the mbuf ** argument references. +The filter may change which mbuf the +.Vt "mbuf **" +argument references. The filter returns an errno if the packet processing is to stop, or 0 if the processing is to continue. If the packet processing is to stop, it is the responsibility of the filter to free the packet. .Pp The -.Em flags +.Fa flags parameter, used in the .Fn pfil_add_hook and .Fn pfil_remove_hook functions, indicates when the filter should be called. The flags are: -.Bl -tag -offset indent -width PFIL_ALL -compact -.It PFIL_IN +.Pp +.Bl -tag -offset indent -width ".Dv PFIL_ALL" -compact +.It Dv PFIL_IN call me on incoming packets -.It PFIL_OUT +.It Dv PFIL_OUT call me on outgoing packets -.It PFIL_ALL +.It Dv PFIL_ALL call me on all of the above .El .Pp @@ -158,18 +165,23 @@ see also below) or ioctl number, and the to the network interface or the pointer to the ifaddr. .Pp The -.Em flags +.Fa flags parameter, used in the .Fn pfil_add_ihook and .Fn pfil_remove_ihook functions, indicates when the filter should be called. The flags are: -.Bl -tag -offset indent -width PFIL_IFADDR -compact -.It PFIL_IFADDR -call me on interface reconfig (cmd is ioctl #) -.It PFIL_IFNET -call me on interface attach/detach (cmd is either +.Pp +.Bl -tag -offset indent -width ".Dv PFIL_IFADDR" -compact +.It Dv PFIL_IFADDR +call me on interface reconfig +.Fa ( cmd +is ioctl #) +.It Dv PFIL_IFNET +call me on interface attach/detach +.Fa ( cmd +is either .Dv PFIL_IFNET_ATTACH or .Dv PFIL_IFNET_DETACH ) @@ -212,7 +224,8 @@ as well as be less IP-centric. .Fn pfil_add_ihook and .Fn pfil_remove_ihook -were added in 8.0. +were added in +.Nx 8.0 . .Sh AUTHORS .An -nosplit The