CVS commit: src

2017-06-27 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jun 28 04:14:53 UTC 2017

Modified Files:
src/sbin/route: rtutil.c
src/sys/net: if_llatbl.c rtsock.c
src/tests/net/arp: t_arp.sh
src/tests/net/ndp: t_ndp.sh
src/tests/net/route: t_flags.sh t_flags6.sh

Log Message:
Restore ARP/NDP entries to route show and netstat -r

Requested by dyoung@ some time ago


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/route/rtutil.c
cvs rdiff -u -r1.20 -r1.21 src/sys/net/if_llatbl.c
cvs rdiff -u -r1.223 -r1.224 src/sys/net/rtsock.c
cvs rdiff -u -r1.31 -r1.32 src/tests/net/arp/t_arp.sh
cvs rdiff -u -r1.27 -r1.28 src/tests/net/ndp/t_ndp.sh
cvs rdiff -u -r1.17 -r1.18 src/tests/net/route/t_flags.sh
cvs rdiff -u -r1.13 -r1.14 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/sbin/route/rtutil.c
diff -u src/sbin/route/rtutil.c:1.8 src/sbin/route/rtutil.c:1.9
--- src/sbin/route/rtutil.c:1.8	Mon Apr  4 07:37:07 2016
+++ src/sbin/route/rtutil.c	Wed Jun 28 04:14:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtutil.c,v 1.8 2016/04/04 07:37:07 ozaki-r Exp $	*/
+/*	$NetBSD: rtutil.c,v 1.9 2017/06/28 04:14:53 ozaki-r Exp $	*/
 /*	$OpenBSD: show.c,v 1.1 2006/05/27 19:16:37 claudio Exp $	*/
 
 /*
@@ -59,6 +59,11 @@
 #include "prog_ops.h"
 #include "rtutil.h"
 
+/*
+ * Keep to handle ARP/NDP entries (fake routes)
+ * for backward compatibility.
+ */
+#define RTF_LLINFO	0x400
 
 #define PLEN(LONG_BIT / 4 + 2)
 #define PFKEYV2_CHUNK sizeof(u_int64_t)
@@ -84,7 +89,7 @@ static const struct bits bits[] = {
 	/* { RTF_CLONING,	'C' }, */
 	{ RTF_CONNECTED, 'C' },
 	/* { RTF_XRESOLVE,	'X' }, */
-	/* { RTF_LLINFO,	'L' }, */
+	{ RTF_LLINFO,	'L' },
 	{ RTF_STATIC,	'S' },
 	{ RTF_PROTO1,	'1' },
 	{ RTF_PROTO2,	'2' },
@@ -263,6 +268,9 @@ p_rtentry(struct rt_msghdr *rtm, int fla
 	char		 ifbuf[IF_NAMESIZE];
 #endif
 
+	if ((flags & RT_LFLAG) && (rtm->rtm_flags & RTF_LLINFO))
+		return;
+
 	if (old_af != sa->sa_family) {
 		old_af = sa->sa_family;
 		p_family(sa->sa_family);

Index: src/sys/net/if_llatbl.c
diff -u src/sys/net/if_llatbl.c:1.20 src/sys/net/if_llatbl.c:1.21
--- src/sys/net/if_llatbl.c:1.20	Fri Jun 23 05:46:10 2017
+++ src/sys/net/if_llatbl.c	Wed Jun 28 04:14:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_llatbl.c,v 1.20 2017/06/23 05:46:10 ozaki-r Exp $	*/
+/*	$NetBSD: if_llatbl.c,v 1.21 2017/06/28 04:14:53 ozaki-r Exp $	*/
 /*
  * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
  * Copyright (c) 2004-2008 Qing Li. All rights reserved.
@@ -80,6 +80,8 @@ int
 lltable_dump_entry(struct lltable *llt, struct llentry *lle,
 struct rt_walkarg *w, struct sockaddr *sa)
 {
+#define RTF_LLINFO	0x400
+#define RTF_CLONED	0x2000
 	struct ifnet *ifp = llt->llt_ifp;
 	int error;
 	void *a;
@@ -107,9 +109,14 @@ lltable_dump_entry(struct lltable *llt, 
 		struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem;
 
 		/* Need to copy by myself */
+		rtm->rtm_index = ifp->if_index;
+		rtm->rtm_rmx.rmx_mtu = 0;
 		rtm->rtm_rmx.rmx_expire =
 		(lle->la_flags & LLE_STATIC) ? 0 : lle->la_expire;
+		rtm->rtm_flags = RTF_UP;
 		rtm->rtm_flags |= RTF_HOST; /* For ndp */
+		/* For backward compatibility */
+		rtm->rtm_flags |= RTF_LLINFO | RTF_CLONED;
 		rtm->rtm_flags |= (lle->la_flags & LLE_STATIC) ? RTF_STATIC : 0;
 		if (lle->la_flags & LLE_PUB)
 			rtm->rtm_flags |= RTF_ANNOUNCE;
@@ -121,6 +128,8 @@ lltable_dump_entry(struct lltable *llt, 
 	}
 
 	return error;
+#undef RTF_LLINFO
+#undef RTF_CLONED
 }
 
 /*

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.223 src/sys/net/rtsock.c:1.224
--- src/sys/net/rtsock.c:1.223	Mon Jun 26 06:59:56 2017
+++ src/sys/net/rtsock.c	Wed Jun 28 04:14:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.223 2017/06/26 06:59:56 ozaki-r Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.224 2017/06/28 04:14:53 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.223 2017/06/26 06:59:56 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.224 2017/06/28 04:14:53 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1932,10 +1932,22 @@ again:
 		}
 #endif
 
-		for (i = 1; i <= AF_MAX; i++)
-			if ((af == 0 || af == i) &&
-			(error = rt_walktree(i, sysctl_dumpentry, &w)))
-break;
+		for (i = 1; i <= AF_MAX; i++) {
+			if (af == 0 || af == i) {
+error = rt_walktree(i, sysctl_dumpentry, &w);
+if (error != 0)
+	break;
+#if defined(INET) || defined(INET6)
+/*
+ * Return ARP/NDP entries too for
+ * backward compatibility.
+ */
+error = lltable_sysctl_dump(i, &w);
+if (error != 0)
+	break;
+#endif
+			}
+		}
 		break;
 
 #ifdef COMPAT_14

Index: src/tests/net/arp/t_arp.sh
diff -u src/tests/net/arp/t_arp.sh:1.31 src/tests/net/arp/t_arp.sh:1.32
--- src/tests/net/arp/t_arp.

CVS commit: src

2017-06-27 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jun 28 04:10:47 UTC 2017

Modified Files:
src/sys/net: route.c
src/tests/net/arp: t_arp.sh
src/tests/net/route: t_route.sh

