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

2017-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 25 07:49:23 UTC 2017

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

Log Message:
Remove debug printf()s.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 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.64 src/sys/dev/pci/ixgbe/ixgbe.c:1.65
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.64	Wed Jan 25 07:46:53 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jan 25 07:49:23 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.64 2017/01/25 07:46:53 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.65 2017/01/25 07:49:23 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -3961,7 +3961,7 @@ ixgbe_handle_mod(void *context)
 	u32 err;
 
 	IXGBE_CORE_LOCK(adapter);
-	printf("%s: called\n", __func__);
+
 	/* Check to see if the PHY type changed */
 	if (hw->phy.ops.identify) {
 		hw->phy.type = ixgbe_phy_unknown;
@@ -4036,7 +4036,6 @@ ixgbe_handle_msf(void *context)
 	bool negotiate;
 
 	IXGBE_CORE_LOCK(adapter);
-	printf("%s: called\n", __func__);
 	/* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */
 	adapter->phy_layer = ixgbe_get_supported_physical_layer(hw);
 



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

2017-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 25 07:46:53 UTC 2017

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

Log Message:
 Fix SFP+ insersion or replacement stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/ixgbe/ixgbe.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.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.63 src/sys/dev/pci/ixgbe/ixgbe.c:1.64
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.63	Thu Jan 19 09:42:08 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jan 25 07:46:53 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.63 2017/01/19 09:42:08 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.64 2017/01/25 07:46:53 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1799,12 +1799,12 @@ ixgbe_msix_link(void *arg)
 		mod_mask = IXGBE_EICR_GPI_SDP2_BY_MAC(hw);
 
 	if (ixgbe_is_sfp(hw)) {
-		if (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw)) {
-			IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
-			softint_schedule(adapter->msf_si);
-		} else if (reg_eicr & mod_mask) {
+		if (reg_eicr & mod_mask) {
 			IXGBE_WRITE_REG(hw, IXGBE_EICR, mod_mask);
 			softint_schedule(adapter->mod_si);
+		} else if (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw)) {
+			IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
+			softint_schedule(adapter->msf_si);
 		}
 	}
 
@@ -3961,7 +3961,7 @@ ixgbe_handle_mod(void *context)
 	u32 err;
 
 	IXGBE_CORE_LOCK(adapter);
-
+	printf("%s: called\n", __func__);
 	/* Check to see if the PHY type changed */
 	if (hw->phy.ops.identify) {
 		hw->phy.type = ixgbe_phy_unknown;
@@ -3996,8 +3996,6 @@ ixgbe_handle_mod(void *context)
 		"Setup failure - unsupported SFP+ module type.\n");
 		goto out;
 	}
-	if (hw->phy.multispeed_fiber)
-		softint_schedule(adapter->msf_si);
 out:
 	/* Update media type */
 	switch (hw->mac.ops.get_media_type(hw)) {
@@ -4015,6 +4013,12 @@ out:
 			break;
 	}
 
+	/* Adjust media types shown in ifconfig */
+	ifmedia_removeall(>media);
+	ixgbe_add_media_types(adapter);
+	ifmedia_set(>media, IFM_ETHER | IFM_AUTO);
+
+	softint_schedule(adapter->msf_si);
 	IXGBE_CORE_UNLOCK(adapter);
 	return;
 }
@@ -4032,6 +4036,7 @@ ixgbe_handle_msf(void *context)
 	bool negotiate;
 
 	IXGBE_CORE_LOCK(adapter);
+	printf("%s: called\n", __func__);
 	/* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */
 	adapter->phy_layer = ixgbe_get_supported_physical_layer(hw);
 
@@ -4043,9 +4048,6 @@ ixgbe_handle_msf(void *context)
 	if (hw->mac.ops.setup_link)
 		hw->mac.ops.setup_link(hw, autoneg, TRUE);
 
-	/* Adjust media types shown in ifconfig */
-	ifmedia_removeall(>media);
-	ixgbe_add_media_types(adapter);
 	IXGBE_CORE_UNLOCK(adapter);
 	return;
 }

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.19 src/sys/dev/pci/ixgbe/ixgbe.h:1.20
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.19	Wed Jan 18 10:18:40 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Wed Jan 25 07:46:53 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 303890 2016-08-09 19:32:06Z dumbbell $*/
-/*$NetBSD: ixgbe.h,v 1.19 2017/01/18 10:18:40 msaitoh Exp $*/
+/*$NetBSD: ixgbe.h,v 1.20 2017/01/25 07:46:53 msaitoh Exp $*/
 
 
 #ifndef _IXGBE_H_
@@ -698,14 +698,20 @@ ixgbe_is_sfp(struct ixgbe_hw *hw)
 	case ixgbe_phy_sfp_unknown:
 	case ixgbe_phy_sfp_passive_tyco:
 	case ixgbe_phy_sfp_passive_unknown:
+	case ixgbe_phy_sfp_unsupported:
 	case ixgbe_phy_qsfp_passive_unknown:
 	case ixgbe_phy_qsfp_active_unknown:
 	case ixgbe_phy_qsfp_intel:
 	case ixgbe_phy_qsfp_unknown:
 		return TRUE;
 	default:
-		return FALSE;
+		break;
 	}
+
+	if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)
+		return TRUE;
+
+	return FALSE;
 }
 
 /* Workaround to make 8.0 buildable */



CVS commit: src/sys/net

2017-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 25 07:19:24 UTC 2017

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

Log Message:
ifmedia_removeall(): Clear ifm_cur and ifm_media after removing all ifmedia
entries.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/net/if_media.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_media.c
diff -u src/sys/net/if_media.c:1.31 src/sys/net/if_media.c:1.32
--- src/sys/net/if_media.c:1.31	Wed Jan 25 07:17:19 2017
+++ src/sys/net/if_media.c	Wed Jan 25 07:19:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media.c,v 1.31 2017/01/25 07:17:19 msaitoh Exp $	*/
+/*	$NetBSD: if_media.c,v 1.32 2017/01/25 07:19:24 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.31 2017/01/25 07:17:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.32 2017/01/25 07:19:24 msaitoh Exp $");
 
 #include 
 #include 
@@ -419,6 +419,8 @@ ifmedia_removeall(struct ifmedia *ifm)
 		TAILQ_REMOVE(>ifm_list, ife, ifm_list);
 		free(ife, M_IFMEDIA);
 	}
+	ifm->ifm_cur = NULL;
+	ifm->ifm_media = IFM_NONE;
 }
 
 



CVS commit: src/sys/net

2017-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 25 07:17:19 UTC 2017

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

Log Message:
ifmedia_init(): Clear ifm_media with IFM_NONE instead of 0.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/net/if_media.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_media.c
diff -u src/sys/net/if_media.c:1.30 src/sys/net/if_media.c:1.31
--- src/sys/net/if_media.c:1.30	Mon Oct  5 21:27:36 2009
+++ src/sys/net/if_media.c	Wed Jan 25 07:17:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media.c,v 1.30 2009/10/05 21:27:36 dyoung Exp $	*/
+/*	$NetBSD: if_media.c,v 1.31 2017/01/25 07:17:19 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.30 2009/10/05 21:27:36 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.31 2017/01/25 07:17:19 msaitoh Exp $");
 
 #include 
 #include 
@@ -113,7 +113,7 @@ ifmedia_init(struct ifmedia *ifm, int do
 
 	TAILQ_INIT(>ifm_list);
 	ifm->ifm_cur = NULL;
-	ifm->ifm_media = 0;
+	ifm->ifm_media = IFM_NONE;
 	ifm->ifm_mask = dontcare_mask;		/* IF don't-care bits */
 	ifm->ifm_change = change_callback;
 	ifm->ifm_status = status_callback;



CVS commit: src/sys/dev/pci

2017-01-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 25 06:33:52 UTC 2017

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

Log Message:
auich_round_blocksize: never return 0 as blocksize


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/pci/auich.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/auich.c
diff -u src/sys/dev/pci/auich.c:1.149 src/sys/dev/pci/auich.c:1.150
--- src/sys/dev/pci/auich.c:1.149	Thu Jul  7 06:55:41 2016
+++ src/sys/dev/pci/auich.c	Wed Jan 25 06:33:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: auich.c,v 1.149 2016/07/07 06:55:41 msaitoh Exp $	*/
+/*	$NetBSD: auich.c,v 1.150 2017/01/25 06:33:52 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2008 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.149 2016/07/07 06:55:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.150 2017/01/25 06:33:52 martin Exp $");
 
 #include 
 #include 
@@ -1068,6 +1068,9 @@ auich_round_blocksize(void *v, int blk, 
 const audio_params_t *param)
 {
 
+	if (blk < 0x40)
+		return 0x40;		/* avoid 0 block size */
+
 	return blk & ~0x3f;		/* keep good alignment */
 }
 



CVS commit: src/share/misc

2017-01-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jan 25 03:23:29 UTC 2017

Modified Files:
src/share/misc: acronyms-o.real

Log Message:
Add "SOS"


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/misc/acronyms-o.real

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

Modified files:

Index: src/share/misc/acronyms-o.real
diff -u src/share/misc/acronyms-o.real:1.2 src/share/misc/acronyms-o.real:1.3
--- src/share/misc/acronyms-o.real:1.2	Fri Apr 24 18:03:38 2015
+++ src/share/misc/acronyms-o.real	Wed Jan 25 03:23:29 2017
@@ -1,4 +1,4 @@
-# $NetBSD: acronyms-o.real,v 1.2 2015/04/24 18:03:38 riastradh Exp $
+# $NetBSD: acronyms-o.real,v 1.3 2017/01/25 03:23:29 pgoyette Exp $
 AFU	all fucked up
 B/S	bullshit
 BAMF	bad-ass motherfucker
@@ -53,6 +53,7 @@ SFA	sweet fuck all
 SNAFU	situation normal, all fucked up
 SNCA	shit no one cares about
 SOL	shit out [of] luck
+SOS	same old shit
 STFA	search the fucking archives
 STFU	shut the fuck up
 STFW	search the fucking web



CVS commit: src/sys/net

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 25 03:04:22 UTC 2017

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

Log Message:
fix locking against myself in module autoload; module autoload calls
if_clone_attach which takes the lock again.


