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

2017-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Feb  7 04:27:43 UTC 2017

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

Log Message:
Set IFM_10G_T on 10G...


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.37 src/sys/dev/pci/ixgbe/ixv.c:1.38
--- src/sys/dev/pci/ixgbe/ixv.c:1.37	Tue Feb  7 04:26:07 2017
+++ src/sys/dev/pci/ixgbe/ixv.c	Tue Feb  7 04:27:43 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.37 2017/02/07 04:26:07 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.38 2017/02/07 04:27:43 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1031,7 +1031,7 @@ ixv_media_status(struct ifnet * ifp, str
 			ifmr->ifm_active |= IFM_1000_T | IFM_FDX;
 			break;
 		case IXGBE_LINK_SPEED_10GB_FULL:
-			ifmr->ifm_active |= IFM_FDX;
+			ifmr->ifm_active |= IFM_10G_T | IFM_FDX;
 			break;
 	}
 



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

2017-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Feb  7 04:26:07 UTC 2017

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

Log Message:
Fix link status stuff:
 - Set get_link_status in ixv_init_locked() to get link status correctly.
 - Don't discard checked speed in ixv_config_link()...


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.36 src/sys/dev/pci/ixgbe/ixv.c:1.37
--- src/sys/dev/pci/ixgbe/ixv.c:1.36	Tue Feb  7 04:20:59 2017
+++ src/sys/dev/pci/ixgbe/ixv.c	Tue Feb  7 04:26:07 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.36 2017/02/07 04:20:59 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.37 2017/02/07 04:26:07 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -783,6 +783,7 @@ ixv_init_locked(struct adapter *adapter)
 
 	/* Config/Enable Link */
 	ixv_config_link(adapter);
+	hw->mac.get_link_status = TRUE;
 
 	/* Start watchdog */
 	callout_reset(>timer, hz, ixv_local_timer, adapter);
