CVS commit: src/usr.bin/config

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 13:53:36 UTC 2015

Modified Files:
src/usr.bin/config: defs.h files.c main.c mkdevsw.c mkheaders.c
mkioconf.c mkswap.c

Log Message:
After thought, revert "Generate *.c files under conf/".  Generate *.c files
under top build directory.  *.c files are never placed just under $S/.  Keep
this exclusiveness.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/config/defs.h
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/config/files.c
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/config/main.c
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/config/mkdevsw.c
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/config/mkheaders.c
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/config/mkioconf.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/config/mkswap.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/config/defs.h
diff -u src/usr.bin/config/defs.h:1.88 src/usr.bin/config/defs.h:1.89
--- src/usr.bin/config/defs.h:1.88	Thu Sep  3 09:28:00 2015
+++ src/usr.bin/config/defs.h	Thu Sep  3 13:53:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.88 2015/09/03 09:28:00 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.89 2015/09/03 13:53:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -433,8 +433,6 @@ struct	nvlist *machinesubarches;
 const char *ioconfname;		/* ioconf name, mutually exclusive to machine */
 const char *srcdir;		/* path to source directory (rel. to build) */
 const char *builddir;		/* path to build directory */
-int	builddirfd;		/* dir fd of builddir */
-int	buildconfdirfd;		/* dir fd of builddir/conf */
 const char *defbuilddir;	/* default build directory */
 const char *ident;		/* kernel "ident"ification string */
 int	errors;			/* counts calls to error() */

Index: src/usr.bin/config/files.c
diff -u src/usr.bin/config/files.c:1.27 src/usr.bin/config/files.c:1.28
--- src/usr.bin/config/files.c:1.27	Wed Sep  2 05:09:25 2015
+++ src/usr.bin/config/files.c	Thu Sep  3 13:53:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: files.c,v 1.27 2015/09/02 05:09:25 uebayasi Exp $	*/
+/*	$NetBSD: files.c,v 1.28 2015/09/03 13:53:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: files.c,v 1.27 2015/09/02 05:09:25 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.28 2015/09/03 13:53:36 uebayasi Exp $");
 
 #include 
 #include 
@@ -278,15 +278,13 @@ fixfiles(void)
  		struct config *cf;
  		char swapname[100];
 
-		buildprefix_push("conf");
-		addfile("conf/devsw.c", NULL, 0, NULL);
-		addfile("conf/ioconf.c", NULL, 0, NULL);
+		addfile("devsw.c", NULL, 0, NULL);
+		addfile("ioconf.c", NULL, 0, NULL);
  		TAILQ_FOREACH(cf, , cf_next) {
- 			(void)snprintf(swapname, sizeof(swapname), "conf/swap%s.c",
+ 			(void)snprintf(swapname, sizeof(swapname), "swap%s.c",
  			cf->cf_name);
  			addfile(intern(swapname), NULL, 0, NULL);
  		}
-		buildprefix_pop();
 	}
 
 	err = 0;

Index: src/usr.bin/config/main.c
diff -u src/usr.bin/config/main.c:1.87 src/usr.bin/config/main.c:1.88
--- src/usr.bin/config/main.c:1.87	Thu Sep  3 06:08:38 2015
+++ src/usr.bin/config/main.c	Thu Sep  3 13:53:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.87 2015/09/03 06:08:38 uebayasi Exp $	*/
+/*	$NetBSD: main.c,v 1.88 2015/09/03 13:53:36 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: main.c,v 1.87 2015/09/03 06:08:38 uebayasi Exp $");
+__RCSID("$NetBSD: main.c,v 1.88 2015/09/03 13:53:36 uebayasi Exp $");
 
 #ifndef MAKE_BOOTSTRAP
 #include 
@@ -100,8 +100,6 @@ extern int yydebug;
 #endif
 int	dflag;
 
-static const char *buildconfdir = ".";
-
 static struct dlhash *obsopttab;
 static struct hashtab *mkopttab;
 static struct nvlist **nextopt;
@@ -530,9 +528,6 @@ main(int argc, char **argv)
 	(void)printf("Build directory is %s\n", builddir);
 	(void)printf("Don't forget to run \"make depend\"\n");
 
-	close(buildconfdirfd);
-	close(builddirfd);
-
 	return 0;
 }
 
@@ -702,7 +697,6 @@ mkallsubdirs(void)
 
 	mksubdirs();
 	mksubdirs();
-	buildconfdir = "conf";
 	return 0;
 }
 
@@ -720,9 +714,6 @@ mksymlinks(void)
 
 	p = buf;
 
-	if ((buildconfdirfd = open(buildconfdir, O_RDONLY)) == -1)
-		errx(EXIT_FAILURE, "cannot opens %s", buildconfdir);
-
 	snprintf(buf, sizeof(buf), "%s/arch/%s/include", srcdir, machine);
 	ret = recreate(p, "machine");
 	ret = recreate(p, machine);
@@ -1498,8 +1489,6 @@ setupdirs(void)
 			errx(EXIT_FAILURE, "cannot create %s", builddir);
 	} else if (!S_ISDIR(st.st_mode))
 		errx(EXIT_FAILURE, "%s is not a directory", builddir);
-	if ((builddirfd = open(builddir, O_RDONLY)) == -1)
-		errx(EXIT_FAILURE, "cannot opens %s", builddir);
 	if (chdir(builddir) == -1)
 		err(EXIT_FAILURE, "cannot change to %s", builddir);
 	if (stat(srcdir, ) == -1)

Index: src/usr.bin/config/mkdevsw.c
diff -u src/usr.bin/config/mkdevsw.c:1.13 

CVS commit: src

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 14:23:52 UTC 2015

Modified Files:
src/sys/conf: Makefile.kern.inc files
src/usr.bin/config: defs.h files.c

Log Message:
Add generated *.c files (devsw.c and ioconf.c) to ${CFILES} by config(1)
internally.  ${MI_CFILES} in Makefile.kern.inc is no longer needed.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/sys/conf/Makefile.kern.inc
cvs rdiff -u -r1.1148 -r1.1149 src/sys/conf/files
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/config/defs.h
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/config/files.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/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.235 src/sys/conf/Makefile.kern.inc:1.236
--- src/sys/conf/Makefile.kern.inc:1.235	Thu Sep  3 12:31:16 2015
+++ src/sys/conf/Makefile.kern.inc	Thu Sep  3 14:23:52 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.235 2015/09/03 12:31:16 uebayasi Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.236 2015/09/03 14:23:52 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -195,15 +195,11 @@ SYSLIBCOMPATLN?=	${COMPATLIBLN}
 ##
 
 .if !defined(___USE_SUFFIX_RULES___)
-MI_CFILES=	devsw.c ioconf.c
 _MD_OBJS=	${MD_OBJS:T}
 .else
 _MD_OBJS=	${MD_OBJS}
 .endif
 
-# the need for a MI_SFILES variable is dubitable at best
-MI_OBJS=${MI_CFILES:S/.c/.o/}
-
 ##
 ## (5) link settings
 ##
@@ -215,7 +211,7 @@ MI_OBJS=${MI_CFILES:S/.c/.o/}
 # load lines for config "xxx" will be emitted as:
 # xxx: ${SYSTEM_DEP} swap.o vers.o build_kernel
 
-SYSTEM_OBJ?=	${_MD_OBJS} ${MI_OBJS} ${OBJS} ${SYSLIBCOMPAT} ${LIBKERN}
+SYSTEM_OBJ?=	${_MD_OBJS} ${OBJS} ${SYSLIBCOMPAT} ${LIBKERN}
 SYSTEM_DEP+=	Makefile ${SYSTEM_OBJ}
 .if defined(CTFMERGE)
 SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
@@ -404,7 +400,7 @@ dependall: depend .WAIT all
 MKDEP_AFLAGS?=	${AFLAGS}
 MKDEP_CFLAGS?=	${CFLAGS}
 SSRCS=${_MD_SFILES} ${_SFILES}
-CSRCS=${_MD_CFILES} ${MI_CFILES} ${_CFILES}
+CSRCS=${_MD_CFILES} ${_CFILES}
 SRCS=${SSRCS} ${CSRCS}
 .if !defined(___USE_SUFFIX_RULES___)
 DEPS=	${SRCS:T:u:R:S/$/.d/g}

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1148 src/sys/conf/files:1.1149
--- src/sys/conf/files:1.1148	Thu Sep  3 09:28:00 2015
+++ src/sys/conf/files	Thu Sep  3 14:23:52 2015
@@ -1,7 +1,7 @@
-#	$NetBSD: files,v 1.1148 2015/09/03 09:28:00 uebayasi Exp $
+#	$NetBSD: files,v 1.1149 2015/09/03 14:23:52 uebayasi Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
-version 	20150844
+version 	20150845
 
 #
 # device classes

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.89 src/usr.bin/config/defs.h:1.90
--- src/usr.bin/config/defs.h:1.89	Thu Sep  3 13:53:36 2015
+++ src/usr.bin/config/defs.h	Thu Sep  3 14:23:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.89 2015/09/03 13:53:36 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.90 2015/09/03 14:23:52 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -107,7 +107,7 @@ extern const char *progname;
  * The next two lines define the current version of the config(1) binary,
  * and the minimum version of the configuration files it supports.
  */