To generate a diff of this commit:
cvs rdiff -u -r1.374 -r1.375 src/sys/net/if.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.c
diff -u src/sys/net/if.c:1.374 src/sys/net/if.c:1.375
--- src/sys/net/if.c:1.374	Tue Jan 24 02:58:58 2017
+++ src/sys/net/if.c	Tue Jan 24 22:04:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.374 2017/01/24 07:58:58 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.375 2017/01/25 03:04:21 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.374 2017/01/24 07:58:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.375 2017/01/25 03:04:21 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1619,8 +1619,13 @@ again:
 	}
 
 	if (ifc == NULL) {
-		if (*ifname == '\0' ||
-		module_autoload(ifname, MODULE_CLASS_DRIVER))
+		int error;
+		if (*ifname == '\0')
+			return NULL;
+		mutex_exit(_clone_mtx);
+		error = module_autoload(ifname, MODULE_CLASS_DRIVER);
+		mutex_enter(_clone_mtx);
+		if (error)
 			return NULL;
 		*ifname = '\0';
 		goto again;



CVS commit: src/sys/net

2017-01-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jan 25 01:04:23 UTC 2017

Modified Files:
src/sys/net: bpf.c bpf.h bpf_stub.c

Log Message:
Use bpf_ops for bpf_mtap_softint

By doing so we don't need to care whether a kernel enables bpfilter or not.


To generate a diff of this commit:
cvs rdiff -u -r1.205 -r1.206 src/sys/net/bpf.c
cvs rdiff -u -r1.68 -r1.69 src/sys/net/bpf.h
cvs rdiff -u -r1.6 -r1.7 src/sys/net/bpf_stub.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/bpf.c
diff -u src/sys/net/bpf.c:1.205 src/sys/net/bpf.c:1.206
--- src/sys/net/bpf.c:1.205	Tue Jan 24 09:05:28 2017
+++ src/sys/net/bpf.c	Wed Jan 25 01:04:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.205 2017/01/24 09:05:28 ozaki-r Exp $	*/
+/*	$NetBSD: bpf.c,v 1.206 2017/01/25 01:04:23 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.205 2017/01/24 09:05:28 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.206 2017/01/25 01:04:23 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -1666,15 +1666,16 @@ bpf_mtap_si(void *arg)
 	}
 }
 
-void
-bpf_mtap_softint(struct ifnet *ifp, struct mbuf *m)
+static void
+_bpf_mtap_softint(struct ifnet *ifp, struct mbuf *m)
 {
 	struct bpf_if *bp = ifp->if_bpf;
 	struct mbuf *dup;
 
 	KASSERT(cpu_intr_p());
 
-	if (bp == NULL || bp->bif_dlist == NULL)
+	/* To avoid extra invocations of the softint */
+	if (bp->bif_dlist == NULL)
 		return;
 	KASSERT(bp->bif_si != NULL);
 
@@ -1893,8 +1894,8 @@ _bpfattach(struct ifnet *ifp, u_int dlt,
 #endif
 }
 
-void
-bpf_mtap_softint_init(struct ifnet *ifp)
+static void
+_bpf_mtap_softint_init(struct ifnet *ifp)
 {
 	struct bpf_if *bp;
 
@@ -2227,6 +2228,9 @@ struct bpf_ops bpf_ops_kernel = {
 	.bpf_mtap_af =		_bpf_mtap_af,
 	.bpf_mtap_sl_in =	_bpf_mtap_sl_in,
 	.bpf_mtap_sl_out =	_bpf_mtap_sl_out,
+
+	.bpf_mtap_softint =		_bpf_mtap_softint,
+	.bpf_mtap_softint_init =	_bpf_mtap_softint_init,
 };
 
 MODULE(MODULE_CLASS_DRIVER, bpf, "bpf_filter");

Index: src/sys/net/bpf.h
diff -u src/sys/net/bpf.h:1.68 src/sys/net/bpf.h:1.69
--- src/sys/net/bpf.h:1.68	Tue Jan 24 09:05:28 2017
+++ src/sys/net/bpf.h	Wed Jan 25 01:04:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.h,v 1.68 2017/01/24 09:05:28 ozaki-r Exp $	*/
+/*	$NetBSD: bpf.h,v 1.69 2017/01/25 01:04:23 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -423,6 +423,9 @@ struct bpf_ops {
 	void (*bpf_mtap_af)(struct bpf_if *, uint32_t, struct mbuf *);
 	void (*bpf_mtap_sl_in)(struct bpf_if *, u_char *, struct mbuf **);
 	void (*bpf_mtap_sl_out)(struct bpf_if *, u_char *, struct mbuf *);
+
+	void (*bpf_mtap_softint_init)(struct ifnet *);
+	void (*bpf_mtap_softint)(struct ifnet *, struct mbuf *);
 };
 
 extern struct bpf_ops *bpf_ops;
@@ -498,6 +501,20 @@ bpf_mtap_sl_out(struct ifnet *_ifp, u_ch
 		bpf_ops->bpf_mtap_sl_out(_ifp->if_bpf, _hdr, _m);
 }
 
+static inline void
+bpf_mtap_softint_init(struct ifnet *_ifp)
+{
+
+	bpf_ops->bpf_mtap_softint_init(_ifp);
+}
+
+static inline void
+bpf_mtap_softint(struct ifnet *_ifp, struct mbuf *_m)
+{
+
+	if (_ifp->if_bpf)
+		bpf_ops->bpf_mtap_softint(_ifp, _m);
+}
 
 void	bpf_setops(void);
 
@@ -517,9 +534,6 @@ int	bpf_validate_ext(const bpf_ctx_t *, 
 bpfjit_func_t bpf_jit_generate(bpf_ctx_t *, void *, size_t);
 void	bpf_jit_freecode(bpfjit_func_t);
 
-void	bpf_mtap_softint_init(struct ifnet *);
-void	bpf_mtap_softint(struct ifnet *, struct mbuf *);
-
 #endif
 
 int	bpf_validate(const struct bpf_insn *, int);

Index: src/sys/net/bpf_stub.c
diff -u src/sys/net/bpf_stub.c:1.6 src/sys/net/bpf_stub.c:1.7
--- src/sys/net/bpf_stub.c:1.6	Mon Jan 30 23:31:27 2012
+++ src/sys/net/bpf_stub.c	Wed Jan 25 01:04:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf_stub.c,v 1.6 2012/01/30 23:31:27 matt Exp $	*/
+/*	$NetBSD: bpf_stub.c,v 1.7 2017/01/25 01:04:23 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf_stub.c,v 1.6 2012/01/30 23:31:27 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf_stub.c,v 1.7 2017/01/25 01:04:23 ozaki-r Exp $");
 
 #include 
 #include 
@@ -67,6 +67,9 @@ struct bpf_ops bpf_ops_stub = {
 	.bpf_mtap_af = 		(void *)bpf_stub_warn,
 	.bpf_mtap_sl_in = 	(void *)bpf_stub_warn,
 	.bpf_mtap_sl_out =	(void *)bpf_stub_warn,
+
+	.bpf_mtap_softint_init =	(void *)bpf_stub_null,
+	.bpf_mtap_softint =		(void *)bpf_stub_warn,
 };
 struct bpf_ops *bpf_ops;
 



CVS commit: src/doc

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 23:31:03 UTC 2017

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new tcpdump/libpcap


To generate a diff of this commit:
cvs rdiff -u -r1.1400 -r1.1401 src/doc/3RDPARTY
cvs rdiff -u -r1.2237 -r1.2238 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.1400 src/doc/3RDPARTY:1.1401
--- src/doc/3RDPARTY:1.1400	Sun Jan 22 17:26:16 2017
+++ src/doc/3RDPARTY	Tue Jan 24 18:31:03 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1400 2017/01/22 22:26:16 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1401 2017/01/24 23:31:03 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -779,8 +779,8 @@ libdevmapper ioctl protocol code, theref
 import. Talk to haad before importing new version.
 
 Package:	libpcap
-Version:	1.7.2
-Current Vers:	1.7.2
+Version:	1.8.1
+Current Vers:	1.8.1
 Maintainer:	tcpdump-work...@tcpdump.org
 Archive Site:	http://www.tcpdump.org/release/
 Home Page:	http://www.tcpdump.org/
@@ -1296,8 +1296,8 @@ Notes:
 Run cleantags before importing because sqlite3.c has an RCSID
 
 Package:	tcpdump
-Version:	4.7.3
-Current Vers:	4.7.3
+Version:	4.8.1
+Current Vers:	4.8.1
 Maintainer:	tcpdump-work...@lists.tcpdump.org
 Archive Site:	http://www.tcpdump.org/release/
 Home Page:	http://www.tcpdump.org/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2237 src/doc/CHANGES:1.2238
--- src/doc/CHANGES:1.2237	Sat Jan 14 01:51:02 2017
+++ src/doc/CHANGES	Tue Jan 24 18:31:03 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2237 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2238 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -452,3 +452,5 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	ptrace(2): Add new options in EVENT_MASK: PTRACE_LWP_CREATE and
 		PTRACE_LWP_EXIT [kamil 20170114]
 	siginfo(2): Add new si_code for SIGTRAP: TRAP_LWP [kamil 20170114]
+	libpcap: Import 1.8.1. [christos 20170124]
+	tcpdump(8): Import 4.8.1. [christos 20170124]



CVS commit: src/external/bsd/libpcap/lib

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 23:26:58 UTC 2017

Modified Files:
src/external/bsd/libpcap/lib: Makefile

Log Message:
add another header file


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/libpcap/lib/Makefile

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

Modified files:

Index: src/external/bsd/libpcap/lib/Makefile
diff -u src/external/bsd/libpcap/lib/Makefile:1.14 src/external/bsd/libpcap/lib/Makefile:1.15
--- src/external/bsd/libpcap/lib/Makefile:1.14	Tue Jan 24 17:37:31 2017
+++ src/external/bsd/libpcap/lib/Makefile	Tue Jan 24 18:26:58 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2017/01/24 22:37:31 christos Exp $	
+# $NetBSD: Makefile,v 1.15 2017/01/24 23:26:58 christos Exp $	
 
 USE_SHLIBDIR=yes
 .include 
@@ -142,7 +142,7 @@ SRCS=	scanner.l savefile.c pcap.c pcap-b
 .PATH:	${NETBSDSRCDIR}/sys/net
 SRCS+=	bpf_filter.c
 
-INCS=		pcap/pcap.h pcap/namedb.h
+INCS=		pcap/pcap.h pcap/namedb.h pcap/export-defs.h
 INCSDIR=	/usr/include
 INCSYMLINKS+=   ../net/bpf.h ${INCSDIR}/pcap/bpf.h
 INCSYMLINKS+=	pcap/pcap.h ${INCSDIR}/pcap.h



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

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 23:27:52 UTC 2017

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

Log Message:
Add another pcap header.


To generate a diff of this commit:
cvs rdiff -u -r1.2103 -r1.2104 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2103 src/distrib/sets/lists/comp/mi:1.2104
--- src/distrib/sets/lists/comp/mi:1.2103	Tue Jan 24 12:27:30 2017
+++ src/distrib/sets/lists/comp/mi	Tue Jan 24 18:27:52 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2103 2017/01/24 17:27:30 roy Exp $
+#	$NetBSD: mi,v 1.2104 2017/01/24 23:27:52 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -2595,6 +2595,7 @@
 ./usr/include/pcap-namedb.h			comp-c-include
 ./usr/include/pcap.hcomp-c-include
 ./usr/include/pcap/bpf.h			comp-c-include
+./usr/include/pcap/export-defs.h		comp-c-include
 ./usr/include/pcap/namedb.h			comp-c-include
 ./usr/include/pcap/pcap.h			comp-c-include
 ./usr/include/pci.hcomp-c-include



CVS commit: src/external/bsd/libpcap/lib

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 22:37:31 UTC 2017

Modified Files:
src/external/bsd/libpcap/lib: Makefile

Log Message:
Add more files


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/libpcap/lib/Makefile

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

Modified files:

Index: src/external/bsd/libpcap/lib/Makefile
diff -u src/external/bsd/libpcap/lib/Makefile:1.13 src/external/bsd/libpcap/lib/Makefile:1.14
--- src/external/bsd/libpcap/lib/Makefile:1.13	Tue Jan 24 17:29:29 2017
+++ src/external/bsd/libpcap/lib/Makefile	Tue Jan 24 17:37:31 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2017/01/24 22:29:29 christos Exp $	
+# $NetBSD: Makefile,v 1.14 2017/01/24 22:37:31 christos Exp $	
 
 USE_SHLIBDIR=yes
 .include 
@@ -136,7 +136,8 @@ CPPFLAGS+=	-DINET6
 
 SRCS=	scanner.l savefile.c pcap.c pcap-bpf.c optimize.c nametoaddr.c \
 	inet.c grammar.y gencode.c fad-getad.c etherent.c bpf_image.c \
-	bpf_dump.c version.c sf-pcap-ng.c sf-pcap.c pcap-common.c
+	bpf_dump.c pcap_version.c sf-pcap-ng.c sf-pcap.c pcap-common.c \
+	fad-getad.c fad-helpers.c
 
 .PATH:	${NETBSDSRCDIR}/sys/net
 SRCS+=	bpf_filter.c



CVS commit: src/distrib/sets/lists

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 22:30:53 UTC 2017

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

Log Message:
bump libpcap.


To generate a diff of this commit:
cvs rdiff -u -r1.796 -r1.797 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.155 -r1.156 src/distrib/sets/lists/debug/shl.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/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.796 src/distrib/sets/lists/base/shl.mi:1.797
--- src/distrib/sets/lists/base/shl.mi:1.796	Mon Jan  2 07:38:16 2017
+++ src/distrib/sets/lists/base/shl.mi	Tue Jan 24 17:30:53 2017
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.796 2017/01/02 12:38:16 roy Exp $
+# $NetBSD: shl.mi,v 1.797 2017/01/24 22:30:53 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -59,8 +59,8 @@
 ./lib/libnpf.so.0base-npf-shlib		dynamicroot,npf
 ./lib/libnpf.so.0.1base-npf-shlib		dynamicroot,npf
 ./lib/libpcap.sobase-sys-shlib		dynamicroot
-./lib/libpcap.so.5base-sys-shlib		dynamicroot
-./lib/libpcap.so.5.1base-sys-shlib		dynamicroot
+./lib/libpcap.so.6base-sys-shlib		dynamicroot
+./lib/libpcap.so.6.0base-sys-shlib		dynamicroot
 ./lib/libppath.sobase-sys-shlib		dynamicroot
 ./lib/libppath.so.0base-sys-shlib		dynamicroot
 ./lib/libppath.so.0.0base-sys-shlib		dynamicroot
@@ -428,8 +428,8 @@
 ./usr/lib/libpanel.so.1base-sys-shlib		compatfile
 ./usr/lib/libpanel.so.1.0			base-sys-shlib		compatfile
 ./usr/lib/libpcap.sobase-net-shlib		compatfile
-./usr/lib/libpcap.so.5base-net-shlib		compatfile
-./usr/lib/libpcap.so.5.1			base-net-shlib		compatfile
+./usr/lib/libpcap.so.6base-net-shlib		compatfile
+./usr/lib/libpcap.so.6.0			base-net-shlib		compatfile
 ./usr/lib/libpci.sobase-sys-shlib		compatfile
 ./usr/lib/libpci.so.2base-sys-shlib		compatfile
 ./usr/lib/libpci.so.2.2base-sys-shlib		compatfile

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.155 src/distrib/sets/lists/debug/shl.mi:1.156
--- src/distrib/sets/lists/debug/shl.mi:1.155	Thu Jan  5 08:45:51 2017
+++ src/distrib/sets/lists/debug/shl.mi	Tue Jan 24 17:30:53 2017
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.155 2017/01/05 13:45:51 wiz Exp $
+# $NetBSD: shl.mi,v 1.156 2017/01/24 22:30:53 christos Exp $
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libblacklist.so.0.0.debug		comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libc.so.12.205.debug			comp-sys-debug	debug,dynamicroot
@@ -15,7 +15,7 @@
 ./usr/libdata/debug/lib/liblzma.so.2.0.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libm.so.0.11.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libnpf.so.0.1.debug			comp-sys-debug	debug,dynamicroot
-./usr/libdata/debug/lib/libpcap.so.5.1.debug			comp-sys-debug	debug,dynamicroot
+./usr/libdata/debug/lib/libpcap.so.6.0.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libppath.so.0.0.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libprop.so.1.1.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libradius.so.4.0.debug			comp-sys-debug	debug,dynamicroot
@@ -152,7 +152,7 @@
 ./usr/libdata/debug/usr/lib/libp2k.so.2.0.debug			comp-puffs-debug	debug,compatfile,rump
 ./usr/libdata/debug/usr/lib/libpam.so.4.0.debug			comp-sys-debug	debug,compatfile,pam
 ./usr/libdata/debug/usr/lib/libpanel.so.1.0.debug		comp-sys-debug	debug,compatfile
-./usr/libdata/debug/usr/lib/libpcap.so.5.1.debug		comp-net-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libpcap.so.6.0.debug		comp-net-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libpci.so.2.2.debug			comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libperfuse.so.0.0.debug		comp-perfuse-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libposix.so.0.1.debug		comp-sys-debug	debug,compatfile



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

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 22:28:42 UTC 2017

Modified Files:
src/external/bsd/byacc/dist: output.c

Log Message:
don't output extern YYSTYPE decl if pure_parser.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/byacc/dist/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/external/bsd/byacc/dist/output.c
diff -u src/external/bsd/byacc/dist/output.c:1.15 src/external/bsd/byacc/dist/output.c:1.16
--- src/external/bsd/byacc/dist/output.c:1.15	Sat Jan  9 17:05:33 2016
+++ src/external/bsd/byacc/dist/output.c	Tue Jan 24 17:28:42 2017
@@ -1,11 +1,11 @@
-/*	$NetBSD: output.c,v 1.15 2016/01/09 22:05:33 christos Exp $	*/
+/*	$NetBSD: output.c,v 1.16 2017/01/24 22:28:42 christos Exp $	*/
 
 /* Id: output.c,v 1.74 2014/10/05 23:21:09 tom Exp  */
 
 #include "defs.h"
 
 #include 
-__RCSID("$NetBSD: output.c,v 1.15 2016/01/09 22:05:33 christos Exp $");
+__RCSID("$NetBSD: output.c,v 1.16 2017/01/24 22:28:42 christos Exp $");
 
 #define StaticOrR	(rflag ? "" : "static ")
 #define CountLine(fp)   (!rflag || ((fp) == code_file))
@@ -1217,7 +1217,8 @@ output_defines(FILE * fp)
 		while ((c = getc(union_file)) != EOF)
 		putc_code(fp, c);
 	}
-	fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix);
+	if (!pure_parser)
+		fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix);
 	}
 }
 }