@@ -1690,10 +1691,9 @@ static void
 ixv_config_link(struct adapter *adapter)
 {
 	struct ixgbe_hw *hw = >hw;
-	u32	autoneg;
 
 	if (hw->mac.ops.check_link)
-		hw->mac.ops.check_link(hw, ,
+		hw->mac.ops.check_link(hw, >link_speed,
 		>link_up, FALSE);
 }
 



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

2017-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Feb  7 04:20:59 UTC 2017

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

Log Message:
Fix device attach:
 - Even if ixgbevf_negotiate_api_version() failed, continue attaching.
   Same as Linux. Tested on ESXi 6.0.
 - Fix argument of pci_msix_alloc_exact().
 - Use different intr_xname for each interrupt.
 - Add missing pci_intr_release() on error.
 - Add missign kcpuset_destroy().
 - Calculate MSI-X vectors correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.35 src/sys/dev/pci/ixgbe/ixv.c:1.36
--- src/sys/dev/pci/ixgbe/ixv.c:1.35	Wed Feb  1 10:47:13 2017
+++ src/sys/dev/pci/ixgbe/ixv.c	Tue Feb  7 04:20:59 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.35 2017/02/01 10:47:13 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.36 2017/02/07 04:20:59 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -427,11 +427,9 @@ ixv_attach(device_t parent, device_t dev
 
 	/* Negotiate mailbox API version */
 	error = ixgbevf_negotiate_api_version(hw, ixgbe_mbox_api_11);
-	if (error) {
-		device_printf(dev, "MBX API 1.1 negotiation failed! Error %d\n", error);
-		error = EIO;
-		goto err_late;
-	}
+	if (error)
+		aprint_debug_dev(dev,
+		"MBX API 1.1 negotiation failed! Error %d\n", error);
 
 	error = ixgbe_init_hw(hw);
 	if (error) {
@@ -1346,7 +1344,8 @@ ixv_allocate_msix(struct adapter *adapte
 	int 		error, rid, vector = 0;
 	pci_chipset_tag_t pc;
 	pcitag_t	tag;
-	char intrbuf[PCI_INTRSTR_LEN];
+	char		intrbuf[PCI_INTRSTR_LEN];
+	char		intr_xname[32];
 	const char	*intrstr = NULL;
 	kcpuset_t	*affinity;
 	int		cpu_id = 0;
@@ -1354,12 +1353,15 @@ ixv_allocate_msix(struct adapter *adapte
 	pc = adapter->osdep.pc;
 	tag = adapter->osdep.tag;
 
+	adapter->osdep.nintrs = adapter->num_queues + 1;
 	if (pci_msix_alloc_exact(pa,
-		>osdep.intrs, IXG_MAX_NINTR) != 0)
+	>osdep.intrs, adapter->osdep.nintrs) != 0)
 		return (ENXIO);
 
 	kcpuset_create(, false);
 	for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) {
+		snprintf(intr_xname, sizeof(intr_xname), "%s TX/RX",
+		device_xname(dev));
 		intrstr = pci_intr_string(pc, adapter->osdep.intrs[i], intrbuf,
 		sizeof(intrbuf));
 #ifdef IXV_MPSAFE
@@ -1367,10 +1369,12 @@ ixv_allocate_msix(struct adapter *adapte
 		true);
 #endif
 		/* Set the handler function */
-		adapter->osdep.ihs[i] = pci_intr_establish(pc,
-		adapter->osdep.intrs[i], IPL_NET, ixv_msix_que, que);
-		if (adapter->osdep.ihs[i] == NULL) {
-			que->res = NULL;
+		que->res = adapter->osdep.ihs[i] = pci_intr_establish_xname(pc,
+		adapter->osdep.intrs[i], IPL_NET, ixv_msix_que, que,
+			intr_xname);
+		if (que->res == NULL) {
+			pci_intr_release(pc, adapter->osdep.intrs,
+			adapter->osdep.nintrs);
 			aprint_error_dev(dev,
 			"Failed to register QUE handler");
 			kcpuset_destroy(affinity);
@@ -1407,14 +1411,16 @@ ixv_allocate_msix(struct adapter *adapte
 
 	/* and Mailbox */
 	cpu_id++;
+	snprintf(intr_xname, sizeof(intr_xname), "%s link", device_xname(dev));
 	intrstr = pci_intr_string(pc, adapter->osdep.intrs[vector], intrbuf,
 	sizeof(intrbuf));
 #ifdef IXG_MPSAFE
 	pci_intr_setattr(pc, >osdep.intrs[vector], PCI_INTR_MPSAFE, true);
 #endif
 	/* Set the mbx handler function */
-	adapter->osdep.ihs[vector] = pci_intr_establish(pc,
-	adapter->osdep.intrs[vector], IPL_NET, ixv_msix_mbx, adapter);
+	adapter->osdep.ihs[vector] = pci_intr_establish_xname(pc,
+	adapter->osdep.intrs[vector], IPL_NET, ixv_msix_mbx, adapter,
+		intr_xname);
 	if (adapter->osdep.ihs[vector] == NULL) {
 		adapter->res = NULL;
 		aprint_error_dev(dev, "Failed to register LINK handler\n");
@@ -1451,6 +1457,7 @@ ixv_allocate_msix(struct adapter *adapte
 		pci_conf_write(pc, tag, rid, msix_ctrl);
 	}
 
+	kcpuset_destroy(affinity);
 	return (0);
 }
 
@@ -1462,7 +1469,7 @@ static int
 ixv_setup_msix(struct adapter *adapter)
 {
 	device_t dev = adapter->dev;
-	int want, msgs;
+	int want, queues, msgs;
 
 	/* Must have at least 2 MSIX vectors */
 	msgs = pci_msix_count(adapter->osdep.pc, adapter->osdep.tag);
@@ -1472,21 +1479,34 @@ ixv_setup_msix(struct adapter *adapter)
 	}
 	msgs = MIN(msgs, IXG_MAX_NINTR);
 
+	/* Figure out a reasonable auto config value */
+	queues = (ncpu > (msgs - 1)) ? (msgs - 1) : ncpu;
+
+	if (ixv_num_queues != 0)
+		queues = ixv_num_queues;
+	else if ((ixv_num_queues == 0) && (queues > IXGBE_VF_MAX_TX_QUEUES))
+		queues = IXGBE_VF_MAX_TX_QUEUES;
+
 	/*
 	** Want vectors for the queues,
 	** plus an additional for mailbox.
 	*/
-	want = adapter->num_queues + 1;
-	if 

CVS commit: src/sys

2017-02-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Feb  7 02:38:08 UTC 2017

Modified Files:
src/sys/netinet: if_arp.c ip_flow.c ip_icmp.c ip_input.c tcp_input.c
src/sys/netinet6: icmp6.c mld6.c

Log Message:
Add missing NULL checks for m_get_rcvif


To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.79 -r1.80 src/sys/netinet/ip_flow.c
cvs rdiff -u -r1.156 -r1.157 src/sys/netinet/ip_icmp.c
cvs rdiff -u -r1.348 -r1.349 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.353 -r1.354 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.207 -r1.208 src/sys/netinet6/icmp6.c
cvs rdiff -u -r1.80 -r1.81 src/sys/netinet6/mld6.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.240 src/sys/netinet/if_arp.c:1.241
--- src/sys/netinet/if_arp.c:1.240	Tue Jan 24 07:09:24 2017
+++ src/sys/netinet/if_arp.c	Tue Feb  7 02:38:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.240 2017/01/24 07:09:24 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.241 2017/02/07 02:38:08 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.240 2017/01/24 07:09:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.241 2017/02/07 02:38:08 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -941,6 +941,10 @@ arpintr(void)
 			goto badlen;
 
 		rcvif = m_get_rcvif(m, );
+		if (__predict_false(rcvif == NULL)) {
+			ARP_STATINC(ARP_STAT_RCVNOINT);
+			goto free;
+		}
 		switch (rcvif->if_type) {
 		case IFT_IEEE1394:
 			arplen = sizeof(struct arphdr) +
@@ -967,6 +971,7 @@ arpintr(void)
 badlen:
 			ARP_STATINC(ARP_STAT_RCVBADLEN);
 		}
+free:
 		m_freem(m);
 	}
 out:
@@ -1312,10 +1317,15 @@ reply:
 		struct llentry *lle = NULL;
 		struct sockaddr_in sin;
 #if NCARP > 0
-		struct ifnet *_rcvif = m_get_rcvif(m, );
-		if (ifp->if_type == IFT_CARP && _rcvif->if_type != IFT_CARP)
-			goto out;
-		m_put_rcvif(_rcvif, );
+		if (ifp->if_type == IFT_CARP) {
+			struct ifnet *_rcvif = m_get_rcvif(m, );
+			int iftype = 0;
+			if (__predict_true(_rcvif != NULL))
+iftype = _rcvif->if_type;
+			m_put_rcvif(_rcvif, );
+			if (iftype != IFT_CARP)
+goto out;
+		}
 #endif
 
 		tha = ar_tha(ah);
@@ -1877,6 +1887,8 @@ in_revarpinput(struct mbuf *m)
 	op = ntohs(ah->ar_op);
 
 	rcvif = m_get_rcvif(m, );
+	if (__predict_false(rcvif == NULL))
+		goto out;
 	switch (rcvif->if_type) {
 	case IFT_IEEE1394:
 		/* ARP without target hardware address is not supported */

Index: src/sys/netinet/ip_flow.c
diff -u src/sys/netinet/ip_flow.c:1.79 src/sys/netinet/ip_flow.c:1.80
--- src/sys/netinet/ip_flow.c:1.79	Wed Jan 11 13:08:29 2017
+++ src/sys/netinet/ip_flow.c	Tue Feb  7 02:38:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_flow.c,v 1.79 2017/01/11 13:08:29 ozaki-r Exp $	*/
+/*	$NetBSD: ip_flow.c,v 1.80 2017/02/07 02:38:08 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_flow.c,v 1.79 2017/01/11 13:08:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_flow.c,v 1.80 2017/02/07 02:38:08 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -247,6 +247,8 @@ ipflow_fastforward(struct mbuf *m)
 		goto out;
 
 	ifp = m_get_rcvif(m, );
+	if (__predict_false(ifp == NULL))
+		goto out_unref;
 	/*
 	 * Verify the IP header checksum.
 	 */

Index: src/sys/netinet/ip_icmp.c
diff -u src/sys/netinet/ip_icmp.c:1.156 src/sys/netinet/ip_icmp.c:1.157
--- src/sys/netinet/ip_icmp.c:1.156	Thu Feb  2 02:52:10 2017
+++ src/sys/netinet/ip_icmp.c	Tue Feb  7 02:38:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_icmp.c,v 1.156 2017/02/02 02:52:10 ozaki-r Exp $	*/
+/*	$NetBSD: ip_icmp.c,v 1.157 2017/02/07 02:38:08 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -94,7 +94,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.156 2017/02/02 02:52:10 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.157 2017/02/07 02:38:08 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -562,7 +562,7 @@ _icmp_input(struct mbuf *m, int hlen, in
 	case ICMP_MASKREQ: {
 		struct ifnet *rcvif;
 		int s, ss;
-		struct ifaddr *ifa;
+		struct ifaddr *ifa = NULL;
 
 		if (icmpmaskrepl == 0)
 			break;
@@ -581,7 +581,8 @@ _icmp_input(struct mbuf *m, int hlen, in
 			icmpdst.sin_addr = ip->ip_dst;
 		ss = pserialize_read_enter();
 		rcvif = m_get_rcvif(m, );
-		ifa = ifaof_ifpforaddr(sintosa(), rcvif);
+		if (__predict_true(rcvif != NULL))
+			ifa = ifaof_ifpforaddr(sintosa(), rcvif);
 		m_put_rcvif(rcvif, );
 		if (ifa == NULL) {
 			pserialize_read_exit(ss);

Index: src/sys/netinet/ip_input.c
diff -u src/sys/netinet/ip_input.c:1.348 src/sys/netinet/ip_input.c:1.349
--- src/sys/netinet/ip_input.c:1.348	Tue Jan 24 

CVS commit: src/sys/sys

2017-02-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Feb  7 02:36:48 UTC 2017

Modified Files:
src/sys/sys: mbuf.h

Log Message:
Tweak m_get_rcvif

Call pserialize_read_exit if if_byindex returns NULL in m_get_rcvif.
By changing so, callers need to call m_put_rcvif only if m_get_rcvif
returns non-NULL.

Old m_get_rcvif/m_put_rcvif could forget to call pserialize_read_exit,
which is pointed out by maxv@. The change fixes it.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/sys/mbuf.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/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.167 src/sys/sys/mbuf.h:1.168
--- src/sys/sys/mbuf.h:1.167	Tue Oct  4 14:13:21 2016
+++ src/sys/sys/mbuf.h	Tue Feb  7 02:36:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.167 2016/10/04 14:13:21 christos Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.168 2017/02/07 02:36:48 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -1006,16 +1006,24 @@ void m_print(const struct mbuf *, const 
 /*
  * Get rcvif of a mbuf.
  *
- * The caller must call m_put_rcvif after using rcvif. The caller cannot
- * block or sleep during using rcvif. Insofar as the constraint is satisfied,
- * the API ensures a got rcvif isn't be freed until m_put_rcvif is called.
+ * The caller must call m_put_rcvif after using rcvif if the returned rcvif
+ * isn't NULL. If the returned rcvif is NULL, the caller doesn't need to call
+ * m_put_rcvif (although calling it is safe).
+ *
+ * The caller must not block or sleep while using rcvif. The API ensures a
+ * returned rcvif isn't freed until m_put_rcvif is called.
  */
 static __inline struct ifnet *
 m_get_rcvif(const struct mbuf *m, int *s)
 {
+	struct ifnet *ifp;
 
 	*s = pserialize_read_enter();
-	return if_byindex(m->m_pkthdr.rcvif_index);
+	ifp = if_byindex(m->m_pkthdr.rcvif_index);
+	if (__predict_false(ifp == NULL))
+		pserialize_read_exit(*s);
+
+	return ifp;
 }
 
 static __inline void



CVS commit: src/sys/net

2017-02-06 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Feb  7 02:33:54 UTC 2017

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

Log Message:
Use m_get_rcvif_psref instead of m_get_rcvif

Because the critical sections are now sleepable.

Reviewed by knakahara@


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/net/if_pppoe.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/if_pppoe.c
diff -u src/sys/net/if_pppoe.c:1.124 src/sys/net/if_pppoe.c:1.125
--- src/sys/net/if_pppoe.c:1.124	Wed Feb  1 17:58:47 2017
+++ src/sys/net/if_pppoe.c	Tue Feb  7 02:33:54 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.124 2017/02/01 17:58:47 maxv Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.125 2017/02/07 02:33:54 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.124 2017/02/01 17:58:47 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.125 2017/02/07 02:33:54 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -640,7 +641,8 @@ pppoe_dispatch_disc_pkt(struct mbuf *m, 
 			break;	/* ignored */
 		case PPPOE_TAG_HUNIQUE: {
 			struct ifnet *rcvif;
-			int s;
+			struct psref psref;
+
 			if (sc != NULL)
 break;
 			n = m_pulldown(m, off + sizeof(*pt), len, );
@@ -653,10 +655,12 @@ pppoe_dispatch_disc_pkt(struct mbuf *m, 
 			hunique = mtod(n, uint8_t *) + noff;
 			hunique_len = len;
 #endif
-			rcvif = m_get_rcvif(m, );
-			sc = pppoe_find_softc_by_hunique(mtod(n, char *) + noff,
-			len, rcvif, RW_READER);
-			m_put_rcvif(rcvif, );
+			rcvif = m_get_rcvif_psref(m, );
+			if (rcvif != NULL) {
+sc = pppoe_find_softc_by_hunique(mtod(n, char *) + noff,
+len, rcvif, RW_READER);
+			}
+			m_put_rcvif_psref(rcvif, );
 			if (sc != NULL) {
 strlcpy(devname, sc->sc_sppp.pp_if.if_xname,
 sizeof(devname));
@@ -786,6 +790,9 @@ breakbreak:;
 #endif /* PPPOE_SERVER */
 	case PPPOE_CODE_PADR:
 #ifdef PPPOE_SERVER
+	{
+		struct ifnet *rcvif;
+		struct psref psref;
 		/*
 		 * get sc from ac_cookie if IFF_PASSIVE
 		 */
@@ -794,10 +801,15 @@ breakbreak:;
 			printf("pppoe: received PADR but not includes ac_cookie\n");
 			goto done;
 		}
-		sc = pppoe_find_softc_by_hunique(ac_cookie,
-		 ac_cookie_len,
-		 m_get_rcvif_NOMPSAFE(m),
-		 RW_WRITER);
+
+		rcvif = m_get_rcvif_psref(m, );
+		if (__predict_true(rcvif != NULL)) {
+			sc = pppoe_find_softc_by_hunique(ac_cookie,
+			 ac_cookie_len,
+			 rcvif,
+			 RW_WRITER);
+		}
+		m_put_rcvif_psref(rcvif, );
 		if (sc == NULL) {
 			/* be quiet if there is not a single pppoe instance */
 			if (!LIST_EMPTY(_softc_list))
@@ -835,6 +847,7 @@ breakbreak:;
 		sc->sc_sppp.pp_up(>sc_sppp);
 		sppp_lock_exit(>sc_sppp);
 		break;
+	}
 #else
 		/* ignore, we are no access concentrator */
 		goto done;
@@ -935,11 +948,14 @@ breakbreak:;
 		break;
 	case PPPOE_CODE_PADT: {
 		struct ifnet *rcvif;
-		int s;
+		struct psref psref;
 
-		rcvif = m_get_rcvif(m, );
-		sc = pppoe_find_softc_by_session(session, rcvif, RW_WRITER);
-		m_put_rcvif(rcvif, );
+		rcvif = m_get_rcvif_psref(m, );
+		if (__predict_true(rcvif != NULL)) {
+			sc = pppoe_find_softc_by_session(session, rcvif,
+			RW_WRITER);
+		}
+		m_put_rcvif_psref(rcvif, );
 		if (sc == NULL)
 			goto done;
 



CVS commit: src/sys/dev

2017-02-06 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Tue Feb  7 02:05:27 UTC 2017

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

Log Message:
Ensure the vc block size is set before call to set defaults.

It should address PR kern/51746 Panics from audio.


To generate a diff of this commit:
cvs rdiff -u -r1.300 -r1.301 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.300 src/sys/dev/audio.c:1.301
--- src/sys/dev/audio.c:1.300	Fri Feb  3 20:13:52 2017
+++ src/sys/dev/audio.c	Tue Feb  7 02:05:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.300 2017/02/03 20:13:52 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.301 2017/02/07 02:05:26 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.300 2017/02/03 20:13:52 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.301 2017/02/07 02:05:26 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -1963,6 +1963,9 @@ audio_open(dev_t dev, struct audio_softc
 		mode |= AUMODE_PLAY | AUMODE_PLAY_ALL;
 	}
 
+	vc->sc_mrr.blksize = sc->sc_vchan[0]->sc_mrr.blksize;
+	vc->sc_mpr.blksize = sc->sc_vchan[0]->sc_mpr.blksize;
+
 	/*
 	 * Multiplex device: /dev/audio (MU-Law) and /dev/sound (linear)
 	 * The /dev/audio is always (re)set to 8-bit MU-Law mono



CVS commit: src/sys/compat/linux/common

2017-02-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Feb  6 23:45:49 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_exec_elf32.c

Log Message:
Use ELFOSABI_LINUX instead of a magic number.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/compat/linux/common/linux_exec_elf32.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/compat/linux/common/linux_exec_elf32.c
diff -u src/sys/compat/linux/common/linux_exec_elf32.c:1.93 src/sys/compat/linux/common/linux_exec_elf32.c:1.94
--- src/sys/compat/linux/common/linux_exec_elf32.c:1.93	Thu Jun 11 02:54:00 2015
+++ src/sys/compat/linux/common/linux_exec_elf32.c	Mon Feb  6 23:45:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_exec_elf32.c,v 1.93 2015/06/11 02:54:00 matt Exp $	*/
+/*	$NetBSD: linux_exec_elf32.c,v 1.94 2017/02/06 23:45:49 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.93 2015/06/11 02:54:00 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.94 2017/02/06 23:45:49 uwe Exp $");
 
 #ifndef ELFSIZE
 /* XXX should die */
@@ -273,7 +273,7 @@ ELFNAME2(linux,signature)(struct lwp *l,
 	int error;
 	static const char linux[] = "Linux";
 
-	if (eh->e_ident[EI_OSABI] == 3 ||
+	if (eh->e_ident[EI_OSABI] == ELFOSABI_LINUX ||
 	memcmp(>e_ident[EI_ABIVERSION], linux, sizeof(linux)) == 0)
 		return 0;
 



CVS commit: src/sys/external/bsd/acpica/dist/compiler

2017-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb  6 23:12:25 UTC 2017

Modified Files:
src/sys/external/bsd/acpica/dist/compiler: aslutils.c

Log Message:
Remove __DATE__! Intel really likes non-reprodible builds!


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/sys/external/bsd/acpica/dist/compiler/aslutils.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/external/bsd/acpica/dist/compiler/aslutils.c
diff -u src/sys/external/bsd/acpica/dist/compiler/aslutils.c:1.16 src/sys/external/bsd/acpica/dist/compiler/aslutils.c:1.17
--- src/sys/external/bsd/acpica/dist/compiler/aslutils.c:1.16	Wed Jan 25 08:38:21 2017
+++ src/sys/external/bsd/acpica/dist/compiler/aslutils.c	Mon Feb  6 18:12:25 2017
@@ -402,7 +402,7 @@ UtDisplaySummary (
 /* Compiler name and version number */
 
 FlPrintFile (FileId, "%s version %X [%s]\n\n",
-ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION, __DATE__);
+ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION, "2017-01-19");
 }
 
 /* Summary of main input and output files */



CVS commit: src/bin/ls

2017-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Feb  6 21:06:04 UTC 2017

Modified Files:
src/bin/ls: ls.c

Log Message:
white space


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/bin/ls/ls.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/ls/ls.c
diff -u src/bin/ls/ls.c:1.75 src/bin/ls/ls.c:1.76
--- src/bin/ls/ls.c:1.75	Mon May 30 17:26:29 2016
+++ src/bin/ls/ls.c	Mon Feb  6 21:06:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ls.c,v 1.75 2016/05/30 17:26:29 dholland Exp $	*/
+/*	$NetBSD: ls.c,v 1.76 2017/02/06 21:06:04 rin Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)ls.c	8.7 (Berkeley) 8/5/94";
 #else
-__RCSID("$NetBSD: ls.c,v 1.75 2016/05/30 17:26:29 dholland Exp $");
+__RCSID("$NetBSD: ls.c,v 1.76 2017/02/06 21:06:04 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -91,7 +91,7 @@ int f_columnacross;		/* columnated forma
 int f_flags;			/* show flags associated with a file */
 int f_grouponly;		/* long listing without owner */
 int f_humanize;			/* humanize the size field */
-int f_commas;   /* separate size field with comma */
+int f_commas;			/* separate size field with comma */
 int f_inode;			/* print inode */
 int f_listdir;			/* list actual directory, not contents */
 int f_listdot;			/* list files beginning with . */



CVS commit: src/distrib/sets/lists

2017-02-06 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Feb  6 19:45:18 UTC 2017

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/debug: mi

Log Message:
+ /usr/bin/nc(someone please check these are correct)


To generate a diff of this commit:
cvs rdiff -u -r1.1151 -r1.1152 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.195 -r1.196 src/distrib/sets/lists/debug/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1151 src/distrib/sets/lists/base/mi:1.1152
--- src/distrib/sets/lists/base/mi:1.1151	Sat Jan 28 16:55:54 2017
+++ src/distrib/sets/lists/base/mi	Mon Feb  6 19:45:17 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1151 2017/01/28 16:55:54 nat Exp $
+# $NetBSD: mi,v 1.1152 2017/02/06 19:45:17 kre Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -810,6 +810,7 @@
 ./usr/bin/mset	base-obsolete		obsolete
 ./usr/bin/msgs	base-util-bin
 ./usr/bin/nbsvtoolbase-crypto-bin		crypto
+./usr/bin/nc	base-netutil-bin
 ./usr/bin/netgroupbase-nis-bin
 ./usr/bin/netpgpbase-crypto-bin		crypto
 ./usr/bin/netpgpkeysbase-crypto-bin		crypto

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.195 src/distrib/sets/lists/debug/mi:1.196
--- src/distrib/sets/lists/debug/mi:1.195	Thu Feb  2 22:07:33 2017
+++ src/distrib/sets/lists/debug/mi	Mon Feb  6 19:45:17 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.195 2017/02/02 22:07:33 martin Exp $
+# $NetBSD: mi,v 1.196 2017/02/06 19:45:17 kre Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -664,6 +664,7 @@
 ./usr/libdata/debug/usr/bin/msguniq.debug	comp-c-debug		debug
 ./usr/libdata/debug/usr/bin/nbperf.debug	comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/nbsvtool.debug	comp-crypto-debug	crypto,debug
+./usr/libdata/debug/usr/bin/nc.debug		comp-netutil-debug	debug
 ./usr/libdata/debug/usr/bin/netgroup.debug	comp-nis-debug		debug
 ./usr/libdata/debug/usr/bin/netpgp.debug	comp-crypto-debug	crypto,debug
 ./usr/libdata/debug/usr/bin/netpgpkeys.debug	comp-crypto-debug	crypto,debug



CVS commit: src/sys/arch/amd64/amd64

2017-02-06 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Feb  6 16:34:37 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: netbsd32_machdep.c

Log Message:
In cpu_mcontext32_validate, allow the registers to have different locations
if the LDT is user-set.

I am intentionally not allowing this in check_sigcontext32, because I don't
think Wine uses it.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/amd64/amd64/netbsd32_machdep.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.100 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.101
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.100	Mon Feb  6 16:02:17 2017
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Mon Feb  6 16:34:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.100 2017/02/06 16:02:17 maxv Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.101 2017/02/06 16:34:37 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.100 2017/02/06 16:02:17 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.101 2017/02/06 16:34:37 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1016,6 +1016,7 @@ check_sigcontext32(struct lwp *l, const 
 int
 cpu_mcontext32_validate(struct lwp *l, const mcontext32_t *mcp)
 {
+	struct pmap *pmap = l->l_proc->p_vmspace->vm_map.pmap;
 	const __greg32_t *gr;
 	struct trapframe *tf;
 	struct pcb *pcb;
@@ -1024,22 +1025,31 @@ cpu_mcontext32_validate(struct lwp *l, c
 	tf = l->l_md.md_regs;
 	pcb = lwp_getpcb(l);
 
-	if (((gr[_REG32_EFL] ^ tf->tf_rflags) & PSL_USERSTATIC) != 0 ||
-	!VALID_USER_CSEL32(gr[_REG32_CS]))
-		return EINVAL;
-	if (gr[_REG32_FS] != 0 && !VALID_USER_DSEL32(gr[_REG32_FS]) &&
-	!(VALID_USER_FSEL32(gr[_REG32_FS]) && pcb->pcb_fs != 0))
-		return EINVAL;
-	if (gr[_REG32_GS] != 0 && !VALID_USER_DSEL32(gr[_REG32_GS]) &&
-	!(VALID_USER_GSEL32(gr[_REG32_GS]) && pcb->pcb_gs != 0))
-		return EINVAL;
-	if (gr[_REG32_ES] != 0 && !VALID_USER_DSEL32(gr[_REG32_ES]))
-		return EINVAL;
-	if (!VALID_USER_DSEL32(gr[_REG32_DS]) ||
-	!VALID_USER_DSEL32(gr[_REG32_SS]))
-		return EINVAL;
-	if (gr[_REG32_EIP] >= VM_MAXUSER_ADDRESS32)
+	if (((gr[_REG32_EFL] ^ tf->tf_rflags) & PSL_USERSTATIC) != 0)
 		return EINVAL;
+
+	if (__predict_false(pmap->pm_ldt != NULL)) {
+		/* Only when the LDT is user-set (with USER_LDT) */
+		if (!USERMODE(gr[_REG32_CS], gr[_REG32_EFL]))
+			return EINVAL;
+	} else {
+		if (!VALID_USER_CSEL32(gr[_REG32_CS]))
+			return EINVAL;
+		if (gr[_REG32_FS] != 0 && !VALID_USER_DSEL32(gr[_REG32_FS]) &&
+		!(VALID_USER_FSEL32(gr[_REG32_FS]) && pcb->pcb_fs != 0))
+			return EINVAL;
+		if (gr[_REG32_GS] != 0 && !VALID_USER_DSEL32(gr[_REG32_GS]) &&
+		!(VALID_USER_GSEL32(gr[_REG32_GS]) && pcb->pcb_gs != 0))
+			return EINVAL;
+		if (gr[_REG32_ES] != 0 && !VALID_USER_DSEL32(gr[_REG32_ES]))
+			return EINVAL;
+		if (!VALID_USER_DSEL32(gr[_REG32_DS]) ||
+		!VALID_USER_DSEL32(gr[_REG32_SS]))
+			return EINVAL;
+		if (gr[_REG32_EIP] >= VM_MAXUSER_ADDRESS32)
+			return EINVAL;
+	}
+
 	return 0;
 }
 



CVS commit: src/usr.bin/nc

2017-02-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Feb  6 16:08:56 UTC 2017

Modified Files:
src/usr.bin/nc: nc.1

Log Message:
Use full month name in Dd.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/nc/nc.1

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

Modified files:

Index: src/usr.bin/nc/nc.1
diff -u src/usr.bin/nc/nc.1:1.2 src/usr.bin/nc/nc.1:1.3
--- src/usr.bin/nc/nc.1:1.2	Mon Feb  6 16:03:40 2017
+++ src/usr.bin/nc/nc.1	Mon Feb  6 16:08:56 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: nc.1,v 1.2 2017/02/06 16:03:40 christos Exp $
+.\" $NetBSD: nc.1,v 1.3 2017/02/06 16:08:56 wiz Exp $
 .\" $OpenBSD: nc.1,v 1.81 2017/01/26 22:59:55 jmc Exp $
 .\"
 .\" Copyright (c) 1996 David Sacerdote
@@ -26,7 +26,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd Feb 2, 2017
+.Dd February 2, 2017
 .Dt NC 1
 .Os
 .Sh NAME



CVS commit: src/doc

2017-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb  6 16:08:40 UTC 2017

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention netcat (nc)


To generate a diff of this commit:
cvs rdiff -u -r1.1408 -r1.1409 src/doc/3RDPARTY
cvs rdiff -u -r1.2242 -r1.2243 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1408 src/doc/3RDPARTY:1.1409
--- src/doc/3RDPARTY:1.1408	Sat Feb  4 23:05:05 2017
+++ src/doc/3RDPARTY	Mon Feb  6 11:08:40 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1408 2017/02/05 04:05:05 spz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1409 2017/02/06 16:08:40 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1668,3 +1668,14 @@ Mailing List:   none
 Responsible:christos
 License:BSD-like (2-clause)
 Location:   external/bsd/librtld_db/dist
+
+Package:netcat
+Version:OpenBSD-2017-02-06
+Current Vers:   OpenBSD--YY-ZZ
+Maintainer: OpenBSD
+Archive Site:   none
+Home Page:  none
+Mailing List:   none
+Responsible:christos
+License:BSD-like (3-clause)
+Location:   usr.bin/nc

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2242 src/doc/CHANGES:1.2243
--- src/doc/CHANGES:1.2242	Tue Jan 31 18:56:41 2017
+++ src/doc/CHANGES	Mon Feb  6 11:08:40 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2242 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2243 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -457,4 +457,5 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	acpi(4): Updated ACPICA to 20170119. [christos 20170125]
 	bta2dpd(8): Add new bluetooth A2DP daemon. [nat 20170129]
 	kerberos(8): Update to latest Heimdal-HEAD [christos 20170128]
-	libevent: Import libevent 2.1.18 [christos 20160131]
+	libevent: Import libevent 2.1.18 [christos 20170131]
+	nc(1): Add a netcat utility from OpenBSD [christos 20170206]



CVS commit: src/distrib/sets/lists/man

2017-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb  6 16:06:38 UTC 2017

Modified Files:
src/distrib/sets/lists/man: mi

Log Message:
add nc


To generate a diff of this commit:
cvs rdiff -u -r1.1547 -r1.1548 src/distrib/sets/lists/man/mi

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1547 src/distrib/sets/lists/man/mi:1.1548
--- src/distrib/sets/lists/man/mi:1.1547	Sat Jan 28 11:55:54 2017
+++ src/distrib/sets/lists/man/mi	Mon Feb  6 11:06:38 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1547 2017/01/28 16:55:54 nat Exp $
+# $NetBSD: mi,v 1.1548 2017/02/06 16:06:38 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -350,6 +350,7 @@
 ./usr/share/man/cat1/mt.0			man-util-catman		.cat
 ./usr/share/man/cat1/mv.0			man-util-catman		.cat
 ./usr/share/man/cat1/nbsvtool.0			man-crypto-catman	crypto,.cat
+./usr/share/man/cat1/nc.0			man-netutil-catman	.cat
 ./usr/share/man/cat1/netgroup.0			man-nis-catman		.cat
 ./usr/share/man/cat1/netpgp.0			man-crypto-catman	crypto,.cat
 ./usr/share/man/cat1/netpgpkeys.0		man-crypto-catman	crypto,.cat
@@ -3521,6 +3522,7 @@
 ./usr/share/man/html1/mt.html			man-util-htmlman	html
 ./usr/share/man/html1/mv.html			man-util-htmlman	html
 ./usr/share/man/html1/nbsvtool.html		man-crypto-htmlman	crypto,html
+./usr/share/man/html1/nc.html			man-netutil-htmlman	html
 ./usr/share/man/html1/netgroup.html		man-nis-htmlman		html
 ./usr/share/man/html1/netpgp.html		man-crypto-htmlman	crypto,html
 ./usr/share/man/html1/netpgpkeys.html		man-crypto-htmlman	crypto,html
@@ -6334,6 +6336,7 @@
 ./usr/share/man/man1/mt.1			man-util-man		.man
 ./usr/share/man/man1/mv.1			man-util-man		.man
 ./usr/share/man/man1/nbsvtool.1			man-crypto-man		crypto,.man
+./usr/share/man/man1/nc.1			man-netutil-man		.man
 ./usr/share/man/man1/netgroup.1			man-nis-man		.man
 ./usr/share/man/man1/netpgp.1			man-crypto-man		crypto,.man
 ./usr/share/man/man1/netpgpkeys.1		man-crypto-man		crypto,.man



CVS commit: src/usr.bin

2017-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb  6 16:04:07 UTC 2017

Modified Files:
src/usr.bin: Makefile

Log Message:
Add nc.


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/usr.bin/Makefile

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

Modified files:

Index: src/usr.bin/Makefile
diff -u src/usr.bin/Makefile:1.226 src/usr.bin/Makefile:1.227
--- src/usr.bin/Makefile:1.226	Sun Oct  2 21:00:27 2016
+++ src/usr.bin/Makefile	Mon Feb  6 11:04:07 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.226 2016/10/03 01:00:27 kamil Exp $
+#	$NetBSD: Makefile,v 1.227 2017/02/06 16:04:07 christos Exp $
 #	from: @(#)Makefile	8.3 (Berkeley) 1/7/94
 
 .include 
@@ -19,7 +19,7 @@ SUBDIR= apply asa at audio audiocfg \
 	machine mail make man menuc mesg midiplay midirecord mixerctl \
 	mkcsmapper mkdep mkesdb mkfifo mklocale mkstr mktemp mkubootimage \
 	moduli msgc msgs \
-	nbperf netgroup netstat newgrp newsyslog nfsstat nice nl nohup \
+	nbperf nc netgroup netstat newgrp newsyslog nfsstat nice nl nohup \
 	pagesize passwd paste patch pathchk pkill pmap pmc pr \
 	printenv printf progress pwait pwhash qsubst quota radioctl rdist \
 	renice rev revoke rfcomm_sppd rlogin rpcgen rpcinfo rs rsh \



CVS commit: src/usr.bin/nc

2017-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb  6 16:03:41 UTC 2017

Modified Files:
src/usr.bin/nc: Makefile atomicio.c nc.1 netcat.c socks.c

Log Message:
- Disable crypto for now, and functionality that we don't provide.
- Fix warnings


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/usr.bin/nc/Makefile \
src/usr.bin/nc/atomicio.c src/usr.bin/nc/nc.1 src/usr.bin/nc/netcat.c \
src/usr.bin/nc/socks.c

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

Modified files:

Index: src/usr.bin/nc/Makefile
diff -u src/usr.bin/nc/Makefile:1.1.1.1 src/usr.bin/nc/Makefile:1.2
--- src/usr.bin/nc/Makefile:1.1.1.1	Mon Feb  6 11:00:51 2017
+++ src/usr.bin/nc/Makefile	Mon Feb  6 11:03:40 2017
@@ -1,8 +1,14 @@
 #	$OpenBSD: Makefile,v 1.7 2015/09/11 21:07:01 beck Exp $
 
+.include 
+
 PROG=	nc
 SRCS=	netcat.c atomicio.c socks.c
-LDADD+= -ltls -lssl -lcrypto
-DPADD+=  ${LIBTLS} ${LIBSSL} ${LIBCRYPTO}
+
+#.if ${MKCRYPTO} == "yes"
+#CPPFLAGS+=-DCRYPTO
+#LDADD+= -ltls -lssl -lcrypto
+#DPADD+=  ${LIBTLS} ${LIBSSL} ${LIBCRYPTO}
+#.endif
 
 .include 
Index: src/usr.bin/nc/atomicio.c
diff -u src/usr.bin/nc/atomicio.c:1.1.1.1 src/usr.bin/nc/atomicio.c:1.2
--- src/usr.bin/nc/atomicio.c:1.1.1.1	Mon Feb  6 11:00:50 2017
+++ src/usr.bin/nc/atomicio.c	Mon Feb  6 11:03:40 2017
@@ -25,6 +25,8 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+#include 
+__RCSID("$NetBSD: atomicio.c,v 1.2 2017/02/06 16:03:40 christos Exp $");
 
 #include 
 #include 
Index: src/usr.bin/nc/nc.1
diff -u src/usr.bin/nc/nc.1:1.1.1.1 src/usr.bin/nc/nc.1:1.2
--- src/usr.bin/nc/nc.1:1.1.1.1	Mon Feb  6 11:00:50 2017
+++ src/usr.bin/nc/nc.1	Mon Feb  6 11:03:40 2017
@@ -1,3 +1,4 @@
+.\" $NetBSD: nc.1,v 1.2 2017/02/06 16:03:40 christos Exp $
 .\" $OpenBSD: nc.1,v 1.81 2017/01/26 22:59:55 jmc Exp $
 .\"
 .\" Copyright (c) 1996 David Sacerdote
@@ -25,7 +26,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd $Mdocdate: January 26 2017 $
+.Dd Feb 2, 2017
 .Dt NC 1
 .Os
 .Sh NAME
@@ -49,7 +50,7 @@
 .Op Fl R Ar CAfile
 .Op Fl s Ar source
 .Op Fl T Ar keyword
-.Op Fl V Ar rtable
+.\" .Op Fl V Ar rtable
 .Op Fl w Ar timeout
 .Op Fl X Ar proxy_protocol
 .Op Fl x Ar proxy_address Ns Op : Ns Ar port
@@ -281,8 +282,8 @@ socket is used, a temporary receiving so
 unless the
 .Fl s
 flag is given.
-.It Fl V Ar rtable
-Set the routing table to be used.
+.\" .It Fl V Ar rtable
+.\" Set the routing table to be used.
 .It Fl v
 Have
 .Nm
Index: src/usr.bin/nc/netcat.c
diff -u src/usr.bin/nc/netcat.c:1.1.1.1 src/usr.bin/nc/netcat.c:1.2
--- src/usr.bin/nc/netcat.c:1.1.1.1	Mon Feb  6 11:00:50 2017
+++ src/usr.bin/nc/netcat.c	Mon Feb  6 11:03:40 2017
@@ -26,6 +26,8 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+#include 
+__RCSID("$NetBSD: netcat.c,v 1.2 2017/02/06 16:03:40 christos Exp $");
 
 /*
  * Re-written nc(1) for OpenBSD. Original implementation by
@@ -54,9 +56,18 @@
 #include 
 #include 
 #include 
+#ifdef CRYPTO
 #include 
+#else
+#define TLS_WANT_POLLIN -2
+#define TLS_WANT_POLLOUT -2
+#endif
 #include "atomicio.h"
 
+#ifdef __NetBSD__
+#define accept4(a, b, c, d) paccept((a), (b), (c), NULL, (d))
+#endif
+
 #define PORT_MAX	65535
 #define UNIX_DG_TMP_SOCKET_SIZE	19
 
@@ -95,13 +106,15 @@ int	Iflag;	/* TCP receive buffer siz
 int	Oflag;	/* TCP send buffer size */
 int	Sflag;	/* TCP MD5 signature option */
 int	Tflag = -1;/* IP Type of Service */
+#ifdef __OpenBSD__
 int	rtableid = -1;
+#endif
 
 int	usetls;	/* use TLS */
 char*Cflag;	/* Public cert file */
 char*Kflag;	/* Private key file */
 char*oflag;	/* OCSP stapling file */
-char*Rflag = DEFAULT_CA_FILE;		/* Root CA file */
+const char*Rflag = DEFAULT_CA_FILE;		/* Root CA file */
 int	tls_cachanged;/* Using non-default CA file */
 int TLSopt;	/* TLS options */
 char	*tls_expectname;			/* required name in peer cert */
@@ -118,6 +131,7 @@ void	atelnet(int, unsigned char *, unsig
 void	build_ports(char *);
 void	help(void);
 int	local_listen(char *, char *, struct addrinfo);
+struct tls;
 void	readwrite(int, struct tls *);
 void	fdpass(int nfd) __attribute__((noreturn));
 int	remote_connect(const char *, const char *, struct addrinfo);
@@ -132,7 +146,7 @@ void	set_common_sockopts(int, int);
 int	map_tos(char *, int *);
 int	map_tls(char *, int *);
 void	report_connect(const struct sockaddr *, socklen_t, char *);
-void	report_tls(struct tls *tls_ctx, char * host, char *tls_expectname);
+void	report_tls(struct tls *tls_ctx, char * host, char *tlsexpectname);
 void	usage(int);
 ssize_t drainbuf(int, unsigned char *, 

CVS commit: src/sys/arch/amd64

2017-02-06 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Feb  6 16:02:18 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: netbsd32_machdep.c
src/sys/arch/amd64/include: netbsd32_machdep.h

Log Message:
Add the USER_LDT sysarch options in netbsd32. We don't translate 'desc',
since if we ever implement USER_LDT we will only allow 8-byte-sized
entries, which have the same layout on amd64 and i386.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amd64/include/netbsd32_machdep.h

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

Modified files:

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.99 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.100
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.99	Sun Feb  5 08:52:11 2017
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Mon Feb  6 16:02:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.99 2017/02/05 08:52:11 maxv Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.100 2017/02/06 16:02:17 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.99 2017/02/05 08:52:11 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.100 2017/02/06 16:02:17 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_mac
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -83,6 +84,14 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_mac
 const char	machine32[] = "i386";
 const char	machine_arch32[] = "i386";	
 
+#ifdef USER_LDT
+static int x86_64_get_ldt32(struct lwp *, void *, register_t *);
+static int x86_64_set_ldt32(struct lwp *, void *, register_t *);
+#else
+#define x86_64_get_ldt32(x, y, z)	ENOSYS
+#define x86_64_set_ldt32(x, y, z)	ENOSYS
+#endif
+
 #ifdef MTRR
 static int x86_64_get_mtrr32(struct lwp *, void *, register_t *);
 static int x86_64_set_mtrr32(struct lwp *, void *, register_t *);
@@ -575,6 +584,14 @@ netbsd32_sysarch(struct lwp *l, const st
 		error = x86_iopl(l,
 		NETBSD32PTR64(SCARG(uap, parms)), retval);
 		break;
+	case X86_GET_LDT: 
+		error = x86_64_get_ldt32(l,
+		NETBSD32PTR64(SCARG(uap, parms)), retval);
+		break;
+	case X86_SET_LDT: 
+		error = x86_64_set_ldt32(l,
+		NETBSD32PTR64(SCARG(uap, parms)), retval);
+		break;
 	case X86_GET_MTRR:
 		error = x86_64_get_mtrr32(l,
 		NETBSD32PTR64(SCARG(uap, parms)), retval);
@@ -590,6 +607,70 @@ netbsd32_sysarch(struct lwp *l, const st
 	return error;
 }
 
+#ifdef USER_LDT
+static int
+x86_64_set_ldt32(struct lwp *l, void *args, register_t *retval)
+{
+	struct x86_set_ldt_args32 ua32;
+	struct x86_set_ldt_args ua;
+	union descriptor *descv;
+	int error;
+
+	if ((error = copyin(args, , sizeof(ua32))) != 0)
+		return (error);
+
+	ua.start = ua32.start;
+	ua.num = ua32.num;
+
+	if (ua.num < 0 || ua.num > 8192)
+		return EINVAL;
+
+	descv = malloc(sizeof(*descv) * ua.num, M_TEMP, M_NOWAIT);
+	if (descv == NULL)
+		return ENOMEM;
+
+	error = copyin((void *)(uintptr_t)ua32.desc, descv,
+	sizeof(*descv) * ua.num);
+	if (error == 0)
+		error = x86_set_ldt1(l, , descv);
+	*retval = ua.start;
+
+	free(descv, M_TEMP);
+	return error;
+}
+
+static int
+x86_64_get_ldt32(struct lwp *l, void *args, register_t *retval)
+{
+	struct x86_get_ldt_args32 ua32;
+	struct x86_get_ldt_args ua;
+	union descriptor *cp;
+	int error;
+
+	if ((error = copyin(args, , sizeof(ua32))) != 0)
+		return error;
+
+	ua.start = ua32.start;
+	ua.num = ua32.num;
+
+	if (ua.num < 0 || ua.num > 8192)
+		return EINVAL;
+
+	cp = malloc(ua.num * sizeof(union descriptor), M_TEMP, M_WAITOK);
+	if (cp == NULL)
+		return ENOMEM;
+
+	error = x86_get_ldt1(l, , cp);
+	*retval = ua.num;
+	if (error == 0)
+		error = copyout(cp, (void *)(uintptr_t)ua32.desc,
+		ua.num * sizeof(*cp));
+
+	free(cp, M_TEMP);
+	return error;
+}
+#endif
+
 #ifdef MTRR
 static int
 x86_64_get_mtrr32(struct lwp *l, void *args, register_t *retval)

Index: src/sys/arch/amd64/include/netbsd32_machdep.h
diff -u src/sys/arch/amd64/include/netbsd32_machdep.h:1.20 src/sys/arch/amd64/include/netbsd32_machdep.h:1.21
--- src/sys/arch/amd64/include/netbsd32_machdep.h:1.20	Wed Oct 19 09:44:00 2016
+++ src/sys/arch/amd64/include/netbsd32_machdep.h	Mon Feb  6 16:02:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.h,v 1.20 2016/10/19 09:44:00 skrll Exp $	*/
+/*	$NetBSD: netbsd32_machdep.h,v 1.21 2017/02/06 16:02:17 maxv Exp $	*/
 
 #ifndef _MACHINE_NETBSD32_H_
 #define _MACHINE_NETBSD32_H_
@@ -114,6 +114,18 @@ struct fpreg32 {
 	char	__data[108];
 };
 
+struct x86_get_ldt_args32 {
+	int32_t start;
+	uint32_t desc;
+	int32_t num;
+};
+
+struct x86_set_ldt_args32 {
+	int32_t start;
+	uint32_t desc;
+	int32_t num;
+};
+
 struct mtrr32 {
 	uint64_t 

CVS import: src/usr.bin/nc

2017-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Feb  6 16:00:51 UTC 2017

Update of /cvsroot/src/usr.bin/nc
In directory ivanova.netbsd.org:/tmp/cvs-serv29840

Log Message:
Import OpenBSD's netcat.

Status:

Vendor Tag: OPENBSD
Release Tags:   openbsd-20170206

N src/usr.bin/nc/atomicio.c
N src/usr.bin/nc/atomicio.h
N src/usr.bin/nc/nc.1
N src/usr.bin/nc/netcat.c
N src/usr.bin/nc/socks.c
N src/usr.bin/nc/Makefile
N src/usr.bin/nc/.gdbinit

No conflicts created by this import



CVS commit: [nick-nhusb] src/sys/dev/usb

2017-02-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb  6 10:20:01 UTC 2017

Modified Files:
src/sys/dev/usb [nick-nhusb]: if_smsc.c

Log Message:
Remove useless checks


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.34 -r1.22.2.35 src/sys/dev/usb/if_smsc.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/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.22.2.34 src/sys/dev/usb/if_smsc.c:1.22.2.35
--- src/sys/dev/usb/if_smsc.c:1.22.2.34	Mon Feb  6 09:08:48 2017
+++ src/sys/dev/usb/if_smsc.c	Mon Feb  6 10:20:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.22.2.34 2017/02/06 09:08:48 skrll Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.22.2.35 2017/02/06 10:20:01 skrll Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -318,8 +318,7 @@ smsc_miibus_statchg(struct ifnet *ifp)
 	uint32_t flow;
 	uint32_t afc_cfg;
 
-	if (mii == NULL || ifp == NULL ||
-	(ifp->if_flags & IFF_RUNNING) == 0)
+	if ((ifp->if_flags & IFF_RUNNING) == 0)
 		return;
 
 	/* Use the MII status to determine link status */
@@ -1236,9 +1235,6 @@ smsc_tick_task(void *xsc)
 
 	struct ifnet * const ifp = >sc_ec.ec_if;
 	struct mii_data	* const mii = >sc_mii;
-	if (mii == NULL)
-		return;
-
 	const int s = splnet();
 
 	mii_tick(mii);



CVS commit: [nick-nhusb] src/sys/dev/usb

2017-02-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb  6 09:08:48 UTC 2017

Modified Files:
src/sys/dev/usb [nick-nhusb]: if_smsc.c

Log Message:
Sprinkle const and reduce scope of a couple of variables.


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.33 -r1.22.2.34 src/sys/dev/usb/if_smsc.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/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.22.2.33 src/sys/dev/usb/if_smsc.c:1.22.2.34
--- src/sys/dev/usb/if_smsc.c:1.22.2.33	Mon Feb  6 09:02:38 2017
+++ src/sys/dev/usb/if_smsc.c	Mon Feb  6 09:08:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.22.2.33 2017/02/06 09:02:38 skrll Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.22.2.34 2017/02/06 09:08:48 skrll Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -1283,14 +1283,11 @@ smsc_unlock_mii(struct smsc_softc *sc)
 void
 smsc_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
 {
-	struct smsc_chain *c = (struct smsc_chain *)priv;
-	struct smsc_softc *sc = c->sc_sc;
-	struct ifnet *ifp = >sc_ec.ec_if;
+	struct smsc_chain * const c = (struct smsc_chain *)priv;
+	struct smsc_softc * const sc = c->sc_sc;
+	struct ifnet * const ifp = >sc_ec.ec_if;
 	u_char *buf = c->sc_buf;
 	uint32_t total_len;
-	uint32_t rxhdr;
-	uint16_t pktlen;
-	struct mbuf *m;
 
 	mutex_enter(>sc_rxlock);
 
@@ -1322,6 +1319,7 @@ smsc_rxeof(struct usbd_xfer *xfer, void 
 	smsc_dbg_printf(sc, "xfer status total_len %d\n", total_len);
 
 	while (total_len != 0) {
+		uint32_t rxhdr;
 		if (total_len < sizeof(rxhdr)) {
 			smsc_dbg_printf(sc, "total_len %d < sizeof(rxhdr) %zu\n",
 			total_len, sizeof(rxhdr));
@@ -1345,7 +1343,7 @@ smsc_rxeof(struct usbd_xfer *xfer, void 
 			goto done;
 		}
 
-		pktlen = (uint16_t)SMSC_RX_STAT_FRM_LENGTH(rxhdr);
+		uint16_t pktlen = (uint16_t)SMSC_RX_STAT_FRM_LENGTH(rxhdr);
 		smsc_dbg_printf(sc, "rxeof total_len %d pktlen %d rxhdr "
 		"0x%08x\n", total_len, pktlen, rxhdr);
 
@@ -1372,7 +1370,7 @@ smsc_rxeof(struct usbd_xfer *xfer, void 
 			goto done;
 		}
 
-		m = smsc_newbuf();
+		struct mbuf *m = smsc_newbuf();
 		if (m == NULL) {
 			smsc_dbg_printf(sc, "smc_newbuf returned NULL\n");
 			ifp->if_ierrors++;



CVS commit: [nick-nhusb] src/sys/dev/usb

2017-02-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb  6 09:02:38 UTC 2017

Modified Files:
src/sys/dev/usb [nick-nhusb]: if_smsc.c

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.32 -r1.22.2.33 src/sys/dev/usb/if_smsc.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/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.22.2.32 src/sys/dev/usb/if_smsc.c:1.22.2.33
--- src/sys/dev/usb/if_smsc.c:1.22.2.32	Sun Feb  5 13:40:46 2017
+++ src/sys/dev/usb/if_smsc.c	Mon Feb  6 09:02:38 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.22.2.32 2017/02/05 13:40:46 skrll Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.22.2.33 2017/02/06 09:02:38 skrll Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -422,10 +422,10 @@ void
 smsc_setmulti(struct smsc_softc *sc)
 {
 	struct ifnet * const ifp = >sc_ec.ec_if;
-	struct ether_multi	*enm;
-	struct ether_multistep	 step;
-	uint32_t		 hashtbl[2] = { 0, 0 };
-	uint32_t		 hash;
+	struct ether_multi *enm;
+	struct ether_multistep step;
+	uint32_t hashtbl[2] = { 0, 0 };
+	uint32_t hash;
 
 	if (sc->sc_dying)
 		return;
@@ -966,8 +966,8 @@ out:
 int
 smsc_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
-	struct smsc_softc	*sc = ifp->if_softc;
-	int			s, error = 0;
+	struct smsc_softc *sc = ifp->if_softc;
+	int s, error = 0;
 
 	if (sc->sc_dying)
 		return EIO;
@@ -1283,14 +1283,14 @@ smsc_unlock_mii(struct smsc_softc *sc)
 void
 smsc_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
 {
-	struct smsc_chain	*c = (struct smsc_chain *)priv;
-	struct smsc_softc	*sc = c->sc_sc;
-	struct ifnet		*ifp = >sc_ec.ec_if;
-	u_char			*buf = c->sc_buf;
-	uint32_t		total_len;
-	uint32_t		rxhdr;
-	uint16_t		pktlen;
-	struct mbuf		*m;
+	struct smsc_chain *c = (struct smsc_chain *)priv;
+	struct smsc_softc *sc = c->sc_sc;
+	struct ifnet *ifp = >sc_ec.ec_if;
+	u_char *buf = c->sc_buf;
+	uint32_t total_len;
+	uint32_t rxhdr;
+	uint16_t pktlen;
+	struct mbuf *m;
 
 	mutex_enter(>sc_rxlock);
 
@@ -1595,7 +1595,7 @@ smsc_rx_list_free(struct smsc_softc *sc)
 struct mbuf *
 smsc_newbuf(void)
 {
-	struct mbuf	*m;
+	struct mbuf *m;
 
 	MGETHDR(m, M_DONTWAIT, MT_DATA);
 	if (m == NULL)