fix misspellings of 'available' and nearby typosdiff -r1.6 -r1.7 src/lib/libdm/dm.3
(rillig)
--- src/lib/libdm/dm.3 2016/01/22 22:12:40 1.6
+++ src/lib/libdm/dm.3 2022/09/10 12:14:17 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | .\" $NetBSD: dm.3,v 1.6 2016/01/22 22:12:40 dholland Exp $ | 1 | .\" $NetBSD: dm.3,v 1.7 2022/09/10 12:14:17 rillig Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2004,2009 The NetBSD Foundation, Inc. | 3 | .\" Copyright (c) 2004,2009 The NetBSD Foundation, Inc. | |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | 6 | .\" This code is derived from software contributed to The NetBSD Foundation | |
7 | .\" by Adam Hamsik. | 7 | .\" by Adam Hamsik. | |
8 | .\" | 8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | 9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | 10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | 11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | 12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | 13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
@@ -161,27 +161,27 @@ libdm_task_t is not created and the func | @@ -161,27 +161,27 @@ libdm_task_t is not created and the func | |||
161 | .Dv NULL . | 161 | .Dv NULL . | |
162 | .Pp | 162 | .Pp | |
163 | .Fn libdm_task_destroy | 163 | .Fn libdm_task_destroy | |
164 | free all memory allocated to | 164 | free all memory allocated to | |
165 | .Fa libdm_task | 165 | .Fa libdm_task | |
166 | by | 166 | by | |
167 | .Fn libdm_task_create . | 167 | .Fn libdm_task_create . | |
168 | .Pp | 168 | .Pp | |
169 | .Fn libdm_task_run | 169 | .Fn libdm_task_run | |
170 | Sends created | 170 | Sends created | |
171 | .Fa libdm_task | 171 | .Fa libdm_task | |
172 | to kernel and receives new one as reply. | 172 | to kernel and receives new one as reply. | |
173 | .Pp | 173 | .Pp | |
174 | List of attributes avaialable in | 174 | List of attributes available in | |
175 | .Vt libdm_task_t : | 175 | .Vt libdm_task_t : | |
176 | .Bl -column -offset indent "DM_IOCTL_TARGET_COUNT" "Number of table entries" "XXX" | 176 | .Bl -column -offset indent "DM_IOCTL_TARGET_COUNT" "Number of table entries" "XXX" | |
177 | .It Sy Attribute Ta Sy Description Ta Sy Mode | 177 | .It Sy Attribute Ta Sy Description Ta Sy Mode | |
178 | .It Li DM_IOCTL_OPEN Ta Device open-count Ta Read-Only | 178 | .It Li DM_IOCTL_OPEN Ta Device open-count Ta Read-Only | |
179 | .It Li DM_IOCTL_MINOR Ta Device minor number Ta Read-Write | 179 | .It Li DM_IOCTL_MINOR Ta Device minor number Ta Read-Write | |
180 | .It Li DM_IOCTL_NAME Ta Device name Ta Read-Write | 180 | .It Li DM_IOCTL_NAME Ta Device name Ta Read-Write | |
181 | .It Li DM_IOCTL_UUID Ta Device uuid Ta Read-Write | 181 | .It Li DM_IOCTL_UUID Ta Device uuid Ta Read-Write | |
182 | .It Li DM_IOCTL_TARGET_COUNT Ta Number of table entries Ta Read-Only | 182 | .It Li DM_IOCTL_TARGET_COUNT Ta Number of table entries Ta Read-Only | |
183 | .\".It Li DM_IOCTL_EVENT Ta Not implemented Ta not imp | 183 | .\".It Li DM_IOCTL_EVENT Ta Not implemented Ta not imp | |
184 | .It Li DM_IOCTL_FLAGS Ta Device status flags Ta Read-Write | 184 | .It Li DM_IOCTL_FLAGS Ta Device status flags Ta Read-Write | |
185 | .El | 185 | .El | |
186 | .Pp | 186 | .Pp | |
187 | .Fn libdm_task_set_name | 187 | .Fn libdm_task_set_name | |
@@ -346,27 +346,27 @@ Get routine will get the table parameter | @@ -346,27 +346,27 @@ Get routine will get the table parameter | |||
346 | .Pp | 346 | .Pp | |
347 | .Fn libdm_table_get_status | 347 | .Fn libdm_table_get_status | |
348 | Get table status which can be Active/Inactive. | 348 | Get table status which can be Active/Inactive. | |
349 | This tells if this table is actually used or not. | 349 | This tells if this table is actually used or not. | |
350 | .Ss LIBDM_TARGET | 350 | .Ss LIBDM_TARGET | |
351 | .Fn libdm_target_destroy | 351 | .Fn libdm_target_destroy | |
352 | Destroy target received from | 352 | Destroy target received from | |
353 | .Vt libdm_cmd | 353 | .Vt libdm_cmd | |
354 | with libdm_cmd_iter iterator. | 354 | with libdm_cmd_iter iterator. | |
355 | .Pp | 355 | .Pp | |
356 | .Fn libdm_target_get_name | 356 | .Fn libdm_target_get_name | |
357 | returns pointer to a string with available target name. | 357 | returns pointer to a string with available target name. | |
358 | .Pp | 358 | .Pp | |
359 | .Fn lobdm_target_get_version | 359 | .Fn libdm_target_get_version | |
360 | Sets argument | 360 | Sets argument | |
361 | .Fa ver[3] | 361 | .Fa ver[3] | |
362 | to a in-kernel loaded target version. | 362 | to a in-kernel loaded target version. | |
363 | .Ss LIBDM_DEV | 363 | .Ss LIBDM_DEV | |
364 | .Fn libdm_dev_destroy | 364 | .Fn libdm_dev_destroy | |
365 | Destroy device received from | 365 | Destroy device received from | |
366 | .Vt libdm_cmd | 366 | .Vt libdm_cmd | |
367 | with libdm_cmd_iter iterator. | 367 | with libdm_cmd_iter iterator. | |
368 | .Pp | 368 | .Pp | |
369 | .Fn libdm_dev_get_name | 369 | .Fn libdm_dev_get_name | |
370 | Return pointer to a string with underlying device name from | 370 | Return pointer to a string with underlying device name from | |
371 | .Vt libdm_dev_t | 371 | .Vt libdm_dev_t | |
372 | .Pp | 372 | .Pp |
--- src/share/man/man3lua/netpgp.3lua 2018/04/30 07:10:04 1.2
+++ src/share/man/man3lua/netpgp.3lua 2022/09/10 12:14:17 1.3
--- src/sys/arch/aarch64/include/cpufunc.h 2022/07/20 01:35:25 1.24
+++ src/sys/arch/aarch64/include/cpufunc.h 2022/09/10 12:14:17 1.25
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: cpufunc.h,v 1.24 2022/07/20 01:35:25 riastradh Exp $ */ | 1 | /* $NetBSD: cpufunc.h,v 1.25 2022/09/10 12:14:17 rillig Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2017 Ryo Shimizu <ryo@nerv.org> | 4 | * Copyright (c) 2017 Ryo Shimizu <ryo@nerv.org> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -127,27 +127,27 @@ cpu_clusterid(void) | @@ -127,27 +127,27 @@ cpu_clusterid(void) | |||
127 | 127 | |||
128 | return __SHIFTOUT(reg_mpidr_el1_read(), MPIDR_AFF1); | 128 | return __SHIFTOUT(reg_mpidr_el1_read(), MPIDR_AFF1); | |
129 | } | 129 | } | |
130 | 130 | |||
131 | static inline bool | 131 | static inline bool | |
132 | cpu_earlydevice_va_p(void) | 132 | cpu_earlydevice_va_p(void) | |
133 | { | 133 | { | |
134 | extern bool pmap_devmap_bootstrap_done; /* in pmap.c */ | 134 | extern bool pmap_devmap_bootstrap_done; /* in pmap.c */ | |
135 | 135 | |||
136 | /* This function may be called before enabling MMU, or mapping KVA */ | 136 | /* This function may be called before enabling MMU, or mapping KVA */ | |
137 | if ((reg_sctlr_el1_read() & SCTLR_M) == 0) | 137 | if ((reg_sctlr_el1_read() & SCTLR_M) == 0) | |
138 | return false; | 138 | return false; | |
139 | 139 | |||
140 | /* device mapping will be availabled after pmap_devmap_bootstrap() */ | 140 | /* device mapping will be available after pmap_devmap_bootstrap() */ | |
141 | if (!pmap_devmap_bootstrap_done) | 141 | if (!pmap_devmap_bootstrap_done) | |
142 | return false; | 142 | return false; | |
143 | 143 | |||
144 | return true; | 144 | return true; | |
145 | } | 145 | } | |
146 | 146 | |||
147 | #endif /* _KERNEL */ | 147 | #endif /* _KERNEL */ | |
148 | 148 | |||
149 | /* definitions of TAG and PAC in pointers */ | 149 | /* definitions of TAG and PAC in pointers */ | |
150 | #define AARCH64_ADDRTOP_TAG_BIT 55 | 150 | #define AARCH64_ADDRTOP_TAG_BIT 55 | |
151 | #define AARCH64_ADDRTOP_TAG __BIT(55) /* ECR_EL1.TBI[01]=1 */ | 151 | #define AARCH64_ADDRTOP_TAG __BIT(55) /* ECR_EL1.TBI[01]=1 */ | |
152 | #define AARCH64_ADDRTOP_MSB __BIT(63) /* ECR_EL1.TBI[01]=0 */ | 152 | #define AARCH64_ADDRTOP_MSB __BIT(63) /* ECR_EL1.TBI[01]=0 */ | |
153 | #define AARCH64_ADDRESS_TAG_MASK __BITS(63,56) /* if TCR.TBI[01]=1 */ | 153 | #define AARCH64_ADDRESS_TAG_MASK __BITS(63,56) /* if TCR.TBI[01]=1 */ |
--- src/sys/arch/i386/stand/lib/bios_disk.S 2014/07/19 14:50:21 1.22
+++ src/sys/arch/i386/stand/lib/bios_disk.S 2022/09/10 12:14:17 1.23
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: bios_disk.S,v 1.22 2014/07/19 14:50:21 erh Exp $ */ | 1 | /* $NetBSD: bios_disk.S,v 1.23 2022/09/10 12:14:17 rillig Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Ported to boot 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 | 4 | * Ported to boot 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 | |
5 | * | 5 | * | |
6 | * Mach Operating System | 6 | * Mach Operating System | |
7 | * Copyright (c) 1992, 1991 Carnegie Mellon University | 7 | * Copyright (c) 1992, 1991 Carnegie Mellon University | |
8 | * All Rights Reserved. | 8 | * All Rights Reserved. | |
9 | * | 9 | * | |
10 | * Permission to use, copy, modify and distribute this software and its | 10 | * Permission to use, copy, modify and distribute this software and its | |
11 | * documentation is hereby granted, provided that both the copyright | 11 | * documentation is hereby granted, provided that both the copyright | |
12 | * notice and this permission notice appear in all copies of the | 12 | * notice and this permission notice appear in all copies of the | |
13 | * software, derivative works or modified versions, and any portions | 13 | * software, derivative works or modified versions, and any portions | |
14 | * thereof, and that both notices appear in supporting documentation. | 14 | * thereof, and that both notices appear in supporting documentation. | |
@@ -187,27 +187,27 @@ ok: | @@ -187,27 +187,27 @@ ok: | |||
187 | shll $24, %eax | 187 | shll $24, %eax | |
188 | shll $16, %ecx # do the same for %ecx | 188 | shll $16, %ecx # do the same for %ecx | |
189 | shrl $8, %ecx | 189 | shrl $8, %ecx | |
190 | movb %dh, %cl # max head | 190 | movb %dh, %cl # max head | |
191 | orl %ecx, %eax # return value in %eax | 191 | orl %ecx, %eax # return value in %eax | |
192 | movl %eax, 28(%esp) | 192 | movl %eax, 28(%esp) | |
193 | 193 | |||
194 | popa | 194 | popa | |
195 | pop %es | 195 | pop %es | |
196 | ret | 196 | ret | |
197 | 197 | |||
198 | /* | 198 | /* | |
199 | * int biosdisk_int13ext(int dev): | 199 | * int biosdisk_int13ext(int dev): | |
200 | * check for availibility of int13 extensions. | 200 | * check for availability of int13 extensions. | |
201 | */ | 201 | */ | |
202 | ENTRY(biosdisk_int13ext) | 202 | ENTRY(biosdisk_int13ext) | |
203 | pusha | 203 | pusha | |
204 | 204 | |||
205 | movb %al, %dl # drive # | 205 | movb %al, %dl # drive # | |
206 | movw $0x55aa, %bx | 206 | movw $0x55aa, %bx | |
207 | 207 | |||
208 | call _C_LABEL(prot_to_real) # enter real mode | 208 | call _C_LABEL(prot_to_real) # enter real mode | |
209 | .code16 | 209 | .code16 | |
210 | 210 | |||
211 | movb $0x41, %ah # ask for disk info | 211 | movb $0x41, %ah # ask for disk info | |
212 | int $0x13 | 212 | int $0x13 | |
213 | setnc %dl | 213 | setnc %dl |
--- src/sys/opencrypto/cryptodev.c 2022/05/22 11:40:38 1.124
+++ src/sys/opencrypto/cryptodev.c 2022/09/10 12:14:17 1.125
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: cryptodev.c,v 1.124 2022/05/22 11:40:38 riastradh Exp $ */ | 1 | /* $NetBSD: cryptodev.c,v 1.125 2022/09/10 12:14:17 rillig Exp $ */ | |
2 | /* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */ | 2 | /* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */ | |
3 | /* $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $ */ | 3 | /* $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $ */ | |
4 | 4 | |||
5 | /*- | 5 | /*- | |
6 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 6 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
8 | * | 8 | * | |
9 | * This code is derived from software contributed to The NetBSD Foundation | 9 | * This code is derived from software contributed to The NetBSD Foundation | |
10 | * by Coyote Point Systems, Inc. | 10 | * by Coyote Point Systems, Inc. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -54,27 +54,27 @@ | @@ -54,27 +54,27 @@ | |||
54 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 54 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
55 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 55 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
56 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 56 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
57 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 57 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
58 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 58 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
59 | * | 59 | * | |
60 | * Effort sponsored in part by the Defense Advanced Research Projects | 60 | * Effort sponsored in part by the Defense Advanced Research Projects | |
61 | * Agency (DARPA) and Air Force Research Laboratory, Air Force | 61 | * Agency (DARPA) and Air Force Research Laboratory, Air Force | |
62 | * Materiel Command, USAF, under agreement number F30602-01-2-0537. | 62 | * Materiel Command, USAF, under agreement number F30602-01-2-0537. | |
63 | * | 63 | * | |
64 | */ | 64 | */ | |
65 | 65 | |||
66 | #include <sys/cdefs.h> | 66 | #include <sys/cdefs.h> | |
67 | __KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.124 2022/05/22 11:40:38 riastradh Exp $"); | 67 | __KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.125 2022/09/10 12:14:17 rillig Exp $"); | |
68 | 68 | |||
69 | #include <sys/param.h> | 69 | #include <sys/param.h> | |
70 | #include <sys/systm.h> | 70 | #include <sys/systm.h> | |
71 | #include <sys/kmem.h> | 71 | #include <sys/kmem.h> | |
72 | #include <sys/malloc.h> | 72 | #include <sys/malloc.h> | |
73 | #include <sys/mbuf.h> | 73 | #include <sys/mbuf.h> | |
74 | #include <sys/pool.h> | 74 | #include <sys/pool.h> | |
75 | #include <sys/sysctl.h> | 75 | #include <sys/sysctl.h> | |
76 | #include <sys/file.h> | 76 | #include <sys/file.h> | |
77 | #include <sys/filedesc.h> | 77 | #include <sys/filedesc.h> | |
78 | #include <sys/errno.h> | 78 | #include <sys/errno.h> | |
79 | #include <sys/md5.h> | 79 | #include <sys/md5.h> | |
80 | #include <sys/sha1.h> | 80 | #include <sys/sha1.h> | |
@@ -1717,28 +1717,28 @@ cryptodev_msessionfin(struct fcrypt *fcr | @@ -1717,28 +1717,28 @@ cryptodev_msessionfin(struct fcrypt *fcr | |||
1717 | for(req = 0; req < count; req++) { | 1717 | for(req = 0; req < count; req++) { | |
1718 | cse = csefind(fcr, sesid[req]); | 1718 | cse = csefind(fcr, sesid[req]); | |
1719 | if (cse == NULL) | 1719 | if (cse == NULL) | |
1720 | continue; | 1720 | continue; | |
1721 | csedelete(fcr, cse); | 1721 | csedelete(fcr, cse); | |
1722 | mutex_exit(&cryptodev_mtx); | 1722 | mutex_exit(&cryptodev_mtx); | |
1723 | csefree(cse); | 1723 | csefree(cse); | |
1724 | mutex_enter(&cryptodev_mtx); | 1724 | mutex_enter(&cryptodev_mtx); | |
1725 | } | 1725 | } | |
1726 | mutex_exit(&cryptodev_mtx); | 1726 | mutex_exit(&cryptodev_mtx); | |
1727 | } | 1727 | } | |
1728 | 1728 | |||
1729 | /* | 1729 | /* | |
1730 | * collect as many completed requests as are availble, or count completed | 1730 | * collect as many completed requests as are available, or count completed | |
1731 | * requests whichever is less. | 1731 | * requests, whichever is less. | |
1732 | * return the number of requests. | 1732 | * return the number of requests. | |
1733 | */ | 1733 | */ | |
1734 | static int | 1734 | static int | |
1735 | cryptodev_getmstatus(struct fcrypt *fcr, struct crypt_result *crypt_res, | 1735 | cryptodev_getmstatus(struct fcrypt *fcr, struct crypt_result *crypt_res, | |
1736 | int count) | 1736 | int count) | |
1737 | { | 1737 | { | |
1738 | struct cryptop *crp = NULL; | 1738 | struct cryptop *crp = NULL; | |
1739 | struct cryptkop *krp = NULL; | 1739 | struct cryptkop *krp = NULL; | |
1740 | struct csession *cse; | 1740 | struct csession *cse; | |
1741 | int i, size, req = 0; | 1741 | int i, size, req = 0; | |
1742 | int completed=0; | 1742 | int completed=0; | |
1743 | 1743 | |||
1744 | /* On queue so nobody else can grab them | 1744 | /* On queue so nobody else can grab them |
--- src/tests/net/bpf/t_bpf.c 2017/02/09 02:18:13 1.8
+++ src/tests/net/bpf/t_bpf.c 2022/09/10 12:14:18 1.9
@@ -1,41 +1,41 @@ | @@ -1,41 +1,41 @@ | |||
1 | /* $NetBSD: t_bpf.c,v 1.8 2017/02/09 02:18:13 ozaki-r Exp $ */ | 1 | /* $NetBSD: t_bpf.c,v 1.9 2022/09/10 12:14:18 rillig Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2010 Antti Kantee. All Rights Reserved. | 4 | * Copyright (c) 2010 Antti Kantee. All Rights Reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * | 14 | * | |
15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS | 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS | |
16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | * SUCH DAMAGE. | 25 | * SUCH DAMAGE. | |
26 | */ | 26 | */ | |
27 | #include <sys/cdefs.h> | 27 | #include <sys/cdefs.h> | |
28 | __RCSID("$NetBSD: t_bpf.c,v 1.8 2017/02/09 02:18:13 ozaki-r Exp $"); | 28 | __RCSID("$NetBSD: t_bpf.c,v 1.9 2022/09/10 12:14:18 rillig Exp $"); | |
29 | 29 | |||
30 | #include <sys/param.h> | 30 | #include <sys/param.h> | |
31 | #include <sys/ioctl.h> | 31 | #include <sys/ioctl.h> | |
32 | #include <sys/socket.h> | 32 | #include <sys/socket.h> | |
33 | #include <sys/mbuf.h> | 33 | #include <sys/mbuf.h> | |
34 | #include <sys/sysctl.h> | 34 | #include <sys/sysctl.h> | |
35 | #include <sys/mman.h> | 35 | #include <sys/mman.h> | |
36 | #include <unistd.h> | 36 | #include <unistd.h> | |
37 | 37 | |||
38 | #include <net/if.h> | 38 | #include <net/if.h> | |
39 | #include <net/bpf.h> | 39 | #include <net/bpf.h> | |
40 | #include <net/dlt.h> | 40 | #include <net/dlt.h> | |
41 | 41 | |||
@@ -301,40 +301,40 @@ ATF_TC_BODY(bpf_ioctl_GDLTLIST, tc) | @@ -301,40 +301,40 @@ ATF_TC_BODY(bpf_ioctl_GDLTLIST, tc) | |||
301 | 301 | |||
302 | RZ(rump_init()); | 302 | RZ(rump_init()); | |
303 | RL(bpfd = rump_sys_open("/dev/bpf", O_RDWR)); | 303 | RL(bpfd = rump_sys_open("/dev/bpf", O_RDWR)); | |
304 | RZ(rump_pub_shmif_create(NULL, &ifnum)); | 304 | RZ(rump_pub_shmif_create(NULL, &ifnum)); | |
305 | sprintf(ifr.ifr_name, "shmif%d", ifnum); | 305 | sprintf(ifr.ifr_name, "shmif%d", ifnum); | |
306 | 306 | |||
307 | dltlist.bfl_len = 0; | 307 | dltlist.bfl_len = 0; | |
308 | dltlist.bfl_list = NULL; | 308 | dltlist.bfl_list = NULL; | |
309 | ATF_REQUIRE_EQ_MSG(rump_sys_ioctl(bpfd, BIOCGDLTLIST, &dltlist), -1, | 309 | ATF_REQUIRE_EQ_MSG(rump_sys_ioctl(bpfd, BIOCGDLTLIST, &dltlist), -1, | |
310 | "Don't allow to get a DLT list without interfaces"); | 310 | "Don't allow to get a DLT list without interfaces"); | |
311 | 311 | |||
312 | RL(rump_sys_ioctl(bpfd, BIOCSETIF, &ifr)); | 312 | RL(rump_sys_ioctl(bpfd, BIOCSETIF, &ifr)); | |
313 | 313 | |||
314 | /* Get the size of an avaiable DLT list */ | 314 | /* Get the size of an available DLT list */ | |
315 | dltlist.bfl_len = 0; | 315 | dltlist.bfl_len = 0; | |
316 | dltlist.bfl_list = NULL; | 316 | dltlist.bfl_list = NULL; | |
317 | RL(rump_sys_ioctl(bpfd, BIOCGDLTLIST, &dltlist)); | 317 | RL(rump_sys_ioctl(bpfd, BIOCGDLTLIST, &dltlist)); | |
318 | ATF_REQUIRE(dltlist.bfl_len == 1); | 318 | ATF_REQUIRE(dltlist.bfl_len == 1); | |
319 | 319 | |||
320 | /* Get an avaiable DLT list */ | 320 | /* Get an available DLT list */ | |
321 | dltlist.bfl_list = calloc(sizeof(u_int), 1); | 321 | dltlist.bfl_list = calloc(sizeof(u_int), 1); | |
322 | dltlist.bfl_len = 1; | 322 | dltlist.bfl_len = 1; | |
323 | RL(rump_sys_ioctl(bpfd, BIOCGDLTLIST, &dltlist)); | 323 | RL(rump_sys_ioctl(bpfd, BIOCGDLTLIST, &dltlist)); | |
324 | ATF_REQUIRE(dltlist.bfl_len == 1); | 324 | ATF_REQUIRE(dltlist.bfl_len == 1); | |
325 | ATF_REQUIRE(dltlist.bfl_list[0] == DLT_EN10MB); | 325 | ATF_REQUIRE(dltlist.bfl_list[0] == DLT_EN10MB); | |
326 | 326 | |||
327 | /* Get an avaiable DLT list with a less buffer (fake with bfl_len) */ | 327 | /* Get an available DLT list with a less buffer (fake with bfl_len) */ | |
328 | dltlist.bfl_len = 0; | 328 | dltlist.bfl_len = 0; | |
329 | ATF_REQUIRE_EQ_MSG(rump_sys_ioctl(bpfd, BIOCGDLTLIST, &dltlist), -1, | 329 | ATF_REQUIRE_EQ_MSG(rump_sys_ioctl(bpfd, BIOCGDLTLIST, &dltlist), -1, | |
330 | "This should fail with ENOMEM"); | 330 | "This should fail with ENOMEM"); | |
331 | 331 | |||
332 | free(dltlist.bfl_list); | 332 | free(dltlist.bfl_list); | |
333 | } | 333 | } | |
334 | 334 | |||
335 | ATF_TP_ADD_TCS(tp) | 335 | ATF_TP_ADD_TCS(tp) | |
336 | { | 336 | { | |
337 | 337 | |||
338 | ATF_TP_ADD_TC(tp, bpfwriteleak); | 338 | ATF_TP_ADD_TC(tp, bpfwriteleak); | |
339 | #if (SIZE_MAX > UINT_MAX) | 339 | #if (SIZE_MAX > UINT_MAX) | |
340 | ATF_TP_ADD_TC(tp, bpfwritetrunc); | 340 | ATF_TP_ADD_TC(tp, bpfwritetrunc); |
--- src/usr.sbin/bootp/bootptest/print-bootp.c 2021/12/12 22:20:52 1.12
+++ src/usr.sbin/bootp/bootptest/print-bootp.c 2022/09/10 12:14:18 1.13
@@ -16,27 +16,27 @@ | @@ -16,27 +16,27 @@ | |||
16 | * written permission. | 16 | * written permission. | |
17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED | 17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED | |
18 | * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | 18 | * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | |
19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
20 | * | 20 | * | |
21 | * Format and print bootp packets. | 21 | * Format and print bootp packets. | |
22 | * | 22 | * | |
23 | * This file was copied from tcpdump-2.1.1 and modified. | 23 | * This file was copied from tcpdump-2.1.1 and modified. | |
24 | * There is an e-mail list for tcpdump: <tcpdump@ee.lbl.gov> | 24 | * There is an e-mail list for tcpdump: <tcpdump@ee.lbl.gov> | |
25 | */ | 25 | */ | |
26 | 26 | |||
27 | #include <sys/cdefs.h> | 27 | #include <sys/cdefs.h> | |
28 | #ifndef lint | 28 | #ifndef lint | |
29 | __RCSID("$NetBSD: print-bootp.c,v 1.12 2021/12/12 22:20:52 andvar Exp $"); | 29 | __RCSID("$NetBSD: print-bootp.c,v 1.13 2022/09/10 12:14:18 rillig Exp $"); | |
30 | /* 93/10/10 <gwr@mc.com> New data-driven option print routine. */ | 30 | /* 93/10/10 <gwr@mc.com> New data-driven option print routine. */ | |
31 | #endif | 31 | #endif | |
32 | 32 | |||
33 | #include <stdio.h> | 33 | #include <stdio.h> | |
34 | 34 | |||
35 | #include <sys/param.h> | 35 | #include <sys/param.h> | |
36 | #include <sys/types.h> | 36 | #include <sys/types.h> | |
37 | #include <sys/socket.h> | 37 | #include <sys/socket.h> | |
38 | #include <net/if.h> | 38 | #include <net/if.h> | |
39 | #include <netinet/in.h> | 39 | #include <netinet/in.h> | |
40 | #include <string.h> | 40 | #include <string.h> | |
41 | #include <strings.h> | 41 | #include <strings.h> | |
42 | #include <ctype.h> | 42 | #include <ctype.h> | |
@@ -58,27 +58,27 @@ bootp_print(struct bootp *bp, int length | @@ -58,27 +58,27 @@ bootp_print(struct bootp *bp, int length | |||
58 | { | 58 | { | |
59 | static char tstr[] = " [|bootp]"; | 59 | static char tstr[] = " [|bootp]"; | |
60 | static unsigned char vm_cmu[4] = VM_CMU; | 60 | static unsigned char vm_cmu[4] = VM_CMU; | |
61 | static unsigned char vm_rfc1048[4] = VM_RFC1048; | 61 | static unsigned char vm_rfc1048[4] = VM_RFC1048; | |
62 | u_char *ep; | 62 | u_char *ep; | |
63 | int vdlen; | 63 | int vdlen; | |
64 | 64 | |||
65 | #define TCHECK(var, l) if ((u_char *)&(var) > ep - l) goto trunc | 65 | #define TCHECK(var, l) if ((u_char *)&(var) > ep - l) goto trunc | |
66 | 66 | |||
67 | /* Note funny sized packets */ | 67 | /* Note funny sized packets */ | |
68 | if (length != sizeof(struct bootp)) | 68 | if (length != sizeof(struct bootp)) | |
69 | (void) printf(" [len=%d]", length); | 69 | (void) printf(" [len=%d]", length); | |
70 | 70 | |||
71 | /* 'ep' points to the end of avaible data. */ | 71 | /* 'ep' points to the end of available data. */ | |
72 | ep = (u_char *) snapend; | 72 | ep = (u_char *) snapend; | |
73 | 73 | |||
74 | switch (bp->bp_op) { | 74 | switch (bp->bp_op) { | |
75 | 75 | |||
76 | case BOOTREQUEST: | 76 | case BOOTREQUEST: | |
77 | /* Usually, a request goes from a client to a server */ | 77 | /* Usually, a request goes from a client to a server */ | |
78 | if (sport != IPPORT_BOOTPC || dport != IPPORT_BOOTPS) | 78 | if (sport != IPPORT_BOOTPC || dport != IPPORT_BOOTPS) | |
79 | printf(" (request)"); | 79 | printf(" (request)"); | |
80 | break; | 80 | break; | |
81 | 81 | |||
82 | case BOOTREPLY: | 82 | case BOOTREPLY: | |
83 | /* Usually, a reply goes from a server to a client */ | 83 | /* Usually, a reply goes from a server to a client */ | |
84 | if (sport != IPPORT_BOOTPS || dport != IPPORT_BOOTPC) | 84 | if (sport != IPPORT_BOOTPS || dport != IPPORT_BOOTPC) |