CVS commit: src/sys/net

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 22:12:42 UTC 2017

Modified Files:
src/sys/net: dlt.h

Log Message:
Sync with libpcap-1.8.1


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/net/dlt.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/dlt.h
diff -u src/sys/net/dlt.h:1.16 src/sys/net/dlt.h:1.17
--- src/sys/net/dlt.h:1.16	Tue Mar 31 17:42:16 2015
+++ src/sys/net/dlt.h	Tue Jan 24 17:12:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dlt.h,v 1.16 2015/03/31 21:42:16 christos Exp $	*/
+/*	$NetBSD: dlt.h,v 1.17 2017/01/24 22:12:42 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -38,8 +38,6 @@
  * SUCH DAMAGE.
  *
  *  @(#)bpf.h   7.1 (Berkeley) 5/7/91
- *
- * @(#) Header: /tcpdump/master/libpcap/pcap/bpf.h,v 1.32 2008-12-23 20:13:29 guy Exp  (LBL)
  */
 
 #ifndef _NET_DLT_H_
@@ -303,40 +301,62 @@
 /*
  * Sigh.
  *
- * This was reserved for Siemens HiPath HDLC on 2002-01-25, as
+ * 121 was reserved for Siemens HiPath HDLC on 2002-01-25, as
  * requested by Tomas Kukosa.
  *
  * On 2004-02-25, a FreeBSD checkin to sys/net/bpf.h was made that
- * assigned 121 as DLT_PFSYNC.  Its libpcap does DLT_ <-> LINKTYPE_
- * mapping, so it probably supports capturing on the pfsync device
- * but not saving the captured data to a pcap file.
+ * assigned 121 as DLT_PFSYNC.  In current versions, its libpcap
+ * does DLT_ <-> LINKTYPE_ mapping, mapping DLT_PFSYNC to a
+ * LINKTYPE_PFSYNC value of 246, so it should write out DLT_PFSYNC
+ * dump files with 246 as the link-layer header type.  (Earlier
+ * versions might not have done mapping, in which case they would
+ * have written them out with a link-layer header type of 121.)
  *
  * OpenBSD, from which pf came, however, uses 18 for DLT_PFSYNC;
- * their libpcap does no DLT_ <-> LINKTYPE_ mapping, so it would
- * use 18 in pcap files as well.
- *
- * NetBSD and DragonFly BSD also use 18 for DLT_PFSYNC; their
- * libpcaps do DLT_ <-> LINKTYPE_ mapping, and neither has an entry
- * for DLT_PFSYNC, so it might not be able to write out dump files
- * with 18 as the link-layer header type.  (Earlier versions might
- * not have done mapping, in which case they'd work the same way
- * OpenBSD does.)
- *
- * Mac OS X defines it as 18, but doesn't appear to use it as of
- * Mac OS X 10.7.3.  Its libpcap does DLT_ <-> LINKTYPE_ mapping.
- *
- * We'll define DLT_PFSYNC as 121 on FreeBSD and define it as 18 on
- * all other platforms.  We'll define DLT_HHDLC as 121 on everything
- * except for FreeBSD; anybody who wants to compile, on FreeBSD, code
- * that uses DLT_HHDLC is out of luck.
- *
- * We'll define LINKTYPE_PFSYNC as 18, *even on FreeBSD*, and map
- * it, so that savefiles won't use 121 for PFSYNC - they'll all
- * use 18.  Code that uses pcap_datalink() to determine the link-layer
- * header type of a savefile won't, when built and run on FreeBSD,
- * be able to distinguish between LINKTYPE_PFSYNC and LINKTYPE_HHDLC
- * capture files; code that doesn't, such as the code in Wireshark,
- * will be able to distinguish between them.
+ * its libpcap does no DLT_ <-> LINKTYPE_ mapping, so it would
+ * write out DLT_PFSYNC dump files with use 18 as the link-layer
+ * header type.
+ *
+ * NetBSD, DragonFly BSD, and Darwin also use 18 for DLT_PFSYNC; in
+ * current versions, their libpcaps do DLT_ <-> LINKTYPE_ mapping,
+ * mapping DLT_PFSYNC to a LINKTYPE_PFSYNC value of 246, so they
+ * should write out DLT_PFSYNC dump files with 246 as the link-layer
+ * header type.  (Earlier versions might not have done mapping,
+ * in which case they'd work the same way OpenBSD does, writing
+ * them out with a link-layer header type of 18.)
+ *
+ * We'll define DLT_PFSYNC as:
+ *
+ *18 on NetBSD, OpenBSD, DragonFly BSD, and Darwin;
+ *
+ *121 on FreeBSD;
+ *
+ *246 everywhere else.
+ *
+ * We'll define DLT_HHDLC as 121 on everything except for FreeBSD;
+ * anybody who wants to compile, on FreeBSD, code that uses DLT_HHDLC
+ * is out of luck.
+ *
+ * We'll define LINKTYPE_PFSYNC as 246 on *all* platforms, so that
+ * savefiles written using *this* code won't use 18 or 121 for PFSYNC,
+ * they'll all use 246.
+ *
+ * Code that uses pcap_datalink() to determine the link-layer header
+ * type of a savefile won't, when built and run on FreeBSD, be able
+ * to distinguish between LINKTYPE_PFSYNC and LINKTYPE_HHDLC capture
+ * files, as pcap_datalink() will give 121 for both of them.  Code
+ * that doesn't, such as the code in Wireshark, will be able to
+ * distinguish between them.
+ *
+ * FreeBSD's libpcap won't map a link-layer header type of 18 - i.e.,
+ * DLT_PFSYNC files from OpenBSD and possibly older versions of NetBSD,
+ * DragonFly BSD, and OS X - to DLT_PFSYNC, so code built with FreeBSD's
+ * libpcap won't treat those files as DLT_PFSYNC files.
+ *
+ * Other libpcaps won't 

CVS import: src/external/bsd/libpcap/dist

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 21:55:32 UTC 2017

Update of /cvsroot/src/external/bsd/libpcap/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv21066

Log Message:
Tuesday, Oct. 25, 2016 m...@sandelman.ca
  Summary for 1.8.1 libpcap release
Add a target in Makefile.in for Exuberant Ctags use: 'extags'.
Rename configure.in to configure.ac: autoconf 2.59
Clean up the name-to-DLT mapping table.
Add some newer DLT_ values: 
IPMI_HPM_2,ZWAVE_R1_R2,ZWAVE_R3,WATTSTOPPER_DLM,ISO_14443,RDS
Clarify what the return values are for both success and failure.
Many changes to build on windows
Check for the "break the loop" condition in the inner loop for TPACKET_V3.
Fix handling of packet count in the TPACKET_V3 inner loop: GitHub issue 
#493.
Filter out duplicate looped back CAN frames.
Fix the handling of loopback filters for IPv6 packets.
Add a link-layer header type for RDS (IEC 62106) groups.
Use different intermediate folders for x86 and x64 builds on Windows.
On Linux, handle all CAN captures with pcap-linux.c, in cooked mode.
Removes the need for the "host-endian" link-layer header type.
Compile with '-Wused-but-marked-unused' in devel mode if supported
Have separate DLTs for big-endian and host-endian SocketCAN headers.
Reflect version.h being renamed to pcap_version.h.
Require that version.h be generated: all build procedures we support 
generate version.h (autoconf, CMake, MSVC)!
Properly check for sock_recv() errors.
Re-impose some of Winsock's limitations on sock_recv().
Replace sprintf() with pcap_snprintf().
Fix signature of pcap_stats_ex_remote().
Initial cmake support for remote packet capture.
Have rpcap_remoteact_getsock() return a SOCKET and supply an "is active" 
flag.
Clean up {DAG, Septel, Myricom SNF}-only builds.
Do UTF-16-to-ASCII conversion into the right place.
pcap_create_interface() needs the interface name on Linux.
Clean up hardware time stamp support: the "any" device does not support any 
time stamp types.
Add support for capturing on FreeBSD usbusN interfaces.
Add a LINKTYPE/DLT_ value for FreeBSD USB.
Go back to using PCAP_API on Windows.
CMake support
Add TurboCap support from WinPcap.
Recognize 802.1ad nested VLAN tag in vlan filter.

Thursday Sep. 3, 2015 g...@alum.mit.edu
  Summary for 1.7.5 libpcap release
Man page cleanups.
Add some allocation failure checks.
Fix a number of Linux/ucLinux configure/build issues.
Fix some memory leaks.
Recognize 802.1ad nested VLAN tag in vlan filter.
Fix building Bluetooth Linux Monitor support with BlueZ 5.1+

Saturday Jun. 27, 2015 m...@sandelman.ca
  Summary for 1.7.4 libpcap release
Include fix for GitHub issue #424 -- out of tree builds.

Friday Apr. 10, 2015 g...@alum.mit.edu
  Summary for 1.7.3 libpcap release
Work around a Linux bonding driver bug.


Status:

Vendor Tag: TCPDUMP
Release Tags:   libpcap-1_8_1

C src/external/bsd/libpcap/dist/grammar.y
C src/external/bsd/libpcap/dist/fad-glifc.c
U src/external/bsd/libpcap/dist/llc.h
C src/external/bsd/libpcap/dist/pcap_setnonblock.3pcap
U src/external/bsd/libpcap/dist/sunatmpos.h
C src/external/bsd/libpcap/dist/sf-pcap-ng.c
C src/external/bsd/libpcap/dist/pcap-dbus.c
C src/external/bsd/libpcap/dist/pcap_findalldevs.3pcap
U src/external/bsd/libpcap/dist/Makefile-devel-adds
N src/external/bsd/libpcap/dist/gen_version_c.sh
U src/external/bsd/libpcap/dist/aclocal.m4
U src/external/bsd/libpcap/dist/pcap_list_tstamp_types.3pcap.in
N src/external/bsd/libpcap/dist/pcap-rpcap.c
U src/external/bsd/libpcap/dist/pcap-bt-linux.h
U src/external/bsd/libpcap/dist/README.sita
C src/external/bsd/libpcap/dist/savefile.c
U src/external/bsd/libpcap/dist/CHANGES
N src/external/bsd/libpcap/dist/configure.ac
C src/external/bsd/libpcap/dist/pcap_dump_ftell.3pcap
C src/external/bsd/libpcap/dist/pcap-nit.c
C src/external/bsd/libpcap/dist/pcap_can_set_rfmon.3pcap
N src/external/bsd/libpcap/dist/pcap-rpcap.h
U src/external/bsd/libpcap/dist/README.tru64
U src/external/bsd/libpcap/dist/org.tcpdump.chmod_bpf.plist
C src/external/bsd/libpcap/dist/pcap-netfilter-linux.c
U src/external/bsd/libpcap/dist/pcap-tstamp.manmisc.in
U src/external/bsd/libpcap/dist/README.hpux
C src/external/bsd/libpcap/dist/pcap-linux.c
C src/external/bsd/libpcap/dist/pcap-bpf.c
N src/external/bsd/libpcap/dist/pcap-tc.c
N src/external/bsd/libpcap/dist/remote-ext.h
N src/external/bsd/libpcap/dist/sockutils.h
C src/external/bsd/libpcap/dist/pcap_open_offline.3pcap.in
U src/external/bsd/libpcap/dist/pcap_list_datalinks.3pcap.in
C src/external/bsd/libpcap/dist/pcap-snoop.c
C src/external/bsd/libpcap/dist/pcap_fileno.3pcap
U src/external/bsd/libpcap/dist/pcap-dbus.h
C src/external/bsd/libpcap/dist/pcap_major_version.3pcap
U src/external/bsd/libpcap/dist/pcap-filter.manmisc.in
C 

CVS import: src/external/bsd/tcpdump/dist

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 21:33:47 UTC 2017

Update of /cvsroot/src/external/bsd/tcpdump/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv16875

Log Message:
Tuesday October 25, 2016 m...@sandelman.ca
  Summary for 4.8.1 tcpdump release
Fix "-x" for Apple PKTAP and PPI packets
Use PRIx64 to print a 64-bit number in hex.
Printer for HNCP (RFCs 7787 and 7788).
dagid is always an IPv6 address, not an opaque 128-bit string, and 
other fixes to RPL printer.
RSVP: Add bounds and length checks
OSPF: Do more bounds checking
Handle OpenSSL 1.1.x.
Initial support for the REdis Serialization Protocol known as RESP.
Add printing function for Generic Protocol Extension for VXLAN
draft-ietf-nvo3-vxlan-gpe-01
Network Service Header: draft-ietf-sfc-nsh-01
Don't recompile the filter if the new file has the same DLT.
Pass an adjusted struct pcap_pkthdr to the sub-printer.
Add three test cases for already fixed CVEs
   CVE-2014-8767: OLSR
   CVE-2014-8768: Geonet
   CVE-2014-8769: AODV
Don't do the DDP-over-UDP heuristic first: GitHub issue #499.
Use the new debugging routines in libpcap.
Harmonize TCP source or destination ports tests with UDP ones
Introduce data types to use for integral values in packet structures.
RSVP: Fix an infinite loop
Support of Type 3 and Type 4 LISP packets.
Don't require IPv6 library support in order to support IPv6 addresses.
Many many changes to support libnetdissect usage.
Add a test that makes unaligned accesses: GitHub issue #478.
add a DNSSEC test case: GH #445 and GH #467.
BGP: add decoding of ADD-PATH capability
fixes to LLC header printing, and RFC948-style IP packets

Friday April 10, 2015 g...@alum.mit.edu
  Summary for 4.7.4 tcpdump release
RPKI to Router Protocol: Fix Segmentation Faults and other problems
RPKI to Router Protocol: print strings with fn_printn()
wb: fix some bounds checks


Status:

Vendor Tag: TCPDUMP
Release Tags:   tcpdump-4_8_1

C src/external/bsd/tcpdump/dist/print-lwres.c
U src/external/bsd/tcpdump/dist/nfsfh.h
U src/external/bsd/tcpdump/dist/llc.h
C src/external/bsd/tcpdump/dist/gmt2local.c
U src/external/bsd/tcpdump/dist/af.h
N src/external/bsd/tcpdump/dist/ascii_strcasecmp.h
U src/external/bsd/tcpdump/dist/l2vpn.h
U src/external/bsd/tcpdump/dist/Makefile-devel-adds
C src/external/bsd/tcpdump/dist/print-m3ua.c
N src/external/bsd/tcpdump/dist/ascii_strcasecmp.c
C src/external/bsd/tcpdump/dist/print-icmp6.c
C src/external/bsd/tcpdump/dist/print-pppoe.c
U src/external/bsd/tcpdump/dist/print-calm-fast.c
C src/external/bsd/tcpdump/dist/print-sunrpc.c
C src/external/bsd/tcpdump/dist/udp.h
C src/external/bsd/tcpdump/dist/print-radius.c
C src/external/bsd/tcpdump/dist/print-ip.c
U src/external/bsd/tcpdump/dist/print-otv.c
C src/external/bsd/tcpdump/dist/print-ascii.c
U src/external/bsd/tcpdump/dist/pcap_dump_ftell.c
U src/external/bsd/tcpdump/dist/addrtoname.h
U src/external/bsd/tcpdump/dist/aclocal.m4
C src/external/bsd/tcpdump/dist/print-ipx.c
C src/external/bsd/tcpdump/dist/print-atalk.c
N src/external/bsd/tcpdump/dist/print-lisp.c
N src/external/bsd/tcpdump/dist/strtoaddr.h
C src/external/bsd/tcpdump/dist/print-lspping.c
C src/external/bsd/tcpdump/dist/print-sl.c
C src/external/bsd/tcpdump/dist/print-tcp.c
U src/external/bsd/tcpdump/dist/print-vtp.c
U src/external/bsd/tcpdump/dist/rpl.h
C src/external/bsd/tcpdump/dist/print-cip.c
C src/external/bsd/tcpdump/dist/print-802_11.c
U src/external/bsd/tcpdump/dist/print-udld.c
U src/external/bsd/tcpdump/dist/gmpls.h
C src/external/bsd/tcpdump/dist/print-pflog.c
U src/external/bsd/tcpdump/dist/print-smtp.c
N src/external/bsd/tcpdump/dist/print-resp.c
U src/external/bsd/tcpdump/dist/nfs.h
C src/external/bsd/tcpdump/dist/print-dhcp6.c
C src/external/bsd/tcpdump/dist/print-slow.c
C src/external/bsd/tcpdump/dist/util.c
U src/external/bsd/tcpdump/dist/machdep.h
U src/external/bsd/tcpdump/dist/CHANGES
C src/external/bsd/tcpdump/dist/print-icmp.c
C src/external/bsd/tcpdump/dist/print-arp.c
U src/external/bsd/tcpdump/dist/print-openflow-1.0.c
C src/external/bsd/tcpdump/dist/print-ripng.c
C src/external/bsd/tcpdump/dist/print-hsrp.c
U src/external/bsd/tcpdump/dist/openflow.h
C src/external/bsd/tcpdump/dist/print-bgp.c
C src/external/bsd/tcpdump/dist/print-fr.c
C src/external/bsd/tcpdump/dist/print-sunatm.c
C src/external/bsd/tcpdump/dist/print-ospf.c
C src/external/bsd/tcpdump/dist/print-aodv.c
U src/external/bsd/tcpdump/dist/README.md
C src/external/bsd/tcpdump/dist/print-fddi.c
U src/external/bsd/tcpdump/dist/print-nflog.c
U src/external/bsd/tcpdump/dist/print-mptcp.c
C src/external/bsd/tcpdump/dist/print-pim.c
U src/external/bsd/tcpdump/dist/print-ftp.c
C src/external/bsd/tcpdump/dist/smbutil.c
C 

CVS commit: src/usr.sbin/npf/npfd

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 20:25:08 UTC 2017

Modified Files:
src/usr.sbin/npf/npfd: npfd_log.c

Log Message:
fix signed compare


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npfd/npfd_log.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.sbin/npf/npfd/npfd_log.c
diff -u src/usr.sbin/npf/npfd/npfd_log.c:1.8 src/usr.sbin/npf/npfd/npfd_log.c:1.9
--- src/usr.sbin/npf/npfd/npfd_log.c:1.8	Sat Jan  7 11:48:03 2017
+++ src/usr.sbin/npf/npfd/npfd_log.c	Tue Jan 24 15:25:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: npfd_log.c,v 1.8 2017/01/07 16:48:03 christos Exp $	*/
+/*	$NetBSD: npfd_log.c,v 1.9 2017/01/24 20:25:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: npfd_log.c,v 1.8 2017/01/07 16:48:03 christos Exp $");
+__RCSID("$NetBSD: npfd_log.c,v 1.9 2017/01/24 20:25:08 christos Exp $");
 
 #include 
 #include 
@@ -90,7 +90,9 @@ npfd_log_gethdr(npfd_log_t *ctx, struct 
 	case 1:
 		if (hdr->magic != TCPDUMP_MAGIC ||
 		hdr->version_major != PCAP_VERSION_MAJOR ||
-		hdr->version_minor != PCAP_VERSION_MINOR)
+		hdr->version_minor != PCAP_VERSION_MINOR ||
+		hdr->linktype != (u_int)pcap_datalink(ctx->pcap) ||
+		hdr->sigfigs != (u_int)pcap_get_tstamp_precision(ctx->pcap))
 			goto out;
 		break;
 	default:



CVS commit: src/usr.sbin/npf/npfd

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 20:24:59 UTC 2017

Modified Files:
src/usr.sbin/npf/npfd: npfd.c

Log Message:
output every 5 seconds instead of 60 or every 100 packets


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/npf/npfd/npfd.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.sbin/npf/npfd/npfd.c
diff -u src/usr.sbin/npf/npfd/npfd.c:1.6 src/usr.sbin/npf/npfd/npfd.c:1.7
--- src/usr.sbin/npf/npfd/npfd.c:1.6	Sat Jan  7 11:48:03 2017
+++ src/usr.sbin/npf/npfd/npfd.c	Tue Jan 24 15:24:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: npfd.c,v 1.6 2017/01/07 16:48:03 christos Exp $	*/
+/*	$NetBSD: npfd.c,v 1.7 2017/01/24 20:24:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: npfd.c,v 1.6 2017/01/07 16:48:03 christos Exp $");
+__RCSID("$NetBSD: npfd.c,v 1.7 2017/01/24 20:24:59 christos Exp $");
 
 #include 
 #include 
@@ -75,6 +75,7 @@ static void
 npfd_event_loop(npfd_log_t *log, int delay)
 {
 	struct pollfd pfd;
+	size_t count = 0;
 
 	pfd.fd = npfd_log_getsock(log);
 	pfd.events = POLLHUP | POLLIN;
@@ -91,6 +92,7 @@ npfd_event_loop(npfd_log_t *log, int del
 		if (flush) {
 			flush = false;
 			npfd_log_flush(log);
+			count = 0;
 		}
 		switch (poll(, 1, delay)) {
 		case -1:
@@ -101,8 +103,13 @@ npfd_event_loop(npfd_log_t *log, int del
 			/*NOTREACHED*/
 		case 0:
 			npfd_log_flush(log);
