CVS commit: src/sys/dev/usb

2013-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 13 08:05:30 UTC 2013

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

Log Message:
Fix locking botch


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

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

Modified files:

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.2 src/sys/dev/usb/if_smsc.c:1.3
--- src/sys/dev/usb/if_smsc.c:1.2	Sat Jan 12 20:06:47 2013
+++ src/sys/dev/usb/if_smsc.c	Sun Jan 13 08:05:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.2 2013/01/12 20:06:47 jakllsch Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.3 2013/01/13 08:05:30 skrll Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -273,9 +273,10 @@ smsc_miibus_readreg(device_t dev, int ph
 		smsc_warn_printf(sc, MII read timeout\n);
 
 	smsc_read_reg(sc, SMSC_MII_DATA, val);
-	smsc_unlock_mii(sc);
 
 done:
+	smsc_unlock_mii(sc);
+
 	return (val  0x);
 }
 



CVS commit: src

2013-01-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 13 08:15:03 UTC 2013

Modified Files:
src/lib/libc/sys: access.2 chmod.2 chown.2 link.2 mkdir.2 mkfifo.2
mknod.2 open.2 readlink.2 rename.2 stat.2 symlink.2 unlink.2
utimes.2
src/sys/kern: vfs_syscalls.c
src/sys/sys: fcntl.h
src/tests/lib/libc/c063: t_o_search.c

Log Message:
Revert defective O_SEARCH implementation committed by manu@ along with
the *at system calls on November 18th of last year. Reasons to revert
it include:
   - it is incorrect in a whole variety of ways (but fortunately, one
 of them is that the missing and improper permission checks have
 no net effect);
   - it was committed without review or discussion;
   - core ruled that all the new O_* flags pertaining to the *at calls
 needed to wait until their semantics could be clarified.

manu was asked to revert it on these grounds but has ignored the request.

I have left O_SEARCH defined and visible and made open() explicitly
ignore it. This way, most code that tries to use it will continue to
build and run. I've also arranged lib/libc/c063/t_o_search.c so that
the tests that make use of the O_SEARCH semantics will disappear until
O_SEARCH comes back, and fixed some mistakes and/or incorrect hacks
that were causing some of these to succeed despite the broken O_SEARCH
implementation.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/sys/access.2
cvs rdiff -u -r1.44 -r1.45 src/lib/libc/sys/chmod.2
cvs rdiff -u -r1.34 -r1.35 src/lib/libc/sys/chown.2
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/sys/link.2 \
src/lib/libc/sys/readlink.2
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/sys/mkdir.2 src/lib/libc/sys/rename.2 \
src/lib/libc/sys/unlink.2
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/sys/mkfifo.2 \
src/lib/libc/sys/symlink.2
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/sys/mknod.2
cvs rdiff -u -r1.54 -r1.55 src/lib/libc/sys/open.2
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/sys/stat.2
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/sys/utimes.2
cvs rdiff -u -r1.462 -r1.463 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.44 -r1.45 src/sys/sys/fcntl.h
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/c063/t_o_search.c

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

Modified files:

Index: src/lib/libc/sys/access.2
diff -u src/lib/libc/sys/access.2:1.31 src/lib/libc/sys/access.2:1.32
--- src/lib/libc/sys/access.2:1.31	Sat Jan 12 19:21:48 2013
+++ src/lib/libc/sys/access.2	Sun Jan 13 08:15:02 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: access.2,v 1.31 2013/01/12 19:21:48 dholland Exp $
+.\	$NetBSD: access.2,v 1.32 2013/01/13 08:15:02 dholland Exp $
 .\
 .\ Copyright (c) 1980, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -107,11 +107,26 @@ mode bits.
 The file descriptor
 .Fa fd
 must name a directory.
-Search permission is required on this directory except if
-.Fa fd
-was opened with the
-.Dv O_SEARCH
-flag.
+Search permission is required on this directory.
+.\(These alternatives await a decision about the semantics of O_SEARCH)
+.\ Search permission is required on this directory, except if
+.\ .Fa fd
+.\ was opened with the
+.\ .Dv O_SEARCH
+.\ flag.
+.\- or -
+.\ The directory referred to by
+.\ .Fa fd
+.\ must have been opened with the
+.\ .Dv O_SEARCH
+.\ flag.
+.\- or -
+.\ The directory referred to by
+.\ .Fa fd
+.\ must have been opened with the
+.\ .Dv O_SEARCH
+.\ flag or must be searchable by the current process at the time the
+.\ call is made.
 .Pp
 The
 .Fa flags

Index: src/lib/libc/sys/chmod.2
diff -u src/lib/libc/sys/chmod.2:1.44 src/lib/libc/sys/chmod.2:1.45
--- src/lib/libc/sys/chmod.2:1.44	Sat Dec  1 21:07:00 2012
+++ src/lib/libc/sys/chmod.2	Sun Jan 13 08:15:02 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: chmod.2,v 1.44 2012/12/01 21:07:00 wiz Exp $
+.\	$NetBSD: chmod.2,v 1.45 2013/01/13 08:15:02 dholland Exp $
 .\
 .\ Copyright (c) 1980, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -90,7 +90,18 @@ is relative.
 In that case, it is looked up from a directory whose file
 descriptor was passed as
 .Fa fd .
-Search permission is required on
+Search permission is required on this directory.
+.\(These alternatives await a decision about the semantics of O_SEARCH)
+.\ Search permission is required on this directory
+.\ except if
+.\ .Fa fd
+.\ was opened with the
+.\ .Dv O_SEARCH
+.\ flag.
+.\- or -
+.\ This file descriptor must have been opened with the
+.\ .Dv O_SEARCH
+.\ flag.
 .Fa fd
 except if that file descriptor was opened with the
 .Dv O_SEARCH

Index: src/lib/libc/sys/chown.2
diff -u src/lib/libc/sys/chown.2:1.34 src/lib/libc/sys/chown.2:1.35
--- src/lib/libc/sys/chown.2:1.34	Sat Dec  1 20:53:10 2012
+++ src/lib/libc/sys/chown.2	Sun Jan 13 08:15:02 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: chown.2,v 1.34 2012/12/01 20:53:10 wiz Exp $
+.\	$NetBSD: 

CVS commit: src/sys/dev/usb

2013-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 13 08:38:05 UTC 2013

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

Log Message:
Remove IFF_OACTIVE in txeof always, i.e. for the usb error case as well.

Set an if_timer.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/if_smsc.c

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

Modified files:

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.3 src/sys/dev/usb/if_smsc.c:1.4
--- src/sys/dev/usb/if_smsc.c:1.3	Sun Jan 13 08:05:30 2013
+++ src/sys/dev/usb/if_smsc.c	Sun Jan 13 08:38:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.3 2013/01/13 08:05:30 skrll Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.4 2013/01/13 08:38:04 skrll Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -642,9 +642,13 @@ smsc_start(struct ifnet *ifp)
 	IFQ_DEQUEUE(ifp-if_snd, m_head);
 
 	bpf_mtap(ifp, m_head);
-	//m_freem(m_head);			/* XXXNH needed? */
 
 	ifp-if_flags |= IFF_OACTIVE;
+
+	/*
+	 * Set a timeout in case the chip goes out to lunch.
+	 */
+	ifp-if_timer = 5;
 }
 
 void
@@ -1351,6 +1355,9 @@ smsc_txeof(usbd_xfer_handle xfer, usbd_p
 
 	s = splnet();
 
+	ifp-if_timer = 0;
+	ifp-if_flags = ~IFF_OACTIVE;
+
 	if (status != USBD_NORMAL_COMPLETION) {
 		if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) {
 			splx(s);
@@ -1364,9 +1371,7 @@ smsc_txeof(usbd_xfer_handle xfer, usbd_p
 		splx(s);
 		return;
 	}
-
-	ifp-if_timer = 0;
-	ifp-if_flags = ~IFF_OACTIVE;
+	ifp-if_opackets++;
 
 	m_freem(c-sc_mbuf);
 	c-sc_mbuf = NULL;
@@ -1374,7 +1379,6 @@ smsc_txeof(usbd_xfer_handle xfer, usbd_p
 	if (IFQ_IS_EMPTY(ifp-if_snd) == 0)
 		smsc_start(ifp);
 
-	ifp-if_opackets++;
 	splx(s);
 }
 



CVS commit: src/sys/arch/luna68k/stand/boot

2013-01-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 13 14:10:55 UTC 2013

Modified Files:
src/sys/arch/luna68k/stand/boot: Makefile conf.c devopen.c init_main.c
ioconf.c locore.S samachdep.h version
Added Files:
src/sys/arch/luna68k/stand/boot: getsecs.c if_le.c lance.c lance.h

Log Message:
Add netboot support.
Based on ews4800mips, mvme68k, and x68k standalone drivers.
Also bump version.

Tested on LUNA-I.

XXX: We really need proper documents about libsa APIs.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/conf.c \
src/sys/arch/luna68k/stand/boot/devopen.c \
src/sys/arch/luna68k/stand/boot/ioconf.c \
src/sys/arch/luna68k/stand/boot/version
cvs rdiff -u -r0 -r1.1 src/sys/arch/luna68k/stand/boot/getsecs.c \
src/sys/arch/luna68k/stand/boot/if_le.c \
src/sys/arch/luna68k/stand/boot/lance.c \
src/sys/arch/luna68k/stand/boot/lance.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/init_main.c \
src/sys/arch/luna68k/stand/boot/samachdep.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/locore.S

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/luna68k/stand/boot/Makefile
diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.4 src/sys/arch/luna68k/stand/boot/Makefile:1.5
--- src/sys/arch/luna68k/stand/boot/Makefile:1.4	Thu Jan 10 15:51:32 2013
+++ src/sys/arch/luna68k/stand/boot/Makefile	Sun Jan 13 14:10:55 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2013/01/10 15:51:32 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.5 2013/01/13 14:10:55 tsutsui Exp $
 #	@(#)Makefile	8.2 (Berkeley) 8/15/93
 
 NOMAN= # defined
@@ -7,16 +7,18 @@ NOMAN= # defined
 .include bsd.sys.mk
 
 S= ${.CURDIR}/../../../..
+LIBSADIR=	${S}/lib/libsa
 
 CPPFLAGS+=	-nostdinc -D_STANDALONE
 CPPFLAGS+=	-I${.CURDIR} -I${.OBJDIR} -I${S} -I${S}/arch
 
 CPPFLAGS+=	-DSUPPORT_DISK
 #CPPFLAGS+=	-DSUPPORT_TAPE
-#CPPFLAGS+=	-DSUPPORT_ETHERNET
-#CPPFLAGS+=	-DSUPPORT_DHCP -DSUPPORT_BOOTP
+CPPFLAGS+=	-DSUPPORT_ETHERNET
+CPPFLAGS+=	-DSUPPORT_DHCP -DSUPPORT_BOOTP
 #CPPFLAGS+=	-DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG
 #CPPFLAGS+=	-DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
+CPPFLAGS+=	-DLIBSA_PRINTF_WIDTH_SUPPORT
 
 CFLAGS=		-Os -msoft-float
 CFLAGS+=	-ffreestanding
@@ -45,6 +47,11 @@ SRCS+=	disklabel.c
 #SRCS+=	fsdump.c
 SRCS+=	ufs_disksubr.c
 
+# netboot support
+SRCS+=	if_le.c lance.c getsecs.c
+.PATH: ${LIBSADIR}
+SRCS+=	dev_net.c
+
 PROG=   boot
 
 NEWVERSWHAT=	${PROG}

Index: src/sys/arch/luna68k/stand/boot/conf.c
diff -u src/sys/arch/luna68k/stand/boot/conf.c:1.1 src/sys/arch/luna68k/stand/boot/conf.c:1.2
--- src/sys/arch/luna68k/stand/boot/conf.c:1.1	Sat Jan  5 17:44:24 2013
+++ src/sys/arch/luna68k/stand/boot/conf.c	Sun Jan 13 14:10:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $	*/
+/*	$NetBSD: conf.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -39,6 +39,7 @@
 #include netinet/in_systm.h
 
 #include lib/libsa/stand.h
+#include lib/libsa/dev_net.h
 #include lib/libsa/nfs.h
 #include lib/libsa/ufs.h
 
@@ -56,6 +57,10 @@
 #define	netstrategy	xxstrategy
 #define	netopen		xxopen
 #define	netclose	xxclose
+#else
+#define	netstrategy	net_strategy
+#define	netopen		net_open
+#define	netclose	net_close
 #endif
 #define	netioctl	noioctl
 
@@ -76,8 +81,9 @@ struct devsw devsw[] = {
 int	ndevs = __arraycount(devsw);
 
 #ifdef SUPPORT_ETHERNET
+extern struct netif_driver le_netif_driver;
 struct netif_driver *netif_drivers[] = {
-	le_driver,
+	le_netif_driver,
 };
 int	n_netif_drivers = __arraycount(netif_drivers);
 #endif
Index: src/sys/arch/luna68k/stand/boot/devopen.c
diff -u src/sys/arch/luna68k/stand/boot/devopen.c:1.1 src/sys/arch/luna68k/stand/boot/devopen.c:1.2
--- src/sys/arch/luna68k/stand/boot/devopen.c:1.1	Sat Jan  5 17:44:24 2013
+++ src/sys/arch/luna68k/stand/boot/devopen.c	Sun Jan 13 14:10:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: devopen.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $	*/
+/*	$NetBSD: devopen.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -101,6 +101,13 @@ devopen(struct open_file *f, const char 
 	}
 
 	file_system[0] = file_system_ufs[0];
+#ifdef SUPPORT_ETHERNET
+	if (strcmp(dp-dv_name, le) == 0) {
+		/* XXX mixing local fs_ops on netboot could be troublesome */
+		file_system[0] = file_system_nfs[0];
+	}
+#endif
+
 	f-f_dev = dp;
 
 	return 0;
Index: src/sys/arch/luna68k/stand/boot/ioconf.c
diff -u src/sys/arch/luna68k/stand/boot/ioconf.c:1.1 src/sys/arch/luna68k/stand/boot/ioconf.c:1.2
--- src/sys/arch/luna68k/stand/boot/ioconf.c:1.1	Sat Jan  5 17:44:24 2013
+++ src/sys/arch/luna68k/stand/boot/ioconf.c	Sun Jan 13 14:10:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ioconf.c,v 1.1 2013/01/05 17:44:24 

CVS commit: src/sys/arch/ews4800mips/stand/common

2013-01-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 13 14:24:24 UTC 2013

Modified Files:
src/sys/arch/ews4800mips/stand/common: lance.c

Log Message:
Fix tyop.  (How these ones slipped in!?)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ews4800mips/stand/common/lance.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/ews4800mips/stand/common/lance.c
diff -u src/sys/arch/ews4800mips/stand/common/lance.c:1.5 src/sys/arch/ews4800mips/stand/common/lance.c:1.6
--- src/sys/arch/ews4800mips/stand/common/lance.c:1.5	Mon Apr 28 20:23:18 2008
+++ src/sys/arch/ews4800mips/stand/common/lance.c	Sun Jan 13 14:24:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lance.c,v 1.5 2008/04/28 20:23:18 martin Exp $	*/
+/*	$NetBSD: lance.c,v 1.6 2013/01/13 14:24:24 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@ bool lance_put(void *, size_t);
 
 void lance_setup(void);
 bool lance_set_initblock(struct leinit *);
-bool lacne_do_initialize(void);
+bool lance_do_initialize(void);
 
 bool lance_test(void);
 bool lance_internal_loopback_test(bool);
@@ -83,7 +83,7 @@ lance_init(void)
 	if (!lance_set_initblock(lance_mem.leinit))
 		return false;
 
-	if (!lacne_do_initialize())
+	if (!lance_do_initialize())
 		return false;
 
 	*LANCE_RDP = LE_C0_STRT;
@@ -280,7 +280,7 @@ lance_set_initblock(struct leinit *leini
 }
 
 bool
-lacne_do_initialize(void)
+lance_do_initialize(void)
 {
 
 	/* Initialze LANCE */
@@ -380,7 +380,7 @@ lance_internal_loopback_test(bool crc)
 	if (!lance_set_initblock(lance_mem.leinit))
 		return false;
 
-	if (!lacne_do_initialize())
+	if (!lance_do_initialize())
 		return false;
 
 	/* Transmit Start */



CVS commit: src/sys/arch/x68k/stand/netboot

2013-01-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 13 14:27:06 UTC 2013

Modified Files:
src/sys/arch/x68k/stand/netboot: conf.c

Log Message:
Remove unnecessary struct open_file files[] leftover.
It's in libsa/files.c.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/netboot/conf.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/x68k/stand/netboot/conf.c
diff -u src/sys/arch/x68k/stand/netboot/conf.c:1.2 src/sys/arch/x68k/stand/netboot/conf.c:1.3
--- src/sys/arch/x68k/stand/netboot/conf.c:1.2	Thu Nov  1 14:46:26 2012
+++ src/sys/arch/x68k/stand/netboot/conf.c	Sun Jan 13 14:27:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.c,v 1.2 2012/11/01 14:46:26 isaki Exp $	*/
+/*	$NetBSD: conf.c,v 1.3 2013/01/13 14:27:06 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 Minoura Makoto
@@ -53,8 +53,6 @@ struct fs_ops file_system[] = {
 };
 int nfsys = sizeof(file_system) / sizeof(file_system[0]);
 
-struct open_file files[SOPEN_MAX];
-
 extern struct netif_driver ne_netif_driver;
 
 struct netif_driver *netif_drivers[] = {



CVS commit: src/distrib

2013-01-13 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jan 13 14:43:24 UTC 2013

Modified Files:
src/distrib/common: Makefile.mdset
src/distrib/evbarm/gzboot/gzimg: Makefile

Log Message:
build.sh lets you build releases with a limited set of kernels by
using the ALL_KERNELS environment variable to override the arch default.

Fix this mechanism for evbarm by limiting the generated boot images
accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/distrib/common/Makefile.mdset
cvs rdiff -u -r1.22 -r1.23 src/distrib/evbarm/gzboot/gzimg/Makefile

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/Makefile.mdset
diff -u src/distrib/common/Makefile.mdset:1.35 src/distrib/common/Makefile.mdset:1.36
--- src/distrib/common/Makefile.mdset:1.35	Sat Jan  1 16:56:18 2011
+++ src/distrib/common/Makefile.mdset	Sun Jan 13 14:43:23 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mdset,v 1.35 2011/01/01 16:56:18 jym Exp $
+#	$NetBSD: Makefile.mdset,v 1.36 2013/01/13 14:43:23 mlelstv Exp $
 #
 # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels
 #
@@ -69,7 +69,10 @@ _MAKEFILE_MDSET_=1
 
 .include bsd.kernobj.mk
 
+ALL_KERNELS?= +
 .for _K _I _F in ${MDSETTARGETS}			# {
+.for currentsel in ${ALL_KERNELS}			# {
+.if ${currentsel} == + || ${_K} == ${currentsel}
 
 _KERNEL:=${_K}			# (work around obscure issue in make(1))
 .if (${_KERNEL:M*/*} != )
@@ -166,6 +169,8 @@ ${_KERNEL.${_K}.${_F}}.gz: ${_KERNEL.${_
 	gzip -9nc ${.ALLSRC}  ${.TARGET}
 .endif			# }
 
+.endif
+.endfor			# }
 .endfor			# }
 
 CLEANFILES+=	${KERNELS} ${KERNELSYMS}
@@ -174,6 +179,7 @@ realall: ${KERNELS}
 
 .if defined(MDSET_RELEASEDIR)
 release:: check_RELEASEDIR .WAIT ${KERNELS}
+	test -z ${KERNELS} || \
 	${RELEASE_INSTALL} ${KERNELS} ${KERNELSYMS} \
 	${RELEASEDIR}/${RELEASEMACHINEDIR}/${MDSET_RELEASEDIR}
 .endif

Index: src/distrib/evbarm/gzboot/gzimg/Makefile
diff -u src/distrib/evbarm/gzboot/gzimg/Makefile:1.22 src/distrib/evbarm/gzboot/gzimg/Makefile:1.23
--- src/distrib/evbarm/gzboot/gzimg/Makefile:1.22	Wed Apr  4 07:32:29 2012
+++ src/distrib/evbarm/gzboot/gzimg/Makefile	Sun Jan 13 14:43:23 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2012/04/04 07:32:29 bsh Exp $
+#	$NetBSD: Makefile,v 1.23 2013/01/13 14:43:23 mlelstv Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -62,7 +62,10 @@ TARGETS=	ADI_BRH		ADI_BRH		ADI_BRH_sd0	\
 		0x0014	netbsd-wd0
 .endif
 
+ALL_KERNELS?= +
 .for K G I R W in ${TARGETS}# {
+.for configsel in ${ALL_KERNELS}			# {
+.if ${configsel} == + || ${configsel} == ${K}
 
 GZB${G}=	${DESTDIR}/usr/mdec/gzboot_${G}_${R}.bin
 
@@ -86,6 +89,8 @@ GZKERNELS+=	$K
 .endif
 KZ${K}+=	gzimg_${I}_flash_${R}.gz
 
+.endif
+.endfor			# }
 .endfor			# }
 
 .for K in ${GZKERNELS}



CVS commit: src/sys/dev/usb

2013-01-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 13 14:46:22 UTC 2013

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

Log Message:
backout r1.16 as it seems to cause problems with uhid devices


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/usb/dwc_otg.c

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

Modified files:

Index: src/sys/dev/usb/dwc_otg.c
diff -u src/sys/dev/usb/dwc_otg.c:1.21 src/sys/dev/usb/dwc_otg.c:1.22
--- src/sys/dev/usb/dwc_otg.c:1.21	Sun Jan 13 01:04:46 2013
+++ src/sys/dev/usb/dwc_otg.c	Sun Jan 13 14:46:21 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc_otg.c,v 1.21 2013/01/13 01:04:46 jmcneill Exp $	*/
+/*	$NetBSD: dwc_otg.c,v 1.22 2013/01/13 14:46:21 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dwc_otg.c,v 1.21 2013/01/13 01:04:46 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: dwc_otg.c,v 1.22 2013/01/13 14:46:21 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -3241,7 +3241,7 @@ dwc_otg_interrupt_poll(struct dwc_otg_so
 	uint8_t ch;
 	uint32_t temp;
 	uint32_t intrs;
-	struct dwc_otg_xfer *dxfer, *tmp;
+	struct dwc_otg_xfer *dxfer;
 	uint8_t got_rx_status;
 
 // 	DPRINTF(\n);
@@ -3330,8 +3330,11 @@ repeat:
 		got_rx_status = 1;
 	}
 
-	TAILQ_FOREACH_SAFE(dxfer, sc-sc_active, xnext, tmp) {
-		dwc_otg_xfer_do_fifo(dxfer-xfer);
+	TAILQ_FOREACH(dxfer, sc-sc_active, xnext) {
+		if (!dwc_otg_xfer_do_fifo(dxfer-xfer)) {
+			/* queue has been modified */
+			goto repeat;
+		}
 	}
 
 	if (got_rx_status) {



CVS commit: src/sys/dev/usb

2013-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 13 15:21:47 UTC 2013

Modified Files:
src/sys/dev/usb: dwc_otg.c dwc_otgvar.h

Log Message:
Add some more counters (disabled by default)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/usb/dwc_otg.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/dwc_otgvar.h

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

Modified files:

Index: src/sys/dev/usb/dwc_otg.c
diff -u src/sys/dev/usb/dwc_otg.c:1.22 src/sys/dev/usb/dwc_otg.c:1.23
--- src/sys/dev/usb/dwc_otg.c:1.22	Sun Jan 13 14:46:21 2013
+++ src/sys/dev/usb/dwc_otg.c	Sun Jan 13 15:21:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc_otg.c,v 1.22 2013/01/13 14:46:21 jmcneill Exp $	*/
+/*	$NetBSD: dwc_otg.c,v 1.23 2013/01/13 15:21:47 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dwc_otg.c,v 1.22 2013/01/13 14:46:21 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: dwc_otg.c,v 1.23 2013/01/13 15:21:47 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -3389,9 +3389,16 @@ dwc_otg_interrupt(struct dwc_otg_softc *
 	status = DWC_OTG_READ_4(sc, DOTG_GINTSTS);
 	DWC_OTG_WRITE_4(sc, DOTG_GINTSTS, status);
 
+	for (size_t i = 0; i  32; i++) {
+		if (status  (1i)) {
+			DOTG_EVCNT_INCR(sc-sc_ev_intr_bit[i]);
+		}
+	}
+
 	KASSERT(mutex_owned(sc-sc_intr_lock));
 	if (status  GINTSTS_USBRST) {
 		DPRINTF(GINTSTS_USBRST\n);
+
 		/* set correct state */
 		sc-sc_flags.status_device_mode = 1;
 		sc-sc_flags.status_bus_reset = 0;
@@ -4112,6 +4119,18 @@ dwc_otg_device_done(usbd_xfer_handle xfe
 	usb_schedsoftintr(sc-sc_bus);
 }
 
+static const char * const intnames[32] = {
+	curmod,	modemis,	otgint,	sof,
+	rxflvl,	nptxfemp,	ginnakeff,	goutnakeff,
+	ulpickint,	i2cint,	erlysusp,	usbsusp,
+	usbrst,	enumdone,	isooutdrop,	eopf,
+	restore_done,	epmis,	iepint,	oepint,
+	incompisoin,	incomplp,	fetsusp,	resetdet,
+	prtint,	hchint,	ptxfemp,	lpm,
+	conidstschng,	disconnint,	sessreqint,	wkupint
+};
+
+
 usbd_status
 dwc_otg_init(struct dwc_otg_softc *sc)
 {
@@ -4165,6 +4184,12 @@ dwc_otg_init(struct dwc_otg_softc *sc)
 	NULL, xname, xfer pool get);
 	evcnt_attach_dynamic(sc-sc_ev_xferpoolput, EVCNT_TYPE_MISC,
 	NULL, xname, xfer pool put);
+
+	for (size_t i = 0; i  32; i++) {
+		evcnt_attach_dynamic(sc-sc_ev_intr_bit[i], EVCNT_TYPE_INTR,
+		NULL, xname, intnames[i]);
+	}	
+
 #endif
 
 	temp = DWC_OTG_READ_4(sc, DOTG_GUSBCFG);

Index: src/sys/dev/usb/dwc_otgvar.h
diff -u src/sys/dev/usb/dwc_otgvar.h:1.4 src/sys/dev/usb/dwc_otgvar.h:1.5
--- src/sys/dev/usb/dwc_otgvar.h:1.4	Sat Jan 12 23:26:06 2013
+++ src/sys/dev/usb/dwc_otgvar.h	Sun Jan 13 15:21:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc_otgvar.h,v 1.4 2013/01/12 23:26:06 jmcneill Exp $ */
+/*	$NetBSD: dwc_otgvar.h,v 1.5 2013/01/13 15:21:47 skrll Exp $ */
 
 /* $FreeBSD: src/sys/dev/usb/controller/dwc_otg.h,v 1.12 2012/09/27 15:23:38 hselasky Exp $ */
 /*-
@@ -180,7 +180,6 @@ typedef struct dwc_otg_softc {
 	kmutex_t sc_intr_lock;
 
 	void *sc_rhc_si;
-	//void *sc_intr_si;
 
 	struct workqueue *sc_wq;
 	struct dwc_otg_work sc_timer_work;
@@ -201,19 +200,20 @@ typedef struct dwc_otg_softc {
 
 	pool_cache_t sc_tdpool;
 	pool_cache_t sc_xferpool;
-
-#ifdef DOTG_COUNTERS
 	
+#ifdef DOTG_COUNTERS
+
 	struct evcnt sc_ev_intr;
+	struct evcnt sc_ev_intr_bit[32];
+
 	struct evcnt sc_ev_soft_intr;
 	struct evcnt sc_ev_work;
-	
+
 	struct evcnt sc_ev_tdpoolget;
 	struct evcnt sc_ev_tdpoolput;
 	struct evcnt sc_ev_xferpoolget;
 	struct evcnt sc_ev_xferpoolput;
-	
-#endif	
+#endif
 
 	/* From FreeBSD softc */
 	struct callout sc_timer;



CVS commit: src/sys/dev/usb

2013-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 13 15:27:17 UTC 2013

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

Log Message:
Mask out all interrupts before clearing them in dwc_otg_init


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/usb/dwc_otg.c

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

Modified files:

Index: src/sys/dev/usb/dwc_otg.c
diff -u src/sys/dev/usb/dwc_otg.c:1.23 src/sys/dev/usb/dwc_otg.c:1.24
--- src/sys/dev/usb/dwc_otg.c:1.23	Sun Jan 13 15:21:47 2013
+++ src/sys/dev/usb/dwc_otg.c	Sun Jan 13 15:27:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc_otg.c,v 1.23 2013/01/13 15:21:47 skrll Exp $	*/
+/*	$NetBSD: dwc_otg.c,v 1.24 2013/01/13 15:27:17 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dwc_otg.c,v 1.23 2013/01/13 15:21:47 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: dwc_otg.c,v 1.24 2013/01/13 15:27:17 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -4325,6 +4325,8 @@ dwc_otg_init(struct dwc_otg_softc *sc)
 	if (dwc_otg_init_fifo(sc, DWC_MODE_OTG))
 		return EINVAL;
 
+	DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, 0);
+
 	DWC_OTG_WRITE_4(sc, DOTG_GOTGINT, 0x);
 	DWC_OTG_WRITE_4(sc, DOTG_GINTSTS, 0x);
 



CVS commit: src/sys/dev/usb

2013-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 13 15:34:03 UTC 2013

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

Log Message:
Fix another locking issue for an error case.

Return a EIO not -EIO (KNF)

From rmind


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/if_smsc.c

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

Modified files:

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.4 src/sys/dev/usb/if_smsc.c:1.5
--- src/sys/dev/usb/if_smsc.c:1.4	Sun Jan 13 08:38:04 2013
+++ src/sys/dev/usb/if_smsc.c	Sun Jan 13 15:34:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.4 2013/01/13 08:38:04 skrll Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.5 2013/01/13 15:34:03 skrll Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -292,6 +292,7 @@ smsc_miibus_writereg(device_t dev, int p
 	smsc_lock_mii(sc);
 	if (smsc_wait_for_bits(sc, SMSC_MII_ADDR, SMSC_MII_BUSY) != 0) {
 		smsc_warn_printf(sc, MII is busy\n);
+		smsc_unlock_mii(sc);
 		return;
 	}
 
@@ -472,7 +473,7 @@ smsc_sethwcsum(struct smsc_softc *sc)
 	int err;
 
 	if (!ifp)
-		return (-EIO);
+		return EIO;
 
 	err = smsc_read_reg(sc, SMSC_COE_CTRL, val);
 	if (err != 0) {



CVS commit: src/lib/libedit

2013-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 15:46:58 UTC 2013

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

Log Message:
explicitly pass (void *)0 instead of NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/lib/libedit/readline.c

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

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.106 src/lib/libedit/readline.c:1.107
--- src/lib/libedit/readline.c:1.106	Fri Oct 12 19:35:02 2012
+++ src/lib/libedit/readline.c	Sun Jan 13 10:46:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.106 2012/10/12 23:35:02 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.107 2013/01/13 15:46:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include config.h
 #if !defined(lint)  !defined(SCCSID)
-__RCSID($NetBSD: readline.c,v 1.106 2012/10/12 23:35:02 christos Exp $);
+__RCSID($NetBSD: readline.c,v 1.107 2013/01/13 15:46:57 christos Exp $);
 #endif /* not lint  not SCCSID */
 
 #include sys/types.h
@@ -2104,9 +2104,9 @@ void
 rl_get_screen_size(int *rows, int *cols)
 {
 	if (rows)
-		el_get(e, EL_GETTC, li, rows, NULL);
+		el_get(e, EL_GETTC, li, rows, (void *)0);
 	if (cols)
-		el_get(e, EL_GETTC, co, cols, NULL);
+		el_get(e, EL_GETTC, co, cols, (void *)0);
 }
 
 void



CVS commit: [netbsd-5] src/sys/fs/smbfs

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:03:38 UTC 2013

Modified Files:
src/sys/fs/smbfs [netbsd-5]: smbfs_node.c smbfs_node.h smbfs_vnops.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1823):
sys/fs/smbfs/smbfs_node.h: revision 1.13 via patch
sys/fs/smbfs/smbfs_node.c: revision 1.48 via patch
sys/fs/smbfs/smbfs_node.c: revision 1.49 via patch
sys/fs/smbfs/smbfs_vnops.c: revision 1.83 via patch
sys/fs/smbfs/smbfs_vnops.c: revision 1.84 via patch
Various fixes for smbfs:
- Implement NGONE to fix caching issue described in PR kern/25070.
  Mostly taken from FreeBSD r125637.
