CVS commit: src/share/mk

2013-09-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 18 09:25:20 UTC 2013

Modified Files:
src/share/mk: bsd.kmodule.mk

Log Message:
When compiling kernel modules on sparc64 force the same memory model as
we force for the kernel (i.e. do not rely on compiler defaults here)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/share/mk/bsd.kmodule.mk

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

Modified files:

Index: src/share/mk/bsd.kmodule.mk
diff -u src/share/mk/bsd.kmodule.mk:1.39 src/share/mk/bsd.kmodule.mk:1.40
--- src/share/mk/bsd.kmodule.mk:1.39	Wed Aug  7 17:36:11 2013
+++ src/share/mk/bsd.kmodule.mk	Wed Sep 18 09:25:20 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmodule.mk,v 1.39 2013/08/07 17:36:11 matt Exp $
+#	$NetBSD: bsd.kmodule.mk,v 1.40 2013/09/18 09:25:20 martin Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -36,6 +36,11 @@ CFLAGS+=	-mlongcall
 CFLAGS+=	-fno-pic
 .endif
 
+.if ${MACHINE} == sparc64
+# force same memory model as rest of the kernel
+CFLAGS+=	-mcmodel=medlow
+.endif
+
 # evbppc needs some special help
 .if ${MACHINE} == evbppc
 



CVS commit: src/sys/arch/vax/include

2013-09-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 18 13:31:39 UTC 2013

Modified Files:
src/sys/arch/vax/include: vmparam.h

Log Message:
Bump MAXTSIZ to 32 MB (it is an arbitrary limit anyway)


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/vax/include/vmparam.h

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

Modified files:

Index: src/sys/arch/vax/include/vmparam.h
diff -u src/sys/arch/vax/include/vmparam.h:1.47 src/sys/arch/vax/include/vmparam.h:1.48
--- src/sys/arch/vax/include/vmparam.h:1.47	Sun Nov 14 13:33:23 2010
+++ src/sys/arch/vax/include/vmparam.h	Wed Sep 18 13:31:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.47 2010/11/14 13:33:23 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.48 2013/09/18 13:31:39 martin Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -62,7 +62,7 @@
  */
 
 #ifndef MAXTSIZ
-#define MAXTSIZ		(8*1024*1024)		/* max text size */
+#define MAXTSIZ		(32*1024*1024)		/* max text size */
 #endif
 #ifndef DFLDSIZ
 #define DFLDSIZ		(128*1024*1024)		/* initial data size limit */



CVS commit: src/sys/dev/pci

2013-09-18 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Sep 18 14:30:45 UTC 2013

Modified Files:
src/sys/dev/pci: files.pci
Added Files:
src/sys/dev/pci: gffb.c gffbreg.h

Log Message:
a preliminary driver for nvidia geforce graphics chips
so far it only supports the GeForce 2MX, tested on macppc only
no acceleration yet, just some DAC setup
the main advantage over genfb is that this driver knows how to setup the
palette registers for the 2nd output


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 src/sys/dev/pci/files.pci
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/gffb.c src/sys/dev/pci/gffbreg.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/files.pci
diff -u src/sys/dev/pci/files.pci:1.366 src/sys/dev/pci/files.pci:1.367
--- src/sys/dev/pci/files.pci:1.366	Wed Aug 21 18:08:29 2013
+++ src/sys/dev/pci/files.pci	Wed Sep 18 14:30:45 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.366 2013/08/21 18:08:29 jakllsch Exp $
+#	$NetBSD: files.pci,v 1.367 2013/09/18 14:30:45 macallan Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -1133,3 +1133,9 @@ defflag	opt_tdvfb.h		TDVFB_CONSOLE
 device	tdvfb: wsemuldisplaydev, rasops16, rasops32, vcons, videomode
 attach	tdvfb at pci
 file	dev/pci/tdvfb.c		tdvfb	
+
+# nvidia geforce framebuffer console driver
+device	gffb: wsemuldisplaydev, rasops8, vcons, videomode, i2cbus, i2c_bitbang, glyphcache
+attach	gffb at pci
+file	dev/pci/gffb.c		gffb
+defflag	opt_gffb.h	GFFB_DEBUG

Added files:

Index: src/sys/dev/pci/gffb.c
diff -u /dev/null src/sys/dev/pci/gffb.c:1.1
--- /dev/null	Wed Sep 18 14:30:45 2013
+++ src/sys/dev/pci/gffb.c	Wed Sep 18 14:30:45 2013
@@ -0,0 +1,622 @@
+/*	$NetBSD: gffb.c,v 1.1 2013/09/18 14:30:45 macallan Exp $	*/
+
+/*
+ * Copyright (c) 2007, 2012 Michael Lorenz
+ * 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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * A console driver for nvidia geforce graphics controllers
+ * tested on macppc only so far
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: gffb.c,v 1.1 2013/09/18 14:30:45 macallan Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/kernel.h
+#include sys/device.h
+#include sys/malloc.h
+#include sys/lwp.h
+#include sys/kauth.h
+
+#include dev/videomode/videomode.h
+
+#include dev/pci/pcivar.h
+#include dev/pci/pcireg.h
+#include dev/pci/pcidevs.h
+#include dev/pci/pciio.h
+#include dev/pci/gffbreg.h
+
+#include dev/wscons/wsdisplayvar.h
+#include dev/wscons/wsconsio.h
+#include dev/wsfont/wsfont.h
+#include dev/rasops/rasops.h
+#include dev/wscons/wsdisplay_vconsvar.h
+#include dev/pci/wsdisplay_pci.h
+#include dev/wscons/wsdisplay_glyphcachevar.h
+
+#include dev/i2c/i2cvar.h
+
+#include opt_gffb.h
+#include opt_vcons.h
+
+#ifdef GFFB_DEBUG
+#define DPRINTF printf
+#else
+#define DPRINTF while(0) printf
+#endif
+
+struct gffb_softc {
+	device_t sc_dev;
+
+	pci_chipset_tag_t sc_pc;
+	pcitag_t sc_pcitag;
+
+	bus_space_tag_t sc_memt;
+	bus_space_tag_t sc_iot;
+
+	bus_space_handle_t sc_regh, sc_fbh;
+	bus_addr_t sc_fb, sc_reg;
+	bus_size_t sc_fbsize, sc_regsize;
+	uint8_t *sc_fbaddr;
+
+	int sc_width, sc_height, sc_depth, sc_stride;
+	int sc_locked;
+	struct vcons_screen sc_console_screen;
+	struct wsscreen_descr sc_defaultscreen_descr;
+	const struct wsscreen_descr *sc_screens[1];
+	struct wsscreen_list sc_screenlist;
+	struct vcons_data vd;
+	int sc_mode;
+	u_char sc_cmap_red[256];
+	u_char sc_cmap_green[256];
+	u_char sc_cmap_blue[256];
+	glyphcache sc_gc;
+};
+
+static int	gffb_match(device_t, cfdata_t, void *);
+static void	

CVS commit: src/sys/sys

2013-09-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 18 14:37:24 UTC 2013

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

Log Message:
s/if (cond) return true; else return false;/return cond;/


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/wapbl.h

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

Modified files:

Index: src/sys/sys/wapbl.h
diff -u src/sys/sys/wapbl.h:1.13 src/sys/sys/wapbl.h:1.14
--- src/sys/sys/wapbl.h:1.13	Sun Nov 20 23:36:06 2011
+++ src/sys/sys/wapbl.h	Wed Sep 18 10:37:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: wapbl.h,v 1.13 2011/11/21 04:36:06 christos Exp $	*/
+/*	$NetBSD: wapbl.h,v 1.14 2013/09/18 14:37:24 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003,2008 The NetBSD Foundation, Inc.
@@ -206,10 +206,7 @@ wapbl_vphaswapbl(struct vnode *vp)
 		return false;
 
 	mp = wapbl_vptomp(vp);
-	if (mp  mp-mnt_wapbl)
-		return true;
-	else
-		return false;
+	return mp  mp-mnt_wapbl;
 }
 
 #endif /* _KERNEL */