+			count = 0;
 			continue;
 		default:
+			if (count++ >= 100) {
+npfd_log_flush(log);
+count = 0;
+			}
 			npfd_log(log);
 		}
 
@@ -168,7 +175,7 @@ main(int argc, char **argv)
 	bool daemon_off = false;
 	int ch;
 
-	int delay = 60 * 1000;
+	int delay = 5 * 1000;
 	const char *iface = "npflog0";
 	int snaplen = 116;
 	char *pidname = NULL;



CVS commit: src/crypto/dist/ipsec-tools/src/racoon

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 19:23:56 UTC 2017

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon: handler.h isakmp.c isakmp_inf.c

Log Message:
PR/51682: Avoid DoS with fragment out of order insertion; keep fragments
sorted in the list.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/crypto/dist/ipsec-tools/src/racoon/handler.h
cvs rdiff -u -r1.75 -r1.76 src/crypto/dist/ipsec-tools/src/racoon/isakmp.c
cvs rdiff -u -r1.50 -r1.51 \
src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/handler.h
diff -u src/crypto/dist/ipsec-tools/src/racoon/handler.h:1.25 src/crypto/dist/ipsec-tools/src/racoon/handler.h:1.26
--- src/crypto/dist/ipsec-tools/src/racoon/handler.h:1.25	Wed Nov 17 05:40:41 2010
+++ src/crypto/dist/ipsec-tools/src/racoon/handler.h	Tue Jan 24 14:23:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: handler.h,v 1.25 2010/11/17 10:40:41 tteras Exp $	*/
+/*	$NetBSD: handler.h,v 1.26 2017/01/24 19:23:56 christos Exp $	*/
 
 /* Id: handler.h,v 1.19 2006/02/25 08:25:12 manubsd Exp */
 