-#define CONFIG_VERSION		20150844
+#define CONFIG_VERSION		20150845
 #define CONFIG_MINVERSION	0
 
 /*

Index: src/usr.bin/config/files.c
diff -u src/usr.bin/config/files.c:1.28 src/usr.bin/config/files.c:1.29
--- src/usr.bin/config/files.c:1.28	Thu Sep  3 13:53:36 2015
+++ src/usr.bin/config/files.c	Thu Sep  3 14:23:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: files.c,v 1.28 2015/09/03 13:53:36 uebayasi Exp $	*/
+/*	$NetBSD: files.c,v 1.29 2015/09/03 14:23:52 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: files.c,v 1.28 2015/09/03 13:53:36 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.29 2015/09/03 14:23:52 uebayasi Exp $");
 
 #include 
 #include 
@@ -274,12 +274,13 @@ fixfiles(void)
 	struct nvlist *flathead, **flatp;
 	int err, sel;
 
+	addfile("devsw.c", NULL, 0, NULL);
+	addfile("ioconf.c", NULL, 0, NULL);
+
 	if (Sflag) {
  		struct config *cf;
  		char swapname[100];
 
-		addfile("devsw.c", NULL, 0, NULL);
-		addfile("ioconf.c", NULL, 0, NULL);
  		TAILQ_FOREACH(cf, , cf_next) {
  			(void)snprintf(swapname, sizeof(swapname), "swap%s.c",
  			cf->cf_name);



CVS commit: src/lib/libc/net

2015-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  3 15:01:19 UTC 2015

Modified Files:
src/lib/libc/net: getnameinfo.c

Log Message:
PR/50195: Henning Petersen: Incorrect check in getnameinfo_link.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/lib/libc/net/getnameinfo.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/net/getnameinfo.c
diff -u src/lib/libc/net/getnameinfo.c:1.56 src/lib/libc/net/getnameinfo.c:1.57
--- src/lib/libc/net/getnameinfo.c:1.56	Fri May 15 10:26:02 2015
+++ src/lib/libc/net/getnameinfo.c	Thu Sep  3 11:01:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: getnameinfo.c,v 1.56 2015/05/15 14:26:02 joerg Exp $	*/
+/*	$NetBSD: getnameinfo.c,v 1.57 2015/09/03 15:01:19 christos Exp $	*/
 /*	$KAME: getnameinfo.c,v 1.45 2000/09/25 22:43:56 itojun Exp $	*/
 
 /*
@@ -47,7 +47,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getnameinfo.c,v 1.56 2015/05/15 14:26:02 joerg Exp $");
+__RCSID("$NetBSD: getnameinfo.c,v 1.57 2015/09/03 15:01:19 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION
@@ -536,11 +536,7 @@ getnameinfo_link(const struct sockaddr *
 
 	if (sdl->sdl_nlen == 0 && sdl->sdl_alen == 0 && sdl->sdl_slen == 0) {
 		n = snprintf(host, hostlen, "link#%u", sdl->sdl_index);
-		if (n < 0 || (socklen_t) n > hostlen) {
-			*host = '\0';
-			return EAI_MEMORY;
-		}
-		return 0;
+		goto out;
 	}
 
 	switch (sdl->sdl_type) {
@@ -553,11 +549,7 @@ getnameinfo_link(const struct sockaddr *
 		else
 			n = snprintf(host, hostlen, "%u.%u",
 			CLLADDR(sdl)[1], CLLADDR(sdl)[0]);
-		if (n < 0 || (socklen_t) n >= hostlen) {
-			*host = '\0';
-			return EAI_MEMORY;
-		} else
-			return 0;
+		goto out;
 #endif
 	case IFT_IEEE1394:
 		if (sdl->sdl_alen < sizeof(iha->iha_uid))
@@ -591,6 +583,12 @@ getnameinfo_link(const struct sockaddr *
 		return hexname((const uint8_t *)CLLADDR(sdl),
 		(size_t)sdl->sdl_alen, host, hostlen);
 	}
+out:
+	if (n < 0 || (socklen_t) n >= hostlen) {
+		*host = '\0';
+		return EAI_MEMORY;
+	}
+	return 0;
 }
 
 static int



CVS commit: src/sys/arch/sparc64/dev

2015-09-03 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Thu Sep  3 19:43:35 UTC 2015

Modified Files:
src/sys/arch/sparc64/dev: iommu.c iommuvar.h vpci.c

Log Message:
sun4v: iommu setup seems to work now - device detection is now possible - parts 
from OpenBSD - ok mrg@, martin@


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/sparc64/dev/iommu.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sparc64/dev/iommuvar.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc64/dev/vpci.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/sparc64/dev/iommu.c
diff -u src/sys/arch/sparc64/dev/iommu.c:1.108 src/sys/arch/sparc64/dev/iommu.c:1.109
--- src/sys/arch/sparc64/dev/iommu.c:1.108	Sun Aug 24 19:09:43 2014
+++ src/sys/arch/sparc64/dev/iommu.c	Thu Sep  3 19:43:35 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: iommu.c,v 1.108 2014/08/24 19:09:43 palle Exp $	*/
+/*	$NetBSD: iommu.c,v 1.109 2015/09/03 19:43:35 palle Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.108 2014/08/24 19:09:43 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.109 2015/09/03 19:43:35 palle Exp $");
 
 #include "opt_ddb.h"
 
@@ -101,6 +101,10 @@ int iommudebug = 0x0;
 static	int iommu_strbuf_flush_done(struct strbuf_ctl *);
 static	void _iommu_dvmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t,
 		bus_size_t, int);
+static void iommu_enter_sun4u(struct strbuf_ctl *sb, vaddr_t va, int64_t pa, int flags);
+static void iommu_enter_sun4v(struct strbuf_ctl *sb, vaddr_t va, int64_t pa, int flags);
+static void iommu_remove_sun4u(struct iommu_state *is, vaddr_t va, size_t len);
+static void iommu_remove_sun4v(struct iommu_state *is, vaddr_t va, size_t len);
 
 /*
  * initialise the UltraSPARC IOMMU (SBUS or PCI):
@@ -118,6 +122,8 @@ iommu_init(char *name, struct iommu_stat
 	struct vm_page *pg;
 	struct pglist pglist;
 
+	DPRINTF(IDB_INFO, ("iommu_init: tsbsize %x iovabase %x\n", tsbsize, iovabase));
+	
 	/*
 	 * Setup the iommu.
 	 *
@@ -181,17 +187,18 @@ iommu_init(char *name, struct iommu_stat
 	if (iommudebug & IDB_INFO)
 	{
 		/* Probe the iommu */