CVS commit: src/sys/nfs

2013-09-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 18 16:33:14 UTC 2013

Modified Files:
src/sys/nfs: nfs_subs.c

Log Message:
Use reference counting to keep track of construction and destruction of the
structures used by both the nfs server and client code. Tested by pgoyette@

1. mount remote fs via nfs (my /home directory), which autoloads nfs module
2. manually modload nfsserver
3. wait a bit
4. manually modunload nfsserver
5. wait a couple minutes
6. verify that client access still works (/bin/ls ~paul home dir)
7. manually modload nfsserver again
8. start an nfsd process
9. wait a bit
10. kill nfsd process
11. wait
12. manually modunload nfsserver again
13. verify continued client access

XXX: Note that nfs_vfs_init() calls nfs_init(), but nfs_vfs_done() does not
 call nfs_fini(). Also note that the destruction order is wrong in it,
 but probably does not matter. someone (!= me) should fix it :-) and
 run the above tests.


To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/sys/nfs/nfs_subs.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/nfs/nfs_subs.c
diff -u src/sys/nfs/nfs_subs.c:1.222 src/sys/nfs/nfs_subs.c:1.223
--- src/sys/nfs/nfs_subs.c:1.222	Sat Nov 19 17:51:30 2011
+++ src/sys/nfs/nfs_subs.c	Wed Sep 18 12:33:14 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_subs.c,v 1.222 2011/11/19 22:51:30 tls Exp $	*/
+/*	$NetBSD: nfs_subs.c,v 1.223 2013/09/18 16:33:14 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_subs.c,v 1.222 2011/11/19 22:51:30 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_subs.c,v 1.223 2013/09/18 16:33:14 christos Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -1502,27 +1502,40 @@ nfs_init0(void)
 	return 0;
 }
 
+static volatile uint32_t nfs_mutex;
+static uint32_t nfs_refcount;
+
+#define nfs_p()	while (atomic_cas_32(nfs_mutex, 0, 1) == 0) continue;
+#define nfs_v()	while (atomic_cas_32(nfs_mutex, 1, 0) == 1) continue;
+
 /*
  * This is disgusting, but it must support both modular and monolothic
- * configurations.  For monolithic builds NFSSERVER may not imply NFS.
+ * configurations, plus the code is shared between server and client.
+ * For monolithic builds NFSSERVER may not imply NFS. Unfortunately we
+ * can't use regular mutexes here that would require static initialization
+ * and we can get initialized from multiple places, so we improvise.
  *
  * Yuck.
  */
 void
 nfs_init(void)
 {
-	static ONCE_DECL(nfs_init_once);
-
-	RUN_ONCE(nfs_init_once, nfs_init0);
+	nfs_p();
+	if (nfs_refcount++ == 0)
+		nfs_init0();
+	nfs_v();
 }
 
 void
 nfs_fini(void)
 {
-
-	nfsdreq_fini();
-	nfs_timer_fini();
-	MOWNER_DETACH(nfs_mowner);
+	nfs_p();
+	if (--nfs_refcount == 0) {
+		MOWNER_DETACH(nfs_mowner);
+		nfs_timer_fini();
+		nfsdreq_fini();
+	}
+	nfs_v();
 }
 
 /*



CVS commit: [netbsd-5] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:45:15 UTC 2013

Modified Files:
src/doc [netbsd-5]: CHANGES-5.3

Log Message:
ticket 1877


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-5.3

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

Modified files:

Index: src/doc/CHANGES-5.3
diff -u src/doc/CHANGES-5.3:1.1.2.27 src/doc/CHANGES-5.3:1.1.2.28
--- src/doc/CHANGES-5.3:1.1.2.27	Wed Sep 18 03:42:21 2013
+++ src/doc/CHANGES-5.3	Wed Sep 18 19:45:15 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.3,v 1.1.2.27 2013/09/18 03:42:21 msaitoh Exp $
+# $NetBSD: CHANGES-5.3,v 1.1.2.28 2013/09/18 19:45:15 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3
 release:
@@ -556,3 +556,11 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #1876]
+xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
+
+	The size of the arrays is max_key_code + 1. This makes these functions
+	consistent with the other checks added for CVE-2013-1997.
+	Check the XkbGetNames reply when names-keys was just allocated
+	Should fix PR lib/48170.
+	[riz, ticket #1877]
+



CVS commit: [netbsd-5-1] xsrc/external/mit/libX11/dist/src/xkb

2013-09-18 Thread Manuel Bouyer
Module Name:xsrc
Committed By:   bouyer
Date:   Wed Sep 18 19:45:40 UTC 2013

Modified Files:
xsrc/external/mit/libX11/dist/src/xkb [netbsd-5-1]: XKBGetMap.c
XKBNames.c

Log Message:
Apply patch, requested by riz in ticket #1877
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.cpatch

The size of the arrays is max_key_code + 1. This makes these functions
consistent with the other checks added for CVE-2013-1997.
Check the XkbGetNames reply when names-keys was just allocated
Should fix PR lib/48170.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.1.2.1 -r1.1.1.1.2.1.2.2 \
xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c \
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.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/libX11/dist/src/xkb/XKBGetMap.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.1.2.1.2.1 xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.1.2.1.2.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.1.2.1.2.1	Thu Jun  6 16:39:19 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	Wed Sep 18 19:45:40 2013
@@ -431,7 +431,7 @@ XkbServerMapPtr		srv;
 
 if ( rep-totalVModMapKeys0 ) {
 	if (((int) rep-firstVModMapKey + rep-nVModMapKeys)
-	  xkb-max_key_code)
+	  xkb-max_key_code + 1)
 	return BadLength;
 	if (((xkb-server==NULL)||(xkb-server-vmodmap==NULL))
 	(XkbAllocServerMap(xkb,XkbVirtualModMapMask,0)!=Success)) {
Index: xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.1.2.1.2.1 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.1.2.1.2.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.1.2.1.2.1	Thu Jun  6 16:39:19 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	Wed Sep 18 19:45:40 2013
@@ -184,7 +184,7 @@ _XkbReadGetNamesReply(	Display *		dpy,
 	nKeys= xkb-max_key_code+1;
 	names-keys= _XkbTypedCalloc(nKeys,XkbKeyNameRec);
 	}
-	else if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code)
+	if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code + 1)
 	goto BAILOUT;
 	if (names-keys!=NULL) {
 	if (!_XkbCopyFromReadBuffer(buf,



CVS commit: [netbsd-5-2] xsrc/external/mit/libX11/dist/src/xkb

2013-09-18 Thread Manuel Bouyer
Module Name:xsrc
Committed By:   bouyer
Date:   Wed Sep 18 19:46:23 UTC 2013

Modified Files:
xsrc/external/mit/libX11/dist/src/xkb [netbsd-5-2]: XKBGetMap.c
XKBNames.c

Log Message:
Apply patch, requested by riz in ticket #1877
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.cpatch

The size of the arrays is max_key_code + 1. This makes these functions
consistent with the other checks added for CVE-2013-1997.
Check the XkbGetNames reply when names-keys was just allocated
Should fix PR lib/48170.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.1.4.1 -r1.1.1.1.2.1.4.2 \
xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c \
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.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/libX11/dist/src/xkb/XKBGetMap.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.1.2.1.4.1 xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.1.2.1.4.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.1.2.1.4.1	Thu Jun  6 16:40:00 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	Wed Sep 18 19:46:23 2013
@@ -431,7 +431,7 @@ XkbServerMapPtr		srv;
 
 if ( rep-totalVModMapKeys0 ) {
 	if (((int) rep-firstVModMapKey + rep-nVModMapKeys)
-	  xkb-max_key_code)
+	  xkb-max_key_code + 1)
 	return BadLength;
 	if (((xkb-server==NULL)||(xkb-server-vmodmap==NULL))
 	(XkbAllocServerMap(xkb,XkbVirtualModMapMask,0)!=Success)) {
Index: xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.1.2.1.4.1 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.1.2.1.4.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.1.2.1.4.1	Thu Jun  6 16:40:00 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	Wed Sep 18 19:46:23 2013
@@ -184,7 +184,7 @@ _XkbReadGetNamesReply(	Display *		dpy,
 	nKeys= xkb-max_key_code+1;
 	names-keys= _XkbTypedCalloc(nKeys,XkbKeyNameRec);
 	}
-	else if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code)
+	if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code + 1)
 	goto BAILOUT;
 	if (names-keys!=NULL) {
 	if (!_XkbCopyFromReadBuffer(buf,



CVS commit: [netbsd-5-1] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:46:01 UTC 2013

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.3

Log Message:
ticket 1877


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.47 -r1.1.2.48 src/doc/CHANGES-5.1.3

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

Modified files:

Index: src/doc/CHANGES-5.1.3
diff -u src/doc/CHANGES-5.1.3:1.1.2.47 src/doc/CHANGES-5.1.3:1.1.2.48
--- src/doc/CHANGES-5.1.3:1.1.2.47	Wed Sep 18 03:45:18 2013
+++ src/doc/CHANGES-5.1.3	Wed Sep 18 19:46:01 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.3,v 1.1.2.47 2013/09/18 03:45:18 msaitoh Exp $
+# $NetBSD: CHANGES-5.1.3,v 1.1.2.48 2013/09/18 19:46:01 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3
 release:
@@ -2531,3 +2531,11 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #1876]
+xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
+
+	The size of the arrays is max_key_code + 1. This makes these functions
+	consistent with the other checks added for CVE-2013-1997.
+	Check the XkbGetNames reply when names-keys was just allocated
+	Should fix PR lib/48170.
+	[riz, ticket #1877]
+



CVS commit: [netbsd-5-2] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:46:41 UTC 2013

Modified Files:
src/doc [netbsd-5-2]: CHANGES-5.2.1

Log Message:
ticket 1877


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-5.2.1

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

Modified files:

Index: src/doc/CHANGES-5.2.1
diff -u src/doc/CHANGES-5.2.1:1.1.2.15 src/doc/CHANGES-5.2.1:1.1.2.16
--- src/doc/CHANGES-5.2.1:1.1.2.15	Wed Sep 18 03:44:01 2013
+++ src/doc/CHANGES-5.2.1	Wed Sep 18 19:46:41 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2.1,v 1.1.2.15 2013/09/18 03:44:01 msaitoh Exp $
+# $NetBSD: CHANGES-5.2.1,v 1.1.2.16 2013/09/18 19:46:41 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.2.1
 release:
@@ -245,3 +245,11 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #1876]
+xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
+
+	The size of the arrays is max_key_code + 1. This makes these functions
+	consistent with the other checks added for CVE-2013-1997.
+	Check the XkbGetNames reply when names-keys was just allocated
+	Should fix PR lib/48170.
+	[riz, ticket #1877]
+



CVS commit: [netbsd-5-2] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:48:25 UTC 2013

Modified Files:
src/doc [netbsd-5-2]: CHANGES-5.2.1

Log Message:
fix ticket 1877


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.16 -r1.1.2.17 src/doc/CHANGES-5.2.1

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

Modified files:

Index: src/doc/CHANGES-5.2.1
diff -u src/doc/CHANGES-5.2.1:1.1.2.16 src/doc/CHANGES-5.2.1:1.1.2.17
--- src/doc/CHANGES-5.2.1:1.1.2.16	Wed Sep 18 19:46:41 2013
+++ src/doc/CHANGES-5.2.1	Wed Sep 18 19:48:25 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2.1,v 1.1.2.16 2013/09/18 19:46:41 bouyer Exp $
+# $NetBSD: CHANGES-5.2.1,v 1.1.2.17 2013/09/18 19:48:25 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.2.1
 release:
@@ -246,6 +246,7 @@ sys/netinet6/in6.c1.167 via patch
 	FreeBSD.
 	[spz, ticket #1876]
 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
+xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	patch
 
 	The size of the arrays is max_key_code + 1. This makes these functions
 	consistent with the other checks added for CVE-2013-1997.



CVS commit: [netbsd-5] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:49:16 UTC 2013

Modified Files:
src/doc [netbsd-5]: CHANGES-5.3

Log Message:
fix ticket 1877


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.28 -r1.1.2.29 src/doc/CHANGES-5.3

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

Modified files:

Index: src/doc/CHANGES-5.3
diff -u src/doc/CHANGES-5.3:1.1.2.28 src/doc/CHANGES-5.3:1.1.2.29
--- src/doc/CHANGES-5.3:1.1.2.28	Wed Sep 18 19:45:15 2013
+++ src/doc/CHANGES-5.3	Wed Sep 18 19:49:16 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.3,v 1.1.2.28 2013/09/18 19:45:15 bouyer Exp $
+# $NetBSD: CHANGES-5.3,v 1.1.2.29 2013/09/18 19:49:16 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3
 release:
@@ -556,7 +556,9 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #1876]
+
 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
+xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	patch
 
 	The size of the arrays is max_key_code + 1. This makes these functions
 	consistent with the other checks added for CVE-2013-1997.



CVS commit: [netbsd-5-1] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:48:51 UTC 2013

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.3

Log Message:
fix ticket 1877


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.48 -r1.1.2.49 src/doc/CHANGES-5.1.3

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

Modified files:

Index: src/doc/CHANGES-5.1.3
diff -u src/doc/CHANGES-5.1.3:1.1.2.48 src/doc/CHANGES-5.1.3:1.1.2.49
--- src/doc/CHANGES-5.1.3:1.1.2.48	Wed Sep 18 19:46:01 2013
+++ src/doc/CHANGES-5.1.3	Wed Sep 18 19:48:51 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.3,v 1.1.2.48 2013/09/18 19:46:01 bouyer Exp $
+# $NetBSD: CHANGES-5.1.3,v 1.1.2.49 2013/09/18 19:48:51 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3
 release:
@@ -2531,7 +2531,9 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #1876]
+
 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
+xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	patch
 
 	The size of the arrays is max_key_code + 1. This makes these functions
 	consistent with the other checks added for CVE-2013-1997.



CVS commit: [netbsd-5-2] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:49:42 UTC 2013

Modified Files:
src/doc [netbsd-5-2]: CHANGES-5.2.1

Log Message:
Formatting fix


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.17 -r1.1.2.18 src/doc/CHANGES-5.2.1

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

Modified files:

Index: src/doc/CHANGES-5.2.1
diff -u src/doc/CHANGES-5.2.1:1.1.2.17 src/doc/CHANGES-5.2.1:1.1.2.18
--- src/doc/CHANGES-5.2.1:1.1.2.17	Wed Sep 18 19:48:25 2013
+++ src/doc/CHANGES-5.2.1	Wed Sep 18 19:49:42 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2.1,v 1.1.2.17 2013/09/18 19:48:25 bouyer Exp $
+# $NetBSD: CHANGES-5.2.1,v 1.1.2.18 2013/09/18 19:49:42 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.2.1
 release:
@@ -245,6 +245,7 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #1876]
+
 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
 xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	patch
 



CVS commit: [netbsd-6] xsrc/external/mit/libX11/dist/src/xkb

2013-09-18 Thread Manuel Bouyer
Module Name:xsrc
Committed By:   bouyer
Date:   Wed Sep 18 19:52:37 UTC 2013

Modified Files:
xsrc/external/mit/libX11/dist/src/xkb [netbsd-6]: XKBGetMap.c
XKBNames.c

Log Message:
Apply patch, requested by riz in ticket #945
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.cpatch
xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c   patch

The size of the arrays is max_key_code + 1. This makes these functions
consistent with the other checks added for CVE-2013-1997.
Check the XkbGetNames reply when names-keys was just allocated
Should fix PR lib/48170.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4.2.1 -r1.1.1.4.2.2 \
xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c \
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.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/libX11/dist/src/xkb/XKBGetMap.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.4.2.1 xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.4.2.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.4.2.1	Thu Jun  6 03:44:25 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	Wed Sep 18 19:52:37 2013
@@ -426,7 +426,7 @@ XkbServerMapPtr		srv;
 
 if ( rep-totalVModMapKeys0 ) {
 	if (((int) rep-firstVModMapKey + rep-nVModMapKeys)
-	  xkb-max_key_code)
+	  xkb-max_key_code + 1)
 	return BadLength;
 	if (((xkb-server==NULL)||(xkb-server-vmodmap==NULL))
 	(XkbAllocServerMap(xkb,XkbVirtualModMapMask,0)!=Success)) {
Index: xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.4.2.1 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.4.2.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.4.2.1	Thu Jun  6 03:44:25 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	Wed Sep 18 19:52:37 2013
@@ -180,7 +180,7 @@ _XkbReadGetNamesReply(	Display *		dpy,
 	nKeys= xkb-max_key_code+1;
 	names-keys= _XkbTypedCalloc(nKeys,XkbKeyNameRec);
 	}
-	else if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code)
+	if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code + 1)
 	goto BAILOUT;
 	if (names-keys!=NULL) {
 	if (!_XkbCopyFromReadBuffer(buf,



CVS commit: [netbsd-6] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:53:23 UTC 2013

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
ticket 945


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.40 -r1.1.2.41 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.40 src/doc/CHANGES-6.2:1.1.2.41
--- src/doc/CHANGES-6.2:1.1.2.40	Wed Sep 18 03:23:28 2013
+++ src/doc/CHANGES-6.2	Wed Sep 18 19:53:23 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.40 2013/09/18 03:23:28 msaitoh Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.41 2013/09/18 19:53:23 bouyer Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -715,3 +715,12 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #944]
+xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
+xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	patch
+
+	The size of the arrays is max_key_code + 1. This makes these functions
+	consistent with the other checks added for CVE-2013-1997.
+	Check the XkbGetNames reply when names-keys was just allocated
+	Should fix PR lib/48170.
+	[riz, ticket #945]
+



CVS commit: [netbsd-6-0] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:53:57 UTC 2013

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.3

Log Message:
ticket 945


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/doc/CHANGES-6.0.3

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

Modified files:

Index: src/doc/CHANGES-6.0.3
diff -u src/doc/CHANGES-6.0.3:1.1.2.22 src/doc/CHANGES-6.0.3:1.1.2.23
--- src/doc/CHANGES-6.0.3:1.1.2.22	Wed Sep 18 03:26:27 2013
+++ src/doc/CHANGES-6.0.3	Wed Sep 18 19:53:57 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.3,v 1.1.2.22 2013/09/18 03:26:27 msaitoh Exp $
+# $NetBSD: CHANGES-6.0.3,v 1.1.2.23 2013/09/18 19:53:57 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.0.2 release to the NetBSD 6.0.3
 release:
@@ -224,3 +224,12 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #944]
+xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
+xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	patch
+
+	The size of the arrays is max_key_code + 1. This makes these functions
+	consistent with the other checks added for CVE-2013-1997.
+	Check the XkbGetNames reply when names-keys was just allocated
+	Should fix PR lib/48170.
+	[riz, ticket #945]
+



CVS commit: [netbsd-6-0] xsrc/external/mit/libX11/dist/src/xkb

2013-09-18 Thread Manuel Bouyer
Module Name:xsrc
Committed By:   bouyer
Date:   Wed Sep 18 19:53:43 UTC 2013

Modified Files:
xsrc/external/mit/libX11/dist/src/xkb [netbsd-6-0]: XKBGetMap.c
XKBNames.c

Log Message:
Apply patch, requested by riz in ticket #945
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.cpatch
xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c   patch

The size of the arrays is max_key_code + 1. This makes these functions
consistent with the other checks added for CVE-2013-1997.
Check the XkbGetNames reply when names-keys was just allocated
Should fix PR lib/48170.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4.4.1 -r1.1.1.4.4.2 \
xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c \
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.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/libX11/dist/src/xkb/XKBGetMap.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.4.4.1 xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.4.4.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.4.4.1	Thu Jun  6 03:52:04 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	Wed Sep 18 19:53:43 2013
@@ -426,7 +426,7 @@ XkbServerMapPtr		srv;
 
 if ( rep-totalVModMapKeys0 ) {
 	if (((int) rep-firstVModMapKey + rep-nVModMapKeys)
-	  xkb-max_key_code)
+	  xkb-max_key_code + 1)
 	return BadLength;
 	if (((xkb-server==NULL)||(xkb-server-vmodmap==NULL))
 	(XkbAllocServerMap(xkb,XkbVirtualModMapMask,0)!=Success)) {
Index: xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.4.4.1 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.4.4.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.4.4.1	Thu Jun  6 03:52:04 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	Wed Sep 18 19:53:43 2013
@@ -180,7 +180,7 @@ _XkbReadGetNamesReply(	Display *		dpy,
 	nKeys= xkb-max_key_code+1;
 	names-keys= _XkbTypedCalloc(nKeys,XkbKeyNameRec);
 	}
-	else if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code)
+	if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code + 1)
 	goto BAILOUT;
 	if (names-keys!=NULL) {
 	if (!_XkbCopyFromReadBuffer(buf,



CVS commit: [netbsd-6-1] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 19:54:30 UTC 2013

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.2

Log Message:
ticket 945


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/doc/CHANGES-6.1.2

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

Modified files:

Index: src/doc/CHANGES-6.1.2
diff -u src/doc/CHANGES-6.1.2:1.1.2.7 src/doc/CHANGES-6.1.2:1.1.2.8
--- src/doc/CHANGES-6.1.2:1.1.2.7	Wed Sep 18 03:25:15 2013
+++ src/doc/CHANGES-6.1.2	Wed Sep 18 19:54:30 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.2,v 1.1.2.7 2013/09/18 03:25:15 msaitoh Exp $
+# $NetBSD: CHANGES-6.1.2,v 1.1.2.8 2013/09/18 19:54:30 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.1.1 release to the NetBSD 6.1.2
 release:
@@ -76,3 +76,12 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #944]
+xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
+xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	patch
+
+	The size of the arrays is max_key_code + 1. This makes these functions
+	consistent with the other checks added for CVE-2013-1997.
+	Check the XkbGetNames reply when names-keys was just allocated
+	Should fix PR lib/48170.
+	[riz, ticket #945]
+



CVS commit: [netbsd-6-1] xsrc/external/mit/libX11/dist/src/xkb

2013-09-18 Thread Manuel Bouyer
Module Name:xsrc
Committed By:   bouyer
Date:   Wed Sep 18 19:54:17 UTC 2013

Modified Files:
xsrc/external/mit/libX11/dist/src/xkb [netbsd-6-1]: XKBGetMap.c
XKBNames.c

Log Message:
Apply patch, requested by riz in ticket #945
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.cpatch
xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c   patch

The size of the arrays is max_key_code + 1. This makes these functions
consistent with the other checks added for CVE-2013-1997.
Check the XkbGetNames reply when names-keys was just allocated
Should fix PR lib/48170.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4.6.1 -r1.1.1.4.6.2 \
xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c \
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.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/libX11/dist/src/xkb/XKBGetMap.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.4.6.1 xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.4.6.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c:1.1.1.4.6.1	Thu Jun  6 03:50:17 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	Wed Sep 18 19:54:17 2013
@@ -426,7 +426,7 @@ XkbServerMapPtr		srv;
 
 if ( rep-totalVModMapKeys0 ) {
 	if (((int) rep-firstVModMapKey + rep-nVModMapKeys)
-	  xkb-max_key_code)
+	  xkb-max_key_code + 1)
 	return BadLength;
 	if (((xkb-server==NULL)||(xkb-server-vmodmap==NULL))
 	(XkbAllocServerMap(xkb,XkbVirtualModMapMask,0)!=Success)) {
Index: xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c
diff -u xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.4.6.1 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.4.6.2
--- xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c:1.1.1.4.6.1	Thu Jun  6 03:50:17 2013
+++ xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	Wed Sep 18 19:54:17 2013
@@ -180,7 +180,7 @@ _XkbReadGetNamesReply(	Display *		dpy,
 	nKeys= xkb-max_key_code+1;
 	names-keys= _XkbTypedCalloc(nKeys,XkbKeyNameRec);
 	}
-	else if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code)
+	if ( ((int)rep-firstKey + rep-nKeys)  xkb-max_key_code + 1)
 	goto BAILOUT;
 	if (names-keys!=NULL) {
 	if (!_XkbCopyFromReadBuffer(buf,



CVS commit: [netbsd-6] src/sys

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 20:00:53 UTC 2013

Modified Files:
src/sys/arch/sandpoint/stand/altboot [netbsd-6]: brdsetup.c rge.c
src/sys/dev/ic [netbsd-6]: rtl8169.c

Log Message:
Pull up following revision(s) (requested by phx in ticket #946):
sys/arch/sandpoint/stand/altboot/rge.c: revision 1.7
sys/arch/sandpoint/stand/altboot/brdsetup.c: revision 1.32
sys/dev/ic/rtl8169.c: revision 1.138
QNAP V200 boards have no EEPROM for the MAC address, so all devices default
to the same address (00:e0:4c:69:20:01).
Now we read the real MAC address from the flash ROM. It is stored at the
beginning of a 512-byte block in ASCII format. Some QNAP's have a broken
ext2 file system, so we cannot look for the file ETH0.MAC_ADDR therein,
but have to search the whole flash in 512-byte steps for candidates...
Make re(4) driver always use IDR register values for its MAC address.
Some sandpoint NAS firmwares set MAC address per their
firmware settings and don't use re(4)'s EEPROM values.
Per rtl8169 manuals re(4) chip reads EEPROM automatically after
hardware reset and Linux driver also uses IDR registers,
so this change should not affect existing other boards
which actually have vaild EEPROM.
Per discussion in old tech-kern@ thread:
http://mail-index.netbsd.org/tech-kern/2012/12/01/msg014573.html
Note rtl81x9.c is still shared among rtk(4) only for a multicast function
(to avoid boring refactoring work).


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.27.2.1 \
src/sys/arch/sandpoint/stand/altboot/brdsetup.c
cvs rdiff -u -r1.6 -r1.6.8.1 src/sys/arch/sandpoint/stand/altboot/rge.c
cvs rdiff -u -r1.134.4.2 -r1.134.4.3 src/sys/dev/ic/rtl8169.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.27 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.27.2.1
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.27	Sat Jan 14 22:36:54 2012
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Wed Sep 18 20:00:53 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.27 2012/01/14 22:36:54 phx Exp $ */
+/* $NetBSD: brdsetup.c,v 1.27.2.1 2013/09/18 20:00:53 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -1181,6 +1181,41 @@ read_mac_string(uint8_t *mac, char *p)
 }
 
 /*
+ * Scan through the Flash memory and look for a string starting at 512 bytes
+ * block boundaries, matching the format: xx:xx:xx:xx:xx:xxNUL, where x
+ * are hexadecimal digits.
+ * Read the first match as our MAC address.
+ * The start address of the search, p, *must* be dividable by 512!
+ * Return false when no suitable MAC string was found.
+ */
+static int
+find_mac_string(uint8_t *mac, char *p)
+{
+	int i;
+
+	for (;;) {
+		for (i = 0; i  3 * 6; i += 3) {
+			if (!isxdigit((unsigned)p[i]) ||
+			!isxdigit((unsigned)p[i + 1]))
+break;
+			if ((i  5  p[i + 2] != ':') ||
+			(i = 5  p[i + 2] != '\0'))
+break;
+		}
+		if (i = 6) {
+			/* found a valid MAC address */
+			read_mac_string(mac, p);
+			return 1;
+		}
+		if (p = (char *)0xfe00)
+			break;
+		p += 0x200;
+	}
+	return 0;
+}
+
+
+/*
  * For cost saving reasons some NAS boxes lack SEEPROM for NIC's
  * ethernet address and keep it in their Flash memory instead.
  */
