CVS commit: src/sys/dev/pci/ixgbe

2017-06-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun 27 05:17:54 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
 Reduce diff against FreeBSD. change hw.ixgN.ts to hw.ixgN.thermal_test
(FreeBSD r282289).


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/pci/ixgbe/ixgbe.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/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.92 src/sys/dev/pci/ixgbe/ixgbe.c:1.93
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.92	Tue Jun 27 05:01:51 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Jun 27 05:17:54 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.92 2017/06/27 05:01:51 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.93 2017/06/27 05:17:54 msaitoh Exp $*/
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -4690,7 +4690,7 @@ ixgbe_add_device_sysctls(struct adapter 
 
 	if (sysctl_createv(log, 0, , ,
 	CTLFLAG_READWRITE, CTLTYPE_INT,
-	"ts", SYSCTL_DESCR("Thermal Test"),
+	"thermal_test", SYSCTL_DESCR("Thermal Test"),
 	ixgbe_sysctl_thermal_test, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL) != 0)
 		aprint_error_dev(dev, "could not create sysctl\n");
 



CVS commit: src/sys/dev/pci/ixgbe

2017-06-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun 27 05:01:52 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_api.c

Log Message:
 Reduce diff against FreeBSD. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ixgbe/ixgbe_api.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/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.91 src/sys/dev/pci/ixgbe/ixgbe.c:1.92
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.91	Fri Jun 23 06:33:35 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Jun 27 05:01:51 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.91 2017/06/23 06:33:35 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.92 2017/06/27 05:01:51 msaitoh Exp $*/
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -5474,8 +5474,8 @@ ixgbe_sysctl_thermal_test(SYSCTLFN_ARGS)
 {
 	struct sysctlnode node = *rnode;
 	struct adapter	*adapter = (struct adapter *)node.sysctl_data;
-	int		error, fire = 0;
 	struct ixgbe_hw *hw;
+	int error, fire = 0;
 
 	hw = >hw;
 

Index: src/sys/dev/pci/ixgbe/ixgbe_api.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_api.c:1.15 src/sys/dev/pci/ixgbe/ixgbe_api.c:1.16
--- src/sys/dev/pci/ixgbe/ixgbe_api.c:1.15	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_api.c	Tue Jun 27 05:01:51 2017
@@ -31,13 +31,15 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_api.c,v 1.15 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$NetBSD: ixgbe_api.c,v 1.16 2017/06/27 05:01:51 msaitoh Exp $*/
 
 #include "ixgbe_api.h"
 #include "ixgbe_common.h"
 
+#define IXGBE_EMPTY_PARAM
+
 static const u32 ixgbe_mvals_base[IXGBE_MVALS_IDX_LIMIT] = {
-	IXGBE_MVALS_INIT()
+	IXGBE_MVALS_INIT(IXGBE_EMPTY_PARAM)
 };
 
 static const u32 ixgbe_mvals_X540[IXGBE_MVALS_IDX_LIMIT] = {



CVS commit: src/tests/net/route

2017-06-26 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jun 27 04:56:13 UTC 2017

Modified Files:
src/tests/net/route: t_flags.sh

Log Message:
Fix wrong comment


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/net/route/t_flags.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/net/route/t_flags.sh
diff -u src/tests/net/route/t_flags.sh:1.16 src/tests/net/route/t_flags.sh:1.17
--- src/tests/net/route/t_flags.sh:1.16	Tue Jun 27 04:52:45 2017
+++ src/tests/net/route/t_flags.sh	Tue Jun 27 04:56:13 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_flags.sh,v 1.16 2017/06/27 04:52:45 ozaki-r Exp $
+#	$NetBSD: t_flags.sh,v 1.17 2017/06/27 04:56:13 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -100,7 +100,7 @@ test_connected()
 
 	export RUMP_SERVER=$SOCK_LOCAL
 
-	# Up, Host, LLINFO, local
+	# Up, Host, local
 	check_route_flags 10.0.0.2 UHl
 
 	# Up, Cloning



CVS commit: src/tests/net/route

2017-06-26 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jun 27 04:52:45 UTC 2017

Modified Files:
src/tests/net/route: t_flags.sh t_flags6.sh

Log Message:
Check existence of ARP/NDP entries

Checking ARP/NDP entries is valid rather than checking routes.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/net/route/t_flags.sh
cvs rdiff -u -r1.12 -r1.13 src/tests/net/route/t_flags6.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/net/route/t_flags.sh
diff -u src/tests/net/route/t_flags.sh:1.15 src/tests/net/route/t_flags.sh:1.16
--- src/tests/net/route/t_flags.sh:1.15	Wed Dec 21 02:46:08 2016
+++ src/tests/net/route/t_flags.sh	Tue Jun 27 04:52:45 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_flags.sh,v 1.15 2016/12/21 02:46:08 ozaki-r Exp $
+#	$NetBSD: t_flags.sh,v 1.16 2017/06/27 04:52:45 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -163,6 +163,7 @@ test_blackhole()
 
 	# Shouldn't be created
 	check_route_no_entry 10.0.0.1
+	atf_check -s not-exit:0 -e match:'no entry' rump.arp -n 10.0.0.1
 }
 
 test_reject()
@@ -185,6 +186,7 @@ test_reject()
 
 	# Shouldn't be created
 	check_route_no_entry 10.0.0.1
+	atf_check -s not-exit:0 -e match:'no entry' rump.arp -n 10.0.0.1
 
 	# Gateway is lo0 (RTF_GATEWAY)
 
@@ -204,6 +206,7 @@ test_reject()
 
 	# Shouldn't be created
 	check_route_no_entry 10.0.0.1
+	atf_check -s not-exit:0 -e match:'no entry' rump.arp -n 10.0.0.1
 
 	# Gateway is lo0 (RTF_HOST)
 

Index: src/tests/net/route/t_flags6.sh
diff -u src/tests/net/route/t_flags6.sh:1.12 src/tests/net/route/t_flags6.sh:1.13
--- src/tests/net/route/t_flags6.sh:1.12	Wed Dec 21 02:46:08 2016
+++ src/tests/net/route/t_flags6.sh	Tue Jun 27 04:52:45 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_flags6.sh,v 1.12 2016/12/21 02:46:08 ozaki-r Exp $
+#	$NetBSD: t_flags6.sh,v 1.13 2017/06/27 04:52:45 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -149,6 +149,8 @@ test_blackhole6()
 
 	# Shouldn't be created
 	check_route_no_entry $IP6_PEER
+	atf_check -s not-exit:0 -o ignore -e match:'no entry' \
+	rump.ndp -n $IP6_PEER
 }
 
 test_reject6()
@@ -173,6 +175,8 @@ test_reject6()
 
 	# Shouldn't be created
 	check_route_no_entry $IP6_PEER
+	atf_check -s not-exit:0 -o ignore -e match:'no entry' \
+	rump.ndp -n $IP6_PEER
 
 	# Gateway is lo0 (RTF_GATEWAY)
 
@@ -193,6 +197,8 @@ test_reject6()
 
 	# Shouldn't be created
 	check_route_no_entry $IP6_PEER
+	atf_check -s not-exit:0 -o ignore -e match:'no entry' \
+	rump.ndp -n $IP6_PEER
 
 	# Gateway is lo0 (RTF_HOST)
 



CVS commit: src/bin/sh

2017-06-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 27 02:22:08 UTC 2017

Modified Files:
src/bin/sh: histedit.c myhistedit.h sh.1 var.c var.h

Log Message:
Properly support EDITRC - use it as (naming) the file when setting
up libedit, and re-do the config whenever EDITRC is set.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/bin/sh/histedit.c
cvs rdiff -u -r1.11 -r1.12 src/bin/sh/myhistedit.h
cvs rdiff -u -r1.152 -r1.153 src/bin/sh/sh.1
cvs rdiff -u -r1.60 -r1.61 src/bin/sh/var.c
cvs rdiff -u -r1.32 -r1.33 src/bin/sh/var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.49 src/bin/sh/histedit.c:1.50
--- src/bin/sh/histedit.c:1.49	Mon Jun 26 20:28:01 2017
+++ src/bin/sh/histedit.c	Tue Jun 27 02:22:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.49 2017/06/26 20:28:01 christos Exp $	*/
+/*	$NetBSD: histedit.c,v 1.50 2017/06/27 02:22:08 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.49 2017/06/26 20:28:01 christos Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.50 2017/06/27 02:22:08 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -158,7 +158,7 @@ bad:
 el_set(el, EL_EDITOR, "emacs");
 			el_set(el, EL_BIND, "^I", 
 			tabcomplete ? "rl-complete" : "ed-insert", NULL);
-			el_source(el, NULL);
+			el_source(el, lookupvar("EDITRC"));
 		}
 	} else {
 		INTOFF;
@@ -174,6 +174,12 @@ bad:
 	}
 }
 
+void
+set_editrc(const char *fname)
+{
+	if (iflag && editing && el)
+		el_source(el, fname);
+}
 
 void
 sethistsize(const char *hs)

Index: src/bin/sh/myhistedit.h
diff -u src/bin/sh/myhistedit.h:1.11 src/bin/sh/myhistedit.h:1.12
--- src/bin/sh/myhistedit.h:1.11	Sat Jun 18 21:18:46 2011
+++ src/bin/sh/myhistedit.h	Tue Jun 27 02:22:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: myhistedit.h,v 1.11 2011/06/18 21:18:46 christos Exp $	*/
+/*	$NetBSD: myhistedit.h,v 1.12 2017/06/27 02:22:08 kre Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -41,6 +41,7 @@ void histedit(void);
 void sethistsize(const char *);
 void setterm(const char *);
 int inputrc(int, char **);
+void set_editrc(const char *);
 int not_fcnumber(char *);
 int str_to_event(const char *, int);
 

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.152 src/bin/sh/sh.1:1.153
--- src/bin/sh/sh.1:1.152	Sat Jun 17 07:50:35 2017
+++ src/bin/sh/sh.1	Tue Jun 27 02:22:08 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.152 2017/06/17 07:50:35 kre Exp $
+.\"	$NetBSD: sh.1,v 1.153 2017/06/27 02:22:08 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -2750,12 +2750,46 @@ and the default settings in
 and
 .Ar vi
 modes.
+Also see
+.Xr editrc 5
+for the commands that can be given to configure
+.Xr editline 7
+in the file named by the
+.Ev EDITRC
+parameter, or using
+.Xr editline 7 Ns \&'s
+configuration command line.
 .Sh ENVIRONMENT
 .Bl -tag -width MAILCHECK
 .It Ev CDPATH
 The search path used with the
 .Ic cd
 built-in.
+.It Ev EDITRC
+Gives the name of the file containing commands for
+.Xr editline 7 .
+See
+.Xr editrc 5
+for possible content and format.
+The file is processed, when in interactive mode with
+command line editing enabled, whenever
+.Ev EDITRC
+is set (even with no actual value change,)
+and if command line editing changes from disabled to enabled,
+or the editor style used is changed.
+(See the
+.Fl E
+and
+.Fl V
+options of the
+.Ic set
+builtin command, described in
+.Sx Built-ins
+above, which are documented further above in
+.Sx Argument List Processing . )
+If unset
+.Dq $HOME/.editrc
+is used.
 .It Ev HISTSIZE
 The number of lines in the history buffer for the shell.
 .It Ev HOME

Index: src/bin/sh/var.c
diff -u src/bin/sh/var.c:1.60 src/bin/sh/var.c:1.61
--- src/bin/sh/var.c:1.60	Sat Jun 17 10:46:34 2017
+++ src/bin/sh/var.c	Tue Jun 27 02:22:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.60 2017/06/17 10:46:34 kre Exp $	*/
+/*	$NetBSD: var.c,v 1.61 2017/06/27 02:22:08 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: var.c,v 1.60 2017/06/17 10:46:34 kre Exp $");
+__RCSID("$NetBSD: var.c,v 1.61 2017/06/27 02:22:08 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -95,6 +95,7 @@ struct localvar *localvars;
 #ifndef SMALL
 struct var vhistsize;
 struct var vterm;
+struct var editrc;
 #endif
 struct var vifs;
 struct var vmail;
@@ -139,6 +140,8 @@ const struct varinit varinit[] = {
 #ifndef SMALL
 	{ ,	VSTRFIXED|VTEXTFIXED|VUNSET,	"TERM=",
 	   { .set_func= setterm } },
+	{ , 	VSTRFIXED|VTEXTFIXED|VUNSET,	"EDITRC=",
+	   { .set_func= set_editrc } },
 #endif
 	{ ,	VSTRFIXED|VTEXTFIXED|VNOFUNC,	"OPTIND=1",
 	   { .set_func= getoptsreset } },

Index: src/bin/sh/var.h
diff -u 

CVS commit: src/lib/libedit

2017-06-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 27 01:22:58 UTC 2017

Modified Files:
src/lib/libedit: editline.3 editrc.5

Log Message:
Include EDITRC in doc.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/lib/libedit/editline.3
cvs rdiff -u -r1.32 -r1.33 src/lib/libedit/editrc.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/editline.3
diff -u src/lib/libedit/editline.3:1.93 src/lib/libedit/editline.3:1.94
--- src/lib/libedit/editline.3:1.93	Mon Apr 10 15:02:40 2017
+++ src/lib/libedit/editline.3	Tue Jun 27 01:22:58 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.93 2017/04/10 15:02:40 abhinav Exp $
+.\"	$NetBSD: editline.3,v 1.94 2017/06/27 01:22:58 kre Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -667,6 +667,8 @@ If
 is
 .Dv NULL ,
 try
+.Pa $EDITRC
+and if that is not set
 .Pa $HOME/.editrc .
 Refer to
 .Xr editrc 5

Index: src/lib/libedit/editrc.5
diff -u src/lib/libedit/editrc.5:1.32 src/lib/libedit/editrc.5:1.33
--- src/lib/libedit/editrc.5:1.32	Sun May 22 23:54:20 2016
+++ src/lib/libedit/editrc.5	Tue Jun 27 01:22:58 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editrc.5,v 1.32 2016/05/22 23:54:20 christos Exp $
+.\"	$NetBSD: editrc.5,v 1.33 2017/06/27 01:22:58 kre Exp $
 .\"
 .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -293,10 +293,18 @@ then the character is set to
 List the values of all the terminal capabilities (see
 .Xr termcap 5 ) .
 .El
+.Sh ENVIRONMENT
+.Bl -tag -width "~/.editrcXXX"
+.It Ev EDITRC
+Names the default configuration file for the
+.Xr editline 3
+library.
+.El
 .Sh FILES
 .Bl -tag -width "~/.editrcXXX"
 .It Pa ~/.editrc
-User configuration file for the
+Last resort, if no other file is specified,
+user configuration file for the
 .Xr editline 3
 library.
 .El



CVS commit: src/share/man/man7

2017-06-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 27 01:13:44 UTC 2017

Modified Files:
src/share/man/man7: environ.7

Log Message:
Document EDITRC


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/share/man/man7/environ.7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man7/environ.7
diff -u src/share/man/man7/environ.7:1.26 src/share/man/man7/environ.7:1.27
--- src/share/man/man7/environ.7:1.26	Sat Feb 25 15:55:45 2017
+++ src/share/man/man7/environ.7	Tue Jun 27 01:13:44 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: environ.7,v 1.26 2017/02/25 15:55:45 abhinav Exp $
+.\"	$NetBSD: environ.7,v 1.27 2017/06/27 01:13:44 kre Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -80,6 +80,13 @@ by
 or
 .Ql g .
 Sizes less than 512 bytes or greater than a gigabyte are ignored.
+.It Ev EDITRC
+Gives the path name of the file used by
+.Xr editline 7
+when command line editing is enabled in various programs.
+See
+.Xr editrc 5
+for information on the format of the file.
 .It Ev EXINIT
 A startup list of commands read by
 .Xr ex 1



CVS commit: src/lib/libedit

2017-06-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 27 00:47:37 UTC 2017

Modified Files:
src/lib/libedit: el.c

Log Message:
Make the default editrc file be $EDITRC (from env) if set, falling back
to $HOME/.editrc otherwise.Better support for this in sh coming.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/lib/libedit/el.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/libedit/el.c
diff -u src/lib/libedit/el.c:1.92 src/lib/libedit/el.c:1.93
--- src/lib/libedit/el.c:1.92	Sun May 22 19:44:26 2016
+++ src/lib/libedit/el.c	Tue Jun 27 00:47:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.c,v 1.92 2016/05/22 19:44:26 christos Exp $	*/
+/*	$NetBSD: el.c,v 1.93 2017/06/27 00:47:37 kre Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)el.c	8.2 (Berkeley) 1/3/94";
 #else
-__RCSID("$NetBSD: el.c,v 1.92 2016/05/22 19:44:26 christos Exp $");
+__RCSID("$NetBSD: el.c,v 1.93 2017/06/27 00:47:37 kre Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -524,18 +524,22 @@ el_source(EditLine *el, const char *fnam
 	fp = NULL;
 	if (fname == NULL) {
 #ifdef HAVE_ISSETUGID
-		static const char elpath[] = "/.editrc";
-		size_t plen = sizeof(elpath);
-
 		if (issetugid())
 			return -1;
-		if ((ptr = getenv("HOME")) == NULL)
-			return -1;
-		plen += strlen(ptr);
-		if ((path = el_malloc(plen * sizeof(*path))) == NULL)
-			return -1;
-		(void)snprintf(path, plen, "%s%s", ptr, elpath);
-		fname = path;
+
+		if ((fname = getenv("EDITRC")) == NULL) {
+			static const char elpath[] = "/.editrc";
+			size_t plen = sizeof(elpath);
+
+			if ((ptr = getenv("HOME")) == NULL)
+return -1;
+			plen += strlen(ptr);
+			if ((path = el_malloc(plen * sizeof(*path))) == NULL)
+return -1;
+			(void)snprintf(path, plen, "%s%s", ptr,
+elpath + (*ptr == '\0'));
+			fname = path;
+		}
 #else
 		/*
 		 * If issetugid() is missing, always return an error, in order
@@ -545,6 +549,9 @@ el_source(EditLine *el, const char *fnam
 		return -1;
 #endif
 	}
+	if (fname[0] == '\0')
+		return -1;
+
 	if (fp == NULL)
 		fp = fopen(fname, "r");
 	if (fp == NULL) {



CVS commit: src/bin

2017-06-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Jun 26 22:09:16 UTC 2017

Modified Files:
src/bin/kill: kill.c
src/bin/sh: var.h
src/bin/sh/bltin: bltin.h

Log Message:
Make arg parsing in kill POSIX compatible with POSIX (XBD 2.12) by
parsing the way getopt(3) would, if only it could handle the (required)
-signumber and -signame options.  This adds two "features" to kill,
-ssigname and -lstatus now work (ie: one word with all of the '-', the
option letter, and its value) and "--" also now works (kill -- -pid1 pid2
will not attempt to send the pid1 signal to pid2, but rather SIGTERM
to the pid1 process group and pid2).  It is still the case that (apart
from --) at most 1 option is permitted (-l, -s, -signame, or -signumber.)

Note that we now have an ambiguity, -sname might mean "-s name" or
send the signal "sname" - if one of those turns out to be valid, that
will be accepted, otherwise the error message will indicate that "sname"
is not a valid signal name, not that "name" is not.   Keeping the "-s"
and signal name as separate words avoids this issue.

Also caution: should someone be weird enough to define a new signal
name (as in the part after SIG) which is almost the same name as an
existing name that starts with 'S' by adding an extra 'S' prepended
(eg: adding a SIGSSYS) then the ambiguity problem becomes much worse.
In that case "kill -ssys" will be resolved in favour of the "-s"
flag being used (the more modern syntax) and would send a SIGSYS, rather
that a SIGSSYS.So don't do that.

While here, switch to using signalname(3) (bye bye NSIG, et. al.), add
some constipation, and show a little pride in formatting the signal names
for "kill -l" (and in the usage when appropriate -- same routine.)   Respect
COLUMNS (POSIX XBD 8.3) as primary specification of the width (terminal width,
not number of columns to print) for kill -l, a very small value for COLUMNS
will cause kill -l output to list signals one per line, a very large
value will cause them all to be listed on one line.) (eg: "COLUMNS=1 kill -l")

TODO: the signal printing for "trap -l" and that for "kill -l"
should be switched to use a common routine (for the sh builtin versions.)

All changes of relevance here are to bin/kill - the (minor) changes to bin/sh
are only to properly expose the builtin version of getenv(3) so the builtin
version of kill can use it (ie: make its prototype available.)


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/bin/kill/kill.c
cvs rdiff -u -r1.31 -r1.32 src/bin/sh/var.h
cvs rdiff -u -r1.14 -r1.15 src/bin/sh/bltin/bltin.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/kill/kill.c
diff -u src/bin/kill/kill.c:1.27 src/bin/kill/kill.c:1.28
--- src/bin/kill/kill.c:1.27	Mon Aug 29 14:51:18 2011
+++ src/bin/kill/kill.c	Mon Jun 26 22:09:16 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: kill.c,v 1.27 2011/08/29 14:51:18 joerg Exp $ */
+/* $NetBSD: kill.c,v 1.28 2017/06/26 22:09:16 kre Exp $ */
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kill.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kill.c,v 1.27 2011/08/29 14:51:18 joerg Exp $");
+__RCSID("$NetBSD: kill.c,v 1.28 2017/06/26 22:09:16 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -63,17 +63,19 @@ int killcmd(int, char *argv[]);
 #include "../../bin/sh/bltin/bltin.h"
 #endif /* SHELL */ 
 
-__dead static void nosig(char *);
+__dead static void nosig(const char *);
 static void printsignals(FILE *);
-static int signame_to_signum(char *);
+static int signum(const char *);
+static pid_t processnum(const char *);
 __dead static void usage(void);
 
 int
 main(int argc, char *argv[])
 {
 	int errors;
-	intmax_t numsig, pid;
-	char *ep;
+	int numsig;
+	pid_t pid;
+	const char *sn;
 
 	setprogname(argv[0]);
 	setlocale(LC_ALL, "");
@@ -83,65 +85,92 @@ main(int argc, char *argv[])
 	numsig = SIGTERM;
 
 	argc--, argv++;
-	if (strcmp(*argv, "-l") == 0) {
-		argc--, argv++;
-		if (argc > 1)
-			usage();
-		if (argc == 1) {
-			if (isdigit((unsigned char)**argv) == 0)
+
+	/*
+	 * Process exactly 1 option, if there is one.
+	 */
+	if (argv[0][0] == '-') {
+		switch (argv[0][1]) {
+		case 'l':
+			if (argv[0][2] != '\0')
+sn = argv[0] + 2;
+			else {
+argc--; argv++;
+sn = argv[0];
+			}
+			if (argc > 1)
 usage();
-			numsig = strtoimax(*argv, , 10);
-			/* check for correctly parsed number */
-			if (*ep != '\0' || numsig == INTMAX_MIN || numsig == INTMAX_MAX) {
-errx(EXIT_FAILURE, "illegal signal number: %s",
-		*argv);
-/* NOTREACHED */
-			}
-			if (numsig >= 128)
-numsig -= 128;
-			/* and whether it fits into signals range */
-			if (numsig <= 0 || numsig >= NSIG)
-nosig(*argv);
-			printf("%s\n", sys_signame[(int) numsig]);
+			if (argc == 1) {
+if (isdigit((unsigned char)*sn) == 0)
+	

CVS commit: src/sys/dev/usb

2017-06-26 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Mon Jun 26 20:36:01 UTC 2017

Modified Files:
src/sys/dev/usb: moscom.c

Log Message:
Add first channel of mcs7720.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/usb/moscom.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/moscom.c
diff -u src/sys/dev/usb/moscom.c:1.10 src/sys/dev/usb/moscom.c:1.11
--- src/sys/dev/usb/moscom.c:1.10	Thu Jul  7 06:55:42 2016
+++ src/sys/dev/usb/moscom.c	Mon Jun 26 20:36:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: moscom.c,v 1.10 2016/07/07 06:55:42 msaitoh Exp $	*/
+/*	$NetBSD: moscom.c,v 1.11 2017/06/26 20:36:01 is Exp $	*/
 /*	$OpenBSD: moscom.c,v 1.11 2007/10/11 18:33:14 deraadt Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: moscom.c,v 1.10 2016/07/07 06:55:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: moscom.c,v 1.11 2017/06/26 20:36:01 is Exp $");
 
 #include 
 #include 
@@ -168,6 +168,7 @@ struct ucom_methods moscom_methods = {
 
 static const struct usb_devno moscom_devs[] = {
 	{ USB_VENDOR_MOSCHIP,		USB_PRODUCT_MOSCHIP_MCS7703 },
+	{ USB_VENDOR_MOSCHIP,		USB_PRODUCT_MOSCHIP_MCS7720 },
 	{ USB_VENDOR_MOSCHIP,		USB_PRODUCT_MOSCHIP_MCS7840 },
 	{ USB_VENDOR_ATEN,		USB_PRODUCT_ATEN_UC2324 }
 };



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-06-26 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Jun 26 20:36:14 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
when reducing DELAY(), it's necessary to appropriately increase number
of iteration, or command can timeout too soon

adjust also siisata_atapi_start() to use DELAY(100) for the polled command,
mostly for consistency, ATAPI devices are quite slow so likely won't have
real effect


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.22 -r1.30.4.23 src/sys/dev/ic/siisata.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/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.22 src/sys/dev/ic/siisata.c:1.30.4.23
--- src/sys/dev/ic/siisata.c:1.30.4.22	Sat Jun 24 11:34:33 2017
+++ src/sys/dev/ic/siisata.c	Mon Jun 26 20:36:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.22 2017/06/24 11:34:33 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.23 2017/06/26 20:36:14 jdolecek Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.22 2017/06/24 11:34:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.23 2017/06/26 20:36:14 jdolecek Exp $");
 
 #include 
 #include 
@@ -944,7 +944,7 @@ siisata_cmd_start(struct ata_channel *ch
 	/*
 	 * polled command
 	 */
-	for (i = 0; i < ata_c->timeout / 10; i++) {
+	for (i = 0; i < ata_c->timeout * 10; i++) {
 		if (ata_c->flags & AT_DONE)
 			break;
 		siisata_intr_port(schp);
@@ -1148,7 +1148,7 @@ siisata_bio_start(struct ata_channel *ch
 	/*
 	 * polled command
 	 */
-	for (i = 0; i < ATA_DELAY / 10; i++) {
+	for (i = 0; i < ATA_DELAY * 10; i++) {
 		if (ata_bio->flags & ATA_ITSDONE)
 			break;
 		siisata_intr_port(schp);
@@ -1693,11 +1693,11 @@ siisata_atapi_start(struct ata_channel *
 	/*
 	 * polled command
 	 */
-	for (i = 0; i < ATA_DELAY / 10; i++) {
+	for (i = 0; i < ATA_DELAY * 10; i++) {
 		if (sc_xfer->xs_status & XS_STS_DONE)
 			break;
 		siisata_intr_port(schp);
-		DELAY(1000);
+		DELAY(100);
 	}
 	if ((sc_xfer->xs_status & XS_STS_DONE) == 0) {
 		siisata_timeout(xfer);



CVS commit: src/sys/dev/usb

2017-06-26 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Mon Jun 26 20:28:43 UTC 2017

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
yet another moschip serial adapter chip.


To generate a diff of this commit:
cvs rdiff -u -r1.736 -r1.737 src/sys/dev/usb/usbdevs

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/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.736 src/sys/dev/usb/usbdevs:1.737
--- src/sys/dev/usb/usbdevs:1.736	Tue May 30 20:13:35 2017
+++ src/sys/dev/usb/usbdevs	Mon Jun 26 20:28:42 2017
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.736 2017/05/30 20:13:35 jnemeth Exp $
+$NetBSD: usbdevs,v 1.737 2017/06/26 20:28:42 is Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -2297,6 +2297,7 @@ product MOBILITY EASIDOCK	0x0304	EasiDoc
 
 /* MosChip Semiconductor */
 product MOSCHIP MCS7703		0x7703	MCS7703 USB Serial Adapter
+product MOSCHIP MCS7720		0x7720	MCS7720 USB Serial Adapter
 product MOSCHIP MCS7780		0x7780	MCS7780 Fast IrDA Adapter
 product MOSCHIP MCS7781		0x7781	MCS7781 Fast IrDA Adapter
 product MOSCHIP MCS7784		0x7784	MCS7784 Slow IrDA Adapter



CVS commit: src/bin/sh

2017-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 26 20:28:02 UTC 2017

Modified Files:
src/bin/sh: histedit.c

Log Message:
source .editrc after we initialize so that commands persist!


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/bin/sh/histedit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.48 src/bin/sh/histedit.c:1.49
--- src/bin/sh/histedit.c:1.48	Wed Mar 16 18:36:40 2016
+++ src/bin/sh/histedit.c	Mon Jun 26 16:28:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.48 2016/03/16 22:36:40 christos Exp $	*/
+/*	$NetBSD: histedit.c,v 1.49 2017/06/26 20:28:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.48 2016/03/16 22:36:40 christos Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.49 2017/06/26 20:28:01 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -152,13 +152,13 @@ bad:
 			INTON;
 		}
 		if (el) {
-			el_source(el, NULL);
 			if (Vflag)
 el_set(el, EL_EDITOR, "vi");
 			else if (Eflag)
 el_set(el, EL_EDITOR, "emacs");
 			el_set(el, EL_BIND, "^I", 
 			tabcomplete ? "rl-complete" : "ed-insert", NULL);
+			el_source(el, NULL);
 		}
 	} else {
 		INTOFF;



CVS commit: src/sys/dev/pci

2017-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 26 18:23:49 UTC 2017

Modified Files:
src/sys/dev/pci: if_vte.c

Log Message:
PR/52333: Jia-Ju Bai: explicitly pass BUS_DMA_NOWAIT to bus_dmamap_load_mbuf()
called from an interrupt context. It should not matter since the maps are
constructed with BUS_DMA_ALLOCNOW, but :-)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/if_vte.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/pci/if_vte.c
diff -u src/sys/dev/pci/if_vte.c:1.17 src/sys/dev/pci/if_vte.c:1.18
--- src/sys/dev/pci/if_vte.c:1.17	Mon May 22 22:19:14 2017
+++ src/sys/dev/pci/if_vte.c	Mon Jun 26 14:23:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vte.c,v 1.17 2017/05/23 02:19:14 ozaki-r Exp $	*/
+/*	$NetBSD: if_vte.c,v 1.18 2017/06/26 18:23:49 christos Exp $	*/
 
 /*
  * Copyright (c) 2011 Manuel Bouyer.  All rights reserved.
@@ -55,7 +55,7 @@
 /* Driver for DM Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.17 2017/05/23 02:19:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.18 2017/06/26 18:23:49 christos Exp $");
 
 #include 
 #include 
@@ -733,7 +733,8 @@ vte_encap(struct vte_softc *sc, struct m
 		m->m_len = m->m_pkthdr.len;
 	}
 
-	error = bus_dmamap_load_mbuf(sc->vte_dmatag, txd->tx_dmamap, m, 0);
+	error = bus_dmamap_load_mbuf(sc->vte_dmatag, txd->tx_dmamap, m,
+	BUS_DMA_NOWAIT);
 	if (error != 0) {
 		txd->tx_flags &= ~VTE_TXMBUF;
 		return (NULL);
@@ -1055,7 +1056,7 @@ vte_newbuf(struct vte_softc *sc, struct 
 	m_adj(m, sizeof(uint32_t));
 
 	if (bus_dmamap_load_mbuf(sc->vte_dmatag,
-	sc->vte_cdata.vte_rx_sparemap, m, 0) != 0) {
+	sc->vte_cdata.vte_rx_sparemap, m, BUS_DMA_NOWAIT) != 0) {
 		m_freem(m);
 		return (ENOBUFS);
 	}



CVS commit: src/etc/etc.vax

2017-06-26 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Mon Jun 26 17:45:56 UTC 2017

Modified Files:
src/etc/etc.vax: Makefile.inc

Log Message:
Add GENERIC_USB to vax kernel sets, but not to sysinst (yet), as bootloader
cannot handle kernels that large (yet).


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/etc/etc.vax/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/etc.vax/Makefile.inc
diff -u src/etc/etc.vax/Makefile.inc:1.24 src/etc/etc.vax/Makefile.inc:1.25
--- src/etc/etc.vax/Makefile.inc:1.24	Sun Jan 15 17:36:55 2012
+++ src/etc/etc.vax/Makefile.inc	Mon Jun 26 17:45:56 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.24 2012/01/15 17:36:55 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.25 2017/06/26 17:45:56 flxd Exp $
 #
 #	etc.vax/Makefile.inc -- vax-specific etc Makefile targets
 #
@@ -6,7 +6,7 @@
 # If you change the list of distributed kernels, don't forget
 # to update the release documentation in distrib/notes/common/contents
 
-KERNEL_SETS=		GENERIC GENERIC.MP
+KERNEL_SETS=		GENERIC GENERIC.MP GENERIC_USB
 
 BUILD_KERNELS=		INSTALL
 



CVS commit: src/external/gpl3/gcc/usr.bin

2017-06-26 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jun 26 17:38:10 UTC 2017

Modified Files:
src/external/gpl3/gcc/usr.bin/backend: Makefile
src/external/gpl3/gcc/usr.bin/host-libcpp: Makefile

Log Message:
Honor HOST_CXX.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/external/gpl3/gcc/usr.bin/backend/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/usr.bin/host-libcpp/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/gpl3/gcc/usr.bin/backend/Makefile
diff -u src/external/gpl3/gcc/usr.bin/backend/Makefile:1.36 src/external/gpl3/gcc/usr.bin/backend/Makefile:1.37
--- src/external/gpl3/gcc/usr.bin/backend/Makefile:1.36	Tue Feb 14 00:20:20 2017
+++ src/external/gpl3/gcc/usr.bin/backend/Makefile	Mon Jun 26 17:38:10 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.36 2017/02/14 00:20:20 rin Exp $
+#	$NetBSD: Makefile,v 1.37 2017/06/26 17:38:10 joerg Exp $
 
 LIBISPRIVATE=	yes
 
@@ -210,7 +210,7 @@ auto-build.h: gmp.h Makefile
 	mkdir .ab && \
 	(cd .ab && \
 		AWK=${TOOL_AWK:Q} \
-		CC=${ORIGHOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} \
+		CC=${ORIGHOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} CXX=${HOST_CXX:Q} \
 		MAKE=${TOOL_GMAKE:Q} \
 		CONFIG_SHELL=${HOST_SH:Q} \
 		gcc_cv_ld=${LD:Q} \

Index: src/external/gpl3/gcc/usr.bin/host-libcpp/Makefile
diff -u src/external/gpl3/gcc/usr.bin/host-libcpp/Makefile:1.2 src/external/gpl3/gcc/usr.bin/host-libcpp/Makefile:1.3
--- src/external/gpl3/gcc/usr.bin/host-libcpp/Makefile:1.2	Sun Aug 14 16:04:50 2016
+++ src/external/gpl3/gcc/usr.bin/host-libcpp/Makefile	Mon Jun 26 17:38:10 2017
@@ -1,14 +1,14 @@
-#	$NetBSD: Makefile,v 1.2 2016/08/14 16:04:50 tls Exp $
+#	$NetBSD: Makefile,v 1.3 2017/06/26 17:38:10 joerg Exp $
 
 libcpp/libcpp.a:
 	[ ! -d libcpp ] && mkdir libcpp || true
 	(cd libcpp; \
-		CC=${HOST_CC:Q} \
+		CC=${HOST_CC:Q} CXX=${HOST_CXX:Q}  \
 		CFLAGS=${HOST_CFLAGS:Q} \
 		MAKE=${TOOL_GMAKE:Q} \
 		CONFIG_SHELL=${HOST_SH:Q} \
 		${HOST_SH} ${DIST}/libcpp/configure -v am_cv_func_iconv=no \
-		&& CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} ${TOOL_GMAKE})
+		&& CC=${HOST_CC:Q} CXX=${HOST_CXX:Q} CFLAGS=${HOST_CFLAGS:Q} ${TOOL_GMAKE})
 
 cleandir:
 	-rm -rf libcpp



CVS commit: src/external/bsd/blacklist/diff

2017-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 26 17:12:05 UTC 2017

Modified Files:
src/external/bsd/blacklist/diff: ssh.diff

Log Message:
amend the patch to close.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/blacklist/diff/ssh.diff

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/diff/ssh.diff
diff -u src/external/bsd/blacklist/diff/ssh.diff:1.8 src/external/bsd/blacklist/diff/ssh.diff:1.9
--- src/external/bsd/blacklist/diff/ssh.diff:1.8	Fri Jan 22 19:05:38 2016
+++ src/external/bsd/blacklist/diff/ssh.diff	Mon Jun 26 13:12:05 2017
@@ -1,6 +1,6 @@
 --- /dev/null	2015-01-22 23:10:33.0 -0500
 +++ dist/pfilter.c	2015-01-22 23:46:03.0 -0500
-@@ -0,0 +1,28 @@
+@@ -0,0 +1,32 @@
 +#include "namespace.h"
 +#include "includes.h"
 +#include "ssh.h"
@@ -28,6 +28,10 @@
 +	// XXX: 3?
 + 	fd = packet_connection_is_on_socket() ? packet_get_connection_in() : 3;
 +	(void)blacklist_r(blstate, a, fd, "ssh");
++	if (a == 0) {
++		blacklist_close(blstate);
++		blstate = NULL;
++	}
 +}
 --- /dev/null	2015-01-20 21:14:44.0 -0500
 +++ dist/pfilter.h	2015-01-20 20:16:20.0 -0500



CVS commit: src/crypto/external/bsd/openssh/dist

2017-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 26 17:10:39 UTC 2017

Modified Files:
src/crypto/external/bsd/openssh/dist: pfilter.c

Log Message:
If we've authenticated, we are already in the child and we don't need the
socket anymore.
XXX: pullup-7, pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/openssh/dist/pfilter.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/openssh/dist/pfilter.c
diff -u src/crypto/external/bsd/openssh/dist/pfilter.c:1.3 src/crypto/external/bsd/openssh/dist/pfilter.c:1.4
--- src/crypto/external/bsd/openssh/dist/pfilter.c:1.3	Fri Jan 22 19:03:30 2016
+++ src/crypto/external/bsd/openssh/dist/pfilter.c	Mon Jun 26 13:10:39 2017
@@ -30,6 +30,10 @@ pfilter_notify(int a)
 	// XXX: 3?
  	fd = packet_connection_is_on_socket() ? packet_get_connection_in() : 3;
 	(void)blacklist_r(blstate, a, fd, "ssh");
+	if (a == 0) {
+		blacklist_close(blstate);
+		blstate = NULL;
+	}
 #else
 	__USE(a);
 #endif



CVS commit: src/sys/dev

2017-06-26 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Jun 26 12:17:10 UTC 2017

Modified Files:
src/sys/dev: mulaw.c

Log Message:
Better solution to mulaw/alaw conversion on big endian systems/sound
devices.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/mulaw.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/mulaw.c
diff -u src/sys/dev/mulaw.c:1.31 src/sys/dev/mulaw.c:1.32
--- src/sys/dev/mulaw.c:1.31	Mon Jun 26 11:45:46 2017
+++ src/sys/dev/mulaw.c	Mon Jun 26 12:17:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mulaw.c,v 1.31 2017/06/26 11:45:46 nat Exp $	*/
+/*	$NetBSD: mulaw.c,v 1.32 2017/06/26 12:17:09 nat Exp $	*/
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.31 2017/06/26 11:45:46 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.32 2017/06/26 12:17:09 nat Exp $");
 
 #include 
 #include 
@@ -321,10 +321,10 @@ DEFINE_FILTER(mulaw_to_linear##n_prec)		
 		break;			\
 	case AUDIO_ENCODING_ULINEAR_BE:	\
 		FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) {	\
-			j = hw - 2;	\
+			j = 2;		\
 			d[0] = mulawtolin16[s[0]][0];			\
 			d[1] = mulawtolin16[s[0]][1];			\
-			while (j > 0 && j < hw)\
+			while (j < hw)	\
 d[j++] = 0;\
 		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
 		break;			\
@@ -339,10 +339,10 @@ DEFINE_FILTER(mulaw_to_linear##n_prec)		
 		break;			\
 	case AUDIO_ENCODING_SLINEAR_BE:	\
 		FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) {	\
-			j = hw - 2;	\
+			j = 2;		\
 			d[0] = mulawtolin16[s[0]][0] ^ 0x80;		\
 			d[1] = mulawtolin16[s[0]][1];			\
-			while (j > 0 && j < hw)\
+			while (j < hw)	\
 d[j++] = 0;\
 		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
 		break;			\
@@ -456,10 +456,10 @@ DEFINE_FILTER(alaw_to_linear##n_prec)			
 		break;			\
 	case AUDIO_ENCODING_ULINEAR_BE:	\
 		FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) {	\
-			j = hw - 2;	\
+			j = 2;		\
 			d[0] = alawtolin16[s[0]][0];			\
 			d[1] = alawtolin16[s[0]][1];			\
-			while (j > 0 && j < hw)\
+			while (j < hw)	\
 d[j++] = 0;\
 		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
 		break;			\
@@ -474,10 +474,10 @@ DEFINE_FILTER(alaw_to_linear##n_prec)			
 		break;			\
 	case AUDIO_ENCODING_SLINEAR_BE:	\
 		FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) {	\
-			j = hw - 2;	\
+			j = 2;		\
 			d[0] = alawtolin16[s[0]][0] ^ 0x80;		\
 			d[1] = alawtolin16[s[0]][1];			\
-			while (j > 0 && j < hw)\
+			while (j < hw)	\
 d[j++] = 0;\
 		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
 		break;			\



CVS commit: src/sys/dev

2017-06-26 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Mon Jun 26 11:45:46 UTC 2017

Modified Files:
src/sys/dev: mulaw.c

Log Message:
Rectify an error in mulaw/alaw conversion to big endian.  The atf audio
test should pass on sparc again.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/mulaw.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/mulaw.c
diff -u src/sys/dev/mulaw.c:1.30 src/sys/dev/mulaw.c:1.31
--- src/sys/dev/mulaw.c:1.30	Sun Jun 25 02:16:41 2017
+++ src/sys/dev/mulaw.c	Mon Jun 26 11:45:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mulaw.c,v 1.30 2017/06/25 02:16:41 nat Exp $	*/
+/*	$NetBSD: mulaw.c,v 1.31 2017/06/26 11:45:46 nat Exp $	*/
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.30 2017/06/25 02:16:41 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.31 2017/06/26 11:45:46 nat Exp $");
 
 #include 
 #include 
@@ -324,7 +324,7 @@ DEFINE_FILTER(mulaw_to_linear##n_prec)		
 			j = hw - 2;	\
 			d[0] = mulawtolin16[s[0]][0];			\
 			d[1] = mulawtolin16[s[0]][1];			\
-			while (j < hw)	\
+			while (j > 0 && j < hw)\
 d[j++] = 0;\
 		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
 		break;			\
@@ -342,7 +342,7 @@ DEFINE_FILTER(mulaw_to_linear##n_prec)		
 			j = hw - 2;	\
 			d[0] = mulawtolin16[s[0]][0] ^ 0x80;		\
 			d[1] = mulawtolin16[s[0]][1];			\
-			while (j < hw)	\
+			while (j > 0 && j < hw)\
 d[j++] = 0;\
 		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
 		break;			\
@@ -459,7 +459,7 @@ DEFINE_FILTER(alaw_to_linear##n_prec)			
 			j = hw - 2;	\
 			d[0] = alawtolin16[s[0]][0];			\
 			d[1] = alawtolin16[s[0]][1];			\
-			while (j < hw)	\
+			while (j > 0 && j < hw)\
 d[j++] = 0;\
 		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
 		break;			\
@@ -477,7 +477,7 @@ DEFINE_FILTER(alaw_to_linear##n_prec)			
 			j = hw - 2;	\
 			d[0] = alawtolin16[s[0]][0] ^ 0x80;		\
 			d[1] = alawtolin16[s[0]][1];			\
-			while (j < hw)	 \
+			while (j > 0 && j < hw)\
 d[j++] = 0;\
 		} FILTER_LOOP_EPILOGUE(this->src, dst);			\
 		break;			\



CVS commit: src/sys/netinet6

2017-06-26 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Jun 26 08:01:53 UTC 2017

Modified Files:
src/sys/netinet6: ip6_output.c

Log Message:
Fix usage of ip6_get_membership

It may set nothing to ifp even if returning 0. So we need to NULL-clear
ifp before calling it.

Fix PR kern/52324


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/netinet6/ip6_output.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/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.191 src/sys/netinet6/ip6_output.c:1.192
--- src/sys/netinet6/ip6_output.c:1.191	Fri Mar  3 07:13:06 2017
+++ src/sys/netinet6/ip6_output.c	Mon Jun 26 08:01:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.191 2017/03/03 07:13:06 ozaki-r Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.192 2017/06/26 08:01:53 ozaki-r Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.191 2017/03/03 07:13:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.192 2017/06/26 08:01:53 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2561,8 +2561,10 @@ ip6_setmoptions(const struct sockopt *so
 		 * Group must be a valid IP6 multicast address.
 		 */
 		bound = curlwp_bind();
+		ifp = NULL;
 		error = ip6_get_membership(sopt, , , , sizeof(ia));
 		if (error != 0) {
+			KASSERT(ifp == NULL);
 			curlwp_bindx(bound);
 			return error;
 		}



CVS commit: src

2017-06-26 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Jun 26 06:59:57 UTC 2017

Modified Files:
src/sys/net: rtsock.c
src/tests/net/arp: t_arp.sh
src/tests/net/ndp: t_ndp.sh

Log Message:
Drop RTF_UP from a routing message of a deleted ARP/NDP entry


To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/sys/net/rtsock.c
cvs rdiff -u -r1.29 -r1.30 src/tests/net/arp/t_arp.sh
cvs rdiff -u -r1.26 -r1.27 src/tests/net/ndp/t_ndp.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.222 src/sys/net/rtsock.c:1.223
--- src/sys/net/rtsock.c:1.222	Mon Jun 26 06:58:42 2017
+++ src/sys/net/rtsock.c	Mon Jun 26 06:59:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.222 2017/06/26 06:58:42 ozaki-r Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.223 2017/06/26 06:59:56 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.222 2017/06/26 06:58:42 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.223 2017/06/26 06:59:56 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -860,6 +860,7 @@ COMPATNAME(route_output)(struct mbuf *m,
 			satocsdl(info.rti_info[RTAX_GATEWAY]);
 			error = lla_rt_output(rtm->rtm_type, rtm->rtm_flags,
 			rtm->rtm_rmx.rmx_expire, , sdlp->sdl_index);
+			rtm->rtm_flags &= ~RTF_UP;
 			break;
 		}
 #endif

Index: src/tests/net/arp/t_arp.sh
diff -u src/tests/net/arp/t_arp.sh:1.29 src/tests/net/arp/t_arp.sh:1.30
--- src/tests/net/arp/t_arp.sh:1.29	Mon Jun 26 03:16:28 2017
+++ src/tests/net/arp/t_arp.sh	Mon Jun 26 06:59:57 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_arp.sh,v 1.29 2017/06/26 03:16:28 ozaki-r Exp $
+#	$NetBSD: t_arp.sh,v 1.30 2017/06/26 06:59:57 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -651,7 +651,7 @@ arp_rtm_body()
 	atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
 	str="$IP4DST $macaddr_dst"
 	atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
-	str="RTM_DELETE.+"
+	str="RTM_DELETE.+"
 	atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file
 	str=""
 	atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file

Index: src/tests/net/ndp/t_ndp.sh
diff -u src/tests/net/ndp/t_ndp.sh:1.26 src/tests/net/ndp/t_ndp.sh:1.27
--- src/tests/net/ndp/t_ndp.sh:1.26	Mon Jun 26 03:16:28 2017
+++ src/tests/net/ndp/t_ndp.sh	Mon Jun 26 06:59:57 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ndp.sh,v 1.26 2017/06/26 03:16:28 ozaki-r Exp $
+#	$NetBSD: t_ndp.sh,v 1.27 2017/06/26 06:59:57 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -450,7 +450,7 @@ ndp_rtm_body()
 	atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
 	str="$IP6DST $macaddr_dst"
 	atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
-	str="RTM_DELETE.+"
+	str="RTM_DELETE.+"
 	atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file
 	str=""
 	atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file



CVS commit: src/sys/net

2017-06-26 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Jun 26 06:58:42 UTC 2017

Modified Files:
src/sys/net: rtsock.c

Log Message:
Fix ifdef; care about a case w/ INET6 and w/o INET


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/sys/net/rtsock.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/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.221 src/sys/net/rtsock.c:1.222
--- src/sys/net/rtsock.c:1.221	Mon Jun 26 03:16:28 2017
+++ src/sys/net/rtsock.c	Mon Jun 26 06:58:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.221 2017/06/26 03:16:28 ozaki-r Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.222 2017/06/26 06:58:42 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.221 2017/06/26 03:16:28 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.222 2017/06/26 06:58:42 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -474,7 +474,7 @@ COMPATNAME(route_purgeif)(struct socket 
 	return EOPNOTSUPP;
 }
 
-#ifdef INET
+#if defined(INET) || defined(INET6)
 static int
 route_get_sdl_index(struct rt_addrinfo *info, int *sdl_index)
 {
@@ -493,7 +493,7 @@ route_get_sdl_index(struct rt_addrinfo *
 
 	return 0;
 }
-#endif /* INET */
+#endif
 
 static void
 route_get_sdl(const struct ifnet *ifp, const struct sockaddr *dst,
@@ -799,8 +799,8 @@ COMPATNAME(route_output)(struct mbuf *m,
 		if (info.rti_info[RTAX_GATEWAY] == NULL) {
 			senderr(EINVAL);
 		}
-#ifdef INET
-		/* support for new ARP code with keeping backcompat */
+#if defined(INET) || defined(INET6)
+		/* support for new ARP/NDP code with keeping backcompat */
 		if (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) {
 			const struct sockaddr_dl *sdlp =
 			satocsdl(info.rti_info[RTAX_GATEWAY]);
@@ -842,7 +842,7 @@ COMPATNAME(route_output)(struct mbuf *m,
 			break;
 		}
 	fallback:
-#endif /* INET */
+#endif /* defined(INET) || defined(INET6) */
 		error = rtrequest1(rtm->rtm_type, , _nrt);
 		if (error == 0) {
 			rt_setmetrics(rtm->rtm_inits, rtm, saved_nrt);
@@ -851,8 +851,8 @@ COMPATNAME(route_output)(struct mbuf *m,
 		break;
 
 	case RTM_DELETE:
-#ifdef INET
-		/* support for new ARP code */
+#if defined(INET) || defined(INET6)
+		/* support for new ARP/NDP code */
 		if (info.rti_info[RTAX_GATEWAY] &&
 		(info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) &&
 		(rtm->rtm_flags & RTF_LLDATA) != 0) {
@@ -862,7 +862,7 @@ COMPATNAME(route_output)(struct mbuf *m,
 			rtm->rtm_rmx.rmx_expire, , sdlp->sdl_index);
 			break;
 		}
-#endif /* INET */
+#endif
 		error = rtrequest1(rtm->rtm_type, , _nrt);
 		if (error != 0)
 			break;