Log Message:
Drop RTF_LLINFO flag (now it's RTF_LLDATA) from local routes

They don't have llinfo anymore. And also the change fixes unexpected
behavior of ARP proxy.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/net/route.c
cvs rdiff -u -r1.30 -r1.31 src/tests/net/arp/t_arp.sh
cvs rdiff -u -r1.12 -r1.13 src/tests/net/route/t_route.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/route.c
diff -u src/sys/net/route.c:1.196 src/sys/net/route.c:1.197
--- src/sys/net/route.c:1.196	Thu Jun 22 09:56:48 2017
+++ src/sys/net/route.c	Wed Jun 28 04:10:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.196 2017/06/22 09:56:48 ozaki-r Exp $	*/
+/*	$NetBSD: route.c,v 1.197 2017/06/28 04:10:47 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.196 2017/06/22 09:56:48 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.197 2017/06/28 04:10:47 ozaki-r Exp $");
 
 #include 
 #ifdef RTFLUSH_DEBUG
@@ -1594,8 +1594,6 @@ rt_ifa_addlocal(struct ifaddr *ifa)
 
 		memset(&info, 0, sizeof(info));
 		info.rti_flags = RTF_HOST | RTF_LOCAL;
-		if (!(ifa->ifa_ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT)))
-			info.rti_flags |= RTF_LLDATA;
 		info.rti_info[RTAX_DST] = ifa->ifa_addr;
 		info.rti_info[RTAX_GATEWAY] =
 		(const struct sockaddr *)ifa->ifa_ifp->if_sadl;

Index: src/tests/net/arp/t_arp.sh
diff -u src/tests/net/arp/t_arp.sh:1.30 src/tests/net/arp/t_arp.sh:1.31
--- src/tests/net/arp/t_arp.sh:1.30	Mon Jun 26 06:59:57 2017
+++ src/tests/net/arp/t_arp.sh	Wed Jun 28 04:10:47 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_arp.sh,v 1.30 2017/06/26 06:59:57 ozaki-r Exp $
+#	$NetBSD: t_arp.sh,v 1.31 2017/06/28 04:10:47 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -322,10 +322,12 @@ arp_cache_overwriting_body()
 	export RUMP_SERVER=$SOCKSRC
 
 	# Cannot overwrite a permanent cache
-	atf_check -s exit:0 rump.arp -s $IP4SRC b2:a0:20:00:00:ff
+	atf_check -s exit:0 rump.arp -s $IP4DST b2:a0:20:00:00:ff
 	$DEBUG && rump.arp -n -a
 	atf_check -s not-exit:0 -e match:'File exists' \
-	rump.arp -s $IP4SRC b2:a0:20:00:00:fe
+	rump.arp -s $IP4DST b2:a0:20:00:00:fe
+	# cleanup
+	atf_check -s exit:0 rump.arp -d $IP4DST
 
 	atf_check -s exit:0 -o ignore rump.ping -n -w $TIMEOUT -c 1 $IP4DST
 	$DEBUG && rump.arp -n -a
@@ -383,11 +385,11 @@ test_proxy_arp()
 
 	if [ "$type" = "pub" ]; then
 		opts="pub"
-		title="permanent published"
 	else
 		opts="pub proxy"
-		title='permanent published \(proxy only\)'
 	fi
+	# Always proxy only since migrating to lltable/llentry
+	title='permanent published \(proxy only\)'
 
 	#
 	# Test#1: First setup an endpoint then create proxy arp entry
@@ -413,26 +415,14 @@ test_proxy_arp()
 
 	# Try to ping
 	export RUMP_SERVER=$SOCKSRC
-	if [ "$type" = "pub" ]; then
-		# XXX fails
-		atf_check -s not-exit:0 -o ignore -e ignore \
-		rump.ping -n -w 1 -c 1 $IP4DST_PROXYARP1
-	else
-		atf_check -s exit:0 -o ignore \
-		rump.ping -n -w 1 -c 1 $IP4DST_PROXYARP1
-	fi
+	atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 $IP4DST_PROXYARP1
 
 	extract_new_packets bus1 > ./out
 	$DEBUG && cat ./out
 
 	pkt1=$(make_pkt_str_arprep $IP4DST_PROXYARP1 $macaddr_dst)
 	pkt2=$(make_pkt_str_garp $IP4DST_PROXYARP1 $macaddr_dst)
-	if [ "$type" = "pub" ]; then
-		atf_check -s not-exit:0 -x \
-		"cat ./out |grep -q -e '$pkt1' -e '$pkt2'"
-	else
-		atf_check -s exit:0 -x "cat ./out |grep -q -e '$pkt1' -e '$pkt2'"
-	fi
+	atf_check -s exit:0 -x "cat ./out |grep -q -e '$pkt1' -e '$pkt2'"
 
 	#
 	# Test#2: Create proxy arp entry then set up an endpoint

Index: src/tests/net/route/t_route.sh
diff -u src/tests/net/route/t_route.sh:1.12 src/tests/net/route/t_route.sh:1.13
--- src/tests/net/route/t_route.sh:1.12	Fri Mar 24 03:47:25 2017
+++ src/tests/net/route/t_route.sh	Wed Jun 28 04:10:47 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: t_route.sh,v 1.12 2017/03/24 03:47:25 ozaki-r Exp $
+#	$NetBSD: t_route.sh,v 1.13 2017/06/28 04:10:47 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -234,7 +234,7 @@ test_route_get()
 destination: 10.0.1.2
  local addr: 10.0.1.2
   interface: lo0
-  flags: 
+  flags: 
  recvpipe  sendpipe  ssthresh  rtt,msecrttvar  hopcount  mtu expire
 	EOF
 	rump.route -n get $IP4SRC > ./output
@@ -309,7 +309,7 @@ test_route_get6()
 destination: fc00:0:0:1::2
  local addr: fc00:0:0:1::2
   interface: lo0
-  flags: 
+  flags: 
  recvpipe  sendpipe  ssthresh  rtt,msecrttvar  hopcount  mtu expire
 	EOF
 	rump.route -n get -inet6 $IP6SRC > ./output



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

2017-06-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jun 28 03:57:36 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_type.h

Log Message:
 Add IXGBE_TIPG_IPGT_MASK and IXGBE_PAP_PACE_MASK for packet pacing.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/ixgbe/ixgbe_type.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/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.24 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.25
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.24	Tue Jun 27 08:03:55 2017
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Wed Jun 28 03:57:36 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_type.h,v 1.24 2017/06/27 08:03:55 msaitoh Exp $*/
+/*$NetBSD: ixgbe_type.h,v 1.25 2017/06/28 03:57:36 msaitoh Exp $*/
 
 #ifndef _IXGBE_TYPE_H_
 #define _IXGBE_TYPE_H_
@@ -510,6 +510,7 @@
 /* Tx DCA Control register : 128 of these (0-127) */
 #define IXGBE_DCA_TXCTRL_82599(_i)	(0x0600C + ((_i) * 0x40))
 #define IXGBE_TIPG			0x0CB00
+#define IXGBE_TIPG_IPGT_MASK		0x00FF
 #define IXGBE_TXPBSIZE(_i)		(0x0CC00 + ((_i) * 4)) /* 8 of these */
 #define IXGBE_MNGTXMAP			0x0CD10
 #define IXGBE_TIPG_FIBER_DEFAULT	3
@@ -1759,6 +1760,7 @@ enum {
 
 /* PAP bit masks*/
 #define IXGBE_PAP_TXPAUSECNT_MASK	0x /* Pause counter mask */
+#define IXGBE_PAP_PACE_MASK		0x000F /* Pace bit mask */
 
 /* RMCS Bit Masks */
 #define IXGBE_RMCS_RRM			0x0002 /* Rx Recycle Mode enable */



CVS commit: src/external/bsd/dhcp/dist

2017-06-27 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed Jun 28 02:46:31 UTC 2017

Modified Files:
src/external/bsd/dhcp/dist/client: dhclient.c
src/external/bsd/dhcp/dist/common: bpf.c comapi.c discover.c dispatch.c
dlpi.c execute.c lpf.c nit.c options.c packet.c parse.c raw.c
socket.c tr.c tree.c upf.c
src/external/bsd/dhcp/dist/dhcpctl: cltest.c omshell.c
src/external/bsd/dhcp/dist/includes: dhcpd.h
src/external/bsd/dhcp/dist/relay: dhcrelay.c
src/external/bsd/dhcp/dist/server: dhcpd.c
src/external/bsd/dhcp/dist/tests: t_api.c

Log Message:
Make DHCP programs compatible with crunchgen(1)

DHCP programs are incompatible with crunchgen(1) so far, because
libdhcp uses callbacks with the same function names for dhclient,
dhcrelay, dhcpd, and omshell. As a result, it is impossible to
link correctly in a single binary.

The offending symbols are classify, check_collection, dhcp, dhcpv6,
bootp, find_class, parse_allow_deny, and dhcp_set_control_state, and
the local_port and remote_port variables.

This change make each program register an array of callbacks at
main() start. libdhcp then uses callbacks through registered
function and variable pointers, and DHCP programs can now go
trough crunchgen(1).

Submitted upstream as ISC-Bugs #45330 with a patch against latest ISC git.
The soon to be released 4.3.6 will not include the change, but it is
likely to be included in 4.3.7


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/dhcp/dist/client/dhclient.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/dhcp/dist/common/bpf.c \
src/external/bsd/dhcp/dist/common/dispatch.c
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/dhcp/dist/common/comapi.c \
src/external/bsd/dhcp/dist/common/nit.c \
src/external/bsd/dhcp/dist/common/tr.c \
src/external/bsd/dhcp/dist/common/upf.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcp/dist/common/discover.c
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/dhcp/dist/common/dlpi.c \
src/external/bsd/dhcp/dist/common/execute.c \
src/external/bsd/dhcp/dist/common/options.c \
src/external/bsd/dhcp/dist/common/parse.c \
src/external/bsd/dhcp/dist/common/socket.c \
src/external/bsd/dhcp/dist/common/tree.c
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/dhcp/dist/common/lpf.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/dhcp/dist/common/packet.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/dhcp/dist/common/raw.c
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/dhcp/dist/dhcpctl/cltest.c \
src/external/bsd/dhcp/dist/dhcpctl/omshell.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/dhcp/dist/includes/dhcpd.h
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/dhcp/dist/relay/dhcrelay.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcp/dist/server/dhcpd.c
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/dhcp/dist/tests/t_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/external/bsd/dhcp/dist/client/dhclient.c
diff -u src/external/bsd/dhcp/dist/client/dhclient.c:1.10 src/external/bsd/dhcp/dist/client/dhclient.c:1.11
--- src/external/bsd/dhcp/dist/client/dhclient.c:1.10	Sun Jan 10 20:10:44 2016
+++ src/external/bsd/dhcp/dist/client/dhclient.c	Wed Jun 28 02:46:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dhclient.c,v 1.10 2016/01/10 20:10:44 christos Exp $	*/
+/*	$NetBSD: dhclient.c,v 1.11 2017/06/28 02:46:30 manu Exp $	*/
 /* dhclient.c
 
DHCP Client. */
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: dhclient.c,v 1.10 2016/01/10 20:10:44 christos Exp $");
+__RCSID("$NetBSD: dhclient.c,v 1.11 2017/06/28 02:46:30 manu Exp $");
 
 #include "dhcpd.h"
 #include 
@@ -95,6 +95,21 @@ int wanted_ia_ta = 0;
 int wanted_ia_pd = 0;
 char *mockup_relay = NULL;
 
+libdhcp_callbacks_t dhclient_callbacks = {
+	&local_port,
+	&remote_port,
+	classify,
+	check_collection,
+	dhcp,
+#ifdef DHCPv6
+	dhcpv6,
+#endif /* DHCPv6 */
+	bootp,
+	find_class,
+	parse_allow_deny,
+	dhcp_set_control_state,
+};
+
 void run_stateless(int exit_mode);
 
 static void usage(void);
@@ -183,6 +198,8 @@ main(int argc, char **argv) {
 	char *s;
 	char **ifaces;
 
+	libdhcp_callbacks_register(&dhclient_callbacks);
+
 	/* Initialize client globals. */
 	memset(&default_duid, 0, sizeof(default_duid));
 
@@ -942,7 +959,7 @@ int find_subnet (struct subnet **sp,
  */
 
 #include 
-__RCSID("$NetBSD: dhclient.c,v 1.10 2016/01/10 20:10:44 christos Exp $");
+__RCSID("$NetBSD: dhclient.c,v 1.11 2017/06/28 02:46:30 manu Exp $");
 
 void state_reboot (cpp)
 	void *cpp;

Index: src/external/bsd/dhcp/dist/common/bpf.c
diff -u src/external/bsd/dhcp/dist/common/bpf.c:1.4 src/external/bsd/dhcp/dist/common/bpf.c:1.5
--- src/external/bsd/dhcp/dist/common/bpf.c:1.4	Sun Jan 10 20:10:44 2016
+++ src/external/bsd/dhcp/dist/common/bpf.c	Wed Jun 28 02:46:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.4 2016/01/10 20:10:44 christos Exp $	*/
+/*	$NetBSD: bp

CVS commit: src/lib/libedit

2017-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 27 23:29:13 UTC 2017

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

Log Message:
fix comment


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/lib/libedit/refresh.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/refresh.c
diff -u src/lib/libedit/refresh.c:1.52 src/lib/libedit/refresh.c:1.53
--- src/lib/libedit/refresh.c:1.52	Tue Jun 27 19:23:48 2017
+++ src/lib/libedit/refresh.c	Tue Jun 27 19:29:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.52 2017/06/27 23:23:48 christos Exp $	*/
+/*	$NetBSD: refresh.c,v 1.53 2017/06/27 23:29:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.52 2017/06/27 23:23:48 christos Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.53 2017/06/27 23:29:12 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -155,7 +155,7 @@ re_addc(EditLine *el, wint_t c)
 	}
 }
 
-/* re_putc():
+/* re_putliteral():
  *	Place the literal string given
  */
 libedit_private void



CVS commit: src/bin/sh

2017-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 27 23:27:03 UTC 2017

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

Log Message:
Add literal prompt support this allows one to do:
CA="$(printf '\1')"
PS1="${CA}$(tput bold)${CA}\$${CA}$(tput sgr0)${CA} "


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 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.50 src/bin/sh/histedit.c:1.51
--- src/bin/sh/histedit.c:1.50	Mon Jun 26 22:22:08 2017
+++ src/bin/sh/histedit.c	Tue Jun 27 19:27:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.50 2017/06/27 02:22:08 kre Exp $	*/
+/*	$NetBSD: histedit.c,v 1.51 2017/06/27 23:27:03 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.50 2017/06/27 02:22:08 kre Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.51 2017/06/27 23:27:03 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -134,7 +134,7 @@ histedit(void)
 			if (el != NULL) {
 if (hist)
 	el_set(el, EL_HIST, history, hist);
-el_set(el, EL_PROMPT, getprompt);
+el_set(el, EL_PROMPT_ESC, getprompt, L'\1');
 el_set(el, EL_SIGNAL, 1);
 el_set(el, EL_ALIAS_TEXT, alias_text, NULL);
 el_set(el, EL_ADDFN, "rl-complete",



CVS commit: src/lib/libedit

2017-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 27 23:25:13 UTC 2017

Modified Files:
src/lib/libedit: Makefile el.c el.h prompt.c
Added Files:
src/lib/libedit: literal.c literal.h

Log Message:
add literal escape sequence support, patterned after the tcsh ones.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/libedit/Makefile
cvs rdiff -u -r1.93 -r1.94 src/lib/libedit/el.c
cvs rdiff -u -r1.41 -r1.42 src/lib/libedit/el.h
cvs rdiff -u -r0 -r1.1 src/lib/libedit/literal.c src/lib/libedit/literal.h
cvs rdiff -u -r1.26 -r1.27 src/lib/libedit/prompt.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/Makefile
diff -u src/lib/libedit/Makefile:1.63 src/lib/libedit/Makefile:1.64
--- src/lib/libedit/Makefile:1.63	Tue May 24 13:42:54 2016
+++ src/lib/libedit/Makefile	Tue Jun 27 19:25:13 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.63 2016/05/24 17:42:54 christos Exp $
+#	$NetBSD: Makefile,v 1.64 2017/06/27 23:25:13 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/4/93
 
 USE_SHLIBDIR=	yes
@@ -15,7 +15,7 @@ CWARNFLAGS.gcc+=	-Wconversion
 CWARNFLAGS.clang+=	-Wno-cast-qual
 
 SRCS =	chared.c chartype.c common.c el.c eln.c emacs.c filecomplete.c \
-	hist.c history.c historyn.c keymacro.c map.c \
+	hist.c history.c historyn.c keymacro.c literal.c map.c \
 	parse.c prompt.c read.c readline.c refresh.c search.c sig.c \
 	terminal.c tokenizer.c tokenizern.c tty.c vi.c
 

Index: src/lib/libedit/el.c
diff -u src/lib/libedit/el.c:1.93 src/lib/libedit/el.c:1.94
--- src/lib/libedit/el.c:1.93	Mon Jun 26 20:47:37 2017
+++ src/lib/libedit/el.c	Tue Jun 27 19:25:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.c,v 1.93 2017/06/27 00:47:37 kre Exp $	*/
+/*	$NetBSD: el.c,v 1.94 2017/06/27 23:25:13 christos 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.93 2017/06/27 00:47:37 kre Exp $");
+__RCSID("$NetBSD: el.c,v 1.94 2017/06/27 23:25:13 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -115,6 +115,7 @@ el_init_fd(const char *prog, FILE *fin, 
 	(void) hist_init(el);
 	(void) prompt_init(el);
 	(void) sig_init(el);
+	(void) literal_init(el);
 	if (read_init(el) == -1) {
 		el_end(el);
 		return NULL;
@@ -146,6 +147,7 @@ el_end(EditLine *el)
 	hist_end(el);
 	prompt_end(el);
 	sig_end(el);
+	literal_end(el);
 
 	el_free(el->el_prog);
 	el_free(el->el_visual.cbuff);

Index: src/lib/libedit/el.h
diff -u src/lib/libedit/el.h:1.41 src/lib/libedit/el.h:1.42
--- src/lib/libedit/el.h:1.41	Tue May 24 11:00:45 2016
+++ src/lib/libedit/el.h	Tue Jun 27 19:25:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.h,v 1.41 2016/05/24 15:00:45 christos Exp $	*/
+/*	$NetBSD: el.h,v 1.42 2017/06/27 23:25:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -94,6 +94,7 @@ typedef struct el_state_t {
 
 #include "tty.h"
 #include "prompt.h"
+#include "literal.h"
 #include "keymacro.h"
 #include "terminal.h"
 #include "refresh.h"
@@ -115,8 +116,8 @@ struct editline {
 	int		  el_errfd;	/* Error file descriptor	*/
 	int		  el_flags;	/* Various flags.		*/
 	coord_t		  el_cursor;	/* Cursor location		*/
-	wchar_t		**el_display;	/* Real screen image = what is there */
-	wchar_t		**el_vdisplay;	/* Virtual screen image = what we see */
+	wint_t		**el_display;	/* Real screen image = what is there */
+	wint_t		**el_vdisplay;	/* Virtual screen image = what we see */
 	void		 *el_data;	/* Client data			*/
 	el_line_t	  el_line;	/* The current line information	*/
 	el_state_t	  el_state;	/* Current editor state		*/
@@ -125,6 +126,7 @@ struct editline {
 	el_refresh_t	  el_refresh;	/* Refresh stuff		*/
 	el_prompt_t	  el_prompt;	/* Prompt stuff			*/
 	el_prompt_t	  el_rprompt;	/* Prompt stuff			*/
+	el_literal_t	  el_literal;	/* prompt literal bits		*/
 	el_chared_t	  el_chared;	/* Characted editor stuff	*/
 	el_map_t	  el_map;	/* Key mapping stuff		*/
 	el_keymacro_t	  el_keymacro;	/* Key binding stuff		*/

Index: src/lib/libedit/prompt.c
diff -u src/lib/libedit/prompt.c:1.26 src/lib/libedit/prompt.c:1.27
--- src/lib/libedit/prompt.c:1.26	Mon May  9 17:46:56 2016
+++ src/lib/libedit/prompt.c	Tue Jun 27 19:25:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: prompt.c,v 1.26 2016/05/09 21:46:56 christos Exp $	*/
+/*	$NetBSD: prompt.c,v 1.27 2017/06/27 23:25:13 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)prompt.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: prompt.c,v 1.26 2016/05/09 21:46:56 christos Exp $");
+__RCSID("$NetBSD: prompt.c,v 1.27 2017/06/27 23:25:13 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -84,7 +84,6 @@ prompt_print(EditLine *el, int op)
 {
 	el_prompt_t *elp;
 	wchar_t *p;
-	int ignore = 0;
 
 	if (op == EL_PROMPT)
 		elp = &el->el_prompt;
@@ -99,13 +98,17 @@ prompt_print(EditLine *el, int op)
 
 	

CVS commit: src/lib/libedit

2017-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 27 23:24:19 UTC 2017

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

Log Message:
remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/lib/libedit/read.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/read.c
diff -u src/lib/libedit/read.c:1.102 src/lib/libedit/read.c:1.103
--- src/lib/libedit/read.c:1.102	Sun Dec 11 10:47:06 2016
+++ src/lib/libedit/read.c	Tue Jun 27 19:24:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: read.c,v 1.102 2016/12/11 15:47:06 christos Exp $	*/
+/*	$NetBSD: read.c,v 1.103 2017/06/27 23:24:19 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)read.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: read.c,v 1.102 2016/12/11 15:47:06 christos Exp $");
+__RCSID("$NetBSD: read.c,v 1.103 2017/06/27 23:24:19 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -229,10 +229,9 @@ read_getcmd(EditLine *el, el_action_t *c
 {
 	static const wchar_t meta = (wchar_t)0x80;
 	el_action_t cmd;
-	int num;
 
 	do {
-		if ((num = el_wgetc(el, ch)) != 1)
+		if (el_wgetc(el, ch) != 1)
 			return -1;
 
 #ifdef	KANJI



CVS commit: src/lib/libedit

2017-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 27 23:23:48 UTC 2017

Modified Files:
src/lib/libedit: refresh.c refresh.h

Log Message:
- add literal sequence handling.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/lib/libedit/refresh.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libedit/refresh.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/libedit/refresh.c
diff -u src/lib/libedit/refresh.c:1.51 src/lib/libedit/refresh.c:1.52
--- src/lib/libedit/refresh.c:1.51	Mon May  9 17:46:56 2016
+++ src/lib/libedit/refresh.c	Tue Jun 27 19:23:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.51 2016/05/09 21:46:56 christos Exp $	*/
+/*	$NetBSD: refresh.c,v 1.52 2017/06/27 23:23:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.51 2016/05/09 21:46:56 christos Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.52 2017/06/27 23:23:48 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -155,6 +155,27 @@ re_addc(EditLine *el, wint_t c)
 	}
 }
 
+/* re_putc():
+ *	Place the literal string given
+ */
+libedit_private void
+re_putliteral(EditLine *el, const wchar_t *begin, const wchar_t *end)
+{
+	coord_t *cur = &el->el_refresh.r_cursor;
+	wint_t c;
+	int sizeh = el->el_terminal.t_size.h;
+
+	c = literal_add(el, begin, end);
+	if (c == 0)
+		return;
+	el->el_vdisplay[cur->v][cur->h] = c;
+	cur->h += 1;	/* XXX: only for narrow */
+	if (cur->h >= sizeh) {
+		/* assure end of line */
+		el->el_vdisplay[cur->v][sizeh] = '\0';
+		re_nextline(el);
+	}
+}
 
 /* re_putc():
  *	Draw the character given
@@ -162,30 +183,30 @@ re_addc(EditLine *el, wint_t c)
 libedit_private void
 re_putc(EditLine *el, wint_t c, int shift)
 {
+	coord_t *cur = &el->el_refresh.r_cursor;
 	int i, w = wcwidth(c);
+	int sizeh = el->el_terminal.t_size.h;
+
 	ELRE_DEBUG(1, (__F, "printing %5x '%lc'\r\n", c, c));
 	if (w == -1)
 		w = 0;
 
-	while (shift && (el->el_refresh.r_cursor.h + w > el->el_terminal.t_size.h))
+	while (shift && (cur->h + w > sizeh))
 	re_putc(el, ' ', 1);
 
-	el->el_vdisplay[el->el_refresh.r_cursor.v]
-	[el->el_refresh.r_cursor.h] = c;
+	el->el_vdisplay[cur->v][cur->h] = c;
 	/* assumes !shift is only used for single-column chars */
 	i = w;
 	while (--i > 0)
-		el->el_vdisplay[el->el_refresh.r_cursor.v]
-		[el->el_refresh.r_cursor.h + i] = MB_FILL_CHAR;
+		el->el_vdisplay[cur->v][cur->h + i] = MB_FILL_CHAR;
 
 	if (!shift)
 		return;
 
-	el->el_refresh.r_cursor.h += w;	/* advance to next place */
-	if (el->el_refresh.r_cursor.h >= el->el_terminal.t_size.h) {
+	cur->h += w;	/* advance to next place */
+	if (cur->h >= sizeh) {
 		/* assure end of line */
-		el->el_vdisplay[el->el_refresh.r_cursor.v][el->el_terminal.t_size.h]
-		= '\0';
+		el->el_vdisplay[cur->v][sizeh] = '\0';
 		re_nextline(el);
 	}
 }
@@ -210,10 +231,13 @@ re_refresh(EditLine *el)
 	ELRE_DEBUG(1, (__F, "el->el_line.buffer = :%ls:\r\n",
 	el->el_line.buffer));
 
+	literal_clear(el);
 	/* reset the Drawing cursor */
 	el->el_refresh.r_cursor.h = 0;
 	el->el_refresh.r_cursor.v = 0;
 
+	terminal_move_to_char(el, 0);
+
 	/* temporarily draw rprompt to calculate its size */
 	prompt_print(el, EL_RPROMPT);
 

Index: src/lib/libedit/refresh.h
diff -u src/lib/libedit/refresh.h:1.10 src/lib/libedit/refresh.h:1.11
--- src/lib/libedit/refresh.h:1.10	Mon May  9 17:46:56 2016
+++ src/lib/libedit/refresh.h	Tue Jun 27 19:23:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.h,v 1.10 2016/05/09 21:46:56 christos Exp $	*/
+/*	$NetBSD: refresh.h,v 1.11 2017/06/27 23:23:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -47,6 +47,8 @@ typedef struct {
 } el_refresh_t;
 
 libedit_private void	re_putc(EditLine *, wint_t, int);
+libedit_private void	re_putliteral(EditLine *, const wchar_t *,
+const wchar_t *);
 libedit_private void	re_clear_lines(EditLine *);
 libedit_private void	re_clear_display(EditLine *);
 libedit_private void	re_refresh(EditLine *);



CVS commit: src/lib/libedit

2017-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 27 23:23:09 UTC 2017

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

Log Message:
- handle literal escape sequence printing.
- factor out common code in allocation and freeing of the display.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/libedit/terminal.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/terminal.c
diff -u src/lib/libedit/terminal.c:1.32 src/lib/libedit/terminal.c:1.33
--- src/lib/libedit/terminal.c:1.32	Mon May  9 17:46:56 2016
+++ src/lib/libedit/terminal.c	Tue Jun 27 19:23:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: terminal.c,v 1.32 2016/05/09 21:46:56 christos Exp $	*/
+/*	$NetBSD: terminal.c,v 1.33 2017/06/27 23:23:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c	8.2 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: terminal.c,v 1.32 2016/05/09 21:46:56 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.33 2017/06/27 23:23:09 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -419,46 +419,58 @@ terminal_rebuffer_display(EditLine *el)
 	return 0;
 }
 
-
-/* terminal_alloc_display():
- *	Allocate a new display.
- */
-static int
-terminal_alloc_display(EditLine *el)
+static wchar_t **
+terminal_alloc_buffer(EditLine *el)
 {
-	int i;
-	wchar_t **b;
+	wint_t **b;
 	coord_t *c = &el->el_terminal.t_size;
+	int i;
 
 	b =  el_malloc(sizeof(*b) * (size_t)(c->v + 1));
 	if (b == NULL)
-		goto done;
+		return NULL;
 	for (i = 0; i < c->v; i++) {
 		b[i] = el_malloc(sizeof(**b) * (size_t)(c->h + 1));
 		if (b[i] == NULL) {
 			while (--i >= 0)
 el_free(b[i]);
 			el_free(b);
-			goto done;
+			return NULL;
 		}
 	}
 	b[c->v] = NULL;
-	el->el_display = b;
+	return b;
+}
 
-	b = el_malloc(sizeof(*b) * (size_t)(c->v + 1));
-	if (b == NULL)
+static void
+terminal_free_buffer(wint_t ***bp)
+{
+	wint_t **b;
+	wint_t **bufp;
+
+	if (*bp == NULL)
+		return;
+
+	b = *bp;
+	*bp = NULL;
+
+	for (bufp = b; *bufp != NULL; bufp++)
+		el_free(*bufp);
+	el_free(b);
+}
+
+/* terminal_alloc_display():
+ *	Allocate a new display.
+ */
+static int
+terminal_alloc_display(EditLine *el)
+{
+	el->el_display = terminal_alloc_buffer(el);
+	if (el->el_display == NULL)
+		goto done;
+	el->el_vdisplay = terminal_alloc_buffer(el);
+	if (el->el_vdisplay == NULL)
 		goto done;
-	for (i = 0; i < c->v; i++) {
-		b[i] = el_malloc(sizeof(**b) * (size_t)(c->h + 1));
-		if (b[i] == NULL) {
-			while (--i >= 0)
-el_free(b[i]);
-			el_free(b);
-			goto done;
-		}
-	}
-	b[c->v] = NULL;
-	el->el_vdisplay = b;
 	return 0;
 done:
 	terminal_free_display(el);
@@ -472,23 +484,8 @@ done:
 static void
 terminal_free_display(EditLine *el)
 {
-	wchar_t **b;
-	wchar_t **bufp;
-
-	b = el->el_display;
-	el->el_display = NULL;
-	if (b != NULL) {
-		for (bufp = b; *bufp != NULL; bufp++)
-			el_free(*bufp);
-		el_free(b);
-	}
-	b = el->el_vdisplay;
-	el->el_vdisplay = NULL;
-	if (b != NULL) {
-		for (bufp = b; *bufp != NULL; bufp++)
-			el_free(*bufp);
-		el_free(b);
-	}
+	terminal_free_buffer(&el->el_display);
+	terminal_free_buffer(&el->el_vdisplay);
 }
 
 
@@ -1254,6 +1251,8 @@ terminal__putc(EditLine *el, wint_t c)
 	ssize_t i;
 	if (c == (wint_t)MB_FILL_CHAR)
 		return 0;
+	if (c & EL_LITERAL)
+		return fputs(literal_get(el, c), el->el_outfile);
 	i = ct_encode_char(buf, (size_t)MB_LEN_MAX, c);
 	if (i <= 0)
 		return (int)i;



CVS commit: src/lib/libedit

2017-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 27 23:22:20 UTC 2017

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

Log Message:
mention the limitation of the literal sequence delimiter.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/lib/libedit/editline.3

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.94 src/lib/libedit/editline.3:1.95
--- src/lib/libedit/editline.3:1.94	Mon Jun 26 21:22:58 2017
+++ src/lib/libedit/editline.3	Tue Jun 27 19:22:20 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.94 2017/06/27 01:22:58 kre Exp $
+.\"	$NetBSD: editline.3,v 1.95 2017/06/27 23:22:20 christos Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 22, 2016
+.Dd June 27, 2017
 .Dt EDITLINE 3
 .Os
 .Sh NAME
@@ -358,6 +358,8 @@ terminal without affecting the state of 
 A subsequent second start/stop literal character ends this behavior.
 This is typically used to embed literal escape sequences that change the
 color/style of the terminal in the prompt.
+Note that the literal escape character cannot be the last character in the
+prompt, as the escape sequence is attached to the next character in the prompt.
 .Dv 0
 unsets it.
 .It Dv EL_REFRESH



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

2017-06-27 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Jun 27 20:13:56 UTC 2017

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

Log Message:
need to explicitely call siisata_timeout() also for polled bio command when
it times out to clean up; this should avoid the 'polled command has been
queued' panic from wddump()


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.24 -r1.30.4.25 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.24 src/sys/dev/ic/siisata.c:1.30.4.25
--- src/sys/dev/ic/siisata.c:1.30.4.24	Tue Jun 27 18:36:04 2017
+++ src/sys/dev/ic/siisata.c	Tue Jun 27 20:13:56 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.24 2017/06/27 18:36:04 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.25 2017/06/27 20:13:56 jdolecek Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.24 2017/06/27 18:36:04 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.25 2017/06/27 20:13:56 jdolecek Exp $");
 
 #include 
 #include 
@@ -1169,6 +1169,10 @@ siisata_bio_start(struct ata_channel *ch
 		DELAY(100);
 	}
 
+	if ((ata_bio->flags & ATA_ITSDONE) == 0) {
+		siisata_timeout(xfer);
+	}
+
 	siisata_enable_port_interrupt(chp);
 out:
 	SIISATA_DEBUG_PRINT(("%s: %s: done\n",



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

2017-06-27 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Jun 27 18:36:04 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c ata_wdc.c atavar.h
src/sys/dev/ic [jdolecek-ncq]: ahcisata_core.c mvsata.c siisata.c wdc.c
src/sys/dev/scsipi [jdolecek-ncq]: atapi_wdc.c

Log Message:
attend error paths, more strict asserts and code consistency

- atastart() and ata_kill_pending() now KASSERT() that all xfers on queue
  have same channel
- inactive xfers are killed via new reason KILL_GONE_INACTIVE, controller
  code must not call any resource deactivation in that case
- c_intr() must call ata_waitdrain_xfer_check() as first thing, and must not
  further touch any xfer structures on exit path; any resource cleanup
  is supposed to be done in c_kill_xfer()
- c_kill_xfer() should never call atastart()
- ata_waitdrain_check() removed, replaced by ata_waitdrain_xfer_check()
- ATA_DRIVE_WAITDRAIN handling converted to use condvar
- removed unused ata_c callback


To generate a diff of this commit:
cvs rdiff -u -r1.132.8.17 -r1.132.8.18 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.105.6.5 -r1.105.6.6 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.92.8.15 -r1.92.8.16 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.57.6.16 -r1.57.6.17 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.35.6.16 -r1.35.6.17 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.30.4.23 -r1.30.4.24 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.283.2.9 -r1.283.2.10 src/sys/dev/ic/wdc.c
cvs rdiff -u -r1.123.4.8 -r1.123.4.9 src/sys/dev/scsipi/atapi_wdc.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/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.132.8.17 src/sys/dev/ata/ata.c:1.132.8.18
--- src/sys/dev/ata/ata.c:1.132.8.17	Sat Jun 24 14:57:17 2017
+++ src/sys/dev/ata/ata.c	Tue Jun 27 18:36:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.132.8.17 2017/06/24 14:57:17 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.132.8.18 2017/06/27 18:36:03 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.17 2017/06/24 14:57:17 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.18 2017/06/27 18:36:03 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -275,6 +275,7 @@ ata_queue_alloc(uint8_t openings)
 	ata_queue_reset(chq);
 
 	cv_init(&chq->queue_busy, "ataqbusy");
+	cv_init(&chq->queue_drain, "atdrn");
 
 	for (uint8_t i = 0; i < openings; i++)
 		ata_xfer_init(&chq->queue_xfers[i], false);
@@ -288,6 +289,9 @@ ata_queue_free(struct ata_queue *chq)
 	for (uint8_t i = 0; i < chq->queue_openings; i++)
 		ata_xfer_destroy(&chq->queue_xfers[i]);
 
+	cv_destroy(&chq->queue_busy);
+	cv_destroy(&chq->queue_drain);
+
 	free(chq, M_DEVBUF);
 }
 
@@ -1140,6 +1144,9 @@ atastart(struct ata_channel *chp)
 	if ((xfer = TAILQ_FIRST(&chp->ch_queue->queue_xfer)) == NULL)
 		goto out;
 
+	/* all xfers on same queue must belong to the same channel */
+	KASSERT(xfer->c_chp == chp);
+
 	/*
 	 * Can only take NCQ command if there are no current active
 	 * commands, or if the active commands are NCQ. Need only check
@@ -1149,10 +1156,6 @@ atastart(struct ata_channel *chp)
 	if (axfer && (axfer->c_flags & C_NCQ) == 0)
 		goto out;
 
-	/* adjust chp, in case we have a shared queue */
-	chp = xfer->c_chp;
-	KASSERT(chp->ch_queue == chq);
-
 	struct ata_drive_datas * const drvp = &chp->ch_drive[xfer->c_drive];
 
 	/*
@@ -1322,29 +1325,37 @@ ata_deactivate_xfer(struct ata_channel *
 	mutex_exit(&chp->ch_lock);
 }
 
-
-bool
-ata_waitdrain_check(struct ata_channel *chp, int drive)
-{
-	if (chp->ch_drive[drive].drive_flags & ATA_DRIVE_WAITDRAIN) {
-		chp->ch_drive[drive].drive_flags &= ~ATA_DRIVE_WAITDRAIN;
-		wakeup(&chp->ch_queue->active_xfers);
-		return true;
-	}
-	return false;
-}
-
+/*
+ * Called in c_intr hook. Must be called before before any deactivations
+ * are done - if there is drain pending, it calls c_kill_xfer hook which
+ * deactivates the xfer.
+ * Calls c_kill_xfer with channel lock free.
+ * Returns true if caller should just exit without further processing.
+ * Caller must not further access any part of xfer or any related controller
+ * structures in that case, it should just return.
+ */
 bool
 ata_waitdrain_xfer_check(struct ata_channel *chp, struct ata_xfer *xfer)
 {
 	int drive = xfer->c_drive;
+	bool draining = false;
+
+	mutex_enter(&chp->ch_lock);
+
 	if (chp->ch_drive[drive].drive_flags & ATA_DRIVE_WAITDRAIN) {
+		mutex_exit(&chp->ch_lock);
+
 		(*xfer->c_kill_xfer)(chp, xfer, KILL_GONE);
+
+		mutex_enter(&chp->ch_lock);
 		chp->ch_drive[drive].drive_flags &= ~ATA_DRIVE_WAITDRAIN;
-		wakeup(&chp->ch_queue->active_xfers);
-		return true;
+		cv_signal(&chp->ch_queue->queue_drain);
+		draining = true;
 	}
-	return false;
+
+	mutex_exit(&chp->ch_lock);
+
+	return draining;
 }
 
 /*
@@ -1367,38 +1378,58 @@ ata_kill_active(struct ata_channel *ch

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

2017-06-27 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Jun 27 18:16:50 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: TODO.ncq

Log Message:
note ATAPI on siisata, ahcisata needs to be tested


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.26 -r1.1.2.27 src/sys/dev/ata/TODO.ncq

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/ata/TODO.ncq
diff -u src/sys/dev/ata/TODO.ncq:1.1.2.26 src/sys/dev/ata/TODO.ncq:1.1.2.27
--- src/sys/dev/ata/TODO.ncq:1.1.2.26	Sat Jun 24 14:33:06 2017
+++ src/sys/dev/ata/TODO.ncq	Tue Jun 27 18:16:50 2017
@@ -3,6 +3,8 @@ Bugs
 
 siisata - fix all new XXX and unmergable bits
 
+test ATAPI on siisata, ahcisata
+
 test wd* at umass?, confirm the ata_channel kludge works
 
 test device error handling (currently appears to not work well, at least in NCQ case)



CVS commit: src/sys/netinet

2017-06-27 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Tue Jun 27 13:54:56 UTC 2017

Modified Files:
src/sys/netinet: sctp_output.c

Log Message:
Use host byte order for a debug message.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/netinet/sctp_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/netinet/sctp_output.c
diff -u src/sys/netinet/sctp_output.c:1.10 src/sys/netinet/sctp_output.c:1.11
--- src/sys/netinet/sctp_output.c:1.10	Fri Mar  3 07:13:06 2017
+++ src/sys/netinet/sctp_output.c	Tue Jun 27 13:54:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sctp_output.c,v 1.10 2017/03/03 07:13:06 ozaki-r Exp $ */
+/*	$NetBSD: sctp_output.c,v 1.11 2017/06/27 13:54:56 rjs Exp $ */
 /*	$KAME: sctp_output.c,v 1.48 2005/06/16 18:29:24 jinmei Exp $	*/
 
 /*
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.10 2017/03/03 07:13:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.11 2017/06/27 13:54:56 rjs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -2243,7 +2243,7 @@ sctp_lowlevel_chunk_output(struct sctp_i
 			   (u_int)(ntohl(ip->ip_src.s_addr)));
 			printf("Destination is %x\n", (u_int)(ntohl(ip->ip_dst.s_addr)));
 			printf("RTP route is %p through\n", rt);
-			printf("length %d\n", ip->ip_len);
+			printf("length %d\n", ntohs(ip->ip_len));
 		}
 #endif
 		if ((have_mtu) && (net) && (have_mtu > net->mtu)) {



CVS commit: src/sys/netinet

2017-06-27 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Tue Jun 27 13:27:54 UTC 2017

Modified Files:
src/sys/netinet: sctp_input.c

Log Message:
Check outgoing cookie size before accessing any contents.

Spotted in FreeBSD by maya.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/netinet/sctp_input.c

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

Modified files:

Index: src/sys/netinet/sctp_input.c
diff -u src/sys/netinet/sctp_input.c:1.6 src/sys/netinet/sctp_input.c:1.7
--- src/sys/netinet/sctp_input.c:1.6	Fri Jun 23 15:13:21 2017
+++ src/sys/netinet/sctp_input.c	Tue Jun 27 13:27:54 2017
@@ -1,5 +1,5 @@
 /*	$KAME: sctp_input.c,v 1.28 2005/04/21 18:36:21 nishida Exp $	*/
-/*	$NetBSD: sctp_input.c,v 1.6 2017/06/23 15:13:21 rjs Exp $	*/
+/*	$NetBSD: sctp_input.c,v 1.7 2017/06/27 13:27:54 rjs Exp $	*/
 
 /*
  * Copyright (C) 2002, 2003, 2004 Cisco Systems Inc,
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sctp_input.c,v 1.6 2017/06/23 15:13:21 rjs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_input.c,v 1.7 2017/06/27 13:27:54 rjs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -1729,19 +1729,6 @@ sctp_handle_cookie_echo(struct mbuf *m, 
 	cookie_offset = offset + sizeof(struct sctp_chunkhdr);
 	cookie_len = ntohs(cp->ch.chunk_length);
 
-	if ((cookie->peerport != sh->src_port) &&
-	(cookie->myport != sh->dest_port) &&
-	(cookie->my_vtag != sh->v_tag)) {
-		/*
-		 * invalid ports or bad tag.  Note that we always leave
-		 * the v_tag in the header in network order and when we
-		 * stored it in the my_vtag slot we also left it in network
-		 * order. This maintians the match even though it may be in
-		 * the opposite byte order of the machine :->
-		 */
-		return (NULL);
-	}
-
 	/* compute size of packet */
 	if (m->m_flags & M_PKTHDR) {
 		size_of_pkt = m->m_pkthdr.len;
@@ -1767,6 +1754,20 @@ sctp_handle_cookie_echo(struct mbuf *m, 
 #endif /* SCTP_DEBUG */
 		return (NULL);
 	}
+
+	if ((cookie->peerport != sh->src_port) &&
+	(cookie->myport != sh->dest_port) &&
+	(cookie->my_vtag != sh->v_tag)) {
+		/*
+		 * invalid ports or bad tag.  Note that we always leave
+		 * the v_tag in the header in network order and when we
+		 * stored it in the my_vtag slot we also left it in network
+		 * order. This maintians the match even though it may be in
+		 * the opposite byte order of the machine :->
+		 */
+		return (NULL);
+	}
+
 	/*
 	 * split off the signature into its own mbuf (since it
 	 * should not be calculated in the sctp_hash_digest_m() call).



CVS commit: src/bin/sh

2017-06-27 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 27 12:43:44 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Make one example more like a real world possibility (it still isn't, but
is closer) - though the actual content is irrelevant to the point being made.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/bin/sh/sh.1

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/sh.1
diff -u src/bin/sh/sh.1:1.154 src/bin/sh/sh.1:1.155
--- src/bin/sh/sh.1:1.154	Tue Jun 27 08:30:40 2017
+++ src/bin/sh/sh.1	Tue Jun 27 12:43:44 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.154 2017/06/27 08:30:40 wiz Exp $
+.\"	$NetBSD: sh.1,v 1.155 2017/06/27 12:43:44 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -1022,7 +1022,7 @@ and allows for commands which do affect 
 Grouping commands together this way allows you to redirect
 their output as though they were one program:
 .Bd -literal -offset indent
-{ echo -n \*q hello \*q ; echo \*q world" ; } > greeting
+{ echo -n \*qhello \*q ; echo \*qworld\*q ; } > greeting
 .Ed
 .Pp
 Note that



CVS commit: src/sys/netinet

2017-06-27 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Jun 27 12:21:54 UTC 2017

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Use if_get_bylla() instead of just looking at the lla of the interface
the address belongs to.
This allows any ARP message we receieved from another interface to
be correctly dropped.

While here, move the protocol length check higher up the food chain.


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.252 src/sys/netinet/if_arp.c:1.253
--- src/sys/netinet/if_arp.c:1.252	Wed Jun 21 09:05:31 2017
+++ src/sys/netinet/if_arp.c	Tue Jun 27 12:21:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.252 2017/06/21 09:05:31 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.253 2017/06/27 12:21:54 roy Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.252 2017/06/21 09:05:31 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.253 2017/06/27 12:21:54 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1025,6 +1025,16 @@ in_arpinput(struct mbuf *m)
 	ah = mtod(m, struct arphdr *);
 	op = ntohs(ah->ar_op);
 
+	if (ah->ar_pln != sizeof(struct in_addr))
+		goto out;
+
+	ifp = if_get_bylla(ar_sha(ah), ah->ar_hln, &psref);
+	if (ifp) {
+		if_put(ifp, &psref);
+		ARP_STATINC(ARP_STAT_RCVLOCALSHA);
+		goto out;	/* it's from me, ignore it. */
+	}
+
 	rcvif = ifp = m_get_rcvif_psref(m, &psref);
 	if (__predict_false(rcvif == NULL))
 		goto drop;
@@ -1046,9 +1056,6 @@ in_arpinput(struct mbuf *m)
 		break;
 	}
 
-	if (ah->ar_pln != sizeof(struct in_addr))
-		goto drop;
-
 	memcpy(&isaddr, ar_spa(ah), sizeof(isaddr));
 	memcpy(&itaddr, ar_tpa(ah), sizeof(itaddr));
 
@@ -1135,12 +1142,6 @@ in_arpinput(struct mbuf *m)
 	myaddr = ia->ia_addr.sin_addr;
 
 	/* XXX checks for bridge case? */
-	if (!memcmp(ar_sha(ah), CLLADDR(ifp->if_sadl), ifp->if_addrlen)) {
-		ARP_STATINC(ARP_STAT_RCVLOCALSHA);
-		goto out;	/* it's from me, ignore it. */
-	}
-
-	/* XXX checks for bridge case? */
 	if (!memcmp(ar_sha(ah), ifp->if_broadcastaddr, ifp->if_addrlen)) {
 		ARP_STATINC(ARP_STAT_RCVBCASTSHA);
 		log(LOG_ERR,



CVS commit: src/sys/net

2017-06-27 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Jun 27 12:17:27 UTC 2017

Modified Files:
src/sys/net: if.c if.h

Log Message:
Introduce if_get_bylla to find an interface with the active
local link address.


To generate a diff of this commit:
cvs rdiff -u -r1.394 -r1.395 src/sys/net/if.c
cvs rdiff -u -r1.239 -r1.240 src/sys/net/if.h

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.394 src/sys/net/if.c:1.395
--- src/sys/net/if.c:1.394	Thu Jun  1 02:45:14 2017
+++ src/sys/net/if.c	Tue Jun 27 12:17:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.394 2017/06/01 02:45:14 chs Exp $	*/
+/*	$NetBSD: if.c,v 1.395 2017/06/27 12:17:27 roy Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394 2017/06/01 02:45:14 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.395 2017/06/27 12:17:27 roy Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -2599,8 +2599,8 @@ out:
 }
 
 /*
- * Release a reference of an ifnet object given by if_get or
- * if_get_byindex.
+ * Release a reference of an ifnet object given by if_get, if_get_byindex
+ * or if_get_bylla.
  */
 void
 if_put(const struct ifnet *ifp, struct psref *psref)
@@ -2643,6 +2643,29 @@ if_get_byindex(u_int idx, struct psref *
 	return ifp;
 }
 
+ifnet_t *
+if_get_bylla(const void *lla, unsigned char lla_len, struct psref *psref)
+{
+	ifnet_t *ifp;
+	int s;
+
+	s = pserialize_read_enter();
+	IFNET_READER_FOREACH(ifp) {
+		if (if_is_deactivated(ifp))
+			continue;
+		if (ifp->if_addrlen != lla_len)
+			continue;
+		if (memcmp(lla, CLLADDR(ifp->if_sadl), lla_len) == 0) {
+			psref_acquire(psref, &ifp->if_psref,
+			ifnet_psref_class);
+			break;
+		}
+	}
+	pserialize_read_exit(s);
+
+	return ifp;
+}
+
 /*
  * Note that it's safe only if the passed ifp is guaranteed to not be freed,
  * for example using pserialize or the ifp is already held or some other

Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.239 src/sys/net/if.h:1.240
--- src/sys/net/if.h:1.239	Fri May 19 08:53:51 2017
+++ src/sys/net/if.h	Tue Jun 27 12:17:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.239 2017/05/19 08:53:51 ozaki-r Exp $	*/
+/*	$NetBSD: if.h,v 1.240 2017/06/27 12:17:27 roy Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -974,6 +974,7 @@ struct	ifnet *ifunit(const char *);
 struct	ifnet *if_get(const char *, struct psref *);
 ifnet_t *if_byindex(u_int);
 ifnet_t *if_get_byindex(u_int, struct psref *);
+ifnet_t *if_get_bylla(const void *, unsigned char, struct psref *);
 void	if_put(const struct ifnet *, struct psref *);
 void	if_acquire(struct ifnet *, struct psref *);
 #define	if_release	if_put



CVS commit: src/sys/netinet

2017-06-27 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Tue Jun 27 11:55:07 UTC 2017

Modified Files:
src/sys/netinet: sctp.h sctp_header.h

Log Message:
Pack structs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/sctp.h src/sys/netinet/sctp_header.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/netinet/sctp.h
diff -u src/sys/netinet/sctp.h:1.1 src/sys/netinet/sctp.h:1.2
--- src/sys/netinet/sctp.h:1.1	Tue Oct 13 21:28:35 2015
+++ src/sys/netinet/sctp.h	Tue Jun 27 11:55:07 2017
@@ -1,5 +1,5 @@
 /*	$KAME: sctp.h,v 1.18 2005/03/06 16:04:16 itojun Exp $	*/
-/*	$NetBSD: sctp.h,v 1.1 2015/10/13 21:28:35 rjs Exp $ */
+/*	$NetBSD: sctp.h,v 1.2 2017/06/27 11:55:07 rjs Exp $ */
 
 #ifndef _NETINET_SCTP_H_
 #define _NETINET_SCTP_H_
@@ -47,7 +47,7 @@ struct sctphdr {
 	u_int32_t v_tag;		/* verification tag of packet */
 	u_int32_t checksum;		/* Adler32 C-Sum */
 	/* chunks follow... */
-};
+} __packed;
 
 /*
  * SCTP Chunks
@@ -57,7 +57,7 @@ struct sctp_chunkhdr {
 	u_int8_t  chunk_flags;		/* chunk flags */
 	u_int16_t chunk_length;		/* chunk length */
 	/* optional params follow */
-};
+} __packed;
 
 /*
  * SCTP chunk parameters
@@ -65,7 +65,7 @@ struct sctp_chunkhdr {
 struct sctp_paramhdr {
 	u_int16_t param_type;		/* parameter type */
 	u_int16_t param_length;		/* parameter length */
-};
+} __packed;
 
 /*
  * user socket options
@@ -199,38 +199,38 @@ struct sctp_error_cause {
 	u_int16_t code;
 	u_int16_t length;
 	/* optional cause-specific info may follow */
-};
+} __packed;
 
 struct sctp_error_invalid_stream {
 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_INVALID_STREAM */
 	u_int16_t stream_id;		/* stream id of the DATA in error */
 	u_int16_t reserved;
-};
+} __packed;
 
 struct sctp_error_missing_param {
 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_MISSING_PARAM */
 	u_int32_t num_missing_params;	/* number of missing parameters */
 	/* u_int16_t param_type's follow */
-};
+} __packed;
 
 struct sctp_error_stale_cookie {
 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_STALE_COOKIE */
 	u_int32_t stale_time;		/* time in usec of staleness */
-};
+} __packed;
 
 struct sctp_error_out_of_resource {
 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_OUT_OF_RESOURCES */
-};
+} __packed;
 
 struct sctp_error_unresolv_addr {
 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_UNRESOLVABLE_ADDR */
 
-};
+} __packed;
 
 struct sctp_error_unrecognized_chunk {
 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_UNRECOG_CHUNK */
 	struct sctp_chunkhdr ch;	/* header from chunk in error */
-};
+} __packed;
 
 #define HAVE_SCTP			1
 #define HAVE_KERNEL_SCTP		1