@@ -141,6 +141,7 @@ struct ph1handle {
 #endif
 #ifdef ENABLE_FRAG
 	int frag;			/* IKE phase 1 fragmentation */
+	int frag_last_index;
 	struct isakmp_frag_item *frag_chain;	/* Received fragments */
 #endif
 

Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp.c:1.75 src/crypto/dist/ipsec-tools/src/racoon/isakmp.c:1.76
--- src/crypto/dist/ipsec-tools/src/racoon/isakmp.c:1.75	Wed Mar  9 17:27:17 2016
+++ src/crypto/dist/ipsec-tools/src/racoon/isakmp.c	Tue Jan 24 14:23:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: isakmp.c,v 1.75 2016/03/09 22:27:17 christos Exp $	*/
+/*	$NetBSD: isakmp.c,v 1.76 2017/01/24 19:23:56 christos Exp $	*/
 
 /* Id: isakmp.c,v 1.74 2006/05/07 21:32:59 manubsd Exp */
 
@@ -1077,6 +1077,7 @@ isakmp_ph1begin_i(rmconf, remote, local)
 		iph1->frag = 1;
 	else
 		iph1->frag = 0;
+	iph1->frag_last_index = 0;
 	iph1->frag_chain = NULL;
 #endif
 	iph1->approval = NULL;
@@ -1181,6 +1182,7 @@ isakmp_ph1begin_r(msg, remote, local, et
 #endif
 #ifdef ENABLE_FRAG
 	iph1->frag = 0;
+	iph1->frag_last_index = 0;
 	iph1->frag_chain = NULL;
 #endif
 	iph1->approval = NULL;

Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.50 src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.51
--- src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c:1.50	Fri Apr 12 05:53:10 2013
+++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_inf.c	Tue Jan 24 14:23:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: isakmp_inf.c,v 1.50 2013/04/12 09:53:10 tteras Exp $	*/
+/*	$NetBSD: isakmp_inf.c,v 1.51 2017/01/24 19:23:56 christos Exp $	*/
 
 /* Id: isakmp_inf.c,v 1.44 2006/05/06 20:45:52 manubsd Exp */
 
@@ -720,6 +720,7 @@ isakmp_info_send_nx(isakmp, remote, loca
 #endif
 #ifdef ENABLE_FRAG
 	iph1->frag = 0;
+	iph1->frag_last_index = 0;
 	iph1->frag_chain = NULL;
 #endif
 



CVS commit: src/crypto/dist/ipsec-tools/src/racoon

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 19:23:31 UTC 2017

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon: isakmp_frag.c

Log Message:
PR/51682: Avoid DoS with fragment out of order insertion; keep fragments
sorted in the list.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c:1.5 src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c:1.6
--- src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c:1.5	Wed Apr 22 07:24:20 2009
+++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_frag.c	Tue Jan 24 14:23:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: isakmp_frag.c,v 1.5 2009/04/22 11:24:20 tteras Exp $	*/
+/*	$NetBSD: isakmp_frag.c,v 1.6 2017/01/24 19:23:31 christos Exp $	*/
 
 /* Id: isakmp_frag.c,v 1.4 2004/11/13 17:31:36 manubsd Exp */
 
@@ -173,6 +173,38 @@ vendorid_frag_cap(gen)
 	return ntohl(hp[MD5_DIGEST_LENGTH / sizeof(*hp)]);
 }
 
+static int 
+isakmp_frag_insert(struct ph1handle *iph1, struct isakmp_frag_item *item)
+{
+	struct isakmp_frag_item *pitem = NULL;
+	struct isakmp_frag_item *citem = iph1->frag_chain;
+
+	if (iph1->frag_chain == NULL) {
+		iph1->frag_chain = item;
+		return 0;
+	}
+
+	do {
+		if (citem->frag_num == item->frag_num)
+			return -1;
+
+		if (citem->frag_num > item->frag_num) {
+			if (pitem)
+pitem->frag_next = item;
+			item->frag_next = citem;
+			break;
+		}
+
+		pitem = citem;
+		citem = citem->frag_next;
+	} while (citem != NULL);
+
+	/* we reached the end of the list, insert */
+	if (citem == NULL)
+	  pitem->frag_next = item;
+	return 0;
+}
+
 int 
 isakmp_frag_extract(iph1, msg)
 	struct ph1handle *iph1;
@@ -224,39 +256,43 @@ isakmp_frag_extract(iph1, msg)
 	item->frag_next = NULL;
 	item->frag_packet = buf;
 
-	/* Look for the last frag while inserting the new item in the chain */
-	if (item->frag_last)
-		last_frag = item->frag_num;
+	/* Check for the last frag before inserting the new item in the chain */
+	if (item->frag_last) {
+		/* if we have the last fragment, indices must match */
+		if (iph1->frag_last_index != 0 &&
+		item->frag_last != iph1->frag_last_index) {
+			plog(LLV_ERROR, LOCATION, NULL,
+			 "Repeated last fragment index mismatch\n");
+			racoon_free(item);
+			vfree(buf);
+			return -1;
+		}
 
-	if (iph1->frag_chain == NULL) {
-		iph1->frag_chain = item;
-	} else {
-		struct isakmp_frag_item *current;
+		last_frag = iph1->frag_last_index = item->frag_num;
+	}
 
-		current = iph1->frag_chain;
-		while (current->frag_next) {
-			if (current->frag_last)
-last_frag = item->frag_num;
-			current = current->frag_next;
-		}
-		current->frag_next = item;
+	/* insert fragment into chain */
+	if (isakmp_frag_insert(iph1, item) == -1) {
+		plog(LLV_ERROR, LOCATION, NULL,
+		"Repeated fragment index mismatch\n");
+		racoon_free(item);
+		vfree(buf);
+		return -1;
 	}
 
-	/* If we saw the last frag, check if the chain is complete */
+	/* If we saw the last frag, check if the chain is complete
+	 * we have a sorted list now, so just walk through */
 	if (last_frag != 0) {
+		item = iph1->frag_chain;
 		for (i = 1; i <= last_frag; i++) {
-			item = iph1->frag_chain;
-			do {
-if (item->frag_num == i)
-	break;
-item = item->frag_next;
-			} while (item != NULL);
-
+			if (item->frag_num != i)
+break;
+			item = item->frag_next;
 			if (item == NULL) /* Not found */
 break;
 		}
 
-		if (item != NULL) /* It is complete */
+		if (i > last_frag) /* It is complete */
 			return 1;
 	}
 		
@@ -291,15 +327,9 @@ isakmp_frag_reassembly(iph1)
 	}
 	data = buf->v;
 
+	item = iph1->frag_chain;
 	for (i = 1; i <= frag_count; i++) {
-		item = iph1->frag_chain;
-		do {
-			if (item->frag_num == i)
-break;
-			item = item->frag_next;
-		} while (item != NULL);
-
-		if (item == NULL) {
+		if (item->frag_num != i) {
 			plog(LLV_ERROR, LOCATION, NULL, 
 			"Missing fragment #%d\n", i);
 			vfree(buf);
@@ -308,6 +338,7 @@ isakmp_frag_reassembly(iph1)
 		}
 		memcpy(data, item->frag_packet->v, item->frag_packet->l);
 		data += item->frag_packet->l;
+		item = item->frag_next;
 	}
 
 out:



CVS commit: src/sys/net

2017-01-24 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Jan 24 18:37:20 UTC 2017

Modified Files:
src/sys/net: if_arcsubr.c if_ecosubr.c if_ethersubr.c if_fddisubr.c
if_tokensubr.c

Log Message:
Don't forget to free the mbuf when we decide not to reply to an ARP
request. This obviously is a terrible bug, since it allows a remote sender
to DoS the system with specially-crafted requests sent in a loop.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/net/if_arcsubr.c
cvs rdiff -u -r1.49 -r1.50 src/sys/net/if_ecosubr.c
cvs rdiff -u -r1.235 -r1.236 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.103 -r1.104 src/sys/net/if_fddisubr.c
cvs rdiff -u -r1.79 -r1.80 src/sys/net/if_tokensubr.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_arcsubr.c
diff -u src/sys/net/if_arcsubr.c:1.75 src/sys/net/if_arcsubr.c:1.76
--- src/sys/net/if_arcsubr.c:1.75	Wed Jan 11 13:08:29 2017
+++ src/sys/net/if_arcsubr.c	Tue Jan 24 18:37:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arcsubr.c,v 1.75 2017/01/11 13:08:29 ozaki-r Exp $	*/
+/*	$NetBSD: if_arcsubr.c,v 1.76 2017/01/24 18:37:20 maxv Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Ignatios Souvatzis
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.75 2017/01/11 13:08:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.76 2017/01/24 18:37:20 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -171,8 +171,10 @@ arc_output(struct ifnet *ifp, struct mbu
 			adst = arcbroadcastaddr;
 		else {
 			uint8_t *tha = ar_tha(arph);
-			if (tha == NULL)
+			if (tha == NULL) {
+m_freem(m);
 return 0;
+			}
 			adst = *tha;
 		}
 

Index: src/sys/net/if_ecosubr.c
diff -u src/sys/net/if_ecosubr.c:1.49 src/sys/net/if_ecosubr.c:1.50
--- src/sys/net/if_ecosubr.c:1.49	Mon Oct  3 11:06:06 2016
+++ src/sys/net/if_ecosubr.c	Tue Jan 24 18:37:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ecosubr.c,v 1.49 2016/10/03 11:06:06 ozaki-r Exp $	*/
+/*	$NetBSD: if_ecosubr.c,v 1.50 2017/01/24 18:37:20 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2001 Ben Harris
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.49 2016/10/03 11:06:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.50 2017/01/24 18:37:20 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -210,8 +210,10 @@ eco_output(struct ifnet *ifp, struct mbu
 	case AF_ARP:
 		ah = mtod(m, struct arphdr *);
 
-		if (ntohs(ah->ar_pro) != ETHERTYPE_IP)
-			return EAFNOSUPPORT;
+		if (ntohs(ah->ar_pro) != ETHERTYPE_IP) {
+			error = EAFNOSUPPORT;
+			goto bad;
+		}
 		ehdr.eco_port = ECO_PORT_IP;
 		switch (ntohs(ah->ar_op)) {
 		case ARPOP_REQUEST:
@@ -221,7 +223,8 @@ eco_output(struct ifnet *ifp, struct mbu
 			ehdr.eco_control = ECO_CTL_ARP_REPLY;
 			break;
 		default:
-			return EOPNOTSUPP;
+			error = EOPNOTSUPP;
+			goto bad;
 		}
 
 		if (m->m_flags & M_BCAST)
@@ -229,8 +232,10 @@ eco_output(struct ifnet *ifp, struct mbu
 			ECO_ADDR_LEN);
 		else {
 			tha = ar_tha(ah);
-			if (tha == NULL)
+			if (tha == NULL) {
+m_freem(m);
 return 0;
+			}
 			memcpy(ehdr.eco_dhost, tha, ECO_ADDR_LEN);
 		}
 

Index: src/sys/net/if_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.235 src/sys/net/if_ethersubr.c:1.236
--- src/sys/net/if_ethersubr.c:1.235	Fri Jan 13 06:11:56 2017
+++ src/sys/net/if_ethersubr.c	Tue Jan 24 18:37:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.235 2017/01/13 06:11:56 msaitoh Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.236 2017/01/24 18:37:20 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.235 2017/01/13 06:11:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.236 2017/01/24 18:37:20 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -279,6 +279,7 @@ ether_output(struct ifnet * const ifp0, 
 
 			if (tha == NULL) {
 /* fake with ARPHDR_IEEE1394 */
+m_freem(m);
 return 0;
 			}
 			memcpy(edst, tha, sizeof(edst));

Index: src/sys/net/if_fddisubr.c
diff -u src/sys/net/if_fddisubr.c:1.103 src/sys/net/if_fddisubr.c:1.104
--- src/sys/net/if_fddisubr.c:1.103	Wed Jan 11 13:08:29 2017
+++ src/sys/net/if_fddisubr.c	Tue Jan 24 18:37:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_fddisubr.c,v 1.103 2017/01/11 13:08:29 ozaki-r Exp $	*/
+/*	$NetBSD: if_fddisubr.c,v 1.104 2017/01/24 18:37:20 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -96,7 +96,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.103 2017/01/11 13:08:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.104 2017/01/24 18:37:20 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_gateway.h"
@@ -261,11 +261,13 @@ fddi_output(struct ifnet *ifp0, struct m
 	case AF_ARP: {
 		struct arphdr *ah = mtod(m, struct arphdr *);

CVS commit: src/distrib

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 18:04:05 UTC 2017

Modified Files:
src/distrib/acorn26/instkernel: Makefile
src/distrib/acorn32/ramdisk: Makefile
src/distrib/alpha/instkernel/ramdisk: Makefile
src/distrib/amiga/miniroot: Makefile.inc
src/distrib/arc/ramdisk: Makefile
src/distrib/bebox/ramdisk: Makefile
src/distrib/cats/ramdisk: Makefile
src/distrib/cobalt/ramdisk: Makefile
src/distrib/dreamcast/ramdisk: Makefile
src/distrib/emips/miniroot: Makefile.inc
src/distrib/emips/ramdisk: Makefile
src/distrib/evbarm/instkernel/ramdisk: Makefile
src/distrib/evbarm/instkernel/sshramdisk: Makefile
src/distrib/evbarm64/ramdisk: Makefile
src/distrib/evbmips/instkernel/ramdisk: Makefile
src/distrib/evbppc/ramdisk: Makefile
src/distrib/evbsh3/instkernel/ramdisk: Makefile
src/distrib/ews4800mips/floppies/ramdisk: Makefile
src/distrib/hp300/miniroot: Makefile.inc
src/distrib/hp300/ramdisk: Makefile
src/distrib/hpcarm/miniroot: Makefile.inc
src/distrib/hpcmips/miniroot: Makefile.inc
src/distrib/hpcsh/miniroot: Makefile.inc
src/distrib/hppa/ramdisk: Makefile
src/distrib/i386/ramdisks/ramdisk-rescuetiny: Makefile
src/distrib/i386/ramdisks/ramdisk-tiny: Makefile
src/distrib/ibmnws/netboot/ramdisk: Makefile
src/distrib/landisk/ramdisk: Makefile
src/distrib/luna68k/ramdisk: Makefile
src/distrib/mac68k/instkernel/ramdisk: Makefile
src/distrib/mac68k/miniroot: Makefile.inc
src/distrib/macppc/floppies/ramdisk: Makefile
src/distrib/mipsco/ramdisk: Makefile
src/distrib/mvme68k/miniroot: Makefile.inc
src/distrib/news68k/floppies/ramdisk: Makefile
src/distrib/newsmips/floppies/ramdisk: Makefile
src/distrib/playstation2/miniroot: Makefile.inc
src/distrib/pmax/miniroot: Makefile.inc
src/distrib/pmax/ramdisk: Makefile
src/distrib/prep/floppies/ramdisk: Makefile
src/distrib/riscv/ramdisk: Makefile
src/distrib/rs6000/ramdisk: Makefile
src/distrib/sandpoint/ramdisk: Makefile
src/distrib/sgimips/miniroot: Makefile.inc.xxx
src/distrib/sgimips/ramdisk: Makefile
src/distrib/shark/instkernel/ramdisk: Makefile
src/distrib/sparc/miniroot: Makefile.inc
src/distrib/sparc64/instfs: Makefile.instfs
src/distrib/sun2/miniroot: Makefile
src/distrib/sun2/ramdisk: Makefile
src/distrib/sun3/miniroot: Makefile
src/distrib/sun3/ramdisk: Makefile
src/distrib/vax/miniroot: Makefile.inc
src/distrib/vax/ramdisk: Makefile
src/distrib/x68k/floppies/ramdisk: Makefile
src/distrib/zaurus/ramdisk: Makefile

Log Message:
+= for MAKEFS_FLAGS


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/acorn26/instkernel/Makefile
cvs rdiff -u -r1.24 -r1.25 src/distrib/acorn32/ramdisk/Makefile
cvs rdiff -u -r1.31 -r1.32 src/distrib/alpha/instkernel/ramdisk/Makefile
cvs rdiff -u -r1.19 -r1.20 src/distrib/amiga/miniroot/Makefile.inc
cvs rdiff -u -r1.24 -r1.25 src/distrib/arc/ramdisk/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/bebox/ramdisk/Makefile
cvs rdiff -u -r1.23 -r1.24 src/distrib/cats/ramdisk/Makefile
cvs rdiff -u -r1.10 -r1.11 src/distrib/cobalt/ramdisk/Makefile
cvs rdiff -u -r1.13 -r1.14 src/distrib/dreamcast/ramdisk/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/emips/miniroot/Makefile.inc
cvs rdiff -u -r1.2 -r1.3 src/distrib/emips/ramdisk/Makefile
cvs rdiff -u -r1.14 -r1.15 src/distrib/evbarm/instkernel/ramdisk/Makefile
cvs rdiff -u -r1.11 -r1.12 src/distrib/evbarm/instkernel/sshramdisk/Makefile
cvs rdiff -u -r1.1 -r1.2 src/distrib/evbarm64/ramdisk/Makefile
cvs rdiff -u -r1.12 -r1.13 src/distrib/evbmips/instkernel/ramdisk/Makefile
cvs rdiff -u -r1.20 -r1.21 src/distrib/evbppc/ramdisk/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/evbsh3/instkernel/ramdisk/Makefile
cvs rdiff -u -r1.11 -r1.12 src/distrib/ews4800mips/floppies/ramdisk/Makefile
cvs rdiff -u -r1.13 -r1.14 src/distrib/hp300/miniroot/Makefile.inc
cvs rdiff -u -r1.33 -r1.34 src/distrib/hp300/ramdisk/Makefile
cvs rdiff -u -r1.7 -r1.8 src/distrib/hpcarm/miniroot/Makefile.inc
cvs rdiff -u -r1.20 -r1.21 src/distrib/hpcmips/miniroot/Makefile.inc
cvs rdiff -u -r1.8 -r1.9 src/distrib/hpcsh/miniroot/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 src/distrib/hppa/ramdisk/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/distrib/i386/ramdisks/ramdisk-rescuetiny/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/i386/ramdisks/ramdisk-tiny/Makefile
cvs rdiff -u -r1.12 -r1.13 src/distrib/ibmnws/netboot/ramdisk/Makefile
cvs rdiff -u -r1.10 -r1.11 src/distrib/landisk/ramdisk/Makefile
cvs rdiff -u -r1.4 -r1.5 src/distrib/luna68k/ramdisk/Makefile
cvs rdiff -u -r1.36 -r1.37 src/distrib/mac68k/instkernel/ramdisk/Makefile
cvs rdiff -u -r1.8 -r1.9 

CVS commit: src/distrib/common/bootimage

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 18:01:07 UTC 2017

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
use the same logic to compute the timestamp like the other files


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/distrib/common/bootimage/Makefile.bootimage

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.12 src/distrib/common/bootimage/Makefile.bootimage:1.13
--- src/distrib/common/bootimage/Makefile.bootimage:1.12	Tue Nov 24 19:50:57 2015
+++ src/distrib/common/bootimage/Makefile.bootimage	Tue Jan 24 13:01:07 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.12 2015/11/25 00:50:57 christos Exp $
+#	$NetBSD: Makefile.bootimage,v 1.13 2017/01/24 18:01:07 christos Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -127,8 +127,8 @@
 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
-.if ${MKREPRO:Uno} == "yes"
-TIMESTAMP=-T ${NETBSDSRCDIR}/sys/sys/param.h
+.if ${MKREPRO_TIMESTAMP:Uno} != "no"
+MAKEFS_TIMESTAMP=-T "${MKREPRO_TIMESTAMP}"
 .endif
 
 .if empty(IMGBASE)
@@ -296,7 +296,7 @@ ${TARGETFS}: prepare_md_post
 	${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE}			\
 	-B ${TARGET_ENDIANNESS}	\
 	-F ${WORKSPEC} -N ${WORKDIR}/etc\
-	${TIMESTAMP}		\
+	${MAKEFS_TIMESTAMP}		\
 	${IMGMAKEFSOPTIONS}		\
 	${WORKFS} ${WORKDIR}
 .if !empty(PRIMARY_BOOT) && ${INSTALLBOOT_AFTER_DISKLABEL} == "no"



CVS commit: src/etc

2017-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 24 17:54:52 UTC 2017

Modified Files:
src/etc: Makefile.params

Log Message:
MAKE varies between builds because it contains the full pathname.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/etc/Makefile.params

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

Modified files:

Index: src/etc/Makefile.params
diff -u src/etc/Makefile.params:1.16 src/etc/Makefile.params:1.17
--- src/etc/Makefile.params:1.16	Sun Jan  8 12:39:08 2017
+++ src/etc/Makefile.params	Tue Jan 24 12:54:52 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.params,v 1.16 2017/01/08 17:39:08 christos Exp $
+#	$NetBSD: Makefile.params,v 1.17 2017/01/24 17:54:52 christos Exp $
 #
 # Makefile fragment for printing build parameters.
 #
@@ -39,7 +39,7 @@
 
 RELEASEVARS=	DISTRIBVER EXTERNAL_TOOLCHAIN HAVE_GCC HAVE_GDB \
 		HAVE_LLVM HAVE_PCC INSTALLWORLDDIR \
-		MACHINE MACHINE_ARCH MAKE MAKECONF \
+		MACHINE MACHINE_ARCH MAKECONF \
 		MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
 		NOCLEANDIR NODISTRIBDIRS NOINCLUDES \
 		TOOLCHAIN_MISSING \
@@ -49,7 +49,7 @@ RELEASEVARS=	DISTRIBVER EXTERNAL_TOOLCHA
 
 .if ${MKREPRO:Uno} != "yes"
 RELEASEVARS+= 	BSDOBJDIR BSDSRCDIR BUILDID BUILDINFO BUILDSEED \
-		DESTDIR KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR \
+		DESTDIR KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR MAKE \
 		MAKEFLAGS NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \
 		RELEASEDIR RELEASEMACHINEDIR TOOLDIR USR_OBJMACHINE X11SRCDIR
 .endif



CVS commit: src

2017-01-24 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Jan 24 17:27:30 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: mi
src/lib/libcurses: Makefile curses.h curses_private.h resize.c
ripoffline.c screen.c
Added Files:
src/lib/libcurses: curses_slk.3 slk.c

Log Message:
Implement POSIX Curses Soft Label Key functions.


To generate a diff of this commit:
cvs rdiff -u -r1.2102 -r1.2103 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.83 -r1.84 src/lib/libcurses/Makefile
cvs rdiff -u -r1.120 -r1.121 src/lib/libcurses/curses.h
cvs rdiff -u -r1.59 -r1.60 src/lib/libcurses/curses_private.h
cvs rdiff -u -r0 -r1.1 src/lib/libcurses/curses_slk.3 src/lib/libcurses/slk.c
cvs rdiff -u -r1.25 -r1.26 src/lib/libcurses/resize.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libcurses/ripoffline.c
cvs rdiff -u -r1.29 -r1.30 src/lib/libcurses/screen.c

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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2102 src/distrib/sets/lists/comp/mi:1.2103
--- src/distrib/sets/lists/comp/mi:1.2102	Wed Jan 11 12:02:24 2017
+++ src/distrib/sets/lists/comp/mi	Tue Jan 24 17:27:30 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2102 2017/01/11 12:02:24 joerg Exp $
+#	$NetBSD: mi,v 1.2103 2017/01/24 17:27:30 roy Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -5739,6 +5739,7 @@
 ./usr/share/man/cat3/curses_scanw.0		comp-c-catman		.cat
 ./usr/share/man/cat3/curses_screen.0		comp-c-catman		.cat
 ./usr/share/man/cat3/curses_scroll.0		comp-c-catman		.cat
+./usr/share/man/cat3/curses_slk.0		comp-c-catman		.cat
 ./usr/share/man/cat3/curses_standout.0		comp-c-catman		.cat
 ./usr/share/man/cat3/curses_termcap.0		comp-c-catman		.cat
 ./usr/share/man/cat3/curses_touch.0		comp-c-catman		.cat
@@ -9008,6 +9009,22 @@
 ./usr/share/man/cat3/sl_find.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sl_free.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sl_init.0			comp-c-catman		.cat
+./usr/share/man/cat3/slk_attroff.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_attr_off.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_attron.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_attr_on.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_attrset.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_attr_set.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_clear.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_color.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_init.0			comp-c-catman		.cat
+./usr/share/man/cat3/slk_label.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_noutrefresh.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_refresh.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_restore.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_set.0			comp-c-catman		.cat
+./usr/share/man/cat3/slk_touch.0		comp-c-catman		.cat
+./usr/share/man/cat3/slk_wset.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sleep.0			comp-c-catman		.cat
 ./usr/share/man/cat3/snprintb.0			comp-c-catman		.cat
 ./usr/share/man/cat3/snprintb_m.0		comp-c-catman		.cat
@@ -13134,6 +13151,7 @@
 ./usr/share/man/html3/curses_scanw.html		comp-c-htmlman		html
 ./usr/share/man/html3/curses_screen.html	comp-c-htmlman		html
 ./usr/share/man/html3/curses_scroll.html	comp-c-htmlman		html
+./usr/share/man/html3/curses_slk.html		comp-c-htmlman		html
 ./usr/share/man/html3/curses_standout.html	comp-c-htmlman		html
 ./usr/share/man/html3/curses_termcap.html	comp-c-htmlman		html
 ./usr/share/man/html3/curses_touch.html		comp-c-htmlman		html
@@ -16339,6 +16357,22 @@
 ./usr/share/man/html3/sl_find.html		comp-c-htmlman		html
 ./usr/share/man/html3/sl_free.html		comp-c-htmlman		html
 ./usr/share/man/html3/sl_init.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_attroff.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_attr_off.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_attron.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_attr_on.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_attrset.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_attr_set.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_clear.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_color.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_init.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_label.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_noutrefresh.html	comp-c-htmlman		html
+./usr/share/man/html3/slk_refresh.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_restore.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_set.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_touch.html		comp-c-htmlman		html
+./usr/share/man/html3/slk_wset.html		comp-c-htmlman		html
 ./usr/share/man/html3/sleep.html		comp-c-htmlman		html
 ./usr/share/man/html3/snprintb.html		comp-c-htmlman		html
 ./usr/share/man/html3/snprintb_m.html		

CVS commit: src/lib/libcurses

2017-01-24 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Jan 24 16:45:41 UTC 2017

Modified Files:
src/lib/libcurses: curses_screen.3

Log Message:
Note an issue with our cursor movement in 1 line size window.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/curses_screen.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/libcurses/curses_screen.3
diff -u src/lib/libcurses/curses_screen.3:1.22 src/lib/libcurses/curses_screen.3:1.23
--- src/lib/libcurses/curses_screen.3:1.22	Tue Jan 10 10:13:24 2017
+++ src/lib/libcurses/curses_screen.3	Tue Jan 24 16:45:41 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_screen.3,v 1.22 2017/01/10 10:13:24 roy Exp $
+.\"	$NetBSD: curses_screen.3,v 1.23 2017/01/24 16:45:41 roy Exp $
 .\"
 .\" Copyright (c) 2002
 .\"	Brett Lymn (bl...@netbsd.org, brett_l...@yahoo.com.au)
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd January 9, 2017
+.Dd January 24, 2017
 .Dt CURSES_SCREEN 3
 .Os
 .Sh NAME
@@ -307,3 +307,8 @@ functions are
 .Em ncurses
 extension to the Curses library and was added in
 .Nx 8.0 .
+.Sh BUGS
+There is currently an issue with cursor movement in a 1 line sized window
+which causes the screen to scroll up.
+This can obviously be seen when using
+.Fn ripoffline .



CVS commit: xsrc/external/mit/xf86-video-chips/dist/src

2017-01-24 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Tue Jan 24 15:47:02 UTC 2017

Modified Files:
xsrc/external/mit/xf86-video-chips/dist/src: ct_exa.c

Log Message:
fix compilation.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c
diff -u xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c:1.1 xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c:1.2
--- xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c:1.1	Sat Jan  7 11:07:07 2017
+++ xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c	Tue Jan 24 10:47:01 2017
@@ -21,7 +21,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/* $NetBSD: ct_exa.c,v 1.1 2017/01/07 16:07:07 macallan Exp $ */
+/* $NetBSD: ct_exa.c,v 1.2 2017/01/24 15:47:01 christos Exp $ */
 
 #include 
 
@@ -192,7 +192,7 @@ ctUploadToScreen(PixmapPtr pDst, int x, 
 {
 ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
 CHIPSPtr cPtr = CHIPSPTR(pScrn);
-char  *dst= cPtr->FbBase + exaGetPixmapOffset(pDst);
+unsigned char *dst = cPtr->FbBase + exaGetPixmapOffset(pDst);
 intdst_pitch  = exaGetPixmapPitch(pDst);
 
 int bpp= pDst->drawable.bitsPerPixel;
@@ -221,7 +221,7 @@ ctDownloadFromScreen(PixmapPtr pSrc, int
 {
 ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum];
 CHIPSPtr cPtr = CHIPSPTR(pScrn);
-char  *src= cPtr->FbBase + exaGetPixmapOffset(pSrc);
+unsigned char *src = cPtr->FbBase + exaGetPixmapOffset(pSrc);
 intsrc_pitch  = exaGetPixmapPitch(pSrc);
 
 int bpp= pSrc->drawable.bitsPerPixel;



CVS commit: src/distrib/amd64/cdroms

2017-01-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jan 24 11:27:55 UTC 2017

Modified Files:
src/distrib/amd64/cdroms: Makefile.cdrom

Log Message:
amd64: make BIOS and UEFI dual bootable iso image.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/amd64/cdroms/Makefile.cdrom

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

Modified files:

Index: src/distrib/amd64/cdroms/Makefile.cdrom
diff -u src/distrib/amd64/cdroms/Makefile.cdrom:1.20 src/distrib/amd64/cdroms/Makefile.cdrom:1.21
--- src/distrib/amd64/cdroms/Makefile.cdrom:1.20	Sun Jul 19 10:16:55 2015
+++ src/distrib/amd64/cdroms/Makefile.cdrom	Tue Jan 24 11:27:55 2017
@@ -1,12 +1,16 @@
-# $NetBSD: Makefile.cdrom,v 1.20 2015/07/19 10:16:55 martin Exp $
+# $NetBSD: Makefile.cdrom,v 1.21 2017/01/24 11:27:55 nonaka Exp $
 
 .include 
+.include 
 
 SYSINSTDIR!= cd ${.CURDIR}/../../../../usr.sbin/sysinst/arch/${MACHINE} && ${PRINTOBJDIR}
 
+EFIBOOTIMG=	efiboot.img
+CLEANFILES+=	${EFIBOOTIMG}
+
 # Need multidot for the boot loader to read kernel modules as it doesn't
 # understand rockridge.
-CDMAKEFSOPTIONS= bootimage=i386;bootxx.${MACHINE},no-emul-boot,allow-multidot
+CDMAKEFSOPTIONS= bootimage=i386;bootxx.${MACHINE},no-emul-boot,allow-multidot,bootimage=i386;${EFIBOOTIMG},platformid=efi,no-emul-boot
 CDINSTKERNEL=	../../instkernel
 CDKERNELS=	netbsd-GENERIC.gz   netbsd
 CDRELEASE_NOISOS=	true
@@ -15,7 +19,15 @@ CD_SETS=	base etc
 CD_SETS+=	modules
 .endif
 
-image_md_pre:
+${EFIBOOTIMG}: ${DESTDIR}/usr/mdec/bootx64.efi ${DESTDIR}/usr/mdec/bootia32.efi
+	${RM} -f ${EFIBOOTIMG}
+	${RM} -rf efiboot/EFI/boot
+	${MKDIR} efiboot/EFI/boot
+	${CP} ${.ALLSRC} efiboot/EFI/boot/
+	${TOOL_MAKEFS} -M 1m -m 1m -B ${TARGET_ENDIANNESS} \
+		-t msdos -o F=12,c=1 ${EFIBOOTIMG} efiboot
+
+image_md_pre: ${EFIBOOTIMG}
 	${RM} -f cdrom/etc/gettytab cdrom/etc/ttys cdrom/etc/rc
 	${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
 	${INSTALL} ${COPY} ${.CURDIR}/../etc.ttys cdrom/etc/ttys



CVS commit: src/usr.sbin/makefs

2017-01-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jan 24 11:22:43 UTC 2017

Modified Files:
src/usr.sbin/makefs: cd9660.c makefs.8
src/usr.sbin/makefs/cd9660: cd9660_eltorito.c cd9660_eltorito.h

Log Message:
makefs(8): add cd9660 eltorito-alt-boot option for EFI boot.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/makefs/cd9660.c
cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/makefs/makefs.8
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/makefs/cd9660/cd9660_eltorito.h

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

Modified files:

Index: src/usr.sbin/makefs/cd9660.c
diff -u src/usr.sbin/makefs/cd9660.c:1.53 src/usr.sbin/makefs/cd9660.c:1.54
--- src/usr.sbin/makefs/cd9660.c:1.53	Fri Nov 25 23:02:44 2016
+++ src/usr.sbin/makefs/cd9660.c	Tue Jan 24 11:22:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660.c,v 1.53 2016/11/25 23:02:44 christos Exp $	*/
+/*	$NetBSD: cd9660.c,v 1.54 2017/01/24 11:22:43 nonaka Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -103,7 +103,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660.c,v 1.53 2016/11/25 23:02:44 christos Exp $");
+__RCSID("$NetBSD: cd9660.c,v 1.54 2017/01/24 11:22:43 nonaka Exp $");
 #endif  /* !__lint */
 
 #include 
@@ -321,6 +321,7 @@ cd9660_prep_opts(fsinfo_t *fsopts)
 		OPT_STR('\0', "no-boot", "No boot support"),
 		OPT_STR('\0', "hard-disk-boot", "Boot from hard disk"),
 		OPT_STR('\0', "boot-load-segment", "Boot load segment"),
+		OPT_STR('\0', "platformid", "Section Header Platform ID"),
 
 		{ .name = NULL }
 	};
@@ -458,7 +459,8 @@ cd9660_parse_opts(const char *option, fs
 			/* RRIP */
 			cd9660_eltorito_add_boot_option(diskStructure, name, 0);
 			rv = 1;
-		} else if (strcmp(name, "boot-load-segment") == 0) {
+		} else if (strcmp(name, "boot-load-segment") == 0 ||
+		strcmp(name, "platformid") == 0) {
 			if (buf[0] == '\0') {
 warnx("Option `%s' doesn't contain a value",
 name);

Index: src/usr.sbin/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.57 src/usr.sbin/makefs/makefs.8:1.58
--- src/usr.sbin/makefs/makefs.8:1.57	Wed Jan 11 13:47:27 2017
+++ src/usr.sbin/makefs/makefs.8	Tue Jan 24 11:22:43 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: makefs.8,v 1.57 2017/01/11 13:47:27 wiz Exp $
+.\"	$NetBSD: makefs.8,v 1.58 2017/01/24 11:22:43 nonaka Exp $
 .\"
 .\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -366,6 +366,8 @@ ElTorito image.
 Do not pad the image (apparently Linux needs the padding).
 .\" .It Sy omit-trailing-period
 .\" Unknown
+.It Sy platformid
+Set platform ID of section header entry of the boot image.
 .It Sy preparer
 Preparer ID of the image.
 .It Sy publisher

Index: src/usr.sbin/makefs/cd9660/cd9660_eltorito.c
diff -u src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.20 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.21
--- src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.20	Mon Jan 28 21:03:28 2013
+++ src/usr.sbin/makefs/cd9660/cd9660_eltorito.c	Tue Jan 24 11:22:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_eltorito.c,v 1.20 2013/01/28 21:03:28 christos Exp $	*/
+/*	$NetBSD: cd9660_eltorito.c,v 1.21 2017/01/24 11:22:43 nonaka Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -40,7 +40,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660_eltorito.c,v 1.20 2013/01/28 21:03:28 christos Exp $");
+__RCSID("$NetBSD: cd9660_eltorito.c,v 1.21 2017/01/24 11:22:43 nonaka Exp $");
 #endif  /* !__lint */
 
 #ifdef DEBUG
@@ -56,11 +56,12 @@ static struct boot_catalog_entry *cd9660
 static struct boot_catalog_entry *cd9660_boot_setup_default_entry(
 struct cd9660_boot_image *);
 static struct boot_catalog_entry *cd9660_boot_setup_section_head(char);
-static struct boot_catalog_entry *cd9660_boot_setup_validation_entry(char);
 #if 0
 static u_char cd9660_boot_get_system_type(struct cd9660_boot_image *);
 #endif
 
+static struct cd9660_boot_image *default_boot_image;
+
 int
 cd9660_add_boot_disk(iso9660_disk *diskStructure, const char *boot_info)
 {
@@ -175,9 +176,15 @@ cd9660_add_boot_disk(iso9660_disk *diskS
 
 	new_image->serialno = diskStructure->image_serialno++;
 
+	new_image->platform_id = new_image->system;
+
 	/* TODO : Need to do anything about the boot image in the tree? */
 	diskStructure->is_bootable = 1;
 
+	/* First boot image is initial/default entry. */
+	if (default_boot_image == NULL)
+		default_boot_image = new_image;
+
 	return 1;
 }
 
@@ -211,6 +218,13 @@ cd9660_eltorito_add_boot_option(iso9660_
 			warn("%s: strtoul", __func__);
 			return 0;
 		}
+	} else if (strcmp(option_string, "platformid") == 0) {
+		if (strcmp(value, "efi") == 0)
+			image->platform_id = ET_SYS_EFI;
+		else {
+			warn("%s: unknown platform: %s", __func__, value);
+			return 0;
+		}
 	} else {

CVS commit: src/distrib/amd64

2017-01-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jan 24 11:16:50 UTC 2017

Modified Files:
src/distrib/amd64: Makefile
Added Files:
src/distrib/amd64/uefi-installimage: Makefile Makefile.bootimage
Makefile.installimage boot.cfg.in etc.rc etc.ttys install.sh
spec.inst

Log Message:
make amd64 EFI install image

XXX merge to installimage?


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/amd64/Makefile
cvs rdiff -u -r0 -r1.1 src/distrib/amd64/uefi-installimage/Makefile \
src/distrib/amd64/uefi-installimage/Makefile.bootimage \
src/distrib/amd64/uefi-installimage/Makefile.installimage \
src/distrib/amd64/uefi-installimage/boot.cfg.in \
src/distrib/amd64/uefi-installimage/etc.rc \
src/distrib/amd64/uefi-installimage/etc.ttys \
src/distrib/amd64/uefi-installimage/install.sh \
src/distrib/amd64/uefi-installimage/spec.inst

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

Modified files:

Index: src/distrib/amd64/Makefile
diff -u src/distrib/amd64/Makefile:1.11 src/distrib/amd64/Makefile:1.12
--- src/distrib/amd64/Makefile:1.11	Thu Jun 30 12:56:27 2016
+++ src/distrib/amd64/Makefile	Tue Jan 24 11:16:50 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2016/06/30 12:56:27 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.12 2017/01/24 11:16:50 nonaka Exp $
 
 .include 
 
@@ -16,6 +16,7 @@ SUBDIR+=	.WAIT
 SUBDIR+=	cdroms
 SUBDIR+=	liveimage
 SUBDIR+=	installimage
+SUBDIR+=	uefi-installimage
 TARGETS+=	release 
 
 iso_image:
@@ -26,5 +27,6 @@ live_image:
 
 install_image:
 	${MAKEDIRTARGET} installimage install_image
+	${MAKEDIRTARGET} uefi-installimage install_image
 
 .include 

Added files:

Index: src/distrib/amd64/uefi-installimage/Makefile
diff -u /dev/null src/distrib/amd64/uefi-installimage/Makefile:1.1
--- /dev/null	Tue Jan 24 11:16:50 2017
+++ src/distrib/amd64/uefi-installimage/Makefile	Tue Jan 24 11:16:50 2017
@@ -0,0 +1,44 @@
+#	$NetBSD: Makefile,v 1.1 2017/01/24 11:16:50 nonaka Exp $
+
+.include 
+
+INSTIMGBASE=	NetBSD-${DISTRIBVER}-amd64-uefi-install	# gives ${IMGBASE}.img
+
+BOOTDISK=	dk1			# unused (use GUID)
+INSTIMAGEMB?=	1280			# for all installation binaries
+
+PRIMARY_BOOT=		bootxx_ffsv1
+SECONDARY_BOOT=		boot
+SECONDARY_BOOT_ARG=	# unnecessary
+EFIBOOT=		${WORKDIR}/usr/mdec/bootx64.efi
+EFIBOOT+=		${WORKDIR}/usr/mdec/bootia32.efi
+#EFIBOOT=		${.OBJDIR}/../../../sys/arch/i386/stand/efiboot/bootx64/bootx64.efi
+#EFIBOOT+=		${.OBJDIR}/../../../sys/arch/i386/stand/efiboot/bootia32/bootia32.efi
+
+USE_MBR=		yes
+USE_GPT=		yes
+
+CLEANFILES+=	boot.cfg
+
+prepare_md_post:
+	${TOOL_SED}			\
+	-e "s/@@MACHINE@@/${MACHINE}/"\
+	-e "s/@@VERSION@@/${DISTRIBVER}/"\
+	< ${.CURDIR}/boot.cfg.in > boot.cfg
+
+DISTRIBDIR!= cd ${.CURDIR}/../.. ; pwd
+SYSINSTDIR!= cd ${.CURDIR}/../../../usr.sbin/sysinst/arch/${MACHINE} && ${PRINTOBJDIR}
+
+SPEC_EXTRA=		${.CURDIR}/spec.inst
+IMGFILE_EXTRA=\
+	${.CURDIR}/etc.ttys		etc/ttys			\
+	${.CURDIR}/etc.rc		etc/rc\
+	${.CURDIR}/install.sh		.\
+	${.OBJDIR}/boot.cfg		.\
+	${SYSINSTDIR}/sysinstmsgs.de	.\
+	${SYSINSTDIR}/sysinstmsgs.es	.\
+	${SYSINSTDIR}/sysinstmsgs.fr	.\
+	${SYSINSTDIR}/sysinstmsgs.pl	.\
+	${SYSINSTDIR}/sysinst		.
+
+.include "${.CURDIR}/Makefile.installimage"
Index: src/distrib/amd64/uefi-installimage/Makefile.bootimage
diff -u /dev/null src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.1
--- /dev/null	Tue Jan 24 11:16:50 2017
+++ src/distrib/amd64/uefi-installimage/Makefile.bootimage	Tue Jan 24 11:16:50 2017
@@ -0,0 +1,499 @@
+#	$NetBSD: Makefile.bootimage,v 1.1 2017/01/24 11:16:50 nonaka Exp $
+#
+# Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS 

CVS commit: src

2017-01-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jan 24 11:09:15 UTC 2017

Modified Files:
src/distrib/sets/lists/base: md.amd64
src/sys/arch/i386/stand: Makefile
src/sys/arch/i386/stand/lib: biosdisk.c bootinfo_biosgeom.c diskbuf.c
exec.c libi386.h vbe.c
src/sys/arch/x86/acpi: acpi_machdep.c
src/sys/arch/x86/include: bootinfo.h efi.h
src/sys/arch/x86/x86: efi.c x86_machdep.c
src/sys/lib/libgnuefi: Makefile Makefile.inc
Added Files:
src/sys/arch/i386/stand/efiboot: Makefile Makefile.efiboot boot.c
conf.c devopen.c devopen.h efiboot.c efiboot.h eficons.c efidelay.c
efidisk.c efidisk.h efidisk_ll.c efigetsecs.c efimemory.c panic.c
self_reloc.c version
src/sys/arch/i386/stand/efiboot/bootia32: Makefile efiboot_machdep.h
efibootia32.c ldscript start.S
src/sys/arch/i386/stand/efiboot/bootx64: Makefile efiboot_machdep.h
efibootx64.c ldscript start.S startprog64.S
src/sys/lib/libgnuefi/arch/i386: Makefile.inc
src/sys/lib/libgnuefi/arch/x86_64: Makefile.inc

Log Message:
Initial commit of native amd64 EFI boot loader.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/i386/stand/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/efiboot/Makefile \
src/sys/arch/i386/stand/efiboot/Makefile.efiboot \
src/sys/arch/i386/stand/efiboot/boot.c \
src/sys/arch/i386/stand/efiboot/conf.c \
src/sys/arch/i386/stand/efiboot/devopen.c \
src/sys/arch/i386/stand/efiboot/devopen.h \
src/sys/arch/i386/stand/efiboot/efiboot.c \
src/sys/arch/i386/stand/efiboot/efiboot.h \
src/sys/arch/i386/stand/efiboot/eficons.c \
src/sys/arch/i386/stand/efiboot/efidelay.c \
src/sys/arch/i386/stand/efiboot/efidisk.c \
src/sys/arch/i386/stand/efiboot/efidisk.h \
src/sys/arch/i386/stand/efiboot/efidisk_ll.c \
src/sys/arch/i386/stand/efiboot/efigetsecs.c \
src/sys/arch/i386/stand/efiboot/efimemory.c \
src/sys/arch/i386/stand/efiboot/panic.c \
src/sys/arch/i386/stand/efiboot/self_reloc.c \
src/sys/arch/i386/stand/efiboot/version
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/efiboot/bootia32/Makefile \
src/sys/arch/i386/stand/efiboot/bootia32/efiboot_machdep.h \
src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c \
src/sys/arch/i386/stand/efiboot/bootia32/ldscript \
src/sys/arch/i386/stand/efiboot/bootia32/start.S
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/efiboot/bootx64/Makefile \
src/sys/arch/i386/stand/efiboot/bootx64/efiboot_machdep.h \
src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c \
src/sys/arch/i386/stand/efiboot/bootx64/ldscript \
src/sys/arch/i386/stand/efiboot/bootx64/start.S \
src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/i386/stand/lib/biosdisk.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/lib/diskbuf.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/i386/stand/lib/exec.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/i386/stand/lib/libi386.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/lib/vbe.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/acpi/acpi_machdep.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/x86/include/bootinfo.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/include/efi.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/x86/efi.c
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/x86/x86/x86_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/lib/libgnuefi/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/lib/libgnuefi/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/sys/lib/libgnuefi/arch/i386/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/sys/lib/libgnuefi/arch/x86_64/Makefile.inc

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

Modified files:

Index: src/distrib/sets/lists/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.267 src/distrib/sets/lists/base/md.amd64:1.268
--- src/distrib/sets/lists/base/md.amd64:1.267	Sat Sep 26 01:46:14 2015
+++ src/distrib/sets/lists/base/md.amd64	Tue Jan 24 11:09:14 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.267 2015/09/26 01:46:14 christos Exp $
+# $NetBSD: md.amd64,v 1.268 2017/01/24 11:09:14 nonaka Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
@@ -30,6 +30,8 @@
 ./usr/mdec/biosboot_com0_57600.sym		base-obsolete		obsolete
 ./usr/mdec/biosboot_com0_9600.sym		base-obsolete		obsolete
 ./usr/mdec/boot	base-sysutil-bin
+./usr/mdec/bootia32.efibase-sysutil-bin
+./usr/mdec/bootx64.efibase-sysutil-bin
 ./usr/mdec/bootxx_cd9660			base-sysutil-bin
 ./usr/mdec/bootxx_dosfsbase-obsolete		obsolete
 ./usr/mdec/bootxx_ext2fs			base-sysutil-bin

Index: 

CVS commit: src/sys/dev/pci

2017-01-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jan 24 10:18:33 UTC 2017

Modified Files:
src/sys/dev/pci: if_rtwn.c if_rtwnreg.h

Log Message:
rtwn(4): increase the number of tx queue required to clear the full mask.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/if_rtwn.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/if_rtwnreg.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/if_rtwn.c
diff -u src/sys/dev/pci/if_rtwn.c:1.9 src/sys/dev/pci/if_rtwn.c:1.10
--- src/sys/dev/pci/if_rtwn.c:1.9	Thu Dec  8 01:12:01 2016
+++ src/sys/dev/pci/if_rtwn.c	Tue Jan 24 10:18:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rtwn.c,v 1.9 2016/12/08 01:12:01 ozaki-r Exp $	*/
+/*	$NetBSD: if_rtwn.c,v 1.10 2017/01/24 10:18:33 nonaka Exp $	*/
 /*	$OpenBSD: if_rtwn.c,v 1.5 2015/06/14 08:02:47 stsp Exp $	*/
 #define	IEEE80211_NO_HT
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_rtwn.c,v 1.9 2016/12/08 01:12:01 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtwn.c,v 1.10 2017/01/24 10:18:33 nonaka Exp $");
 
 #include 
 #include 
@@ -1989,7 +1989,7 @@ rtwn_tx(struct rtwn_softc *sc, struct mb
 	tx_ring->cur = (tx_ring->cur + 1) % RTWN_TX_LIST_COUNT;
 	tx_ring->queued++;
 
-	if (tx_ring->queued >= (RTWN_TX_LIST_COUNT - 1))
+	if (tx_ring->queued > RTWN_TX_LIST_HIMARK)
 		sc->qfullmsk |= (1 << qid);
 
 	/* Kick TX. */
@@ -2035,7 +2035,7 @@ rtwn_tx_done(struct rtwn_softc *sc, int 
 		tx_ring->queued--;
 	}
 
-	if (tx_ring->queued < (RTWN_TX_LIST_COUNT - 1))
+	if (tx_ring->queued < RTWN_TX_LIST_LOMARK)
 		sc->qfullmsk &= ~(1 << qid);
 }
 

Index: src/sys/dev/pci/if_rtwnreg.h
diff -u src/sys/dev/pci/if_rtwnreg.h:1.2 src/sys/dev/pci/if_rtwnreg.h:1.3
--- src/sys/dev/pci/if_rtwnreg.h:1.2	Fri Nov  6 14:22:17 2015
+++ src/sys/dev/pci/if_rtwnreg.h	Tue Jan 24 10:18:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rtwnreg.h,v 1.2 2015/11/06 14:22:17 nonaka Exp $	*/
+/*	$NetBSD: if_rtwnreg.h,v 1.3 2017/01/24 10:18:33 nonaka Exp $	*/
 /*	$OpenBSD: if_rtwnreg.h,v 1.3 2015/06/14 08:02:47 stsp Exp $	*/
 
 /*-
@@ -1168,6 +1168,8 @@ struct r92c_tx_desc {
 #define RTWN_NTXQUEUES			9
 #define RTWN_RX_LIST_COUNT		256
 #define RTWN_TX_LIST_COUNT		256
+#define RTWN_TX_LIST_LOMARK		192
+#define RTWN_TX_LIST_HIMARK		255
 #define RTWN_HOST_CMD_RING_COUNT	32
 
 /* TX queue indices. */



CVS commit: src

2017-01-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jan 24 09:05:28 UTC 2017

Modified Files:
src/sys/dev/ic: hd64570.c midway.c
src/sys/dev/pci: if_lmc.c if_lmc.h
src/sys/net: bpf.c bpf.h bpfdesc.h
src/sys/netisdn: i4b_ipr.c
Added Files:
src/doc: TODO.smpnet

Log Message:
Defer bpf_mtap in Rx interrupt context to softint

bpf_mtap of some drivers is still called in hardware interrupt context.
We want to run them in softint as well as bpf_mtap of most drivers
(see if_percpuq_softint and if_input).

To this end, bpf_mtap_softint mechanism is implemented; it defers
bpf_mtap processing to a dedicated softint for a target driver.
By using the machanism, we can move bpf_mtap processing to softint
without changing target drivers much while it adds some overhead
on CPU and memory. Once target drivers are changed to softint-based,
we should return to normal bpf_mtap.

Proposed on tech-kern and tech-net


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/doc/TODO.smpnet
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/ic/hd64570.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/ic/midway.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/if_lmc.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/if_lmc.h
cvs rdiff -u -r1.204 -r1.205 src/sys/net/bpf.c
cvs rdiff -u -r1.67 -r1.68 src/sys/net/bpf.h
cvs rdiff -u -r1.39 -r1.40 src/sys/net/bpfdesc.h
cvs rdiff -u -r1.40 -r1.41 src/sys/netisdn/i4b_ipr.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/hd64570.c
diff -u src/sys/dev/ic/hd64570.c:1.51 src/sys/dev/ic/hd64570.c:1.52
--- src/sys/dev/ic/hd64570.c:1.51	Thu Dec 15 09:35:24 2016
+++ src/sys/dev/ic/hd64570.c	Tue Jan 24 09:05:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64570.c,v 1.51 2016/12/15 09:35:24 ozaki-r Exp $	*/
+/*	$NetBSD: hd64570.c,v 1.52 2017/01/24 09:05:28 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1999 Christian E. Hopps
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.51 2016/12/15 09:35:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.52 2017/01/24 09:05:28 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -457,6 +457,7 @@ sca_port_attach(struct sca_softc *sc, u_
 	if_attach(ifp);
 	if_alloc_sadl(ifp);
 	bpf_attach(ifp, DLT_HDLC, HDLC_HDRLEN);
+	bpf_mtap_softint_init(ifp);
 
 	if (sc->sc_parent == NULL)
 		printf("%s: port %d\n", ifp->if_xname, port);
@@ -1574,7 +1575,7 @@ sca_frame_process(sca_port_t *scp)
 		return;
 	}
 
-	bpf_mtap(>sp_if, m); /* XXX not in softint */
+	bpf_mtap_softint(>sp_if, m);
 
 	scp->sp_if.if_ipackets++;
 

Index: src/sys/dev/ic/midway.c
diff -u src/sys/dev/ic/midway.c:1.98 src/sys/dev/ic/midway.c:1.99
--- src/sys/dev/ic/midway.c:1.98	Thu Dec 15 09:35:24 2016
+++ src/sys/dev/ic/midway.c	Tue Jan 24 09:05:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: midway.c,v 1.98 2016/12/15 09:35:24 ozaki-r Exp $	*/
+/*	$NetBSD: midway.c,v 1.99 2017/01/24 09:05:28 ozaki-r Exp $	*/
 /*	(sync'd to midway.c 1.68)	*/
 
 /*
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.98 2016/12/15 09:35:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.99 2017/01/24 09:05:28 ozaki-r Exp $");
 
 #include "opt_natm.h"
 
@@ -2766,7 +2766,7 @@ EN_INTR_TYPE en_intr(void *arg)
 	  ifp->if_ipackets++;
 #endif
 
-	  bpf_mtap(ifp, m); /* XXX not in softint */
+	  bpf_mtap_softint(ifp, m);
 
 	  atm_input(ifp, , m, sc->rxslot[slot].rxhand);
 	}
@@ -3623,6 +3623,7 @@ en_pvcattach(struct ifnet *ifp)
 	LIST_INSERT_HEAD(>sif_list, (struct pvcsif *)pvc_ifp, sif_links);
 	if_attach(pvc_ifp);
 	atm_ifattach(pvc_ifp);
+	bpf_mtap_softint_init(pvc_ifp);
 
 #ifdef ATM_PVCEXT
 	rrp_add(sc, pvc_ifp);

Index: src/sys/dev/pci/if_lmc.c
diff -u src/sys/dev/pci/if_lmc.c:1.62 src/sys/dev/pci/if_lmc.c:1.63
--- src/sys/dev/pci/if_lmc.c:1.62	Thu Dec 15 09:35:24 2016
+++ src/sys/dev/pci/if_lmc.c	Tue Jan 24 09:05:28 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_lmc.c,v 1.62 2016/12/15 09:35:24 ozaki-r Exp $ */
+/* $NetBSD: if_lmc.c,v 1.63 2017/01/24 09:05:28 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2002-2006 David Boggs. 
@@ -74,7 +74,7 @@
  */
 
 # include 
-__KERNEL_RCSID(0, "$NetBSD: if_lmc.c,v 1.62 2016/12/15 09:35:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lmc.c,v 1.63 2017/01/24 09:05:28 ozaki-r Exp $");
 # include 	/* OS version */
 # include "opt_inet.h"	/* INET6, INET */
 # include "opt_altq_enabled.h" /* ALTQ */
@@ -4294,7 +4294,7 @@ rxintr_cleanup(softc_t *sc)
 sc->status.cntrs.ipackets++;
 
 /* Berkeley Packet Filter */
-LMC_BPF_MTAP(sc, first_mbuf); /* XXX not in softint */
+LMC_BPF_MTAP(sc, first_mbuf);
 
 /* Give this good packet to the network stacks. */
 sc->quota--;
@@ -4446,7 +4446,7 @@ txintr_cleanup(softc_t *sc)
 sc->status.cntrs.opackets++;
 
 /* Berkeley Packet Filter */
-LMC_BPF_MTAP(sc, m); /* XXX not in softint */
+LMC_BPF_MTAP(sc,