- Revert revision 1.70 of smbfs_vnops.c to fix setattr to opened
  direcotry.  In case of SMB_CAP_NT_SMBS, NOPEN is set after
  smbfs_smb_ntcreatex() call.  If NOPEN is set in front, it will
  immediately return by condition at do_open label.
- In smbfs_close(), call smbfs_smb_close() and drop NOPEN bit in
  the case of direcotry.  Otherwise smbfs_rmdir() fails when the
  directory was opened.
- Remove redundant vput() before vgone().
- Avoid unnecessary mutex_exit() in smbfs_node_alloc().
- Set NGONE bit to from-name vnode to invalidate the smbnode cache.


To generate a diff of this commit:
cvs rdiff -u -r1.39.6.1 -r1.39.6.2 src/sys/fs/smbfs/smbfs_node.c
cvs rdiff -u -r1.12 -r1.12.64.1 src/sys/fs/smbfs/smbfs_node.h
cvs rdiff -u -r1.65.6.1 -r1.65.6.2 src/sys/fs/smbfs/smbfs_vnops.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/fs/smbfs/smbfs_node.c
diff -u src/sys/fs/smbfs/smbfs_node.c:1.39.6.1 src/sys/fs/smbfs/smbfs_node.c:1.39.6.2
--- src/sys/fs/smbfs/smbfs_node.c:1.39.6.1	Sat Oct  3 23:05:25 2009
+++ src/sys/fs/smbfs/smbfs_node.c	Sun Jan 13 16:03:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_node.c,v 1.39.6.1 2009/10/03 23:05:25 snj Exp $	*/
+/*	$NetBSD: smbfs_node.c,v 1.39.6.2 2013/01/13 16:03:38 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smbfs_node.c,v 1.39.6.1 2009/10/03 23:05:25 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: smbfs_node.c,v 1.39.6.2 2013/01/13 16:03:38 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -96,6 +96,7 @@ static int
 smbfs_node_alloc(struct mount *mp, struct vnode *dvp,
 	const char *name, int nmlen, struct smbfattr *fap, struct vnode **vpp)
 {
+	struct vattr vattr;
 	struct smbmount *smp = VFSTOSMBFS(mp);
 	struct smbnode_hashhead *nhpp;
 	struct smbnode *np, *np2, *dnp;
@@ -136,11 +137,26 @@ retry:
 		mutex_exit(smp-sm_hashlock);
 		if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK) != 0)
 			goto retry;
+		/* Force cached attributes to be refreshed if stale. */
+		(void)VOP_GETATTR(vp, vattr, curlwp-l_cred);
+		/*
+		 * If the file type on the server is inconsistent with
+		 * what it was when we created the vnode, kill the
+		 * bogus vnode now and fall through to the code below
+		 * to create a new one with the right type.
+		 */
+		if ((vp-v_type == VDIR  (np-n_dosattr  SMB_FA_DIR) == 0) ||
+		(vp-v_type == VREG  (np-n_dosattr  SMB_FA_DIR) != 0)) {
+			VOP_UNLOCK(vp, 0);
+			vgone(vp);
+			goto allocnew;
+		}
 		*vpp = vp;
 		return (0);
 	}
 	mutex_exit(smp-sm_hashlock);
 
+allocnew:
 	/*
 	 * If we don't have node attributes, then it is an explicit lookup
 	 * for an existing vnode.
@@ -306,6 +322,8 @@ smbfs_inactive(v)
 		smbfs_attr_cacheremove(vp);
 	}
 	VOP_UNLOCK(vp, 0);
+	if (np-n_flag  NGONE)
+		vrecycle(vp, NULL, l);
 	return (0);
 }
 /*

Index: src/sys/fs/smbfs/smbfs_node.h
diff -u src/sys/fs/smbfs/smbfs_node.h:1.12 src/sys/fs/smbfs/smbfs_node.h:1.12.64.1
--- src/sys/fs/smbfs/smbfs_node.h:1.12	Thu Nov  2 17:34:21 2006
+++ src/sys/fs/smbfs/smbfs_node.h	Sun Jan 13 16:03:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_node.h,v 1.12 2006/11/02 17:34:21 jmmv Exp $	*/
+/*	$NetBSD: smbfs_node.h,v 1.12.64.1 2013/01/13 16:03:38 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -48,6 +48,7 @@
 /*efine	NNEW			0x0008*//* smb/vnode has been allocated */
 #define	NREFPARENT		0x0010	/* node holds parent from recycling */
 #define	NOPEN			0x2000	/* file is open */
+#define	NGONE			0x4000	/* file has been removed/renamed */
 
 #define SMBFS_ATTRTIMO		5	/* Attribute cache timeout in sec */
 

Index: src/sys/fs/smbfs/smbfs_vnops.c
diff -u src/sys/fs/smbfs/smbfs_vnops.c:1.65.6.1 src/sys/fs/smbfs/smbfs_vnops.c:1.65.6.2
--- src/sys/fs/smbfs/smbfs_vnops.c:1.65.6.1	Fri Feb 17 16:01:28 2012
+++ src/sys/fs/smbfs/smbfs_vnops.c	Sun Jan 13 16:03:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_vnops.c,v 1.65.6.1 2012/02/17 16:01:28 sborrill Exp $	*/
+/*	$NetBSD: smbfs_vnops.c,v 1.65.6.2 2013/01/13 16:03:38 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smbfs_vnops.c,v 1.65.6.1 2012/02/17 16:01:28 sborrill Exp 

CVS commit: [netbsd-5] src/sys

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:05:34 UTC 2013

Modified Files:
src/sys/fs/smbfs [netbsd-5]: smbfs_smb.c smbfs_subr.c smbfs_subr.h
smbfs_vnops.c
src/sys/netsmb [netbsd-5]: smb.h

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1824):
sys/netsmb/smb.h: revision 1.20
sys/fs/smbfs/smbfs_vnops.c: revision 1.85
sys/fs/smbfs/smbfs_subr.c: revision 1.16
sys/fs/smbfs/smbfs_smb.c: revision 1.44
sys/fs/smbfs/smbfs_subr.h: revision 1.21
Improve smbfs timestamp handling.
Don't round timestamp to 2 seconds resolution if the server
supports the CAP_INFOLEVEL_PASSTHRU capability.


To generate a diff of this commit:
cvs rdiff -u -r1.37.6.2 -r1.37.6.3 src/sys/fs/smbfs/smbfs_smb.c
cvs rdiff -u -r1.14 -r1.14.44.1 src/sys/fs/smbfs/smbfs_subr.c
cvs rdiff -u -r1.19.6.1 -r1.19.6.2 src/sys/fs/smbfs/smbfs_subr.h
cvs rdiff -u -r1.65.6.2 -r1.65.6.3 src/sys/fs/smbfs/smbfs_vnops.c
cvs rdiff -u -r1.17 -r1.17.86.1 src/sys/netsmb/smb.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/fs/smbfs/smbfs_smb.c
diff -u src/sys/fs/smbfs/smbfs_smb.c:1.37.6.2 src/sys/fs/smbfs/smbfs_smb.c:1.37.6.3
--- src/sys/fs/smbfs/smbfs_smb.c:1.37.6.2	Mon Nov 26 19:50:11 2012
+++ src/sys/fs/smbfs/smbfs_smb.c	Sun Jan 13 16:05:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_smb.c,v 1.37.6.2 2012/11/26 19:50:11 riz Exp $	*/
+/*	$NetBSD: smbfs_smb.c,v 1.37.6.3 2013/01/13 16:05:34 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smbfs_smb.c,v 1.37.6.2 2012/11/26 19:50:11 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: smbfs_smb.c,v 1.37.6.3 2013/01/13 16:05:34 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -430,7 +430,6 @@ smbfs_smb_setptime2(struct smbnode *np, 
 /*
  * NT level. Specially for win9x
  */
-#if 0
 int
 smbfs_smb_setpattrNT(struct smbnode *np, u_short attr, struct timespec *mtime,
 	struct timespec *atime, struct smb_cred *scred)
@@ -442,13 +441,22 @@ smbfs_smb_setpattrNT(struct smbnode *np,
 	int64_t tm;
 	int error, tzoff;
 
+	/*
+	 * SMB_SET_FILE_BASIC_INFO isn't supported for
+	 * SMB_TRANS2_SET_PATH_INFORMATION,
+	 * so use SMB_SET_FILE_BASIC_INFORMATION instead,
+	 * but it requires SMB_CAP_INFOLEVEL_PASSTHRU capability.
+	 */
+	if ((SMB_CAPS(vcp)  SMB_CAP_INFOLEVEL_PASSTHRU) == 0)
+		return smbfs_smb_setptime2(np, mtime, atime, attr, scred);
+
 	error = smb_t2_alloc(SSTOCP(ssp), SMB_TRANS2_SET_PATH_INFORMATION,
 	scred, t2p);
 	if (error)
 		return error;
 	mbp = t2p-t2_tparam;
 	mb_init(mbp);
-	mb_put_uint16le(mbp, SMB_SET_FILE_BASIC_INFO);
+	mb_put_uint16le(mbp, SMB_SET_FILE_BASIC_INFORMATION);
 	mb_put_uint32le(mbp, 0);		/* MBZ */
 	error = smbfs_fullpath(mbp, vcp, np, NULL, 0);
 	if (error) {
@@ -471,13 +479,13 @@ smbfs_smb_setpattrNT(struct smbnode *np,
 	mb_put_int64le(mbp, tm);
 	mb_put_int64le(mbp, tm);		/* change time */
 	mb_put_uint32le(mbp, attr);		/* attr */
-	t2p-t2_maxpcount = 24;
-	t2p-t2_maxdcount = 56;
+	mb_put_uint32le(mbp, 0);		/* padding */
+	t2p-t2_maxpcount = 2;
+	t2p-t2_maxdcount = 0;
 	error = smb_t2_request(t2p);
 	smb_t2_done(t2p);
 	return error;
 }
-#endif
 
 /*
  * Set file atime and mtime. Doesn't supported by core dialect.
@@ -560,9 +568,8 @@ smbfs_smb_setfattrNT(struct smbnode *np,
 		tm = 0;
 	mb_put_int64le(mbp, tm);
 	mb_put_int64le(mbp, tm);		/* change time */
-	mb_put_uint16le(mbp, attr);
-	mb_put_uint32le(mbp, 0);			/* padding */
-	mb_put_uint16le(mbp, 0);
+	mb_put_uint32le(mbp, attr);		/* attr */
+	mb_put_uint32le(mbp, 0);		/* padding */
 	t2p-t2_maxpcount = 2;
 	t2p-t2_maxdcount = 0;
 	error = smb_t2_request(t2p);

Index: src/sys/fs/smbfs/smbfs_subr.c
diff -u src/sys/fs/smbfs/smbfs_subr.c:1.14 src/sys/fs/smbfs/smbfs_subr.c:1.14.44.1
--- src/sys/fs/smbfs/smbfs_subr.c:1.14	Sat Jun 30 09:37:57 2007
+++ src/sys/fs/smbfs/smbfs_subr.c	Sun Jan 13 16:05:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: smbfs_subr.c,v 1.14 2007/06/30 09:37:57 pooka Exp $	*/
+/*	$NetBSD: smbfs_subr.c,v 1.14.44.1 2013/01/13 16:05:34 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smbfs_subr.c,v 1.14 2007/06/30 09:37:57 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: smbfs_subr.c,v 1.14.44.1 2013/01/13 16:05:34 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -145,7 +145,7 @@ smb_time_local2NT(struct timespec *tsp, 
 	u_long seconds;
 
 	smb_time_local2server(tsp, 0, seconds);
-	*nsec = (((int64_t)(seconds)  ~1) + DIFF1970TO1601) * (int64_t)1000;
+	*nsec = ((int64_t)seconds + DIFF1970TO1601) * (int64_t)1000;
 }
 
 void

Index: src/sys/fs/smbfs/smbfs_subr.h
diff -u src/sys/fs/smbfs/smbfs_subr.h:1.19.6.1 src/sys/fs/smbfs/smbfs_subr.h:1.19.6.2
--- src/sys/fs/smbfs/smbfs_subr.h:1.19.6.1	Tue Oct 27 20:46:52 

CVS commit: [netbsd-5] src/sys/netsmb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:08:23 UTC 2013

Modified Files:
src/sys/netsmb [netbsd-5]: smb_iod.c smb_rq.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1825):
sys/netsmb/smb_rq.c: revision 1.32
sys/netsmb/smb_iod.c: revision 1.31
sys/netsmb/smb_iod.c: revision 1.32
sys/netsmb/smb_iod.c: revision 1.33
sys/netsmb/smb_iod.c: revision 1.34
sys/netsmb/smb_iod.c: revision 1.35
Do not call callout_stop() unless the structure was previoulsy
initialised for a non null timeout.
Do initialise the callout when fetching a new request structure from
the pool, not when starting the timer. Likewise, destroy the callout
when giving back the item to the pool.
Send data for as long as there is new data available.  Otherwise
there was a danger of smb_iod_recvall() blocking, hence releasing
the kernel lock, new data creeping into the queue, and a wakeup
being missed (well, there's still a race, but since it's theoretical
enough for me to never have encountered it, I'll rather solve it
by periodic wakeups).
defensive programming: wake up iod thread once a second just in case
add comment to previous stating periodic wakeups can be nuked
once smb is mpsafe.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/netsmb/smb_iod.c
cvs rdiff -u -r1.30 -r1.30.6.1 src/sys/netsmb/smb_rq.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/netsmb/smb_iod.c
diff -u src/sys/netsmb/smb_iod.c:1.29 src/sys/netsmb/smb_iod.c:1.29.6.1
--- src/sys/netsmb/smb_iod.c:1.29	Tue Jun 24 10:37:19 2008
+++ src/sys/netsmb/smb_iod.c	Sun Jan 13 16:08:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_iod.c,v 1.29 2008/06/24 10:37:19 gmcgarry Exp $	*/
+/*	$NetBSD: smb_iod.c,v 1.29.6.1 2013/01/13 16:08:23 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smb_iod.c,v 1.29 2008/06/24 10:37:19 gmcgarry Exp $);
+__KERNEL_RCSID(0, $NetBSD: smb_iod.c,v 1.29.6.1 2013/01/13 16:08:23 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -670,7 +670,11 @@ smb_iod_thread(void *arg)
 		if (iod-iod_flags  SMBIOD_SHUTDOWN)
 			break;
 		SMBIODEBUG((going to sleep\n));
-		tsleep(iod-iod_flags, PSOCK, smbidle, 0);
+		/*
+		 * technically wakeup every hz is unnecessary, but keep
+		 * this here until smb has been made mpsafe.
+		 */
+		tsleep(iod-iod_flags, PSOCK, smbidle, hz);
 	}
 	splx(s);
 	kthread_exit(0);

Index: src/sys/netsmb/smb_rq.c
diff -u src/sys/netsmb/smb_rq.c:1.30 src/sys/netsmb/smb_rq.c:1.30.6.1
--- src/sys/netsmb/smb_rq.c:1.30	Tue Jun 24 10:37:19 2008
+++ src/sys/netsmb/smb_rq.c	Sun Jan 13 16:08:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_rq.c,v 1.30 2008/06/24 10:37:19 gmcgarry Exp $	*/
+/*	$NetBSD: smb_rq.c,v 1.30.6.1 2013/01/13 16:08:23 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smb_rq.c,v 1.30 2008/06/24 10:37:19 gmcgarry Exp $);
+__KERNEL_RCSID(0, $NetBSD: smb_rq.c,v 1.30.6.1 2013/01/13 16:08:23 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -95,6 +95,7 @@ smb_rq_alloc(struct smb_connobj *layer, 
 	rqp = pool_get(smbrq_pool, PR_WAITOK);
 	error = smb_rq_init(rqp, layer, cmd, scred);
 	rqp-sr_flags |= SMBR_ALLOCED;
+	callout_init(rqp-sr_timo_ch, 0);
 	if (error) {
 		smb_rq_done(rqp);
 		return error;
@@ -166,8 +167,10 @@ smb_rq_done(struct smb_rq *rqp)
 	mb_done(rqp-sr_rq);
 	md_done(rqp-sr_rp);
 	smb_sl_destroy(rqp-sr_slock);
-	if (rqp-sr_flags  SMBR_ALLOCED)
+	if (rqp-sr_flags  SMBR_ALLOCED) {
+		callout_destroy(rqp-sr_timo_ch);
 		pool_put(smbrq_pool, rqp);
+	}
 }
 
 /*



CVS commit: [netbsd-5] src/sys/dev

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:12:57 UTC 2013

Modified Files:
src/sys/dev [netbsd-5]: lockstat.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1826):
sys/dev/lockstat.c: revision 1.16
Fix off by one.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.10.1 src/sys/dev/lockstat.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/lockstat.c
diff -u src/sys/dev/lockstat.c:1.15 src/sys/dev/lockstat.c:1.15.10.1
--- src/sys/dev/lockstat.c:1.15	Mon Apr 28 20:23:46 2008
+++ src/sys/dev/lockstat.c	Sun Jan 13 16:12:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $	*/
+/*	$NetBSD: lockstat.c,v 1.15.10.1 2013/01/13 16:12:56 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15.10.1 2013/01/13 16:12:56 bouyer Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -270,7 +270,7 @@ lockstat_stop(lsdisable_t *ld)
 
 	cpuno = 0;
 	for (CPU_INFO_FOREACH(cii, ci)) {
-		if (cpuno  sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
+		if (cpuno = sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
 			log(LOG_WARNING, lockstat: too many CPUs\n);
 			break;
 		}



CVS commit: [netbsd-5-0] src/sys/dev

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:13:04 UTC 2013

Modified Files:
src/sys/dev [netbsd-5-0]: lockstat.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1826):
sys/dev/lockstat.c: revision 1.16
Fix off by one.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.16.1 src/sys/dev/lockstat.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/lockstat.c
diff -u src/sys/dev/lockstat.c:1.15 src/sys/dev/lockstat.c:1.15.16.1
--- src/sys/dev/lockstat.c:1.15	Mon Apr 28 20:23:46 2008
+++ src/sys/dev/lockstat.c	Sun Jan 13 16:13:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $	*/
+/*	$NetBSD: lockstat.c,v 1.15.16.1 2013/01/13 16:13:03 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15.16.1 2013/01/13 16:13:03 bouyer Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -270,7 +270,7 @@ lockstat_stop(lsdisable_t *ld)
 
 	cpuno = 0;
 	for (CPU_INFO_FOREACH(cii, ci)) {
-		if (cpuno  sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
+		if (cpuno = sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
 			log(LOG_WARNING, lockstat: too many CPUs\n);
 			break;
 		}



CVS commit: [netbsd-5-1] src/sys/dev

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:13:08 UTC 2013

Modified Files:
src/sys/dev [netbsd-5-1]: lockstat.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1826):
sys/dev/lockstat.c: revision 1.16
Fix off by one.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.24.1 src/sys/dev/lockstat.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/lockstat.c
diff -u src/sys/dev/lockstat.c:1.15 src/sys/dev/lockstat.c:1.15.24.1
--- src/sys/dev/lockstat.c:1.15	Mon Apr 28 20:23:46 2008
+++ src/sys/dev/lockstat.c	Sun Jan 13 16:13:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $	*/
+/*	$NetBSD: lockstat.c,v 1.15.24.1 2013/01/13 16:13:08 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15.24.1 2013/01/13 16:13:08 bouyer Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -270,7 +270,7 @@ lockstat_stop(lsdisable_t *ld)
 
 	cpuno = 0;
 	for (CPU_INFO_FOREACH(cii, ci)) {
-		if (cpuno  sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
+		if (cpuno = sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
 			log(LOG_WARNING, lockstat: too many CPUs\n);
 			break;
 		}



CVS commit: [netbsd-5-2] src/sys/dev

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:13:09 UTC 2013

Modified Files:
src/sys/dev [netbsd-5-2]: lockstat.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1826):
sys/dev/lockstat.c: revision 1.16
Fix off by one.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.48.1 src/sys/dev/lockstat.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/lockstat.c
diff -u src/sys/dev/lockstat.c:1.15 src/sys/dev/lockstat.c:1.15.48.1
--- src/sys/dev/lockstat.c:1.15	Mon Apr 28 20:23:46 2008
+++ src/sys/dev/lockstat.c	Sun Jan 13 16:13:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $	*/
+/*	$NetBSD: lockstat.c,v 1.15.48.1 2013/01/13 16:13:09 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15.48.1 2013/01/13 16:13:09 bouyer Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -270,7 +270,7 @@ lockstat_stop(lsdisable_t *ld)
 
 	cpuno = 0;
 	for (CPU_INFO_FOREACH(cii, ci)) {
-		if (cpuno  sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
+		if (cpuno = sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
 			log(LOG_WARNING, lockstat: too many CPUs\n);
 			break;
 		}



CVS commit: [netbsd-5] src/sys/dev/raidframe

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:14:43 UTC 2013

Modified Files:
src/sys/dev/raidframe [netbsd-5]: rf_driver.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1827):
sys/dev/raidframe/rf_driver.c: revision 1.131
Fix off by one read.


To generate a diff of this commit:
cvs rdiff -u -r1.118.10.2 -r1.118.10.3 src/sys/dev/raidframe/rf_driver.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/raidframe/rf_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.118.10.2 src/sys/dev/raidframe/rf_driver.c:1.118.10.3
--- src/sys/dev/raidframe/rf_driver.c:1.118.10.2	Thu Dec 10 22:59:16 2009
+++ src/sys/dev/raidframe/rf_driver.c	Sun Jan 13 16:14:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_driver.c,v 1.118.10.2 2009/12/10 22:59:16 snj Exp $	*/
+/*	$NetBSD: rf_driver.c,v 1.118.10.3 2013/01/13 16:14:42 bouyer Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.2 2009/12/10 22:59:16 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.3 2013/01/13 16:14:42 bouyer Exp $);
 
 #include opt_raid_diagnostic.h
 
@@ -868,7 +868,7 @@ rf_ConfigureDebug(RF_Config_t *cfgPtr)
 	int i;
 
 	rf_ResetDebugOptions();
-	for (i = 0; cfgPtr-debugVars[i][0]  i  RF_MAXDBGV; i++) {
+	for (i = 0; i  RF_MAXDBGV  cfgPtr-debugVars[i][0]; i++) {
 		name_p = rf_find_non_white(cfgPtr-debugVars[i][0]);
 		white_p = rf_find_white(name_p);	/* skip to start of 2nd
 			 * word */



CVS commit: [netbsd-5-0] src/sys/dev/raidframe

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:15:06 UTC 2013

Modified Files:
src/sys/dev/raidframe [netbsd-5-0]: rf_driver.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1827):
sys/dev/raidframe/rf_driver.c: revision 1.131
Fix off by one read.


To generate a diff of this commit:
cvs rdiff -u -r1.118.10.1 -r1.118.10.1.2.1 src/sys/dev/raidframe/rf_driver.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/raidframe/rf_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.118.10.1 src/sys/dev/raidframe/rf_driver.c:1.118.10.1.2.1
--- src/sys/dev/raidframe/rf_driver.c:1.118.10.1	Tue Dec 23 04:03:00 2008
+++ src/sys/dev/raidframe/rf_driver.c	Sun Jan 13 16:15:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_driver.c,v 1.118.10.1 2008/12/23 04:03:00 snj Exp $	*/
+/*	$NetBSD: rf_driver.c,v 1.118.10.1.2.1 2013/01/13 16:15:06 bouyer Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.1 2008/12/23 04:03:00 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.1.2.1 2013/01/13 16:15:06 bouyer Exp $);
 
 #include opt_raid_diagnostic.h
 
@@ -854,7 +854,7 @@ rf_ConfigureDebug(RF_Config_t *cfgPtr)
 	int i;
 
 	rf_ResetDebugOptions();
-	for (i = 0; cfgPtr-debugVars[i][0]  i  RF_MAXDBGV; i++) {
+	for (i = 0; i  RF_MAXDBGV  cfgPtr-debugVars[i][0]; i++) {
 		name_p = rf_find_non_white(cfgPtr-debugVars[i][0]);
 		white_p = rf_find_white(name_p);	/* skip to start of 2nd
 			 * word */



CVS commit: [netbsd-5-1] src/sys/dev/raidframe

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:15:09 UTC 2013

Modified Files:
src/sys/dev/raidframe [netbsd-5-1]: rf_driver.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1827):
sys/dev/raidframe/rf_driver.c: revision 1.131
Fix off by one read.


To generate a diff of this commit:
cvs rdiff -u -r1.118.10.2 -r1.118.10.2.2.1 src/sys/dev/raidframe/rf_driver.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/raidframe/rf_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.118.10.2 src/sys/dev/raidframe/rf_driver.c:1.118.10.2.2.1
--- src/sys/dev/raidframe/rf_driver.c:1.118.10.2	Thu Dec 10 22:59:16 2009
+++ src/sys/dev/raidframe/rf_driver.c	Sun Jan 13 16:15:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_driver.c,v 1.118.10.2 2009/12/10 22:59:16 snj Exp $	*/
+/*	$NetBSD: rf_driver.c,v 1.118.10.2.2.1 2013/01/13 16:15:09 bouyer Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.2 2009/12/10 22:59:16 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.2.2.1 2013/01/13 16:15:09 bouyer Exp $);
 
 #include opt_raid_diagnostic.h
 
@@ -868,7 +868,7 @@ rf_ConfigureDebug(RF_Config_t *cfgPtr)
 	int i;
 
 	rf_ResetDebugOptions();
-	for (i = 0; cfgPtr-debugVars[i][0]  i  RF_MAXDBGV; i++) {
+	for (i = 0; i  RF_MAXDBGV  cfgPtr-debugVars[i][0]; i++) {
 		name_p = rf_find_non_white(cfgPtr-debugVars[i][0]);
 		white_p = rf_find_white(name_p);	/* skip to start of 2nd
 			 * word */



CVS commit: [netbsd-5-2] src/sys/dev/raidframe

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:15:12 UTC 2013

Modified Files:
src/sys/dev/raidframe [netbsd-5-2]: rf_driver.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1827):
sys/dev/raidframe/rf_driver.c: revision 1.131
Fix off by one read.


To generate a diff of this commit:
cvs rdiff -u -r1.118.10.2 -r1.118.10.2.6.1 src/sys/dev/raidframe/rf_driver.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/raidframe/rf_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.118.10.2 src/sys/dev/raidframe/rf_driver.c:1.118.10.2.6.1
--- src/sys/dev/raidframe/rf_driver.c:1.118.10.2	Thu Dec 10 22:59:16 2009
+++ src/sys/dev/raidframe/rf_driver.c	Sun Jan 13 16:15:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_driver.c,v 1.118.10.2 2009/12/10 22:59:16 snj Exp $	*/
+/*	$NetBSD: rf_driver.c,v 1.118.10.2.6.1 2013/01/13 16:15:12 bouyer Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.2 2009/12/10 22:59:16 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.2.6.1 2013/01/13 16:15:12 bouyer Exp $);
 
 #include opt_raid_diagnostic.h
 
@@ -868,7 +868,7 @@ rf_ConfigureDebug(RF_Config_t *cfgPtr)
 	int i;
 
 	rf_ResetDebugOptions();
-	for (i = 0; cfgPtr-debugVars[i][0]  i  RF_MAXDBGV; i++) {
+	for (i = 0; i  RF_MAXDBGV  cfgPtr-debugVars[i][0]; i++) {
 		name_p = rf_find_non_white(cfgPtr-debugVars[i][0]);
 		white_p = rf_find_white(name_p);	/* skip to start of 2nd
 			 * word */