-
-		printf("iommu cr=%llx tsb=%llx\n",
-			(unsigned long long)bus_space_read_8(is->is_bustag,
+		if (!CPU_ISSUN4V) {
+			printf("iommu cr=%llx tsb=%llx\n",
+			(unsigned long long)bus_space_read_8(is->is_bustag,
 is->is_iommu,
 offsetof(struct iommureg, iommu_cr)),
-			(unsigned long long)bus_space_read_8(is->is_bustag,
+			(unsigned long long)bus_space_read_8(is->is_bustag,
 is->is_iommu,
 offsetof(struct iommureg, iommu_tsb)));
-		printf("TSB base %p phys %llx\n", (void *)is->is_tsb,
-			(unsigned long long)is->is_ptsb);
-		delay(100); /* 1 s */
+			printf("TSB base %p phys %llx\n", (void *)is->is_tsb,
+			(unsigned long long)is->is_ptsb);
+			delay(100); /* 1 s */
+		}
 	}
 #endif
 
@@ -207,8 +214,9 @@ iommu_init(char *name, struct iommu_stat
 	is->is_dvmamap = extent_create(name,
 	is->is_dvmabase, is->is_dvmaend,
 	0, 0, EX_NOWAIT);
-	/* XXXMRG Check is_dvmamap is valid. */
-
+	if (!is->is_dvmamap)
+		panic("iommu_init: extent_create() failed");
+	  
 	mutex_init(>is_lock, MUTEX_DEFAULT, IPL_HIGH);
 
 	/*
@@ -237,6 +245,9 @@ iommu_reset(struct iommu_state *is)
 	int i;
 	struct strbuf_ctl *sb;
 
+	if (CPU_ISSUN4V)
+		return;
+	
 	IOMMUREG_WRITE(is, iommu_tsb, is->is_ptsb);
 
 	/* Enable IOMMU in diagnostic mode */
@@ -276,9 +287,22 @@ iommu_reset(struct iommu_state *is)
 /*
  * Here are the iommu control routines.
  */
+
 void
 iommu_enter(struct strbuf_ctl *sb, vaddr_t va, int64_t pa, int flags)
 {
+	DPRINTF(IDB_IOMMU, ("iommu_enter: va %lx pa %lx flags %x\n",
+	va, (long)pa, flags));
+	if (!CPU_ISSUN4V)
+		iommu_enter_sun4u(sb, va, pa, flags);
+	else
+		iommu_enter_sun4v(sb, va, pa, flags);
+}
+
+
+void
+iommu_enter_sun4u(struct strbuf_ctl *sb, vaddr_t va, int64_t pa, int flags)
+{
 	struct iommu_state *is = sb->sb_is;
 	int strbuf = (flags & BUS_DMA_STREAMING);
 	int64_t tte;
@@ -311,6 +335,35 @@ iommu_enter(struct strbuf_ctl *sb, vaddr
 		(u_long)tte));
 }
 
+void
+iommu_enter_sun4v(struct strbuf_ctl *sb, vaddr_t va, int64_t pa, int flags)
+{
+	struct iommu_state *is = sb->sb_is;
+	u_int64_t tsbid = IOTSBSLOT(va, is->is_tsbsize);
+	paddr_t page_list[1], addr;
+	u_int64_t attr, nmapped;
+	int err;
+
+#ifdef DIAGNOSTIC
+	if (va < is->is_dvmabase || (va + PAGE_MASK) > is->is_dvmaend)
+		panic("viommu_enter: va %#lx not in DVMA space", va);
+#endif
+
+	attr = PCI_MAP_ATTR_READ | PCI_MAP_ATTR_WRITE;
+	if (flags & BUS_DMA_READ)
+		attr &= ~PCI_MAP_ATTR_READ;
+	if (flags & BUS_DMA_WRITE)
+		attr &= ~PCI_MAP_ATTR_WRITE;
+
+	page_list[0] = trunc_page(pa);
+	if (!pmap_extract(pmap_kernel(), (vaddr_t)page_list, ))
+		panic("viommu_enter: pmap_extract failed");
+	err = hv_pci_iommu_map(is->is_devhandle, tsbid, 1, attr,
+	addr, );
+	if (err != 

CVS commit: src/include/ssp

2015-09-03 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Thu Sep  3 20:43:47 UTC 2015

Modified Files:
src/include/ssp: ssp.h

Log Message:
correct __ssp_overlap() to not trigger for adjacent areas


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/include/ssp/ssp.h

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

Modified files:

Index: src/include/ssp/ssp.h
diff -u src/include/ssp/ssp.h:1.12 src/include/ssp/ssp.h:1.13
--- src/include/ssp/ssp.h:1.12	Thu Jun 25 18:41:03 2015
+++ src/include/ssp/ssp.h	Thu Sep  3 20:43:47 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssp.h,v 1.12 2015/06/25 18:41:03 joerg Exp $	*/
+/*	$NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@ __ssp_inline rtype fun args { \
 __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0)
 
 #define __ssp_overlap(a, b, l) \
-(((a) <= (b) && (b) <= (a) + (l)) || ((b) <= (a) && (a) <= (b) + (l)))
+(((a) <= (b) && (b) < (a) + (l)) || ((b) <= (a) && (a) < (b) + (l)))
 
 __BEGIN_DECLS
 void __stack_chk_fail(void) __dead;



CVS commit: src/usr.bin/config

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 06:08:38 UTC 2015

Modified Files:
src/usr.bin/config: main.c

Log Message:
Fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/config/main.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/config/main.c
diff -u src/usr.bin/config/main.c:1.86 src/usr.bin/config/main.c:1.87
--- src/usr.bin/config/main.c:1.86	Thu Sep  3 02:45:24 2015
+++ src/usr.bin/config/main.c	Thu Sep  3 06:08:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.86 2015/09/03 02:45:24 uebayasi Exp $	*/
+/*	$NetBSD: main.c,v 1.87 2015/09/03 06:08:38 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: main.c,v 1.86 2015/09/03 02:45:24 uebayasi Exp $");
+__RCSID("$NetBSD: main.c,v 1.87 2015/09/03 06:08:38 uebayasi Exp $");
 
 #ifndef MAKE_BOOTSTRAP
 #include 
@@ -653,7 +653,7 @@ static int
 mksubdirs(struct filelist *fl)
 {
 	struct files *fi;
-	const char *prefix, *sep;
+	const char *prologue, *prefix, *sep;
 	char buf[MAXPATHLEN];
 
 	TAILQ_FOREACH(fi, fl, fi_next) {
@@ -674,7 +674,6 @@ mksubdirs(struct filelist *fl)
 			continue;
 		mksubdir(buf);
 		if (fi->fi_prefix != NULL && fi->fi_buildprefix != NULL) {
-			const char *prologue, *sep;
 			char org[MAXPATHLEN];
 
 			if (fi->fi_prefix[0] == '/') {
@@ -704,6 +703,7 @@ mkallsubdirs(void)
 	mksubdirs();
 	mksubdirs();
 	buildconfdir = "conf";
+	return 0;
 }
 
 /*



CVS commit: src/sys/conf

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 06:10:53 UTC 2015

Modified Files:
src/sys/conf: Makefile.kern.inc

Log Message:
Sort dependendy to keep alphabetical build order.


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.231 src/sys/conf/Makefile.kern.inc:1.232
--- src/sys/conf/Makefile.kern.inc:1.231	Thu Sep  3 06:09:46 2015
+++ src/sys/conf/Makefile.kern.inc	Thu Sep  3 06:10:53 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.231 2015/09/03 06:09:46 uebayasi Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.232 2015/09/03 06:10:53 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -343,7 +343,7 @@ _NVFLAGS=${NVFLAGS}
 
 .if !target(vers.o)
 newvers: vers.o
-vers.o: ${SYSTEM_OBJ} Makefile $S/conf/newvers.sh \
+vers.o: ${SYSTEM_OBJ:O} Makefile $S/conf/newvers.sh \
 		$S/conf/osrelease.sh ${_NETBSD_VERSION_DEPENDS}
 	${_MKMSG_CREATE} vers.c
 	${HOST_SH} $S/conf/newvers.sh ${_NVFLAGS}
@@ -494,7 +494,7 @@ CPPFLAGS+=	${CPPFLAGS.${.IMPSRC:T}}
 CWARNFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
 
 .for k in ${KERNELS}
-${k}: ${SYSTEM_DEP} vers.o build_kernel
+${k}: ${SYSTEM_DEP:O} vers.o build_kernel
 .endfor
 
 .if !defined(COPY_SYMTAB)



CVS commit: src

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 06:09:46 UTC 2015

Modified Files:
src/sys/conf: Makefile.kern.inc files
src/usr.bin/config: defs.h mkmakefile.c

Log Message:
Define kernel dependency in Makefile.kern.inc.


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/sys/conf/Makefile.kern.inc
cvs rdiff -u -r1.1146 -r1.1147 src/sys/conf/files
cvs rdiff -u -r1.86 -r1.87 src/usr.bin/config/defs.h
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/config/mkmakefile.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/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.230 src/sys/conf/Makefile.kern.inc:1.231
--- src/sys/conf/Makefile.kern.inc:1.230	Thu Sep  3 04:17:55 2015
+++ src/sys/conf/Makefile.kern.inc	Thu Sep  3 06:09:46 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.230 2015/09/03 04:17:55 uebayasi Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.231 2015/09/03 06:09:46 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -493,6 +493,10 @@ CFLAGS+=	${COPTS.${.IMPSRC:T}} ${CPUFLAG
 CPPFLAGS+=	${CPPFLAGS.${.IMPSRC:T}}
 CWARNFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
 
+.for k in ${KERNELS}
+${k}: ${SYSTEM_DEP} vers.o build_kernel
+.endfor
+
 .if !defined(COPY_SYMTAB)
 build_kernel: .USE
 	${SYSTEM_LD_HEAD}

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1146 src/sys/conf/files:1.1147
--- src/sys/conf/files:1.1146	Wed Sep  2 14:17:03 2015
+++ src/sys/conf/files	Thu Sep  3 06:09:46 2015
@@ -1,7 +1,7 @@
-#	$NetBSD: files,v 1.1146 2015/09/02 14:17:03 uebayasi Exp $
+#	$NetBSD: files,v 1.1147 2015/09/03 06:09:46 uebayasi Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
-version 	20150842
+version 	20150843
 
 #
 # device classes

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.86 src/usr.bin/config/defs.h:1.87
--- src/usr.bin/config/defs.h:1.86	Wed Sep  2 14:17:03 2015
+++ src/usr.bin/config/defs.h	Thu Sep  3 06:09:46 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.86 2015/09/02 14:17:03 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.87 2015/09/03 06:09:46 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -107,7 +107,7 @@ extern const char *progname;
  * The next two lines define the current version of the config(1) binary,
  * and the minimum version of the configuration files it supports.
  */
-#define CONFIG_VERSION		20150842
+#define CONFIG_VERSION		20150843
 #define CONFIG_MINVERSION	0
 
 /*

Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.60 src/usr.bin/config/mkmakefile.c:1.61
--- src/usr.bin/config/mkmakefile.c:1.60	Wed Sep  2 16:29:44 2015
+++ src/usr.bin/config/mkmakefile.c	Thu Sep  3 06:09:46 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.60 2015/09/02 16:29:44 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.61 2015/09/03 06:09:46 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: mkmakefile.c,v 1.60 2015/09/02 16:29:44 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.61 2015/09/03 06:09:46 uebayasi Exp $");
 
 #include 
 #include 
@@ -572,8 +572,6 @@ emitload(FILE *fp)
 	 		cf->cf_name);
 		}
 		fprintf(fp, "KERNELS+=%s\n", cf->cf_name);
-		fprintf(fp, "%s: ${SYSTEM_DEP}%s vers.o build_kernel\n",
-		cf->cf_name, swapobj);
 	}
 	fputs("\n", fp);
 }



CVS commit: src/sys/conf

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 06:24:15 UTC 2015

Modified Files:
src/sys/conf: Makefile.kern.inc

Log Message:
Kernel depends on swap.o too.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.232 src/sys/conf/Makefile.kern.inc:1.233
--- src/sys/conf/Makefile.kern.inc:1.232	Thu Sep  3 06:10:53 2015
+++ src/sys/conf/Makefile.kern.inc	Thu Sep  3 06:24:15 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.232 2015/09/03 06:10:53 uebayasi Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.233 2015/09/03 06:24:15 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -494,7 +494,7 @@ CPPFLAGS+=	${CPPFLAGS.${.IMPSRC:T}}
 CWARNFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
 
 .for k in ${KERNELS}
-${k}: ${SYSTEM_DEP:O} vers.o build_kernel
+${k}: ${SYSTEM_DEP:O} swap${k}.o vers.o build_kernel
 .endfor
 
 .if !defined(COPY_SYMTAB)



CVS commit: src/libexec/talkd

2015-09-03 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Sep  3 08:16:36 UTC 2015

Modified Files:
src/libexec/talkd: table.c

Log Message:
Remove dead assignment; from Henning Petersen in PR 50196.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/libexec/talkd/table.c

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

Modified files:

Index: src/libexec/talkd/table.c
diff -u src/libexec/talkd/table.c:1.10 src/libexec/talkd/table.c:1.11
--- src/libexec/talkd/table.c:1.10	Mon Mar 16 01:13:38 2009
+++ src/libexec/talkd/table.c	Thu Sep  3 08:16:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: table.c,v 1.10 2009/03/16 01:13:38 lukem Exp $	*/
+/*	$NetBSD: table.c,v 1.11 2015/09/03 08:16:36 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)table.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: table.c,v 1.10 2009/03/16 01:13:38 lukem Exp $");
+__RCSID("$NetBSD: table.c,v 1.11 2015/09/03 08:16:36 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -199,7 +199,6 @@ delete_invite(uint32_t id_num)
 {
 	TABLE_ENTRY *ptr;
 
-	ptr = table;
 	if (debug)
 		syslog(LOG_DEBUG, "delete_invite(%"PRIu32")", id_num);
 	for (ptr = table; ptr != NIL; ptr = ptr->next) {



CVS commit: src

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 09:28:00 UTC 2015

Modified Files:
src/sys/conf: Makefile.kern.inc files
src/usr.bin/config: defs.h mkmakefile.c

Log Message:
Move `all' target definition to Makefile.kern.inc.


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/sys/conf/Makefile.kern.inc
cvs rdiff -u -r1.1147 -r1.1148 src/sys/conf/files
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/config/defs.h
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/config/mkmakefile.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/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.233 src/sys/conf/Makefile.kern.inc:1.234
--- src/sys/conf/Makefile.kern.inc:1.233	Thu Sep  3 06:24:15 2015
+++ src/sys/conf/Makefile.kern.inc	Thu Sep  3 09:28:00 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.233 2015/09/03 06:24:15 uebayasi Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.234 2015/09/03 09:28:00 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -213,7 +213,7 @@ MI_OBJS=${MI_CFILES:S/.c/.o/}
 # xxx: ${SYSTEM_DEP} swap.o vers.o build_kernel
 
 SYSTEM_OBJ?=	${MD_OBJS} ${MI_OBJS} ${OBJS} ${SYSLIBCOMPAT} ${LIBKERN}
-SYSTEM_DEP+=	Makefile ${SYSTEM_OBJ} .gdbinit
+SYSTEM_DEP+=	Makefile ${SYSTEM_OBJ}
 .if defined(CTFMERGE)
 SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
 .else
@@ -493,7 +493,10 @@ CFLAGS+=	${COPTS.${.IMPSRC:T}} ${CPUFLAG
 CPPFLAGS+=	${CPPFLAGS.${.IMPSRC:T}}
 CWARNFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
 
+.MAIN: all
+all: .gdbinit
 .for k in ${KERNELS}
+all: .WAIT ${k}
 ${k}: ${SYSTEM_DEP:O} swap${k}.o vers.o build_kernel
 .endfor
 

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1147 src/sys/conf/files:1.1148
--- src/sys/conf/files:1.1147	Thu Sep  3 06:09:46 2015
+++ src/sys/conf/files	Thu Sep  3 09:28:00 2015
@@ -1,7 +1,7 @@
-#	$NetBSD: files,v 1.1147 2015/09/03 06:09:46 uebayasi Exp $
+#	$NetBSD: files,v 1.1148 2015/09/03 09:28:00 uebayasi Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
-version 	20150843
+version 	20150844
 
 #
 # device classes

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.87 src/usr.bin/config/defs.h:1.88
--- src/usr.bin/config/defs.h:1.87	Thu Sep  3 06:09:46 2015
+++ src/usr.bin/config/defs.h	Thu Sep  3 09:28:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.87 2015/09/03 06:09:46 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.88 2015/09/03 09:28:00 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -107,7 +107,7 @@ extern const char *progname;
  * The next two lines define the current version of the config(1) binary,
  * and the minimum version of the configuration files it supports.
  */
-#define CONFIG_VERSION		20150843
+#define CONFIG_VERSION		20150844
 #define CONFIG_MINVERSION	0
 
 /*

Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.61 src/usr.bin/config/mkmakefile.c:1.62
--- src/usr.bin/config/mkmakefile.c:1.61	Thu Sep  3 06:09:46 2015
+++ src/usr.bin/config/mkmakefile.c	Thu Sep  3 09:28:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.61 2015/09/03 06:09:46 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.62 2015/09/03 09:28:00 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: mkmakefile.c,v 1.61 2015/09/03 06:09:46 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.62 2015/09/03 09:28:00 uebayasi Exp $");
 
 #include 
 #include 
@@ -534,19 +534,6 @@ emitload(FILE *fp)
 {
 	struct config *cf;
 
-	fputs(".MAIN: all\n", fp);
-	fputs("all:", fp);
-	TAILQ_FOREACH(cf, , cf_next) {
-		fprintf(fp, " %s", cf->cf_name);
-		/*
-		 * If we generate multiple configs inside the same build directory
-		 * with a parallel build, strange things may happen, so sequentialize
-		 * them.
-		 */
-		if (cf != TAILQ_LAST(,conftq))
-			fprintf(fp, " .WAIT");
-	}
-	fputs("\n\n", fp);
 	/*
 	 * Generate the backward-compatible "build_kernel" rule if
 	 * sys/conf/Makefile.kern.inc doesn't define any (pre-2014 Aug).



CVS commit: src/doc

2015-09-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  3 07:34:34 UTC 2015

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new bind


To generate a diff of this commit:
cvs rdiff -u -r1.1249 -r1.1250 src/doc/3RDPARTY
cvs rdiff -u -r1.2099 -r1.2100 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1249 src/doc/3RDPARTY:1.1250
--- src/doc/3RDPARTY:1.1249	Sat Aug 29 13:18:35 2015
+++ src/doc/3RDPARTY	Thu Sep  3 03:34:34 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1249 2015/08/29 17:18:35 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1250 2015/09/03 07:34:34 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -114,8 +114,8 @@ Notes:
 bc includes dc, both of which are in the NetBSD tree.
 
 Package:	bind [named and utils]
-Version:	9.10.2-P3
-Current Vers:	9.10.2-P3
+Version:	9.10.2-P4
+Current Vers:	9.10.2-P4
 Maintainer:	Paul Vixie <vi...@vix.com>
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2099 src/doc/CHANGES:1.2100
--- src/doc/CHANGES:1.2099	Wed Sep  2 14:53:30 2015
+++ src/doc/CHANGES	Thu Sep  3 03:34:34 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2099 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2100 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -195,3 +195,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	rtwn(4): Add a driver for Realtek RTL8188CE/RTL8192CE PCIe IEEE
 		802.11b/g/n wireless network devices, ported from OpenBSD.
 		[nonaka 20150827]
+	bind: Import version 9.10.2-P4. [christos 20150903]



CVS commit: src/tests/net/if

2015-09-03 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Sep  3 10:22:52 UTC 2015

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Add tests for ifconfig options

>From s-yamaguchi@IIJ (with some tweaks by me)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if/t_ifconfig.sh

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

Modified files:

Index: src/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.1 src/tests/net/if/t_ifconfig.sh:1.2
--- src/tests/net/if/t_ifconfig.sh:1.1	Wed Jul  1 08:33:31 2015
+++ src/tests/net/if/t_ifconfig.sh	Thu Sep  3 10:22:52 2015
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.1 2015/07/01 08:33:31 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.2 2015/09/03 10:22:52 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -71,8 +71,116 @@ create_destroy_cleanup()
 	RUMP_SERVER=${RUMP_SERVER1} rump.halt
 }
 
+atf_test_case options cleanup
+options_head()
+{
+
+	atf_set "descr" "tests of ifconfig options"
+	atf_set "require.progs" "rump_server"
+}
+
+options_body()
+{
+
+	export RUMP_SERVER=${RUMP_SERVER1}
+	atf_check -s exit:0 rump_server $RUMP_FLAGS $RUMP_SERVER1
+
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr bus1
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet 10.0.0.1/24
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 fc00::1/64
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
+	atf_check -s exit:0 -o ignore rump.ifconfig -w 10
+	$DEBUG && rump.ifconfig shmif0
+
+	# ifconfig [-N] interface address_family
+	#   -N resolves hostnames
+	atf_check -s exit:0 -o match:'inet 127.0.0.1' rump.ifconfig lo0 inet
+	atf_check -s exit:0 -o match:'inet localhost' rump.ifconfig -N lo0 inet
+	atf_check -s exit:0 -o match:'inet6 ::1' rump.ifconfig lo0 inet6
+	atf_check -s exit:0 -o match:'inet6 localhost' rump.ifconfig -N lo0 inet6
+	atf_check -s not-exit:0 -e match:'not supported' rump.ifconfig lo0 atalk
+	atf_check -s not-exit:0 -e match:'not supported' rump.ifconfig -N lo0 atalk
+	atf_check -s exit:0 -o ignore rump.ifconfig lo0 link
+	atf_check -s exit:0 -o ignore rump.ifconfig -N lo0 link
+
+	# ifconfig [-hLmNvz] interface
+	#   -h -v shows statistics in human readable format
+	atf_check -s exit:0 -o ignore rump.ifconfig -h -v lo0
+	#   -L shows IPv6 lifetime
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 fc00::2 \
+	pltime 100
+	$DEBUG && rump.ifconfig -L shmif0
+	atf_check -s exit:0 -o match:'pltime' rump.ifconfig -L shmif0
+	atf_check -s exit:0 -o match:'vltime' rump.ifconfig -L shmif0
+	#   -m shows all of the supported media (not supported in shmif)
+	$DEBUG && rump.ifconfig -m shmif0
+	atf_check -s exit:0 -o ignore rump.ifconfig -m shmif0
+	atf_check -s exit:0 -o match:'localhost' rump.ifconfig -N lo0
+	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -v lo0
+	atf_check -s exit:0 -o ignore rump.ping -c 1 localhost
+	#   -z clears and shows statistics at that point
+	atf_check -s exit:0 -o match:'2 packets' rump.ifconfig -z lo0
+	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -v lo0
+
+	# ifconfig -a [-bdhLNmsuvz]
+	#   -a shows all interfaces in the system
+	$DEBUG && rump.ifconfig -a
+	atf_check -s exit:0 -o match:'shmif0' -o match:'lo0' rump.ifconfig -a
+	#   -a -b shows only broadcast interfaces
+	atf_check -s exit:0 -o match:'shmif0' -o not-match:'lo0' rump.ifconfig -a -b
+	#   -a -d shows only down interfaces
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 down
+	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -a -d
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
+	atf_check -s exit:0 -o not-match:'shmif0' rump.ifconfig -a -d
+	atf_check -s exit:0 -o match:'pltime' rump.ifconfig -a -L
+	atf_check -s exit:0 -o match:'vltime' rump.ifconfig -a -L
+	atf_check -s exit:0 -o match:'localhost' rump.ifconfig -a -N
+	atf_check -s exit:0 -o ignore rump.ifconfig -a -m
+	#   -a -s shows only interfaces connected to a network
+	#   (shmif is always connected)
+	$DEBUG && rump.ifconfig -a -s
+	atf_check -s exit:0 -o ignore rump.ifconfig -a -s
+	#   -a -u shows only up interfaces
+	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -a -u
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 down
+	atf_check -s exit:0 -o not-match:'shmif0' rump.ifconfig -a -u
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
+	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -a -v
+	atf_check -s exit:0 -o ignore rump.ping -c 1 localhost
+	atf_check -s exit:0 -o match:'2 packets' rump.ifconfig -a -z
+	atf_check -s exit:0 -o not-match:'2 packets' rump.ifconfig -a -v
+
+	# ifconfig -l [-bdsu]
+	#   -l shows only inteface names
+	atf_check -s exit:0 -o match:'lo0 shmif0' rump.ifconfig -l
+	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l -b
+	atf_check -s exit:0 -o ignore 

CVS commit: src

2015-09-03 Thread Youri Mouton
Module Name:src
Committed By:   youri
Date:   Thu Sep  3 22:24:02 UTC 2015

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/xbase: mi
src/distrib/sets/lists/xetc: mi
src/etc/mtree: NetBSD.dist.Xorg NetBSD.dist.base
src/external/mit: Makefile
Added Files:
src/external/mit/ctwm: Makefile
src/external/mit/ctwm/bin: Makefile
src/external/mit/ctwm/bin/ctwm: Makefile

Log Message:
CTWM is an extension to twm, that support multiple virtual screens,
and a lot of other goodies.

You can use and manage up to 32 virtual screens called workspaces.
You swap from one workspace to another by clicking on a button in an
optional panel of buttons (the workspace manager) or by invoking a function.

You can custom each workspace by choosing different colors, names
and pixmaps for the buttons and background root windows.

Main features are:
- Optional 3D window titles and border (ala Motif).
- Shaped, colored icons.
- Multiple icons for clients based on the icon name.
- Windows can belong to several workspaces.
- A map of your workspaces to move quickly windows between
  different workspaces.
  - Animations: icons, root backgrounds and buttons can be animated.
  - Pinnable and sticky menus.
  - etc...

See http://web.zephyrite.net/NetBSD/wm/index.html
ok mrg.


To generate a diff of this commit:
cvs rdiff -u -r1.1113 -r1.1114 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.127 -r1.128 src/distrib/sets/lists/xbase/mi
cvs rdiff -u -r1.25 -r1.26 src/distrib/sets/lists/xetc/mi
cvs rdiff -u -r1.14 -r1.15 src/etc/mtree/NetBSD.dist.Xorg
cvs rdiff -u -r1.148 -r1.149 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.4 -r1.5 src/external/mit/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mit/ctwm/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mit/ctwm/bin/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mit/ctwm/bin/ctwm/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/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1113 src/distrib/sets/lists/base/mi:1.1114
--- src/distrib/sets/lists/base/mi:1.1113	Thu Aug 27 14:04:07 2015
+++ src/distrib/sets/lists/base/mi	Thu Sep  3 22:24:02 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1113 2015/08/27 14:04:07 nonaka Exp $
+# $NetBSD: mi,v 1.1114 2015/09/03 22:24:02 youri Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -84,6 +84,7 @@
 ./etc/X11/rstart/commands			base-x11-root
 ./etc/X11/rstart/commands/x11r6			base-x11-root
 ./etc/X11/rstart/contexts			base-x11-root
+./etc/X11/ctwm	base-x11-root
 ./etc/X11/twm	base-x11-root
 ./etc/X11/xdm	base-x11-root
 ./etc/X11/xinit	base-x11-root

Index: src/distrib/sets/lists/xbase/mi
diff -u src/distrib/sets/lists/xbase/mi:1.127 src/distrib/sets/lists/xbase/mi:1.128
--- src/distrib/sets/lists/xbase/mi:1.127	Sun Aug 23 18:28:40 2015
+++ src/distrib/sets/lists/xbase/mi	Thu Sep  3 22:24:02 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.127 2015/08/23 18:28:40 mrg Exp $
+# $NetBSD: mi,v 1.128 2015/09/03 22:24:02 youri Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1015,6 +1015,7 @@
 ./usr/X11R6/man/cat1/sxpm.0-unknown-	.cat,x11
 ./usr/X11R6/man/cat1/texteroids.0			-unknown-	.cat,x11
 ./usr/X11R6/man/cat1/twm.0-unknown-	.cat,x11
+./usr/X11R6/man/cat1/ctwm.0-unknown-	.cat,x11
 ./usr/X11R6/man/cat1/ucs2any.0-unknown-	.cat,x11
 ./usr/X11R6/man/cat1/viewres.0-unknown-	.cat,x11
 ./usr/X11R6/man/cat1/x11perf.0-unknown-	.cat,x11
@@ -1407,6 +1408,7 @@
 ./usr/X11R7/bin/startx	-unknown-	xorg
 ./usr/X11R7/bin/sxpm	-unknown-	xorg
 ./usr/X11R7/bin/twm	-unknown-	xorg
+./usr/X11R7/bin/ctwm	-unknown-	xorg
 ./usr/X11R7/bin/ucs2any	-unknown-	xorg
 ./usr/X11R7/bin/uxterm	-unknown-	xorg
 ./usr/X11R7/bin/viewres	-unknown-	xorg
@@ -1516,6 +1518,88 @@
 ./usr/X11R7/include/X11/pixmaps/NetBSD.xpm		-unknown-	xorg
 ./usr/X11R7/include/X11/pixmaps/xorg-bw.xpm		-unknown-	xorg
 ./usr/X11R7/include/X11/pixmaps/xorg.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwmbase-x11-root	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/skull.xpm		-unknown- xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3D_Expand15.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3D_Iconify15.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3D_Lightning15.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3D_Menu15.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3D_Resize15.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3D_Zoom15.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3dcircle.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3ddimple.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3ddot.xpm		-unknown-	xorg
+./usr/X11R7/include/X11/pixmaps/ctwm/3dfeet.xpm		-unknown-	

CVS commit: xsrc/external/mit/ctwm/dist

2015-09-03 Thread Youri Mouton
Module Name:xsrc
Committed By:   youri
Date:   Thu Sep  3 22:16:33 UTC 2015

Added Files:
xsrc/external/mit/ctwm/dist: CHANGES Imakefile Imakefile.local-template
PROBLEMS README README.VMS README.gnome TODO TODO.gnome
add_window.c add_window.h clicktofocus.c clicktofocus.h
ctwm.axp_opt ctwm.c ctwm.com ctwm.h ctwm.man ctwm.spec ctwm.txt
ctwm.vax_opt cursor.c cursor.h deftwmrc.c demolib.c
descrip.local-template descrip.mms descrip.submms events.c events.h
example.ctwmrc gc.c gc.h gendeftwmrc.com gnome.c gnome.h
gnomewindefs.h gram.c_VMS gram.h_VMS gram.tab.c gram.tab.h gram.y
gtw.c iconmgr.c iconmgr.h icons.c icons.h levitte.ctwmrc lex.c
lex.c_VMS lex.l libctwm.c link.com list.c list.h lnm.c lnm.h
make.com menus.c menus.h mk_tar.sh mwmhints.c mwmhints.h parse.c
parse.h peterc.ctwmrc resize.c resize.h screen.h session.c
session.h siconify.bm sound.c sound.doc sound.h system.ctwmrc
system.ctwmrc.gnome twm.h types.h util.c util.h version.c version.h
vms.txt vms2.txt vms_cmd_services.c vms_cmd_services.h vscreen.c
vscreen.h windowbox.c windowbox.h workmgr.c workmgr.h
xsrc/external/mit/ctwm/dist/xpm: 3D_Expand15.xpm 3D_Iconify15.xpm
3D_Lightning15.xpm 3D_Menu15.xpm 3D_Resize15.xpm 3D_Zoom15.xpm
3dcircle.xpm 3ddimple.xpm 3ddot.xpm 3dfeet.xpm 3dleopard.xpm
3dpie.xpm 3dpyramid.xpm 3dslant.xpm IslandD.xpm IslandW.xpm
LRom.xpm LRom1.xpm arthur.xpm audio_editor.xpm background1.xpm
background2.xpm background3.xpm background4.xpm background5.xpm
background6.xpm background7.xpm background8.xpm background9.xpm
ball1.xpm ball10.xpm ball11.xpm ball12.xpm ball2.xpm ball3.xpm
ball4.xpm ball5.xpm ball6.xpm ball7.xpm ball8.xpm ball9.xpm
cdrom1.xpm claude.xpm clipboard.xpm datebook.xpm emacs.xpm
ghostview.xpm hpterm.xpm mail0.xpm mail1.xpm nothing.xpm nt1.xpm
nt2.xpm pixmap.xpm postit.xpm skull.xpm spider.xpm supman1.xbm
supman2.xbm supman3.xbm supman4.xbm supman5.xbm supman6.xbm
supman7.xbm supman8.xbm supman9.xbm term.xpm unknown.xpm
unknown1.xpm unread.xpm welcome.xpm welcome.xwd xarchie.xpm
xcalc.xpm xcalc2.xpm xedit.xpm xftp.xpm xgopher.xpm xgrab.xpm
xhpcalc.xpm xirc.xpm xmail.xpm xman.xpm xmosaic.xpm xnomail.xpm
xrn-compose.xpm xrn.goodnews.xpm xrn.nonews.xpm xrn.xpm xterm.xpm

Log Message:
CTWM is an extension to twm, that support multiple virtual screens,
and a lot of other goodies.

You can use and manage up to 32 virtual screens called workspaces.
You swap from one workspace to another by clicking on a button in an
optional panel of buttons (the workspace manager) or by invoking a function.

You can custom each workspace by choosing different colors, names
and pixmaps for the buttons and background root windows.

Main features are:
- Optional 3D window titles and border (ala Motif).
- Shaped, colored icons.
- Multiple icons for clients based on the icon name.
- Windows can belong to several workspaces.
- A map of your workspaces to move quickly windows between
  different workspaces.
- Animations: icons, root backgrounds and buttons can be animated.
- Pinnable and sticky menus.
- etc...

This commit follows the proposal on retiring twm in favour of something newer,
like ctwm. See http://web.zephyrite.net/NetBSD/wm/index.html.

ok mrg.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 xsrc/external/mit/ctwm/dist/CHANGES \
xsrc/external/mit/ctwm/dist/Imakefile \
xsrc/external/mit/ctwm/dist/Imakefile.local-template \
xsrc/external/mit/ctwm/dist/PROBLEMS xsrc/external/mit/ctwm/dist/README \
xsrc/external/mit/ctwm/dist/README.VMS \
xsrc/external/mit/ctwm/dist/README.gnome xsrc/external/mit/ctwm/dist/TODO \
xsrc/external/mit/ctwm/dist/TODO.gnome \
xsrc/external/mit/ctwm/dist/add_window.c \
xsrc/external/mit/ctwm/dist/add_window.h \
xsrc/external/mit/ctwm/dist/clicktofocus.c \
xsrc/external/mit/ctwm/dist/clicktofocus.h \
xsrc/external/mit/ctwm/dist/ctwm.axp_opt \
xsrc/external/mit/ctwm/dist/ctwm.c xsrc/external/mit/ctwm/dist/ctwm.com \
xsrc/external/mit/ctwm/dist/ctwm.h xsrc/external/mit/ctwm/dist/ctwm.man \
xsrc/external/mit/ctwm/dist/ctwm.spec \
xsrc/external/mit/ctwm/dist/ctwm.txt \
xsrc/external/mit/ctwm/dist/ctwm.vax_opt \
xsrc/external/mit/ctwm/dist/cursor.c xsrc/external/mit/ctwm/dist/cursor.h \
xsrc/external/mit/ctwm/dist/deftwmrc.c \
xsrc/external/mit/ctwm/dist/demolib.c \
xsrc/external/mit/ctwm/dist/descrip.local-template \
xsrc/external/mit/ctwm/dist/descrip.mms \
xsrc/external/mit/ctwm/dist/descrip.submms \
xsrc/external/mit/ctwm/dist/events.c xsrc/external/mit/ctwm/dist/events.h \

CVS commit: src/usr.bin/config

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Sep  4 05:13:32 UTC 2015

Modified Files:
src/usr.bin/config: files.c mkmakefile.c

Log Message:
Now Makefile.kern.inc handles swap.c compiling/linking nicely,
config(1) can become less hackish.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/config/files.c
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/config/mkmakefile.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/config/files.c
diff -u src/usr.bin/config/files.c:1.30 src/usr.bin/config/files.c:1.31
--- src/usr.bin/config/files.c:1.30	Fri Sep  4 01:24:01 2015
+++ src/usr.bin/config/files.c	Fri Sep  4 05:13:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: files.c,v 1.30 2015/09/04 01:24:01 uebayasi Exp $	*/
+/*	$NetBSD: files.c,v 1.31 2015/09/04 05:13:32 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: files.c,v 1.30 2015/09/04 01:24:01 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.31 2015/09/04 05:13:32 uebayasi Exp $");
 
 #include 
 #include 
@@ -274,20 +274,17 @@ fixfiles(void)
 	struct files *fi, *ofi;
 	struct nvlist *flathead, **flatp;
 	int err, sel;
+	struct config *cf;
+ 	char swapname[100];
 
 	addfile("devsw.c", NULL, 0, NULL);
 	addfile("ioconf.c", NULL, 0, NULL);
 
-	if (Sflag) {
- 		struct config *cf;
- 		char swapname[100];
-
- 		TAILQ_FOREACH(cf, , cf_next) {
- 			(void)snprintf(swapname, sizeof(swapname), "swap%s.c",
- 			cf->cf_name);
- 			addfile(intern(swapname), NULL, 0, NULL);
- 		}
-	}
+	TAILQ_FOREACH(cf, , cf_next) {
+ 		(void)snprintf(swapname, sizeof(swapname), "swap%s.c",
+ 		cf->cf_name);
+ 		addfile(intern(swapname), NULL, 0, NULL);
+ 	}
 
 	err = 0;
 	TAILQ_FOREACH(fi, , fi_next) {

Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.64 src/usr.bin/config/mkmakefile.c:1.65
--- src/usr.bin/config/mkmakefile.c:1.64	Fri Sep  4 01:24:01 2015
+++ src/usr.bin/config/mkmakefile.c	Fri Sep  4 05:13:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.64 2015/09/04 01:24:01 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.65 2015/09/04 05:13:32 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: mkmakefile.c,v 1.64 2015/09/04 01:24:01 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.65 2015/09/04 05:13:32 uebayasi Exp $");
 
 #include 
 #include 
@@ -466,8 +466,6 @@ static void
 emitfiles(FILE *fp, struct filelist *filelist, int suffix)
 {
 	struct files *fi;
- 	struct config *cf;
- 	char swapname[100];
 	int found = 0;
 
 	TAILQ_FOREACH(fi, filelist, fi_snext) {
@@ -479,23 +477,6 @@ emitfiles(FILE *fp, struct filelist *fil
 		emitfilerel(fp, fi);
 		fputs(" \\\n", fp);
 	}
-
- 	/*
- 	 * The allfiles list does not include the configuration-specific
- 	 * C source files.  These files should be eliminated someday, but
- 	 * for now, we have to add them to ${CFILES} (and only ${CFILES}).
- 	 */
- 	if (!Sflag) {
- 	if (suffix == 'c') {
- 		TAILQ_FOREACH(cf, , cf_next) {
-			found++;
- 			(void)snprintf(swapname, sizeof(swapname), "swap%s.c",
- 			cf->cf_name);
- 			fprintf(fp, "\t%s \\\n", swapname);
- 		}
- 	}
-	}
-
 	if (found == 0)
 		fprintf(fp, "#%%%cFILES\n", toupper(suffix));
 }



CVS commit: src/usr.bin/config

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Sep  4 01:24:01 UTC 2015

Modified Files:
src/usr.bin/config: files.c mkmakefile.c

Log Message:
Share more code by making *.o handling less special.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/config/files.c
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/config/mkmakefile.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/config/files.c
diff -u src/usr.bin/config/files.c:1.29 src/usr.bin/config/files.c:1.30
--- src/usr.bin/config/files.c:1.29	Thu Sep  3 14:23:52 2015
+++ src/usr.bin/config/files.c	Fri Sep  4 01:24:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: files.c,v 1.29 2015/09/03 14:23:52 uebayasi Exp $	*/
+/*	$NetBSD: files.c,v 1.30 2015/09/04 01:24:01 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: files.c,v 1.29 2015/09/03 14:23:52 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.30 2015/09/04 01:24:01 uebayasi Exp $");
 
 #include 
 #include 
@@ -195,6 +195,7 @@ addfile(const char *path, struct condexp
 		break;
 	case 'o':
 		TAILQ_INSERT_TAIL(, fi, fi_snext);
+		TAILQ_INSERT_TAIL(, fi, fi_next);
 		break;
 	default:
 		cfgxerror(fi->fi_srcfile, fi->fi_srcline,

Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.63 src/usr.bin/config/mkmakefile.c:1.64
--- src/usr.bin/config/mkmakefile.c:1.63	Thu Sep  3 13:32:07 2015
+++ src/usr.bin/config/mkmakefile.c	Fri Sep  4 01:24:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.63 2015/09/03 13:32:07 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.64 2015/09/04 01:24:01 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: mkmakefile.c,v 1.63 2015/09/03 13:32:07 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.64 2015/09/04 01:24:01 uebayasi Exp $");
 
 #include 
 #include 
@@ -334,20 +334,8 @@ emitfilerel(FILE *fp, struct files *fi)
 static void
 emitobjs(FILE *fp)
 {
-	struct files *fi;
-	int found = 0;
 
-	TAILQ_FOREACH(fi, , fi_snext) {
-		if ((fi->fi_flags & FI_SEL) == 0)
-			continue;
-		if (found++ == 0)
-			fputs("OFILES= \\\n", fp);
-		putc('\t', fp);
-		emitfile(fp, fi);
-		fputs(" \\\n", fp);
-	}
-	if (found == 0)
-		fprintf(fp, "#%%OBJS\n");
+	emitfiles(fp, , 'o');
 }
 
 static void



CVS commit: src/usr.bin/config

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 13:32:07 UTC 2015

Modified Files:
src/usr.bin/config: mkmakefile.c

Log Message:
Pretty-print `Makefile' output.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/config/mkmakefile.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/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.62 src/usr.bin/config/mkmakefile.c:1.63
--- src/usr.bin/config/mkmakefile.c:1.62	Thu Sep  3 09:28:00 2015
+++ src/usr.bin/config/mkmakefile.c	Thu Sep  3 13:32:07 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.62 2015/09/03 09:28:00 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.63 2015/09/03 13:32:07 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: mkmakefile.c,v 1.62 2015/09/03 09:28:00 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.63 2015/09/03 13:32:07 uebayasi Exp $");
 
 #include 
 #include 
@@ -335,16 +335,19 @@ static void
 emitobjs(FILE *fp)
 {
 	struct files *fi;
+	int found = 0;
 
-	fputs("OFILES= \\\n", fp);
 	TAILQ_FOREACH(fi, , fi_snext) {
 		if ((fi->fi_flags & FI_SEL) == 0)
 			continue;
+		if (found++ == 0)
+			fputs("OFILES= \\\n", fp);
 		putc('\t', fp);
 		emitfile(fp, fi);
 		fputs(" \\\n", fp);
 	}
-	putc('\n', fp);
+	if (found == 0)
+		fprintf(fp, "#%%OBJS\n");
 }
 
 static void
@@ -477,9 +480,11 @@ emitfiles(FILE *fp, struct filelist *fil
 	struct files *fi;
  	struct config *cf;
  	char swapname[100];
+	int found = 0;
 
-	fprintf(fp, "%cFILES= \\\n", toupper(suffix));
 	TAILQ_FOREACH(fi, filelist, fi_snext) {
+		if (found++ == 0)
+			fprintf(fp, "%cFILES= \\\n", toupper(suffix));
 		if ((fi->fi_flags & FI_SEL) == 0)
 			continue;
 		putc('\t', fp);
@@ -495,13 +500,16 @@ emitfiles(FILE *fp, struct filelist *fil
  	if (!Sflag) {
  	if (suffix == 'c') {
  		TAILQ_FOREACH(cf, , cf_next) {
+			found++;
  			(void)snprintf(swapname, sizeof(swapname), "swap%s.c",
  			cf->cf_name);
  			fprintf(fp, "\t%s \\\n", swapname);
  		}
  	}
 	}
-	putc('\n', fp);
+
+	if (found == 0)
+		fprintf(fp, "#%%%cFILES\n", toupper(suffix));
 }
 
 /*
@@ -511,6 +519,7 @@ static void
 emitrules(FILE *fp)
 {
 	struct files *fi;
+	int found = 0;
 
 	TAILQ_FOREACH(fi, , fi_next) {
 		if ((fi->fi_flags & FI_SEL) == 0)
@@ -521,7 +530,10 @@ emitrules(FILE *fp)
 		emitfile(fp, fi);
 		putc('\n', fp);
 		fprintf(fp, "\t%s\n\n", fi->fi_mkrule);
+		found = 1;
 	}
+	if (found == 0)
+		fprintf(fp, "#%%RULES\n");
 }
 
 /*
@@ -533,6 +545,7 @@ static void
 emitload(FILE *fp)
 {
 	struct config *cf;
+	int found = 0;
 
 	/*
 	 * Generate the backward-compatible "build_kernel" rule if
@@ -559,8 +572,10 @@ emitload(FILE *fp)
 	 		cf->cf_name);
 		}
 		fprintf(fp, "KERNELS+=%s\n", cf->cf_name);
+		found = 1;
 	}
-	fputs("\n", fp);
+	if (found == 0)
+		fprintf(fp, "#%%LOAD\n");
 }
 
 /*



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

2015-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Sep  3 13:07:46 UTC 2015

Modified Files:
src/sys/arch/luna68k/luna68k: locore.s

Log Message:
Fix spelling in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/luna68k/luna68k/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/luna68k/locore.s
diff -u src/sys/arch/luna68k/luna68k/locore.s:1.61 src/sys/arch/luna68k/luna68k/locore.s:1.62
--- src/sys/arch/luna68k/luna68k/locore.s:1.61	Wed Sep  2 11:33:30 2015
+++ src/sys/arch/luna68k/luna68k/locore.s	Thu Sep  3 13:07:46 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.61 2015/09/02 11:33:30 tsutsui Exp $ */
+/* $NetBSD: locore.s,v 1.62 2015/09/03 13:07:46 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -927,9 +927,9 @@ GLOBAL(proto040tc)
 	.long	0x8000		| %tc (4KB page)
 #endif
 GLOBAL(proto040tt0)		| tt0 0x4000.-0x7fff.
-	.long	0x403fa040	| kernel only, cache inhebit, serialized
+	.long	0x403fa040	| kernel only, cache inhibit, serialized
 GLOBAL(proto040tt1)		| tt1 0x8000.-0x.
-	.long	0x807fa040	| kernel only, cache inhebit, serialized
+	.long	0x807fa040	| kernel only, cache inhibit, serialized
 nullrp:
 	.long	0x7fff0001	| do-nothing MMU root pointer
 



CVS commit: src/sys/conf

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 12:31:16 UTC 2015

Modified Files:
src/sys/conf: Makefile.kern.inc

Log Message:
Prepare for relative ${MD_OBJS}.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.234 src/sys/conf/Makefile.kern.inc:1.235
--- src/sys/conf/Makefile.kern.inc:1.234	Thu Sep  3 09:28:00 2015
+++ src/sys/conf/Makefile.kern.inc	Thu Sep  3 12:31:16 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.234 2015/09/03 09:28:00 uebayasi Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.235 2015/09/03 12:31:16 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -196,6 +196,9 @@ SYSLIBCOMPATLN?=	${COMPATLIBLN}
 
 .if !defined(___USE_SUFFIX_RULES___)
 MI_CFILES=	devsw.c ioconf.c
+_MD_OBJS=	${MD_OBJS:T}
+.else
+_MD_OBJS=	${MD_OBJS}
 .endif
 
 # the need for a MI_SFILES variable is dubitable at best
@@ -212,7 +215,7 @@ MI_OBJS=${MI_CFILES:S/.c/.o/}
 # load lines for config "xxx" will be emitted as:
 # xxx: ${SYSTEM_DEP} swap.o vers.o build_kernel
 
-SYSTEM_OBJ?=	${MD_OBJS} ${MI_OBJS} ${OBJS} ${SYSLIBCOMPAT} ${LIBKERN}
+SYSTEM_OBJ?=	${_MD_OBJS} ${MI_OBJS} ${OBJS} ${SYSLIBCOMPAT} ${LIBKERN}
 SYSTEM_DEP+=	Makefile ${SYSTEM_OBJ}
 .if defined(CTFMERGE)
 SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
@@ -300,12 +303,16 @@ OBJS.o=	${OFILES}
 # absolute, generated (build directory), relative (under $S)
 _CFILES=${CFILES:M/*} ${CFILES:N/*:N*/*} ${CFILES:N/*:M*/*:C|^|$S/|}
 _SFILES=${SFILES:M/*} ${SFILES:N/*:N*/*} ${SFILES:N/*:M*/*:C|^|$S/|}
+_MD_CFILES=${MD_CFILES}
+_MD_SFILES=${MD_SFILES}
 .else
 OBJS.c=	${CFILES:R:C|$|.o|}
 OBJS.s=	${SFILES:R:C|$|.o|}
 OBJS.o=	${OFILES}
 _CFILES=${CFILES}
 _SFILES=${SFILES}
+_MD_CFILES=${MD_CFILES:C|^$S/||}
+_MD_SFILES=${MD_SFILES:C|^$S/||}
 .endif # ___USE_SUFFIX_RULES___
 OBJS=	${OBJS.c} ${OBJS.s} ${OBJS.o}
 
@@ -331,7 +338,7 @@ assym.h: ${GENASSYM_CONF} ${GENASSYM_EXT
 	${GENASSYM} -- ${CC} ${CFLAGS:N-Wa,*} ${CPPFLAGS} ${PROF} \
 	${GENASSYM_CPPFLAGS} > assym.h.tmp && \
 	mv -f assym.h.tmp assym.h
-${MD_SFILES:C/\.[Ss]/.o/} ${SFILES:C/\.[Ss]/.o/}: assym.h
+${_MD_SFILES:C/\.[Ss]/.o/} ${_SFILES:C/\.[Ss]/.o/}: assym.h
 
 MKREPRO?=no
 
@@ -396,8 +403,8 @@ dependall: depend .WAIT all
 .if !target(.depend)
 MKDEP_AFLAGS?=	${AFLAGS}
 MKDEP_CFLAGS?=	${CFLAGS}
-SSRCS=${MD_SFILES} ${_SFILES}
-CSRCS=${MD_CFILES} ${MI_CFILES} ${_CFILES}
+SSRCS=${_MD_SFILES} ${_SFILES}
+CSRCS=${_MD_CFILES} ${MI_CFILES} ${_CFILES}
 SRCS=${SSRCS} ${CSRCS}
 .if !defined(___USE_SUFFIX_RULES___)
 DEPS=	${SRCS:T:u:R:S/$/.d/g}



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

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Sep  3 12:33:12 UTC 2015

Modified Files:
src/sys/arch/amd64/conf: Makefile.amd64

Log Message:
Define ${MD_OBJS} as relative path.  This change makes amd64 kernel buildable
for `-S' mode.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/amd64/conf/Makefile.amd64

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/Makefile.amd64
diff -u src/sys/arch/amd64/conf/Makefile.amd64:1.51 src/sys/arch/amd64/conf/Makefile.amd64:1.52
--- src/sys/arch/amd64/conf/Makefile.amd64:1.51	Mon Aug 24 14:04:24 2015
+++ src/sys/arch/amd64/conf/Makefile.amd64	Thu Sep  3 12:33:11 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.amd64,v 1.51 2015/08/24 14:04:24 uebayasi Exp $
+#	$NetBSD: Makefile.amd64,v 1.52 2015/09/03 12:33:11 uebayasi Exp $
 
 # Makefile for NetBSD
 #
@@ -56,11 +56,13 @@ KERN_AS=	library
 ##
 ## (4) local objects, compile rules, and dependencies
 ##
-MD_OBJS=	locore.o vector.o copy.o spl.o
+MD_OBJS=	arch/amd64/amd64/locore.o arch/amd64/amd64/vector.o \
+		arch/amd64/amd64/copy.o arch/amd64/amd64/spl.o
 MD_CFILES=
 MD_SFILES=	${AMD64}/amd64/locore.S ${AMD64}/amd64/vector.S \
 		${AMD64}/amd64/copy.S ${AMD64}/amd64/spl.S
 
+.if !defined(___USE_SUFFIX_RULES___)
 locore.o: ${AMD64}/amd64/locore.S assym.h
 	${NORMAL_S}
 
@@ -72,6 +74,7 @@ copy.o: ${AMD64}/amd64/copy.S assym.h
 
 spl.o: ${AMD64}/amd64/spl.S assym.h
 	${NORMAL_S}
+.endif # ___USE_SUFFIX_RULES___
 
 ##
 ## (5) link settings



CVS commit: src/tests/net/net

2015-09-03 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Sep  4 05:24:57 UTC 2015

Modified Files:
src/tests/net/net: t_forwarding.sh

Log Message:
Add tests to check if nexthop route lookup works

These tests reproduce a panic on assertion "ro->_ro_rt ==NULL ||
ro->_ro_rt->rt_refcnt > 0" failure that had been fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/net/net/t_forwarding.sh

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

Modified files:

Index: src/tests/net/net/t_forwarding.sh
diff -u src/tests/net/net/t_forwarding.sh:1.6 src/tests/net/net/t_forwarding.sh:1.7
--- src/tests/net/net/t_forwarding.sh:1.6	Fri Aug  7 00:50:12 2015
+++ src/tests/net/net/t_forwarding.sh	Fri Sep  4 05:24:57 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: t_forwarding.sh,v 1.6 2015/08/07 00:50:12 ozaki-r Exp $
+#	$NetBSD: t_forwarding.sh,v 1.7 2015/09/04 05:24:57 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -268,6 +268,15 @@ test_ping_success()
 	atf_check -s exit:0 -o ignore rump.ping -q -n -w $TIMEOUT -c 1 $IP4DSTGW
 	atf_check -s exit:0 -o ignore rump.ping -q -n -w $TIMEOUT -c 1 $IP4SRC
 	$DEBUG && rump.ifconfig -v shmif0
+
+	# Check if nexthop lookup involving a rtentry creation
+	# on sending a packet works
+	export RUMP_SERVER=$SOCKSRC
+	$DEBUG && rump.netstat -nr
+	atf_check -s exit:0 -o ignore rump.route delete $IP4SRCGW
+	$DEBUG && rump.netstat -nr
+	atf_check -s exit:0 -o ignore rump.ping -q -n -w $TIMEOUT -c 2 $IP4DST
+	$DEBUG && rump.netstat -nr
 }
 
 test_ttl()
@@ -302,6 +311,15 @@ test_ping6_success()
 	atf_check -s exit:0 -o ignore rump.ping6 -q -n -c 1 -X $TIMEOUT $IP6DSTGW
 	atf_check -s exit:0 -o ignore rump.ping6 -q -n -c 1 -X $TIMEOUT $IP6SRC
 	$DEBUG && rump.ifconfig -v shmif0
+
+	# Check if nexthop lookup involving a rtentry creation
+	# on sending a packet works
+	export RUMP_SERVER=$SOCKSRC
+	$DEBUG && rump.netstat -nr
+	atf_check -s exit:0 -o ignore rump.route delete -inet6 $IP6SRCGW
+	$DEBUG && rump.netstat -nr
+	atf_check -s exit:0 -o ignore rump.ping6 -q -n -c 2 -X $TIMEOUT $IP6DST
+	$DEBUG && rump.netstat -nr
 }
 
 test_hoplimit()



CVS commit: src/sys/netinet6

2015-09-03 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Sep  4 05:33:23 UTC 2015

Modified Files:
src/sys/netinet6: nd6.c

Log Message:
Pull nexthop determination routine from nd6_output

It simplifies nd6_output and the nexthop determination routine slightly.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/netinet6/nd6.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/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.175 src/sys/netinet6/nd6.c:1.176
--- src/sys/netinet6/nd6.c:1.175	Thu Sep  3 00:54:39 2015
+++ src/sys/netinet6/nd6.c	Fri Sep  4 05:33:23 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.175 2015/09/03 00:54:39 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.c,v 1.176 2015/09/04 05:33:23 ozaki-r Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.175 2015/09/03 00:54:39 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.176 2015/09/04 05:33:23 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2145,92 +2145,129 @@ nd6_slowtimo(void *ignored_arg)
 	mutex_exit(softnet_lock);
 }
 
-#define senderr(e) { error = (e); goto bad;}
-int
-nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0,
-const struct sockaddr_in6 *dst, struct rtentry *rt00)
+/*
+ * Next hop determination.  This routine was derived from ether_output.
+ */
+static int
+nd6_determine_nexthop(struct ifnet *ifp, const struct sockaddr_in6 *dst,
+struct rtentry *rt00, struct rtentry **ret_rt, bool *sendpkt)
 {
-	struct mbuf *m = m0;
 	struct rtentry *rt, *rt0;
-	struct sockaddr_in6 *gw6 = NULL;
-	struct llinfo_nd6 *ln = NULL;
-	int error = 0;
+	struct rtentry *gwrt;
+	struct sockaddr_in6 *gw6;
 
 #define RTFREE_IF_NEEDED(_rt) \
 	if ((_rt) != NULL && (_rt) != rt00) \
 		rtfree((_rt));
 
+	KASSERT(rt00 != NULL);
+
 	rt = rt0 = rt00;
 
-	if (IN6_IS_ADDR_MULTICAST(>sin6_addr))
-		goto sendpkt;
+	if ((rt->rt_flags & RTF_UP) == 0) {
+		rt0 = rt = rtalloc1(sin6tocsa(dst), 1);
+		if (rt == NULL)
+			goto hostunreach;
+		if (rt->rt_ifp != ifp)
+			goto hostunreach;
+	}
 
-	if (nd6_need_cache(ifp) == 0)
-		goto sendpkt;
+	if ((rt->rt_flags & RTF_GATEWAY) == 0)
+		goto out;
+
+	gw6 = (struct sockaddr_in6 *)rt->rt_gateway;
 
 	/*
-	 * next hop determination.  This routine is derived from ether_output.
+	 * We skip link-layer address resolution and NUD
+	 * if the gateway is not a neighbor from ND point
+	 * of view, regardless of the value of nd_ifinfo.flags.
+	 * The second condition is a bit tricky; we skip
+	 * if the gateway is our own address, which is
+	 * sometimes used to install a route to a p2p link.
 	 */
-	if (rt) {
-		if ((rt->rt_flags & RTF_UP) == 0) {
-			if ((rt0 = rt = rtalloc1(sin6tocsa(dst), 1)) != NULL) {
-if (rt->rt_ifp != ifp)
-	senderr(EHOSTUNREACH);
-			} else
-senderr(EHOSTUNREACH);
+	if (!nd6_is_addr_neighbor(gw6, ifp) ||
+	in6ifa_ifpwithaddr(ifp, >sin6_addr)) {
+		/*
+		 * We allow this kind of tricky route only
+		 * when the outgoing interface is p2p.
+		 * XXX: we may need a more generic rule here.
+		 */
+		if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
+			goto hostunreach;
+
+		*sendpkt = true;
+		goto out;
+	}
+
+	/* Try to use a cached nexthop route (gwroute) if exists */
+	gwrt = rt_get_gwroute(rt);
+	if (gwrt == NULL)
+		goto lookup;
+
+	RTFREE_IF_NEEDED(rt);
+	rt = gwrt;
+	if ((rt->rt_flags & RTF_UP) == 0) {
+		RTFREE_IF_NEEDED(rt);
+		rt = rt0;
+	lookup:
+		/* Look up a nexthop route */
+		gwrt = rtalloc1(rt->rt_gateway, 1);
+		rt_set_gwroute(rt, gwrt);
+		RTFREE_IF_NEEDED(rt);
+		rt = gwrt;
+		if (rt == NULL)
+			goto hostunreach;
+		/* the "G" test below also prevents rt == rt0 */
+		if ((rt->rt_flags & RTF_GATEWAY) ||
+		(rt->rt_ifp != ifp)) {
+			if (rt0->rt_gwroute != NULL)
+rtfree(rt0->rt_gwroute);
+			rt0->rt_gwroute = NULL;
+			goto hostunreach;
 		}
+	}
 
-		if (rt->rt_flags & RTF_GATEWAY) {
-			struct rtentry *gwrt;
-			gw6 = (struct sockaddr_in6 *)rt->rt_gateway;
+out:
+	*ret_rt = rt;
+	return 0;
 
-			/*
-			 * We skip link-layer address resolution and NUD
-			 * if the gateway is not a neighbor from ND point
-			 * of view, regardless of the value of nd_ifinfo.flags.
-			 * The second condition is a bit tricky; we skip
-			 * if the gateway is our own address, which is
-			 * sometimes used to install a route to a p2p link.
-			 */
-			if (!nd6_is_addr_neighbor(gw6, ifp) ||
-			in6ifa_ifpwithaddr(ifp, >sin6_addr)) {
-/*
- * We allow this kind of tricky route only
- * when the outgoing interface is p2p.
- * XXX: we may need a more generic rule here.
- */
-if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
-	senderr(EHOSTUNREACH);
+hostunreach:
+	RTFREE_IF_NEEDED(rt);
 
-goto sendpkt;
-			}
+	return EHOSTUNREACH;
+#undef RTFREE_IF_NEEDED
+}
 
-			gwrt = rt_get_gwroute(rt);
-			if (gwrt 

CVS commit: src/usr.bin/config

2015-09-03 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Sep  4 05:52:15 UTC 2015

Modified Files:
src/usr.bin/config: mkmakefile.c

Log Message:
Output ${ALLFILES}, the list of selected *.[csSo] files, sorted in the exact
order config(1) parses "file ..." commands in config(5) files.  Define
${CFILES}, ${SFILES}, and ${OFILES} as subset of ${ALLFILES} selected by
suffix.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/config/mkmakefile.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/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.65 src/usr.bin/config/mkmakefile.c:1.66
--- src/usr.bin/config/mkmakefile.c:1.65	Fri Sep  4 05:13:32 2015
+++ src/usr.bin/config/mkmakefile.c	Fri Sep  4 05:52:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.65 2015/09/04 05:13:32 uebayasi Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.66 2015/09/04 05:52:15 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: mkmakefile.c,v 1.65 2015/09/04 05:13:32 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.66 2015/09/04 05:52:15 uebayasi Exp $");
 
 #include 
 #include 
@@ -63,9 +63,9 @@ __RCSID("$NetBSD: mkmakefile.c,v 1.65 20
  */
 
 static void emitdefs(FILE *);
-static void emitfiles(FILE *, struct filelist *, int);
+static void emitallfiles(FILE *);
 
-static void emitobjs(FILE *);
+static void emitofiles(FILE *);
 static void emitallkobjs(FILE *);
 static int emitallkobjscb(const char *, void *, void *);
 static void emitattrkobjs(FILE *);
@@ -145,7 +145,7 @@ mkmakefile(void)
 			continue;
 		}
 		if (strcmp(line, "%OBJS\n") == 0)
-			fn = Mflag ? emitkobjs : emitobjs;
+			fn = Mflag ? emitkobjs : emitofiles;
 		else if (strcmp(line, "%CFILES\n") == 0)
 			fn = emitcfiles;
 		else if (strcmp(line, "%SFILES\n") == 0)
@@ -332,10 +332,11 @@ emitfilerel(FILE *fp, struct files *fi)
 }
 
 static void
-emitobjs(FILE *fp)
+emitofiles(FILE *fp)
 {
 
-	emitfiles(fp, , 'o');
+	emitallfiles(fp);
+	fprintf(fp, "OFILES=\t${ALLFILES:M*.o}\n");
 }
 
 static void
@@ -452,33 +453,37 @@ static void
 emitcfiles(FILE *fp)
 {
 
-	emitfiles(fp, , 'c');
+	emitallfiles(fp);
+	fprintf(fp, "CFILES=\t${ALLFILES:M*.c}\n");
 }
 
 static void
 emitsfiles(FILE *fp)
 {
 
-	emitfiles(fp, , 's');
+	emitallfiles(fp);
+	fprintf(fp, "SFILES=\t${ALLFILES:M*.[sS]}\n");
 }
 
 static void
-emitfiles(FILE *fp, struct filelist *filelist, int suffix)
+emitallfiles(FILE *fp)
 {
 	struct files *fi;
+	static int called;
 	int found = 0;
 
-	TAILQ_FOREACH(fi, filelist, fi_snext) {
-		if (found++ == 0)
-			fprintf(fp, "%cFILES= \\\n", toupper(suffix));
+	if (called++ != 0)
+		return;
+	TAILQ_FOREACH(fi, , fi_next) {
 		if ((fi->fi_flags & FI_SEL) == 0)
 			continue;
+		if (found++ == 0)
+			fprintf(fp, "ALLFILES= \\\n");
 		putc('\t', fp);
 		emitfilerel(fp, fi);
 		fputs(" \\\n", fp);
 	}
-	if (found == 0)
-		fprintf(fp, "#%%%cFILES\n", toupper(suffix));
+	fputc('\n', fp);
 }
 
 /*