CVS commit: src/external/bsd/blacklist/bin
Module Name:src Committed By: christos Date: Mon Mar 30 03:02:41 UTC 2020 Modified Files: src/external/bsd/blacklist/bin: blacklistd.8 Log Message: Explain how configuration matching is done. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/external/bsd/blacklist/bin/blacklistd.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/blacklist/bin/blacklistd.8 diff -u src/external/bsd/blacklist/bin/blacklistd.8:1.20 src/external/bsd/blacklist/bin/blacklistd.8:1.21 --- src/external/bsd/blacklist/bin/blacklistd.8:1.20 Wed Nov 6 18:17:37 2019 +++ src/external/bsd/blacklist/bin/blacklistd.8 Sun Mar 29 23:02:41 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: blacklistd.8,v 1.20 2019/11/06 23:17:37 wiz Exp $ +.\" $NetBSD: blacklistd.8,v 1.21 2020/03/30 03:02:41 christos Exp $ .\" .\" Copyright (c) 2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 6, 2019 +.Dd March 29, 2020 .Dt BLACKLISTD 8 .Os .Sh NAME @@ -65,6 +65,42 @@ with syntax specified in If an entry is matched, a state entry is created for that tuple. Each entry contains a number of tries limit and a duration. .Pp +The way +.Nm +does configuration entry matching is by having the client side pass the +file dscriptor associated with the connection the client wants to blacklist +as well as passing socket credentials. +.Pp +The file descriptor is used to retrieve information (address and port) +about the remote side with +.Xr getpeername 2 +and the local side with +.Xr getsockname 2 . +.Pp +By examining the port of the local side, +.Nm +can determine if the client program +.Dq owns +the port. +By examining the optional address portion on the local side, it can match +interfaces. +By examining the remote address, it can match specific allow or deny rules. +.Pp +Finally +.Nm +can examine the socket credentials to match the user in the configuration file. +.Pp +While this works well for TCP sockets, it cannot be relied on for unbound +UDP sockets. +It is also less meaningful when it comes to connections using non-privileged +ports. +On the other hand, if we receive a request that has a local endpoind indicating +UDP privileged port, we can presume that the client was privileged to be +able to acquire that port. +.Pp +Once an entry is matched +.Nm +can perform various actions. If the action is .Dq add and the number of tries limit is reached, then a
CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Mon Mar 30 02:41:06 UTC 2020 Modified Files: src/usr.bin/make: main.c make.h Log Message: make: fix -fno-common build debug was declared extern, but debug_file was not; correct this and define debug_file in main.c (as debug is) to fix the -fno-common build. -fno-common will become the default with GCC10/LLVM11. Patch from kevans at freebsd To generate a diff of this commit: cvs rdiff -u -r1.273 -r1.274 src/usr.bin/make/main.c cvs rdiff -u -r1.104 -r1.105 src/usr.bin/make/make.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.273 src/usr.bin/make/main.c:1.274 --- src/usr.bin/make/main.c:1.273 Sat Oct 28 21:54:54 2017 +++ src/usr.bin/make/main.c Mon Mar 30 02:41:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.273 2017/10/28 21:54:54 sjg Exp $ */ +/* $NetBSD: main.c,v 1.274 2020/03/30 02:41:06 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.273 2017/10/28 21:54:54 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.274 2020/03/30 02:41:06 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.273 2017/10/28 21:54:54 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.274 2020/03/30 02:41:06 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -195,6 +195,8 @@ char *makeDependfile; pid_t myPid; int makelevel; +FILE *debug_file; + Boolean forceJobs = FALSE; extern Lst parseIncPath; Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.104 src/usr.bin/make/make.h:1.105 --- src/usr.bin/make/make.h:1.104 Mon Feb 12 21:38:09 2018 +++ src/usr.bin/make/make.h Mon Mar 30 02:41:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.104 2018/02/12 21:38:09 sjg Exp $ */ +/* $NetBSD: make.h,v 1.105 2020/03/30 02:41:06 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -448,7 +448,7 @@ extern pid_t myPid; * There is one bit per module. It is up to the module what debug * information to print. */ -FILE *debug_file; /* Output written here - default stdout */ +extern FILE *debug_file; /* Output written here - default stdout */ extern int debug; #define DEBUG_ARCH 0x1 #define DEBUG_COND 0x2
CVS commit: src/distrib/sets/lists/debug
Module Name:src Committed By: christos Date: Mon Mar 30 02:12:38 UTC 2020 Modified Files: src/distrib/sets/lists/debug: mi Log Message: Add rpcapd To generate a diff of this commit: cvs rdiff -u -r1.298 -r1.299 src/distrib/sets/lists/debug/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.298 src/distrib/sets/lists/debug/mi:1.299 --- src/distrib/sets/lists/debug/mi:1.298 Sun Mar 8 18:08:46 2020 +++ src/distrib/sets/lists/debug/mi Sun Mar 29 22:12:38 2020 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.298 2020/03/08 22:08:46 mgorny Exp $ +# $NetBSD: mi,v 1.299 2020/03/30 02:12:38 christos Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib comp-sys-usr compatdir ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile @@ -1244,6 +1244,7 @@ ./usr/libdata/debug/usr/sbin/rpc.pcnfsd.debug comp-nfsserver-debug debug ./usr/libdata/debug/usr/sbin/rpc.statd.debug comp-nfsserver-debug debug ./usr/libdata/debug/usr/sbin/rpc.yppasswdd.debug comp-nis-debug yp,debug +./usr/libdata/debug/usr/sbin/rpcapd.debug comp-netutil-debug debug ./usr/libdata/debug/usr/sbin/rpcbind.debug comp-rpcbind-debug debug ./usr/libdata/debug/usr/sbin/rtadvd.debug comp-router-debug use_inet6,debug ./usr/libdata/debug/usr/sbin/rtquery.debug comp-netutil-debug debug
CVS commit: src/lib/libterminfo
Module Name:src Committed By: roy Date: Mon Mar 30 02:08:11 UTC 2020 Modified Files: src/lib/libterminfo: compile.c Log Message: terminfo: satisfy gcc bitching To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/lib/libterminfo/compile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libterminfo/compile.c diff -u src/lib/libterminfo/compile.c:1.23 src/lib/libterminfo/compile.c:1.24 --- src/lib/libterminfo/compile.c:1.23 Mon Mar 30 00:09:06 2020 +++ src/lib/libterminfo/compile.c Mon Mar 30 02:08:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compile.c,v 1.23 2020/03/30 00:09:06 roy Exp $ */ +/* $NetBSD: compile.c,v 1.24 2020/03/30 02:08:11 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2011, 2020 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #endif #include -__RCSID("$NetBSD: compile.c,v 1.23 2020/03/30 00:09:06 roy Exp $"); +__RCSID("$NetBSD: compile.c,v 1.24 2020/03/30 02:08:11 roy Exp $"); #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H #include @@ -132,6 +132,8 @@ _ti_promote(TIC *tic) tic->extras.entries = tic->extras.buflen = tic->extras.bufpos = 0; for (n = entries; n > 0; n--) { num = _ti_decode_16(); + flag = 0; /* satisfy gcc, won't be used for non flag types */ + str = NULL; /* satisfy gcc, won't be used as strl is 0 */ strl = 0; code = cap; cap += num;
CVS commit: src/usr.bin/infocmp
Module Name:src Committed By: roy Date: Mon Mar 30 00:22:19 UTC 2020 Modified Files: src/usr.bin/infocmp: infocmp.c Log Message: infocmp: strip versioning from aliases as well To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.bin/infocmp/infocmp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/infocmp/infocmp.c diff -u src/usr.bin/infocmp/infocmp.c:1.15 src/usr.bin/infocmp/infocmp.c:1.16 --- src/usr.bin/infocmp/infocmp.c:1.15 Sun Mar 29 19:10:08 2020 +++ src/usr.bin/infocmp/infocmp.c Mon Mar 30 00:22:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: infocmp.c,v 1.15 2020/03/29 19:10:08 roy Exp $ */ +/* $NetBSD: infocmp.c,v 1.16 2020/03/30 00:22:18 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2020 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ */ #include -__RCSID("$NetBSD: infocmp.c,v 1.15 2020/03/29 19:10:08 roy Exp $"); +__RCSID("$NetBSD: infocmp.c,v 1.16 2020/03/30 00:22:18 roy Exp $"); #include @@ -715,6 +715,8 @@ main(int argc, char **argv) use_terms(t, argc - optind, argv + optind); if ((optind + 1 != argc && nflag == 0) || uflag != 0) { + char *alias, *aliascpy, *delim; + if (uflag == 0) printf("# Reconstructed from %s\n", _ti_database == NULL ? @@ -724,8 +726,24 @@ main(int argc, char **argv) if (term != NULL) *term = '\0'; printf("%s", t->name); - if (t->_alias != NULL && *t->_alias != '\0') - printf("|%s", t->_alias); + alias = aliascpy = estrdup(t->_alias); + while (alias != NULL && *alias != '\0') { + putchar('|'); + delim = strchr(alias, TERMINFO_VDELIM); + if (delim != NULL) +*delim++ = '\0'; + printf("%s", alias); + if (delim != NULL) { +while (*delim != '\0' && *delim != '|') + delim++; +if (*delim == '\0') + alias = NULL; +else + alias = delim + 1; + } else +alias = NULL; + } + free(aliascpy); if (t->desc != NULL && *t->desc != '\0') printf("|%s", t->desc); printf(",\n");
CVS commit: src
Module Name:src Committed By: roy Date: Mon Mar 30 00:09:07 UTC 2020 Modified Files: src/lib/libterminfo: compile.c src/usr.bin/tic: tic.c Log Message: terminfo: v3 records should create v3 aliases To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/lib/libterminfo/compile.c cvs rdiff -u -r1.39 -r1.40 src/usr.bin/tic/tic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libterminfo/compile.c diff -u src/lib/libterminfo/compile.c:1.22 src/lib/libterminfo/compile.c:1.23 --- src/lib/libterminfo/compile.c:1.22 Sun Mar 29 21:46:22 2020 +++ src/lib/libterminfo/compile.c Mon Mar 30 00:09:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compile.c,v 1.22 2020/03/29 21:46:22 roy Exp $ */ +/* $NetBSD: compile.c,v 1.23 2020/03/30 00:09:06 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2011, 2020 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #endif #include -__RCSID("$NetBSD: compile.c,v 1.22 2020/03/29 21:46:22 roy Exp $"); +__RCSID("$NetBSD: compile.c,v 1.23 2020/03/30 00:09:06 roy Exp $"); #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H #include @@ -67,7 +67,7 @@ dowarn(int flags, const char *fmt, ...) int _ti_promote(TIC *tic) { - char *obuf, type, flag; + char *obuf, type, flag, *buf, *delim, *name, *nbuf; const char *cap, *code, *str; size_t n, entries, strl; uint16_t ind; @@ -84,6 +84,28 @@ _ti_promote(TIC *tic) } free(obuf); + n = 0; + obuf = buf = tic->alias; + tic->alias = NULL; + while (buf != NULL) { + delim = strchr(buf, '|'); + if (delim != NULL) + *delim++ = '\0'; + name = _ti_getname(tic->rtype, buf); + strl = strlen(name) + 1; + nbuf = realloc(tic->alias, n + strl); + if (nbuf == NULL) { + free(name); + return -1; + } + tic->alias = nbuf; + memcpy(tic->alias + n, name, strl); + n += strl; + free(name); + buf = delim; + } + free(obuf); + obuf = tic->nums.buf; cap = obuf; entries = tic->nums.entries; Index: src/usr.bin/tic/tic.c diff -u src/usr.bin/tic/tic.c:1.39 src/usr.bin/tic/tic.c:1.40 --- src/usr.bin/tic/tic.c:1.39 Sun Mar 29 21:54:03 2020 +++ src/usr.bin/tic/tic.c Mon Mar 30 00:09:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: tic.c,v 1.39 2020/03/29 21:54:03 roy Exp $ */ +/* $NetBSD: tic.c,v 1.40 2020/03/30 00:09:06 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2020 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #endif #include -__RCSID("$NetBSD: tic.c,v 1.39 2020/03/29 21:54:03 roy Exp $"); +__RCSID("$NetBSD: tic.c,v 1.40 2020/03/30 00:09:06 roy Exp $"); #include #include @@ -179,10 +179,37 @@ store_term(const char *name, TERM *base_ return term; } +static void +alias_terms(TERM *term) +{ + char *p, *e, *alias; + + /* Create aliased terms */ + if (term->tic->alias == NULL) + return; + + alias = p = estrdup(term->tic->alias); + while (p != NULL && *p != '\0') { + e = strchr(p, '|'); + if (e != NULL) + *e++ = '\0'; + /* No need to lengthcheck the alias because the main + * terminfo description already stores all the aliases + * in the same length field as the alias. */ + if (find_term(p) != NULL) { + dowarn("%s: has alias for already assigned" + " term %s", term->tic->name, p); + } else { + store_term(p, term); + } + p = e; + } + free(alias); +} + static int process_entry(TBUF *buf, int flags) { - char *p, *e, *alias; TERM *term; TIC *tic; TBUF sbuf = *buf; @@ -208,27 +235,7 @@ process_entry(TBUF *buf, int flags) } term = store_term(tic->name, NULL); term->tic = tic; - - /* Create aliased terms */ - if (tic->alias != NULL) { - alias = p = estrdup(tic->alias); - while (p != NULL && *p != '\0') { - e = strchr(p, '|'); - if (e != NULL) -*e++ = '\0'; - /* No need to lengthcheck the alias because the main - * terminfo description already stores all the aliases - * in the same length field as the alias. */ - if (find_term(p) != NULL) { -dowarn("%s: has alias for already assigned" -" term %s", tic->name, p); - } else { -store_term(p, term); - } - p = e; - } - free(alias); - } + alias_terms(term); if (tic->rtype == TERMINFO_RTYPE) return process_entry(, flags | TIC_COMPAT_V1); @@ -356,6 +363,11 @@ promote(TIC *rtic, TIC *utic) tic->name = _ti_getname(TERMINFO_RTYPE, rtic->name); if (tic->name == NULL) goto err; + if (rtic->alias != NULL) { + tic->alias = strdup(rtic->alias); + if (tic->alias == NULL) + goto err; + } if (rtic->desc != NULL) { tic->desc = strdup(rtic->desc); if (tic->desc == NULL) @@ -375,10 +387,12 @@ promote(TIC *rtic, TIC *utic) goto err; term = store_term(tic->name, NULL); - if (term != NULL) { - term->tic = tic; - return 0; - } + if (term == NULL) + goto err; + + term->tic = tic; + alias_terms(term); + return 0; err: free(tic->flags.buf); @@ -386,6 +400,7 @@ err: free(tic->strs.buf); free(tic->extras.buf); free(tic->desc); + free(tic->alias); free(tic->name);
CVS commit: src/sys/dev/ic
Module Name:src Committed By: nisimura Date: Mon Mar 30 00:01:57 UTC 2020 Modified Files: src/sys/dev/ic: dm9000reg.h Log Message: DM9000 add register description To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/dm9000reg.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/dev/ic/dm9000reg.h diff -u src/sys/dev/ic/dm9000reg.h:1.2 src/sys/dev/ic/dm9000reg.h:1.3 --- src/sys/dev/ic/dm9000reg.h:1.2 Sat Jan 28 08:29:55 2012 +++ src/sys/dev/ic/dm9000reg.h Mon Mar 30 00:01:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dm9000reg.h,v 1.2 2012/01/28 08:29:55 nisimura Exp $ */ +/* $NetBSD: dm9000reg.h,v 1.3 2020/03/30 00:01:57 nisimura Exp $ */ /* * Copyright (c) 2009 Paul Fleischer @@ -39,135 +39,134 @@ #define DM9000_IOSIZE 4 /* XXX: Depends on the wiring of the address lines. */ #define DM9000_NCR 0x00 -#define DM9000_NCR_RST (1 << 0) +#define DM9000_NCR_RST (1<<0) /* reset chip, self clear */ #define DM9000_NCR_LBK_MASK (0x06) #define DM9000_NCR_LBK_SHIFT (1) -#define DM9000_NCR_LBK_MAC_INTERNAL ( 1 << DM9000_NCR_LBK_SHIFT ) -#define DM9000_NCR_LBK_NORMAL ( 0 << DM9000_NCR_LBK_SHIFT) -#define DM9000_NCR_LBK_INT_PHY ( 2 << DM9000_NCR_LBK_SHIFT) -#define DM9000_NCR_FDX (1 << 3) -#define DM9000_NCR_FCOL (1 << 4) -#define DM9000_NCR_WAKEEN (1 << 6) -#define DM9000_NCR_EXY_PHY (1 << 7) +#define DM9000_NCR_LBK_MAC_INTERNAL (1<1522) */ +#define DM9000_RCR_WTDIS (1<<6) /* disable Rx watchdog timer */ #define DM9000_RSR 0x06 -#define DM9000_RSR_FOE (1<<0) +#define DM9000_RSR_FOE (1<<0) /* Rx FIFO overflow detected */ #define DM9000_RSR_CE (1<<1) #define DM9000_RSR_AE (1<<2) #define DM9000_RSR_PLE (1<<3) #define DM9000_RSR_RWTO (1<<4) #define DM9000_RSR_LCS (1<<5) -#define DM9000_RSR_MF (1<<6) -#define DM9000_RSR_RF (1<<7) +#define DM9000_RSR_MF (1<<6) /* mcast/bcast frame received */ +#define DM9000_RSR_RF (1<<7) /* runt frame received (<64 bytes) */ #define DM9000_ROCR 0x07 #define DM9000_BPTR 0x08 #define DM9000_FCTR 0x09 #define DM9000_FCR 0x0A -#define DM9000_FCR_FLCE (1 << 0) -#define DM9000_FCR_RXPCS (1 << 1) -#define DM9000_FCR_RXPS (1 << 2) -#define DM9000_FCR_BKPM (1 << 3) -#define DM9000_FCR_BKPA (1 << 4) -#define DM9000_FCR_TXPEN (1 << 5) -#define DM9000_FCR_TXPF (1 << 6) -#define DM9000_FCR_TXP0 (1 << 7) +#define DM9000_FCR_FLCE (1<<0) /* flow control enable */ +#define DM9000_FCR_RXPCS (1<<1) /* Rx PAUSE current status */ +#define DM9000_FCR_RXPS (1<<2) /* Rx PAUSE status, read to clear */ +#define DM9000_FCR_BKPM (1<<3) +#define DM9000_FCR_BKPA (1<<4) +#define DM9000_FCR_TXPEN (1<<5) /* force PAUSE/unPAUSE */ +#define DM9000_FCR_TXPF (1<<6) /* Tx PAUSE packet (when full */ +#define DM9000_FCR_TXP0 (1<<7) /* Tx PAUSE packet (when empty) */ #define DM9000_EPCR 0x0B -#define DM9000_EPCR_ERRE (1 << 0) -#define DM9000_EPCR_ERPRW (1 << 1) -#define DM9000_EPCR_ERPRR (1 << 2) -#define DM9000_EPCR_EPOS_EEPROM (0 << 3) -#define DM9000_EPCR_EPOS_PHY(1 << 3) -#define DM9000_EPCR_WEP (1 << 4) -#define DM9000_EPCR_REEP (1 << 5) -#define DM9000_EPAR 0x0C -#define DM9000_EPAR_EROA_MASK 0x3F /* bits 0-5 */ -#define DM9000_EPAR_INT_PHY 0x40 /* EPAR[7:6] = 01 for internal PHY */ -#define DM9000_EPDRL 0x0D -#define DM9000_EPDRH 0x0E +#define DM9000_EPCR_ERRE (1<<0) /* operation in progress, busy bit */ +#define DM9000_EPCR_ERPRW (1<<1) /* instruct to write */ +#define DM9000_EPCR_ERPRR (1<<2) /* instruct to read */ +#define DM9000_EPCR_EPOS_EEPROM (0<<3) /* 1: PHY op, 0: EEPROM op */ +#define DM9000_EPCR_EPOS_PHY(1<<3) +#define DM9000_EPCR_WEP (1<<4) +#define DM9000_EPCR_REEP (1<<5) +#define DM9000_EPAR 0x0C /* 7:6 (!!) PHY id, 5:0 reg num */ +#define DM9000_EPAR_EROA_MASK 0x3F /* bits 0-5 */ +#define DM9000_EPAR_INT_PHY 0x40 /* EPAR[7:6] = 01 for internal PHY */ +#define DM9000_EPDRL 0x0D /* data 7:0 */ +#define DM9000_EPDRH 0x0E /* data 15:8 */ #define DM9000_WCR 0x0F -#define DM9000_PAB0 0x10 +#define DM9000_PAB0 0x10 /* my station address 7:0 */ #define DM9000_PAB1 0x11 #define DM9000_PAB2 0x12 #define DM9000_PAB3 0x13 #define DM9000_PAB4 0x14 -#define DM9000_PAB5 0x15 +#define DM9000_PAB5 0x15 /* my station address 47:40 */ -#define DM9000_MAB0 0x16 +#define DM9000_MAB0 0x16 /* 64bit mcast hash filter 7:0 */ #define DM9000_MAB1 0x17 #define DM9000_MAB2 0x18 #define DM9000_MAB3 0x19 #define DM9000_MAB4 0x1A #define DM9000_MAB5 0x1B #define DM9000_MAB6 0x1C -#define DM9000_MAB7 0x1D +#define DM9000_MAB7 0x1D /* 63:56, needs 0x80 to catch bcast */ #define DM9000_GPCR 0x1E -#define DM9000_GPCR_GPIO0_OUT (1 << 0) +#define DM9000_GPCR_GPIO0_OUT (1<<0) #define DM9000_GPR 0x1F -#define DM9000_GPR_PHY_PWROFF (1 << 0) +#define DM9000_GPR_PHY_PWROFF (1<<0) /* power down internal PHY */ #define DM9000_TRPAL 0x22 #define DM9000_TRPAH 0x23
CVS commit: src/sys/dev/ic
Module Name:src Committed By: nisimura Date: Sun Mar 29 23:16:52 UTC 2020 Modified Files: src/sys/dev/ic: dm9000.c Log Message: reorganise rcv frame address filter code To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/dev/ic/dm9000.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/dev/ic/dm9000.c diff -u src/sys/dev/ic/dm9000.c:1.22 src/sys/dev/ic/dm9000.c:1.23 --- src/sys/dev/ic/dm9000.c:1.22 Wed Jan 29 14:14:55 2020 +++ src/sys/dev/ic/dm9000.c Sun Mar 29 23:16:52 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dm9000.c,v 1.22 2020/01/29 14:14:55 thorpej Exp $ */ +/* $NetBSD: dm9000.c,v 1.23 2020/03/29 23:16:52 nisimura Exp $ */ /* * Copyright (c) 2009 Paul Fleischer @@ -879,7 +879,7 @@ dme_reset(struct dme_softc *sc) dme_write(sc, DM9000_IMR, DM9000_IMR_PAR | DM9000_IMR_PRM | DM9000_IMR_PTM); - /* Setup multicast address filter, and enable RX. */ + /* Setup multicast address filter, or run promisc. mode. */ dme_set_addr_filter(sc); /* Obtain media information from PHY */ @@ -893,33 +893,30 @@ dme_reset(struct dme_softc *sc) void dme_set_addr_filter(struct dme_softc *sc) { - struct ether_multi *enm; - struct ether_multistep step; - struct ethercom *ec; - struct ifnet *ifp; - uint16_t af[4]; - int i; - - ec = >sc_ethercom; - ifp = >ec_if; + struct ethercom *ec = >sc_ethercom; + struct ifnet *ifp = >ec_if; + struct ether_multi *enm; + struct ether_multistep step; + uint8_t mchash[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; /* 64bit mchash */ + uint32_t h = 0; + uint8_t rcr; + + rcr = dme_read(sc, DM9000_RCR); + rcr &= ~(DM9000_RCR_PRMSC | DM9000_RCR_ALL); + dme_write(sc, DM9000_RCR, rcr &~ DM9000_RCR_RXEN); + ETHER_LOCK(ec); if (ifp->if_flags & IFF_PROMISC) { - dme_write(sc, DM9000_RCR, DM9000_RCR_RXEN | - DM9000_RCR_WTDIS | - DM9000_RCR_PRMSC); - ifp->if_flags |= IFF_ALLMULTI; - return; + ec->ec_flags |= ETHER_F_ALLMULTI; + ETHER_UNLOCK(ec); + /* run promisc. mode */ + rcr |= DM9000_RCR_PRMSC; + goto update; } - - af[0] = af[1] = af[2] = af[3] = 0x; - ifp->if_flags &= ~IFF_ALLMULTI; - - ETHER_LOCK(ec); + ec->ec_flags &= ~ETHER_F_ALLMULTI; ETHER_FIRST_MULTI(step, ec, enm); while (enm != NULL) { - uint16_t hash; - if (memcpy(enm->enm_addrlo, enm->enm_addrhi, - sizeof(enm->enm_addrlo))) { + if (memcpy(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) { /* * We must listen to a range of multicast addresses. * For now, just accept all multicasts, rather than @@ -928,25 +925,25 @@ dme_set_addr_filter(struct dme_softc *sc * ranges is for IP multicast routing, for which the * range is big enough to require all bits set.) */ - ifp->if_flags |= IFF_ALLMULTI; - af[0] = af[1] = af[2] = af[3] = 0x; + ec->ec_flags |= ETHER_F_ALLMULTI; + ETHER_UNLOCK(ec); + memset(mchash, 0xff, sizeof(mchash)); /* necessary? */ + /* accept all mulicast frame */ + rcr |= DM9000_RCR_ALL; break; - } else { - hash = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN) & 0x3F; - af[(uint16_t)(hash>>4)] |= (uint16_t)(1 << (hash % 16)); - ETHER_NEXT_MULTI(step, enm); } + h = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN) & 0x3f; + /* 3(5:3) and 3(2:0) sampling to make uint8_t[8] */ + mchash[h / 8] |= 1 << (h % 8); + ETHER_NEXT_MULTI(step, enm); } ETHER_UNLOCK(ec); - - /* Write the multicast address filter */ - for (i = 0; i < 4; i++) { - dme_write(sc, DM9000_MAB0+i*2, af[i] & 0xFF); - dme_write(sc, DM9000_MAB0+i*2+1, (af[i] >> 8) & 0xFF); - } - - /* Setup RX controls */ - dme_write(sc, DM9000_RCR, DM9000_RCR_RXEN | DM9000_RCR_WTDIS); + /* DM9000 receive filter is always on */ + mchash[7] |= 0x80; /* to catch bcast frame */ + update: + dme_write_c(sc, DM9000_MAB0, mchash, sizeof(mchash)); + dme_write(sc, DM9000_RCR, rcr | DM9000_RCR_RXEN | DM9000_RCR_WTDIS); + return; } int
CVS commit: src/usr.bin/tic
Module Name:src Committed By: roy Date: Sun Mar 29 21:54:03 UTC 2020 Modified Files: src/usr.bin/tic: tic.c Log Message: tic: Duplicate and promote v1 records when merging a v3 record When this occurs, tic merges the matching v1 record into the original v1. The screen-256color record by itself doesn't have any numerics bigger than a short, but the xterm+256setaf record does. The screen-256color record is now as it was before the recent terminfo2.cdb merge into terminfo.cdb. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/usr.bin/tic/tic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/tic/tic.c diff -u src/usr.bin/tic/tic.c:1.38 src/usr.bin/tic/tic.c:1.39 --- src/usr.bin/tic/tic.c:1.38 Sat Mar 28 15:37:04 2020 +++ src/usr.bin/tic/tic.c Sun Mar 29 21:54:03 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: tic.c,v 1.38 2020/03/28 15:37:04 roy Exp $ */ +/* $NetBSD: tic.c,v 1.39 2020/03/29 21:54:03 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2020 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #endif #include -__RCSID("$NetBSD: tic.c,v 1.38 2020/03/28 15:37:04 roy Exp $"); +__RCSID("$NetBSD: tic.c,v 1.39 2020/03/29 21:54:03 roy Exp $"); #include #include @@ -51,6 +51,7 @@ __RCSID("$NetBSD: tic.c,v 1.38 2020/03/2 #include #include #include +#include #include #include #include @@ -141,6 +142,22 @@ find_term(const char *name) } static TERM * +find_newest_term(const char *name) +{ + char *lname; + TERM *term; + + lname = _ti_getname(TERMINFO_RTYPE, name); + if (lname == NULL) + return NULL; + term = find_term(lname); + free(lname); + if (term == NULL) + term = find_term(name); + return term; +} + +static TERM * store_term(const char *name, TERM *base_term) { TERM *term; @@ -228,24 +245,9 @@ merge(TIC *rtic, TIC *utic, int flags) int num; size_t n; - /* Promote record type if needed. */ - if (rtic->rtype < utic->rtype) { - char *obuf = rtic->nums.buf; - - cap = rtic->nums.buf; - rtic->nums.buf = NULL; - rtic->nums.buflen = rtic->nums.bufpos = 0; - for (n = rtic->nums.entries; n > 0; n--) { - ind = _ti_decode_16(); - num = _ti_decode_num(, rtic->rtype); - if (VALID_NUMERIC(num) && - !_ti_encode_buf_id_num(>nums, ind, num, - _ti_numsize(utic))) -err(EXIT_FAILURE, "encode num"); - } - rtic->rtype = utic->rtype; - free(obuf); - } + if (rtic->rtype < utic->rtype) + errx(EXIT_FAILURE, "merge rtype diff (%s:%d into %s:%d)", + utic->name, utic->rtype, rtic->name, rtic->rtype); cap = utic->flags.buf; for (n = utic->flags.entries; n > 0; n--) { @@ -318,20 +320,95 @@ merge(TIC *rtic, TIC *utic, int flags) } } +static int +dup_tbuf(TBUF *dst, const TBUF *src) +{ + + if (src->buflen == 0) + return 0; + dst->buf = malloc(src->buflen); + if (dst->buf == NULL) + return -1; + dst->buflen = src->buflen; + memcpy(dst->buf, src->buf, dst->buflen); + dst->bufpos = src->bufpos; + dst->entries = src->entries; + return 0; +} + +static int +promote(TIC *rtic, TIC *utic) +{ + TERM *nrterm = find_newest_term(rtic->name); + TERM *nuterm = find_newest_term(utic->name); + TERM *term; + TIC *tic; + + if (nrterm == NULL || nuterm == NULL) + return -1; + if (nrterm->tic->rtype >= nuterm->tic->rtype) + return 0; + + tic = calloc(1, sizeof(*tic)); + if (tic == NULL) + return -1; + + tic->name = _ti_getname(TERMINFO_RTYPE, rtic->name); + if (tic->name == NULL) + goto err; + if (rtic->desc != NULL) { + tic->desc = strdup(rtic->desc); + if (tic->desc == NULL) + goto err; + } + + tic->rtype = rtic->rtype; + if (dup_tbuf(>flags, >flags) == -1) + goto err; + if (dup_tbuf(>nums, >nums) == -1) + goto err; + if (dup_tbuf(>strs, >strs) == -1) + goto err; + if (dup_tbuf(>extras, >extras) == -1) + goto err; + if (_ti_promote(tic) == -1) + goto err; + + term = store_term(tic->name, NULL); + if (term != NULL) { + term->tic = tic; + return 0; + } + +err: + free(tic->flags.buf); + free(tic->nums.buf); + free(tic->strs.buf); + free(tic->extras.buf); + free(tic->desc); + free(tic->name); + free(tic); + return -1; +} + static size_t merge_use(int flags) { size_t skipped, merged, memn; const char *cap; + char *name, *basename; uint16_t num; TIC *rtic, *utic; - TERM *term, *uterm;; + TERM *term, *uterm; + bool promoted; skipped = merged = 0; STAILQ_FOREACH(term, , next) { if (term->base_term != NULL) continue; rtic = term->tic; + basename = _ti_getname(TERMINFO_RTYPE_O1, rtic->name); + promoted = false; while ((cap = _ti_find_extra(rtic, >extras, "use")) != NULL) { if (*cap++ != 's') { @@ -339,11 +416,19 @@ merge_use(int flags) break; } cap += sizeof(uint16_t); - if (strcmp(rtic->name, cap) == 0) { + if (strcmp(basename, cap) == 0) { dowarn("%s: uses itself", rtic->name); goto remove; } - uterm = find_term(cap); + name = _ti_getname(rtic->rtype, cap); +
CVS commit: src/lib/libterminfo
Module Name:src Committed By: roy Date: Sun Mar 29 21:46:23 UTC 2020 Modified Files: src/lib/libterminfo: compile.c term_private.h Log Message: terminfo: Promote a terminfo description to v3 when required Blindly scanning the capabilities for # and checking that the following number is bigger than a short isn't reliable because this could be a string value: SomeString#1234 Instead, if we process the numeric as normal and if it's value is too big for v1 then promote the record to v3. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/lib/libterminfo/compile.c cvs rdiff -u -r1.17 -r1.18 src/lib/libterminfo/term_private.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libterminfo/compile.c diff -u src/lib/libterminfo/compile.c:1.21 src/lib/libterminfo/compile.c:1.22 --- src/lib/libterminfo/compile.c:1.21 Sun Mar 29 18:54:57 2020 +++ src/lib/libterminfo/compile.c Sun Mar 29 21:46:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compile.c,v 1.21 2020/03/29 18:54:57 roy Exp $ */ +/* $NetBSD: compile.c,v 1.22 2020/03/29 21:46:22 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2011, 2020 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #endif #include -__RCSID("$NetBSD: compile.c,v 1.21 2020/03/29 18:54:57 roy Exp $"); +__RCSID("$NetBSD: compile.c,v 1.22 2020/03/29 21:46:22 roy Exp $"); #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H #include @@ -64,6 +64,84 @@ dowarn(int flags, const char *fmt, ...) } } +int +_ti_promote(TIC *tic) +{ + char *obuf, type, flag; + const char *cap, *code, *str; + size_t n, entries, strl; + uint16_t ind; + int num, ortype, error = 0; + + ortype = tic->rtype; + tic->rtype = TERMINFO_RTYPE; + obuf = tic->name; + tic->name = _ti_getname(tic->rtype, tic->name); + if (tic->name == NULL) { + warn("_ti_getname"); + tic->name = obuf; + return -1; + } + free(obuf); + + obuf = tic->nums.buf; + cap = obuf; + entries = tic->nums.entries; + tic->nums.buf = NULL; + tic->nums.entries = tic->nums.buflen = tic->nums.bufpos = 0; + for (n = entries; n > 0; n--) { + ind = _ti_decode_16(); + num = _ti_decode_num(, ortype); + if (VALID_NUMERIC(num) && + !_ti_encode_buf_id_num(>nums, ind, num, + _ti_numsize(tic))) + { + warn("promote num"); + error = -1; + break; + } + } + free(obuf); + + obuf = tic->extras.buf; + cap = obuf; + entries = tic->extras.entries; + tic->extras.buf = NULL; + tic->extras.entries = tic->extras.buflen = tic->extras.bufpos = 0; + for (n = entries; n > 0; n--) { + num = _ti_decode_16(); + strl = 0; + code = cap; + cap += num; + type = *cap++; + switch (type) { + case 'f': + flag = *cap++; + break; + case 'n': + num = _ti_decode_num(, ortype); + break; + case 's': + strl = _ti_decode_16(); + str = cap; + cap += strl; + break; + default: + errno = EINVAL; + break; + } + if (!_ti_store_extra(tic, 0, code, type, flag, num, + str, strl, TIC_EXTRA)) + { + error = -1; + break; + } + } + free(obuf); + + return error; +} + char * _ti_grow_tbuf(TBUF *tbuf, size_t len) { @@ -190,7 +268,7 @@ size_t _ti_store_extra(TIC *tic, int wrn, const char *id, char type, char flag, int num, const char *str, size_t strl, int flags) { - size_t l; + size_t l, capl; _DIAGASSERT(tic != NULL); @@ -206,13 +284,25 @@ _ti_store_extra(TIC *tic, int wrn, const } l = strlen(id) + 1; - if (l > UINT16_T_MAX) { + if (l > UINT16_MAX) { dowarn(flags, "%s: %s: cap name is too long", tic->name, id); return 0; } - if (!_ti_grow_tbuf(>extras, - l + strl + sizeof(uint16_t) + _ti_numsize(tic) + 1)) + capl = sizeof(uint16_t) + l + 1; + switch (type) { + case 'f': + capl++; + break; + case 'n': + capl += _ti_numsize(tic); + break; + case 's': + capl += sizeof(uint16_t) + strl; + break; + } + + if (!_ti_grow_tbuf(>extras, capl)) return 0; _ti_encode_buf_count_str(>extras, id, l); tic->extras.buf[tic->extras.bufpos++] = type; @@ -433,19 +523,6 @@ _ti_get_token(char **cap, char sep) return token; } -static int -_ti_find_rtype(const char *cap) -{ - const char *ptr; - - for (ptr = cap; (ptr = strchr(ptr, '#')) != NULL;) { - if (strtol(++ptr, NULL, 0) > SHRT_MAX) { - return TERMINFO_RTYPE; - } - } - return TERMINFO_RTYPE_O1; -} - int _ti_encode_buf_id_num(TBUF *tbuf, int ind, int num, size_t len) { @@ -525,8 +602,7 @@ _ti_compile(char *cap, int flags) if (tic == NULL) return NULL; - tic->rtype = (flags & TIC_COMPAT_V1) ? TERMINFO_RTYPE_O1 : - _ti_find_rtype(cap); + tic->rtype = TERMINFO_RTYPE_O1; /* will promote if needed */ buf.buf = NULL; buf.buflen = 0; @@ -618,6 +694,13 @@ _ti_compile(char *cap, int flags) tic->name, token, cnum); continue; } + if (cnum > INT16_MAX) { +if (flags & TIC_COMPAT_V1) + cnum = INT16_MAX; +else if (tic->rtype == TERMINFO_RTYPE_O1) + if (_ti_promote(tic) == -1) + goto error; + }
CVS commit: src/sys/arch/arm/include/arm32
Module Name:src Committed By: skrll Date: Sun Mar 29 21:34:33 UTC 2020 Modified Files: src/sys/arch/arm/include/arm32: pmap.h Log Message: Don't define pt_entry_t if _LOCORE Reported by Patrick Welche To generate a diff of this commit: cvs rdiff -u -r1.165 -r1.166 src/sys/arch/arm/include/arm32/pmap.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/arch/arm/include/arm32/pmap.h diff -u src/sys/arch/arm/include/arm32/pmap.h:1.165 src/sys/arch/arm/include/arm32/pmap.h:1.166 --- src/sys/arch/arm/include/arm32/pmap.h:1.165 Sun Mar 29 09:01:32 2020 +++ src/sys/arch/arm/include/arm32/pmap.h Sun Mar 29 21:34:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.165 2020/03/29 09:01:32 skrll Exp $ */ +/* $NetBSD: pmap.h,v 1.166 2020/03/29 21:34:33 skrll Exp $ */ /* * Copyright (c) 2002, 2003 Wasabi Systems, Inc. @@ -1184,14 +1184,14 @@ do { \ (pg)->mdpage.k_mappings = 0; \ } while (/*CONSTCOND*/0) -#endif /* !_LOCORE */ - #ifndef __BSD_PTENTRY_T__ #define __BSD_PTENTRY_T__ typedef uint32_t pt_entry_t; #define PRIxPTE PRIx32 #endif +#endif /* !_LOCORE */ + #endif /* _KERNEL */ #endif /* _ARM32_PMAP_H_ */
CVS commit: src/external/mit/xorg/lib
Module Name:src Committed By: maya Date: Sun Mar 29 21:06:03 UTC 2020 Modified Files: src/external/mit/xorg/lib: libloader.mk src/external/mit/xorg/lib/libGL: Makefile Log Message: Define GL_LIB_NAME somewhere that applies to dri_common.c, which is the file that needs it. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/mit/xorg/lib/libloader.mk cvs rdiff -u -r1.28 -r1.29 src/external/mit/xorg/lib/libGL/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/lib/libloader.mk diff -u src/external/mit/xorg/lib/libloader.mk:1.5 src/external/mit/xorg/lib/libloader.mk:1.6 --- src/external/mit/xorg/lib/libloader.mk:1.5 Fri Feb 7 19:00:18 2020 +++ src/external/mit/xorg/lib/libloader.mk Sun Mar 29 21:06:03 2020 @@ -1,4 +1,4 @@ -# $NetBSD: libloader.mk,v 1.5 2020/02/07 19:00:18 jmcneill Exp $ +# $NetBSD: libloader.mk,v 1.6 2020/03/29 21:06:03 maya Exp $ # makefile fragment for mesa src/loader @@ -15,7 +15,6 @@ CPPFLAGS.${_f}= -I${X11SRCDIR.Mesa}/src -I${X11SRCDIR.Mesa}/../src/util \ -I${X11SRCDIR.Mesa}/src/mesa \ -I${X11SRCDIR.Mesa}/src \ - -DGL_LIB_NAME=\"libGL.so.3\" \ -DDEFAULT_DRIVER_DIR=\"${X11USRLIBDIR}/modules/dri\" \ -DUSE_DRICONF \ -DHAVE_LIBDRM Index: src/external/mit/xorg/lib/libGL/Makefile diff -u src/external/mit/xorg/lib/libGL/Makefile:1.28 src/external/mit/xorg/lib/libGL/Makefile:1.29 --- src/external/mit/xorg/lib/libGL/Makefile:1.28 Tue Sep 24 19:29:42 2019 +++ src/external/mit/xorg/lib/libGL/Makefile Sun Mar 29 21:06:03 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.28 2019/09/24 19:29:42 maya Exp $ +# $NetBSD: Makefile,v 1.29 2020/03/29 21:06:03 maya Exp $ .include @@ -117,7 +117,8 @@ SRCS.dri= \ .for fn in ${SRCS.dri} CPPFLAGS.${fn}= \ - -I${X11SRCDIR.Mesa}/src + -I${X11SRCDIR.Mesa}/src \ + -DGL_LIB_NAME="\"libGL.so.${SHLIB_MAJOR}\"" .endfor .endif
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Mar 29 19:50:23 UTC 2020 Modified Files: src/external/bsd/libpcap/dist: pcap-rpcap-unix.c Log Message: make the patch compile on NetBSD To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libpcap/dist/pcap-rpcap-unix.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap-rpcap-unix.c diff -u src/external/bsd/libpcap/dist/pcap-rpcap-unix.c:1.1 src/external/bsd/libpcap/dist/pcap-rpcap-unix.c:1.2 --- src/external/bsd/libpcap/dist/pcap-rpcap-unix.c:1.1 Sun Mar 29 15:49:26 2020 +++ src/external/bsd/libpcap/dist/pcap-rpcap-unix.c Sun Mar 29 15:50:23 2020 @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include "pcap-rpcap-unix.h" @@ -113,17 +113,17 @@ put32(unsigned char *buf, unsigned int v } static int -rpcap_recv_pkt(pcap_t *p, int fd, char *recv_buf, unsigned int buflen) +rpcap_recv_pkt(pcap_t *p, int fd, unsigned char *recv_buf, unsigned int buflen) { - static char discard[1024]; + static unsigned char discard[1024]; size_t mlen; int ret; - char *buf; + unsigned char *buf; unsigned int len; unsigned int pkt_len; - char hdr[8]; + unsigned char hdr[8]; int pkt_type; /* read header loop */ @@ -162,7 +162,7 @@ rpcap_recv_pkt(pcap_t *p, int fd, char * pkt_len = get32([4]); if (pkt_type == RPCAP_MSG_ERROR) { - recv_buf = p->errbuf; + recv_buf = (unsigned char *)p->errbuf; buflen = PCAP_ERRBUF_SIZE-1; } @@ -216,10 +216,8 @@ rpcap_recv_pkt(pcap_t *p, int fd, char * } static int -rpcap_send_pkt(pcap_t *p, const char *send_buf, unsigned int len) +rpcap_send_pkt(pcap_t *p, const unsigned char *send_buf, unsigned int len) { - char *buf; - size_t mlen; int ret; @@ -252,7 +250,7 @@ rpcap_send_pkt(pcap_t *p, const char *se } static int -rpcap_send_request(pcap_t *p, char type, char *buf, unsigned int payload_len) +rpcap_send_request(pcap_t *p, char type, unsigned char *buf, unsigned int payload_len) { buf[0] = RPCAP_VERSION_EXPERIMENTAL; buf[1] = type; @@ -265,14 +263,13 @@ rpcap_send_request(pcap_t *p, char type, static int rpcap_send_request_auth(pcap_t *p, const char *username, const char *password) { - int res; if (username || password) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: auth not supported (yet!)"); return -1; } else { - static const char login_null_pkt[16] = { + static const unsigned char login_null_pkt[16] = { RPCAP_VERSION_EXPERIMENTAL, RPCAP_MSG_AUTH_REQ, 0, 0, @@ -293,14 +290,14 @@ rpcap_send_request_open(pcap_t *p, const { const size_t interface_len = strlen(interface); - char buf_open[8+255] = { + unsigned char buf_open[8+255] = { RPCAP_VERSION_EXPERIMENTAL, RPCAP_MSG_OPEN_REQ, 0, 0, 0, 0, 0, interface_len }; - char reply_buf[8]; + unsigned char reply_buf[8]; int reply_len; if (interface_len > 255) { @@ -328,7 +325,7 @@ rpcap_send_request_open(pcap_t *p, const static int rpcap_send_request_start(pcap_t *p, struct in_addr *server_ip) { - char buf_start[8+12+8+8] = { + unsigned char buf_start[8+12+8+8] = { RPCAP_VERSION_EXPERIMENTAL, RPCAP_MSG_STARTCAP_REQ, 0, 0, @@ -350,15 +347,14 @@ rpcap_send_request_start(pcap_t *p, stru }; struct sockaddr_in sin; - char reply_buf[8]; + unsigned char reply_buf[8]; int reply_len; int fd; - unsigned int buf_size; unsigned short portdata; put32(_start[8], p->snapshot); /* snaplen */ - put32(_start[12], p->md.timeout/2); /* read_timeout */ + put32(_start[12], p->opt.timeout/2); /* read_timeout */ if (rpcap_send_pkt(p, buf_start, sizeof(buf_start))) return -1; @@ -370,7 +366,7 @@ rpcap_send_request_start(pcap_t *p, stru return -1; } - buf_size = get32(_buf[0]); + get32(_buf[0]); portdata = get16(_buf[4]); fd = socket(AF_INET, SOCK_STREAM, 0); @@ -405,14 +401,14 @@ rpcap_inject_common(pcap_t *handle, cons static int rpcap_stats_common(pcap_t *handle, struct pcap_stat *stats) { - static const char buf_stats[8] = { + static const unsigned char buf_stats[8] = { RPCAP_VERSION_EXPERIMENTAL, RPCAP_MSG_STATS_REQ, 0, 0, 0, 0, 0, 0 }; - char reply_buf[16]; + unsigned char reply_buf[16]; int reply_len; /* local */ @@ -442,7 +438,7 @@ rpcap_stats_common(pcap_t *handle, struc static int rpcap_setfilter_common(pcap_t *handle, struct bpf_program *prog) { - char *buf_setfilter; + unsigned char *buf_setfilter; /* update local filter */ if (install_bpf_program(handle, prog) == -1) @@ -451,9 +447,9 @@ rpcap_setfilter_common(pcap_t *handle, s /* update remote filter */ if (prog->bf_len < 0xf) { unsigned int data_size = 8 + 8 * prog->bf_len; - char *buf_filter; - char *buf_insn; - int i; + unsigned char *buf_filter; + unsigned char *buf_insn; + size_t i; buf_setfilter = malloc(8 + data_size); if
CVS commit: src/external/bsd/libpcap/lib
Module Name:src Committed By: christos Date: Sun Mar 29 19:50:46 UTC 2020 Modified Files: src/external/bsd/libpcap/lib: Makefile Log Message: rpcap:///interface support. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/external/bsd/libpcap/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/lib/Makefile diff -u src/external/bsd/libpcap/lib/Makefile:1.28 src/external/bsd/libpcap/lib/Makefile:1.29 --- src/external/bsd/libpcap/lib/Makefile:1.28 Sun Mar 29 13:49:52 2020 +++ src/external/bsd/libpcap/lib/Makefile Sun Mar 29 15:50:46 2020 @@ -1,10 +1,11 @@ -# $NetBSD: Makefile,v 1.28 2020/03/29 17:49:52 christos Exp $ +# $NetBSD: Makefile,v 1.29 2020/03/29 19:50:46 christos Exp $ USE_SHLIBDIR=yes .include USE_FORT?= yes # network protocol library CPPFLAGS+= -DPCAP_DONT_INCLUDE_PCAP_BPF_H -DHAVE_CONFIG_H -DENABLE_REMOTE +CPPFLAGS+= -DPCAP_SUPPORT_RPCAP CPPFLAGS+= -I${.OBJDIR} .SUFFIXES: .3 .3pcap @@ -138,6 +139,7 @@ pcap-bpf.c \ pcap-common.c \ pcap-new.c \ pcap-rpcap.c \ +pcap-rpcap-unix.c \ pcap.c \ rpcap-protocol.c \ savefile.c \
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Mar 29 19:49:26 UTC 2020 Modified Files: src/external/bsd/libpcap/dist: pcap.c Added Files: src/external/bsd/libpcap/dist: pcap-rpcap-unix.c pcap-rpcap-unix.h Log Message: Use http://sourceforge.net/p/libpcap/patches/_discuss/thread/fc8f43a0/ad35/\ attachment/rpcap3.patch to provide rpcap support. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/bsd/libpcap/dist/pcap-rpcap-unix.c \ src/external/bsd/libpcap/dist/pcap-rpcap-unix.h cvs rdiff -u -r1.9 -r1.10 src/external/bsd/libpcap/dist/pcap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap.c diff -u src/external/bsd/libpcap/dist/pcap.c:1.9 src/external/bsd/libpcap/dist/pcap.c:1.10 --- src/external/bsd/libpcap/dist/pcap.c:1.9 Tue Oct 1 12:02:12 2019 +++ src/external/bsd/libpcap/dist/pcap.c Sun Mar 29 15:49:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pcap.c,v 1.9 2019/10/01 16:02:12 christos Exp $ */ +/* $NetBSD: pcap.c,v 1.10 2020/03/29 19:49:26 christos Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998 @@ -34,7 +34,7 @@ */ #include -__RCSID("$NetBSD: pcap.c,v 1.9 2019/10/01 16:02:12 christos Exp $"); +__RCSID("$NetBSD: pcap.c,v 1.10 2020/03/29 19:49:26 christos Exp $"); #ifdef HAVE_CONFIG_H #include @@ -125,6 +125,10 @@ struct rtentry; /* declarations in +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "pcap-rpcap-unix.h" + +#define RPCAP_IFACE "rpcap://" + +/* default */ +#define RPCAP_DEFAULT_NETPORT 2002 + +/* version */ +#define RPCAP_VERSION_EXPERIMENTAL 0 + +/* packets */ +#define RPCAP_MSG_ERROR 1/*!< Message that keeps an error notification */ +#define RPCAP_MSG_OPEN_REQ 3 /*!< Request to open a remote device */ +#define RPCAP_MSG_STARTCAP_REQ 4 /*!< Request to start a capture on a remote device */ +#define RPCAP_MSG_UPDATEFILTER_REQ 5 /*!< Send a compiled filter into the remote device */ +#define RPCAP_MSG_PACKET 7/*!< This is a 'data' message, which carries a network packet */ +#define RPCAP_MSG_AUTH_REQ 8 /*!< Message that keeps the authentication parameters */ +#define RPCAP_MSG_STATS_REQ 9 /*!< It requires to have network statistics */ + +#define RPCAP_UPDATEFILTER_BPF 1 /*!< This code tells us that the filter is encoded with the BPF/NPF syntax */ + +static unsigned short +get16(const unsigned char *buf) +{ + unsigned short val; + + val = buf[0]; + val = val << 8 | buf[1]; + return val; +} + +static void +put16(unsigned char *buf, unsigned int val) +{ + buf[0] = val >> 8; + buf[1] = val >> 0; +} + +static unsigned int +get32(const unsigned char *buf) +{ + unsigned int val; + + val = buf[0]; + val = val << 8 | buf[1]; + val = val << 8 | buf[2]; + val = val << 8 | buf[3]; + return val; +} + +static void +put32(unsigned char *buf, unsigned int val) +{ + buf[0] = val >> 24; + buf[1] = val >> 16; + buf[2] = val >> 8; + buf[3] = val >> 0; +} + +static int +rpcap_recv_pkt(pcap_t *p, int fd, char *recv_buf, unsigned int buflen) +{ + static char discard[1024]; + + size_t mlen; + int ret; + char *buf; + unsigned int len; + unsigned int pkt_len; + + char hdr[8]; + int pkt_type; + +/* read header loop */ + buf = hdr; + len = 8; + + ret = 0; + do { + buf += ret; + len -= ret; + + do { + ret = read(fd, buf, len); + if (p->break_loop) { +snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "break-loop"); +p->break_loop = 0; +return -2; + } + } while (ret == -1 && errno == EINTR); + } while (ret > 0 && len-ret); + + if (ret <= 0) { + if (!ret) + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: connection closed"); + else + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: connection error (%s)", strerror(errno)); + return -1; + } + + if (hdr[0] != RPCAP_VERSION_EXPERIMENTAL) { + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: incorrect reply version (%.2x)", hdr[0]); + return -1; + } + + pkt_type = (unsigned char) hdr[1]; + pkt_len = get32([4]); + + if (pkt_type == RPCAP_MSG_ERROR) { + recv_buf = p->errbuf; + buflen = PCAP_ERRBUF_SIZE-1; + } + + buf = recv_buf; + +/* read payload loop */ + if (pkt_len) { + ret = 0; + len = pkt_len; + do { + buf += ret; + buflen -= ret; + len -= ret; + + if (!buflen) { +buf = discard; +buflen = sizeof(discard); + } + + mlen = (len < 0x7fff) ? len : 0x7fff; + + if (mlen > buflen) +mlen = buflen; + + do { +ret = read(fd, buf, mlen); +if (p->break_loop) { + p->break_loop = 0; + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "break-loop"); + return -2; +} + } while (ret == -1 && errno == EINTR); + } while (ret > 0 && len-ret); + + if (ret <= 0) { + if (!ret) +snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: connection closed"); + else +snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: connection error (%s)", strerror(errno)); +
CVS commit: src/usr.bin/infocmp
Module Name:src Committed By: roy Date: Sun Mar 29 19:10:08 UTC 2020 Modified Files: src/usr.bin/infocmp: infocmp.c Log Message: infocmp: Strip versioning from terminfo name To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/usr.bin/infocmp/infocmp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/infocmp/infocmp.c diff -u src/usr.bin/infocmp/infocmp.c:1.14 src/usr.bin/infocmp/infocmp.c:1.15 --- src/usr.bin/infocmp/infocmp.c:1.14 Sat Mar 28 15:50:25 2020 +++ src/usr.bin/infocmp/infocmp.c Sun Mar 29 19:10:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: infocmp.c,v 1.14 2020/03/28 15:50:25 christos Exp $ */ +/* $NetBSD: infocmp.c,v 1.15 2020/03/29 19:10:08 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2020 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ */ #include -__RCSID("$NetBSD: infocmp.c,v 1.14 2020/03/28 15:50:25 christos Exp $"); +__RCSID("$NetBSD: infocmp.c,v 1.15 2020/03/29 19:10:08 roy Exp $"); #include @@ -719,6 +719,10 @@ main(int argc, char **argv) printf("# Reconstructed from %s\n", _ti_database == NULL ? "internal database" : _ti_database); + /* Strip internal versioning */ + term = strchr(t->name, TERMINFO_VDELIM); + if (term != NULL) + *term = '\0'; printf("%s", t->name); if (t->_alias != NULL && *t->_alias != '\0') printf("|%s", t->_alias);
CVS commit: src/lib/libterminfo
Module Name:src Committed By: roy Date: Sun Mar 29 18:54:58 UTC 2020 Modified Files: src/lib/libterminfo: compile.c term_private.h Log Message: terminfo: allow _ti_getname to convert from and to any version To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/lib/libterminfo/compile.c cvs rdiff -u -r1.16 -r1.17 src/lib/libterminfo/term_private.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libterminfo/compile.c diff -u src/lib/libterminfo/compile.c:1.20 src/lib/libterminfo/compile.c:1.21 --- src/lib/libterminfo/compile.c:1.20 Sat Mar 28 15:45:56 2020 +++ src/lib/libterminfo/compile.c Sun Mar 29 18:54:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compile.c,v 1.20 2020/03/28 15:45:56 christos Exp $ */ +/* $NetBSD: compile.c,v 1.21 2020/03/29 18:54:57 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2011, 2020 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #endif #include -__RCSID("$NetBSD: compile.c,v 1.20 2020/03/28 15:45:56 christos Exp $"); +__RCSID("$NetBSD: compile.c,v 1.21 2020/03/29 18:54:57 roy Exp $"); #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H #include @@ -155,18 +155,34 @@ _ti_find_extra(TIC *tic, TBUF *tbuf, con char * _ti_getname(int rtype, const char *orig) { + const char *delim; char *name; + const char *verstr; + size_t diff, vlen; - if (rtype == TERMINFO_RTYPE) { - /* , and | are the two print characters now allowed - * in terminfo aliases or long descriptions. - * As | is generally used to delimit aliases inside the - * description, we use a comma. */ - if (asprintf(, "%s,v3", orig) < 0) - name = NULL; - } else { - name = strdup(orig); + switch (rtype) { + case TERMINFO_RTYPE: + verstr = TERMINFO_VDELIMSTR "v3"; + break; + case TERMINFO_RTYPE_O1: + verstr = ""; + break; + default: + errno = EINVAL; + return NULL; } + + delim = orig; + while (*delim != '\0' && *delim != TERMINFO_VDELIM) + delim++; + diff = delim - orig; + vlen = strlen(verstr); + name = malloc(diff + vlen + 1); + if (name == NULL) + return NULL; + + memcpy(name, orig, diff); + memcpy(name + diff, verstr, vlen + 1); return name; } Index: src/lib/libterminfo/term_private.h diff -u src/lib/libterminfo/term_private.h:1.16 src/lib/libterminfo/term_private.h:1.17 --- src/lib/libterminfo/term_private.h:1.16 Sun Mar 29 18:32:45 2020 +++ src/lib/libterminfo/term_private.h Sun Mar 29 18:54:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: term_private.h,v 1.16 2020/03/29 18:32:45 roy Exp $ */ +/* $NetBSD: term_private.h,v 1.17 2020/03/29 18:54:57 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2013, 2020 The NetBSD Foundation, Inc. @@ -79,6 +79,13 @@ #define TERMINFO_ALIAS 2 #define TERMINFO_RTYPE 3 +/* , and | are the two print characters now allowed + * in terminfo aliases or long descriptions. + * As | is generally used to delimit aliases inside the + * description, we use a comma. */ +#define TERMINFO_VDELIM ',' +#define TERMINFO_VDELIMSTR "," + /* We use the same ncurses tic macros so that our data is identical * when a caller uses the long name macros to access te terminfo data * directly. */
CVS commit: src/lib/libterminfo
Module Name:src Committed By: roy Date: Sun Mar 29 18:32:45 UTC 2020 Modified Files: src/lib/libterminfo: term_private.h Log Message: terminfo: Clamp numeric bounds to storage not API. While here, fix decoding of numeric -1 stored in uint16_t to still be -1. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/libterminfo/term_private.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libterminfo/term_private.h diff -u src/lib/libterminfo/term_private.h:1.15 src/lib/libterminfo/term_private.h:1.16 --- src/lib/libterminfo/term_private.h:1.15 Sat Mar 28 15:23:33 2020 +++ src/lib/libterminfo/term_private.h Sun Mar 29 18:32:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: term_private.h,v 1.15 2020/03/28 15:23:33 roy Exp $ */ +/* $NetBSD: term_private.h,v 1.16 2020/03/29 18:32:45 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2013, 2020 The NetBSD Foundation, Inc. @@ -188,7 +188,7 @@ int _ti_parm_analyse(const char *, int * static __inline int _ti_decode_16(const char **cap) { - int num = le16dec(*cap); + int num = (int16_t)le16dec(*cap); *cap += sizeof(uint16_t); return num; @@ -197,7 +197,7 @@ _ti_decode_16(const char **cap) static __inline int _ti_decode_32(const char **cap) { - int num = le32dec(*cap); + int num = (int32_t)le32dec(*cap); *cap += sizeof(uint32_t); return num; @@ -216,7 +216,7 @@ _ti_decode_num(const char **cap, int rty static __inline void _ti_encode_16(char **cap, size_t num) { - _DIAGASSERT(num <= USHRT_MAX); + _DIAGASSERT(num <= UINT16_MAX); le16enc(*cap, (uint16_t)num); *cap += sizeof(uint16_t); } @@ -224,7 +224,7 @@ _ti_encode_16(char **cap, size_t num) static __inline void _ti_encode_32(char **cap, size_t num) { - _DIAGASSERT(num <= UINT_MAX); + _DIAGASSERT(num <= UINT32_MAX); le32enc(*cap, (uint32_t)num); *cap += sizeof(uint32_t); } @@ -248,7 +248,7 @@ _ti_encode_count_str(char **cap, const c static __inline void _ti_encode_buf_16(TBUF *tbuf, size_t num) { - _DIAGASSERT(num <= USHRT_MAX); + _DIAGASSERT(num <= UINT16_MAX); le16enc(tbuf->buf + tbuf->bufpos, (uint16_t)num); tbuf->bufpos += sizeof(uint16_t); } @@ -256,7 +256,7 @@ _ti_encode_buf_16(TBUF *tbuf, size_t num static __inline void _ti_encode_buf_32(TBUF *tbuf, size_t num) { - _DIAGASSERT(num <= UINT_MAX); + _DIAGASSERT(num <= UINT32_MAX); le32enc(tbuf->buf + tbuf->bufpos, (uint32_t)num); tbuf->bufpos += sizeof(uint32_t); } @@ -273,8 +273,8 @@ static __inline void _ti_encode_buf_num(TBUF *tbuf, size_t num, int rtype) { if (rtype == TERMINFO_RTYPE_O1) { - if (num > SHRT_MAX) - num = SHRT_MAX; + if (num > INT16_MAX) + num = INT16_MAX; _ti_encode_buf_16(tbuf, num); } else { _ti_encode_buf_32(tbuf, num);
CVS commit: src/usr.bin/ktrace
Module Name:src Committed By: sevan Date: Sun Mar 29 17:50:23 UTC 2020 Modified Files: src/usr.bin/ktrace: ktrace.1 Log Message: tense To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/usr.bin/ktrace/ktrace.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/ktrace/ktrace.1 diff -u src/usr.bin/ktrace/ktrace.1:1.44 src/usr.bin/ktrace/ktrace.1:1.45 --- src/usr.bin/ktrace/ktrace.1:1.44 Sun Mar 29 17:48:18 2020 +++ src/usr.bin/ktrace/ktrace.1 Sun Mar 29 17:50:23 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: ktrace.1,v 1.44 2020/03/29 17:48:18 sevan Exp $ +.\" $NetBSD: ktrace.1,v 1.45 2020/03/29 17:50:23 sevan Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -277,7 +277,7 @@ on process 67 .Sh HISTORY The .Nm -command appears in +command appeared in .Bx 4.4 . The .Nm ktrace
CVS commit: src/external/bsd/libpcap/lib
Module Name:src Committed By: christos Date: Sun Mar 29 17:49:52 UTC 2020 Modified Files: src/external/bsd/libpcap/lib: Makefile Log Message: need bsd.init.mk to grab Makefile.inc To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/external/bsd/libpcap/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/lib/Makefile diff -u src/external/bsd/libpcap/lib/Makefile:1.27 src/external/bsd/libpcap/lib/Makefile:1.28 --- src/external/bsd/libpcap/lib/Makefile:1.27 Sun Mar 29 13:12:45 2020 +++ src/external/bsd/libpcap/lib/Makefile Sun Mar 29 13:49:52 2020 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.27 2020/03/29 17:12:45 christos Exp $ +# $NetBSD: Makefile,v 1.28 2020/03/29 17:49:52 christos Exp $ USE_SHLIBDIR=yes -.include +.include USE_FORT?= yes # network protocol library CPPFLAGS+= -DPCAP_DONT_INCLUDE_PCAP_BPF_H -DHAVE_CONFIG_H -DENABLE_REMOTE
CVS commit: src/usr.bin/ktrace
Module Name:src Committed By: sevan Date: Sun Mar 29 17:48:18 UTC 2020 Modified Files: src/usr.bin/ktrace: ktrace.1 Log Message: Document ktrace history To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/usr.bin/ktrace/ktrace.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/ktrace/ktrace.1 diff -u src/usr.bin/ktrace/ktrace.1:1.43 src/usr.bin/ktrace/ktrace.1:1.44 --- src/usr.bin/ktrace/ktrace.1:1.43 Thu Jan 8 22:03:42 2015 +++ src/usr.bin/ktrace/ktrace.1 Sun Mar 29 17:48:18 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: ktrace.1,v 1.43 2015/01/08 22:03:42 riastradh Exp $ +.\" $NetBSD: ktrace.1,v 1.44 2020/03/29 17:48:18 sevan Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 .\" -.Dd January 8, 2015 +.Dd March 29, 2020 .Dt KTRACE 1 .Os .Sh NAME @@ -279,3 +279,7 @@ The .Nm command appears in .Bx 4.4 . +The +.Nm ktrace +command appeared in +.Nx 1.5 .
CVS commit: src/external/bsd/libpcap
Module Name:src Committed By: christos Date: Sun Mar 29 17:30:30 UTC 2020 Modified Files: src/external/bsd/libpcap: Makefile Log Message: Descend to sbin To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libpcap/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/Makefile diff -u src/external/bsd/libpcap/Makefile:1.2 src/external/bsd/libpcap/Makefile:1.3 --- src/external/bsd/libpcap/Makefile:1.2 Sat Dec 4 22:00:44 2010 +++ src/external/bsd/libpcap/Makefile Sun Mar 29 13:30:30 2020 @@ -1,5 +1,5 @@ -# $NetBSD: Makefile,v 1.2 2010/12/05 03:00:44 christos Exp $ +# $NetBSD: Makefile,v 1.3 2020/03/29 17:30:30 christos Exp $ -SUBDIR= bin lib +SUBDIR= bin lib .WAIT sbin .include
CVS commit: src/etc/mtree
Module Name:src Committed By: christos Date: Sun Mar 29 17:14:13 UTC 2020 Modified Files: src/etc/mtree: NetBSD.dist.base Log Message: Add rpcapd examples To generate a diff of this commit: cvs rdiff -u -r1.211 -r1.212 src/etc/mtree/NetBSD.dist.base Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/mtree/NetBSD.dist.base diff -u src/etc/mtree/NetBSD.dist.base:1.211 src/etc/mtree/NetBSD.dist.base:1.212 --- src/etc/mtree/NetBSD.dist.base:1.211 Mon Mar 2 19:42:33 2020 +++ src/etc/mtree/NetBSD.dist.base Sun Mar 29 13:14:13 2020 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.211 2020/03/03 00:42:33 christos Exp $ +# $NetBSD: NetBSD.dist.base,v 1.212 2020/03/29 17:14:13 christos Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -410,6 +410,7 @@ ./usr/share/examples/racoon/roadwarrior ./usr/share/examples/racoon/roadwarrior/client ./usr/share/examples/racoon/roadwarrior/server +./usr/share/examples/rpcapd ./usr/share/examples/rtadvd ./usr/share/examples/slip ./usr/share/examples/smbfs
CVS commit: src/distrib/sets/lists
Module Name:src Committed By: christos Date: Sun Mar 29 17:13:47 UTC 2020 Modified Files: src/distrib/sets/lists/base: mi shl.mi src/distrib/sets/lists/debug: shl.mi src/distrib/sets/lists/man: mi src/distrib/sets/lists/misc: mi Log Message: enable remote for libpcap and add rpcapd To generate a diff of this commit: cvs rdiff -u -r1.1234 -r1.1235 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.880 -r1.881 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.239 -r1.240 src/distrib/sets/lists/debug/shl.mi cvs rdiff -u -r1.1683 -r1.1684 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.216 -r1.217 src/distrib/sets/lists/misc/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/mi diff -u src/distrib/sets/lists/base/mi:1.1234 src/distrib/sets/lists/base/mi:1.1235 --- src/distrib/sets/lists/base/mi:1.1234 Fri Mar 27 11:11:57 2020 +++ src/distrib/sets/lists/base/mi Sun Mar 29 13:13:46 2020 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1234 2020/03/27 15:11:57 christos Exp $ +# $NetBSD: mi,v 1.1235 2020/03/29 17:13:46 christos Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -1973,6 +1973,7 @@ ./usr/sbin/rpc.pcnfsdbase-nfsserver-bin ./usr/sbin/rpc.statdbase-nfsserver-bin ./usr/sbin/rpc.yppasswdd base-nis-bin yp +./usr/sbin/rpcapdbase-netutil-bin ./usr/sbin/rpcbindbase-rpcbind-bin ./usr/sbin/rtadvdbase-router-bin use_inet6 ./usr/sbin/rtquerybase-netutil-bin @@ -2314,6 +2315,7 @@ ./usr/share/examples/racoon/roadwarrior base-netutil-examples ./usr/share/examples/racoon/roadwarrior/client base-netutil-examples ./usr/share/examples/racoon/roadwarrior/server base-netutil-examples +./usr/share/examples/rpcapd base-netutil-examples ./usr/share/examples/rtadvd base-router-examples ./usr/share/examples/slip base-slip-examples ./usr/share/examples/smbfs base-sysutil-examples Index: src/distrib/sets/lists/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.880 src/distrib/sets/lists/base/shl.mi:1.881 --- src/distrib/sets/lists/base/shl.mi:1.880 Fri Mar 13 11:19:25 2020 +++ src/distrib/sets/lists/base/shl.mi Sun Mar 29 13:13:46 2020 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.880 2020/03/13 15:19:25 roy Exp $ +# $NetBSD: shl.mi,v 1.881 2020/03/29 17:13:46 christos Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -68,7 +68,7 @@ ./lib/libnvpair.so.0.0base-zfs-shlib dynamicroot,zfs ./lib/libpcap.sobase-sys-shlib dynamicroot ./lib/libpcap.so.8base-sys-shlib dynamicroot -./lib/libpcap.so.8.0base-sys-shlib dynamicroot +./lib/libpcap.so.8.1base-sys-shlib dynamicroot ./lib/libppath.sobase-sys-shlib dynamicroot ./lib/libppath.so.0base-sys-shlib dynamicroot ./lib/libppath.so.0.0base-sys-shlib dynamicroot @@ -490,7 +490,7 @@ ./usr/lib/libpanel.so.3.0 base-sys-shlib compatfile ./usr/lib/libpcap.sobase-net-shlib compatfile ./usr/lib/libpcap.so.8base-net-shlib compatfile -./usr/lib/libpcap.so.8.0 base-net-shlib compatfile +./usr/lib/libpcap.so.8.1 base-net-shlib compatfile ./usr/lib/libpci.sobase-sys-shlib compatfile ./usr/lib/libpci.so.2base-sys-shlib compatfile ./usr/lib/libpci.so.2.2base-sys-shlib compatfile Index: src/distrib/sets/lists/debug/shl.mi diff -u src/distrib/sets/lists/debug/shl.mi:1.239 src/distrib/sets/lists/debug/shl.mi:1.240 --- src/distrib/sets/lists/debug/shl.mi:1.239 Sat Mar 14 02:39:20 2020 +++ src/distrib/sets/lists/debug/shl.mi Sun Mar 29 13:13:46 2020 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.239 2020/03/14 06:39:20 skrll Exp $ +# $NetBSD: shl.mi,v 1.240 2020/03/29 17:13:46 christos Exp $ ./usr/lib/libbfd_g.a comp-c-debuglib debuglib,compatfile,binutils ./usr/libdata/debug/lib base-sys-usr debug,dynamicroot,compatdir ./usr/libdata/debug/lib/libavl.so.0.0.debug comp-zfs-debug debug,dynamicroot,zfs @@ -19,7 +19,7 @@ ./usr/libdata/debug/lib/libm.so.0.12.debug comp-sys-debug debug,dynamicroot ./usr/libdata/debug/lib/libnpf.so.0.1.debug comp-sys-debug debug,dynamicroot ./usr/libdata/debug/lib/libnvpair.so.0.0.debug comp-zfs-debug debug,dynamicroot,zfs -./usr/libdata/debug/lib/libpcap.so.8.0.debug comp-sys-debug debug,dynamicroot +./usr/libdata/debug/lib/libpcap.so.8.1.debug comp-sys-debug debug,dynamicroot ./usr/libdata/debug/lib/libppath.so.0.0.debug comp-sys-debug debug,dynamicroot ./usr/libdata/debug/lib/libprop.so.1.1.debug comp-sys-debug debug,dynamicroot ./usr/libdata/debug/lib/libpthread.so.1.4.debug comp-sys-debug debug,dynamicroot @@ -180,7 +180,7 @@ ./usr/libdata/debug/usr/lib/libpanel.so.1.0.debug comp-sys-debug debug,obsolete,compatfile ./usr/libdata/debug/usr/lib/libpanel.so.2.0.debug comp-sys-debug debug,obsolete,compatfile
CVS commit: src/external/bsd/libpcap
Module Name:src Committed By: christos Date: Sun Mar 29 17:12:45 UTC 2020 Modified Files: src/external/bsd/libpcap/dist: pcap-rpcap.c sockutils.c src/external/bsd/libpcap/lib: Makefile shlib_version Added Files: src/external/bsd/libpcap: Makefile.inc src/external/bsd/libpcap/sbin: Makefile Makefile.inc src/external/bsd/libpcap/sbin/rpcapd: Makefile Log Message: ENABLE_REMOTE and add rpcapd(8) To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/bsd/libpcap/Makefile.inc cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/libpcap/dist/pcap-rpcap.c \ src/external/bsd/libpcap/dist/sockutils.c cvs rdiff -u -r1.26 -r1.27 src/external/bsd/libpcap/lib/Makefile cvs rdiff -u -r1.6 -r1.7 src/external/bsd/libpcap/lib/shlib_version cvs rdiff -u -r0 -r1.1 src/external/bsd/libpcap/sbin/Makefile \ src/external/bsd/libpcap/sbin/Makefile.inc cvs rdiff -u -r0 -r1.1 src/external/bsd/libpcap/sbin/rpcapd/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap-rpcap.c diff -u src/external/bsd/libpcap/dist/pcap-rpcap.c:1.1.1.3 src/external/bsd/libpcap/dist/pcap-rpcap.c:1.2 --- src/external/bsd/libpcap/dist/pcap-rpcap.c:1.1.1.3 Tue Oct 1 12:00:26 2019 +++ src/external/bsd/libpcap/dist/pcap-rpcap.c Sun Mar 29 13:12:45 2020 @@ -2701,7 +2701,7 @@ SOCKET pcap_remoteact_accept(const char } /* checks if the connecting host is among the ones allowed */ - if (sock_check_hostlist((char *)hostlist, RPCAP_HOSTLIST_SEP, , errbuf, PCAP_ERRBUF_SIZE) < 0) + if (sock_check_hostlist(__UNCONST(hostlist), RPCAP_HOSTLIST_SEP, , errbuf, PCAP_ERRBUF_SIZE) < 0) { rpcap_senderror(sockctrl, 0, PCAP_ERR_REMOTEACCEPT, errbuf, NULL); sock_close(sockctrl, NULL, 0); Index: src/external/bsd/libpcap/dist/sockutils.c diff -u src/external/bsd/libpcap/dist/sockutils.c:1.1.1.3 src/external/bsd/libpcap/dist/sockutils.c:1.2 --- src/external/bsd/libpcap/dist/sockutils.c:1.1.1.3 Tue Oct 1 12:00:27 2019 +++ src/external/bsd/libpcap/dist/sockutils.c Sun Mar 29 13:12:45 2020 @@ -250,13 +250,13 @@ static int sock_ismcastaddr(const struct { if (saddr->sa_family == PF_INET) { - struct sockaddr_in *saddr4 = (struct sockaddr_in *) saddr; + const struct sockaddr_in *saddr4 = (const struct sockaddr_in *) saddr; if (IN_MULTICAST(ntohl(saddr4->sin_addr.s_addr))) return 0; else return -1; } else { - struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *) saddr; + const struct sockaddr_in6 *saddr6 = (const struct sockaddr_in6 *) saddr; if (IN6_IS_ADDR_MULTICAST(>sin6_addr)) return 0; else return -1; } @@ -1534,7 +1534,7 @@ int sock_getascii_addrport(const struct if ((flags & NI_NUMERICHOST) == 0) /* Check that we want literal names */ { if ((sockaddr->ss_family == AF_INET6) && - (memcmp(&((struct sockaddr_in6 *) sockaddr)->sin6_addr, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", sizeof(struct in6_addr)) == 0)) + (memcmp(&((const struct sockaddr_in6 *) sockaddr)->sin6_addr, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", sizeof(struct in6_addr)) == 0)) { if (address) pcap_strlcpy(address, SOCKET_NAME_NULL_DAD, addrlen); @@ -1542,7 +1542,7 @@ int sock_getascii_addrport(const struct } } - if (getnameinfo((struct sockaddr *) sockaddr, sockaddrlen, address, addrlen, port, portlen, flags) != 0) + if (getnameinfo((const struct sockaddr *) sockaddr, sockaddrlen, address, addrlen, port, portlen, flags) != 0) { /* If the user wants to receive an error message */ if (errbuf) Index: src/external/bsd/libpcap/lib/Makefile diff -u src/external/bsd/libpcap/lib/Makefile:1.26 src/external/bsd/libpcap/lib/Makefile:1.27 --- src/external/bsd/libpcap/lib/Makefile:1.26 Sun Oct 13 03:28:06 2019 +++ src/external/bsd/libpcap/lib/Makefile Sun Mar 29 13:12:45 2020 @@ -1,19 +1,14 @@ -# $NetBSD: Makefile,v 1.26 2019/10/13 07:28:06 mrg Exp $ +# $NetBSD: Makefile,v 1.27 2020/03/29 17:12:45 christos Exp $ USE_SHLIBDIR=yes .include USE_FORT?= yes # network protocol library -CPPFLAGS+= -DPCAP_DONT_INCLUDE_PCAP_BPF_H -DHAVE_CONFIG_H -I${.OBJDIR} +CPPFLAGS+= -DPCAP_DONT_INCLUDE_PCAP_BPF_H -DHAVE_CONFIG_H -DENABLE_REMOTE +CPPFLAGS+= -I${.OBJDIR} .SUFFIXES: .3 .3pcap -__sed: .USE - @rm -f ${.TARGET} - ${TOOL_SED} -e 's,@MAN_FILE_FORMATS@,5,g' \ - -e 's,@MAN_MISC_INFO@,7,g' \ - -e 's,3PCAP,3,g' < ${.ALLSRC} > ${.TARGET} - .3pcap.3: @rm -f ${.TARGET} ${TOOL_SED} -e 's,@MAN_FILE_FORMATS@,5,g' \ @@ -23,10 +18,9 @@ __sed: .USE # Search first in the kernel for bpf_filter.c .PATH: ${NETBSDSRCDIR}/sys/net -SRCDIR= ${.CURDIR}/../dist -.PATH: ${SRCDIR} +.PATH: ${SRCDIR} -LIB= pcap +LIB= pcap MAN3= \ pcap_activate.3pcap \ pcap_breakloop.3pcap \ @@ -142,11 +136,15 @@ nametoaddr.c \ optimize.c \ pcap-bpf.c \ pcap-common.c \ +pcap-new.c \ +pcap-rpcap.c \ pcap.c \ +rpcap-protocol.c \ savefile.c \ scanner.l \ sf-pcap.c \
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jdolecek Date: Sun Mar 29 15:38:29 UTC 2020 Modified Files: src/sys/arch/xen/xen: xennetback_xenbus.c Log Message: completely g/c the #if 0'ed xennetback_tx_free(), it's not used any more To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.87 src/sys/arch/xen/xen/xennetback_xenbus.c:1.88 --- src/sys/arch/xen/xen/xennetback_xenbus.c:1.87 Sun Mar 29 15:35:31 2020 +++ src/sys/arch/xen/xen/xennetback_xenbus.c Sun Mar 29 15:38:29 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: xennetback_xenbus.c,v 1.87 2020/03/29 15:35:31 jdolecek Exp $ */ +/* $NetBSD: xennetback_xenbus.c,v 1.88 2020/03/29 15:38:29 jdolecek Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -25,7 +25,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.87 2020/03/29 15:35:31 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.88 2020/03/29 15:38:29 jdolecek Exp $"); #include "opt_xen.h" @@ -132,9 +132,6 @@ static void xennetback_frontend_changed( static inline void xennetback_tx_response(struct xnetback_instance *, int, int); static void xennetback_mbuf_addr(struct mbuf *, paddr_t *, int *); -#if 0 /* XXX */ -static void xennetback_tx_free(struct mbuf * , void *, size_t, void *); -#endif /* XXX */ static SLIST_HEAD(, xnetback_instance) xnetback_instances; static kmutex_t xnetback_lock; @@ -871,26 +868,6 @@ xennetback_evthandler(void *arg) return 1; } -#if 0 /* XXX */ -static void -xennetback_tx_free(struct mbuf *m, void *va, size_t size, void *arg) -{ - int s = splnet(); - struct xni_pkt *pkt = arg; - struct xnetback_instance *xneti = pkt->pkt_xneti; - - XENPRINTF(("xennetback_tx_free\n")); - - xennetback_tx_response(xneti, pkt->pkt_id, NETIF_RSP_OKAY); - - xni_pkt_unmap(pkt, (vaddr_t)va & ~PAGE_MASK); - - if (m) - pool_cache_put(mb_cache, m); - splx(s); -} -#endif /* XXX */ - static int xennetback_ifioctl(struct ifnet *ifp, u_long cmd, void *data) {
CVS commit: src/sys/arch/xen/xen
Module Name:src Committed By: jdolecek Date: Sun Mar 29 15:35:31 UTC 2020 Modified Files: src/sys/arch/xen/xen: xennetback_xenbus.c Log Message: in xennetback_evthandler() just copy the DomU packet into destination mbuf via hypervisor GNTTABOP_copy op instead of mapping the buffer into Dom0 memory no performance difference observed for now - it would probably make more difference if Dom0 was MP, or when Dom0 is under VM pressure this will eventually be updated to batch copy the DomU packets To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.86 src/sys/arch/xen/xen/xennetback_xenbus.c:1.87 --- src/sys/arch/xen/xen/xennetback_xenbus.c:1.86 Fri Mar 27 18:37:30 2020 +++ src/sys/arch/xen/xen/xennetback_xenbus.c Sun Mar 29 15:35:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: xennetback_xenbus.c,v 1.86 2020/03/27 18:37:30 jdolecek Exp $ */ +/* $NetBSD: xennetback_xenbus.c,v 1.87 2020/03/29 15:35:31 jdolecek Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -25,7 +25,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.86 2020/03/27 18:37:30 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.87 2020/03/29 15:35:31 jdolecek Exp $"); #include "opt_xen.h" @@ -79,16 +79,6 @@ extern pt_entry_t xpmap_pg_nx; /* linux wants at last 16 bytes free in front of the packet */ #define LINUX_REQUESTED_OFFSET 16 -/* hash list for TX requests */ -/* descriptor of a packet being handled by the kernel */ -struct xni_pkt { - int pkt_id; /* packet's ID */ - grant_handle_t pkt_handle; - struct xnetback_instance *pkt_xneti; /* pointer back to our softc */ -}; - -/* pools for xni_pkt */ -struct pool xni_pkt_pool; /* ratecheck(9) for pool allocation failures */ static const struct timeval xni_pool_errintvl = { 30, 0 }; /* 30s, each */ @@ -141,6 +131,7 @@ static void xennetback_frontend_changed( static inline void xennetback_tx_response(struct xnetback_instance *, int, int); +static void xennetback_mbuf_addr(struct mbuf *, paddr_t *, int *); #if 0 /* XXX */ static void xennetback_tx_free(struct mbuf * , void *, size_t, void *); #endif /* XXX */ @@ -192,13 +183,6 @@ static struct _pages_pool_free { } pages_pool_free[NB_XMIT_PAGES_BATCH]; -static inline void -xni_pkt_unmap(struct xni_pkt *pkt, vaddr_t pkt_va) -{ - xen_shm_unmap(pkt_va, 1, >pkt_handle); - pool_put(_pkt_pool, pkt); -} - void xvifattach(int n) { @@ -223,8 +207,6 @@ xvifattach(int n) mcl_pages_alloc = NB_XMIT_PAGES_BATCH - 1; /* initialise pools */ - pool_init(_pkt_pool, sizeof(struct xni_pkt), 0, 0, 0, - "xnbpkt", NULL, IPL_VM); xmit_pages_cache = pool_cache_init(PAGE_SIZE, 0, 0, 0, "xnbxm", NULL, IPL_VM, NULL, NULL, NULL); @@ -732,6 +714,10 @@ xennetback_tx_check_packet(const netif_t if (__predict_false(txreq->size > maxlen)) return "too big"; + /* Somewhat duplicit, MCLBYTES is > ETHER_MAX_LEN */ + if (__predict_false(txreq->size > MCLBYTES)) + return "bigger than MCLBYTES"; + return NULL; } @@ -741,11 +727,12 @@ xennetback_evthandler(void *arg) struct xnetback_instance *xneti = arg; struct ifnet *ifp = >xni_if; netif_tx_request_t txreq; - struct xni_pkt *pkt; - vaddr_t pkt_va; struct mbuf *m; - int receive_pending, err; + int receive_pending; RING_IDX req_cons; + gnttab_copy_t gop; + paddr_t pa; + int offset; XENPRINTF(("xennetback_evthandler ")); req_cons = xneti->xni_txring.req_cons; @@ -797,52 +784,64 @@ xennetback_evthandler(void *arg) if_statinc(ifp, if_ierrors); continue; } + if (txreq.size > MHLEN) { + MCLGET(m, M_DONTWAIT); + if (__predict_false(m->m_ext_storage.ext_buf == NULL)) { +m_freem(m); +xennetback_tx_response(xneti, txreq.id, +NETIF_RSP_DROPPED); +if_statinc(ifp, if_ierrors); +continue; + } + } XENPRINTF(("%s pkt offset %d size %d id %d req_cons %d\n", xneti->xni_if.if_xname, txreq.offset, txreq.size, txreq.id, MASK_NETIF_TX_IDX(req_cons))); - pkt = pool_get(_pkt_pool, PR_NOWAIT); - if (__predict_false(pkt == NULL)) { - static struct timeval lasttime; - if (ratecheck(, _pool_errintvl)) -printf("%s: xnbpkt alloc failed\n", -ifp->if_xname); - xennetback_tx_response(xneti, txreq.id, - NETIF_RSP_DROPPED); - if_statinc(ifp, if_ierrors); + /* + * Copy the data and ack it. Delaying it until the mbuf is + * freed will stall transmit. + */ + xennetback_mbuf_addr(m, , ); + memset(, 0, sizeof(gop)); + gop.flags = GNTCOPY_source_gref; + gop.len = txreq.size; + + gop.source.u.ref = txreq.gref; + gop.source.offset = txreq.offset; + gop.source.domid = xneti->xni_domid; + + gop.dest.offset = offset; + gop.dest.domid =
CVS commit: src/crypto/external/bsd/openssl/dist/crypto/md4
Module Name:src Committed By: christos Date: Sun Mar 29 14:58:22 UTC 2020 Modified Files: src/crypto/external/bsd/openssl/dist/crypto/md4: md4_dgst.c Log Message: restore previous unsigned change. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/crypto/external/bsd/openssl/dist/crypto/md4/md4_dgst.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/openssl/dist/crypto/md4/md4_dgst.c diff -u src/crypto/external/bsd/openssl/dist/crypto/md4/md4_dgst.c:1.8 src/crypto/external/bsd/openssl/dist/crypto/md4/md4_dgst.c:1.9 --- src/crypto/external/bsd/openssl/dist/crypto/md4/md4_dgst.c:1.8 Sat Mar 21 20:53:06 2020 +++ src/crypto/external/bsd/openssl/dist/crypto/md4/md4_dgst.c Sun Mar 29 10:58:22 2020 @@ -37,7 +37,7 @@ int MD4_Init(MD4_CTX *c) void md4_block_data_order(MD4_CTX *c, const void *data_, size_t num) { const unsigned char *data = data_; -register MD32_REG_T A, B, C, D, l; +register unsigned MD32_REG_T A, B, C, D, l; # ifndef MD32_XARRAY /* See comment in crypto/sha/sha_local.h for details. */ unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
CVS commit: src/sys/dev/ic
Module Name:src Committed By: jmcneill Date: Sun Mar 29 13:20:04 UTC 2020 Modified Files: src/sys/dev/ic: bcmgenet.c Log Message: Try to use the existing HW address programmed into the device if possible. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/bcmgenet.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/dev/ic/bcmgenet.c diff -u src/sys/dev/ic/bcmgenet.c:1.4 src/sys/dev/ic/bcmgenet.c:1.5 --- src/sys/dev/ic/bcmgenet.c:1.4 Sun Mar 29 13:04:15 2020 +++ src/sys/dev/ic/bcmgenet.c Sun Mar 29 13:20:04 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bcmgenet.c,v 1.4 2020/03/29 13:04:15 jmcneill Exp $ */ +/* $NetBSD: bcmgenet.c,v 1.5 2020/03/29 13:20:04 jmcneill Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -34,7 +34,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.4 2020/03/29 13:04:15 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.5 2020/03/29 13:20:04 jmcneill Exp $"); #include #include @@ -823,28 +823,38 @@ static void genet_get_eaddr(struct genet_softc *sc, uint8_t *eaddr) { prop_dictionary_t prop = device_properties(sc->sc_dev); - uint32_t maclo, machi; + uint32_t maclo, machi, val; prop_data_t eaprop; eaprop = prop_dictionary_get(prop, "mac-address"); - if (eaprop == NULL) { - /* Create one */ - maclo = 0x00f2 | (cprng_strong32() & 0x); - machi = cprng_strong32() & 0x; - - eaddr[0] = maclo & 0xff; - eaddr[1] = (maclo >> 8) & 0xff; - eaddr[2] = (maclo >> 16) & 0xff; - eaddr[3] = (maclo >> 24) & 0xff; - eaddr[4] = machi & 0xff; - eaddr[5] = (machi >> 8) & 0xff; - } else { + if (eaprop != NULL) { KASSERT(prop_object_type(eaprop) == PROP_TYPE_DATA); KASSERT(prop_data_size(eaprop) == ETHER_ADDR_LEN); memcpy(eaddr, prop_data_data_nocopy(eaprop), ETHER_ADDR_LEN); + return; + } + + maclo = machi = 0; + + val = RD4(sc, GENET_SYS_RBUF_FLUSH_CTRL); + if ((val & GENET_SYS_RBUF_FLUSH_RESET) == 0) { + maclo = htobe32(RD4(sc, GENET_UMAC_MAC0)); + machi = htobe16(RD4(sc, GENET_UMAC_MAC1) & 0x); + } + + if (maclo == 0 && machi == 0) { + /* Create one */ + maclo = 0x00f2 | (cprng_strong32() & 0x); + machi = cprng_strong32() & 0x; } + eaddr[0] = maclo & 0xff; + eaddr[1] = (maclo >> 8) & 0xff; + eaddr[2] = (maclo >> 16) & 0xff; + eaddr[3] = (maclo >> 24) & 0xff; + eaddr[4] = machi & 0xff; + eaddr[5] = (machi >> 8) & 0xff; } static int
CVS commit: src/sys/dev/ic
Module Name:src Committed By: jmcneill Date: Sun Mar 29 13:04:15 UTC 2020 Modified Files: src/sys/dev/ic: bcmgenet.c Log Message: Avoid "hole in RX ring" condition by ensuring a new mbuf is available before using an existing one. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/bcmgenet.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/dev/ic/bcmgenet.c diff -u src/sys/dev/ic/bcmgenet.c:1.3 src/sys/dev/ic/bcmgenet.c:1.4 --- src/sys/dev/ic/bcmgenet.c:1.3 Thu Feb 27 17:30:07 2020 +++ src/sys/dev/ic/bcmgenet.c Sun Mar 29 13:04:15 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bcmgenet.c,v 1.3 2020/02/27 17:30:07 jmcneill Exp $ */ +/* $NetBSD: bcmgenet.c,v 1.4 2020/03/29 13:04:15 jmcneill Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -34,7 +34,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.3 2020/02/27 17:30:07 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.4 2020/03/29 13:04:15 jmcneill Exp $"); #include #include @@ -626,7 +626,17 @@ genet_rxintr(struct genet_softc *sc, int status = RD4(sc, GENET_RX_DESC_STATUS(index)); len = __SHIFTOUT(status, GENET_RX_DESC_STATUS_BUFLEN); - /* XXX check for errors */ + m = sc->sc_rx.buf_map[index].mbuf; + + if ((m0 = genet_alloc_mbufcl(sc)) == NULL) { + if_statinc(ifp, if_ierrors); + goto next; + } + error = genet_setup_rxbuf(sc, index, m0); + if (error != 0) { + if_statinc(ifp, if_ierrors); + goto next; + } bus_dmamap_sync(sc->sc_rx.buf_tag, sc->sc_rx.buf_map[index].map, 0, sc->sc_rx.buf_map[index].map->dm_mapsize, @@ -637,8 +647,6 @@ genet_rxintr(struct genet_softc *sc, int n, index, status, len, len - ETHER_ALIGN); if (len > ETHER_ALIGN) { - m = sc->sc_rx.buf_map[index].mbuf; - m_adj(m, ETHER_ALIGN); m_set_rcvif(m, ifp); @@ -648,15 +656,7 @@ genet_rxintr(struct genet_softc *sc, int if_percpuq_enqueue(ifp->if_percpuq, m); } - if ((m0 = genet_alloc_mbufcl(sc)) != NULL) { - error = genet_setup_rxbuf(sc, index, m0); - if (error != 0) { -/* XXX hole in RX ring */ - } - } else { - if_statinc(ifp, if_ierrors); - } - +next: index = RX_NEXT(index); sc->sc_rx.cidx = (sc->sc_rx.cidx + 1) & 0x;
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Sun Mar 29 12:48:22 UTC 2020 Modified Files: src/doc [netbsd-8]: CHANGES-8.2 Log Message: Not distrib note changes To generate a diff of this commit: cvs rdiff -u -r1.1.2.113 -r1.1.2.114 src/doc/CHANGES-8.2 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-8.2 diff -u src/doc/CHANGES-8.2:1.1.2.113 src/doc/CHANGES-8.2:1.1.2.114 --- src/doc/CHANGES-8.2:1.1.2.113 Sun Mar 29 12:11:41 2020 +++ src/doc/CHANGES-8.2 Sun Mar 29 12:48:22 2020 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.2,v 1.1.2.113 2020/03/29 12:11:41 martin Exp $ +# $NetBSD: CHANGES-8.2,v 1.1.2.114 2020/03/29 12:48:22 martin Exp $ A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2 release: @@ -2178,6 +2178,17 @@ distrib/notes/newsmips/xfer 1.3 links to the homepage. Remove outdated copy of the program. [martin] +distrib/notes/bebox/prep (manually edited) +distrib/notes/common/main (manually edited) +distrib/notes/common/postinstall (manually edited) +distrib/notes/ews4800mips/xfer (manually edited) +distrib/notes/i386/xfer(manually edited) +distrib/notes/news68k/xfer (manually edited) +distrib/notes/newsmips/xfer (manually edited) + + Prepare for 8.2 release. + [martin] + include/stdio.h 1.98 Move P_tmpdir from "/var/tmp/" to "/tmp/".
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Sun Mar 29 12:11:41 UTC 2020 Modified Files: src/doc [netbsd-8]: CHANGES-8.2 Log Message: Tickets #1526 and #1527 To generate a diff of this commit: cvs rdiff -u -r1.1.2.112 -r1.1.2.113 src/doc/CHANGES-8.2 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-8.2 diff -u src/doc/CHANGES-8.2:1.1.2.112 src/doc/CHANGES-8.2:1.1.2.113 --- src/doc/CHANGES-8.2:1.1.2.112 Sun Mar 29 11:48:21 2020 +++ src/doc/CHANGES-8.2 Sun Mar 29 12:11:41 2020 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.2,v 1.1.2.112 2020/03/29 11:48:21 martin Exp $ +# $NetBSD: CHANGES-8.2,v 1.1.2.113 2020/03/29 12:11:41 martin Exp $ A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2 release: @@ -2178,3 +2178,17 @@ distrib/notes/newsmips/xfer 1.3 links to the homepage. Remove outdated copy of the program. [martin] +include/stdio.h 1.98 + + Move P_tmpdir from "/var/tmp/" to "/tmp/". + [mrg, ticket #1526] + +sys/dev/scsipi/cd.c1.343 +sys/kern/subr_disk.c1.130 + + PR 55104: + Avoid division by zero if label isn't valid. + Allow open of RAWPART even when no medium is loaded. + Keep errors silent if no medium is loaded. + [mlelstv, ticket #1527] +
CVS commit: [netbsd-8] src/sys
Module Name:src Committed By: martin Date: Sun Mar 29 12:10:37 UTC 2020 Modified Files: src/sys/dev/scsipi [netbsd-8]: cd.c src/sys/kern [netbsd-8]: subr_disk.c Log Message: Pull up following revision(s) (requested by mlelstv in ticket #1527): sys/dev/scsipi/cd.c: revision 1.343 sys/kern/subr_disk.c: revision 1.130 Avoid division by zero if label isn't valid. Allow open of RAWPART even when no medium is loaded. Keep errors silent if no medium is loaded. Fixes PR kern/55104 To generate a diff of this commit: cvs rdiff -u -r1.340.6.1 -r1.340.6.2 src/sys/dev/scsipi/cd.c cvs rdiff -u -r1.119.2.2 -r1.119.2.3 src/sys/kern/subr_disk.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/dev/scsipi/cd.c diff -u src/sys/dev/scsipi/cd.c:1.340.6.1 src/sys/dev/scsipi/cd.c:1.340.6.2 --- src/sys/dev/scsipi/cd.c:1.340.6.1 Wed Jun 21 18:18:55 2017 +++ src/sys/dev/scsipi/cd.c Sun Mar 29 12:10:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cd.c,v 1.340.6.1 2017/06/21 18:18:55 snj Exp $ */ +/* $NetBSD: cd.c,v 1.340.6.2 2020/03/29 12:10:37 martin Exp $ */ /*- * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation, @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.340.6.1 2017/06/21 18:18:55 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.340.6.2 2020/03/29 12:10:37 martin Exp $"); #include #include @@ -401,8 +401,8 @@ cd_firstopen(device_t self, dev_t dev, i else silent = 0; - /* make cdclose() loud again */ - cd->flags &= ~CDF_EJECTED; + /* make cdclose() silent */ + cd->flags |= CDF_EJECTED; /* Check that it is still responding and ok. */ error = scsipi_test_unit_ready(periph, @@ -419,8 +419,11 @@ cd_firstopen(device_t self, dev_t dev, i if (error == EINVAL) error = EIO; } - if (error) + if (error) { + if (part == RAW_PART) + goto out; goto bad; + } /* Lock the pack in. */ error = scsipi_prevent(periph, SPAMR_PREVENT_DT, @@ -448,6 +451,9 @@ cd_firstopen(device_t self, dev_t dev, i SC_DEBUG(periph, SCSIPI_DB3, ("Params loaded ")); cd_set_geometry(cd); + + /* make cdclose() loud again */ + cd->flags &= ~CDF_EJECTED; } periph->periph_flags |= PERIPH_OPEN; @@ -519,7 +525,8 @@ cd_lastclose(device_t self) struct scsipi_adapter *adapt = periph->periph_channel->chan_adapter; int silent; - if (cd->flags & CDF_EJECTED) + if ((cd->flags & CDF_EJECTED) != 0 || + (periph->periph_flags & PERIPH_MEDIA_LOADED) == 0) silent = XS_CTL_SILENT; else silent = 0; @@ -1213,6 +1220,14 @@ cdioctl(dev_t dev, u_long cmd, void *add return (EIO); switch (cmd) { + case DIOCTUR: { + /* test unit ready */ + error = scsipi_test_unit_ready(cd->sc_periph, XS_CTL_SILENT); + *((int*)addr) = (error == 0); + if (error == ENODEV || error == EIO || error == 0) + return 0; + return error; + } case CDIOCPLAYTRACKS: { /* PLAY_MSF command */ struct ioc_play_track *args = addr; @@ -1447,15 +1462,18 @@ static void cd_label(device_t self, struct disklabel *lp) { struct cd_softc *cd = device_private(self); + struct scsipi_periph *periph = cd->sc_periph; struct cd_formatted_toc toc; - int lastsession; + int lastsession = 0; strncpy(lp->d_typename, "optical media", 16); lp->d_rpm = 300; - lp->d_flags |= D_REMOVABLE | D_SCSI_MMC; + lp->d_flags |= D_REMOVABLE; - if (cdreadmsaddr(cd, , ) != 0) - lastsession = 0; + if ((periph->periph_flags & PERIPH_MEDIA_LOADED) != 0) { + lp->d_flags |= D_SCSI_MMC; + (void) cdreadmsaddr(cd, , ); + } lp->d_partitions[0].p_offset = 0; lp->d_partitions[0].p_size = lp->d_secperunit; Index: src/sys/kern/subr_disk.c diff -u src/sys/kern/subr_disk.c:1.119.2.2 src/sys/kern/subr_disk.c:1.119.2.3 --- src/sys/kern/subr_disk.c:1.119.2.2 Fri Nov 1 09:29:25 2019 +++ src/sys/kern/subr_disk.c Sun Mar 29 12:10:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_disk.c,v 1.119.2.2 2019/11/01 09:29:25 martin Exp $ */ +/* $NetBSD: subr_disk.c,v 1.119.2.3 2020/03/29 12:10:37 martin Exp $ */ /*- * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.119.2.2 2019/11/01 09:29:25 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.119.2.3 2020/03/29 12:10:37 martin Exp $"); #include #include @@ -429,6 +429,10 @@ int disk_read_sectors(void (*strat)(struct buf *), const struct disklabel *lp, struct buf *bp, unsigned int sector, int count) { + + if ((lp->d_secsize / DEV_BSIZE) == 0 || lp->d_secpercyl == 0) + return EINVAL; + bp->b_blkno = btodb((off_t)sector * lp->d_secsize); bp->b_bcount = count * lp->d_secsize; bp->b_flags = (bp->b_flags & ~B_WRITE) | B_READ;
CVS commit: [netbsd-8] src/include
Module Name:src Committed By: martin Date: Sun Mar 29 12:08:38 UTC 2020 Modified Files: src/include [netbsd-8]: stdio.h Log Message: Pull up following revision(s) (requested by mrg in ticket #1526): include/stdio.h: revision 1.98 move P_tmpdir from "/var/tmp/" to "/tmp/". the main effect of this is to make GCC and other libiberty using tools use /tmp instead of /var/tmp for compiler temp files, which can be a bottleneck on larger systems. a survey of other platforms shows only OSX also uses /var/tmp, everyone else has switched to /tmp long ago. cons: some smaller systems may have a smaller /tmp than /var/tmp, and this may cause builds to fail with out of space earlier. point the build to /var/tmp using TMPDIR in this case. one can argue that setting TMPDIR would work around this, but we want to have the effect for all users without having special setup. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.97.8.1 src/include/stdio.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/stdio.h diff -u src/include/stdio.h:1.97 src/include/stdio.h:1.97.8.1 --- src/include/stdio.h:1.97 Thu Mar 17 00:42:49 2016 +++ src/include/stdio.h Sun Mar 29 12:08:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: stdio.h,v 1.97 2016/03/17 00:42:49 christos Exp $ */ +/* $NetBSD: stdio.h,v 1.97.8.1 2020/03/29 12:08:37 martin Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -193,7 +193,7 @@ __END_DECLS /* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) -#define P_tmpdir "/var/tmp/" +#define P_tmpdir "/tmp/" #endif #define L_tmpnam 1024 /* XXX must be == PATH_MAX */ /* Always ensure that this is consistent with */
CVS commit: [netbsd-8] src/distrib/notes
Module Name:src Committed By: martin Date: Sun Mar 29 11:59:06 UTC 2020 Modified Files: src/distrib/notes/bebox [netbsd-8]: prep src/distrib/notes/common [netbsd-8]: main postinstall src/distrib/notes/ews4800mips [netbsd-8]: xfer src/distrib/notes/i386 [netbsd-8]: xfer src/distrib/notes/news68k [netbsd-8]: xfer src/distrib/notes/newsmips [netbsd-8]: xfer Log Message: Prepare for 8.2 release. To generate a diff of this commit: cvs rdiff -u -r1.2.40.1 -r1.2.40.2 src/distrib/notes/bebox/prep cvs rdiff -u -r1.535.2.6 -r1.535.2.7 src/distrib/notes/common/main cvs rdiff -u -r1.81 -r1.81.8.1 src/distrib/notes/common/postinstall cvs rdiff -u -r1.2.38.1 -r1.2.38.2 src/distrib/notes/ews4800mips/xfer cvs rdiff -u -r1.20.38.1 -r1.20.38.2 src/distrib/notes/i386/xfer cvs rdiff -u -r1.3.38.1 -r1.3.38.2 src/distrib/notes/news68k/xfer cvs rdiff -u -r1.2.38.1 -r1.2.38.2 src/distrib/notes/newsmips/xfer Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/notes/bebox/prep diff -u src/distrib/notes/bebox/prep:1.2.40.1 src/distrib/notes/bebox/prep:1.2.40.2 --- src/distrib/notes/bebox/prep:1.2.40.1 Sun Mar 29 11:45:13 2020 +++ src/distrib/notes/bebox/prep Sun Mar 29 11:59:06 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: prep,v 1.2.40.1 2020/03/29 11:45:13 martin Exp $ +.\" $NetBSD: prep,v 1.2.40.2 2020/03/29 11:59:06 martin Exp $ . .Pp . @@ -46,7 +46,7 @@ and use it to write the floppy image(s) you can use the .Ic Rawrite32 Windows program which can be found at -.Lk https://www.NetBSD.org/~martin/rawrite32 . +.Lk https://www.NetBSD.org/~martin/rawrite32 .Pp Also you can create boot.fs in the following way: .Pp Index: src/distrib/notes/common/main diff -u src/distrib/notes/common/main:1.535.2.6 src/distrib/notes/common/main:1.535.2.7 --- src/distrib/notes/common/main:1.535.2.6 Sun Mar 29 11:45:13 2020 +++ src/distrib/notes/common/main Sun Mar 29 11:59:06 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: main,v 1.535.2.6 2020/03/29 11:45:13 martin Exp $ +.\" $NetBSD: main,v 1.535.2.7 2020/03/29 11:59:06 martin Exp $ .\" .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -259,7 +259,7 @@ which can be found at .Lk http://sourceforge.net/projects/win32diskimager/ or Rawrite32 which can be found at -.Lk https://www.NetBSD.org/~martin/rawrite32 . +.Lk https://www.NetBSD.org/~martin/rawrite32 .if \n[amd64]:\n[i386] \{\ If you have problems writing a raw image to a floppy, the @@ -480,7 +480,7 @@ would not exist. . .if \n[FOR_RELEASE] \{\ .Pp -.Ss Changes Between The NetBSD 8.0 and 8.1 Releases +.Ss Changes Between The NetBSD 8.1 and 8.2 Releases .Pp The .Nx @@ -489,8 +489,8 @@ is the first security/critical update of It represents a selected subset of fixes deemed important for security or stability reasons. The complete list of changes can be found in the -CHANGES-8.1: -.Lk https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.1/CHANGES-8.1 +CHANGES-8.2: +.Lk https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.2/CHANGES-8.2 file in the top level directory of the NetBSD \*V release tree. @@ -566,6 +566,8 @@ Changes between the 7.0 and 8.0 releases Changes between the initial 8.0 branch and final release of 8.0. .It Li CHANGES-8.1 Changes between the 8.0 release and the 8.1 release. +.It Li CHANGES-8.2 +Changes between the 8.1 release and the 8.2 release. .It Li CHANGES.prev Changes in previous .Nx Index: src/distrib/notes/common/postinstall diff -u src/distrib/notes/common/postinstall:1.81 src/distrib/notes/common/postinstall:1.81.8.1 --- src/distrib/notes/common/postinstall:1.81 Tue May 19 19:30:27 2015 +++ src/distrib/notes/common/postinstall Sun Mar 29 11:59:06 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: postinstall,v 1.81 2015/05/19 19:30:27 snj Exp $ +.\" $NetBSD: postinstall,v 1.81.8.1 2020/03/29 11:59:06 martin Exp $ .\" .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -373,7 +373,7 @@ post-installation configuration menu, th .Xr pkgsrc 7 framework for compiling packages can be obtained by retrieving the file -.Lk ftp://ftp.NetBSD.org/pub/pkgsrc/pkgsrc.tar.gz . +.Lk ftp://ftp.NetBSD.org/pub/pkgsrc/pkgsrc.tar.gz It is typically extracted into .Pa /usr/pkgsrc (though other locations work fine) with the commands: Index: src/distrib/notes/ews4800mips/xfer diff -u src/distrib/notes/ews4800mips/xfer:1.2.38.1 src/distrib/notes/ews4800mips/xfer:1.2.38.2 --- src/distrib/notes/ews4800mips/xfer:1.2.38.1 Sun Mar 29 11:45:13 2020 +++ src/distrib/notes/ews4800mips/xfer Sun Mar 29 11:59:06 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: xfer,v 1.2.38.1 2020/03/29 11:45:13 martin Exp $ +.\" $NetBSD: xfer,v 1.2.38.2 2020/03/29 11:59:06 martin Exp $ .\" .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -61,7 +61,7 @@ and use it to write the floppy image(s) .Ic Rawrite32 Windows program. It can be
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Sun Mar 29 11:48:21 UTC 2020 Modified Files: src/doc [netbsd-8]: CHANGES-8.2 Log Message: Note Rawrite32/distrib note changes To generate a diff of this commit: cvs rdiff -u -r1.1.2.111 -r1.1.2.112 src/doc/CHANGES-8.2 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-8.2 diff -u src/doc/CHANGES-8.2:1.1.2.111 src/doc/CHANGES-8.2:1.1.2.112 --- src/doc/CHANGES-8.2:1.1.2.111 Fri Mar 27 08:49:53 2020 +++ src/doc/CHANGES-8.2 Sun Mar 29 11:48:21 2020 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.2,v 1.1.2.111 2020/03/27 08:49:53 sborrill Exp $ +# $NetBSD: CHANGES-8.2,v 1.1.2.112 2020/03/29 11:48:21 martin Exp $ A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2 release: @@ -2166,3 +2166,15 @@ etc/named.conf 1.8 which no longer serves any useful purpose). [christos, ticket #1524] +src/sys/arch/i386/stand/misc/rawr32.exe.uue (delete) +distrib/notes/bebox/prep 1.3 +distrib/notes/common/main 1.547 +distrib/notes/ews4800mips/xfer 1.3 +distrib/notes/i386/xfer1.21 +distrib/notes/news68k/xfer 1.4 +distrib/notes/newsmips/xfer 1.3 + + Replace references to i386 install media for Rawrite32 with + links to the homepage. Remove outdated copy of the program. + [martin] +
CVS commit: [netbsd-8] src/distrib/notes
Module Name:src Committed By: martin Date: Sun Mar 29 11:45:13 UTC 2020 Modified Files: src/distrib/notes/bebox [netbsd-8]: prep src/distrib/notes/common [netbsd-8]: main src/distrib/notes/ews4800mips [netbsd-8]: xfer src/distrib/notes/i386 [netbsd-8]: xfer src/distrib/notes/news68k [netbsd-8]: xfer src/distrib/notes/newsmips [netbsd-8]: xfer Log Message: Pull up following revision(s): distrib/notes/ews4800mips/xfer: revision 1.3 distrib/notes/bebox/prep: revision 1.3 distrib/notes/newsmips/xfer: revision 1.3 distrib/notes/i386/xfer: revision 1.21 distrib/notes/common/main: revision 1.547 distrib/notes/news68k/xfer: revision 1.4 Replace references to i386 install media for Rawrite32 with links to the homepage. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.2.40.1 src/distrib/notes/bebox/prep cvs rdiff -u -r1.535.2.5 -r1.535.2.6 src/distrib/notes/common/main cvs rdiff -u -r1.2 -r1.2.38.1 src/distrib/notes/ews4800mips/xfer cvs rdiff -u -r1.20 -r1.20.38.1 src/distrib/notes/i386/xfer cvs rdiff -u -r1.3 -r1.3.38.1 src/distrib/notes/news68k/xfer cvs rdiff -u -r1.2 -r1.2.38.1 src/distrib/notes/newsmips/xfer Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/notes/bebox/prep diff -u src/distrib/notes/bebox/prep:1.2 src/distrib/notes/bebox/prep:1.2.40.1 --- src/distrib/notes/bebox/prep:1.2 Mon Nov 15 21:39:12 2010 +++ src/distrib/notes/bebox/prep Sun Mar 29 11:45:13 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: prep,v 1.2 2010/11/15 21:39:12 wiz Exp $ +.\" $NetBSD: prep,v 1.2.40.1 2020/03/29 11:45:13 martin Exp $ . .Pp . @@ -45,13 +45,8 @@ If you have an x86 PC which runs and use it to write the floppy image(s) to floppy disk, you can use the .Ic Rawrite32 -Windows32 program -.Pq installed by Pa rawr32.exe -available in the -.Pa i386/installation/misc/ -directory of the -.Nx -distribution. +Windows program which can be found at +.Lk https://www.NetBSD.org/~martin/rawrite32 . .Pp Also you can create boot.fs in the following way: .Pp Index: src/distrib/notes/common/main diff -u src/distrib/notes/common/main:1.535.2.5 src/distrib/notes/common/main:1.535.2.6 --- src/distrib/notes/common/main:1.535.2.5 Fri May 31 08:37:28 2019 +++ src/distrib/notes/common/main Sun Mar 29 11:45:13 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: main,v 1.535.2.5 2019/05/31 08:37:28 martin Exp $ +.\" $NetBSD: main,v 1.535.2.6 2020/03/29 11:45:13 martin Exp $ .\" .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -257,15 +257,14 @@ with the appropriate device for your sys On Windows, you will need to use a program such as Win32 Disk Imager, which can be found at .Lk http://sourceforge.net/projects/win32diskimager/ +or +Rawrite32 which can be found at +.Lk https://www.NetBSD.org/~martin/rawrite32 . .if \n[amd64]:\n[i386] \{\ If you have problems writing a raw image to a floppy, the .Ic rawrite.exe MS-DOS program -or the -.Ic Rawrite32 -Windows32 program (installed by -.Pa rawr32.exe ) in the .Pa \*M/installation/misc/ directory may be of help. Index: src/distrib/notes/ews4800mips/xfer diff -u src/distrib/notes/ews4800mips/xfer:1.2 src/distrib/notes/ews4800mips/xfer:1.2.38.1 --- src/distrib/notes/ews4800mips/xfer:1.2 Fri May 27 17:38:43 2011 +++ src/distrib/notes/ews4800mips/xfer Sun Mar 29 11:45:13 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: xfer,v 1.2 2011/05/27 17:38:43 tsutsui Exp $ +.\" $NetBSD: xfer,v 1.2.38.1 2020/03/29 11:45:13 martin Exp $ .\" .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -59,14 +59,9 @@ If you have an i386 machine which runs .Tn Microsoft Windows and use it to write the floppy image(s) to floppy disk, you can use the .Ic Rawrite32 -Windows32 program. -It can be installed by -Pa rawr32.exe -provided in the -.Pa i386/installation/misc/ -directory of the -.Nx -distribution. +Windows program. +It can be downloaded from +.Lk https://www.NetBSD.org/~martin/rawrite32 . .Ic rawrite utility for the .Tn MS-DOS Index: src/distrib/notes/i386/xfer diff -u src/distrib/notes/i386/xfer:1.20 src/distrib/notes/i386/xfer:1.20.38.1 --- src/distrib/notes/i386/xfer:1.20 Fri May 27 17:38:43 2011 +++ src/distrib/notes/i386/xfer Sun Mar 29 11:45:13 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: xfer,v 1.20 2011/05/27 17:38:43 tsutsui Exp $ +.\" $NetBSD: xfer,v 1.20.38.1 2020/03/29 11:45:13 martin Exp $ .\" .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -59,21 +59,16 @@ If you are using .Tn Microsoft Windows to write the floppy image(s) to floppy disk, you can use the .Ic Rawrite32 -Windows32 program. -It can be installed by -Pa rawr32.exe -provieded in the -.Pa i386/installation/misc -directory of the -.Nx -distribution. +Windows program. +It can be downloaded from +.Lk https://www.NetBSD.org/~martin/rawrite32 .
CVS commit: [netbsd-8] src/sys/arch/i386/stand/misc
Module Name:src Committed By: martin Date: Sun Mar 29 11:38:13 UTC 2020 Modified Files: src/sys/arch/i386/stand/misc [netbsd-8]: Makefile Removed Files: src/sys/arch/i386/stand/misc [netbsd-8]: rawr32.exe.uue Log Message: Remove outdated Rawrite32 copy To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.7.52.1 src/sys/arch/i386/stand/misc/Makefile cvs rdiff -u -r1.7 -r0 src/sys/arch/i386/stand/misc/rawr32.exe.uue 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/i386/stand/misc/Makefile diff -u src/sys/arch/i386/stand/misc/Makefile:1.7 src/sys/arch/i386/stand/misc/Makefile:1.7.52.1 --- src/sys/arch/i386/stand/misc/Makefile:1.7 Wed Oct 27 18:29:46 2010 +++ src/sys/arch/i386/stand/misc/Makefile Sun Mar 29 11:38:12 2020 @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.7 2010/10/27 18:29:46 martin Exp $ +# $NetBSD: Makefile,v 1.7.52.1 2020/03/29 11:38:12 martin Exp $ MISC_FILES= rawrite.c UUDECODE_FILES= pfdisk.doc pfdisk.exe pfdisktc.zip \ - rawr32.exe \ rawrite.doc rawrite.exe .include
CVS commit: src/sys/dev/usb
Module Name:src Committed By: tih Date: Sun Mar 29 10:46:10 UTC 2020 Modified Files: src/sys/dev/usb: ukbd.c Log Message: Summary: Introduce a keyboard event ring buffer for USB console keyboards For the console keyboard, events must be handled separately from the interrupt handler, because of the possibility that the user chooses to drop into DDB by use of the designated key combination. This delayed handling is tied to the HZ clock through the callout(9) mechanism, meaning that another keyboard event arriving within 10ms of the previous one might overwrite its predecessor before it's handled. This causes dropped events for fast typists - and the situation gets worse with modern, programmable, keyboards. This patch introduces a ring buffer in the ukbd_softc data structure, so that multiple pending events may be safely stored. To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/sys/dev/usb/ukbd.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/dev/usb/ukbd.c diff -u src/sys/dev/usb/ukbd.c:1.145 src/sys/dev/usb/ukbd.c:1.146 --- src/sys/dev/usb/ukbd.c:1.145 Sat Mar 14 02:35:33 2020 +++ src/sys/dev/usb/ukbd.c Sun Mar 29 10:46:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ukbd.c,v 1.145 2020/03/14 02:35:33 christos Exp $*/ +/* $NetBSD: ukbd.c,v 1.146 2020/03/29 10:46:10 tih Exp $*/ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.145 2020/03/14 02:35:33 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.146 2020/03/29 10:46:10 tih Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -258,7 +258,9 @@ struct ukbd_softc { int sc_console_keyboard; /* we are the console keyboard */ struct callout sc_delay; /* for quirk handling */ - struct ukbd_data sc_data; /* for quirk handling */ +#define MAXPENDING 32 + struct ukbd_data sc_data[MAXPENDING]; + size_t sc_data_w, sc_data_r; struct hid_location sc_apple_fn; struct hid_location sc_numloc; @@ -475,6 +477,9 @@ ukbd_attach(device_t parent, device_t se callout_init(>sc_delay, 0); + sc->sc_data_w = 0; + sc->sc_data_r = 0; + usb_init_task(>sc_ledtask, ukbd_set_leds_task, sc, 0); /* Flash the leds; no real purpose, just shows we're alive. */ @@ -686,8 +691,14 @@ ukbd_intr(struct uhidev *addr, void *ibu * generate a key up followed by a key down for the same * key after about 10 ms. * We avoid this bug by holding off decoding for 20 ms. + * Note that this comes at a cost: we deliberately overwrite + * the data for any keyboard event that is followed by + * another one within this time window. */ - sc->sc_data = *ud; + if (sc->sc_data_w == sc->sc_data_r) { + sc->sc_data_w = (sc->sc_data_w + 1) % MAXPENDING; + } + sc->sc_data[sc->sc_data_w] = *ud; callout_reset(>sc_delay, hz / 50, ukbd_delayed_decode, sc); #ifdef DDB } else if (sc->sc_console_keyboard && !(sc->sc_flags & FLAG_POLLING)) { @@ -697,8 +708,9 @@ ukbd_intr(struct uhidev *addr, void *ibu * polling from inside the interrupt routine and that * loses bigtime. */ - sc->sc_data = *ud; - callout_reset(>sc_delay, 1, ukbd_delayed_decode, sc); + sc->sc_data_w = (sc->sc_data_w + 1) % MAXPENDING; + sc->sc_data[sc->sc_data_w] = *ud; + callout_reset(>sc_delay, 0, ukbd_delayed_decode, sc); #endif } else { ukbd_decode(sc, ud); @@ -710,7 +722,10 @@ ukbd_delayed_decode(void *addr) { struct ukbd_softc *sc = addr; - ukbd_decode(sc, >sc_data); + while (sc->sc_data_r != sc->sc_data_w) { + sc->sc_data_r = (sc->sc_data_r + 1) % MAXPENDING; + ukbd_decode(sc, >sc_data[sc->sc_data_r]); + } } void
CVS commit: src/sys/arch/acorn32/eb7500atx
Module Name:src Committed By: skrll Date: Sun Mar 29 10:25:28 UTC 2020 Modified Files: src/sys/arch/acorn32/eb7500atx: eb7500atx_machdep.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/arch/acorn32/eb7500atx/eb7500atx_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/acorn32/eb7500atx/eb7500atx_machdep.c diff -u src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c:1.31 src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c:1.32 --- src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c:1.31 Tue Jul 16 14:41:43 2019 +++ src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c Sun Mar 29 10:25:28 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: eb7500atx_machdep.c,v 1.31 2019/07/16 14:41:43 skrll Exp $ */ +/* $NetBSD: eb7500atx_machdep.c,v 1.32 2020/03/29 10:25:28 skrll Exp $ */ /* * Copyright (c) 2000-2002 Reinoud Zandijk. @@ -55,7 +55,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: eb7500atx_machdep.c,v 1.31 2019/07/16 14:41:43 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: eb7500atx_machdep.c,v 1.32 2020/03/29 10:25:28 skrll Exp $"); #include #include @@ -945,7 +945,7 @@ initarm(void *cookie) #endif /* DDB */ /* We return the new stack pointer address */ - return(kernelstack.pv_va + USPACE_SVC_STACK_TOP); + return kernelstack.pv_va + USPACE_SVC_STACK_TOP; }
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maxv Date: Sun Mar 29 09:46:14 UTC 2020 Modified Files: src/sys/dev/usb: vhci.c Log Message: store the request buffer in the vxfer instead of the packet, clearer To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/vhci.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/dev/usb/vhci.c diff -u src/sys/dev/usb/vhci.c:1.12 src/sys/dev/usb/vhci.c:1.13 --- src/sys/dev/usb/vhci.c:1.12 Tue Mar 24 17:20:55 2020 +++ src/sys/dev/usb/vhci.c Sun Mar 29 09:46:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vhci.c,v 1.12 2020/03/24 17:20:55 maxv Exp $ */ +/* $NetBSD: vhci.c,v 1.13 2020/03/29 09:46:14 maxv Exp $ */ /* * Copyright (c) 2019-2020 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.12 2020/03/24 17:20:55 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.13 2020/03/29 09:46:14 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -173,8 +173,6 @@ static const struct usbd_pipe_methods vh * ++ */ -struct vhci_xfer; - typedef struct { int type; #define VHCI_REQ_CTRL 0 @@ -184,6 +182,8 @@ typedef struct { } u; } vhci_request_t; +struct vhci_xfer; + typedef struct vhci_packet { /* General. */ TAILQ_ENTRY(vhci_packet) portlist; @@ -192,9 +192,6 @@ typedef struct vhci_packet { bool utoh; uint8_t addr; - /* For a request packet, the storage goes there. */ - vhci_request_t reqbuf; - /* Exposed for FD operations. */ uint8_t *buf; size_t size; @@ -230,6 +227,9 @@ typedef struct vhci_xfer { size_t npkts; vhci_packet_list_t pkts; + /* Header storage. */ + vhci_request_t reqbuf; + /* Used for G/C. */ TAILQ_ENTRY(vhci_xfer) freelist; } vhci_xfer_t; @@ -286,15 +286,15 @@ vhci_pkt_ctrl_create(vhci_port_t *port, req->vxfer = vxfer; req->utoh = false; req->addr = addr; - req->buf = (uint8_t *)>reqbuf; - req->size = sizeof(req->reqbuf); + req->buf = (uint8_t *)>reqbuf; + req->size = sizeof(vxfer->reqbuf); req->cursor = 0; npkts++; /* Init the request buffer. */ - memset(>reqbuf, 0, sizeof(req->reqbuf)); - req->reqbuf.type = VHCI_REQ_CTRL; - memcpy(>reqbuf.u.ctrl, >ux_request, + memset(>reqbuf, 0, sizeof(vxfer->reqbuf)); + vxfer->reqbuf.type = VHCI_REQ_CTRL; + memcpy(>reqbuf.u.ctrl, >ux_request, sizeof(xfer->ux_request)); /* Data packet. */
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: skrll Date: Sun Mar 29 09:20:43 UTC 2020 Modified Files: src/sys/arch/arm/arm32: pmap.c Log Message: PTE_SYNC before TLB flush and no need to PTE_SYNC after an unmap. To generate a diff of this commit: cvs rdiff -u -r1.401 -r1.402 src/sys/arch/arm/arm32/pmap.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/arm/arm32/pmap.c diff -u src/sys/arch/arm/arm32/pmap.c:1.401 src/sys/arch/arm/arm32/pmap.c:1.402 --- src/sys/arch/arm/arm32/pmap.c:1.401 Sun Mar 29 09:10:26 2020 +++ src/sys/arch/arm/arm32/pmap.c Sun Mar 29 09:20:43 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.401 2020/03/29 09:10:26 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.402 2020/03/29 09:20:43 skrll Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -198,7 +198,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.401 2020/03/29 09:10:26 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.402 2020/03/29 09:20:43 skrll Exp $"); #include #include @@ -2722,9 +2722,10 @@ pmap_syncicache_page(struct vm_page_md * * Unmap the page(s). */ l2pte_reset(ptep + j); + PTE_SYNC(ptep + j); + pmap_tlb_flush_SE(kpm, dstp + i, PVF_REF | PVF_EXEC); } - PTE_SYNC_RANGE(ptep, way_size / L2_S_SIZE); md->pvh_attrs |= PVF_EXEC; PMAPCOUNT(exec_synced);
CVS commit: src/sys/arch/arm
Module Name:src Committed By: skrll Date: Sun Mar 29 09:10:26 UTC 2020 Modified Files: src/sys/arch/arm/arm32: fault.c pmap.c src/sys/arch/arm/include: pcb.h Log Message: Support PMAP_FAULTINFO on arm To generate a diff of this commit: cvs rdiff -u -r1.110 -r1.111 src/sys/arch/arm/arm32/fault.c cvs rdiff -u -r1.400 -r1.401 src/sys/arch/arm/arm32/pmap.c cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/include/pcb.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/arch/arm/arm32/fault.c diff -u src/sys/arch/arm/arm32/fault.c:1.110 src/sys/arch/arm/arm32/fault.c:1.111 --- src/sys/arch/arm/arm32/fault.c:1.110 Mon Feb 24 12:38:57 2020 +++ src/sys/arch/arm/arm32/fault.c Sun Mar 29 09:10:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fault.c,v 1.110 2020/02/24 12:38:57 rin Exp $ */ +/* $NetBSD: fault.c,v 1.111 2020/03/29 09:10:26 skrll Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -81,7 +81,7 @@ #include "opt_kgdb.h" #include -__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.110 2020/02/24 12:38:57 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.111 2020/03/29 09:10:26 skrll Exp $"); #include #include @@ -468,6 +468,33 @@ data_abort_handler(trapframe_t *tf) dab_fatal(tf, fsr, far, l, NULL); } +#ifdef PMAP_FAULTINFO + struct pcb_faultinfo * const pfi = >pcb_faultinfo; + struct proc * const p = curproc; + + if (p->p_pid == pfi->pfi_lastpid && va == pfi->pfi_faultaddr) { + if (++pfi->pfi_repeats > 4) { + tlb_asid_t asid = tlb_get_asid(); + pt_entry_t *ptep = pfi->pfi_faultptep; + + printf("%s: fault #%u (%x/%s) for %#" PRIxVADDR + "(%#x) at pc %#" PRIxREGISTER " curpid=%u/%u " + "ptep@%p=%#" PRIxPTE ")\n", __func__, + pfi->pfi_repeats, fsr & FAULT_TYPE_MASK, + data_aborts[fsr & FAULT_TYPE_MASK].desc, va, + far, tf->tf_pc, map->pmap->pm_pai[0].pai_asid, + asid, ptep, ptep ? *ptep : 0); + cpu_Debugger(); + } + } else { + pfi->pfi_lastpid = p->p_pid; + pfi->pfi_faultaddr = va; + pfi->pfi_repeats = 0; + pfi->pfi_faultptep = NULL; + pfi->pfi_faulttype = fsr & FAULT_TYPE_MASK; + } +#endif /* PMAP_FAULTINFO */ + onfault = pcb->pcb_onfault; pcb->pcb_onfault = NULL; error = uvm_fault(map, va, ftype); Index: src/sys/arch/arm/arm32/pmap.c diff -u src/sys/arch/arm/arm32/pmap.c:1.400 src/sys/arch/arm/arm32/pmap.c:1.401 --- src/sys/arch/arm/arm32/pmap.c:1.400 Mon Mar 23 16:38:29 2020 +++ src/sys/arch/arm/arm32/pmap.c Sun Mar 29 09:10:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.400 2020/03/23 16:38:29 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.401 2020/03/29 09:10:26 skrll Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -198,7 +198,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.400 2020/03/23 16:38:29 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.401 2020/03/29 09:10:26 skrll Exp $"); #include #include @@ -3466,6 +3466,12 @@ pmap_remove(pmap_t pm, vaddr_t sva, vadd UVMHIST_LOG(maphist, " (pm=%#jx, sva=%#jx, eva=%#jx)", (uintptr_t)pm, sva, eva, 0); +#ifdef PMAP_FAULTINFO + curpcb->pcb_faultinfo.pfi_faultaddr = 0; + curpcb->pcb_faultinfo.pfi_repeats = 0; + curpcb->pcb_faultinfo.pfi_faultptep = NULL; +#endif + SLIST_INIT(_list); /* * we lock in the pmap => pv_head direction Index: src/sys/arch/arm/include/pcb.h diff -u src/sys/arch/arm/include/pcb.h:1.28 src/sys/arch/arm/include/pcb.h:1.29 --- src/sys/arch/arm/include/pcb.h:1.28 Wed Jan 24 09:04:45 2018 +++ src/sys/arch/arm/include/pcb.h Sun Mar 29 09:10:26 2020 @@ -41,6 +41,14 @@ #include #include +struct pcb_faultinfo { + void *pfi_faultptep; + vaddr_t pfi_faultaddr; + u_int pfi_repeats; + pid_t pfi_lastpid; + uint8_t pfi_faulttype; +}; + #define pcb_ksp pcb_sp struct pcb { @@ -68,6 +76,7 @@ struct pcb { void * pcb_onfault; /* On fault handler */ struct vfpreg pcb_vfp; /* VFP registers */ struct vfpreg pcb_kernel_vfp; /* kernel VFP state */ + struct pcb_faultinfo pcb_faultinfo; }; /*
CVS commit: src/sys/arch/arm/include
Module Name:src Committed By: skrll Date: Sun Mar 29 09:06:38 UTC 2020 Modified Files: src/sys/arch/arm/include: cpu.h Log Message: Provide a curpcb To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 src/sys/arch/arm/include/cpu.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/arch/arm/include/cpu.h diff -u src/sys/arch/arm/include/cpu.h:1.109 src/sys/arch/arm/include/cpu.h:1.110 --- src/sys/arch/arm/include/cpu.h:1.109 Mon Mar 9 18:43:52 2020 +++ src/sys/arch/arm/include/cpu.h Sun Mar 29 09:06:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.109 2020/03/09 18:43:52 christos Exp $ */ +/* $NetBSD: cpu.h,v 1.110 2020/03/29 09:06:38 skrll Exp $ */ /* * Copyright (c) 1994-1996 Mark Brinicombe. @@ -262,6 +262,7 @@ curcpu(void) #ifndef curlwp #define curlwp (curcpu()->ci_curlwp) #endif +#define curpcb ((struct pcb *)lwp_getpcb(curlwp)) #define CPU_INFO_ITERATOR int #if defined(_MODULE) || defined(MULTIPROCESSOR)
CVS commit: src/sys/arch/arm/include/arm32
Module Name:src Committed By: skrll Date: Sun Mar 29 09:01:32 UTC 2020 Modified Files: src/sys/arch/arm/include/arm32: pmap.h Log Message: Provide a pt_entry_t and PRIxPTE To generate a diff of this commit: cvs rdiff -u -r1.164 -r1.165 src/sys/arch/arm/include/arm32/pmap.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/arch/arm/include/arm32/pmap.h diff -u src/sys/arch/arm/include/arm32/pmap.h:1.164 src/sys/arch/arm/include/arm32/pmap.h:1.165 --- src/sys/arch/arm/include/arm32/pmap.h:1.164 Sat Mar 14 14:05:42 2020 +++ src/sys/arch/arm/include/arm32/pmap.h Sun Mar 29 09:01:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.164 2020/03/14 14:05:42 ad Exp $ */ +/* $NetBSD: pmap.h,v 1.165 2020/03/29 09:01:32 skrll Exp $ */ /* * Copyright (c) 2002, 2003 Wasabi Systems, Inc. @@ -1186,6 +1186,12 @@ do { \ #endif /* !_LOCORE */ +#ifndef __BSD_PTENTRY_T__ +#define __BSD_PTENTRY_T__ +typedef uint32_t pt_entry_t; +#define PRIxPTE PRIx32 +#endif + #endif /* _KERNEL */ #endif /* _ARM32_PMAP_H_ */
CVS commit: src/sys/arch/arm/arm
Module Name:src Committed By: skrll Date: Sun Mar 29 08:27:41 UTC 2020 Modified Files: src/sys/arch/arm/arm: arm_cpu_topology.c Log Message: Fix a c error from 1.3 that should fixes mrg's rk3399 slow vs fast CPU problem. My XU4 certainly reports the right relative speeds for the 5 (yes, 5) CPUs that are avalable. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/arm/arm_cpu_topology.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/arm/arm/arm_cpu_topology.c diff -u src/sys/arch/arm/arm/arm_cpu_topology.c:1.4 src/sys/arch/arm/arm/arm_cpu_topology.c:1.5 --- src/sys/arch/arm/arm/arm_cpu_topology.c:1.4 Sat Feb 15 08:16:10 2020 +++ src/sys/arch/arm/arm/arm_cpu_topology.c Sun Mar 29 08:27:41 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: arm_cpu_topology.c,v 1.4 2020/02/15 08:16:10 skrll Exp $ */ +/* $NetBSD: arm_cpu_topology.c,v 1.5 2020/03/29 08:27:41 skrll Exp $ */ /* * Copyright (c) 2020 Matthew R. Green @@ -33,7 +33,7 @@ #include "opt_multiprocessor.h" #include -__KERNEL_RCSID(0, "$NetBSD: arm_cpu_topology.c,v 1.4 2020/02/15 08:16:10 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arm_cpu_topology.c,v 1.5 2020/03/29 08:27:41 skrll Exp $"); #include #include @@ -97,8 +97,8 @@ arm_cpu_do_topology(struct cpu_info *con for (CPU_INFO_FOREACH(cii, ci)) { if (ci == newci) continue; - cpu_topology_setspeed(newci, - newci->ci_capacity_dmips_mhz < best_cap); + cpu_topology_setspeed(ci, + ci->ci_capacity_dmips_mhz < best_cap); } #endif /* MULTIPROCESSOR */ }
CVS commit: src/etc
Module Name:src Committed By: kim Date: Sun Mar 29 06:44:16 UTC 2020 Modified Files: src/etc: crontab Log Message: Fix skipped daily in Eastern Europe - Move /etc/daily from 03:15 -> 04:15 - Move /etc/weekly from 04:30 -> 05:30 (to keep the spacing) This should prevent problems during daylight savings changeover (which is usually between 01:00 -> 04:00, depending upon the region) where the cronjobs may be executed twice, or never at all... This expands on the previous fix in revision 1.13 from 1997. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/etc/crontab Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/crontab diff -u src/etc/crontab:1.15 src/etc/crontab:1.16 --- src/etc/crontab:1.15 Wed Nov 27 15:09:17 2002 +++ src/etc/crontab Sun Mar 29 06:44:16 2020 @@ -1,4 +1,4 @@ -# $NetBSD: crontab,v 1.15 2002/11/27 15:09:17 perry Exp $ +# $NetBSD: crontab,v 1.16 2020/03/29 06:44:16 kim Exp $ # # /var/cron/tabs/root - root's crontab for NetBSD # @@ -15,6 +15,6 @@ CRON_WITHIN=7200 0 * * * * /usr/bin/newsyslog # # do daily/weekly/monthly maintenance -15 3 * * * /bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | sendmail -t -30 4 * * 6 /bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | sendmail -t +15 4 * * * /bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | sendmail -t +30 5 * * 6 /bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | sendmail -t #30 5 1 * * /bin/sh /etc/monthly 2>&1 | tee /var/log/monthly.out | sendmail -t