@@ -1199,6 +1234,10 @@ read_mac_from_flash(uint8_t *mac)
 	case BRD_DLINKDSM:
 		read_mac_string(mac, (char *)0xfff0ff80);
 		return;
+	case BRD_QNAPTS:
+		if (find_mac_string(mac, (char *)0xfff0))
+			return;
+		break;
 	default:
 		printf(Warning: This board has no known method defined 
 		to determine its MAC address!\n);

Index: src/sys/arch/sandpoint/stand/altboot/rge.c
diff -u src/sys/arch/sandpoint/stand/altboot/rge.c:1.6 src/sys/arch/sandpoint/stand/altboot/rge.c:1.6.8.1
--- src/sys/arch/sandpoint/stand/altboot/rge.c:1.6	Sun Oct 30 21:08:33 2011
+++ src/sys/arch/sandpoint/stand/altboot/rge.c	Wed Sep 18 20:00:53 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: rge.c,v 1.6 2011/10/30 21:08:33 phx Exp $ */
+/* $NetBSD: rge.c,v 1.6.8.1 2013/09/18 20:00:53 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -102,6 +102,9 @@ struct desc {
 #define	 RCR_AM		(1U  2)	/* accept multicast frame */
 #define	 RCR_APM	(1U  1)	/* accept unicast frame */
 #define	 RCR_AAP	(1U  0)	/* promiscuous */