CVS commit: [netbsd-5] src/sys/external/isc/atheros_hal/dist

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:17:51 UTC 2013

Modified Files:
src/sys/external/isc/atheros_hal/dist [netbsd-5]: ah_eeprom_v14.c

Log Message:
Apply patch (requested by msaitoh in ticket #1827):
sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c: patch
Fix off by one read.


To generate a diff of this commit:
cvs rdiff -u -r1.4.10.2 -r1.4.10.3 \
src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.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/isc/atheros_hal/dist/ah_eeprom_v14.c
diff -u src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c:1.4.10.2 src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c:1.4.10.3
--- src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c:1.4.10.2	Fri Aug  7 06:43:30 2009
+++ src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c	Sun Jan 13 16:17:51 2013
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ah_eeprom_v14.c,v 1.4.10.2 2009/08/07 06:43:30 snj Exp $
+ * $Id: ah_eeprom_v14.c,v 1.4.10.3 2013/01/13 16:17:51 bouyer Exp $
  */
 #include sys/endian.h
 #include opt_ah.h
@@ -270,7 +270,7 @@ v14EepromReadCTLInfo(struct ath_hal *ah,
 	
 	HALASSERT(AR5416_NUM_CTLS = sizeof(ee-ee_rdEdgesPower)/NUM_EDGES);
 
-	for (i = 0; ee-ee_base.ctlIndex[i] != 0  i  AR5416_NUM_CTLS; i++) {
+	for (i = 0; i  AR5416_NUM_CTLS  ee-ee_base.ctlIndex[i] != 0; i++) {
 		for (j = 0; j  NUM_EDGES; j ++) {
 			/* XXX Confirm this is the right thing to do when an invalid channel is stored */
 			if (ee-ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel == AR5416_BCHAN_UNUSED) {



CVS commit: [netbsd-5-1] src/sys/external/isc/atheros_hal/dist

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:17:56 UTC 2013

Modified Files:
src/sys/external/isc/atheros_hal/dist [netbsd-5-1]: ah_eeprom_v14.c

Log Message:
Apply patch (requested by msaitoh in ticket #1827):
sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c: patch
Fix off by one read.


To generate a diff of this commit:
cvs rdiff -u -r1.4.10.2 -r1.4.10.2.2.1 \
src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.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/isc/atheros_hal/dist/ah_eeprom_v14.c
diff -u src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c:1.4.10.2 src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c:1.4.10.2.2.1
--- src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c:1.4.10.2	Fri Aug  7 06:43:30 2009
+++ src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c	Sun Jan 13 16:17:56 2013
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ah_eeprom_v14.c,v 1.4.10.2 2009/08/07 06:43:30 snj Exp $
+ * $Id: ah_eeprom_v14.c,v 1.4.10.2.2.1 2013/01/13 16:17:56 bouyer Exp $
  */
 #include sys/endian.h
 #include opt_ah.h
@@ -270,7 +270,7 @@ v14EepromReadCTLInfo(struct ath_hal *ah,
 	
 	HALASSERT(AR5416_NUM_CTLS = sizeof(ee-ee_rdEdgesPower)/NUM_EDGES);
 
-	for (i = 0; ee-ee_base.ctlIndex[i] != 0  i  AR5416_NUM_CTLS; i++) {
+	for (i = 0; i  AR5416_NUM_CTLS  ee-ee_base.ctlIndex[i] != 0; i++) {
 		for (j = 0; j  NUM_EDGES; j ++) {
 			/* XXX Confirm this is the right thing to do when an invalid channel is stored */
 			if (ee-ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel == AR5416_BCHAN_UNUSED) {



CVS commit: [netbsd-5-2] src/sys/external/isc/atheros_hal/dist

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:17:57 UTC 2013

Modified Files:
src/sys/external/isc/atheros_hal/dist [netbsd-5-2]: ah_eeprom_v14.c

Log Message:
Apply patch (requested by msaitoh in ticket #1827):
sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c: patch
Fix off by one read.


To generate a diff of this commit:
cvs rdiff -u -r1.4.10.2 -r1.4.10.2.6.1 \
src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.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/isc/atheros_hal/dist/ah_eeprom_v14.c
diff -u src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c:1.4.10.2 src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c:1.4.10.2.6.1
--- src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c:1.4.10.2	Fri Aug  7 06:43:30 2009
+++ src/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c	Sun Jan 13 16:17:57 2013
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ah_eeprom_v14.c,v 1.4.10.2 2009/08/07 06:43:30 snj Exp $
+ * $Id: ah_eeprom_v14.c,v 1.4.10.2.6.1 2013/01/13 16:17:57 bouyer Exp $
  */
 #include sys/endian.h
 #include opt_ah.h
@@ -270,7 +270,7 @@ v14EepromReadCTLInfo(struct ath_hal *ah,
 	
 	HALASSERT(AR5416_NUM_CTLS = sizeof(ee-ee_rdEdgesPower)/NUM_EDGES);
 
-	for (i = 0; ee-ee_base.ctlIndex[i] != 0  i  AR5416_NUM_CTLS; i++) {
+	for (i = 0; i  AR5416_NUM_CTLS  ee-ee_base.ctlIndex[i] != 0; i++) {
 		for (j = 0; j  NUM_EDGES; j ++) {
 			/* XXX Confirm this is the right thing to do when an invalid channel is stored */
 			if (ee-ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel == AR5416_BCHAN_UNUSED) {



CVS commit: [netbsd-5] src/sys/compat/netbsd32

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:22:17 UTC 2013

Modified Files:
src/sys/compat/netbsd32 [netbsd-5]: netbsd32_fs.c

Log Message:
Pull up following revision(s) (requested by matt in ticket #1829):
sys/compat/netbsd32/netbsd32_fs.c: revision 1.64
Fix inverted error check.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.6.1 src/sys/compat/netbsd32/netbsd32_fs.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.55 src/sys/compat/netbsd32/netbsd32_fs.c:1.55.6.1
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.55	Tue Jun 24 11:18:15 2008
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Sun Jan 13 16:22:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.55 2008/06/24 11:18:15 ad Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.55.6.1 2013/01/13 16:22:17 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.55 2008/06/24 11:18:15 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.55.6.1 2013/01/13 16:22:17 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -593,7 +593,7 @@ netbsd32___fhstat40(struct lwp *l, const
 	int error;
 
 	error = do_fhstat(l, SCARG_P32(uap, fhp), SCARG(uap, fh_size), sb);
-	if (error != 0) {
+	if (error == 0) {
 		netbsd32_from___stat30(sb, sb32);
 		error = copyout(sb32, SCARG_P32(uap, sb), sizeof(sb));
 	}



CVS commit: [netbsd-5] src/sys/dev/usb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:28:07 UTC 2013

Modified Files:
src/sys/dev/usb [netbsd-5]: ubsa_common.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1830):
sys/dev/usb/ubsa_common.c: revision 1.9
Fix off by one read error.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.8.1 src/sys/dev/usb/ubsa_common.c

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

Modified files:

Index: src/sys/dev/usb/ubsa_common.c
diff -u src/sys/dev/usb/ubsa_common.c:1.4 src/sys/dev/usb/ubsa_common.c:1.4.8.1
--- src/sys/dev/usb/ubsa_common.c:1.4	Sat May 24 16:40:58 2008
+++ src/sys/dev/usb/ubsa_common.c	Sun Jan 13 16:28:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $	*/
+/*	$NetBSD: ubsa_common.c,v 1.4.8.1 2013/01/13 16:28:07 bouyer Exp $	*/
 /*-
  * Copyright (c) 2002, Alexander Kabaev kan.FreeBSD.org.
  * All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $);
+__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4.8.1 2013/01/13 16:28:07 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -112,7 +112,7 @@ ubsa_request(struct ubsa_softc *sc, int 
 	else
 		req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
 
-	if (portno  UBSA_MAXCONN) {
+	if (portno = UBSA_MAXCONN) {
 		printf(%s: ubsa_request: invalid port(%d)#\n,
 			USBDEVNAME(sc-sc_dev), portno);
 		return USBD_INVAL; 



CVS commit: [netbsd-5-0] src/sys/dev/usb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:29:00 UTC 2013

Modified Files:
src/sys/dev/usb [netbsd-5-0]: ubsa_common.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1830):
sys/dev/usb/ubsa_common.c: revision 1.9
Fix off by one read error.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.14.1 src/sys/dev/usb/ubsa_common.c

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

Modified files:

Index: src/sys/dev/usb/ubsa_common.c
diff -u src/sys/dev/usb/ubsa_common.c:1.4 src/sys/dev/usb/ubsa_common.c:1.4.14.1
--- src/sys/dev/usb/ubsa_common.c:1.4	Sat May 24 16:40:58 2008
+++ src/sys/dev/usb/ubsa_common.c	Sun Jan 13 16:29:00 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $	*/
+/*	$NetBSD: ubsa_common.c,v 1.4.14.1 2013/01/13 16:29:00 bouyer Exp $	*/
 /*-
  * Copyright (c) 2002, Alexander Kabaev kan.FreeBSD.org.
  * All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $);
+__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4.14.1 2013/01/13 16:29:00 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -112,7 +112,7 @@ ubsa_request(struct ubsa_softc *sc, int 
 	else
 		req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
 
-	if (portno  UBSA_MAXCONN) {
+	if (portno = UBSA_MAXCONN) {
 		printf(%s: ubsa_request: invalid port(%d)#\n,
 			USBDEVNAME(sc-sc_dev), portno);
 		return USBD_INVAL; 



CVS commit: [netbsd-5-1] src/sys/dev/usb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:30:16 UTC 2013

Modified Files:
src/sys/dev/usb [netbsd-5-1]: ubsa_common.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1830):
sys/dev/usb/ubsa_common.c: revision 1.9
Fix off by one read error.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.22.1 src/sys/dev/usb/ubsa_common.c

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

Modified files:

Index: src/sys/dev/usb/ubsa_common.c
diff -u src/sys/dev/usb/ubsa_common.c:1.4 src/sys/dev/usb/ubsa_common.c:1.4.22.1
--- src/sys/dev/usb/ubsa_common.c:1.4	Sat May 24 16:40:58 2008
+++ src/sys/dev/usb/ubsa_common.c	Sun Jan 13 16:30:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $	*/
+/*	$NetBSD: ubsa_common.c,v 1.4.22.1 2013/01/13 16:30:16 bouyer Exp $	*/
 /*-
  * Copyright (c) 2002, Alexander Kabaev kan.FreeBSD.org.
  * All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $);
+__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4.22.1 2013/01/13 16:30:16 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -112,7 +112,7 @@ ubsa_request(struct ubsa_softc *sc, int 
 	else
 		req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
 
-	if (portno  UBSA_MAXCONN) {
+	if (portno = UBSA_MAXCONN) {
 		printf(%s: ubsa_request: invalid port(%d)#\n,
 			USBDEVNAME(sc-sc_dev), portno);
 		return USBD_INVAL; 



CVS commit: [netbsd-5-2] src/sys/dev/usb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:30:17 UTC 2013

Modified Files:
src/sys/dev/usb [netbsd-5-2]: ubsa_common.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1830):
sys/dev/usb/ubsa_common.c: revision 1.9
Fix off by one read error.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.26.1 src/sys/dev/usb/ubsa_common.c

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

Modified files:

Index: src/sys/dev/usb/ubsa_common.c
diff -u src/sys/dev/usb/ubsa_common.c:1.4 src/sys/dev/usb/ubsa_common.c:1.4.26.1
--- src/sys/dev/usb/ubsa_common.c:1.4	Sat May 24 16:40:58 2008
+++ src/sys/dev/usb/ubsa_common.c	Sun Jan 13 16:30:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $	*/
+/*	$NetBSD: ubsa_common.c,v 1.4.26.1 2013/01/13 16:30:17 bouyer Exp $	*/
 /*-
  * Copyright (c) 2002, Alexander Kabaev kan.FreeBSD.org.
  * All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $);
+__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4.26.1 2013/01/13 16:30:17 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -112,7 +112,7 @@ ubsa_request(struct ubsa_softc *sc, int 
 	else
 		req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
 
-	if (portno  UBSA_MAXCONN) {
+	if (portno = UBSA_MAXCONN) {
 		printf(%s: ubsa_request: invalid port(%d)#\n,
 			USBDEVNAME(sc-sc_dev), portno);
 		return USBD_INVAL; 



CVS commit: [netbsd-5] src/sys/external/bsd/drm/dist/shared-core

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:32:22 UTC 2013

Modified Files:
src/sys/external/bsd/drm/dist/shared-core [netbsd-5]: i915_suspend.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1831):
sys/external/bsd/drm/dist/shared-core/i915_suspend.c: revision 1.6
Fix wrong reference to dev_priv-saveSWF1. It was clearly wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.3.10.1 -r1.3.10.2 \
src/sys/external/bsd/drm/dist/shared-core/i915_suspend.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/drm/dist/shared-core/i915_suspend.c
diff -u src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.10.1 src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.10.2
--- src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.10.1	Sat Jun 20 23:37:01 2009
+++ src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c	Sun Jan 13 16:32:22 2013
@@ -512,7 +512,7 @@ int i915_restore_state(struct drm_device
 
 	for (i = 0; i  16; i++) {
 		I915_WRITE(SWF00 + (i  2), dev_priv-saveSWF0[i]);
-		I915_WRITE(SWF10 + (i  2), dev_priv-saveSWF1[i+7]);
+		I915_WRITE(SWF10 + (i  2), dev_priv-saveSWF1[i]);
 	}
 	for (i = 0; i  3; i++)
 		I915_WRITE(SWF30 + (i  2), dev_priv-saveSWF2[i]);



CVS commit: [netbsd-5-0] src/sys/external/bsd/drm/dist/shared-core

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:32:25 UTC 2013

Modified Files:
src/sys/external/bsd/drm/dist/shared-core [netbsd-5-0]: i915_suspend.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1831):
sys/external/bsd/drm/dist/shared-core/i915_suspend.c: revision 1.6
Fix wrong reference to dev_priv-saveSWF1. It was clearly wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.16.1 \
src/sys/external/bsd/drm/dist/shared-core/i915_suspend.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/drm/dist/shared-core/i915_suspend.c
diff -u src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3 src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.16.1
--- src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3	Sat Jul 19 22:14:13 2008
+++ src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c	Sun Jan 13 16:32:25 2013
@@ -513,7 +513,7 @@ int i915_restore_state(struct drm_device
 
 	for (i = 0; i  16; i++) {
 		I915_WRITE(SWF00 + (i  2), dev_priv-saveSWF0[i]);
-		I915_WRITE(SWF10 + (i  2), dev_priv-saveSWF1[i+7]);
+		I915_WRITE(SWF10 + (i  2), dev_priv-saveSWF1[i]);
 	}
 	for (i = 0; i  3; i++)
 		I915_WRITE(SWF30 + (i  2), dev_priv-saveSWF2[i]);



CVS commit: [netbsd-5-2] src/sys/external/bsd/drm/dist/shared-core

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:32:28 UTC 2013

Modified Files:
src/sys/external/bsd/drm/dist/shared-core [netbsd-5-2]: i915_suspend.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1831):
sys/external/bsd/drm/dist/shared-core/i915_suspend.c: revision 1.6
Fix wrong reference to dev_priv-saveSWF1. It was clearly wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.3.10.1 -r1.3.10.1.6.1 \
src/sys/external/bsd/drm/dist/shared-core/i915_suspend.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/drm/dist/shared-core/i915_suspend.c
diff -u src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.10.1 src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.10.1.6.1
--- src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.10.1	Sat Jun 20 23:37:01 2009
+++ src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c	Sun Jan 13 16:32:27 2013
@@ -512,7 +512,7 @@ int i915_restore_state(struct drm_device
 
 	for (i = 0; i  16; i++) {
 		I915_WRITE(SWF00 + (i  2), dev_priv-saveSWF0[i]);
-		I915_WRITE(SWF10 + (i  2), dev_priv-saveSWF1[i+7]);
+		I915_WRITE(SWF10 + (i  2), dev_priv-saveSWF1[i]);
 	}
 	for (i = 0; i  3; i++)
 		I915_WRITE(SWF30 + (i  2), dev_priv-saveSWF2[i]);



CVS commit: [netbsd-5-1] src/sys/external/bsd/drm/dist/shared-core

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:32:31 UTC 2013

Modified Files:
src/sys/external/bsd/drm/dist/shared-core [netbsd-5-1]: i915_suspend.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1831):
sys/external/bsd/drm/dist/shared-core/i915_suspend.c: revision 1.6
Fix wrong reference to dev_priv-saveSWF1. It was clearly wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.3.10.1 -r1.3.10.1.2.1 \
src/sys/external/bsd/drm/dist/shared-core/i915_suspend.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/drm/dist/shared-core/i915_suspend.c
diff -u src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.10.1 src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.10.1.2.1
--- src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.3.10.1	Sat Jun 20 23:37:01 2009
+++ src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c	Sun Jan 13 16:32:30 2013
@@ -512,7 +512,7 @@ int i915_restore_state(struct drm_device
 
 	for (i = 0; i  16; i++) {
 		I915_WRITE(SWF00 + (i  2), dev_priv-saveSWF0[i]);
-		I915_WRITE(SWF10 + (i  2), dev_priv-saveSWF1[i+7]);
+		I915_WRITE(SWF10 + (i  2), dev_priv-saveSWF1[i]);
 	}
 	for (i = 0; i  3; i++)
 		I915_WRITE(SWF30 + (i  2), dev_priv-saveSWF2[i]);



CVS commit: [netbsd-5] src/sbin/sysctl

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:35:24 UTC 2013

Modified Files:
src/sbin/sysctl [netbsd-5]: sysctl.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1832):
sbin/sysctl/sysctl.c: revision 1.149 via patch
Add missing free() in error path.


To generate a diff of this commit:
cvs rdiff -u -r1.124.2.1 -r1.124.2.2 src/sbin/sysctl/sysctl.c

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

Modified files:

Index: src/sbin/sysctl/sysctl.c
diff -u src/sbin/sysctl/sysctl.c:1.124.2.1 src/sbin/sysctl/sysctl.c:1.124.2.2
--- src/sbin/sysctl/sysctl.c:1.124.2.1	Wed Apr  1 21:37:02 2009
+++ src/sbin/sysctl/sysctl.c	Sun Jan 13 16:35:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.c,v 1.124.2.1 2009/04/01 21:37:02 snj Exp $ */
+/*	$NetBSD: sysctl.c,v 1.124.2.2 2013/01/13 16:35:24 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT(@(#) Copyright (c) 1993\
 #if 0
 static char sccsid[] = @(#)sysctl.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: sysctl.c,v 1.124.2.1 2009/04/01 21:37:02 snj Exp $);
+__RCSID($NetBSD: sysctl.c,v 1.124.2.2 2013/01/13 16:35:24 bouyer Exp $);
 #endif
 #endif /* not lint */
 
@@ -2246,6 +2246,7 @@ kern_drivers(HANDLER_ARGS)
 	rc = sysctl(name, namelen, kd, sz, NULL, 0);
 	if (rc == -1) {
 		sysctlerror(1);
+		free(kd);
 		return;
 	}
 



CVS commit: [netbsd-5] src/usr.bin/netstat

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:36:58 UTC 2013

Modified Files:
src/usr.bin/netstat [netbsd-5]: bpf.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1833):
usr.bin/netstat/bpf.c: revision 1.11
Fix memory leak.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.6.1 src/usr.bin/netstat/bpf.c

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

Modified files:

Index: src/usr.bin/netstat/bpf.c
diff -u src/usr.bin/netstat/bpf.c:1.8 src/usr.bin/netstat/bpf.c:1.8.6.1
--- src/usr.bin/netstat/bpf.c:1.8	Mon Apr 28 20:24:14 2008
+++ src/usr.bin/netstat/bpf.c	Sun Jan 13 16:36:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.8 2008/04/28 20:24:14 martin Exp $	*/
+/*	$NetBSD: bpf.c,v 1.8.6.1 2013/01/13 16:36:58 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -165,6 +165,7 @@ bpf_dump(char *interface)
 printf(%s\n, p.p_comm);
 #undef BPFEXT
 		}
+		free(v);
 	} else {
 /* XXX */
 errx(1, bpf_dump not implemented using kvm);



CVS commit: [netbsd-5] src/sys/arch

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:46:23 UTC 2013

Modified Files:
src/sys/arch/amd64/conf [netbsd-5]: XEN3_DOMU
src/sys/arch/i386/conf [netbsd-5]: XEN2_DOMU

Log Message:
apply patch(s) (requested by sborrill in ticket #1834):
sys/arch/i386/conf/XEN2_DOMU: patch
sys/arch/amd64/conf/XEN3_DOMU: patch
Add drvctl to Xen DOMU kernels


To generate a diff of this commit:
cvs rdiff -u -r1.13.4.2 -r1.13.4.3 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.19.4.2 -r1.19.4.3 src/sys/arch/i386/conf/XEN2_DOMU

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOMU
diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.2 src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.3
--- src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.2	Mon Feb 15 18:04:11 2010
+++ src/sys/arch/amd64/conf/XEN3_DOMU	Sun Jan 13 16:46:22 2013
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.13.4.2 2010/02/15 18:04:11 sborrill Exp $
+# $NetBSD: XEN3_DOMU,v 1.13.4.3 2013/01/13 16:46:22 bouyer Exp $
 
 include 	arch/amd64/conf/std.xen
 
@@ -223,3 +223,6 @@ pseudo-device	vcoda		4	# coda minicache 
 
 # a pseudo device needed for SMBFS
 pseudo-device	nsmb			# experimental - SMB requester
+
+# userland interface to drivers, including autoconf and properties retrieval
+pseudo-device   drvctl

Index: src/sys/arch/i386/conf/XEN2_DOMU
diff -u src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.2 src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.3
--- src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.2	Mon Feb 15 18:04:11 2010
+++ src/sys/arch/i386/conf/XEN2_DOMU	Sun Jan 13 16:46:22 2013
@@ -1,4 +1,4 @@
-# $NetBSD: XEN2_DOMU,v 1.19.4.2 2010/02/15 18:04:11 sborrill Exp $
+# $NetBSD: XEN2_DOMU,v 1.19.4.3 2013/01/13 16:46:22 bouyer Exp $
 
 include 	arch/xen/conf/std.xen
 
@@ -237,3 +237,6 @@ pseudo-device	vcoda		4	# coda minicache 
 
 # a pseudo device needed for SMBFS
 pseudo-device	nsmb			# experimental - SMB requester
+
+# userland interface to drivers, including autoconf and properties retrieval
+pseudo-device   drvctl



CVS commit: [netbsd-5] src/sbin/fsck_ffs

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:54:39 UTC 2013

Modified Files:
src/sbin/fsck_ffs [netbsd-5]: pass1.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1837):
sbin/fsck_ffs/pass1.c: revision 1.50
Show pass1 SIGINFO output on stderr like other passes, not on stdout.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.2.1 src/sbin/fsck_ffs/pass1.c

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

Modified files:

Index: src/sbin/fsck_ffs/pass1.c
diff -u src/sbin/fsck_ffs/pass1.c:1.46 src/sbin/fsck_ffs/pass1.c:1.46.2.1
--- src/sbin/fsck_ffs/pass1.c:1.46	Sun Oct 12 23:26:12 2008
+++ src/sbin/fsck_ffs/pass1.c	Sun Jan 13 16:54:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pass1.c,v 1.46 2008/10/12 23:26:12 christos Exp $	*/
+/*	$NetBSD: pass1.c,v 1.46.2.1 2013/01/13 16:54:39 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)pass1.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: pass1.c,v 1.46 2008/10/12 23:26:12 christos Exp $);
+__RCSID($NetBSD: pass1.c,v 1.46.2.1 2013/01/13 16:54:39 bouyer Exp $);
 #endif
 #endif /* not lint */
 
@@ -109,7 +109,8 @@ pass1(void)
 		else
 			inosused = sblock-fs_ipg;
 		if (got_siginfo) {
-			printf(%s: phase 1: cyl group %d of %d (%d%%)\n,
+			fprintf(stderr,
+			%s: phase 1: cyl group %d of %d (%d%%)\n,
 			cdevname(), c, sblock-fs_ncg,
 			c * 100 / sblock-fs_ncg);
 			got_siginfo = 0;



CVS commit: [netbsd-5-0] src/sbin/fsck_ffs

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:55:07 UTC 2013

Modified Files:
src/sbin/fsck_ffs [netbsd-5-0]: pass1.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1837):
sbin/fsck_ffs/pass1.c: revision 1.50
Show pass1 SIGINFO output on stderr like other passes, not on stdout.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.6.1 src/sbin/fsck_ffs/pass1.c

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

Modified files:

Index: src/sbin/fsck_ffs/pass1.c
diff -u src/sbin/fsck_ffs/pass1.c:1.46 src/sbin/fsck_ffs/pass1.c:1.46.6.1
--- src/sbin/fsck_ffs/pass1.c:1.46	Sun Oct 12 23:26:12 2008
+++ src/sbin/fsck_ffs/pass1.c	Sun Jan 13 16:55:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pass1.c,v 1.46 2008/10/12 23:26:12 christos Exp $	*/
+/*	$NetBSD: pass1.c,v 1.46.6.1 2013/01/13 16:55:06 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)pass1.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: pass1.c,v 1.46 2008/10/12 23:26:12 christos Exp $);
+__RCSID($NetBSD: pass1.c,v 1.46.6.1 2013/01/13 16:55:06 bouyer Exp $);
 #endif
 #endif /* not lint */
 
@@ -109,7 +109,8 @@ pass1(void)
 		else
 			inosused = sblock-fs_ipg;
 		if (got_siginfo) {
-			printf(%s: phase 1: cyl group %d of %d (%d%%)\n,
+			fprintf(stderr,
+			%s: phase 1: cyl group %d of %d (%d%%)\n,
 			cdevname(), c, sblock-fs_ncg,
 			c * 100 / sblock-fs_ncg);
 			got_siginfo = 0;



CVS commit: [netbsd-5-1] src/sbin/fsck_ffs

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:55:29 UTC 2013

Modified Files:
src/sbin/fsck_ffs [netbsd-5-1]: pass1.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1837):
sbin/fsck_ffs/pass1.c: revision 1.50
Show pass1 SIGINFO output on stderr like other passes, not on stdout.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.10.1 src/sbin/fsck_ffs/pass1.c

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

Modified files:

Index: src/sbin/fsck_ffs/pass1.c
diff -u src/sbin/fsck_ffs/pass1.c:1.46 src/sbin/fsck_ffs/pass1.c:1.46.10.1
--- src/sbin/fsck_ffs/pass1.c:1.46	Sun Oct 12 23:26:12 2008
+++ src/sbin/fsck_ffs/pass1.c	Sun Jan 13 16:55:29 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pass1.c,v 1.46 2008/10/12 23:26:12 christos Exp $	*/
+/*	$NetBSD: pass1.c,v 1.46.10.1 2013/01/13 16:55:29 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)pass1.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: pass1.c,v 1.46 2008/10/12 23:26:12 christos Exp $);
+__RCSID($NetBSD: pass1.c,v 1.46.10.1 2013/01/13 16:55:29 bouyer Exp $);
 #endif
 #endif /* not lint */
 
@@ -109,7 +109,8 @@ pass1(void)
 		else
 			inosused = sblock-fs_ipg;
 		if (got_siginfo) {
-			printf(%s: phase 1: cyl group %d of %d (%d%%)\n,
+			fprintf(stderr,
+			%s: phase 1: cyl group %d of %d (%d%%)\n,
 			cdevname(), c, sblock-fs_ncg,
 			c * 100 / sblock-fs_ncg);
 			got_siginfo = 0;



CVS commit: [netbsd-5-2] src/sbin/fsck_ffs

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:55:34 UTC 2013

Modified Files:
src/sbin/fsck_ffs [netbsd-5-2]: pass1.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1837):
sbin/fsck_ffs/pass1.c: revision 1.50
Show pass1 SIGINFO output on stderr like other passes, not on stdout.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.16.1 src/sbin/fsck_ffs/pass1.c

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

Modified files:

Index: src/sbin/fsck_ffs/pass1.c
diff -u src/sbin/fsck_ffs/pass1.c:1.46 src/sbin/fsck_ffs/pass1.c:1.46.16.1
--- src/sbin/fsck_ffs/pass1.c:1.46	Sun Oct 12 23:26:12 2008
+++ src/sbin/fsck_ffs/pass1.c	Sun Jan 13 16:55:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pass1.c,v 1.46 2008/10/12 23:26:12 christos Exp $	*/
+/*	$NetBSD: pass1.c,v 1.46.16.1 2013/01/13 16:55:34 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)pass1.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: pass1.c,v 1.46 2008/10/12 23:26:12 christos Exp $);
+__RCSID($NetBSD: pass1.c,v 1.46.16.1 2013/01/13 16:55:34 bouyer Exp $);
 #endif
 #endif /* not lint */
 
@@ -109,7 +109,8 @@ pass1(void)
 		else
 			inosused = sblock-fs_ipg;
 		if (got_siginfo) {
-			printf(%s: phase 1: cyl group %d of %d (%d%%)\n,
+			fprintf(stderr,
+			%s: phase 1: cyl group %d of %d (%d%%)\n,
 			cdevname(), c, sblock-fs_ncg,
 			c * 100 / sblock-fs_ncg);
 			got_siginfo = 0;



CVS commit: [netbsd-5] src/etc/namedb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:00:33 UTC 2013

Modified Files:
src/etc/namedb [netbsd-5]: root.cache

Log Message:
Pull up following revision(s) (requested by taca in ticket #1839):
etc/namedb/root.cache: revision 1.17
D.ROOT-SERVERS.NET changes IPv4 address.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.12.1 src/etc/namedb/root.cache

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

Modified files:

Index: src/etc/namedb/root.cache
diff -u src/etc/namedb/root.cache:1.13 src/etc/namedb/root.cache:1.13.12.1
--- src/etc/namedb/root.cache:1.13	Tue Feb  5 09:19:06 2008
+++ src/etc/namedb/root.cache	Sun Jan 13 17:00:32 2013
@@ -1,4 +1,4 @@
-;	$NetBSD: root.cache,v 1.13 2008/02/05 09:19:06 tron Exp $
+;	$NetBSD: root.cache,v 1.13.12.1 2013/01/13 17:00:32 bouyer Exp $
 ;
 ;   This file holds the information on root name servers needed to
 ;   initialize cache of Internet domain name servers
@@ -33,7 +33,8 @@ C.ROOT-SERVERS.NET.  360  A 
 ; formerly TERP.UMD.EDU
 ;
 .360  NSD.ROOT-SERVERS.NET.
-D.ROOT-SERVERS.NET.  360  A 128.8.10.90
+D.ROOT-SERVERS.NET.  360  A 199.7.91.13
+D.ROOT-SERVERS.NET.	 360    2001:500:2D::D
 ;
 ; formerly NS.NASA.GOV
 ;



CVS commit: [netbsd-5-1] src/etc/namedb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:07:29 UTC 2013

Modified Files:
src/etc/namedb [netbsd-5-1]: root.cache

Log Message:
Pull up following revision(s) (requested by taca in ticket #1839):
etc/namedb/root.cache: revision 1.17
D.ROOT-SERVERS.NET changes IPv4 address.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.20.1 src/etc/namedb/root.cache

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

Modified files:

Index: src/etc/namedb/root.cache
diff -u src/etc/namedb/root.cache:1.13 src/etc/namedb/root.cache:1.13.20.1
--- src/etc/namedb/root.cache:1.13	Tue Feb  5 09:19:06 2008
+++ src/etc/namedb/root.cache	Sun Jan 13 17:07:29 2013
@@ -1,4 +1,4 @@
-;	$NetBSD: root.cache,v 1.13 2008/02/05 09:19:06 tron Exp $
+;	$NetBSD: root.cache,v 1.13.20.1 2013/01/13 17:07:29 bouyer Exp $
 ;
 ;   This file holds the information on root name servers needed to
 ;   initialize cache of Internet domain name servers
@@ -33,7 +33,8 @@ C.ROOT-SERVERS.NET.  360  A 
 ; formerly TERP.UMD.EDU
 ;
 .360  NSD.ROOT-SERVERS.NET.
-D.ROOT-SERVERS.NET.  360  A 128.8.10.90
+D.ROOT-SERVERS.NET.  360  A 199.7.91.13
+D.ROOT-SERVERS.NET.	 360    2001:500:2D::D
 ;
 ; formerly NS.NASA.GOV
 ;



CVS commit: [netbsd-5-0] src/etc/namedb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:07:35 UTC 2013

Modified Files:
src/etc/namedb [netbsd-5-0]: root.cache

Log Message:
Pull up following revision(s) (requested by taca in ticket #1839):
etc/namedb/root.cache: revision 1.17
D.ROOT-SERVERS.NET changes IPv4 address.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.16.1 src/etc/namedb/root.cache

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

Modified files:

Index: src/etc/namedb/root.cache
diff -u src/etc/namedb/root.cache:1.13 src/etc/namedb/root.cache:1.13.16.1
--- src/etc/namedb/root.cache:1.13	Tue Feb  5 09:19:06 2008
+++ src/etc/namedb/root.cache	Sun Jan 13 17:07:34 2013
@@ -1,4 +1,4 @@
-;	$NetBSD: root.cache,v 1.13 2008/02/05 09:19:06 tron Exp $
+;	$NetBSD: root.cache,v 1.13.16.1 2013/01/13 17:07:34 bouyer Exp $
 ;
 ;   This file holds the information on root name servers needed to
 ;   initialize cache of Internet domain name servers
@@ -33,7 +33,8 @@ C.ROOT-SERVERS.NET.  360  A 
 ; formerly TERP.UMD.EDU
 ;
 .360  NSD.ROOT-SERVERS.NET.
-D.ROOT-SERVERS.NET.  360  A 128.8.10.90
+D.ROOT-SERVERS.NET.  360  A 199.7.91.13
+D.ROOT-SERVERS.NET.	 360    2001:500:2D::D
 ;
 ; formerly NS.NASA.GOV
 ;



CVS commit: [netbsd-5-2] src/etc/namedb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:07:34 UTC 2013

Modified Files:
src/etc/namedb [netbsd-5-2]: root.cache

Log Message:
Pull up following revision(s) (requested by taca in ticket #1839):
etc/namedb/root.cache: revision 1.17
D.ROOT-SERVERS.NET changes IPv4 address.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.24.1 src/etc/namedb/root.cache

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

Modified files:

Index: src/etc/namedb/root.cache
diff -u src/etc/namedb/root.cache:1.13 src/etc/namedb/root.cache:1.13.24.1
--- src/etc/namedb/root.cache:1.13	Tue Feb  5 09:19:06 2008
+++ src/etc/namedb/root.cache	Sun Jan 13 17:07:34 2013
@@ -1,4 +1,4 @@
-;	$NetBSD: root.cache,v 1.13 2008/02/05 09:19:06 tron Exp $
+;	$NetBSD: root.cache,v 1.13.24.1 2013/01/13 17:07:34 bouyer Exp $
 ;
 ;   This file holds the information on root name servers needed to
 ;   initialize cache of Internet domain name servers
@@ -33,7 +33,8 @@ C.ROOT-SERVERS.NET.  360  A 
 ; formerly TERP.UMD.EDU
 ;
 .360  NSD.ROOT-SERVERS.NET.
-D.ROOT-SERVERS.NET.  360  A 128.8.10.90
+D.ROOT-SERVERS.NET.  360  A 199.7.91.13
+D.ROOT-SERVERS.NET.	 360    2001:500:2D::D
 ;
 ; formerly NS.NASA.GOV
 ;



CVS commit: [netbsd-5] src/gnu/dist/grep

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:12:55 UTC 2013

Modified Files:
src/gnu/dist/grep/lib [netbsd-5]: getopt.c regex.c
src/gnu/dist/grep/src [netbsd-5]: ansi2knr.c dfa.c grep.c search.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #1838):
gnu/dist/grep/src/grep.c: revision 1.14
gnu/dist/grep/src/ansi2knr.c: revision 1.2
gnu/dist/grep/src/search.c: revision 1.4
gnu/dist/grep/src/dfa.c: revision 1.3
gnu/dist/grep/lib/getopt.c: revision 1.2
gnu/dist/grep/lib/regex.c: revision 1.2
Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.
This change to NetBSD's version of GNU grep 2.5.1 (licenced under
GPLv2) was made without direct reference to any code licenced
under GPLv3.
Thanks to Ignatios Souvatzis for looking at GPLv3-derived
patches and describing the problem in general terms.  Thanks to
pkgsrc/devel/coccinelle for helping me find places where int
variables were used to store the results from pointer arithmetic
or strlen().  Thanks to Martin Husemann for testing.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.38.1 src/gnu/dist/grep/lib/getopt.c \
src/gnu/dist/grep/lib/regex.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.38.1 src/gnu/dist/grep/src/ansi2knr.c
cvs rdiff -u -r1.2 -r1.2.38.1 src/gnu/dist/grep/src/dfa.c
cvs rdiff -u -r1.12 -r1.12.4.1 src/gnu/dist/grep/src/grep.c
cvs rdiff -u -r1.3 -r1.3.4.1 src/gnu/dist/grep/src/search.c

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

Modified files:

Index: src/gnu/dist/grep/lib/getopt.c
diff -u src/gnu/dist/grep/lib/getopt.c:1.1.1.1 src/gnu/dist/grep/lib/getopt.c:1.1.1.1.38.1
--- src/gnu/dist/grep/lib/getopt.c:1.1.1.1	Sun Jan 26 23:15:12 2003
+++ src/gnu/dist/grep/lib/getopt.c	Sun Jan 13 17:12:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: getopt.c,v 1.1.1.1 2003/01/26 23:15:12 wiz Exp $	*/
+/*	$NetBSD: getopt.c,v 1.1.1.1.38.1 2013/01/13 17:12:55 bouyer Exp $	*/
 
 /* Getopt for GNU.
NOTE: The canonical source of this file is maintained with the GNU
@@ -431,7 +431,7 @@ _getopt_initialize (argc, argv, optstrin
 	  else
 	{
 	  const char *orig_str = __getopt_nonoption_flags;
-	  int len = nonoption_flags_max_len = strlen (orig_str);
+	  size_t len = nonoption_flags_max_len = strlen (orig_str);
 	  if (nonoption_flags_max_len  argc)
 		nonoption_flags_max_len = argc;
 	  __getopt_nonoption_flags =
Index: src/gnu/dist/grep/lib/regex.c
diff -u src/gnu/dist/grep/lib/regex.c:1.1.1.1 src/gnu/dist/grep/lib/regex.c:1.1.1.1.38.1
--- src/gnu/dist/grep/lib/regex.c:1.1.1.1	Sun Jan 26 23:15:13 2003
+++ src/gnu/dist/grep/lib/regex.c	Sun Jan 13 17:12:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: regex.c,v 1.1.1.1 2003/01/26 23:15:13 wiz Exp $	*/
+/*	$NetBSD: regex.c,v 1.1.1.1.38.1 2013/01/13 17:12:55 bouyer Exp $	*/
 
 /* Extended regular expression matching and search library,
version 0.12.
@@ -1127,7 +1127,7 @@ print_double_string (where, string1, siz
 int size1;
 int size2;
 {
-  int this_char;
+  ptrdiff_t this_char;
 
   if (where == NULL)
 printf ((null));

Index: src/gnu/dist/grep/src/ansi2knr.c
diff -u src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1 src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1.38.1
--- src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1	Sun Jan 26 23:15:29 2003
+++ src/gnu/dist/grep/src/ansi2knr.c	Sun Jan 13 17:12:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ansi2knr.c,v 1.1.1.1 2003/01/26 23:15:29 wiz Exp $	*/
+/*	$NetBSD: ansi2knr.c,v 1.1.1.1.38.1 2013/01/13 17:12:55 bouyer Exp $	*/
 
 /* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved. */
 
@@ -461,7 +461,7 @@ test1(buf)
 	   }
 	   {
 	   char *id = p;
-	   int len;
+	   ptrdiff_t len;
 	   /*
 		* Check for identifier1(identifier2) and not
 		* identifier1(void), or identifier1(identifier2, ).

Index: src/gnu/dist/grep/src/dfa.c
diff -u src/gnu/dist/grep/src/dfa.c:1.2 src/gnu/dist/grep/src/dfa.c:1.2.38.1
--- src/gnu/dist/grep/src/dfa.c:1.2	Sun Jan 26 23:55:52 2003
+++ src/gnu/dist/grep/src/dfa.c	Sun Jan 13 17:12:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dfa.c,v 1.2 2003/01/26 23:55:52 wiz Exp $	*/
+/*	$NetBSD: dfa.c,v 1.2.38.1 2013/01/13 17:12:55 bouyer Exp $	*/
 
 /* dfa.c - deterministic extended regexp routines for GNU
Copyright 1988, 1998, 2000 Free Software Foundation, Inc.
@@ -334,9 +334,10 @@ static int hard_LC_COLLATE;	/* Nonzero i
 #ifdef MBS_SUPPORT
 /* These variables are used only if (MB_CUR_MAX  1).  */
 static mbstate_t mbs;		/* Mbstate for mbrlen().  */
-static int cur_mb_len;		/* Byte length of the current scanning
-   multibyte character.  */
-static int cur_mb_index;/* Byte index of the current scanning multibyte
+static ssize_t cur_mb_len;	/* Byte length of the current 

CVS commit: [netbsd-5-2] src/gnu/dist/grep

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:14:45 UTC 2013

Modified Files:
src/gnu/dist/grep/lib [netbsd-5-2]: getopt.c regex.c
src/gnu/dist/grep/src [netbsd-5-2]: ansi2knr.c dfa.c grep.c search.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #1838):
gnu/dist/grep/src/grep.c: revision 1.14
gnu/dist/grep/src/ansi2knr.c: revision 1.2
gnu/dist/grep/src/search.c: revision 1.4
gnu/dist/grep/src/dfa.c: revision 1.3
gnu/dist/grep/lib/getopt.c: revision 1.2
gnu/dist/grep/lib/regex.c: revision 1.2
Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.
This change to NetBSD's version of GNU grep 2.5.1 (licenced under
GPLv2) was made without direct reference to any code licenced
under GPLv3.
Thanks to Ignatios Souvatzis for looking at GPLv3-derived
patches and describing the problem in general terms.  Thanks to
pkgsrc/devel/coccinelle for helping me find places where int
variables were used to store the results from pointer arithmetic
or strlen().  Thanks to Martin Husemann for testing.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.64.1 src/gnu/dist/grep/lib/getopt.c \
src/gnu/dist/grep/lib/regex.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.64.1 src/gnu/dist/grep/src/ansi2knr.c
cvs rdiff -u -r1.2 -r1.2.64.1 src/gnu/dist/grep/src/dfa.c
cvs rdiff -u -r1.12 -r1.12.2.1 src/gnu/dist/grep/src/grep.c
cvs rdiff -u -r1.3 -r1.3.28.1 src/gnu/dist/grep/src/search.c

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

Modified files:

Index: src/gnu/dist/grep/lib/getopt.c
diff -u src/gnu/dist/grep/lib/getopt.c:1.1.1.1 src/gnu/dist/grep/lib/getopt.c:1.1.1.1.64.1
--- src/gnu/dist/grep/lib/getopt.c:1.1.1.1	Sun Jan 26 23:15:12 2003
+++ src/gnu/dist/grep/lib/getopt.c	Sun Jan 13 17:14:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: getopt.c,v 1.1.1.1 2003/01/26 23:15:12 wiz Exp $	*/
+/*	$NetBSD: getopt.c,v 1.1.1.1.64.1 2013/01/13 17:14:45 bouyer Exp $	*/
 
 /* Getopt for GNU.
NOTE: The canonical source of this file is maintained with the GNU
@@ -431,7 +431,7 @@ _getopt_initialize (argc, argv, optstrin
 	  else
 	{
 	  const char *orig_str = __getopt_nonoption_flags;
-	  int len = nonoption_flags_max_len = strlen (orig_str);
+	  size_t len = nonoption_flags_max_len = strlen (orig_str);
 	  if (nonoption_flags_max_len  argc)
 		nonoption_flags_max_len = argc;
 	  __getopt_nonoption_flags =
Index: src/gnu/dist/grep/lib/regex.c
diff -u src/gnu/dist/grep/lib/regex.c:1.1.1.1 src/gnu/dist/grep/lib/regex.c:1.1.1.1.64.1
--- src/gnu/dist/grep/lib/regex.c:1.1.1.1	Sun Jan 26 23:15:13 2003
+++ src/gnu/dist/grep/lib/regex.c	Sun Jan 13 17:14:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: regex.c,v 1.1.1.1 2003/01/26 23:15:13 wiz Exp $	*/
+/*	$NetBSD: regex.c,v 1.1.1.1.64.1 2013/01/13 17:14:45 bouyer Exp $	*/
 
 /* Extended regular expression matching and search library,
version 0.12.
@@ -1127,7 +1127,7 @@ print_double_string (where, string1, siz
 int size1;
 int size2;
 {
-  int this_char;
+  ptrdiff_t this_char;
 
   if (where == NULL)
 printf ((null));

Index: src/gnu/dist/grep/src/ansi2knr.c
diff -u src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1 src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1.64.1
--- src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1	Sun Jan 26 23:15:29 2003
+++ src/gnu/dist/grep/src/ansi2knr.c	Sun Jan 13 17:14:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ansi2knr.c,v 1.1.1.1 2003/01/26 23:15:29 wiz Exp $	*/
+/*	$NetBSD: ansi2knr.c,v 1.1.1.1.64.1 2013/01/13 17:14:45 bouyer Exp $	*/
 
 /* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved. */
 
@@ -461,7 +461,7 @@ test1(buf)
 	   }
 	   {
 	   char *id = p;
-	   int len;
+	   ptrdiff_t len;
 	   /*
 		* Check for identifier1(identifier2) and not
 		* identifier1(void), or identifier1(identifier2, ).

Index: src/gnu/dist/grep/src/dfa.c
diff -u src/gnu/dist/grep/src/dfa.c:1.2 src/gnu/dist/grep/src/dfa.c:1.2.64.1
--- src/gnu/dist/grep/src/dfa.c:1.2	Sun Jan 26 23:55:52 2003
+++ src/gnu/dist/grep/src/dfa.c	Sun Jan 13 17:14:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dfa.c,v 1.2 2003/01/26 23:55:52 wiz Exp $	*/
+/*	$NetBSD: dfa.c,v 1.2.64.1 2013/01/13 17:14:45 bouyer Exp $	*/
 
 /* dfa.c - deterministic extended regexp routines for GNU
Copyright 1988, 1998, 2000 Free Software Foundation, Inc.
@@ -334,9 +334,10 @@ static int hard_LC_COLLATE;	/* Nonzero i
 #ifdef MBS_SUPPORT
 /* These variables are used only if (MB_CUR_MAX  1).  */
 static mbstate_t mbs;		/* Mbstate for mbrlen().  */
-static int cur_mb_len;		/* Byte length of the current scanning
-   multibyte character.  */
-static int cur_mb_index;/* Byte index of the current scanning multibyte
+static ssize_t cur_mb_len;	/* Byte length of the current 

CVS commit: [netbsd-5-0] src/gnu/dist/grep

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:14:47 UTC 2013

Modified Files:
src/gnu/dist/grep/lib [netbsd-5-0]: getopt.c regex.c
src/gnu/dist/grep/src [netbsd-5-0]: ansi2knr.c dfa.c grep.c search.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #1838):
gnu/dist/grep/src/grep.c: revision 1.14
gnu/dist/grep/src/ansi2knr.c: revision 1.2
gnu/dist/grep/src/search.c: revision 1.4
gnu/dist/grep/src/dfa.c: revision 1.3
gnu/dist/grep/lib/getopt.c: revision 1.2
gnu/dist/grep/lib/regex.c: revision 1.2
Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.
This change to NetBSD's version of GNU grep 2.5.1 (licenced under
GPLv2) was made without direct reference to any code licenced
under GPLv3.
Thanks to Ignatios Souvatzis for looking at GPLv3-derived
patches and describing the problem in general terms.  Thanks to
pkgsrc/devel/coccinelle for helping me find places where int
variables were used to store the results from pointer arithmetic
or strlen().  Thanks to Martin Husemann for testing.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.42.1 src/gnu/dist/grep/lib/getopt.c \
src/gnu/dist/grep/lib/regex.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.42.1 src/gnu/dist/grep/src/ansi2knr.c
cvs rdiff -u -r1.2 -r1.2.42.1 src/gnu/dist/grep/src/dfa.c
cvs rdiff -u -r1.12 -r1.12.8.1 src/gnu/dist/grep/src/grep.c
cvs rdiff -u -r1.3 -r1.3.8.1 src/gnu/dist/grep/src/search.c

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

Modified files:

Index: src/gnu/dist/grep/lib/getopt.c
diff -u src/gnu/dist/grep/lib/getopt.c:1.1.1.1 src/gnu/dist/grep/lib/getopt.c:1.1.1.1.42.1
--- src/gnu/dist/grep/lib/getopt.c:1.1.1.1	Sun Jan 26 23:15:12 2003
+++ src/gnu/dist/grep/lib/getopt.c	Sun Jan 13 17:14:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: getopt.c,v 1.1.1.1 2003/01/26 23:15:12 wiz Exp $	*/
+/*	$NetBSD: getopt.c,v 1.1.1.1.42.1 2013/01/13 17:14:47 bouyer Exp $	*/
 
 /* Getopt for GNU.
NOTE: The canonical source of this file is maintained with the GNU
@@ -431,7 +431,7 @@ _getopt_initialize (argc, argv, optstrin
 	  else
 	{
 	  const char *orig_str = __getopt_nonoption_flags;
-	  int len = nonoption_flags_max_len = strlen (orig_str);
+	  size_t len = nonoption_flags_max_len = strlen (orig_str);
 	  if (nonoption_flags_max_len  argc)
 		nonoption_flags_max_len = argc;
 	  __getopt_nonoption_flags =
Index: src/gnu/dist/grep/lib/regex.c
diff -u src/gnu/dist/grep/lib/regex.c:1.1.1.1 src/gnu/dist/grep/lib/regex.c:1.1.1.1.42.1
--- src/gnu/dist/grep/lib/regex.c:1.1.1.1	Sun Jan 26 23:15:13 2003
+++ src/gnu/dist/grep/lib/regex.c	Sun Jan 13 17:14:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: regex.c,v 1.1.1.1 2003/01/26 23:15:13 wiz Exp $	*/
+/*	$NetBSD: regex.c,v 1.1.1.1.42.1 2013/01/13 17:14:47 bouyer Exp $	*/
 
 /* Extended regular expression matching and search library,
version 0.12.
@@ -1127,7 +1127,7 @@ print_double_string (where, string1, siz
 int size1;
 int size2;
 {
-  int this_char;
+  ptrdiff_t this_char;
 
   if (where == NULL)
 printf ((null));

Index: src/gnu/dist/grep/src/ansi2knr.c
diff -u src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1 src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1.42.1
--- src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1	Sun Jan 26 23:15:29 2003
+++ src/gnu/dist/grep/src/ansi2knr.c	Sun Jan 13 17:14:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ansi2knr.c,v 1.1.1.1 2003/01/26 23:15:29 wiz Exp $	*/
+/*	$NetBSD: ansi2knr.c,v 1.1.1.1.42.1 2013/01/13 17:14:47 bouyer Exp $	*/
 
 /* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved. */
 
@@ -461,7 +461,7 @@ test1(buf)
 	   }
 	   {
 	   char *id = p;
-	   int len;
+	   ptrdiff_t len;
 	   /*
 		* Check for identifier1(identifier2) and not
 		* identifier1(void), or identifier1(identifier2, ).

Index: src/gnu/dist/grep/src/dfa.c
diff -u src/gnu/dist/grep/src/dfa.c:1.2 src/gnu/dist/grep/src/dfa.c:1.2.42.1
--- src/gnu/dist/grep/src/dfa.c:1.2	Sun Jan 26 23:55:52 2003
+++ src/gnu/dist/grep/src/dfa.c	Sun Jan 13 17:14:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dfa.c,v 1.2 2003/01/26 23:55:52 wiz Exp $	*/
+/*	$NetBSD: dfa.c,v 1.2.42.1 2013/01/13 17:14:47 bouyer Exp $	*/
 
 /* dfa.c - deterministic extended regexp routines for GNU
Copyright 1988, 1998, 2000 Free Software Foundation, Inc.
@@ -334,9 +334,10 @@ static int hard_LC_COLLATE;	/* Nonzero i
 #ifdef MBS_SUPPORT
 /* These variables are used only if (MB_CUR_MAX  1).  */
 static mbstate_t mbs;		/* Mbstate for mbrlen().  */
-static int cur_mb_len;		/* Byte length of the current scanning
-   multibyte character.  */
-static int cur_mb_index;/* Byte index of the current scanning multibyte
+static ssize_t cur_mb_len;	/* Byte length of the current 

CVS commit: [netbsd-5-1] src/gnu/dist/grep

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:14:51 UTC 2013

Modified Files:
src/gnu/dist/grep/lib [netbsd-5-1]: getopt.c regex.c
src/gnu/dist/grep/src [netbsd-5-1]: ansi2knr.c dfa.c grep.c search.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #1838):
gnu/dist/grep/src/grep.c: revision 1.14
gnu/dist/grep/src/ansi2knr.c: revision 1.2
gnu/dist/grep/src/search.c: revision 1.4
gnu/dist/grep/src/dfa.c: revision 1.3
gnu/dist/grep/lib/getopt.c: revision 1.2
gnu/dist/grep/lib/regex.c: revision 1.2
Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.
This change to NetBSD's version of GNU grep 2.5.1 (licenced under
GPLv2) was made without direct reference to any code licenced
under GPLv3.
Thanks to Ignatios Souvatzis for looking at GPLv3-derived
patches and describing the problem in general terms.  Thanks to
pkgsrc/devel/coccinelle for helping me find places where int
variables were used to store the results from pointer arithmetic
or strlen().  Thanks to Martin Husemann for testing.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.46.1 src/gnu/dist/grep/lib/getopt.c \
src/gnu/dist/grep/lib/regex.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.46.1 src/gnu/dist/grep/src/ansi2knr.c
cvs rdiff -u -r1.2 -r1.2.46.1 src/gnu/dist/grep/src/dfa.c
cvs rdiff -u -r1.12 -r1.12.12.1 src/gnu/dist/grep/src/grep.c
cvs rdiff -u -r1.3 -r1.3.12.1 src/gnu/dist/grep/src/search.c

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

Modified files:

Index: src/gnu/dist/grep/lib/getopt.c
diff -u src/gnu/dist/grep/lib/getopt.c:1.1.1.1 src/gnu/dist/grep/lib/getopt.c:1.1.1.1.46.1
--- src/gnu/dist/grep/lib/getopt.c:1.1.1.1	Sun Jan 26 23:15:12 2003
+++ src/gnu/dist/grep/lib/getopt.c	Sun Jan 13 17:14:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: getopt.c,v 1.1.1.1 2003/01/26 23:15:12 wiz Exp $	*/
+/*	$NetBSD: getopt.c,v 1.1.1.1.46.1 2013/01/13 17:14:51 bouyer Exp $	*/
 
 /* Getopt for GNU.
NOTE: The canonical source of this file is maintained with the GNU
@@ -431,7 +431,7 @@ _getopt_initialize (argc, argv, optstrin
 	  else
 	{
 	  const char *orig_str = __getopt_nonoption_flags;
-	  int len = nonoption_flags_max_len = strlen (orig_str);
+	  size_t len = nonoption_flags_max_len = strlen (orig_str);
 	  if (nonoption_flags_max_len  argc)
 		nonoption_flags_max_len = argc;
 	  __getopt_nonoption_flags =
Index: src/gnu/dist/grep/lib/regex.c
diff -u src/gnu/dist/grep/lib/regex.c:1.1.1.1 src/gnu/dist/grep/lib/regex.c:1.1.1.1.46.1
--- src/gnu/dist/grep/lib/regex.c:1.1.1.1	Sun Jan 26 23:15:13 2003
+++ src/gnu/dist/grep/lib/regex.c	Sun Jan 13 17:14:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: regex.c,v 1.1.1.1 2003/01/26 23:15:13 wiz Exp $	*/
+/*	$NetBSD: regex.c,v 1.1.1.1.46.1 2013/01/13 17:14:51 bouyer Exp $	*/
 
 /* Extended regular expression matching and search library,
version 0.12.
@@ -1127,7 +1127,7 @@ print_double_string (where, string1, siz
 int size1;
 int size2;
 {
-  int this_char;
+  ptrdiff_t this_char;
 
   if (where == NULL)
 printf ((null));

Index: src/gnu/dist/grep/src/ansi2knr.c
diff -u src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1 src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1.46.1
--- src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1	Sun Jan 26 23:15:29 2003
+++ src/gnu/dist/grep/src/ansi2knr.c	Sun Jan 13 17:14:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ansi2knr.c,v 1.1.1.1 2003/01/26 23:15:29 wiz Exp $	*/
+/*	$NetBSD: ansi2knr.c,v 1.1.1.1.46.1 2013/01/13 17:14:51 bouyer Exp $	*/
 
 /* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved. */
 
@@ -461,7 +461,7 @@ test1(buf)
 	   }
 	   {
 	   char *id = p;
-	   int len;
+	   ptrdiff_t len;
 	   /*
 		* Check for identifier1(identifier2) and not
 		* identifier1(void), or identifier1(identifier2, ).

Index: src/gnu/dist/grep/src/dfa.c
diff -u src/gnu/dist/grep/src/dfa.c:1.2 src/gnu/dist/grep/src/dfa.c:1.2.46.1
--- src/gnu/dist/grep/src/dfa.c:1.2	Sun Jan 26 23:55:52 2003
+++ src/gnu/dist/grep/src/dfa.c	Sun Jan 13 17:14:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dfa.c,v 1.2 2003/01/26 23:55:52 wiz Exp $	*/
+/*	$NetBSD: dfa.c,v 1.2.46.1 2013/01/13 17:14:51 bouyer Exp $	*/
 
 /* dfa.c - deterministic extended regexp routines for GNU
Copyright 1988, 1998, 2000 Free Software Foundation, Inc.
@@ -334,9 +334,10 @@ static int hard_LC_COLLATE;	/* Nonzero i
 #ifdef MBS_SUPPORT
 /* These variables are used only if (MB_CUR_MAX  1).  */
 static mbstate_t mbs;		/* Mbstate for mbrlen().  */
-static int cur_mb_len;		/* Byte length of the current scanning
-   multibyte character.  */
-static int cur_mb_index;/* Byte index of the current scanning multibyte
+static ssize_t cur_mb_len;	/* Byte length of the current 

CVS commit: [netbsd-5] src/doc

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:16:06 UTC 2013

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

Log Message:
tickets 1823-1839


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 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.1 src/doc/CHANGES-5.3:1.1.2.2
--- src/doc/CHANGES-5.3:1.1.2.1	Tue Dec 18 21:59:28 2012
+++ src/doc/CHANGES-5.3	Sun Jan 13 17:16:06 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.3,v 1.1.2.1 2012/12/18 21:59:28 riz Exp $
+# $NetBSD: CHANGES-5.3,v 1.1.2.2 2013/01/13 17:16:06 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3
 release:
@@ -11,3 +11,123 @@ sys/sys/param.h	patched by hand
 	Welcome to 5.2_STABLE.
 	[riz]
 
+sys/fs/smbfs/smbfs_node.c			1.48, 1.49 via patch
+sys/fs/smbfs/smbfs_node.h			1.13 via patch
+sys/fs/smbfs/smbfs_vnops.c			1.83, 1.84 via patch
+
+	Various fixes for smbfs:
+
+	- Implement NGONE to fix caching issue described in PR kern/25070.
+	  Mostly taken from FreeBSD r125637.
+	- Revert revision 1.70 of smbfs_vnops.c to fix setattr to opened
+	  direcotry.  In case of SMB_CAP_NT_SMBS, NOPEN is set after
+	  smbfs_smb_ntcreatex() call.  If NOPEN is set in front, it will
+	  immediately return by condition at do_open label.
+	- In smbfs_close(), call smbfs_smb_close() and drop NOPEN bit in
+	  the case of direcotry.  Otherwise smbfs_rmdir() fails when the
+	  directory was opened.
+	- Remove redundant vput() before vgone().
+	- Avoid unnecessary mutex_exit() in smbfs_node_alloc().
+	- Set NGONE bit to from-name vnode to invalidate the smbnode cache.
+	[nakayama, ticket #1823]
+
+sys/fs/smbfs/smbfs_smb.c			1.44
+sys/fs/smbfs/smbfs_subr.c			1.16
+sys/fs/smbfs/smbfs_subr.h			1.21
+sys/fs/smbfs/smbfs_vnops.c			1.85
+sys/netsmb/smb.h1.20
+
+	Improve smbfs timestamp handling.
+	Don't round timestamp to 2 seconds resolution if the server
+	supports the CAP_INFOLEVEL_PASSTHRU capability.
+	[nakayama, ticket #1824]
+
+sys/netsmb/smb_iod.c1.31 - 1.35
+sys/netsmb/smb_rq.c1.32
+
+	Do not call callout_stop() unless the structure was previoulsy
+	initialised for a non null timeout.
+	Do initialise the callout when fetching a new request structure from
+	the pool, not when starting the timer. Likewise, destroy the callout
+	when giving back the item to the pool.
+	Send data for as long as there is new data available.  Otherwise
+	there was a danger of smb_iod_recvall() blocking, hence releasing
+	the kernel lock, new data creeping into the queue, and a wakeup
+	being missed (well, there's still a race, but since it's theoretical
+	enough for me to never have encountered it, I'll rather solve it
+	by periodic wakeups).
+	defensive programming: wake up iod thread once a second just in case
+	add comment to previous stating periodic wakeups can be nuked
+	once smb is mpsafe.
+	[nakayama, ticket #1825]
+
+sys/dev/lockstat.c1.16
+
+	Fix off by one.
+	[msaitoh, ticket #1826]
+
+sys/dev/raidframe/rf_driver.c			1.131
+
+	Fix off by one read.
+	[msaitoh, ticket #1827]
+
+sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c		patch
+
+	Fix off by one read.
+	[msaitoh, ticket #1828]
+
+sys/compat/netbsd32/netbsd32_fs.c		1.64
+
+	Fix inverted error check.
+	[matt, ticket #1829]
+
+sys/dev/usb/ubsa_common.c			1.9
+
+	Fix off by one read error.
+	[msaitoh, ticket #1830]
+
+sys/external/bsd/drm/dist/shared-core/i915_suspend.c 1.6
+
+	Fix wrong reference to dev_priv-saveSWF1. It was clearly wrong.
+	[msaitoh, ticket #1831]
+
+sbin/sysctl/sysctl.c1.149 via patch
+
+	Add missing free() in error path.
+	[msaitoh, ticket #1832]
+
+usr.bin/netstat/bpf.c1.11
+
+	Fix memory leak.
+	[msaitoh, ticket #1833]
+
+sys/arch/i386/conf/XEN2_DOMU:			patch
+sys/arch/amd64/conf/XEN3_DOMU:			patch
+
+	Add drvctl to Xen DOMU kernels
+	[sborrill, ticket #1834]
+
+sbin/fsck_ffs/pass1.c1.50
+
+	Show pass1 SIGINFO output on stderr like other passes, not on stdout.
+	[riastradh, ticket #1837]
+
+etc/namedb/root.cache1.17
+
+	D.ROOT-SERVERS.NET changes IPv4 address.
+	[taca, ticket #1839]
+
+gnu/dist/grep/lib/getopt.c			1.2
+gnu/dist/grep/lib/regex.c			1.2
+gnu/dist/grep/src/ansi2knr.c			1.2
+gnu/dist/grep/src/dfa.c1.3
+gnu/dist/grep/src/grep.c			1.14
+gnu/dist/grep/src/search.c			1.4
+
+	Change several int variables to size_t, ssize_t, or ptrdiff_t.
+	This should fix the bug described in CVE-2012-5667 when an input
+	line is so long that its length cannot be stored in an int
+	variable.
+
+	[apb, ticket #1838]
+



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

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:17:46 UTC 2013

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

Log Message:
tickets 1826, 1827, 1830, 1831, 1837, 1839, 1838


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.91 -r1.1.2.92 src/doc/CHANGES-5.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-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.91 src/doc/CHANGES-5.0.3:1.1.2.92
--- src/doc/CHANGES-5.0.3:1.1.2.91	Mon Nov 26 20:01:48 2012
+++ src/doc/CHANGES-5.0.3	Sun Jan 13 17:17:46 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.91 2012/11/26 20:01:48 riz Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.92 2013/01/13 17:17:46 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -5203,3 +5203,47 @@ xsrc/external/mit/expat/dist/xmlwf/readf
 	Address CVE-2012-1147, CVE-2012-1148 and CVE-2012-0876.
 	[spz, ticket #1821]
 
+sys/dev/lockstat.c1.16
+
+	Fix off by one.
+	[msaitoh, ticket #1826]
+
+sys/dev/raidframe/rf_driver.c			1.131
+
+	Fix off by one read.
+	[msaitoh, ticket #1827]
+
+sys/dev/usb/ubsa_common.c			1.9
+
+	Fix off by one read error.
+	[msaitoh, ticket #1830]
+
+sys/external/bsd/drm/dist/shared-core/i915_suspend.c 1.6
+
+	Fix wrong reference to dev_priv-saveSWF1. It was clearly wrong.
+	[msaitoh, ticket #1831]
+
+sbin/fsck_ffs/pass1.c1.50
+
+	Show pass1 SIGINFO output on stderr like other passes, not on stdout.
+	[riastradh, ticket #1837]
+
+etc/namedb/root.cache1.17
+
+	D.ROOT-SERVERS.NET changes IPv4 address.
+	[taca, ticket #1839]
+
+gnu/dist/grep/lib/getopt.c			1.2
+gnu/dist/grep/lib/regex.c			1.2
+gnu/dist/grep/src/ansi2knr.c			1.2
+gnu/dist/grep/src/dfa.c1.3
+gnu/dist/grep/src/grep.c			1.14
+gnu/dist/grep/src/search.c			1.4
+
+	Change several int variables to size_t, ssize_t, or ptrdiff_t.
+	This should fix the bug described in CVE-2012-5667 when an input
+	line is so long that its length cannot be stored in an int
+	variable.
+
+	[apb, ticket #1838]
+



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

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:18:30 UTC 2013

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

Log Message:
tickets 1826, 1827, 1828, 1830, 1831, 1837, 1839, 1838


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.33 -r1.1.2.34 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.33 src/doc/CHANGES-5.1.3:1.1.2.34
--- src/doc/CHANGES-5.1.3:1.1.2.33	Mon Nov 26 20:02:07 2012
+++ src/doc/CHANGES-5.1.3	Sun Jan 13 17:18:30 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.3,v 1.1.2.33 2012/11/26 20:02:07 riz Exp $
+# $NetBSD: CHANGES-5.1.3,v 1.1.2.34 2013/01/13 17:18:30 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3
 release:
@@ -2295,3 +2295,52 @@ xsrc/external/mit/expat/dist/xmlwf/readf
 	Address CVE-2012-1147, CVE-2012-1148 and CVE-2012-0876.
 	[spz, ticket #1821]
 
+sys/dev/lockstat.c1.16
+
+	Fix off by one.
+	[msaitoh, ticket #1826]
+
+sys/dev/raidframe/rf_driver.c			1.131
+
+	Fix off by one read.
+	[msaitoh, ticket #1827]
+
+sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c		patch
+
+	Fix off by one read.
+	[msaitoh, ticket #1828]
+
+sys/dev/usb/ubsa_common.c			1.9
+
+	Fix off by one read error.
+	[msaitoh, ticket #1830]
+
+sys/external/bsd/drm/dist/shared-core/i915_suspend.c 1.6
+
+	Fix wrong reference to dev_priv-saveSWF1. It was clearly wrong.
+	[msaitoh, ticket #1831]
+
+sbin/fsck_ffs/pass1.c1.50
+
+	Show pass1 SIGINFO output on stderr like other passes, not on stdout.
+	[riastradh, ticket #1837]
+
+etc/namedb/root.cache1.17
+
+	D.ROOT-SERVERS.NET changes IPv4 address.
+	[taca, ticket #1839]
+
+gnu/dist/grep/lib/getopt.c			1.2
+gnu/dist/grep/lib/regex.c			1.2
+gnu/dist/grep/src/ansi2knr.c			1.2
+gnu/dist/grep/src/dfa.c1.3
+gnu/dist/grep/src/grep.c			1.14
+gnu/dist/grep/src/search.c			1.4
+
+	Change several int variables to size_t, ssize_t, or ptrdiff_t.
+	This should fix the bug described in CVE-2012-5667 when an input
+	line is so long that its length cannot be stored in an int
+	variable.
+
+	[apb, ticket #1838]
+



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

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:19:01 UTC 2013

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

Log Message:
tickets 1826, 1827, 1828, 1830, 1831, 1837, 1839, 1838


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 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.1 src/doc/CHANGES-5.2.1:1.1.2.2
--- src/doc/CHANGES-5.2.1:1.1.2.1	Tue Dec 18 21:55:15 2012
+++ src/doc/CHANGES-5.2.1	Sun Jan 13 17:19:01 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2.1,v 1.1.2.1 2012/12/18 21:55:15 riz Exp $
+# $NetBSD: CHANGES-5.2.1,v 1.1.2.2 2013/01/13 17:19:01 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.2.1
 release:
@@ -9,3 +9,52 @@ sys/sys/param.h	patched by hand
 	Welcome to 5.2.0_PATCH.
 	[riz]
 
+sys/dev/lockstat.c1.16
+
+	Fix off by one.
+	[msaitoh, ticket #1826]
+
+sys/dev/raidframe/rf_driver.c			1.131
+
+	Fix off by one read.
+	[msaitoh, ticket #1827]
+
+sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c		patch
+
+	Fix off by one read.
+	[msaitoh, ticket #1828]
+
+sys/dev/usb/ubsa_common.c			1.9
+
+	Fix off by one read error.
+	[msaitoh, ticket #1830]
+
+sys/external/bsd/drm/dist/shared-core/i915_suspend.c 1.6
+
+	Fix wrong reference to dev_priv-saveSWF1. It was clearly wrong.
+	[msaitoh, ticket #1831]
+
+sbin/fsck_ffs/pass1.c1.50
+
+	Show pass1 SIGINFO output on stderr like other passes, not on stdout.
+	[riastradh, ticket #1837]
+
+etc/namedb/root.cache1.17
+
+	D.ROOT-SERVERS.NET changes IPv4 address.
+	[taca, ticket #1839]
+
+gnu/dist/grep/lib/getopt.c			1.2
+gnu/dist/grep/lib/regex.c			1.2
+gnu/dist/grep/src/ansi2knr.c			1.2
+gnu/dist/grep/src/dfa.c1.3
+gnu/dist/grep/src/grep.c			1.14
+gnu/dist/grep/src/search.c			1.4
+
+	Change several int variables to size_t, ssize_t, or ptrdiff_t.
+	This should fix the bug described in CVE-2012-5667 when an input
+	line is so long that its length cannot be stored in an int
+	variable.
+
+	[apb, ticket #1838]
+



CVS commit: [netbsd-5] src/lib/librefuse

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:57:48 UTC 2013

Modified Files:
src/lib/librefuse [netbsd-5]: refuse.c

Log Message:
Pull up following revision(s) (requested by tron in ticket #1836):
lib/librefuse/refuse.c: revision 1.96 via patch
FUSE seems to allow short writes without errors but PUFFS doesn't. Work
around this by returning ENOSPC in case of a short write to avoid protocol
errors. This change is based on problem analysis provided by Antti Kantee.
This fixes PR lib/45129 by myself.


To generate a diff of this commit:
cvs rdiff -u -r1.89.4.2 -r1.89.4.3 src/lib/librefuse/refuse.c

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

Modified files:

Index: src/lib/librefuse/refuse.c
diff -u src/lib/librefuse/refuse.c:1.89.4.2 src/lib/librefuse/refuse.c:1.89.4.3
--- src/lib/librefuse/refuse.c:1.89.4.2	Mon Aug  8 19:56:50 2011
+++ src/lib/librefuse/refuse.c	Sun Jan 13 17:57:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: refuse.c,v 1.89.4.2 2011/08/08 19:56:50 riz Exp $	*/
+/*	$NetBSD: refuse.c,v 1.89.4.3 2013/01/13 17:57:48 bouyer Exp $	*/
 
 /*
  * Copyright © 2007 Alistair Crooks.  All rights reserved.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #if !defined(lint)
-__RCSID($NetBSD: refuse.c,v 1.89.4.2 2011/08/08 19:56:50 riz Exp $);
+__RCSID($NetBSD: refuse.c,v 1.89.4.3 2013/01/13 17:57:48 bouyer Exp $);
 #endif /* !lint */
 
 #include sys/types.h
@@ -1083,14 +1083,16 @@ puffs_fuse_node_write(struct puffs_userm
 	ret = (*fuse-op.write)(path, (char *)buf, *resid, offset,
 	rn-file_info);
 
-	if (ret  0) {
-		if (offset + ret  pn-pn_va.va_size)
+	if (ret = 0) {
+		if ((uint64_t)(offset + ret)  pn-pn_va.va_size)
 			pn-pn_va.va_size = offset + ret;
 		*resid -= ret;
-		ret = 0;
+		ret = (*resid == 0) ? 0 : ENOSPC;
+	} else {
+		ret = -ret;
 	}
 
-	return -ret;
+	return ret;
 }
 
 



CVS commit: [netbsd-5] src/doc

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 17:58:06 UTC 2013

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

Log Message:
ticket 1836


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 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.2 src/doc/CHANGES-5.3:1.1.2.3
--- src/doc/CHANGES-5.3:1.1.2.2	Sun Jan 13 17:16:06 2013
+++ src/doc/CHANGES-5.3	Sun Jan 13 17:58:06 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.3,v 1.1.2.2 2013/01/13 17:16:06 bouyer Exp $
+# $NetBSD: CHANGES-5.3,v 1.1.2.3 2013/01/13 17:58:06 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.2 release to the NetBSD 5.3
 release:
@@ -131,3 +131,12 @@ gnu/dist/grep/src/search.c			1.4
 
 	[apb, ticket #1838]
 
+lib/librefuse/refuse.c1.96 via patch
+
+	FUSE seems to allow short writes without errors but PUFFS doesn't. Work
+	around this by returning ENOSPC in case of a short write to avoid
+	protocol errors. This change is based on problem analysis provided by
+	Antti Kantee.
+	This fixes PR lib/45129 by myself.
+	[tron, ticket #1836]
+



CVS commit: src

2013-01-13 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Sun Jan 13 18:47:58 UTC 2013

Modified Files:
src/etc/defaults: rc.conf
src/etc/rc.d: ppp
src/share/man/man5: rc.conf.5

Log Message:
Add ppp=YES variable. Currently pppd(8) starts automatically if ppp_peers
is not empty. Adding a ppp variable allows the default peer to be set,
and ppp set to NO so that dialing can happen with /etc/rc.d/ppp onestart.
Default set to YES so that old behaviour is preserved.
http://mail-index.netbsd.org/tech-userlevel/2012/08/21/msg006656.html


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/etc/defaults/rc.conf
cvs rdiff -u -r1.10 -r1.11 src/etc/rc.d/ppp
cvs rdiff -u -r1.154 -r1.155 src/share/man/man5/rc.conf.5

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

Modified files:

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.121 src/etc/defaults/rc.conf:1.122
--- src/etc/defaults/rc.conf:1.121	Fri Jan 11 04:32:41 2013
+++ src/etc/defaults/rc.conf	Sun Jan 13 18:47:57 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.121 2013/01/11 04:32:41 riastradh Exp $
+#	$NetBSD: rc.conf,v 1.122 2013/01/13 18:47:57 prlw1 Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -179,7 +179,7 @@ dhcpcd_flags=-q# For ifconfig_XXX=
 dhclient=NO	# behave as a DHCP client
 			dhclient_flags=	# blank: config all interfaces
 ntpdate=NO  		ntpdate_flags=-b -s	# May need '-u' thru firewall
-ppp_peers=	# /etc/ppp/peers to call
+ppp=YES			ppp_peers=		# /etc/ppp/peers to call
 ip6mode=host	# host, autohost or router
 ip6uniquelocal=NO# IPv6 unique-local forwarding
 rtsol=NO		rtsol_flags=-a	# for ip6mode=autohost only

Index: src/etc/rc.d/ppp
diff -u src/etc/rc.d/ppp:1.10 src/etc/rc.d/ppp:1.11
--- src/etc/rc.d/ppp:1.10	Thu Dec 13 21:51:52 2012
+++ src/etc/rc.d/ppp	Sun Jan 13 18:47:58 2013
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ppp,v 1.10 2012/12/13 21:51:52 wiz Exp $
+# $NetBSD: ppp,v 1.11 2013/01/13 18:47:58 prlw1 Exp $
 #
 
 # PROVIDE: ppp
@@ -14,6 +14,7 @@
 $_rc_subr_loaded . /etc/rc.subr
 
 name=ppp
+rcvar=$name
 start_cmd=ppp_start
 stop_cmd=ppp_stop
 sig_stop=-INT

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.154 src/share/man/man5/rc.conf.5:1.155
--- src/share/man/man5/rc.conf.5:1.154	Tue Oct  2 09:18:59 2012
+++ src/share/man/man5/rc.conf.5	Sun Jan 13 18:47:58 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: rc.conf.5,v 1.154 2012/10/02 09:18:59 roy Exp $
+.\	$NetBSD: rc.conf.5,v 1.155 2013/01/13 18:47:58 prlw1 Exp $
 .\
 .\ Copyright (c) 1996 Matthew R. Green
 .\ All rights reserved.
@@ -887,9 +887,17 @@ Boolean value.
 Run
 .Xr pflogd 8
 for dumping packet filter logging information to a file.
+.It Sy ppp
+A boolean. Toggles starting
+.Xr pppd 8
+on startup. See
+.Sy ppp_peers
+below.
 .It Sy ppp_peers
 A string.
 If
+.Sy ppp
+is true and
 .Sy ppp_peers
 is not empty, then
 .Pa /etc/rc.d/ppp



CVS commit: [netbsd-6] src/sbin/fsck_ffs

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 18:55:37 UTC 2013

Modified Files:
src/sbin/fsck_ffs [netbsd-6]: pass1.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #779):
sbin/fsck_ffs/pass1.c: revision 1.50
Show pass1 SIGINFO output on stderr like other passes, not on stdout.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.49.4.1 src/sbin/fsck_ffs/pass1.c

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

Modified files:

Index: src/sbin/fsck_ffs/pass1.c
diff -u src/sbin/fsck_ffs/pass1.c:1.49 src/sbin/fsck_ffs/pass1.c:1.49.4.1
--- src/sbin/fsck_ffs/pass1.c:1.49	Sun Aug 14 12:32:01 2011
+++ src/sbin/fsck_ffs/pass1.c	Sun Jan 13 18:55:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pass1.c,v 1.49 2011/08/14 12:32:01 christos Exp $	*/
+/*	$NetBSD: pass1.c,v 1.49.4.1 2013/01/13 18:55:37 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)pass1.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: pass1.c,v 1.49 2011/08/14 12:32:01 christos Exp $);
+__RCSID($NetBSD: pass1.c,v 1.49.4.1 2013/01/13 18:55:37 bouyer Exp $);
 #endif
 #endif /* not lint */
 
@@ -109,7 +109,8 @@ pass1(void)
 		else
 			inosused = sblock-fs_ipg;
 		if (got_siginfo) {
-			printf(%s: phase 1: cyl group %d of %d (%d%%)\n,
+			fprintf(stderr,
+			%s: phase 1: cyl group %d of %d (%d%%)\n,
 			cdevname(), c, sblock-fs_ncg,
 			c * 100 / sblock-fs_ncg);
 			got_siginfo = 0;



CVS commit: [netbsd-6-0] src/sbin/fsck_ffs

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 18:55:41 UTC 2013

Modified Files:
src/sbin/fsck_ffs [netbsd-6-0]: pass1.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #779):
sbin/fsck_ffs/pass1.c: revision 1.50
Show pass1 SIGINFO output on stderr like other passes, not on stdout.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.49.10.1 src/sbin/fsck_ffs/pass1.c

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

Modified files:

Index: src/sbin/fsck_ffs/pass1.c
diff -u src/sbin/fsck_ffs/pass1.c:1.49 src/sbin/fsck_ffs/pass1.c:1.49.10.1
--- src/sbin/fsck_ffs/pass1.c:1.49	Sun Aug 14 12:32:01 2011
+++ src/sbin/fsck_ffs/pass1.c	Sun Jan 13 18:55:41 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pass1.c,v 1.49 2011/08/14 12:32:01 christos Exp $	*/
+/*	$NetBSD: pass1.c,v 1.49.10.1 2013/01/13 18:55:41 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)pass1.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: pass1.c,v 1.49 2011/08/14 12:32:01 christos Exp $);
+__RCSID($NetBSD: pass1.c,v 1.49.10.1 2013/01/13 18:55:41 bouyer Exp $);
 #endif
 #endif /* not lint */
 
@@ -109,7 +109,8 @@ pass1(void)
 		else
 			inosused = sblock-fs_ipg;
 		if (got_siginfo) {
-			printf(%s: phase 1: cyl group %d of %d (%d%%)\n,
+			fprintf(stderr,
+			%s: phase 1: cyl group %d of %d (%d%%)\n,
 			cdevname(), c, sblock-fs_ncg,
 			c * 100 / sblock-fs_ncg);
 			got_siginfo = 0;



CVS commit: [netbsd-6] src/etc/namedb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 18:57:48 UTC 2013

Modified Files:
src/etc/namedb [netbsd-6]: root.cache

Log Message:
Pull up following revision(s) (requested by taca in ticket #781):
etc/namedb/root.cache: revision 1.17
D.ROOT-SERVERS.NET changes IPv4 address.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.4.1 src/etc/namedb/root.cache

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

Modified files:

Index: src/etc/namedb/root.cache
diff -u src/etc/namedb/root.cache:1.16 src/etc/namedb/root.cache:1.16.4.1
--- src/etc/namedb/root.cache:1.16	Mon Aug  1 10:04:27 2011
+++ src/etc/namedb/root.cache	Sun Jan 13 18:57:48 2013
@@ -1,4 +1,4 @@
-;	$NetBSD: root.cache,v 1.16 2011/08/01 10:04:27 taca Exp $
+;	$NetBSD: root.cache,v 1.16.4.1 2013/01/13 18:57:48 bouyer Exp $
 ;   This file holds the information on root name servers needed to
 ;   initialize cache of Internet domain name servers
 ;   (e.g. reference this file in the cache  .  file
@@ -10,8 +10,8 @@
 ;   on server   FTP.INTERNIC.NET
 ;   -OR-RS.INTERNIC.NET
 ;
-;   last update:Jun 8, 2011
-;   related version of root zone:   2011060800
+;   last update:Jan 3, 2013
+;   related version of root zone:   2013010300
 ;
 ; formerly NS.INTERNIC.NET
 ;
@@ -32,7 +32,7 @@ C.ROOT-SERVERS.NET.  360  A 
 ; FORMERLY TERP.UMD.EDU
 ;
 .360  NSD.ROOT-SERVERS.NET.
-D.ROOT-SERVERS.NET.  360  A 128.8.10.90
+D.ROOT-SERVERS.NET.  360  A 199.7.91.13
 D.ROOT-SERVERS.NET.	 360    2001:500:2D::D
 ;
 ; FORMERLY NS.NASA.GOV



CVS commit: [netbsd-6-0] src/etc/namedb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 18:57:51 UTC 2013

Modified Files:
src/etc/namedb [netbsd-6-0]: root.cache

Log Message:
Pull up following revision(s) (requested by taca in ticket #781):
etc/namedb/root.cache: revision 1.17
D.ROOT-SERVERS.NET changes IPv4 address.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.10.1 src/etc/namedb/root.cache

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

Modified files:

Index: src/etc/namedb/root.cache
diff -u src/etc/namedb/root.cache:1.16 src/etc/namedb/root.cache:1.16.10.1
--- src/etc/namedb/root.cache:1.16	Mon Aug  1 10:04:27 2011
+++ src/etc/namedb/root.cache	Sun Jan 13 18:57:50 2013
@@ -1,4 +1,4 @@
-;	$NetBSD: root.cache,v 1.16 2011/08/01 10:04:27 taca Exp $
+;	$NetBSD: root.cache,v 1.16.10.1 2013/01/13 18:57:50 bouyer Exp $
 ;   This file holds the information on root name servers needed to
 ;   initialize cache of Internet domain name servers
 ;   (e.g. reference this file in the cache  .  file
@@ -10,8 +10,8 @@
 ;   on server   FTP.INTERNIC.NET
 ;   -OR-RS.INTERNIC.NET
 ;
-;   last update:Jun 8, 2011
-;   related version of root zone:   2011060800
+;   last update:Jan 3, 2013
+;   related version of root zone:   2013010300
 ;
 ; formerly NS.INTERNIC.NET
 ;
@@ -32,7 +32,7 @@ C.ROOT-SERVERS.NET.  360  A 
 ; FORMERLY TERP.UMD.EDU
 ;
 .360  NSD.ROOT-SERVERS.NET.
-D.ROOT-SERVERS.NET.  360  A 128.8.10.90
+D.ROOT-SERVERS.NET.  360  A 199.7.91.13
 D.ROOT-SERVERS.NET.	 360    2001:500:2D::D
 ;
 ; FORMERLY NS.NASA.GOV



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

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 18:58:51 UTC 2013

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

Log Message:
tickets 779 and 781


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/doc/CHANGES-6.0.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.0.2
diff -u src/doc/CHANGES-6.0.2:1.1.2.4 src/doc/CHANGES-6.0.2:1.1.2.5
--- src/doc/CHANGES-6.0.2:1.1.2.4	Mon Jan  7 16:54:20 2013
+++ src/doc/CHANGES-6.0.2	Sun Jan 13 18:58:50 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.2,v 1.1.2.4 2013/01/07 16:54:20 riz Exp $
+# $NetBSD: CHANGES-6.0.2,v 1.1.2.5 2013/01/13 18:58:50 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.0.1 release to the NetBSD 6.0.2
 release:
@@ -24,3 +24,13 @@ sys/kern/uipc_syscalls.c			1.157-1.158
 	Prevent ktrace from being able to crash the kernel.
 	[mlelstv, ticket #778]
 
+sbin/fsck_ffs/pass1.c1.50
+
+	Show pass1 SIGINFO output on stderr like other passes, not on stdout.
+	[riastradh, ticket #779]
+
+etc/namedb/root.cache1.17
+
+	D.ROOT-SERVERS.NET changes IPv4 address.
+	[taca, ticket #781]
+



CVS commit: [netbsd-6] src/doc

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 18:59:00 UTC 2013

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

Log Message:
tickets 779 and 781


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.72 -r1.1.2.73 src/doc/CHANGES-6.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-6.1
diff -u src/doc/CHANGES-6.1:1.1.2.72 src/doc/CHANGES-6.1:1.1.2.73
--- src/doc/CHANGES-6.1:1.1.2.72	Tue Jan  8 07:07:33 2013
+++ src/doc/CHANGES-6.1	Sun Jan 13 18:58:59 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.72 2013/01/08 07:07:33 msaitoh Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.73 2013/01/13 18:58:59 bouyer Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -8016,3 +8016,13 @@ sys/kern/uipc_syscalls.c			1.157-1.158
 	Prevent ktrace from being able to crash the kernel.
 	[mlelstv, ticket #778]
 
+sbin/fsck_ffs/pass1.c1.50
+
+	Show pass1 SIGINFO output on stderr like other passes, not on stdout.
+	[riastradh, ticket #779]
+
+etc/namedb/root.cache1.17
+
+	D.ROOT-SERVERS.NET changes IPv4 address.
+	[taca, ticket #781]
+



CVS commit: [netbsd-6] src/sys/arch/arm/marvell

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 19:03:06 UTC 2013

Modified Files:
src/sys/arch/arm/marvell [netbsd-6]: files.marvell mvsoctmr.c

Log Message:
Pull up following revision(s) (requested by riz in ticket #770):
sys/arch/arm/marvell/files.marvell: revision 1.5
sys/arch/arm/marvell/mvsoctmr.c: revision 1.4
sys/arch/arm/marvell/mvsoctmr.c: revision 1.5
sys/arch/arm/marvell/mvsoctmr.c: revision 1.6
sys/arch/arm/marvell/mvsoctmr.c: revision 1.7
Add support for the watchdog timer in mvsoctmr.
Tested on DreamPlug system.
When disabling watchdog timer, do not set the counter to 0.
Having the watchdog counter at 0 and having WDRstOutEn set to 1 causes
immediate watchdog reset on my 88F5182 A2.
Remove duplicate global variable.
The maximum watchdog period is dependant on mvTclk; calculate at runtime.
This gets the maximum period up to 25 seconds at 166â…”MHz mvTclk.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.10.1 src/sys/arch/arm/marvell/files.marvell
cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/arch/arm/marvell/mvsoctmr.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/arm/marvell/files.marvell
diff -u src/sys/arch/arm/marvell/files.marvell:1.4 src/sys/arch/arm/marvell/files.marvell:1.4.10.1
--- src/sys/arch/arm/marvell/files.marvell:1.4	Sat Mar 12 22:34:52 2011
+++ src/sys/arch/arm/marvell/files.marvell	Sun Jan 13 19:03:05 2013
@@ -1,4 +1,4 @@
-#   $NetBSD: files.marvell,v 1.4 2011/03/12 22:34:52 nonaka Exp $
+#   $NetBSD: files.marvell,v 1.4.10.1 2013/01/13 19:03:05 bouyer Exp $
 #
 # Configuration info for Marvell System on Chip support
 #
@@ -24,7 +24,7 @@ file	arch/arm/marvell/kirkwood.c		kirkwo
 include dev/marvell/files.discovery
 
 # Timers
-device	mvsoctmr
+device	mvsoctmr: sysmon_wdog
 attach	mvsoctmr at mvsoc
 file	arch/arm/marvell/mvsoctmr.c		mvsoctmr
 

Index: src/sys/arch/arm/marvell/mvsoctmr.c
diff -u src/sys/arch/arm/marvell/mvsoctmr.c:1.3 src/sys/arch/arm/marvell/mvsoctmr.c:1.3.2.1
--- src/sys/arch/arm/marvell/mvsoctmr.c:1.3	Sun Feb 12 16:34:07 2012
+++ src/sys/arch/arm/marvell/mvsoctmr.c	Sun Jan 13 19:03:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoctmr.c,v 1.3 2012/02/12 16:34:07 matt Exp $	*/
+/*	$NetBSD: mvsoctmr.c,v 1.3.2.1 2013/01/13 19:03:05 bouyer Exp $	*/
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mvsoctmr.c,v 1.3 2012/02/12 16:34:07 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mvsoctmr.c,v 1.3.2.1 2013/01/13 19:03:05 bouyer Exp $);
+
+#include opt_ddb.h
 
 #include sys/param.h
 #include sys/atomic.h
@@ -36,6 +38,7 @@ __KERNEL_RCSID(0, $NetBSD: mvsoctmr.c,v
 #include sys/time.h
 #include sys/timetc.h
 #include sys/systm.h
+#include sys/wdog.h
 
 #include machine/intr.h
 
@@ -47,10 +50,21 @@ __KERNEL_RCSID(0, $NetBSD: mvsoctmr.c,v
 
 #include dev/marvell/marvellvar.h
 
+#include dev/sysmon/sysmonvar.h
+
+#ifdef DDB
+#include machine/db_machdep.h
+#include ddb/db_extern.h
+#endif
+
 
 struct mvsoctmr_softc {
 	device_t sc_dev;
 
+	struct sysmon_wdog sc_wdog;
+	uint32_t sc_wdog_period;
+	uint32_t sc_wdog_armed;
+
 	bus_space_tag_t sc_iot;
 	bus_space_handle_t sc_ioh;
 };
@@ -65,6 +79,15 @@ static u_int mvsoctmr_get_timecount(stru
 
 static void mvsoctmr_cntl(struct mvsoctmr_softc *, int, u_int, int, int);
 
+static int mvsoctmr_wdog_tickle(struct sysmon_wdog *);
+static int mvsoctmr_wdog_setmode(struct sysmon_wdog *);
+
+#ifdef DDB
+static void mvsoctmr_wdog_ddb_trap(int);
+#endif
+
+#define MVSOC_WDOG_MAX_PERIOD	(0x / mvTclk)
+
 static struct mvsoctmr_softc *mvsoctmr_sc;
 static struct timecounter mvsoctmr_timecounter = {
 	mvsoctmr_get_timecount,	/* get_timecount */
@@ -102,6 +125,7 @@ mvsoctmr_attach(device_t parent, device_
 {
 struct mvsoctmr_softc *sc = device_private(self);
 	struct marvell_attach_args *mva = aux;
+	uint32_t rstoutn;
 
 	aprint_naive(\n);
 	aprint_normal(: Marvell SoC Timer\n);
@@ -117,6 +141,28 @@ mvsoctmr_attach(device_t parent, device_
 
 	mvsoctmr_timecounter.tc_name = device_xname(self);
 	mvsoctmr_cntl(sc, MVSOCTMR_TIMER1, 0x, 1, 1);
+
+	/*
+	 * stop watchdog timer, enable watchdog timer resets
+	 */
+	mvsoctmr_cntl(sc, MVSOCTMR_WATCHDOG, 0x, 0, 0);
+	rstoutn = read_mlmbreg(MVSOC_MLMB_RSTOUTNMASKR);
+	write_mlmbreg(MVSOC_MLMB_RSTOUTNMASKR,
+		  rstoutn | MVSOC_MLMB_RSTOUTNMASKR_WDRSTOUTEN);
+
+#ifdef DDB
+	db_trap_callback = mvsoctmr_wdog_ddb_trap;
+#endif
+
+	sc-sc_wdog.smw_name = device_xname(self);
+	sc-sc_wdog.smw_cookie = sc;
+	sc-sc_wdog.smw_setmode = mvsoctmr_wdog_setmode;
+	sc-sc_wdog.smw_tickle = mvsoctmr_wdog_tickle;
+	sc-sc_wdog.smw_period = MVSOC_WDOG_MAX_PERIOD;
+
+	if (sysmon_wdog_register(sc-sc_wdog) != 0)
+		aprint_error_dev(self,
+ unable to register watchdog with sysmon\n);
 }
 
 

CVS commit: [netbsd-6] src/doc

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 19:03:27 UTC 2013

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

Log Message:
tickets 770


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.73 -r1.1.2.74 src/doc/CHANGES-6.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-6.1
diff -u src/doc/CHANGES-6.1:1.1.2.73 src/doc/CHANGES-6.1:1.1.2.74
--- src/doc/CHANGES-6.1:1.1.2.73	Sun Jan 13 18:58:59 2013
+++ src/doc/CHANGES-6.1	Sun Jan 13 19:03:27 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.73 2013/01/13 18:58:59 bouyer Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.74 2013/01/13 19:03:27 bouyer Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -8026,3 +8026,10 @@ etc/namedb/root.cache1.17
 	D.ROOT-SERVERS.NET changes IPv4 address.
 	[taca, ticket #781]
 
+sys/arch/arm/marvell/files.marvell		1.5
+sys/arch/arm/marvell/mvsoctmr.c			1.4 - 1.7
+
+	Add support for the watchdog timer in mvsoctmr.
+	Tested on DreamPlug system.
+	[riz, ticket #770]
+



CVS commit: [netbsd-6] src/gnu/dist/grep

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 19:08:05 UTC 2013

Modified Files:
src/gnu/dist/grep/lib [netbsd-6]: getopt.c regex.c
src/gnu/dist/grep/src [netbsd-6]: ansi2knr.c dfa.c grep.c search.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #780):
gnu/dist/grep/src/grep.c: revision 1.14
gnu/dist/grep/src/ansi2knr.c: revision 1.2
gnu/dist/grep/src/search.c: revision 1.4
gnu/dist/grep/src/dfa.c: revision 1.3
gnu/dist/grep/lib/getopt.c: revision 1.2
gnu/dist/grep/lib/regex.c: revision 1.2
Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.
This change to NetBSD's version of GNU grep 2.5.1 (licenced under
GPLv2) was made without direct reference to any code licenced
under GPLv3.
Thanks to Ignatios Souvatzis for looking at GPLv3-derived
patches and describing the problem in general terms.  Thanks to
pkgsrc/devel/coccinelle for helping me find places where int
variables were used to store the results from pointer arithmetic
or strlen().  Thanks to Martin Husemann for testing.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.56.1 src/gnu/dist/grep/lib/getopt.c \
src/gnu/dist/grep/lib/regex.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.56.1 src/gnu/dist/grep/src/ansi2knr.c
cvs rdiff -u -r1.2 -r1.2.56.1 src/gnu/dist/grep/src/dfa.c
cvs rdiff -u -r1.13 -r1.13.8.1 src/gnu/dist/grep/src/grep.c
cvs rdiff -u -r1.3 -r1.3.20.1 src/gnu/dist/grep/src/search.c

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

Modified files:

Index: src/gnu/dist/grep/lib/getopt.c
diff -u src/gnu/dist/grep/lib/getopt.c:1.1.1.1 src/gnu/dist/grep/lib/getopt.c:1.1.1.1.56.1
--- src/gnu/dist/grep/lib/getopt.c:1.1.1.1	Sun Jan 26 23:15:12 2003
+++ src/gnu/dist/grep/lib/getopt.c	Sun Jan 13 19:08:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: getopt.c,v 1.1.1.1 2003/01/26 23:15:12 wiz Exp $	*/
+/*	$NetBSD: getopt.c,v 1.1.1.1.56.1 2013/01/13 19:08:05 bouyer Exp $	*/
 
 /* Getopt for GNU.
NOTE: The canonical source of this file is maintained with the GNU
@@ -431,7 +431,7 @@ _getopt_initialize (argc, argv, optstrin
 	  else
 	{
 	  const char *orig_str = __getopt_nonoption_flags;
-	  int len = nonoption_flags_max_len = strlen (orig_str);
+	  size_t len = nonoption_flags_max_len = strlen (orig_str);
 	  if (nonoption_flags_max_len  argc)
 		nonoption_flags_max_len = argc;
 	  __getopt_nonoption_flags =
Index: src/gnu/dist/grep/lib/regex.c
diff -u src/gnu/dist/grep/lib/regex.c:1.1.1.1 src/gnu/dist/grep/lib/regex.c:1.1.1.1.56.1
--- src/gnu/dist/grep/lib/regex.c:1.1.1.1	Sun Jan 26 23:15:13 2003
+++ src/gnu/dist/grep/lib/regex.c	Sun Jan 13 19:08:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: regex.c,v 1.1.1.1 2003/01/26 23:15:13 wiz Exp $	*/
+/*	$NetBSD: regex.c,v 1.1.1.1.56.1 2013/01/13 19:08:05 bouyer Exp $	*/
 
 /* Extended regular expression matching and search library,
version 0.12.
@@ -1127,7 +1127,7 @@ print_double_string (where, string1, siz
 int size1;
 int size2;
 {
-  int this_char;
+  ptrdiff_t this_char;
 
   if (where == NULL)
 printf ((null));

Index: src/gnu/dist/grep/src/ansi2knr.c
diff -u src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1 src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1.56.1
--- src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1	Sun Jan 26 23:15:29 2003
+++ src/gnu/dist/grep/src/ansi2knr.c	Sun Jan 13 19:08:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ansi2knr.c,v 1.1.1.1 2003/01/26 23:15:29 wiz Exp $	*/
+/*	$NetBSD: ansi2knr.c,v 1.1.1.1.56.1 2013/01/13 19:08:05 bouyer Exp $	*/
 
 /* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved. */
 
@@ -461,7 +461,7 @@ test1(buf)
 	   }
 	   {
 	   char *id = p;
-	   int len;
+	   ptrdiff_t len;
 	   /*
 		* Check for identifier1(identifier2) and not
 		* identifier1(void), or identifier1(identifier2, ).

Index: src/gnu/dist/grep/src/dfa.c
diff -u src/gnu/dist/grep/src/dfa.c:1.2 src/gnu/dist/grep/src/dfa.c:1.2.56.1
--- src/gnu/dist/grep/src/dfa.c:1.2	Sun Jan 26 23:55:52 2003
+++ src/gnu/dist/grep/src/dfa.c	Sun Jan 13 19:08:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dfa.c,v 1.2 2003/01/26 23:55:52 wiz Exp $	*/
+/*	$NetBSD: dfa.c,v 1.2.56.1 2013/01/13 19:08:05 bouyer Exp $	*/
 
 /* dfa.c - deterministic extended regexp routines for GNU
Copyright 1988, 1998, 2000 Free Software Foundation, Inc.
@@ -334,9 +334,10 @@ static int hard_LC_COLLATE;	/* Nonzero i
 #ifdef MBS_SUPPORT
 /* These variables are used only if (MB_CUR_MAX  1).  */
 static mbstate_t mbs;		/* Mbstate for mbrlen().  */
-static int cur_mb_len;		/* Byte length of the current scanning
-   multibyte character.  */
-static int cur_mb_index;/* Byte index of the current scanning multibyte
+static ssize_t cur_mb_len;	/* Byte length of the current 

CVS commit: [netbsd-6-0] src/gnu/dist/grep

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 19:08:40 UTC 2013

Modified Files:
src/gnu/dist/grep/lib [netbsd-6-0]: getopt.c regex.c
src/gnu/dist/grep/src [netbsd-6-0]: ansi2knr.c dfa.c grep.c search.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #780):
gnu/dist/grep/src/grep.c: revision 1.14
gnu/dist/grep/src/ansi2knr.c: revision 1.2
gnu/dist/grep/src/search.c: revision 1.4
gnu/dist/grep/src/dfa.c: revision 1.3
gnu/dist/grep/lib/getopt.c: revision 1.2
gnu/dist/grep/lib/regex.c: revision 1.2
Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.
This change to NetBSD's version of GNU grep 2.5.1 (licenced under
GPLv2) was made without direct reference to any code licenced
under GPLv3.
Thanks to Ignatios Souvatzis for looking at GPLv3-derived
patches and describing the problem in general terms.  Thanks to
pkgsrc/devel/coccinelle for helping me find places where int
variables were used to store the results from pointer arithmetic
or strlen().  Thanks to Martin Husemann for testing.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.62.1 src/gnu/dist/grep/lib/getopt.c \
src/gnu/dist/grep/lib/regex.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.62.1 src/gnu/dist/grep/src/ansi2knr.c
cvs rdiff -u -r1.2 -r1.2.62.1 src/gnu/dist/grep/src/dfa.c
cvs rdiff -u -r1.13 -r1.13.14.1 src/gnu/dist/grep/src/grep.c
cvs rdiff -u -r1.3 -r1.3.26.1 src/gnu/dist/grep/src/search.c

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

Modified files:

Index: src/gnu/dist/grep/lib/getopt.c
diff -u src/gnu/dist/grep/lib/getopt.c:1.1.1.1 src/gnu/dist/grep/lib/getopt.c:1.1.1.1.62.1
--- src/gnu/dist/grep/lib/getopt.c:1.1.1.1	Sun Jan 26 23:15:12 2003
+++ src/gnu/dist/grep/lib/getopt.c	Sun Jan 13 19:08:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: getopt.c,v 1.1.1.1 2003/01/26 23:15:12 wiz Exp $	*/
+/*	$NetBSD: getopt.c,v 1.1.1.1.62.1 2013/01/13 19:08:40 bouyer Exp $	*/
 
 /* Getopt for GNU.
NOTE: The canonical source of this file is maintained with the GNU
@@ -431,7 +431,7 @@ _getopt_initialize (argc, argv, optstrin
 	  else
 	{
 	  const char *orig_str = __getopt_nonoption_flags;
-	  int len = nonoption_flags_max_len = strlen (orig_str);
+	  size_t len = nonoption_flags_max_len = strlen (orig_str);
 	  if (nonoption_flags_max_len  argc)
 		nonoption_flags_max_len = argc;
 	  __getopt_nonoption_flags =
Index: src/gnu/dist/grep/lib/regex.c
diff -u src/gnu/dist/grep/lib/regex.c:1.1.1.1 src/gnu/dist/grep/lib/regex.c:1.1.1.1.62.1
--- src/gnu/dist/grep/lib/regex.c:1.1.1.1	Sun Jan 26 23:15:13 2003
+++ src/gnu/dist/grep/lib/regex.c	Sun Jan 13 19:08:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: regex.c,v 1.1.1.1 2003/01/26 23:15:13 wiz Exp $	*/
+/*	$NetBSD: regex.c,v 1.1.1.1.62.1 2013/01/13 19:08:40 bouyer Exp $	*/
 
 /* Extended regular expression matching and search library,
version 0.12.
@@ -1127,7 +1127,7 @@ print_double_string (where, string1, siz
 int size1;
 int size2;
 {
-  int this_char;
+  ptrdiff_t this_char;
 
   if (where == NULL)
 printf ((null));

Index: src/gnu/dist/grep/src/ansi2knr.c
diff -u src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1 src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1.62.1
--- src/gnu/dist/grep/src/ansi2knr.c:1.1.1.1	Sun Jan 26 23:15:29 2003
+++ src/gnu/dist/grep/src/ansi2knr.c	Sun Jan 13 19:08:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ansi2knr.c,v 1.1.1.1 2003/01/26 23:15:29 wiz Exp $	*/
+/*	$NetBSD: ansi2knr.c,v 1.1.1.1.62.1 2013/01/13 19:08:40 bouyer Exp $	*/
 
 /* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved. */
 
@@ -461,7 +461,7 @@ test1(buf)
 	   }
 	   {
 	   char *id = p;
-	   int len;
+	   ptrdiff_t len;
 	   /*
 		* Check for identifier1(identifier2) and not
 		* identifier1(void), or identifier1(identifier2, ).

Index: src/gnu/dist/grep/src/dfa.c
diff -u src/gnu/dist/grep/src/dfa.c:1.2 src/gnu/dist/grep/src/dfa.c:1.2.62.1
--- src/gnu/dist/grep/src/dfa.c:1.2	Sun Jan 26 23:55:52 2003
+++ src/gnu/dist/grep/src/dfa.c	Sun Jan 13 19:08:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dfa.c,v 1.2 2003/01/26 23:55:52 wiz Exp $	*/
+/*	$NetBSD: dfa.c,v 1.2.62.1 2013/01/13 19:08:40 bouyer Exp $	*/
 
 /* dfa.c - deterministic extended regexp routines for GNU
Copyright 1988, 1998, 2000 Free Software Foundation, Inc.
@@ -334,9 +334,10 @@ static int hard_LC_COLLATE;	/* Nonzero i
 #ifdef MBS_SUPPORT
 /* These variables are used only if (MB_CUR_MAX  1).  */
 static mbstate_t mbs;		/* Mbstate for mbrlen().  */
-static int cur_mb_len;		/* Byte length of the current scanning
-   multibyte character.  */
-static int cur_mb_index;/* Byte index of the current scanning multibyte
+static ssize_t cur_mb_len;	/* Byte length of the current 

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

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 19:09:32 UTC 2013

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

Log Message:
ticket #780


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/doc/CHANGES-6.0.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.0.2
diff -u src/doc/CHANGES-6.0.2:1.1.2.5 src/doc/CHANGES-6.0.2:1.1.2.6
--- src/doc/CHANGES-6.0.2:1.1.2.5	Sun Jan 13 18:58:50 2013
+++ src/doc/CHANGES-6.0.2	Sun Jan 13 19:09:32 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.2,v 1.1.2.5 2013/01/13 18:58:50 bouyer Exp $
+# $NetBSD: CHANGES-6.0.2,v 1.1.2.6 2013/01/13 19:09:32 bouyer Exp $
 
 A complete list of changes from the NetBSD 6.0.1 release to the NetBSD 6.0.2
 release:
@@ -34,3 +34,17 @@ etc/namedb/root.cache1.17
 	D.ROOT-SERVERS.NET changes IPv4 address.
 	[taca, ticket #781]
 
+gnu/dist/grep/lib/getopt.c			1.2
+gnu/dist/grep/lib/regex.c			1.2
+gnu/dist/grep/src/ansi2knr.c			1.2
+gnu/dist/grep/src/dfa.c1.3
+gnu/dist/grep/src/grep.c			1.14
+gnu/dist/grep/src/search.c			1.4
+
+	Change several int variables to size_t, ssize_t, or ptrdiff_t.
+	This should fix the bug described in CVE-2012-5667 when an input
+	line is so long that its length cannot be stored in an int
+	variable.
+
+	[apb, ticket #780]
+



CVS commit: [netbsd-6] src/doc

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 19:09:38 UTC 2013

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

Log Message:
ticket #780


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.74 -r1.1.2.75 src/doc/CHANGES-6.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-6.1
diff -u src/doc/CHANGES-6.1:1.1.2.74 src/doc/CHANGES-6.1:1.1.2.75
--- src/doc/CHANGES-6.1:1.1.2.74	Sun Jan 13 19:03:27 2013
+++ src/doc/CHANGES-6.1	Sun Jan 13 19:09:38 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.74 2013/01/13 19:03:27 bouyer Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.75 2013/01/13 19:09:38 bouyer Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -8033,3 +8033,17 @@ sys/arch/arm/marvell/mvsoctmr.c			1.4 - 
 	Tested on DreamPlug system.
 	[riz, ticket #770]
 
+gnu/dist/grep/lib/getopt.c			1.2
+gnu/dist/grep/lib/regex.c			1.2
+gnu/dist/grep/src/ansi2knr.c			1.2
+gnu/dist/grep/src/dfa.c1.3
+gnu/dist/grep/src/grep.c			1.14
+gnu/dist/grep/src/search.c			1.4
+
+	Change several int variables to size_t, ssize_t, or ptrdiff_t.
+	This should fix the bug described in CVE-2012-5667 when an input
+	line is so long that its length cannot be stored in an int
+	variable.
+
+	[apb, ticket #780]
+



CVS commit: src/sbin/fsck

2013-01-13 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jan 13 19:53:17 UTC 2013

Modified Files:
src/sbin/fsck: fsutil.c

Log Message:
Support symlinks to a block device to resolve the name of the
corresponding raw device.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck/fsutil.c

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

Modified files:

Index: src/sbin/fsck/fsutil.c
diff -u src/sbin/fsck/fsutil.c:1.23 src/sbin/fsck/fsutil.c:1.24
--- src/sbin/fsck/fsutil.c:1.23	Sun Apr  8 04:19:14 2012
+++ src/sbin/fsck/fsutil.c	Sun Jan 13 19:53:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsutil.c,v 1.23 2012/04/08 04:19:14 christos Exp $	*/
+/*	$NetBSD: fsutil.c,v 1.24 2013/01/13 19:53:16 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: fsutil.c,v 1.23 2012/04/08 04:19:14 christos Exp $);
+__RCSID($NetBSD: fsutil.c,v 1.24 2013/01/13 19:53:16 mlelstv Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -173,6 +173,7 @@ blockcheck(const char *origname)
 	const char *newname, *raw, *cooked;
 	struct fstab *fsp;
 	int retried = 0;
+	ssize_t len;
 	char cbuf[MAXPATHLEN];
 	static char buf[MAXPATHLEN];
 
@@ -181,7 +182,13 @@ blockcheck(const char *origname)
 		perr(Can't stat `/');
 		return (origname);
 	}
-	newname = origname;
+	len = readlink(origname, cbuf, sizeof(cbuf)-1);
+	if (len == -1) {
+		newname = origname;
+	} else {
+		cbuf[len] = '\0';
+		newname = cbuf;
+	}
 retry:
 	if (stat(newname, stblock)  0) {
 		perr(Can't stat `%s', newname);



CVS commit: src/share/man/man5

2013-01-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jan 13 19:56:14 UTC 2013

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/share/man/man5/rc.conf.5

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

Modified files:

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.155 src/share/man/man5/rc.conf.5:1.156
--- src/share/man/man5/rc.conf.5:1.155	Sun Jan 13 18:47:58 2013
+++ src/share/man/man5/rc.conf.5	Sun Jan 13 19:56:13 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: rc.conf.5,v 1.155 2013/01/13 18:47:58 prlw1 Exp $
+.\	$NetBSD: rc.conf.5,v 1.156 2013/01/13 19:56:13 wiz Exp $
 .\
 .\ Copyright (c) 1996 Matthew R. Green
 .\ All rights reserved.
@@ -888,9 +888,11 @@ Run
 .Xr pflogd 8
 for dumping packet filter logging information to a file.
 .It Sy ppp
-A boolean. Toggles starting
+A boolean.
+Toggles starting
 .Xr pppd 8
-on startup. See
+on startup.
+See
 .Sy ppp_peers
 below.
 .It Sy ppp_peers



CVS commit: src/distrib/utils/embedded

2013-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 20:57:18 UTC 2013

Modified Files:
src/distrib/utils/embedded: mkimage
Added Files:
src/distrib/utils/embedded/conf: rpi.conf usermode.conf

Log Message:
Adjust mkimage to handle RPI. From skrll@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r0 -r1.1 src/distrib/utils/embedded/conf/rpi.conf \
src/distrib/utils/embedded/conf/usermode.conf

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.3 src/distrib/utils/embedded/mkimage:1.4
--- src/distrib/utils/embedded/mkimage:1.3	Tue Feb 28 23:49:50 2012
+++ src/distrib/utils/embedded/mkimage	Sun Jan 13 15:57:18 2013
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: mkimage,v 1.3 2012/02/29 04:49:50 agc Exp $
+# $NetBSD: mkimage,v 1.4 2013/01/13 20:57:18 christos Exp $
 
 # Copyright (c) 2012 Alistair Crooks a...@netbsd.org
 # All rights reserved.
@@ -70,6 +70,12 @@ next_avail ()
 
 # find the size of the gzipped files in a .tgz archive
 sizeone() {
+	if [ ! -f $1 ]
+	then
+		echo $PROG: Missing set $1 12
+		echo 0
+		return;
+	fi
 case $1 in 
 *.tgz|*.tar.gz)
 tar tvzf $1 | awk '{ tot += $5 } END { print tot }'
@@ -83,31 +89,66 @@ sizeone() {
 esac
 }
 
+usage() {
+	cat  EOF 12
+Usage: $PROG [-S setsdir] [-c custom-files-dir] [-h host-arch] [-s size]
+EOF
+exit 1
+}
+
+finish() {
+cleanup
+${sudo} umount ${mnt}
+${sudo} vnconfig -u ${vnddev}
+}
+
+trap finish 0 1 2 3 15
+DIR=$(dirname $0)
+PROG=$(basename $0)
 bar
-custom=custom
-h=usermode1.$(uname -n)
-image=usermode.img
-overhead=8 # in MB
-sets=base etc modules
-setsdir=/usr/build/release/$(uname -m)/binary/sets
-size=0	# in MB
-specialdirs=/kern /proc
-usermodedirs=/var.cow /etc.cow /root.cow /pkgs
-sudo=sudo
-
-while [ $# -gt 0 ]; do
-	case $1 in
-	-S)	setsdir=$2; shift ;;
-	-c)	custom=$2; shift ;;
-	-h)	h=$2; shift ;;
-	-s)	size=$2; shift ;;
-	-x)	set -x ;;
-	*)	break ;;
+sudo=
+mnt=/tmp/image.$$
+src=/usr/src
+obj=/usr/obj
+
+# First pass for options to get the host
+OPTS=S:c:h:s:x
+while getopts $OPTS f
+do
+	case $f in
+	h)	h=$OPTARG;;
+	*)	;;
+	esac
+done
+
+if [ -z $h ]
+then
+	usage
+fi
+
+if [ ! -f ${DIR}/${h}.conf ]
+then
+	echo $PROG: ${DIR}/${h}.conf is not present 12
+	exit 1
+fi
+
+. ${DIR}/${h}.conf
+
+OPTIND=1
+while getopts $OPTS f
+do
+	case $f in
+	S)	setsdir=$OPTARG;;
+	c)	custom=$OPTARG;;
+	h)	;;
+	s)	size=$OPTARG;;
+	x)	set -x;;
+	*)	;;
 	esac
-	shift
 done
 
-if [ $# -gt 0 ]; then
+shift $(( $OPTIND - 1 ))
+if [ -n $1 ]; then
 	# take the next argument as being the image name
 	image=$1
 	shift
@@ -115,69 +156,52 @@ fi
 
 total=0
 for s in ${sets}; do
-	total=$(expr ${total} + $(sizeone ${setsdir}/${s}.tgz))
+	one=$(sizeone ${setsdir}/${s}.tgz)
+	total=$(( ${total} +  ${one} ))
 done
 # calculate size of custom files
 custsize=0
 if [ -d ${custom} ]; then
 	custsize=$(ls -lR ${custom} | awk 'NF == 9 { tot += $5 } END { print tot }')
 fi
-total=$(expr \( \( ${total} + ${custsize} \) / 100 \) + ${overhead})
+total=$(( ( ( ${total} + ${custsize} ) / 100 ) + ${overhead} ))
 if [ $size -eq 0 ]; then
 # auto-size the pkgs fs
 size=${total}
 else
 # check that we've been given enough space
 if [ ${total} -gt ${size} ]; then
-echo File system size given as ${size} MB, but it needs ${total} MB 2
+echo $PROG: Given size is ${size} MB, but we need ${total} MB 2
 exit 1
 fi
 fi
 
 echo ${bar} making a new ${size} MB image in ${image} ${bar}
-dd if=/dev/zero of=${image} bs=1m count=${size}
+dd if=/dev/zero of=${image} bs=1m count=${size} conv=sparse
 
 vnddev=$(next_avail vnd)
 echo ${bar} mounting image via vnd ${vnddev} ${bar}
 ${sudo} vnconfig ${vnddev} ${image}
-${sudo} newfs /dev/r${vnddev}a
-${sudo} mount /dev/${vnddev}a /mnt
+${sudo} mkdir -p ${mnt}
+make_filesystems
+
+${sudo} mkdir -p ${mnt}/etc ${mnt}/dev
 
 echo ${bar} installing sets ${bar}
-(cd /mnt 
+(cd ${mnt} 
 	for s in ${sets}; do
-		echo ${s}
-		${sudo} tar xpzf ${setsdir}/${s}.tgz
+		if [ -f ${s} ]; then
+			echo ${s}
+			${sudo} tar xpzf ${setsdir}/${s}.tgz
+		fi
 	done
 )
 
 echo ${bar} performing customisations ${bar}
-${sudo} rm -f /mnt/etc/motd
 
-tmp=/tmp/usermode.$$
-cat  ${tmp}  EOF
-# NetBSD/usermode /etc/fstab
-/dev/ld0a   /   ffs ro  1 1
-/dev/ld1a	/pkgs		ffs	ro		1 2
-kernfs  /kern   kernfs  rw
-ptyfs   /dev/ptsptyfs   rw
-procfs  /proc   procfs  rw
-# mount /root as tmpfs on top of existing dir
-tmpfs   /root.cow   tmpfs   rw,-s2M 0 0
-/root.cow   /root   union   rw,hidden   0 0
-# mount /etc as tmpfs on top of existing dir
-tmpfs   

CVS commit: src/distrib/utils/embedded

2013-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 20:58:38 UTC 2013

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
move configuration to new place.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.4 src/distrib/utils/embedded/mkimage:1.5
--- src/distrib/utils/embedded/mkimage:1.4	Sun Jan 13 15:57:18 2013
+++ src/distrib/utils/embedded/mkimage	Sun Jan 13 15:58:38 2013
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: mkimage,v 1.4 2013/01/13 20:57:18 christos Exp $
+# $NetBSD: mkimage,v 1.5 2013/01/13 20:58:38 christos Exp $
 
 # Copyright (c) 2012 Alistair Crooks a...@netbsd.org
 # All rights reserved.
@@ -126,13 +126,13 @@ then
 	usage
 fi
 
-if [ ! -f ${DIR}/${h}.conf ]
+if [ ! -f ${DIR}/conf/${h}.conf ]
 then
-	echo $PROG: ${DIR}/${h}.conf is not present 12
+	echo $PROG: ${DIR}/conf/${h}.conf is not present 12
 	exit 1
 fi
 
-. ${DIR}/${h}.conf
+. ${DIR}/conf/${h}.conf
 
 OPTIND=1
 while getopts $OPTS f



CVS commit: src/distrib/utils/embedded

2013-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 20:59:22 UTC 2013

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
complain on unknown options


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.5 src/distrib/utils/embedded/mkimage:1.6
--- src/distrib/utils/embedded/mkimage:1.5	Sun Jan 13 15:58:38 2013
+++ src/distrib/utils/embedded/mkimage	Sun Jan 13 15:59:22 2013
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: mkimage,v 1.5 2013/01/13 20:58:38 christos Exp $
+# $NetBSD: mkimage,v 1.6 2013/01/13 20:59:22 christos Exp $
 
 # Copyright (c) 2012 Alistair Crooks a...@netbsd.org
 # All rights reserved.
@@ -143,7 +143,7 @@ do
 	h)	;;
 	s)	size=$OPTARG;;
 	x)	set -x;;
-	*)	;;
+	*)	usage;;
 	esac
 done
 



CVS commit: src/sys/arch/xen

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 21:01:05 UTC 2013

Modified Files:
src/sys/arch/xen/include: hypervisor.h
src/sys/arch/xen/x86: hypervisor_machdep.c
src/sys/arch/xen/xen: evtchn.c

Log Message:
Re-apply
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039125.html
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039126.html
they're not involved in i386 domU hang shown by ATF.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/xen/x86/hypervisor_machdep.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/xen/xen/evtchn.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/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.42 src/sys/arch/xen/include/hypervisor.h:1.43
--- src/sys/arch/xen/include/hypervisor.h:1.42	Sat Jan 12 21:09:10 2013
+++ src/sys/arch/xen/include/hypervisor.h	Sun Jan 13 21:01:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.42 2013/01/12 21:09:10 bouyer Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.43 2013/01/13 21:01:05 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -142,8 +142,7 @@ void hypervisor_unmask_event(unsigned in
 void hypervisor_mask_event(unsigned int);
 void hypervisor_clear_event(unsigned int);
 void hypervisor_enable_ipl(unsigned int);
-void hypervisor_set_ipending(struct cpu_info *, 
-			 uint32_t, int, int);
+void hypervisor_set_ipending(uint32_t, int, int);
 void hypervisor_machdep_attach(void);
 void hypervisor_machdep_resume(void);
 

Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.26 src/sys/arch/xen/x86/hypervisor_machdep.c:1.27
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.26	Sat Jan 12 21:09:10 2013
+++ src/sys/arch/xen/x86/hypervisor_machdep.c	Sun Jan 13 21:01:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor_machdep.c,v 1.26 2013/01/12 21:09:10 bouyer Exp $	*/
+/*	$NetBSD: hypervisor_machdep.c,v 1.27 2013/01/13 21:01:05 bouyer Exp $	*/
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hypervisor_machdep.c,v 1.26 2013/01/12 21:09:10 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: hypervisor_machdep.c,v 1.27 2013/01/13 21:01:05 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -87,11 +87,11 @@ static void update_p2m_frame_list_list(v
 // #define EARLY_DEBUG_EVENT
 
 /* callback function type */
-typedef void (*iterate_func_t)(struct cpu_info *, unsigned int,
-			   unsigned int, unsigned int, void *);
+typedef void (*iterate_func_t)(unsigned int, unsigned int,
+			   unsigned int, void *);
 
 static inline void
-evt_iterate_bits(struct cpu_info *ci, volatile unsigned long *pendingl1,
+evt_iterate_bits(volatile unsigned long *pendingl1,
 		 volatile unsigned long *pendingl2, 
 		 volatile unsigned long *mask,
 		 iterate_func_t iterate_pending, void *iterate_args)
@@ -109,7 +109,7 @@ evt_iterate_bits(struct cpu_info *ci, vo
 		l1 = ~(1UL  l1i);
 
 		l2 = pendingl2[l1i]  (mask != NULL ? ~mask[l1i] : -1UL);
-		l2 = ci-ci_evtmask[l1i];
+		l2 = curcpu()-ci_evtmask[l1i];
 
 		if (mask != NULL) xen_atomic_setbits_l(mask[l1i], l2);
 		xen_atomic_clearbits_l(pendingl2[l1i], l2);
@@ -120,7 +120,7 @@ evt_iterate_bits(struct cpu_info *ci, vo
 
 			port = (l1i  LONG_SHIFT) + l2i;
 
-			iterate_pending(ci, port, l1i, l2i, iterate_args);
+			iterate_pending(port, l1i, l2i, iterate_args);
 		}
 	}
 }
@@ -131,20 +131,18 @@ evt_iterate_bits(struct cpu_info *ci, vo
  */

 static inline void
-evt_set_pending(struct cpu_info *ci, unsigned int port, unsigned int l1i,
+evt_set_pending(unsigned int port, unsigned int l1i,
 		unsigned int l2i, void *args)
 {
 
 	KASSERT(args != NULL);
-	KASSERT(ci != NULL);
 
 	int *ret = args;
 
 	if (evtsource[port]) {
-		hypervisor_set_ipending(evtsource[port]-ev_cpu,
-		evtsource[port]-ev_imask, l1i, l2i);
+		hypervisor_set_ipending(evtsource[port]-ev_imask, l1i, l2i);
 		evtsource[port]-ev_evcnt.ev_count++;
-		if (*ret == 0  ci-ci_ilevel 
+		if (*ret == 0  curcpu()-ci_ilevel 
 		evtsource[port]-ev_maxlevel)
 			*ret = 1;
 	}
@@ -193,7 +191,7 @@ stipending(void)
 
 		vci-evtchn_upcall_pending = 0;
 
-		evt_iterate_bits(ci, vci-evtchn_pending_sel,
+		evt_iterate_bits(vci-evtchn_pending_sel,
 		s-evtchn_pending, s-evtchn_mask,
 		evt_set_pending, ret);
 
@@ -214,12 +212,12 @@ stipending(void)
 /* Iterate through pending events and call the event handler */
 
 static inline void
-evt_do_hypervisor_callback(struct cpu_info *ci, unsigned int port,
-			   unsigned int l1i, unsigned int l2i, void *args)
+evt_do_hypervisor_callback(unsigned int port, unsigned int l1i,
+			   unsigned int l2i, void *args)
 {
 	KASSERT(args != NULL);
-	KASSERT(ci == curcpu());
 
+	struct cpu_info *ci = curcpu();
 	struct intrframe *regs = args;
 
 #ifdef 

CVS commit: src/distrib/utils/embedded/conf

2013-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 21:38:45 UTC 2013

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf

Log Message:
Autosize label


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/rpi.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.1 src/distrib/utils/embedded/conf/rpi.conf:1.2
--- src/distrib/utils/embedded/conf/rpi.conf:1.1	Sun Jan 13 15:57:18 2013
+++ src/distrib/utils/embedded/conf/rpi.conf	Sun Jan 13 16:38:45 2013
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.1 2013/01/13 20:57:18 christos Exp $
+# $NetBSD: rpi.conf,v 1.2 2013/01/13 21:38:45 christos Exp $
 # Raspberry PI customization script used by mkimage
 #
 image=$HOME/rpi.img
@@ -11,23 +11,42 @@ setsdir=$obj/evbarm/media
 kerneldir=$src/sys/arch/evbarm/compile/RPI
 specialdirs=/kern /proc
 
+swap=512
 size=2048
 overhead=8
+boot=112
+init=8
 
 tmp=/tmp/rpi.disklabel.$$
 
 make_filesystems() {
+
+	local asize=$(( ${size} * 1024 ))
+	local swapsize=$(( ${swap} * 1024 ))
+	local bootsize=$(( ${boot} * 1024 ))
+
+	local bootoffset=$((${init} * 1024 ))
+	local swapoffset=$(( ${bootoffset} + ${bootsize} ))
+	local aoffset=$(( ${swapoffset} + ${swapsize} ))
+
+	local totalsize=$(( ${asize} + ${swapsize} + ${bootsize} + ${bootoffset} ))
+	local bps=512
+	local spt=32
+	local tpc=64
+	local spc=2048
+	local cylinders=$(( ${totalsize} / ${spc} ))
+
 	cat  ${tmp}  EOF
 type: SCSI
 disk: STORAGE DEVICE
 label: fictitious
 flags: removable
-bytes/sector: 512
-sectors/track: 32
-tracks/cylinder: 64
-sectors/cylinder: 2048
-cylinders: 7460
-total sectors: 2097152
+bytes/sector: ${bps}
+sectors/track: ${spt}
+tracks/cylinder: ${tpc}
+sectors/cylinder: ${spc}
+cylinders: ${cylinders}
+total sectors: ${totalsize}
 rpm: 3600
 interleave: 1
 trackskew: 0
@@ -37,11 +56,11 @@ track-to-track seek: 0  # microseconds
 drivedata: 0 
 
 8 partitions:
-#sizeoffset fstype [fsize bsize cpg/sgs]
- a:   1449984647168 4.2BSD   2048 16384 0  # 
- b:524288122880   swap #
- d:   2097152 0 unused  0 0#
- e:114688  8192  MSDOS #
+# size offsetfstype [fsize bsize cpg/sgs]
+ a:   ${asize} ${aoffset}4.2BSD   2048 16384 0  # 
+ b:   ${swapsize}  ${swapoffset} swap   #
+ d:   ${totalsize} 0 unused  0 0#
+ e:   ${bootsize}  ${bootoffset} MSDOS  #
 EOF
 	${sudo} disklabel -R ${vnddev} ${tmp}
 	${sudo} fdisk -f -u -0 -s 12/8192/114688 -F ${image}



CVS commit: src/distrib/utils/embedded/conf

2013-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 21:46:03 UTC 2013

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf

Log Message:
use variables for the fdisk command too


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/rpi.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.2 src/distrib/utils/embedded/conf/rpi.conf:1.3
--- src/distrib/utils/embedded/conf/rpi.conf:1.2	Sun Jan 13 16:38:45 2013
+++ src/distrib/utils/embedded/conf/rpi.conf	Sun Jan 13 16:46:03 2013
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.2 2013/01/13 21:38:45 christos Exp $
+# $NetBSD: rpi.conf,v 1.3 2013/01/13 21:46:03 christos Exp $
 # Raspberry PI customization script used by mkimage
 #
 image=$HOME/rpi.img
@@ -16,6 +16,7 @@ size=2048
 overhead=8
 boot=112
 init=8
+msdosid=12
 
 tmp=/tmp/rpi.disklabel.$$
 
@@ -63,7 +64,7 @@ drivedata: 0 
  e:   ${bootsize}  ${bootoffset} MSDOS  #
 EOF
 	${sudo} disklabel -R ${vnddev} ${tmp}
-	${sudo} fdisk -f -u -0 -s 12/8192/114688 -F ${image}
+	${sudo} fdisk -f -u -0 -s ${msdosid}/${bootoffset}/${bootsize} -F ${image}
 	${sudo} newfs /dev/r${vnddev}a
 	${sudo} newfs_msdos /dev/r${vnddev}e
 	${sudo} mount /dev/${vnddev}a ${mnt}



CVS commit: src/distrib/utils/embedded

2013-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 21:51:47 UTC 2013

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
honor ${TMPDIR}


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.6 src/distrib/utils/embedded/mkimage:1.7
--- src/distrib/utils/embedded/mkimage:1.6	Sun Jan 13 15:59:22 2013
+++ src/distrib/utils/embedded/mkimage	Sun Jan 13 16:51:47 2013
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: mkimage,v 1.6 2013/01/13 20:59:22 christos Exp $
+# $NetBSD: mkimage,v 1.7 2013/01/13 21:51:47 christos Exp $
 
 # Copyright (c) 2012 Alistair Crooks a...@netbsd.org
 # All rights reserved.
@@ -107,7 +107,7 @@ DIR=$(dirname $0)
 PROG=$(basename $0)
 bar
 sudo=
-mnt=/tmp/image.$$
+mnt=${TMPDIR:-/tmp}/image.$$
 src=/usr/src
 obj=/usr/obj
 



CVS commit: src/distrib/utils/embedded/conf

2013-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 13 22:08:43 UTC 2013

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf usermode.conf

Log Message:
append to rc.conf, don't overwrite


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/usermode.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.4 src/distrib/utils/embedded/conf/rpi.conf:1.5
--- src/distrib/utils/embedded/conf/rpi.conf:1.4	Sun Jan 13 16:52:42 2013
+++ src/distrib/utils/embedded/conf/rpi.conf	Sun Jan 13 17:08:43 2013
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.4 2013/01/13 21:52:42 christos Exp $
+# $NetBSD: rpi.conf,v 1.5 2013/01/13 22:08:43 christos Exp $
 # Raspberry PI customization script used by mkimage
 #
 image=$HOME/rpi.img
@@ -87,7 +87,7 @@ EOF
 
 customize() {
 
-${sudo} cat  ${mnt}/etc/rc.conf  EOF
+${sudo} cat  ${mnt}/etc/rc.conf  EOF
 sshd=YES
 dhcpcd=YES
 mdnsd=YES

Index: src/distrib/utils/embedded/conf/usermode.conf
diff -u src/distrib/utils/embedded/conf/usermode.conf:1.1 src/distrib/utils/embedded/conf/usermode.conf:1.2
--- src/distrib/utils/embedded/conf/usermode.conf:1.1	Sun Jan 13 15:57:18 2013
+++ src/distrib/utils/embedded/conf/usermode.conf	Sun Jan 13 17:08:43 2013
@@ -1,4 +1,4 @@
-# $NetBSD: usermode.conf,v 1.1 2013/01/13 20:57:18 christos Exp $
+# $NetBSD: usermode.conf,v 1.2 2013/01/13 22:08:43 christos Exp $
 # NetBSD/usermode customization script used by mkimage
 custom=custom
 image=usermode.img
@@ -37,7 +37,7 @@ EOF
 }
 
 customize() {
-${sudo} cat  ${mnt}/etc/rc.conf  EOF
+${sudo} cat  ${mnt}/etc/rc.conf  EOF
 # make sure we have the right rw filesystem at boot
 critical_filesystems_local=/var.cow /var /etc.cow /etc /root.cow /root
 



CVS commit: othersrc/external/bsd/netdiff

2013-01-13 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Sun Jan 13 22:17:22 UTC 2013

Modified Files:
othersrc/external/bsd/netdiff/bin: Makefile
othersrc/external/bsd/netdiff/bin/netdiff: Makefile
othersrc/external/bsd/netdiff/bin/qdiff: Makefile
othersrc/external/bsd/netdiff/dist: diff.c diff_subr.c diffreg.c
libnetdiff.3 netdiff.h
othersrc/external/bsd/netdiff/lib: Makefile
Added Files:
othersrc/external/bsd/netdiff/bin/wdiff: Makefile f1 f2
othersrc/external/bsd/netdiff/dist: netwdiff.1 netwdiff.c

Log Message:
Add wdiff functionality, which performs a word-by-word comparison
between two areas of memory, or between two files.  This is
accomplished using two new functions, wdiff_mem() or wdiff_file(), and
results can either be retrieved by displaying them to stdout, to an
output file, or by using diff_get_diffs() to retrieve the results
in-memory.

Internally, the two files/areas of memory are split into separate
areas of memory with a word on each line, and the two areas of memory
are compared using diff_mem().

Comparisons can also be made in a case-insensitive manner.

In the comparison output, added text is displayed in {+ ...  +}
delimiters, and deleted text is shown with [- ... -] delimiters.
Changes are displayed as a deletion and an addition.

+ Deleted text can be inhibited from display by using the -1 argument
  to netwdiff(1).
+ Added text can be inhibited from display by using the -2 argument to
  netwdiff(1).
+ Common text can be inhibited from display by using the -3 argument
  to netwdiff(1).

(Don't blame me, these flags are the ones used by GNU wdiff.)

With thanks to Thomas Klausner for the nudge to create this.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/netdiff/bin/Makefile
cvs rdiff -u -r1.1.1.1 -r1.2 \
othersrc/external/bsd/netdiff/bin/netdiff/Makefile
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/netdiff/bin/qdiff/Makefile
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/netdiff/bin/wdiff/Makefile \
othersrc/external/bsd/netdiff/bin/wdiff/f1 \
othersrc/external/bsd/netdiff/bin/wdiff/f2
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/netdiff/dist/diff.c \
othersrc/external/bsd/netdiff/dist/diffreg.c \
othersrc/external/bsd/netdiff/dist/libnetdiff.3
cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/netdiff/dist/diff_subr.c
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/netdiff/dist/netdiff.h
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/netdiff/dist/netwdiff.1 \
othersrc/external/bsd/netdiff/dist/netwdiff.c
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/netdiff/lib/Makefile

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

Modified files:

Index: othersrc/external/bsd/netdiff/bin/Makefile
diff -u othersrc/external/bsd/netdiff/bin/Makefile:1.2 othersrc/external/bsd/netdiff/bin/Makefile:1.3
--- othersrc/external/bsd/netdiff/bin/Makefile:1.2	Sat Jan 12 01:31:20 2013
+++ othersrc/external/bsd/netdiff/bin/Makefile	Sun Jan 13 22:17:21 2013
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.2 2013/01/12 01:31:20 agc Exp $
+# $NetBSD: Makefile,v 1.3 2013/01/13 22:17:21 agc Exp $
 
 SUBDIR=		netdiff
+SUBDIR=		wdiff
 .if !make(install)
 SUBDIR+=	memdiff
 SUBDIR+=	qdiff
@@ -12,3 +13,4 @@ t:
 	cd netdiff  ${MAKE} t
 	cd qdiff  ${MAKE} t
 	cd memdiff  ${MAKE} t
+	cd wdiff  ${MAKE} t

Index: othersrc/external/bsd/netdiff/bin/netdiff/Makefile
diff -u othersrc/external/bsd/netdiff/bin/netdiff/Makefile:1.1.1.1 othersrc/external/bsd/netdiff/bin/netdiff/Makefile:1.2
--- othersrc/external/bsd/netdiff/bin/netdiff/Makefile:1.1.1.1	Thu Jan 10 08:17:11 2013
+++ othersrc/external/bsd/netdiff/bin/netdiff/Makefile	Sun Jan 13 22:17:21 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.1.1 2013/01/10 08:17:11 agc Exp $
+# $NetBSD: Makefile,v 1.2 2013/01/13 22:17:21 agc Exp $
 
 .include bsd.own.mk
 
@@ -30,9 +30,9 @@ t: ${PROG}
 	-env LD_LIBRARY_PATH=${LIB_NETDIFF_DIR} ./${PROG} -u f1 f2  003.out
 	diff 003.expected 003.out
 	rm -f 003.out
-	-env LD_LIBRARY_PATH=${LIB_NETDIFF_DIR} ./${PROG} /usr/src/sbin /d/thinfs-src/sbin  004.out
-	diff 004.expected 004.out
-	rm -f 004.out
+	#-env LD_LIBRARY_PATH=${LIB_NETDIFF_DIR} ./${PROG} /usr/src/sbin /d/thinfs-src/sbin  004.out
+	#diff 004.expected 004.out
+	#rm -f 004.out
 	-env LD_LIBRARY_PATH=${LIB_NETDIFF_DIR} ./${PROG} Makefile Makefile  005.out
 	diff 005.expected 005.out
 	rm -f 005.out

Index: othersrc/external/bsd/netdiff/bin/qdiff/Makefile
diff -u othersrc/external/bsd/netdiff/bin/qdiff/Makefile:1.1.1.1 othersrc/external/bsd/netdiff/bin/qdiff/Makefile:1.2
--- othersrc/external/bsd/netdiff/bin/qdiff/Makefile:1.1.1.1	Thu Jan 10 08:17:11 2013
+++ othersrc/external/bsd/netdiff/bin/qdiff/Makefile	Sun Jan 13 22:17:21 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.1.1 2013/01/10 08:17:11 agc Exp $
+# $NetBSD: Makefile,v 1.2 2013/01/13 22:17:21 agc Exp $
 
 .include bsd.own.mk
 
@@ 

CVS commit: src/sbin/dump

2013-01-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 13 22:53:01 UTC 2013

Modified Files:
src/sbin/dump: dump.h dumprmt.c itime.c optr.c tape.c unctime.c

Log Message:
Add some const.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sbin/dump/dump.h
cvs rdiff -u -r1.34 -r1.35 src/sbin/dump/dumprmt.c
cvs rdiff -u -r1.18 -r1.19 src/sbin/dump/itime.c
cvs rdiff -u -r1.38 -r1.39 src/sbin/dump/optr.c
cvs rdiff -u -r1.50 -r1.51 src/sbin/dump/tape.c
cvs rdiff -u -r1.15 -r1.16 src/sbin/dump/unctime.c

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

Modified files:

Index: src/sbin/dump/dump.h
diff -u src/sbin/dump/dump.h:1.47 src/sbin/dump/dump.h:1.48
--- src/sbin/dump/dump.h:1.47	Sat May  5 21:03:02 2012
+++ src/sbin/dump/dump.h	Sun Jan 13 22:53:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dump.h,v 1.47 2012/05/05 21:03:02 christos Exp $	*/
+/*	$NetBSD: dump.h,v 1.48 2013/01/13 22:53:01 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -182,7 +182,7 @@ void	quit(const char *fmt, ...) __attrib
 time_t	do_stats(void);
 void	statussig(int);
 void	timeest(void);
-time_t	unctime(char *);
+time_t	unctime(const char *);
 
 /* mapping routines */
 union	dinode;
@@ -212,7 +212,7 @@ void	close_rewind(void);
 void	dumpblock(daddr_t, int);
 void	startnewtape(int);
 void	trewind(int);
-void	writerec(char *, int);
+void	writerec(const char *, int);
 
 void	Exit(int);
 void	dumpabort(int);

Index: src/sbin/dump/dumprmt.c
diff -u src/sbin/dump/dumprmt.c:1.34 src/sbin/dump/dumprmt.c:1.35
--- src/sbin/dump/dumprmt.c:1.34	Mon Aug 29 14:34:59 2011
+++ src/sbin/dump/dumprmt.c	Sun Jan 13 22:53:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dumprmt.c,v 1.34 2011/08/29 14:34:59 joerg Exp $	*/
+/*	$NetBSD: dumprmt.c,v 1.35 2013/01/13 22:53:01 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)dumprmt.c	8.3 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: dumprmt.c,v 1.34 2011/08/29 14:34:59 joerg Exp $);
+__RCSID($NetBSD: dumprmt.c,v 1.35 2013/01/13 22:53:01 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -73,7 +73,7 @@ static	int rmtstate = TS_CLOSED;
 static	int rmtape;
 static	char *rmtpeer;
 
-static	int	okname(char *);
+static	int	okname(const char *);
 static	int	rmtcall(const char *, const char *, int);
 __dead static	void	rmtconnaborted(int);
 static	int	rmtgetb(void);
@@ -157,9 +157,9 @@ rmtgetconn(void)
 }
 
 static int
-okname(char *cp0)
+okname(const char *cp0)
 {
-	char *cp;
+	const char *cp;
 	int c;
 
 	for (cp = cp0; *cp; cp++) {

Index: src/sbin/dump/itime.c
diff -u src/sbin/dump/itime.c:1.18 src/sbin/dump/itime.c:1.19
--- src/sbin/dump/itime.c:1.18	Thu Mar 11 01:32:59 2010
+++ src/sbin/dump/itime.c	Sun Jan 13 22:53:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: itime.c,v 1.18 2010/03/11 01:32:59 christos Exp $	*/
+/*	$NetBSD: itime.c,v 1.19 2013/01/13 22:53:01 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)itime.c	8.1 (Berkeley) 6/5/93;
 #else
-__RCSID($NetBSD: itime.c,v 1.18 2010/03/11 01:32:59 christos Exp $);
+__RCSID($NetBSD: itime.c,v 1.19 2013/01/13 22:53:01 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -65,7 +65,7 @@ int	nddates = 0;
 
 static	void dumprecout(FILE *, struct dumpdates *);
 static	int getrecord(FILE *, struct dumpdates *);
-static	int makedumpdate(struct dumpdates *, char *);
+static	int makedumpdate(struct dumpdates *, const char *);
 static	void readdumptimes(FILE *);
 
 void
@@ -256,7 +256,7 @@ getrecord(FILE *df, struct dumpdates *dd
 }
 
 static int
-makedumpdate(struct dumpdates *ddp, char *tbuf)
+makedumpdate(struct dumpdates *ddp, const char *tbuf)
 {
 	char un_buf[128];
 

Index: src/sbin/dump/optr.c
diff -u src/sbin/dump/optr.c:1.38 src/sbin/dump/optr.c:1.39
--- src/sbin/dump/optr.c:1.38	Sat Apr  7 16:44:10 2012
+++ src/sbin/dump/optr.c	Sun Jan 13 22:53:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: optr.c,v 1.38 2012/04/07 16:44:10 christos Exp $	*/
+/*	$NetBSD: optr.c,v 1.39 2013/01/13 22:53:01 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)optr.c	8.2 (Berkeley) 1/6/94;
 #else
-__RCSID($NetBSD: optr.c,v 1.38 2012/04/07 16:44:10 christos Exp $);
+__RCSID($NetBSD: optr.c,v 1.39 2013/01/13 22:53:01 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -64,7 +64,7 @@ __RCSID($NetBSD: optr.c,v 1.38 2012/04/
 #include pathnames.h
 
 void	alarmcatch(int);
-struct fstab *allocfsent(struct fstab *);
+struct fstab *allocfsent(const struct fstab *);
 int	datesort(const void *, const void *);
 extern  char *time_string;
 extern  char default_time_string[];
@@ -319,7 +319,7 @@ quit(const char *fmt, ...)
  */
 
 struct fstab *
-allocfsent(struct fstab *fs)
+allocfsent(const struct fstab *fs)
 {
 	struct fstab *new;
 	char buf[MAXPATHLEN];

Index: src/sbin/dump/tape.c
diff -u src/sbin/dump/tape.c:1.50 src/sbin/dump/tape.c:1.51
--- 

CVS commit: src/sbin/dump

2013-01-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 13 22:54:25 UTC 2013

Modified Files:
src/sbin/dump: dumprmt.c

Log Message:
Use ctype.h functions correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sbin/dump/dumprmt.c

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

Modified files:

Index: src/sbin/dump/dumprmt.c
diff -u src/sbin/dump/dumprmt.c:1.35 src/sbin/dump/dumprmt.c:1.36
--- src/sbin/dump/dumprmt.c:1.35	Sun Jan 13 22:53:01 2013
+++ src/sbin/dump/dumprmt.c	Sun Jan 13 22:54:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dumprmt.c,v 1.35 2013/01/13 22:53:01 dholland Exp $	*/
+/*	$NetBSD: dumprmt.c,v 1.36 2013/01/13 22:54:24 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)dumprmt.c	8.3 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: dumprmt.c,v 1.35 2013/01/13 22:53:01 dholland Exp $);
+__RCSID($NetBSD: dumprmt.c,v 1.36 2013/01/13 22:54:24 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -160,7 +160,7 @@ static int
 okname(const char *cp0)
 {
 	const char *cp;
-	int c;
+	unsigned char c;
 
 	for (cp = cp0; *cp; cp++) {
 		c = *cp;



CVS commit: src/sbin/dump

2013-01-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 13 22:59:31 UTC 2013

Modified Files:
src/sbin/dump: ffs_inode.c

Log Message:
Use static; remove unused global var this uncovered.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sbin/dump/ffs_inode.c

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

Modified files:

Index: src/sbin/dump/ffs_inode.c
diff -u src/sbin/dump/ffs_inode.c:1.18 src/sbin/dump/ffs_inode.c:1.19
--- src/sbin/dump/ffs_inode.c:1.18	Sun Jul 20 01:20:22 2008
+++ src/sbin/dump/ffs_inode.c	Sun Jan 13 22:59:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_inode.c,v 1.18 2008/07/20 01:20:22 lukem Exp $ */
+/*	$NetBSD: ffs_inode.c,v 1.19 2013/01/13 22:59:31 dholland Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -36,7 +36,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #endif /* not lint */
 
 #ifndef lint
-__RCSID($NetBSD: ffs_inode.c,v 1.18 2008/07/20 01:20:22 lukem Exp $);
+__RCSID($NetBSD: ffs_inode.c,v 1.19 2013/01/13 22:59:31 dholland Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -60,10 +60,9 @@ __RCSID($NetBSD: ffs_inode.c,v 1.18 200
 
 #include dump.h
 
-struct fs *sblock;
+static struct fs *sblock;
 
 static off_t sblock_try[] = SBLOCKSEARCH;
-off_t sblockloc;
 
 int is_ufs2;
 



CVS commit: src/sbin/dump

2013-01-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 13 23:07:16 UTC 2013

Modified Files:
src/sbin/dump: optr.c

Log Message:
Use more static.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sbin/dump/optr.c

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

Modified files:

Index: src/sbin/dump/optr.c
diff -u src/sbin/dump/optr.c:1.39 src/sbin/dump/optr.c:1.40
--- src/sbin/dump/optr.c:1.39	Sun Jan 13 22:53:01 2013
+++ src/sbin/dump/optr.c	Sun Jan 13 23:07:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: optr.c,v 1.39 2013/01/13 22:53:01 dholland Exp $	*/
+/*	$NetBSD: optr.c,v 1.40 2013/01/13 23:07:16 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)optr.c	8.2 (Berkeley) 1/6/94;
 #else
-__RCSID($NetBSD: optr.c,v 1.39 2013/01/13 22:53:01 dholland Exp $);
+__RCSID($NetBSD: optr.c,v 1.40 2013/01/13 23:07:16 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -63,12 +63,12 @@ __RCSID($NetBSD: optr.c,v 1.39 2013/01/
 #include dump.h
 #include pathnames.h
 
-void	alarmcatch(int);
-struct fstab *allocfsent(const struct fstab *);
-int	datesort(const void *, const void *);
 extern  char *time_string;
 extern  char default_time_string[];
 
+static void alarmcatch(int);
+static struct fstab *allocfsent(const struct fstab *);
+static int datesort(const void *, const void *);
 static void do_timestamp(time_t, const char *);
 
 /*
@@ -144,7 +144,7 @@ char lastmsg[200];
  *	Alert the console operator, and enable the alarm clock to
  *	sleep for 2 minutes in case nobody comes to satisfy dump
  */
-void
+static void
 alarmcatch(int dummy __unused)
 {
 
@@ -318,7 +318,7 @@ quit(const char *fmt, ...)
  *	we don't actually do it
  */
 
-struct fstab *
+static struct fstab *
 allocfsent(const struct fstab *fs)
 {
 	struct fstab *new;
@@ -501,7 +501,7 @@ lastdump(char arg)
 	}
 }
 
-int
+static int
 datesort(const void *a1, const void *a2)
 {
 	const struct dumpdates *d1 = *(const struct dumpdates *const *)a1;



CVS commit: src/sbin/dump

2013-01-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 13 23:17:18 UTC 2013

Modified Files:
src/sbin/dump: tape.c

Log Message:
Use void * for I/O functions and remove no-longer-needed casts.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sbin/dump/tape.c

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

Modified files:

Index: src/sbin/dump/tape.c
diff -u src/sbin/dump/tape.c:1.51 src/sbin/dump/tape.c:1.52
--- src/sbin/dump/tape.c:1.51	Sun Jan 13 22:53:01 2013
+++ src/sbin/dump/tape.c	Sun Jan 13 23:17:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tape.c,v 1.51 2013/01/13 22:53:01 dholland Exp $	*/
+/*	$NetBSD: tape.c,v 1.52 2013/01/13 23:17:18 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)tape.c	8.4 (Berkeley) 5/1/95;
 #else
-__RCSID($NetBSD: tape.c,v 1.51 2013/01/13 22:53:01 dholland Exp $);
+__RCSID($NetBSD: tape.c,v 1.52 2013/01/13 23:17:18 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -70,8 +70,8 @@ extern	int cartridge;
 extern	const char *host;
 char	*nexttape;
 
-static	ssize_t atomic_read(int, char *, int);
-static	ssize_t atomic_write(int, const char *, int);
+static	ssize_t atomic_read(int, void *, int);
+static	ssize_t atomic_write(int, const void *, int);
 static	void doslave(int, int);
 static	void enslave(void);
 static	void flushtape(void);
@@ -286,7 +286,7 @@ flushtape(void)
 
 	slp-req[trecno].count = 0;			/* Sentinel */
 
-	if (atomic_write(slp-fd, (char *)slp-req, siz) != siz)
+	if (atomic_write(slp-fd, slp-req, siz) != siz)
 		quit(error writing command pipe: %s\n, strerror(errno));
 	slp-sent = 1; /* we sent a request, read the response later */
 
@@ -297,7 +297,7 @@ flushtape(void)
 
 	/* Read results back from next slave */
 	if (slp-sent) {
-		if (atomic_read(slp-fd, (char *)got, sizeof got)
+		if (atomic_read(slp-fd, got, sizeof got)
 		!= sizeof got) {
 			perror(  DUMP: error reading command pipe in master);
 			dumpabort(0);
@@ -315,7 +315,7 @@ flushtape(void)
 			for (i = 0; i  SLAVES; i++) {
 if (slaves[i].sent) {
 	if (atomic_read(slaves[i].fd,
-	(char *)got, sizeof got)
+	got, sizeof got)
 	!= sizeof got) {
 		perror(  DUMP: error reading command pipe in master);
 		dumpabort(0);
@@ -369,7 +369,7 @@ trewind(int eject)
 		 * fixme: punt for now.
 		 */
 		if (slaves[f].sent) {
-			if (atomic_read(slaves[f].fd, (char *)got, sizeof got)
+			if (atomic_read(slaves[f].fd, got, sizeof got)
 			!= sizeof got) {
 perror(  DUMP: error reading command pipe in master);
 dumpabort(0);
@@ -508,7 +508,7 @@ rollforward(void)
 			lastspclrec = savedtapea - 1;
 		}
 		size = (char *)ntb - (char *)q;
-		if (atomic_write(slp-fd, (char *)q, size) != size) {
+		if (atomic_write(slp-fd, q, size) != size) {
 			perror(  DUMP: error writing command pipe);
 			dumpabort(0);
 		}
@@ -548,7 +548,7 @@ rollforward(void)
 	 * worked ok, otherwise the tape is much too short!
 	 */
 	if (slp-sent) {
-		if (atomic_read(slp-fd, (char *)got, sizeof got)
+		if (atomic_read(slp-fd, got, sizeof got)
 		!= sizeof got) {
 			perror(  DUMP: error reading command pipe in master);
 			dumpabort(0);
@@ -787,7 +787,7 @@ enslave(void)
 
 	for (i = 0; i  SLAVES; i++)
 		(void) atomic_write(slaves[i].fd,
-(char *) slaves[(i + 1) % SLAVES].pid,
+slaves[(i + 1) % SLAVES].pid,
 sizeof slaves[0].pid);
 
 	master = 0;
@@ -829,7 +829,7 @@ doslave(int cmd, int slave_number __unus
 	/*
 	 * Need the pid of the next slave in the loop...
 	 */
-	if ((nread = atomic_read(cmd, (char *)nextslave, sizeof nextslave))
+	if ((nread = atomic_read(cmd, nextslave, sizeof nextslave))
 	!= sizeof nextslave) {
 		quit(master/slave protocol botched - didn't get pid of next slave.\n);
 	}
@@ -837,7 +837,7 @@ doslave(int cmd, int slave_number __unus
 	/*
 	 * Get list of blocks to dump, read the blocks into tape buffer
 	 */
-	while ((nread = atomic_read(cmd, (char *)slp-req, reqsiz)) == reqsiz) {
+	while ((nread = atomic_read(cmd, slp-req, reqsiz)) == reqsiz) {
 		struct req *p = slp-req;
 
 		for (trecno = 0; trecno  ntrec;
@@ -847,7 +847,7 @@ doslave(int cmd, int slave_number __unus
 	p-count * TP_BSIZE);
 			} else {
 if (p-count != 1 || atomic_read(cmd,
-(char *)slp-tblock[trecno],
+slp-tblock[trecno],
 TP_BSIZE) != TP_BSIZE)
    quit(master/slave protocol botched.\n);
 			}
@@ -915,7 +915,7 @@ doslave(int cmd, int slave_number __unus
 			 * pass size of write back to master
 			 * (for EOT handling)
 			 */
-			(void) atomic_write(cmd, (char *)size, sizeof size);
+			(void) atomic_write(cmd, size, sizeof size);
 		}
 
 		/*
@@ -934,12 +934,12 @@ doslave(int cmd, int slave_number __unus
  * loop until the count is satisfied (or error).
  */
 static ssize_t
-atomic_read(int fd, char *buf, int count)
+atomic_read(int fd, void *buf, int count)
 {
 	ssize_t got, 

CVS commit: src/sbin/dump

2013-01-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 13 23:45:35 UTC 2013

Modified Files:
src/sbin/dump: dump.h

Log Message:
Use __printflike.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sbin/dump/dump.h

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

Modified files:

Index: src/sbin/dump/dump.h
diff -u src/sbin/dump/dump.h:1.48 src/sbin/dump/dump.h:1.49
--- src/sbin/dump/dump.h:1.48	Sun Jan 13 22:53:01 2013
+++ src/sbin/dump/dump.h	Sun Jan 13 23:45:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dump.h,v 1.48 2013/01/13 22:53:01 dholland Exp $	*/
+/*	$NetBSD: dump.h,v 1.49 2013/01/13 23:45:35 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -175,10 +175,10 @@ void	fs_mapinodes(ino_t, u_int64_t *, in
 /* operator interface functions */
 void	broadcast(const char *);
 void	lastdump(char);
-void	msg(const char *fmt, ...) __attribute__((__format__(__printf__,1,2)));
-void	msgtail(const char *fmt, ...) __attribute__((__format__(__printf__,1,2)));
+void	msg(const char *fmt, ...) __printflike(1, 2);
+void	msgtail(const char *fmt, ...) __printflike(1, 2);
 int	query(const char *);
-void	quit(const char *fmt, ...) __attribute__((__format__(__printf__,1,2)));
+void	quit(const char *fmt, ...) __printflike(1, 2);
 time_t	do_stats(void);
 void	statussig(int);
 void	timeest(void);



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

2013-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 14 00:06:12 UTC 2013

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

Log Message:
print the lid too.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/amd64/amd64/trap.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.74 src/sys/arch/amd64/amd64/trap.c:1.75
--- src/sys/arch/amd64/amd64/trap.c:1.74	Tue Aug 28 11:54:40 2012
+++ src/sys/arch/amd64/amd64/trap.c	Sun Jan 13 19:06:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.74 2012/08/28 15:54:40 christos Exp $	*/
+/*	$NetBSD: trap.c,v 1.75 2013/01/14 00:06:11 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.74 2012/08/28 15:54:40 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.75 2013/01/14 00:06:11 christos Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -199,7 +199,7 @@ trap_print(const struct trapframe *frame
 	type, frame-tf_err, (u_long)frame-tf_rip, frame-tf_cs,
 	frame-tf_rflags, rcr2(), curcpu()-ci_ilevel, frame-tf_rsp);
 
-	printf(curlwp %p pid %d lid %d lowest kstack %p\n,
+	printf(curlwp %p pid %d.%d lowest kstack %p\n,
 	l, l-l_proc-p_pid, l-l_lid, KSTACK_LOWEST_ADDR(l));
 }
 
@@ -390,8 +390,8 @@ kernelfault:
 	case T_STKFLT|T_USER:
 	case T_ALIGNFLT|T_USER:
 #ifdef TRAP_SIGDEBUG
-		printf(pid %d (%s): BUS/SEGV (%x) at rip %lx addr %lx\n,
-		p-p_pid, p-p_comm, type, frame-tf_rip, rcr2());
+		printf(pid %d.%d (%s): BUS/SEGV (%x) at rip %lx addr %lx\n,
+		p-p_pid, l-l_lid, p-p_comm, type, frame-tf_rip, rcr2());
 		frame_dump(frame);
 #endif
 		KSI_INIT_TRAP(ksi);
@@ -424,8 +424,8 @@ kernelfault:
 	case T_PRIVINFLT|T_USER:	/* privileged instruction fault */
 	case T_FPOPFLT|T_USER:		/* coprocessor operand fault */
 #ifdef TRAP_SIGDEBUG
-		printf(pid %d (%s): ILL at rip %lx addr %lx\n,
-		p-p_pid, p-p_comm, frame-tf_rip, rcr2());
+		printf(pid %d.%d (%s): ILL at rip %lx addr %lx\n,
+		p-p_pid, l-l_lid, p-p_comm, frame-tf_rip, rcr2());
 		frame_dump(frame);
 #endif
 		KSI_INIT_TRAP(ksi);
@@ -463,8 +463,8 @@ kernelfault:
 
 #if 0 /* handled by fpudna() */
 	case T_DNA|T_USER: {
-		printf(pid %d killed due to lack of floating point\n,
-		p-p_pid);
+		printf(pid %d.%d killed due to lack of floating point\n,
+		p-p_pid, l-l_lid);
 		KSI_INIT_TRAP(ksi);
 		ksi.ksi_signo = SIGKILL;
 		ksi.ksi_trap = type  ~T_USER;
@@ -639,14 +639,14 @@ faultcommon:
 		}
 		if (error == ENOMEM) {
 			ksi.ksi_signo = SIGKILL;
-			printf(UVM: pid %d (%s), uid %d killed: out of swap\n,
-			   p-p_pid, p-p_comm,
+			printf(UVM: pid %d.%d (%s), uid %d killed: out of swap\n,
+			   p-p_pid, l-l_lid, p-p_comm,
 			   l-l_cred ?
 			   kauth_cred_geteuid(l-l_cred) : -1);
 		} else {
 #ifdef TRAP_SIGDEBUG
-			printf(pid %d (%s): SEGV at rip %lx addr %lx\n,
-			p-p_pid, p-p_comm, frame-tf_rip, va);
+			printf(pid %d.%d (%s): SEGV at rip %lx addr %lx\n,
+			p-p_pid, l-l_lid, p-p_comm, frame-tf_rip, va);
 			frame_dump(frame);
 #endif
 			ksi.ksi_signo = SIGSEGV;



CVS commit: src/common/lib/libc/arch/arm/string

2013-01-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 14 00:07:30 UTC 2013

Added Files:
src/common/lib/libc/arch/arm/string: strcat_arm.S

Log Message:
Add a native version of strcat which uses the optimized strlen and strcpy
routines.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/common/lib/libc/arch/arm/string/strcat_arm.S

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

Added files:

Index: src/common/lib/libc/arch/arm/string/strcat_arm.S
diff -u /dev/null src/common/lib/libc/arch/arm/string/strcat_arm.S:1.1
--- /dev/null	Mon Jan 14 00:07:30 2013
+++ src/common/lib/libc/arch/arm/string/strcat_arm.S	Mon Jan 14 00:07:29 2013
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ */
+
+#include machine/asm.h
+
+/*
+ * Implementation of strcat using strlen/strcpy.
+ */
+ENTRY(strcat)
+	str	lr, [sp, #-8]		/* save return address */
+	push	{r4, r5}		/* save registers */
+
+	mov	r4, r0			/* save dst */
+	mov	r5, r1			/* save append */
+
+	bl	PLT_SYM(strlen)		/* find length of dst */
+
+	add	r0, r0, r4		/* add to dst pointer */
+	mov	r1, r5			/* fetch append */
+	bl	PLT_SYM(strcpy)		/* append string */
+
+	mov	r0, r4			/* restore dst as return value */
+	pop	{r4, r5}		/* restore registers */
+	ldr	lr, [sp], #8		/* restore return address */
+	RET
+END(strcat)



CVS commit: src/sys/arch/luna68k/stand/boot

2013-01-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jan 14 01:37:58 UTC 2013

Modified Files:
src/sys/arch/luna68k/stand/boot: autoconf.c ioconf.c samachdep.h sc.c
sd.c ufs_disksubr.c version

Log Message:
Fix drivers to make secondary SPC SCSI on LUNA-II work properly.
Also bump version.

Now we can load a NetBSD kernel from external SCSI disks on LUNA-II.
(and netboot on LUNA-II also works)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/autoconf.c \
src/sys/arch/luna68k/stand/boot/ioconf.c \
src/sys/arch/luna68k/stand/boot/sc.c src/sys/arch/luna68k/stand/boot/sd.c \
src/sys/arch/luna68k/stand/boot/version
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/samachdep.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/ufs_disksubr.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/luna68k/stand/boot/autoconf.c
diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.2 src/sys/arch/luna68k/stand/boot/autoconf.c:1.3
--- src/sys/arch/luna68k/stand/boot/autoconf.c:1.2	Sat Jan 12 13:39:47 2013
+++ src/sys/arch/luna68k/stand/boot/autoconf.c	Mon Jan 14 01:37:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.2 2013/01/12 13:39:47 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -80,6 +80,7 @@
 
 #include sys/param.h
 #include sys/dkstat.h
+#include machine/cpu.h
 #include lib/libkern/libkern.h
 #include luna68k/stand/boot/samachdep.h
 #include luna68k/stand/boot/device.h
@@ -499,6 +500,10 @@ find_devs(void)
 	setup_hw(hw, (char *) 0xe100, 0xe, SCSI, 0xe, MB89352  (SPC));
 	hw++;
 
+	if (machtype == LUNA_II  !badaddr((void *) 0xe140)) {
+		setup_hw(hw, (char *) 0xe140, 0xe, SCSI, 0xe, MB89352  (SPC));
+		hw++;
+	}
 	if (!badaddr((void *) 0xf100)) {
 		setup_hw(hw, (char *) 0xf100, 0xf, NET,  0xf, Am7990 (LANCE));
 		hw++;
Index: src/sys/arch/luna68k/stand/boot/ioconf.c
diff -u src/sys/arch/luna68k/stand/boot/ioconf.c:1.2 src/sys/arch/luna68k/stand/boot/ioconf.c:1.3
--- src/sys/arch/luna68k/stand/boot/ioconf.c:1.2	Sun Jan 13 14:10:55 2013
+++ src/sys/arch/luna68k/stand/boot/ioconf.c	Mon Jan 14 01:37:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ioconf.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $	*/
+/*	$NetBSD: ioconf.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -86,6 +86,7 @@ extern struct driver stdriver;
 struct hp_ctlr hp_cinit[] = {
 /*	driver,		unit,	alive,	addr,	flags */
 	{ scdriver,	0,	0,	C 0x0,	0x0 },
+	{ scdriver,	1,	0,	C 0x0,	0x0 },
 	{0},
 };
 
@@ -93,6 +94,8 @@ struct hp_device hp_dinit[] = {
 /*driver,	cdriver,	unit,	ctlr,	slave,	addr,	dk,	flags*/
 { sddriver,	scdriver,	0,	0,	6,	C 0x0,	1,	0x0 },
 { sddriver,	scdriver,	1,	0,	5,	C 0x0,	1,	0x0 },
+{ sddriver,	scdriver,	2,	1,	6,	C 0x0,	1,	0x0 },
+{ sddriver,	scdriver,	3,	1,	5,	C 0x0,	1,	0x0 },
 { ledriver,	NULL,		0,	0,	0,	C 0x0,	0,	0x0 },
 #ifdef notyet
 { stdriver,	scdriver,	0,	0,	4,	C 0x0,	0,	0x0 },
Index: src/sys/arch/luna68k/stand/boot/sc.c
diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.2 src/sys/arch/luna68k/stand/boot/sc.c:1.3
--- src/sys/arch/luna68k/stand/boot/sc.c:1.2	Sun Jan 13 04:39:28 2013
+++ src/sys/arch/luna68k/stand/boot/sc.c	Mon Jan 14 01:37:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sc.c,v 1.2 2013/01/13 04:39:28 tsutsui Exp $	*/
+/*	$NetBSD: sc.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -76,7 +76,7 @@
  */
 
 
-#define NSC	1
+#define NSC	2
 
 #include sys/param.h
 #include luna68k/stand/boot/samachdep.h
@@ -111,7 +111,14 @@ int
 scinit(void *arg)
 {
 	struct hp_ctlr *hc = arg;
-	struct scsi_softc *hs = scsi_softc[hc-hp_unit];
+	struct scsi_softc *hs;
+	int unit;
+
+	unit = hc-hp_unit;
+	if (unit  0 || unit = NSC)
+		return 0;
+
+	hs = scsi_softc[unit];
 
 	hc-hp_ipl= SCSI_IPL;
 	hs-sc_hc = hc;
Index: src/sys/arch/luna68k/stand/boot/sd.c
diff -u src/sys/arch/luna68k/stand/boot/sd.c:1.2 src/sys/arch/luna68k/stand/boot/sd.c:1.3
--- src/sys/arch/luna68k/stand/boot/sd.c:1.2	Sun Jan 13 04:39:28 2013
+++ src/sys/arch/luna68k/stand/boot/sd.c	Mon Jan 14 01:37:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.2 2013/01/13 04:39:28 tsutsui Exp $	*/
+/*	$NetBSD: sd.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -252,7 +252,7 @@ sdinit(void *arg)
 	/*
 	 * read disklabel
 	 */
-	msg = readdisklabel(hd-hp_slave, sdstrategy, lp);
+	msg = readdisklabel(hd-hp_ctlr, hd-hp_slave, lp);
 	if (msg != NULL)
 		printf(sd%d: %s\n, hd-hp_unit, msg);
 
Index: src/sys/arch/luna68k/stand/boot/version
diff -u src/sys/arch/luna68k/stand/boot/version:1.2 src/sys/arch/luna68k/stand/boot/version:1.3
--- src/sys/arch/luna68k/stand/boot/version:1.2	Sun Jan 13 14:10:55 2013
+++ src/sys/arch/luna68k/stand/boot/version	Mon 

CVS commit: othersrc/external/bsd/netdiff/dist

2013-01-13 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Jan 14 01:54:23 UTC 2013

Modified Files:
othersrc/external/bsd/netdiff/dist: diffreg.c netwdiff.1

Log Message:
Get rid of the pseudo 8-bit ASCII 4 EVAH! character translation
tables to perform case-insensitive comparisons.  For now, we just use
the ctype.h tolower(3) macro to obtain lower case.  Definitely an area
for future development.

No functional changes, all test s run to completion and pass, so there
are no regressions.

Sync the wdiff(1) man page with reality in the RETURN VALUES section.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/netdiff/dist/diffreg.c
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/netdiff/dist/netwdiff.1

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

Modified files:

Index: othersrc/external/bsd/netdiff/dist/diffreg.c
diff -u othersrc/external/bsd/netdiff/dist/diffreg.c:1.4 othersrc/external/bsd/netdiff/dist/diffreg.c:1.5
--- othersrc/external/bsd/netdiff/dist/diffreg.c:1.4	Sun Jan 13 22:17:22 2013
+++ othersrc/external/bsd/netdiff/dist/diffreg.c	Mon Jan 14 01:54:23 2013
@@ -247,9 +247,8 @@ typedef struct stone_t {
 	int		 suff;		/* length of prefix and suffix */
 	int		 changec;	/* # of changes */
 	size_t		 candc;
-	candidate_t	*candlist;		/* merely a free storage pot for candidates */
+	candidate_t	*candlist;	/* merely a free storage pot for candidates */
 	size_t		 candlistlen;	/* the length of candlist */
-	uint8_t		*chrtran;	/* translation table for case-folding */
 	diffrange_t	*context_vec_start;
 	diffrange_t	*context_vec_end;
 	diffrange_t	*context_vec_ptr;
@@ -259,72 +258,15 @@ typedef struct stone_t {
 	size_t		 max_context;
 } stone_t;
 
-/*
- * chrtran points to one of 2 translation tables: cup2low if folding upper to
- * lower case clow2low if not folding case
- */
-static uint8_t clow2low[256] = {
-	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
-	0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
-	0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
-	0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
-	0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
-	0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41,
-	0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c,
-	0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-	0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62,
-	0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d,
-	0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
-	0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83,
-	0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e,
-	0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
-	0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4,
-	0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
-	0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba,
-	0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5,
-	0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
-	0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb,
-	0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
-	0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1,
-	0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc,
-	0xfd, 0xfe, 0xff
-};
-
-static uint8_t cup2low[256] = {
-	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
-	0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
-	0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
-	0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
-	0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
-	0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x60, 0x61,
-	0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c,
-	0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
-	0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x60, 0x61, 0x62,
-	0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d,
-	0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
-	0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83,
-	0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e,
-	0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
-	0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4,
-	0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
-	0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba,
-	0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5,
-	0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
-	0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb,
-	0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 

CVS commit: src/doc

2013-01-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jan 14 02:17:45 UTC 2013

Modified Files:
src/doc: CHANGES

Log Message:
Note luna68k bootloader updates.


To generate a diff of this commit:
cvs rdiff -u -r1.1780 -r1.1781 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/CHANGES
diff -u src/doc/CHANGES:1.1780 src/doc/CHANGES:1.1781
--- src/doc/CHANGES:1.1780	Sat Jan 12 22:28:40 2013
+++ src/doc/CHANGES	Mon Jan 14 02:17:45 2013
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1780 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1781 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -172,3 +172,6 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 	kernel: Add usmsc(4), a driver for SMSC LAN95xx USB LAN devices, 
 		ported from OpenBSD. [skrll 20130109]
 	arm: kill userland FPA support, replace with VFP. [matt 20130111]
+	luna68k: Add netboot support. [tsutsui 20130113]
+	luna68k: Fix bootloader to make secondary SPC SCSI on LUNA-II work
+		properly.  [tsutsui 20130114]



CVS commit: src/usr.sbin/syslogd

2013-01-13 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jan 14 03:05:41 UTC 2013

Modified Files:
src/usr.sbin/syslogd: syslogd.8

Log Message:
fix thinko


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/syslogd/syslogd.8

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/syslogd/syslogd.8
diff -u src/usr.sbin/syslogd/syslogd.8:1.53 src/usr.sbin/syslogd/syslogd.8:1.54
--- src/usr.sbin/syslogd/syslogd.8:1.53	Tue Oct 30 23:03:02 2012
+++ src/usr.sbin/syslogd/syslogd.8	Mon Jan 14 03:05:41 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: syslogd.8,v 1.53 2012/10/30 23:03:02 wiz Exp $
+.\	$NetBSD: syslogd.8,v 1.54 2013/01/14 03:05:41 dholland Exp $
 .\
 .\ Copyright (c) 1983, 1986, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -95,7 +95,7 @@ Multiple
 options create multiple log sockets.
 If no
 .Fl p
-arguments are created, the default socket of
+arguments are given, the default socket of
 .Pa /var/run/log
 is used.
 .It Fl r



CVS commit: othersrc/external/bsd/netdiff/dist

2013-01-13 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Jan 14 05:20:40 UTC 2013

Modified Files:
othersrc/external/bsd/netdiff/dist: diffreg.c

Log Message:
minor cosmetics - also ignore case if we're using our (abstracted) fread()
eqivalent function, not just in the single character case. This wouldn't
have produced wrong results, but would have made it much more inefficient,
since the initial do files differ? question would have given a false
positive.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/netdiff/dist/diffreg.c

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

Modified files:

Index: othersrc/external/bsd/netdiff/dist/diffreg.c
diff -u othersrc/external/bsd/netdiff/dist/diffreg.c:1.5 othersrc/external/bsd/netdiff/dist/diffreg.c:1.6
--- othersrc/external/bsd/netdiff/dist/diffreg.c:1.5	Mon Jan 14 01:54:23 2013
+++ othersrc/external/bsd/netdiff/dist/diffreg.c	Mon Jan 14 05:20:40 2013
@@ -353,15 +353,25 @@ diff_ftell(file_t *f)
 }
 
 static size_t
-diff_fread(void *ptr, size_t size, size_t c, file_t *f)
+diff_fread(diff_t *diff, void *ptr, size_t size, size_t c, file_t *f)
 {
+	size_t	cc;
+	size_t	i;
+	char	*p;
+
 	if (f-mapped) {
 		memcpy(ptr, f-mapped[f-curpos], c * size);
 		f-curpos += (c * size);
-		return c;
+		cc = c;
 	} else {
-		return fread(ptr, size, c, f-fp);
+		cc = fread(ptr, size, c, f-fp);
 	}
+	if (DIFF_GET_FLAG(diff, 'i')) {
+		for (i = 0, p = ptr ; i  cc ; i++) {
+			p[i] = tolower((uint8_t)p[i]);
+		}
+	}
+	return cc;
 }
 
 static int
@@ -420,27 +430,27 @@ diff_fsetpos(file_t *f, const fpos_t *po
 static int
 files_differ(diff_t *diff, file_t *f, int flags)
 {
-	char buf1[BUFSIZ], buf2[BUFSIZ];
-	size_t i, j;
+	size_t	cc[2];
+	char	buf1[BUFSIZ * 10];
+	char	buf2[BUFSIZ * 10];
 
 	if ((flags  (D_EMPTY1|D_EMPTY2)) || diff-st[0].st_size != diff-st[1].st_size ||
 	(diff-st[0].st_mode  S_IFMT) != (diff-st[1].st_mode  S_IFMT)) {
 		return 1;
 	}
 	for (;;) {
-		i = diff_fread(buf1, 1, sizeof(buf1), f[0]);
-		j = diff_fread(buf2, 1, sizeof(buf2), f[1]);
-		
-		if (i != j) {
+		cc[0] = diff_fread(diff, buf1, 1, sizeof(buf1), f[0]);
+		cc[1] = diff_fread(diff, buf2, 1, sizeof(buf2), f[1]);
+		if (cc[0] != cc[1]) {
 			return 1;
 		}
-		if (i == 0  j == 0) {
+		if (cc[0] == 0  cc[1] == 0) {
 			if (diff_ferror(f[0]) || diff_ferror(f[1])) {
 return 1;
 			}
 			return 0;
 		}
-		if (memcmp(buf1, buf2, i) != 0) {
+		if (memcmp(buf1, buf2, cc[0]) != 0) {
 			return 1;
 		}
 	}
@@ -1057,7 +1067,7 @@ print_context_header(diff_t *diff, const
 #define ISIDENT(x)	(isalpha((uint8_t)x) || (x) == '_' || (x) == '$')
 
 static char *
-match_function(stone_t *s, const long *offsets, int lineno, file_t *f)
+match_function(diff_t *diff, stone_t *s, const long *offsets, int lineno, file_t *f)
 {
 	const char	*state;
 	size_t		 nc;
@@ -1072,7 +1082,7 @@ match_function(stone_t *s, const long *o
 		if (nc = sizeof(buf)) {
 			nc = sizeof(buf) - 1;
 		}
-		nc = diff_fread(buf, 1, nc, f);
+		nc = diff_fread(diff, buf, 1, nc, f);
 		if (nc  0) {
 			buf[nc] = '\0';
 			buf[strcspn(buf, \n)] = '\0';
@@ -1241,7 +1251,7 @@ dump_context_vec(diff_t *diff, stone_t *
 
 	diff_printf(diff, ***);
 	if (SHOW_C_FUNCTION(diff)) {
-		func = match_function(s, f[0].offsets, lowa-1, f[0]);
+		func = match_function(diff, s, f[0].offsets, lowa-1, f[0]);
 		if (func != NULL) {
 			diff_printf(diff,  %s, func);
 		}
@@ -1343,7 +1353,7 @@ dump_unified_vec(diff_t *diff, stone_t *
 	uni_range(diff, lowc, upd);
 	diff_printf(diff,  @@);
 	if (SHOW_C_FUNCTION(diff)) {
-		func = match_function(s, f[0].offsets, lowa-1, f[0]);
+		func = match_function(diff, s, f[0].offsets, lowa-1, f[0]);
 		if (func != NULL) {
 			diff_printf(diff,  %s, func);
 		}