Index: src/sys/netinet/sctp_header.h
diff -u src/sys/netinet/sctp_header.h:1.1 src/sys/netinet/sctp_header.h:1.2
--- src/sys/netinet/sctp_header.h:1.1	Tue Oct 13 21:28:35 2015
+++ src/sys/netinet/sctp_header.h	Tue Jun 27 11:55:07 2017
@@ -1,5 +1,5 @@
 /*	$KAME: sctp_header.h,v 1.14 2005/03/06 16:04:17 itojun Exp $	*/
-/*	$NetBSD: sctp_header.h,v 1.1 2015/10/13 21:28:35 rjs Exp $ */
+/*	$NetBSD: sctp_header.h,v 1.2 2017/06/27 11:55:07 rjs Exp $ */
 
 #ifndef __SCTP_HEADER_H__
 #define __SCTP_HEADER_H__
@@ -46,35 +46,35 @@
 struct sctp_ipv4addr_param {
 	struct sctp_paramhdr ph;	/* type=SCTP_IPV4_PARAM_TYPE, len=8 */
 	u_int32_t addr;			/* IPV4 address */
-};
+} __packed;
 
 struct sctp_ipv6addr_param {
 	struct sctp_paramhdr ph;	/* type=SCTP_IPV6_PARAM_TYPE, len=20 */
 	u_int8_t  addr[16];		/* IPV6 address */
-};
+} __packed;
 
 /* Cookie Preservative */
 struct sctp_cookie_perserve_param {
 	struct sctp_paramhdr ph;	/* type=SCTP_COOKIE_PRESERVE, len=8 */
 	u_int32_t time;			/* time in ms to extend cookie */
-};
+} __packed;
 
 /* Host Name Address */
 struct sctp_host_name_param {
 	struct sctp_paramhdr ph;	/* type=SCTP_HOSTNAME_ADDRESS */
 	char name[1];			/* host name */
-};
+} __packed;
 
 /* supported address type */
 struct sctp_supported_addr_param {
 	struct sctp_paramhdr ph;	/* type=SCTP_SUPPORTED_ADDRTYPE */
 	u_int16_t addr_type[1];		/* array of supported address types */
-};
+} __packed;
 
 /* ECN parameter */
 struct sctp_ecn_supported_param {
 	struct sctp_paramhdr ph;	/* type=SCTP_ECN_CAPABLE */
-};
+} __packed;
 
 
 /* heartbeat info parameter */