+#define RGE_EECMD	0x50		/* EEPROM command register */
+#define  EECMD_LOCK	0x00
+#define  EECMD_UNLOCK	0xc0
 #define RGE_PHYAR	0x60		/* PHY access */
 #define RGE_PHYSR	0x6c		/* PHY status */
 #define RGE_RMS		0xda		/* Rx maximum frame size */
@@ -146,7 +149,8 @@ rge_init(unsigned tag, void *data)
 	unsigned val;
 	struct local *l;
 	struct desc *txd, *rxd;
-	uint8_t *en = data;
+	uint32_t reg;
+	uint8_t *en;
 
 	l = ALLOC(struct local, 256);	/* desc alignment */
 	memset(l, 0, sizeof(struct local));
@@ -158,14 +162,27 @@ 

CVS commit: [netbsd-6] src/doc

2013-09-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 18 20:01:20 UTC 2013

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
ticket 946


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.41 -r1.1.2.42 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.41 src/doc/CHANGES-6.2:1.1.2.42
--- src/doc/CHANGES-6.2:1.1.2.41	Wed Sep 18 19:53:23 2013
+++ src/doc/CHANGES-6.2	Wed Sep 18 20:01:20 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.41 2013/09/18 19:53:23 bouyer Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.42 2013/09/18 20:01:20 bouyer Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -724,3 +724,11 @@ xsrc/external/mit/libX11/dist/src/xkb/XK
 	Should fix PR lib/48170.
 	[riz, ticket #945]
 
+sys/arch/sandpoint/stand/altboot/brdsetup.c	1.32
+sys/arch/sandpoint/stand/altboot/rge.c		1.7
+sys/dev/ic/rtl8169.c1.138
+
+	Fix ethernet address for the onboard re(4) for boards without eeprom
+	(QNAP V200) and some sandpoint NAS.
+	[phx, ticket #946]
+



CVS commit: src/lib/csu/common

2013-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Sep 18 22:53:39 UTC 2013

Modified Files:
src/lib/csu/common: Makefile.inc

Log Message:
Fix previous: use PICFLAGS for crtbeginS.o
Should unbreak sh3 builds.

XXX: PICFLAGS is defined in bsd.lib.mk which lib/csu does not use.
For now supply a local definition.  joerg@, please fix appropriately.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/csu/common/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/lib/csu/common/Makefile.inc
diff -u src/lib/csu/common/Makefile.inc:1.18 src/lib/csu/common/Makefile.inc:1.19
--- src/lib/csu/common/Makefile.inc:1.18	Thu Sep 12 15:36:15 2013
+++ src/lib/csu/common/Makefile.inc	Wed Sep 18 22:53:39 2013
@@ -1,7 +1,10 @@
-#	$NetBSD: Makefile.inc,v 1.18 2013/09/12 15:36:15 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.19 2013/09/18 22:53:39 uwe Exp $
 
 .include bsd.own.mk
 
+# XXX: FIXME: This is defined in bsd.lib.mk
+PICFLAGS ?= -fPIC
+
 COMMON_DIR:=	${.CURDIR}/common
 .PATH:		${COMMON_DIR}
 
@@ -38,11 +41,11 @@ crtbegin.o: crtbegin.c crtbegin.h
 .if exists(${ARCHDIR}/crtbegin.S)
 crtbeginS.o: crtbegin.S
 	${_MKTARGET_COMPILE}
-	${COMPILE.S} -DPIC -DSHARED ${ARCHDIR}/crtbegin.S -o ${.TARGET}.o
+	${COMPILE.S} ${PICFLAGS} -DSHARED ${ARCHDIR}/crtbegin.S -o ${.TARGET}.o
 .else
 crtbeginS.o: crtbegin.c crtbegin.h
 	${_MKTARGET_COMPILE}
-	${COMPILE.c} -fPIC -DPIC -DSHARED ${COMMON_DIR}/crtbegin.c -o ${.TARGET}.o
+	${COMPILE.c} ${PICFLAGS} -DSHARED ${COMMON_DIR}/crtbegin.c -o ${.TARGET}.o
 .endif
 	${LD} -x -r -o ${.TARGET} ${.TARGET}.o
 	rm -f ${.TARGET}.o



CVS commit: src/games/fortune/strfile

2013-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Sep 18 23:18:14 UTC 2013

Modified Files:
src/games/fortune/strfile: strfile.c

Log Message:
#include nbtool_config.h to pull in getprogname() declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/games/fortune/strfile/strfile.c

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

Modified files:

Index: src/games/fortune/strfile/strfile.c
diff -u src/games/fortune/strfile/strfile.c:1.35 src/games/fortune/strfile/strfile.c:1.36
--- src/games/fortune/strfile/strfile.c:1.35	Sat Oct 13 20:42:56 2012
+++ src/games/fortune/strfile/strfile.c	Wed Sep 18 23:18:14 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: strfile.c,v 1.35 2012/10/13 20:42:56 dholland Exp $	*/
+/*	$NetBSD: strfile.c,v 1.36 2013/09/18 23:18:14 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -32,6 +32,10 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include nbtool_config.h
+#endif
+
 #ifdef __NetBSD__
 #include sys/cdefs.h
 #ifndef lint
@@ -43,7 +47,7 @@ __COPYRIGHT(@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = @(#)strfile.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: strfile.c,v 1.35 2012/10/13 20:42:56 dholland Exp $);
+__RCSID($NetBSD: strfile.c,v 1.36 2013/09/18 23:18:14 uwe Exp $);
 #endif
 #endif /* not lint */
 #endif /* __NetBSD__ */



CVS commit: src/sys/nfs

2013-09-18 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Sep 18 23:27:38 UTC 2013

Modified Files:
src/sys/nfs: nfs_subs.c

Log Message:
knf (blank line even if there are no local declarations)


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/sys/nfs/nfs_subs.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/nfs/nfs_subs.c
diff -u src/sys/nfs/nfs_subs.c:1.223 src/sys/nfs/nfs_subs.c:1.224
--- src/sys/nfs/nfs_subs.c:1.223	Wed Sep 18 16:33:14 2013
+++ src/sys/nfs/nfs_subs.c	Wed Sep 18 23:27:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_subs.c,v 1.223 2013/09/18 16:33:14 christos Exp $	*/
+/*	$NetBSD: nfs_subs.c,v 1.224 2013/09/18 23:27:38 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_subs.c,v 1.223 2013/09/18 16:33:14 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_subs.c,v 1.224 2013/09/18 23:27:38 pgoyette Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -1520,6 +1520,7 @@ static uint32_t nfs_refcount;
 void
 nfs_init(void)
 {
+
 	nfs_p();
 	if (nfs_refcount++ == 0)
 		nfs_init0();
@@ -1529,6 +1530,7 @@ nfs_init(void)
 void
 nfs_fini(void)
 {
+
 	nfs_p();
 	if (--nfs_refcount == 0) {
 		MOWNER_DETACH(nfs_mowner);



CVS commit: src/sys

2013-09-18 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Sep 18 23:34:55 UTC 2013

Modified Files:
src/sys/external/bsd/ipf/netinet: fil.c
src/sys/net: bpf.c bpf.h bpf_filter.c if_ppp.c
src/sys/net/npf: npf_ruleset.c

Log Message:
Add bpf_filter_ext() to use with BPF COP, restore bpf_filter() as it was
originally to preserve compatibility.  Similarly, add bpf_validate_ext()
which takes bpf_ctx_t.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/ipf/netinet/fil.c
cvs rdiff -u -r1.176 -r1.177 src/sys/net/bpf.c
cvs rdiff -u -r1.61 -r1.62 src/sys/net/bpf.h
cvs rdiff -u -r1.57 -r1.58 src/sys/net/bpf_filter.c
cvs rdiff -u -r1.140 -r1.141 src/sys/net/if_ppp.c
cvs rdiff -u -r1.22 -r1.23 src/sys/net/npf/npf_ruleset.c

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

Modified files:

Index: src/sys/external/bsd/ipf/netinet/fil.c
diff -u src/sys/external/bsd/ipf/netinet/fil.c:1.11 src/sys/external/bsd/ipf/netinet/fil.c:1.12
--- src/sys/external/bsd/ipf/netinet/fil.c:1.11	Thu Sep 12 20:03:10 2013
+++ src/sys/external/bsd/ipf/netinet/fil.c	Wed Sep 18 23:34:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fil.c,v 1.11 2013/09/12 20:03:10 martin Exp $	*/
+/*	$NetBSD: fil.c,v 1.12 2013/09/18 23:34:55 rmind Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -138,7 +138,7 @@ extern struct timeout ipf_slowtimer_ch;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fil.c,v 1.11 2013/09/12 20:03:10 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: fil.c,v 1.12 2013/09/18 23:34:55 rmind Exp $);
 #else
 static const char sccsid[] = @(#)fil.c	1.36 6/5/96 (C) 1993-2000 Darren Reed;
 static const char rcsid[] = @(#)Id: fil.c,v 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $;
@@ -2405,14 +2405,8 @@ ipf_scanlist(fr_info_t *fin, u_32_t pass
 continue;
 			mc = (u_char *)fin-fin_m;
 			wlen = fin-fin_dlen + fin-fin_hlen;
-#if defined(__NetBSD__)
-			if (!bpf_filter(bpf_def_ctx, NULL,
-			fr-fr_data, mc, wlen, 0))
-continue;
-#else
 			if (!bpf_filter(fr-fr_data, mc, wlen, 0))
 continue;
-#endif
 			break;
 		}
 #endif

Index: src/sys/net/bpf.c
diff -u src/sys/net/bpf.c:1.176 src/sys/net/bpf.c:1.177
--- src/sys/net/bpf.c:1.176	Mon Sep  9 20:53:51 2013
+++ src/sys/net/bpf.c	Wed Sep 18 23:34:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.176 2013/09/09 20:53:51 christos Exp $	*/
+/*	$NetBSD: bpf.c,v 1.177 2013/09/18 23:34:55 rmind Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.176 2013/09/09 20:53:51 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.177 2013/09/18 23:34:55 rmind Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_bpf.h
@@ -1382,8 +1382,7 @@ bpf_deliver(struct bpf_if *bp, void *(*c
 		if (d-bd_jitcode != NULL)
 			slen = d-bd_jitcode(pkt, pktlen, buflen);
 		else
-			slen = bpf_filter(bpf_def_ctx, NULL, d-bd_filter,
-			pkt, pktlen, buflen);
+			slen = bpf_filter(d-bd_filter, pkt, pktlen, buflen);
 
 		if (!slen) {
 			continue;

Index: src/sys/net/bpf.h
diff -u src/sys/net/bpf.h:1.61 src/sys/net/bpf.h:1.62
--- src/sys/net/bpf.h:1.61	Fri Aug 30 15:00:08 2013
+++ src/sys/net/bpf.h	Wed Sep 18 23:34:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.h,v 1.61 2013/08/30 15:00:08 rmind Exp $	*/
+/*	$NetBSD: bpf.h,v 1.62 2013/09/18 23:34:55 rmind Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -384,23 +384,20 @@ struct bpf_ctx;
 typedef struct bpf_ctx bpf_ctx_t;
 typedef uint32_t (*bpf_copfunc_t)(const struct mbuf *, void *,
 uint32_t, uint32_t *);
-extern bpf_ctx_t *bpf_def_ctx;
 
 bpf_ctx_t *bpf_create(void);
 void	bpf_destroy(bpf_ctx_t *);
 
 int	bpf_set_cop(bpf_ctx_t *, const bpf_copfunc_t *, size_t);
-u_int	bpf_filter(bpf_ctx_t *, void *, const struct bpf_insn *,
+u_int	bpf_filter_ext(bpf_ctx_t *, void *, const struct bpf_insn *,
 	const u_char *, u_int, u_int);
-int	bpf_validate(const struct bpf_insn *, int);
+int	bpf_validate_ext(bpf_ctx_t *, const struct bpf_insn *, int);
 
-#else
+#endif
 
 int	bpf_validate(const struct bpf_insn *, int);
 u_int	bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
 
-#endif
-
 __END_DECLS
 
 /*

Index: src/sys/net/bpf_filter.c
diff -u src/sys/net/bpf_filter.c:1.57 src/sys/net/bpf_filter.c:1.58
--- src/sys/net/bpf_filter.c:1.57	Fri Aug 30 15:00:08 2013
+++ src/sys/net/bpf_filter.c	Wed Sep 18 23:34:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf_filter.c,v 1.57 2013/08/30 15:00:08 rmind Exp $	*/
+/*	$NetBSD: bpf_filter.c,v 1.58 2013/09/18 23:34:55 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf_filter.c,v 1.57 2013/08/30 15:00:08 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf_filter.c,v 1.58 2013/09/18 23:34:55 rmind Exp $);
 
 #if 0
 #if !(defined(lint) || defined(KERNEL))
@@ -61,8 +61,7 @@ struct 

CVS commit: src/games/fortune/strfile

2013-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Sep 19 00:18:52 UTC 2013

Modified Files:
src/games/fortune/strfile: strfile.c

Log Message:
Don't define TRUE/FALSE, which may conflict with host headers.
TRUE is unused anyway.  Replace all instances of FALSE with 0.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/games/fortune/strfile/strfile.c

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

Modified files:

Index: src/games/fortune/strfile/strfile.c
diff -u src/games/fortune/strfile/strfile.c:1.36 src/games/fortune/strfile/strfile.c:1.37
--- src/games/fortune/strfile/strfile.c:1.36	Wed Sep 18 23:18:14 2013
+++ src/games/fortune/strfile/strfile.c	Thu Sep 19 00:18:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: strfile.c,v 1.36 2013/09/18 23:18:14 uwe Exp $	*/
+/*	$NetBSD: strfile.c,v 1.37 2013/09/19 00:18:52 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -47,7 +47,7 @@ __COPYRIGHT(@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = @(#)strfile.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: strfile.c,v 1.36 2013/09/18 23:18:14 uwe Exp $);
+__RCSID($NetBSD: strfile.c,v 1.37 2013/09/19 00:18:52 uwe Exp $);
 #endif
 #endif /* not lint */
 #endif /* __NetBSD__ */
@@ -102,9 +102,6 @@ __RCSID($NetBSD: strfile.c,v 1.36 2013/
  *	Added ordering options.
  */
 
-# define	TRUE	1
-# define	FALSE	0
-
 # define	STORING_PTRS	(Oflag || Rflag)
 # define	CHUNKSIZE	512
 
@@ -126,11 +123,11 @@ static char *Infile = NULL;		/* input fi
 static char Outfile[MAXPATHLEN] = ;	/* output file name */
 static char Delimch = '%';		/* delimiting character */
 
-static int Sflag	= FALSE;	/* silent run flag */
-static int Oflag	= FALSE;	/* ordering flag */
-static int Iflag	= FALSE;	/* ignore case flag */
-static int Rflag	= FALSE;	/* randomize order flag */
-static int Xflag	= FALSE;	/* set rotated bit */
+static int Sflag	= 0;		/* silent run flag */
+static int Oflag	= 0;		/* ordering flag */
+static int Iflag	= 0;		/* ignore case flag */
+static int Rflag	= 0;		/* randomize order flag */
+static int Xflag	= 0;		/* set rotated bit */
 static long Num_pts	= 0;		/* number of pointers/strings */
 
 static off_t *Seekpts;
@@ -223,7 +220,7 @@ main(int ac, char **av)
 			else
 fp-first = *nsp;
 			fp-pos = Seekpts[Num_pts - 1];
-			first = FALSE;
+			first = 0;
 		}
 	} while (sp != NULL);
 
@@ -397,8 +394,8 @@ cmp_str(const void *vp1, const void *vp2
 	(void) fseek(Sort_1, p1-pos, SEEK_SET);
 	(void) fseek(Sort_2, p2-pos, SEEK_SET);
 
-	n1 = FALSE;
-	n2 = FALSE;
+	n1 = 0;
+	n2 = 0;
 	while (!isalnum(c1 = getc(Sort_1))  c1 != '\0')
 		SET_N(n1, c1);
 	while (!isalnum(c2 = getc(Sort_2))  c2 != '\0')



CVS commit: src/games/fortune/strfile

2013-09-18 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Sep 19 00:34:00 UTC 2013

Modified Files:
src/games/fortune/strfile: strfile.c

Log Message:
Now that we use nbtool_config.h we can use __dead again and drop
local attempts to define its equivalent.

Also drop the comment that warns this file is a tool; use of
nbtool_config.h makes it evident.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/games/fortune/strfile/strfile.c

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

Modified files:

Index: src/games/fortune/strfile/strfile.c
diff -u src/games/fortune/strfile/strfile.c:1.37 src/games/fortune/strfile/strfile.c:1.38
--- src/games/fortune/strfile/strfile.c:1.37	Thu Sep 19 00:18:52 2013
+++ src/games/fortune/strfile/strfile.c	Thu Sep 19 00:34:00 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: strfile.c,v 1.37 2013/09/19 00:18:52 uwe Exp $	*/
+/*	$NetBSD: strfile.c,v 1.38 2013/09/19 00:34:00 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -47,13 +47,11 @@ __COPYRIGHT(@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = @(#)strfile.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: strfile.c,v 1.37 2013/09/19 00:18:52 uwe Exp $);
+__RCSID($NetBSD: strfile.c,v 1.38 2013/09/19 00:34:00 uwe Exp $);
 #endif
 #endif /* not lint */
 #endif /* __NetBSD__ */
 
-/* n.b.: this file is used at build-time - i.e. during build.sh. */
-
 #include sys/types.h
 #include sys/param.h
 #include ctype.h
@@ -71,14 +69,6 @@ __RCSID($NetBSD: strfile.c,v 1.37 2013/
 #define	MAXPATHLEN	1024
 #endif	/* MAXPATHLEN */
 
-#if defined(__NetBSD__) || defined(__dead)
-#define NORETURN	__dead
-#elif defined __GNUC__
-#define NORETURN	__attribute__((__noreturn__))
-#else
-#define NORETURN
-#endif
-
 /*
  *	This program takes a file composed of strings separated by
  * lines starting with two consecutive delimiting character (default
@@ -141,7 +131,7 @@ static STR *Firstch;			/* first chars of
 
 static uint32_t h2nl(uint32_t h);
 static void getargs(int argc, char **argv);
-static void usage(void) NORETURN;
+static void usage(void) __dead;
 static void add_offset(FILE *fp, off_t off);
 static void do_order(void);
 static int cmp_str(const void *vp1, const void *vp2);



CVS commit: src/sys/net

2013-09-18 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Thu Sep 19 00:48:48 UTC 2013

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

Log Message:
bpf_validate_ext: allow COP to modify the memstore.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/net/bpf_filter.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_filter.c
diff -u src/sys/net/bpf_filter.c:1.58 src/sys/net/bpf_filter.c:1.59
--- src/sys/net/bpf_filter.c:1.58	Wed Sep 18 23:34:55 2013
+++ src/sys/net/bpf_filter.c	Thu Sep 19 00:48:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf_filter.c,v 1.58 2013/09/18 23:34:55 rmind Exp $	*/
+/*	$NetBSD: bpf_filter.c,v 1.59 2013/09/19 00:48:48 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf_filter.c,v 1.58 2013/09/18 23:34:55 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf_filter.c,v 1.59 2013/09/19 00:48:48 rmind Exp $);
 
 #if 0
 #if !(defined(lint) || defined(KERNEL))
@@ -729,6 +729,19 @@ bpf_validate(const struct bpf_insn *f, i
 		case BPF_RET:
 			break;
 		case BPF_MISC:
+#if defined(KERNEL) || defined(_KERNEL)
+			switch (BPF_MISCOP(p-code)) {
+			case BPF_COP:
+			case BPF_COPX:
+/* In-kernel COP use only. */
+if (bc-copfuncs) {
+	invalid = 0;
+}
+break;
+			default:
+break;
+			}
+#endif
 			break;
 		default:
 			goto out;



CVS commit: src

2013-09-18 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Thu Sep 19 01:49:07 UTC 2013

Modified Files:
src/distrib/sets/lists/comp: mi
src/lib/libnpf: npf.c npf.h
src/sys/modules/npf: Makefile
src/sys/net/npf: Makefile files.npf npf_ctl.c npf_impl.h npf_ruleset.c
src/sys/rump/net/lib/libnpf: Makefile
src/usr.sbin/npf/npfctl: npfctl.h
src/usr.sbin/npf/npftest: npftest.c npftest.h
src/usr.sbin/npf/npftest/libnpftest: Makefile npf_rule_test.c
npf_test.h
Removed Files:
src/sys/net/npf: npf_instr.c npf_ncode.h npf_processor.c
src/usr.sbin/npf/npfctl: npf_disassemble.c npf_ncgen.c
src/usr.sbin/npf/npftest/libnpftest: npf_processor_test.c

Log Message:
NPF: G/C n-code in favour of BPF byte-code.  Delete lots of code, mmm!


To generate a diff of this commit:
cvs rdiff -u -r1.1836 -r1.1837 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.20 -r1.21 src/lib/libnpf/npf.c
cvs rdiff -u -r1.17 -r1.18 src/lib/libnpf/npf.h
cvs rdiff -u -r1.14 -r1.15 src/sys/modules/npf/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/Makefile
cvs rdiff -u -r1.14 -r1.15 src/sys/net/npf/files.npf
cvs rdiff -u -r1.28 -r1.29 src/sys/net/npf/npf_ctl.c
cvs rdiff -u -r1.32 -r1.33 src/sys/net/npf/npf_impl.h
cvs rdiff -u -r1.16 -r0 src/sys/net/npf/npf_instr.c
cvs rdiff -u -r1.11 -r0 src/sys/net/npf/npf_ncode.h
cvs rdiff -u -r1.15 -r0 src/sys/net/npf/npf_processor.c
cvs rdiff -u -r1.24 -r1.25 src/sys/net/npf/npf_ruleset.c
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/net/lib/libnpf/Makefile
cvs rdiff -u -r1.18 -r0 src/usr.sbin/npf/npfctl/npf_disassemble.c
cvs rdiff -u -r1.15 -r0 src/usr.sbin/npf/npfctl/npf_ncgen.c
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/npf/npfctl/npfctl.h
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/npf/npftest/npftest.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/npf/npftest/npftest.h
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/npf/npftest/libnpftest/Makefile
cvs rdiff -u -r1.4 -r0 \
src/usr.sbin/npf/npftest/libnpftest/npf_processor_test.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npftest/libnpftest/npf_rule_test.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/npf/npftest/libnpftest/npf_test.h

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.1836 src/distrib/sets/lists/comp/mi:1.1837
--- src/distrib/sets/lists/comp/mi:1.1836	Tue Sep 10 16:51:24 2013
+++ src/distrib/sets/lists/comp/mi	Thu Sep 19 01:49:07 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1836 2013/09/10 16:51:24 pooka Exp $
+#	$NetBSD: mi,v 1.1837 2013/09/19 01:49:07 rmind Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1980,7 +1980,7 @@
 ./usr/include/net/net_stats.h			comp-c-include
 ./usr/include/net/netisr.h			comp-c-include
 ./usr/include/net/npf.hcomp-c-include
-./usr/include/net/npf_ncode.h			comp-c-include
+./usr/include/net/npf_ncode.h			comp-obsolete		obsolete
 ./usr/include/net/pfil.h			comp-c-include
 ./usr/include/net/pfkeyv2.h			comp-c-include
 ./usr/include/net/pfvar.h			comp-c-include

Index: src/lib/libnpf/npf.c
diff -u src/lib/libnpf/npf.c:1.20 src/lib/libnpf/npf.c:1.21
--- src/lib/libnpf/npf.c:1.20	Thu Sep 19 01:04:46 2013
+++ src/lib/libnpf/npf.c	Thu Sep 19 01:49:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf.c,v 1.20 2013/09/19 01:04:46 rmind Exp $	*/
+/*	$NetBSD: npf.c,v 1.21 2013/09/19 01:49:07 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2010-2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: npf.c,v 1.20 2013/09/19 01:04:46 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: npf.c,v 1.21 2013/09/19 01:49:07 rmind Exp $);
 
 #include sys/types.h
 #include netinet/in_systm.h
@@ -661,53 +661,6 @@ npf_rule_getproc(nl_rule_t *rl)
 	return rpname;
 }
 
-#if 1
-static int
-_npf_rule_foreach1(prop_array_t rules, nl_rule_callback_t func)
-{
-	prop_dictionary_t rldict;
-	prop_object_iterator_t it;
-	unsigned reduce[16], n;
-	unsigned nlevel;
-
-	if (!rules || prop_object_type(rules) != PROP_TYPE_ARRAY) {
-		return ENOENT;
-	}
-	it = prop_array_iterator(rules);
-	if (it == NULL) {
-		return ENOMEM;
-	}
-
-	nlevel = 0;
-	reduce[nlevel] = 0;
-	n = 0;
-
-	while ((rldict = prop_object_iterator_next(it)) != NULL) {
-		nl_rule_t nrl = { .nrl_dict = rldict };
-		uint32_t skipto = 0;
-
-		prop_dictionary_get_uint32(rldict, skip-to, skipto);
-		(*func)(nrl, nlevel);
-		if (skipto) {
-			nlevel++;
-			reduce[nlevel] = skipto;
-		}
-		if (reduce[nlevel] == ++n) {
-			assert(nlevel  0);
-			nlevel--;
-		}
-	}
-	prop_object_iterator_release(it);
-	return 0;
-}
-
-int
-_npf_rule_foreach(nl_config_t *ncf, nl_rule_callback_t func)
-{
-	return _npf_rule_foreach1(ncf-ncf_rules_list, func);
-}
-#endif
-
 int
 _npf_ruleset_list(int fd, const char *rname, nl_config_t *ncf)
 {
@@ -734,31 +687,6 @@ _npf_ruleset_list(int fd, const char *rn
 	return error;
 }
 
-#if 1
-pri_t