@@ -88,42 +88,42 @@ struct sctp_heartbeat_info_param {
 	u_int8_t addr_family;
 	u_int8_t addr_len;
 	char address[SCTP_ADDRMAX];
-};
+} __packed;
 
 
 /* draft-ietf-tsvwg-prsctp */
 /* PR-SCTP supported parameter */
 struct sctp_prsctp_supported_param {
 	struct sctp_paramhdr ph;
-};
+} __packed;
 
 
 /* draft-ietf-tsvwg-addip-sctp */
 struct sctp_asconf_paramhdr {		/* an ASCONF "parameter" */
 	struct sctp_paramhdr ph;	/* a SCTP parameter header */
 	u_int32_t correlation_id;	/* correlation id for this param */
-};
+} __packed;
 
 struct sctp_asconf_addr_param {		/* an ASCONF address parameter */
 	struct sctp_asconf_paramhdr aph;	/* asconf "parameter" 

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

2017-06-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun 27 10:33:09 UTC 2017

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

Log Message:
 Fix a bug of ixg(4)'s media setting.

Before:
 ifconfig ixg0 media 100baseTX  -> advertise 100Mbps only
 ifconfig ixg0 media 1000baseT  -> advertise 1Gbps and 1000Mbps (NG)
 ifconfig ixg0 media 10Gbase-T  -> advertise all (NG)
 ifconfig ixg0 media auto   -> advertise all

After:
 ifconfig ixg0 media 100baseTX  -> advertise 100Mbps only
 ifconfig ixg0 media 1000baseT  -> advertise 1Gbps only
 ifconfig ixg0 media 10Gbase-T  -> advertise 10Gbps only
 ifconfig ixg0 media auto   -> advertise all


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 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.93 src/sys/dev/pci/ixgbe/ixgbe.c:1.94
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.93	Tue Jun 27 05:17:54 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Jun 27 10:33:09 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.93 2017/06/27 05:17:54 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.94 2017/06/27 10:33:09 msaitoh Exp $*/
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2131,6 +2131,9 @@ ixgbe_media_change(struct ifnet * ifp)
 	struct ifmedia *ifm = &adapter->media;
 	struct ixgbe_hw *hw = &adapter->hw;
 	ixgbe_link_speed speed = 0;
+	ixgbe_link_speed link_caps = 0;
+	bool negotiate = false;
+	s32 err = IXGBE_NOT_IMPLEMENTED;
 
 	INIT_DEBUGOUT("ixgbe_media_change: begin");
 
@@ -2147,10 +2150,19 @@ ixgbe_media_change(struct ifnet * ifp)
 	*/
 	switch (IFM_SUBTYPE(ifm->ifm_media)) {
 		case IFM_AUTO:
+			err = hw->mac.ops.get_link_capabilities(hw, &link_caps,
+			&negotiate);
+			if (err != IXGBE_SUCCESS) {
+device_printf(adapter->dev, "Unable to determine "
+"supported advertise speeds\n");
+return (ENODEV);
+			}
+			speed |= link_caps;
+			break;
 		case IFM_10G_T:
-			speed |= IXGBE_LINK_SPEED_100_FULL;
 		case IFM_10G_LRM:
 		case IFM_10G_LR:
+		case IFM_10G_TWINAX:
 #ifndef IFM_ETH_XTYPE
 		case IFM_10G_SR: /* KR, too */
 		case IFM_10G_CX4: /* KX4 */
@@ -2158,12 +2170,9 @@ ixgbe_media_change(struct ifnet * ifp)
 		case IFM_10G_KR:
 		case IFM_10G_KX4:
 #endif
-			speed |= IXGBE_LINK_SPEED_1GB_FULL;
-		case IFM_10G_TWINAX:
 			speed |= IXGBE_LINK_SPEED_10GB_FULL;
 			break;
 		case IFM_1000_T:
-			speed |= IXGBE_LINK_SPEED_100_FULL;
 		case IFM_1000_LX:
 		case IFM_1000_SX:
 		case IFM_1000_KX:



CVS commit: src/sys/dev

2017-06-27 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun 27 09:44:13 UTC 2017

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

Log Message:
Ensure to close open file descriptors.

Patch by pgoyette@.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/audiobell.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/audiobell.c
diff -u src/sys/dev/audiobell.c:1.23 src/sys/dev/audiobell.c:1.24
--- src/sys/dev/audiobell.c:1.23	Tue Jun 27 09:35:05 2017
+++ src/sys/dev/audiobell.c	Tue Jun 27 09:44:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiobell.c,v 1.23 2017/06/27 09:35:05 nat Exp $	*/
+/*	$NetBSD: audiobell.c,v 1.24 2017/06/27 09:44:13 nat Exp $	*/
 
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.23 2017/06/27 09:35:05 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.24 2017/06/27 09:44:13 nat Exp $");
 
 #include 
 #include 
@@ -106,10 +106,11 @@ audiobell(void *v, u_int pitch, u_int pe
 	struct uio auio;
 	struct iovec aiov;
 	struct file *fp;
-	int size, len;
+	int size, len, fd;
 
 	KASSERT(volume <= 100);
 
+	fd = -1;
 	fp = NULL;
 	buf = NULL;
 	audio = AUDIO_DEVICE | device_unit((device_t)v);
@@ -121,6 +122,7 @@ audiobell(void *v, u_int pitch, u_int pe
 	/* If not configured, we can't beep. */
 	if (audiobellopen(audio, FWRITE, 0, NULL, &fp) != EMOVEFD || fp == NULL)
 		return;
+	fd = curlwp->l_dupfd;	/* save the fd for closing when done */
 
 	if (audiobellioctl(fp, AUDIO_GETINFO, &ai) != 0)
 		goto out;
@@ -174,5 +176,9 @@ audiobell(void *v, u_int pitch, u_int pe
 out:
 	if (buf != NULL)
 		free(buf, M_TEMP);
+	if (fd >= 0) {
+		fd_getfile(fd);
+		fd_close(fd);
+	}
 	audiobellclose(fp);
 }



CVS commit: src/sys/dev

2017-06-27 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Jun 27 09:35:05 UTC 2017

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

Log Message:
KNF.  NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/audiobell.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/audiobell.c
diff -u src/sys/dev/audiobell.c:1.22 src/sys/dev/audiobell.c:1.23
--- src/sys/dev/audiobell.c:1.22	Sun Jun 11 13:05:43 2017
+++ src/sys/dev/audiobell.c	Tue Jun 27 09:35:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiobell.c,v 1.22 2017/06/11 13:05:43 nat Exp $	*/
+/*	$NetBSD: audiobell.c,v 1.23 2017/06/27 09:35:05 nat Exp $	*/
 
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.22 2017/06/11 13:05:43 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.23 2017/06/27 09:35:05 nat Exp $");
 
 #include 
 #include 
@@ -80,7 +80,8 @@ audiobell_synthesize(int16_t *buf, u_int
 	int16_t *wave;
 
 	wave = malloc(sizeof(sinewave) * 4, M_TEMP, M_WAITOK);
-	if (wave == NULL) return -1;
+	if (wave == NULL)
+		return -1;
 	audiobell_expandwave(wave);
 	pitch = pitch * ((sizeof(sinewave) * 4) << BELL_SHIFT) /
 	BELL_SAMPLE_RATE / 2;
@@ -98,6 +99,7 @@ audiobell_synthesize(int16_t *buf, u_int
 void
 audiobell(void *v, u_int pitch, u_int period, u_int volume, int poll)
 {
+	dev_t audio;
 	int16_t *buf;
 	uint16_t phase;
 	struct audio_info ai;
@@ -109,19 +111,19 @@ audiobell(void *v, u_int pitch, u_int pe
 	KASSERT(volume <= 100);
 
 	fp = NULL;
-	dev_t audio = AUDIO_DEVICE | device_unit((device_t)v);
+	buf = NULL;
+	audio = AUDIO_DEVICE | device_unit((device_t)v);
 
 	/* The audio system isn't built for polling. */
-	if (poll) return;
+	if (poll)
+		return;
 
 	/* If not configured, we can't beep. */
 	if (audiobellopen(audio, FWRITE, 0, NULL, &fp) != EMOVEFD || fp == NULL)
 		return;
 
-	if (audiobellioctl(fp, AUDIO_GETINFO, &ai) != 0) {
-		audiobellclose(fp);
-		return;
-	}
+	if (audiobellioctl(fp, AUDIO_GETINFO, &ai) != 0)
+		goto out;
 
 	AUDIO_INITINFO(&ai);
 	ai.mode = AUMODE_PLAY;
@@ -136,21 +138,20 @@ audiobell(void *v, u_int pitch, u_int pe
 	ai.play.encoding = AUDIO_ENCODING_SLINEAR_BE;
 #endif
 
-	if (audiobellioctl(fp, AUDIO_SETINFO, &ai) != 0) {
-		audiobellclose(fp);
-		return;
-	}
-	buf = NULL;
+	if (audiobellioctl(fp, AUDIO_SETINFO, &ai) != 0)
+		goto out;
 
 	if (ai.blocksize < BELL_SAMPLE_RATE)
 		ai.blocksize = BELL_SAMPLE_RATE;
 
 	len = period * BELL_SAMPLE_RATE / 1000 * 2;
 	size = min(len, ai.blocksize);
-	if (size == 0) goto out;
+	if (size == 0)
+		goto out;
 
 	buf = malloc(size, M_TEMP, M_WAITOK);
-	if (buf == NULL) goto out;
+	if (buf == NULL)
+		goto out;
  
 	phase = 0;
 	while (len > 0) {
@@ -171,6 +172,7 @@ audiobell(void *v, u_int pitch, u_int pe
 		len -= size;
 	}
 out:
-	if (buf != NULL) free(buf, M_TEMP);
+	if (buf != NULL)
+		free(buf, M_TEMP);
 	audiobellclose(fp);
 }



CVS commit: src/sys/miscfs/genfs

2017-06-27 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Jun 27 08:40:53 UTC 2017

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
Add missing check for dead or dying vnode to the entry of genfs_getpages().


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.69 src/sys/miscfs/genfs/genfs_io.c:1.70
--- src/sys/miscfs/genfs/genfs_io.c:1.69	Sun Jun  4 08:05:42 2017
+++ src/sys/miscfs/genfs/genfs_io.c	Tue Jun 27 08:40:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.69 2017/06/04 08:05:42 hannken Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.70 2017/06/27 08:40:53 hannken Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.69 2017/06/04 08:05:42 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.70 2017/06/27 08:40:53 hannken Exp $");
 
 #include 
 #include 
@@ -139,6 +139,13 @@ genfs_getpages(void *v)
 	KASSERT(vp->v_type == VREG || vp->v_type == VDIR ||
 	vp->v_type == VLNK || vp->v_type == VBLK);
 
+	error = vdead_check(vp, VDEAD_NOWAIT);
+	if (error) {
+		if ((flags & PGO_LOCKED) == 0)
+			mutex_exit(uobj->vmobjlock);
+		return error;
+	}
+
 startover:
 	error = 0;
 	const voff_t origvsize = vp->v_size;



CVS commit: src/bin/sh

2017-06-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jun 27 08:30:40 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Get rid of workarounds for ancient groff html backend.
Simplify macro usage.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/bin/sh/sh.1

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/sh.1
diff -u src/bin/sh/sh.1:1.153 src/bin/sh/sh.1:1.154
--- src/bin/sh/sh.1:1.153	Tue Jun 27 02:22:08 2017
+++ src/bin/sh/sh.1	Tue Jun 27 08:30:40 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.153 2017/06/27 02:22:08 kre Exp $
+.\"	$NetBSD: sh.1,v 1.154 2017/06/27 08:30:40 wiz Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -245,7 +245,7 @@ and there is no form using
 .Dq \&+ .
 .It Fl C Em noclobber
 Don't overwrite existing files with
-.Dq \*[Gt] .
+.Dq > .
 .It Fl e Em errexit
 If not interactive, exit immediately if any untested command fails.
 The exit status of a command is considered to be
@@ -256,7 +256,7 @@ explicitly tested if the command is used
 or
 .Ic until ,
 or if the command is the left hand operand of an
-.Dq \*[Am]\*[Am]
+.Dq &&
 or
 .Dq ||
 operator,
@@ -432,9 +432,9 @@ operators (their meaning is discussed la
 The following is a list of operators:
 .Bl -ohang -offset indent
 .It "Control operators:"
-.Dl \*[Am]  \*[Am]\*[Am]  \&(  \&)  \&;  ;; ;\*[Am] | || \*[Lt]newline\*[Gt]
+.Dl &  &&  \&(  \&)  \&;  ;; ;& | || 
 .It "Redirection operators:"
-.Dl \*[Lt]  \*[Gt]  \*[Gt]|  \*[Lt]\*[Lt]  \*[Gt]\*[Gt]  \*[Lt]\*[Am]  \*[Gt]\*[Am]  \*[Lt]\*[Lt]-  \*[Lt]\*[Gt]
+.Dl <  >  >|  <<  >>  <&  >&  <<-  <>
 .El
 .Ss Quoting
 Quoting is used to remove the special meaning of certain characters or
@@ -462,7 +462,7 @@ and backslash
 .Pq \e .
 The backslash inside double quotes is historically weird, and serves to
 quote only the following characters (and these not in all contexts):
-.Dl $  `  \*q  \e  \*[Lt]newline\*[Gt] ,
+.Dl $  `  \*q  \e   ,
 where a backslash newline is a line continuation as above.
 Otherwise it remains literal.
 .Ss Reserved Words
@@ -562,39 +562,39 @@ If present it must occur immediately bef
 operator, with no intervening white space, and becomes a
 part of that operator.
 .Bl -tag -width aaabsfiles -offset indent
-.It Oo Ar n Oc Ns \*[Gt] Ar file
+.It Oo Ar n Oc Ns > Ar file
 Redirect standard output (or n) to
 .Ar file .
-.It Oo Ar n Oc Ns \*[Gt]| file
+.It Oo Ar n Oc Ns >| file
 The same, but override the
 .Fl C
 option.
-.It Oo Ar n Oc Ns \*[Gt]\*[Gt] Ar file
+.It Oo Ar n Oc Ns >> Ar file
 Append standard output (or n) to
 .Ar file .
-.It Oo Ar n Oc Ns \*[Lt] Ar file
+.It Oo Ar n Oc Ns < Ar file
 Redirect standard input (or
 .Ar n )
 from
 .Ar file .
-.It Oo Ar n1 Oc Ns \*[Lt]\*[Am] Ns Ar n2
+.It Oo Ar n1 Oc Ns <& Ns Ar n2
 Duplicate standard input (or
 .Ar n1 )
 from file descriptor
 .Ar n2 .
 .Ar n2
 is expanded if not a digit string, the result must be a number.
-.It Oo Ar n Oc Ns \*[Lt]\*[Am]-
+.It Oo Ar n Oc Ns <&-
 Close standard input (or
 .Ar n ) .
-.It Oo Ar n1 Oc Ns \*[Gt]\*[Am] Ns Ar n2
+.It Oo Ar n1 Oc Ns >& Ns Ar n2
 Duplicate standard output (or
 .Ar n1 )
 to
 .Ar n2 .
-.It Oo Ar n Oc Ns \*[Gt]\*[Am]-
+.It Oo Ar n Oc Ns >&-
 Close standard output (or n).
-.It Oo Ar n Oc Ns \*[Lt]\*[Gt] Ar file
+.It Oo Ar n Oc Ns <> Ar file
 Open
 .Ar file
 for reading and writing on standard input (or
@@ -605,7 +605,7 @@ The following redirection is often calle
 .Dq here-document .
 .Bl -item -offset indent
 .It
-.Li [n]\*[Lt]\*[Lt] delimiter
+.Li [n]<< delimiter
 .Dl here-doc-text ...
 .Li delimiter
 .El
@@ -636,9 +636,9 @@ expansion as described in the
 .Sx Word Expansions
 section below.
 If the operator is
-.Dq \*[Lt]\*[Lt]\(mi
+.Dq <<\(mi
 instead of
-.Dq \*[Lt]\*[Lt] ,
+.Dq << ,
 then leading tabs in all lines in the here-doc-text, including before the
 end delimiter, are stripped.
 If the delimiter is not quoted, lines in here-doc-text that end with
@@ -793,7 +793,7 @@ Because pipeline assignment of standard 
 takes place before redirection, it can be modified by redirection.
 For example:
 .Pp
-.Dl $ command1 2\*[Gt]\*[Am]1 | command2
+.Dl $ command1 2>&1 | command2
 .Pp
 sends both the standard output and standard error of command1
 to the standard input of command2.
@@ -801,7 +801,7 @@ to the standard input of command2.
 A ; or
 .Aq newline
 terminator causes the preceding AND-OR-list (described
-next) to be executed sequentially; a \*[Am] causes asynchronous execution of
+next) to be executed sequentially; a & causes asynchronous execution of
 the preceding AND-OR-list.
 The exit status of an asynchronous AND-OR-list is zero.
 The actual status of the commands,
@@ -814,14 +814,14 @@ Note that unlike some other shells, each
 child of the invoking shell (unless it is a shell built-in, in which case
 it executes in the current shell -- but any effect it has on the

CVS commit: src/sys/dev/usb

2017-06-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jun 27 08:09:50 UTC 2017

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen (comment change only)


To generate a diff of this commit:
cvs rdiff -u -r1.729 -r1.730 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.730 -r1.731 src/sys/dev/usb/usbdevs_data.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/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.729 src/sys/dev/usb/usbdevs.h:1.730
--- src/sys/dev/usb/usbdevs.h:1.729	Tue Jun 27 05:31:40 2017
+++ src/sys/dev/usb/usbdevs.h	Tue Jun 27 08:09:50 2017
@@ -1,7 +1,7 @@
-/*	$NetBSD: usbdevs.h,v 1.729 2017/06/27 05:31:40 kre Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.730 2017/06/27 08:09:50 wiz Exp $	*/
 
 /*
- * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
+ * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
  *	NetBSD: usbdevs,v 1.737 2017/06/26 20:28:42 is Exp

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.730 src/sys/dev/usb/usbdevs_data.h:1.731
--- src/sys/dev/usb/usbdevs_data.h:1.730	Tue Jun 27 05:31:40 2017
+++ src/sys/dev/usb/usbdevs_data.h	Tue Jun 27 08:09:50 2017
@@ -1,7 +1,7 @@
-/*	$NetBSD: usbdevs_data.h,v 1.730 2017/06/27 05:31:40 kre Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.731 2017/06/27 08:09:50 wiz Exp $	*/
 
 /*
- * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
+ * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
  *	NetBSD: usbdevs,v 1.737 2017/06/26 20:28:42 is Exp



CVS commit: src/sys/dev/pci

2017-06-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jun 27 08:10:44 UTC 2017

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen (comment change only)


To generate a diff of this commit:
cvs rdiff -u -r1.1283 -r1.1284 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1282 -r1.1283 src/sys/dev/pci/pcidevs_data.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/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1283 src/sys/dev/pci/pcidevs.h:1.1284
--- src/sys/dev/pci/pcidevs.h:1.1283	Sat Jun 17 20:25:26 2017
+++ src/sys/dev/pci/pcidevs.h	Tue Jun 27 08:10:44 2017
@@ -1,7 +1,7 @@
-/*	$NetBSD: pcidevs.h,v 1.1283 2017/06/17 20:25:26 jdolecek Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1284 2017/06/27 08:10:44 wiz Exp $	*/
 
 /*
- * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
+ * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
  *	NetBSD: pcidevs,v 1.1291 2017/06/17 20:25:06 jdolecek Exp

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1282 src/sys/dev/pci/pcidevs_data.h:1.1283
--- src/sys/dev/pci/pcidevs_data.h:1.1282	Sat Jun 17 20:25:26 2017
+++ src/sys/dev/pci/pcidevs_data.h	Tue Jun 27 08:10:44 2017
@@ -1,7 +1,7 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1282 2017/06/17 20:25:26 jdolecek Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1283 2017/06/27 08:10:44 wiz Exp $	*/
 
 /*
- * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
+ * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
  *	NetBSD: pcidevs,v 1.1291 2017/06/17 20:25:06 jdolecek Exp



CVS commit: src/sys/dev

2017-06-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jun 27 08:09:14 UTC 2017

Modified Files:
src/sys/dev: devlist2h.awk

Log Message:
Add verb to sentence.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/devlist2h.awk

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/devlist2h.awk
diff -u src/sys/dev/devlist2h.awk:1.2 src/sys/dev/devlist2h.awk:1.3
--- src/sys/dev/devlist2h.awk:1.2	Wed Oct 26 01:03:23 2016
+++ src/sys/dev/devlist2h.awk	Tue Jun 27 08:09:14 2017
@@ -1,5 +1,5 @@
 #! /usr/bin/awk -f
-#	$NetBSD: devlist2h.awk,v 1.2 2016/10/26 01:03:23 pgoyette Exp $
+#	$NetBSD: devlist2h.awk,v 1.3 2017/06/27 08:09:14 wiz Exp $
 #
 # Copyright (c) 1995, 1996 Christopher G. Demetriou
 # All rights reserved.
@@ -44,7 +44,7 @@ NR == 1 {
 
 	printf("/*\t$NetBSD" "$\t*/\n\n") > dfile
 	printf("/*\n") > dfile
-	printf(" * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.\n") \
+	printf(" * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.\n") \
 	> dfile
 	printf(" *\n") > dfile
 	printf(" * generated from:\n") > dfile
@@ -53,7 +53,7 @@ NR == 1 {
 
 	printf("/*\t$NetBSD" "$\t*/\n\n") > hfile
 	printf("/*\n") > hfile
-	printf(" * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.\n") \
+	printf(" * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.\n") \
 	> hfile
 	printf(" *\n") > hfile
 	printf(" * generated from:\n") > hfile



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

2017-06-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun 27 08:03:55 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_type.h

Log Message:
 Add some register definitions for X550 and newer.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ixgbe/ixgbe_type.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/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.23 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.24
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.23	Fri Jun 23 09:02:48 2017
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Tue Jun 27 08:03:55 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_type.h,v 1.23 2017/06/23 09:02:48 msaitoh Exp $*/
+/*$NetBSD: ixgbe_type.h,v 1.24 2017/06/27 08:03:55 msaitoh Exp $*/
 
 #ifndef _IXGBE_TYPE_H_
 #define _IXGBE_TYPE_H_
@@ -1052,6 +1052,24 @@ struct ixgbe_dmac_config {
 #define IXGBE_GSCN_2		0x11028
 #define IXGBE_GSCN_3		0x1102C
 #define IXGBE_FACTPS		0x10150
+
+/* X550 */
+#define IXGBE_PCI_ICAUSE	0x11520
+#define IXGBE_PCI_IENA		0x11528
+#define IXGBE_PCI_VMINDEX	0x11530
+#define IXGBE_PCI_VMPEND	0x11538
+#define IXGBE_PCI_DREVID	0x11540
+#define IXGBE_PCI_BYTCTH	0x11544
+#define IXGBE_PCI_BYTCTL	0x11548
+#define IXGBE_PCI_LATCT		0x11720 /* Denverton */
+#define IXGBE_PCI_LCBDATA	0x11734
+#define IXGBE_PCI_PKTCT		0x11740 /* Denverton */
+#define IXGBE_PCI_LCBADD	0x11788
+#define IXGBE_GSCL_1_X550	0x11800
+#define IXGBE_GSCL_2_X550	0x11804
+#define IXGBE_PCI_GSCL(_i)	(0x011810 + ((_i) * 4))
+#define IXGBE_PCI_GSCN(_i)	(0x011820 + ((_i) * 4))
+
 #define IXGBE_FACTPS_X540	IXGBE_FACTPS
 #define IXGBE_FACTPS_X550	IXGBE_FACTPS
 #define IXGBE_FACTPS_X550EM_x	IXGBE_FACTPS