CVS commit: src/sys/miscfs/genfs

2010-12-03 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Dec  3 08:42:14 UTC 2010

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
genfs_do_putpages(): When testing an uobject for dirty or modified
pages skip uninitialized (PG_FAKE) pages (DEBUG only).


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.44 src/sys/miscfs/genfs/genfs_io.c:1.45
--- src/sys/miscfs/genfs/genfs_io.c:1.44	Tue Nov 30 10:55:25 2010
+++ src/sys/miscfs/genfs/genfs_io.c	Fri Dec  3 08:42:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.44 2010/11/30 10:55:25 hannken Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.45 2010/12/03 08:42:14 hannken Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.44 2010/11/30 10:55:25 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.45 2010/12/03 08:42:14 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1224,7 +1224,7 @@
 	(vp-v_iflag  VI_ONWORKLST) != 0) {
 #if defined(DEBUG)
 		TAILQ_FOREACH(pg, uobj-memq, listq.queue) {
-			if ((pg-flags  PG_MARKER) != 0) {
+			if ((pg-flags  (PG_FAKE | PG_MARKER)) != 0) {
 continue;
 			}
 			if ((pg-flags  PG_CLEAN) == 0) {



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

2010-12-03 Thread Timo Teräs
Module Name:src
Committed By:   tteras
Date:   Fri Dec  3 09:46:24 UTC 2010

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

Log Message:
Netlink deletion notification does not guarentee actual address deletion:
it might still exist on some other interface. Make sure we do not unbind
unless the address is really gone.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.26 src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.27
--- src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.26	Fri Oct 22 06:26:26 2010
+++ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c	Fri Dec  3 09:46:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: grabmyaddr.c,v 1.26 2010/10/22 06:26:26 tteras Exp $	*/
+/*	$NetBSD: grabmyaddr.c,v 1.27 2010/12/03 09:46:24 tteras Exp $	*/
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * Copyright (C) 2008 Timo Teras timo.te...@iki.fi.
@@ -319,6 +319,11 @@
 
 #if defined(USE_NETLINK)
 
+static int netlink_fd = -1;
+
+#define NLMSG_TAIL(nmsg) \
+	((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)-nlmsg_len)))
+
 static void
 parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len)
 {
@@ -331,6 +336,24 @@
 }
 
 static int
+netlink_add_rtattr_l(struct nlmsghdr *n, int maxlen, int type,
+		 const void *data, int alen)
+{
+	int len = RTA_LENGTH(alen);
+	struct rtattr *rta;
+
+	if (NLMSG_ALIGN(n-nlmsg_len) + RTA_ALIGN(len)  maxlen)
+		return FALSE;
+
+	rta = NLMSG_TAIL(n);
+	rta-rta_type = type;
+	rta-rta_len = len;
+	memcpy(RTA_DATA(rta), data, alen);
+	n-nlmsg_len = NLMSG_ALIGN(n-nlmsg_len) + RTA_ALIGN(len);
+	return TRUE;
+}
+
+static int
 netlink_enumerate(fd, family, type)
 	int fd;
 	int family;
@@ -410,6 +433,42 @@
 #endif
 
 static int
+netlink_route_is_local(int family, const unsigned char *addr, size_t addr_len)
+{
+	struct {
+		struct nlmsghdr n;
+		struct rtmsgr;
+		charbuf[1024];
+	} req;
+	struct rtmsg *r = NLMSG_DATA(req.n);
+	struct rtattr *rta[RTA_MAX+1];
+	struct sockaddr_nl nladdr;
+	ssize_t rlen;
+
+	memset(req, 0, sizeof(req));
+	req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg));
+	req.n.nlmsg_flags = NLM_F_REQUEST;
+	req.n.nlmsg_type = RTM_GETROUTE;
+	req.r.rtm_family = family;
+	netlink_add_rtattr_l(req.n, sizeof(req), RTA_DST,
+			 addr, addr_len);
+	req.r.rtm_dst_len = addr_len * 8;
+
+	memset(nladdr, 0, sizeof(nladdr));
+	nladdr.nl_family = AF_NETLINK;
+
+	if (sendto(netlink_fd, req, sizeof(req), 0,
+		   (struct sockaddr *) nladdr, sizeof(nladdr))  0)
+		return 0;
+	rlen = recv(netlink_fd, req, sizeof(req), 0);
+	if (rlen  0)
+		return 0;
+
+	return  req.n.nlmsg_type == RTM_NEWROUTE 
+		req.r.rtm_type == RTN_LOCAL;
+}
+
+static int
 netlink_process_route(struct nlmsghdr *h)
 {
 	struct sockaddr_storage addr;
@@ -455,6 +514,18 @@
 		return 0;
 	}
 
+	/* If local route was deleted, check if there is still local
+	 * route for the same IP on another interface */
+	if (h-nlmsg_type == RTM_DELROUTE 
+	netlink_route_is_local(rtm-rtm_family,
+   RTA_DATA(rta[RTA_DST]),
+   RTA_PAYLOAD(rta[RTA_DST]))) {
+		plog(LLV_DEBUG, LOCATION, NULL,
+			Netlink: not deleting %s yet, it exists still\n,
+			saddrwop2str((struct sockaddr *) addr));
+		return 0;
+	}
+
 	netlink_add_del_address(h-nlmsg_type == RTM_NEWROUTE,
 (struct sockaddr *) addr);
 	return 0;
@@ -518,9 +589,8 @@
 }
 
 static int
-kernel_open_socket()
+netlink_open_socket()
 {
-	struct sockaddr_nl nl;
 	int fd;
 
 	fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
@@ -535,6 +605,25 @@
 		plog(LLV_WARNING, LOCATION, NULL,
 		 failed to put socket in non-blocking mode\n);
 
+	return fd;
+}
+
+static int
+kernel_open_socket()
+{
+	struct sockaddr_nl nl;
+	int fd;
+
+	if (netlink_fd  0) {
+		netlink_fd = netlink_open_socket();
+		if (netlink_fd  0)
+			return -1;
+	}
+
+	fd = netlink_open_socket();
+	if (fd  0)
+		return fd;
+
 	/* We monitor IPv4 addresses using RTMGRP_IPV4_ROUTE group
 	 * the get the RTN_LOCAL routes which are automatically added
 	 * by kernel. This is because:



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

2010-12-03 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Dec  3 12:02:28 UTC 2010

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

Log Message:
Add missing files ./usr/tests/util/make/d_unmatchedvarparen.{mk,out}


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.166 src/distrib/sets/lists/tests/mi:1.167
--- src/distrib/sets/lists/tests/mi:1.166	Wed Dec  1 17:40:08 2010
+++ src/distrib/sets/lists/tests/mi	Fri Dec  3 12:02:28 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.166 2010/12/01 17:40:08 njoly Exp $
+# $NetBSD: mi,v 1.167 2010/12/03 12:02:28 hannken Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1815,6 +1815,8 @@
 ./usr/tests/util/make/d_qequals.out		tests-util-tests
 ./usr/tests/util/make/d_ternary.mk		tests-util-tests
 ./usr/tests/util/make/d_ternary.out		tests-util-tests
+./usr/tests/util/make/d_unmatchedvarparen.mk	tests-util-tests
+./usr/tests/util/make/d_unmatchedvarparen.out	tests-util-tests
 ./usr/tests/util/make/d_varcmd.mk		tests-util-tests
 ./usr/tests/util/make/d_varcmd.out		tests-util-tests
 ./usr/tests/util/make/t_make			tests-util-tests



CVS commit: src

2010-12-03 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Dec  3 13:11:50 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/stdlib: Makefile
Added Files:
src/tests/lib/libc/stdlib: t_strtox.c

Log Message:
Add testcase for PR/44189: strtod(3) wrong results with -0x.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/stdlib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/stdlib/t_strtox.c

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.167 src/distrib/sets/lists/tests/mi:1.168
--- src/distrib/sets/lists/tests/mi:1.167	Fri Dec  3 12:02:28 2010
+++ src/distrib/sets/lists/tests/mi	Fri Dec  3 13:11:50 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.167 2010/12/03 12:02:28 hannken Exp $
+# $NetBSD: mi,v 1.168 2010/12/03 13:11:50 njoly Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -328,6 +328,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_environment.debug	tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_environment_pth.debug	tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_mi_vector_hash.debug	tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_strtox.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/stringtests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_popcount.debug		tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/lib/libdestests-lib-debug
@@ -1528,6 +1529,7 @@
 ./usr/tests/lib/libc/stdlib/t_environment	tests-lib-tests		atf
 ./usr/tests/lib/libc/stdlib/t_environment_pth	tests-lib-tests		atf
 ./usr/tests/lib/libc/stdlib/t_mi_vector_hash	tests-lib-tests		atf
+./usr/tests/lib/libc/stdlib/t_strtox		tests-lib-tests		atf
 ./usr/tests/lib/libc/stdio			tests-lib-tests
 ./usr/tests/lib/libc/stdio/Atffile		tests-lib-tests		atf
 ./usr/tests/lib/libc/stdio/t_fmemopen		tests-lib-tests		atf

Index: src/tests/lib/libc/stdlib/Makefile
diff -u src/tests/lib/libc/stdlib/Makefile:1.4 src/tests/lib/libc/stdlib/Makefile:1.5
--- src/tests/lib/libc/stdlib/Makefile:1.4	Tue Nov 16 14:03:47 2010
+++ src/tests/lib/libc/stdlib/Makefile	Fri Dec  3 13:11:50 2010
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.4 2010/11/16 14:03:47 tron Exp $
+# $NetBSD: Makefile,v 1.5 2010/12/03 13:11:50 njoly Exp $
 
 .include bsd.own.mk
 
 TESTSDIR=	${TESTSBASE}/lib/libc/stdlib
 
 TESTS_C+=	t_mi_vector_hash t_environment t_environment_pth
+TESTS_C+=	t_strtox
 
 LDADD.t_environment_pth=	-pthread
 

Added files:

Index: src/tests/lib/libc/stdlib/t_strtox.c
diff -u /dev/null src/tests/lib/libc/stdlib/t_strtox.c:1.1
--- /dev/null	Fri Dec  3 13:11:50 2010
+++ src/tests/lib/libc/stdlib/t_strtox.c	Fri Dec  3 13:11:50 2010
@@ -0,0 +1,64 @@
+/*	$NetBSD: t_strtox.c,v 1.1 2010/12/03 13:11:50 njoly Exp $	*/
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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
+ * COPYRIGHT HOLDERS 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 sys/cdefs.h
+__RCSID($NetBSD: t_strtox.c,v 1.1 2010/12/03 13:11:50 njoly Exp $);
+
+#include atf-c.h
+#include stdlib.h
+
+ATF_TC(hexadecimal);
+
+ATF_TC_HEAD(hexadecimal, tc)
+{
+	atf_tc_set_md_var(tc, descr,
+	Test strtod with hexdecimal numbers);
+}
+
+ATF_TC_BODY(hexadecimal, tc)
+{
+	const char *str;
+	char *end;
+
+	str = -0x0;
+	ATF_REQUIRE(strtod(str, end) == -0.0  end == str+4);
+
+	atf_tc_expect_fail(PR/44189);
+	str = -0x;
+	ATF_REQUIRE(strtod(str, 

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

2010-12-03 Thread Timo Teräs
Module Name:src
Committed By:   tteras
Date:   Fri Dec  3 14:32:53 UTC 2010

Modified Files:
src/crypto/dist/ipsec-tools/src/libipsec: libpfkey.h pfkey_dump.c
src/crypto/dist/ipsec-tools/src/setkey: parse.y setkey.8

Log Message:
Support GRE key as upper layer protocol specifier (will be supported in
Linux kernel 2.6.38).


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/dist/ipsec-tools/src/libipsec/libpfkey.h \
src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c
cvs rdiff -u -r1.13 -r1.14 src/crypto/dist/ipsec-tools/src/setkey/parse.y
cvs rdiff -u -r1.25 -r1.26 src/crypto/dist/ipsec-tools/src/setkey/setkey.8

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/libipsec/libpfkey.h
diff -u src/crypto/dist/ipsec-tools/src/libipsec/libpfkey.h:1.17 src/crypto/dist/ipsec-tools/src/libipsec/libpfkey.h:1.18
--- src/crypto/dist/ipsec-tools/src/libipsec/libpfkey.h:1.17	Mon Aug 17 13:52:14 2009
+++ src/crypto/dist/ipsec-tools/src/libipsec/libpfkey.h	Fri Dec  3 14:32:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: libpfkey.h,v 1.17 2009/08/17 13:52:14 vanhu Exp $	*/
+/*	$NetBSD: libpfkey.h,v 1.18 2010/12/03 14:32:52 tteras Exp $	*/
 
 /* Id: libpfkey.h,v 1.13 2005/12/04 20:26:43 manubsd Exp */
 
@@ -210,6 +210,10 @@
 #define IPPROTO_IPCOMP IPPROTO_COMP
 #endif
 
+#ifndef IPPROTO_MH
+#define IPPROTO_MH		135
+#endif
+
 static __inline u_int8_t
 sysdep_sa_len (const struct sockaddr *sa)
 {
Index: src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c
diff -u src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c:1.17 src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c:1.18
--- src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c:1.17	Fri Apr  2 15:13:26 2010
+++ src/crypto/dist/ipsec-tools/src/libipsec/pfkey_dump.c	Fri Dec  3 14:32:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfkey_dump.c,v 1.17 2010/04/02 15:13:26 christos Exp $	*/
+/*	$NetBSD: pfkey_dump.c,v 1.18 2010/12/03 14:32:52 tteras Exp $	*/
 
 /*	$KAME: pfkey_dump.c,v 1.45 2003/09/08 10:14:56 itojun Exp $	*/
 
@@ -716,13 +716,19 @@
 	else
 		snprintf(prefbuf, sizeof(prefbuf), /%u, pref);
 
-	if (ulp == IPPROTO_ICMPV6)
+	switch (ulp) {
+	case IPPROTO_ICMP:
+	case IPPROTO_ICMPV6:
+	case IPPROTO_MH:
+	case IPPROTO_GRE:
 		memset(portbuf, 0, sizeof(portbuf));
-	else {
+		break;
+	default:
 		if (port == IPSEC_PORT_ANY)
-			snprintf(portbuf, sizeof(portbuf), [%s], any);
+			strcpy(portbuf, [any]);
 		else
 			snprintf(portbuf, sizeof(portbuf), [%u], port);
+		break;
 	}
 
 	snprintf(buf, sizeof(buf), %s%s, prefbuf, portbuf);
@@ -734,29 +740,26 @@
 str_upperspec(ulp, p1, p2)
 	u_int ulp, p1, p2;
 {
-	if (ulp == IPSEC_ULPROTO_ANY)
-		printf(any);
-	else if (ulp == IPPROTO_ICMPV6) {
-		printf(icmp6);
-		if (!(p1 == IPSEC_PORT_ANY  p2 == IPSEC_PORT_ANY))
-			printf( %u,%u, p1, p2);
-	} else {
-		struct protoent *ent;
+	struct protoent *ent;
 
-		switch (ulp) {
-		case IPPROTO_IPV4:
-			printf(ip4);
-			break;
-		default:
-			ent = getprotobynumber((int)ulp);
-			if (ent)
-printf(%s, ent-p_name);
-			else
-printf(%u, ulp);
+	ent = getprotobynumber((int)ulp);
+	if (ent)
+		printf(%s, ent-p_name);
+	else
+		printf(%u, ulp);
 
-			endprotoent();
-			break;
-		}
+	if (p1 == IPSEC_PORT_ANY  p2 == IPSEC_PORT_ANY)
+		return;
+
+	switch (ulp) {
+	case IPPROTO_ICMP:
+	case IPPROTO_ICMPV6:
+	case IPPROTO_MH:
+		printf( %u,%u, p1, p2);
+		break;
+	case IPPROTO_GRE:
+		printf( %u, (p1  16) + p2);
+		break;
 	}
 }
 

Index: src/crypto/dist/ipsec-tools/src/setkey/parse.y
diff -u src/crypto/dist/ipsec-tools/src/setkey/parse.y:1.13 src/crypto/dist/ipsec-tools/src/setkey/parse.y:1.14
--- src/crypto/dist/ipsec-tools/src/setkey/parse.y:1.13	Fri Jun  4 13:06:03 2010
+++ src/crypto/dist/ipsec-tools/src/setkey/parse.y	Fri Dec  3 14:32:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.y,v 1.13 2010/06/04 13:06:03 vanhu Exp $	*/
+/*	$NetBSD: parse.y,v 1.14 2010/12/03 14:32:52 tteras Exp $	*/
 
 /*	$KAME: parse.y,v 1.81 2003/07/01 04:01:48 itojun Exp $	*/
 
@@ -57,10 +57,6 @@
 #include vchar.h
 #include extern.h
 
-#ifndef IPPROTO_MH
-#define IPPROTO_MH		135
-#endif
-
 #define DEFAULT_NATT_PORT	4500
 
 #ifndef UDP_ENCAP_ESPINUDP
@@ -95,7 +91,7 @@
 static int p_aiflags = 0, p_aifamily = PF_UNSPEC;
 
 static struct addrinfo *parse_addr __P((char *, char *));
-static int fix_portstr __P((vchar_t *, vchar_t *, vchar_t *));
+static int fix_portstr __P((int, vchar_t *, vchar_t *, vchar_t *));
 static int setvarbuf __P((char *, int *, struct sadb_ext *, int, 
 const void *, int));
 void parse_init __P((void));
@@ -584,16 +580,8 @@
 #endif
 
 			/* fixed port fields if ulp is icmp */
-			if ($10.buf != NULL) {
-if (($9 != IPPROTO_ICMPV6) 
-	($9 != IPPROTO_ICMP) 
-	($9 != IPPROTO_MH))
-	return -1;
-free($5.buf);
-free($8.buf);
-if (fix_portstr($10, $5, $8))
-	return -1;
-			}
+			if (fix_portstr($9, $10, 

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

2010-12-03 Thread Timo Teräs
Module Name:src
Committed By:   tteras
Date:   Fri Dec  3 15:01:11 UTC 2010

Modified Files:
src/crypto/dist/ipsec-tools/src/libipsec: ipsec_dump_policy.c

Log Message:
Recognize direction for Linux per-socket policies.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/crypto/dist/ipsec-tools/src/libipsec/ipsec_dump_policy.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/libipsec/ipsec_dump_policy.c
diff -u src/crypto/dist/ipsec-tools/src/libipsec/ipsec_dump_policy.c:1.8 src/crypto/dist/ipsec-tools/src/libipsec/ipsec_dump_policy.c:1.9
--- src/crypto/dist/ipsec-tools/src/libipsec/ipsec_dump_policy.c:1.8	Wed Jul 18 12:07:50 2007
+++ src/crypto/dist/ipsec-tools/src/libipsec/ipsec_dump_policy.c	Fri Dec  3 15:01:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_dump_policy.c,v 1.8 2007/07/18 12:07:50 vanhu Exp $	*/
+/*	$NetBSD: ipsec_dump_policy.c,v 1.9 2010/12/03 15:01:11 tteras Exp $	*/
 
 /* Id: ipsec_dump_policy.c,v 1.10 2005/06/29 09:12:37 manubsd Exp */
 
@@ -53,7 +53,10 @@
 #include libpfkey.h
 
 static const char *ipsp_dir_strs[] = {
-	any, in, out, fwd
+	any, in, out, fwd,
+#ifdef __linux__
+	in(socket), out(socket)
+#endif
 };
 
 static const char *ipsp_policy_strs[] = {
@@ -165,6 +168,8 @@
 	case IPSEC_DIR_OUTBOUND:
 #ifdef HAVE_POLICY_FWD
 	case IPSEC_DIR_FWD:
+	case IPSEC_DIR_FWD + 1:
+	case IPSEC_DIR_FWD + 2:
 #endif
 		break;
 	default:



CVS commit: src

2010-12-03 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Dec  3 17:57:43 UTC 2010

Modified Files:
src/distrib/sets/lists/base: mi
src/share/wscons/keymaps: Makefile

Log Message:
Make sure the new ukbd.any.powerbook keymap is just compiled for macppc.
So it can be removed from distrib/sets/lists/base/mi again.


To generate a diff of this commit:
cvs rdiff -u -r1.890 -r1.891 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.16 -r1.17 src/share/wscons/keymaps/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.890 src/distrib/sets/lists/base/mi:1.891
--- src/distrib/sets/lists/base/mi:1.890	Thu Dec  2 02:58:28 2010
+++ src/distrib/sets/lists/base/mi	Fri Dec  3 17:57:43 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.890 2010/12/02 02:58:28 pgoyette Exp $
+# $NetBSD: mi,v 1.891 2010/12/03 17:57:43 phx Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -4105,7 +4105,6 @@
 ./usr/share/wscons/keymaps/pckbd.pl.iso8859-2	base-util-share		share
 ./usr/share/wscons/keymaps/pckbd.ru.koi8-r	base-util-share		share
 ./usr/share/wscons/keymaps/pckbd.sv.svascii	base-util-share		share
-./usr/share/wscons/keymaps/ukbd.any.powerbook	base-util-share		share
 ./usr/share/wscons/keymaps/ukbd.be.azerty	base-util-share		share
 ./usr/share/zoneinfobase-sys-share
 ./usr/share/zoneinfo/Africa			base-sys-share

Index: src/share/wscons/keymaps/Makefile
diff -u src/share/wscons/keymaps/Makefile:1.16 src/share/wscons/keymaps/Makefile:1.17
--- src/share/wscons/keymaps/Makefile:1.16	Wed Dec  1 17:48:04 2010
+++ src/share/wscons/keymaps/Makefile	Fri Dec  3 17:57:43 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2010/12/01 17:48:04 phx Exp $
+# $NetBSD: Makefile,v 1.17 2010/12/03 17:57:43 phx Exp $
 
 NOOBJ=	# defined
 
@@ -13,8 +13,11 @@
 	pckbd.pl.iso8859-2 \
 	pckbd.ru.koi8-r \
 	pckbd.sv.svascii \
-	ukbd.be.azerty \
-	ukbd.any.powerbook
+	ukbd.be.azerty
+
+.if ${MACHINE} == macppc
+FILES+=	ukbd.any.powerbook
+.endif
 
 FILESDIR= /usr/share/wscons/keymaps
 



CVS commit: src/tests/lib/csu/arch

2010-12-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Dec  3 20:51:21 UTC 2010

Added Files:
src/tests/lib/csu/arch/i386: h_initfini_align.S
src/tests/lib/csu/arch/x86_64: h_initfini_align.S

Log Message:
Actually add the check_stack_alignment implementation for x86.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/i386/h_initfini_align.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/arch/x86_64/h_initfini_align.S

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

Added files:

Index: src/tests/lib/csu/arch/i386/h_initfini_align.S
diff -u /dev/null src/tests/lib/csu/arch/i386/h_initfini_align.S:1.1
--- /dev/null	Fri Dec  3 20:51:21 2010
+++ src/tests/lib/csu/arch/i386/h_initfini_align.S	Fri Dec  3 20:51:21 2010
@@ -0,0 +1,15 @@
+/*	$NetBSD: h_initfini_align.S,v 1.1 2010/12/03 20:51:21 joerg Exp $	*/
+
+#include machine/asm.h
+
+RCSID($NetBSD: h_initfini_align.S,v 1.1 2010/12/03 20:51:21 joerg Exp $)
+
+_ENTRY(check_stack_alignment)
+	movl	%esp, %eax
+	andl	$3, %eax
+	jz 1f
+	xorl	%eax, %eax
+	ret
+1:
+	incl	%eax
+	ret

Index: src/tests/lib/csu/arch/x86_64/h_initfini_align.S
diff -u /dev/null src/tests/lib/csu/arch/x86_64/h_initfini_align.S:1.1
--- /dev/null	Fri Dec  3 20:51:21 2010
+++ src/tests/lib/csu/arch/x86_64/h_initfini_align.S	Fri Dec  3 20:51:21 2010
@@ -0,0 +1,16 @@
+/*	$NetBSD: h_initfini_align.S,v 1.1 2010/12/03 20:51:21 joerg Exp $	*/
+
+#include machine/asm.h
+
+RCSID($NetBSD: h_initfini_align.S,v 1.1 2010/12/03 20:51:21 joerg Exp $)
+
+_ENTRY(check_stack_alignment)
+	movl	%esp, %eax
+	andl	$15, %eax
+	subl	$8, %eax
+	jz 1f
+	xorl	%eax, %eax
+	ret
+1:
+	incl	%eax
+	ret



CVS commit: src

2010-12-03 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Fri Dec  3 21:38:49 UTC 2010

Modified Files:
src: Makefile
src/compat: compatsubdir.mk
src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.amd64
md.sparc64
src/distrib/sets/lists/comp: ad.mips64eb ad.mips64el md.amd64
md.sparc64
src/external: Makefile
src/external/bsd/libdwarf: prepare-import.sh
src/external/bsd/libelf: prepare-import.sh
src/external/bsd/libevent: prepare-import.sh
src/gnu: Makefile
src/lib: Makefile
Removed Files:
src/crypto/external/lib: Makefile
src/external/lib: Makefile
src/gnu/lib: Makefile

Log Message:
Remove the do-external-lib and do-gnu-lib targets, along with
external/lib/Makefile and crypto/external/lib/Makefile, replacing
them all with SUBDIRs directly from lib/Makefile.

compat/compatsubdirs.mk becomes simpler now, as everything is built
from lib/Makefile, meaning all the libraries will now be built under
compat so update the set lists to account for that.


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/Makefile
cvs rdiff -u -r1.4 -r1.5 src/compat/compatsubdir.mk
cvs rdiff -u -r1.6 -r0 src/crypto/external/lib/Makefile
cvs rdiff -u -r1.29 -r1.30 src/distrib/sets/lists/base/ad.mips64eb
cvs rdiff -u -r1.27 -r1.28 src/distrib/sets/lists/base/ad.mips64el
cvs rdiff -u -r1.101 -r1.102 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.95 -r1.96 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.13 -r1.14 src/distrib/sets/lists/comp/ad.mips64eb \
src/distrib/sets/lists/comp/ad.mips64el
cvs rdiff -u -r1.81 -r1.82 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.71 -r1.72 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.14 -r1.15 src/external/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libdwarf/prepare-import.sh
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libelf/prepare-import.sh
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libevent/prepare-import.sh
cvs rdiff -u -r1.17 -r0 src/external/lib/Makefile
cvs rdiff -u -r1.16 -r1.17 src/gnu/Makefile
cvs rdiff -u -r1.47 -r0 src/gnu/lib/Makefile
cvs rdiff -u -r1.154 -r1.155 src/lib/Makefile

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

Modified files:

Index: src/Makefile
diff -u src/Makefile:1.280 src/Makefile:1.281
--- src/Makefile:1.280	Sun Nov 28 18:40:54 2010
+++ src/Makefile	Fri Dec  3 21:38:46 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.280 2010/11/28 18:40:54 skrll Exp $
+#	$NetBSD: Makefile,v 1.281 2010/12/03 21:38:46 plunky Exp $
 
 #
 # This is the top-level makefile for building NetBSD. For an outline of
@@ -91,8 +91,6 @@
 #external/bsd/pcc/libpcc.
 #   do-lib-libc: builds and installs prerequisites from lib/libc.
 #   do-lib:  builds and installs prerequisites from lib.
-#   do-gnu-lib:  builds and installs prerequisites from gnu/lib.
-#   do-external-lib: builds and installs prerequisites from external/lib.
 #   do-sys-rump-dev-lib: builds and installs prerequisites from sys/rump/dev/lib
 #   do-sys-rump-fs-lib:  builds and installs prerequisites from sys/rump/fs/lib
 #   do-sys-rump-kern-lib:  builds and installs prereq. from sys/rump/kern/lib
@@ -240,7 +238,7 @@
 BUILDTARGET+=	do-libpcc
 .endif
 BUILDTARGETS+=	do-lib-libc
-BUILDTARGETS+=	do-lib do-gnu-lib do-external-lib
+BUILDTARGETS+=	do-lib
 .if (${MACHINE} != evbppc)  ${MKKMOD} != no
 BUILDTARGETS+=	do-sys-modules
 .endif
@@ -419,7 +417,7 @@
 BUILD_CC_LIB+= external/bsd/pcc/libpcc
 .endif
 
-.for dir in tools tools/compat lib/csu ${BUILD_CC_LIB} lib/libc lib gnu/lib external/lib crypto/external/lib sys/rump/dev/lib sys/rump/fs/lib sys/rump/kern/lib sys/rump/net/lib sys/modules
+.for dir in tools tools/compat lib/csu ${BUILD_CC_LIB} lib/libc lib sys/rump/dev/lib sys/rump/fs/lib sys/rump/kern/lib sys/rump/net/lib sys/modules
 do-${dir:S/\//-/g}: .PHONY .MAKE
 .for targ in dependall install
 	${MAKEDIRTARGET} ${dir} ${targ}
@@ -430,7 +428,7 @@
 COMPAT_SUBDIR_LIST=lib/csu ${BUILD_CC_LIB} lib/libc
 .for dir in ${COMPAT_SUBDIR_LIST}
 do-compat-${dir:S/\//-/g}: .PHONY .MAKE
-.for targ in obj dependall install
+.for targ in dependall install
 	${MAKEDIRTARGET} compat ${targ} BOOTSTRAP_SUBDIRS=../../../${dir}
 .endfor
 .endfor

Index: src/compat/compatsubdir.mk
diff -u src/compat/compatsubdir.mk:1.4 src/compat/compatsubdir.mk:1.5
--- src/compat/compatsubdir.mk:1.4	Tue Nov  2 16:34:33 2010
+++ src/compat/compatsubdir.mk	Fri Dec  3 21:38:48 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: compatsubdir.mk,v 1.4 2010/11/02 16:34:33 joerg Exp $
+#	$NetBSD: compatsubdir.mk,v 1.5 2010/12/03 21:38:48 plunky Exp $
 
 # Build netbsd libraries.
 
@@ -13,39 +13,11 @@
 # XXX make this use MAKEOBJDIR
 MAKEDIRTARGETENV=	MAKEOBJDIRPREFIX=${.OBJDIR} MKOBJDIRS=yes MKSHARE=no BSD_MK_COMPAT_FILE=${BSD_MK_COMPAT_FILE}
 
-# XXX fix the library list to include all 'external' libs?
 

CVS commit: src/etc

2010-12-03 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Fri Dec  3 21:40:04 UTC 2010

Modified Files:
src/etc: passwd.conf

Log Message:
Set the default localcypher to sha1 as discussed in current-us...@.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/etc/passwd.conf

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

Modified files:

Index: src/etc/passwd.conf
diff -u src/etc/passwd.conf:1.2 src/etc/passwd.conf:1.3
--- src/etc/passwd.conf:1.2	Mon Apr 15 07:48:00 2002
+++ src/etc/passwd.conf	Fri Dec  3 21:40:04 2010
@@ -1,9 +1,9 @@
-#	$NetBSD: passwd.conf,v 1.2 2002/04/15 07:48:00 ad Exp $
+#	$NetBSD: passwd.conf,v 1.3 2010/12/03 21:40:04 jmmv Exp $
 #
 # passwd.conf(5) -
 #	password configuration file
 #
 
-#default:
-#	localcipher = md5
-#	ypcipher = old
+default:
+	localcipher = sha1
+	ypcipher = old



CVS commit: src/share/man/man5

2010-12-03 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Fri Dec  3 21:41:40 UTC 2010

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

Log Message:
Document what the default values for localcipher and ypcipher are.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man5/passwd.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/passwd.conf.5
diff -u src/share/man/man5/passwd.conf.5:1.9 src/share/man/man5/passwd.conf.5:1.10
--- src/share/man/man5/passwd.conf.5:1.9	Sat Oct  3 12:45:15 2009
+++ src/share/man/man5/passwd.conf.5	Fri Dec  3 21:41:40 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: passwd.conf.5,v 1.9 2009/10/03 12:45:15 zafer Exp $
+.\	$NetBSD: passwd.conf.5,v 1.10 2010/12/03 21:41:40 jmmv Exp $
 .\
 .\ Copyright 1997 Niels Provos pro...@physnet.uni-hamburg.de
 .\ All rights reserved.
@@ -28,7 +28,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd September 4, 2005
+.Dd December 3, 2010
 .Dt PASSWD.CONF 5
 .Os
 .Sh NAME
@@ -57,6 +57,7 @@
 .Bl -tag -width localcipher
 .It Sy localcipher
 The cipher to use for local passwords.
+.Pp
 Possible values are:
 .Dq old ,
 .Dq newsalt,\*[Lt]rounds\*[Gt] ,
@@ -75,9 +76,16 @@
 .Dq blowfish
 the value can be between 4 and 31.
 It specifies the base 2 logarithm of the number of rounds.
+.Pp
+If not specified, the default value is
+.Dq old .
 .It Sy ypcipher
 The cipher to use for YP passwords.
+.Pp
 The possible values are the same as for localcipher.
+.Pp
+If not specified, the default value is
+.Dq old .
 .El
 .Pp
 To retrieve information from this file use
@@ -87,11 +95,11 @@
 .It Pa /etc/passwd.conf
 .El
 .Sh EXAMPLES
-Use MD5 as the local cipher and old-style DES as the YP cipher.
+Use SHA1 as the local cipher and old-style DES as the YP cipher.
 Use blowfish with 2^5 rounds for root:
 .Bd -literal
  default:
-  localcipher = md5
+  localcipher = sha1
   ypcipher = old
 
  root:
@@ -107,3 +115,12 @@
 .Nm
 configuration file first appeared in
 .Nx 1.6 .
+.Pp
+The default value of
+.Sy localcipher
+was set to
+.Dq sha1
+in
+.Pa /etc/passwd.conf
+starting from
+.Nx 6.0 .



CVS commit: src/libexec/ld.elf_so/arch/x86_64

2010-12-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Dec  3 22:48:25 UTC 2010

Modified Files:
src/libexec/ld.elf_so/arch/x86_64: rtld_start.S

Log Message:
Add comment about the unusual stack alignment in .rtld_bind_start.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/libexec/ld.elf_so/arch/x86_64/rtld_start.S

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

Modified files:

Index: src/libexec/ld.elf_so/arch/x86_64/rtld_start.S
diff -u src/libexec/ld.elf_so/arch/x86_64/rtld_start.S:1.6 src/libexec/ld.elf_so/arch/x86_64/rtld_start.S:1.7
--- src/libexec/ld.elf_so/arch/x86_64/rtld_start.S:1.6	Fri Feb 28 22:37:35 2003
+++ src/libexec/ld.elf_so/arch/x86_64/rtld_start.S	Fri Dec  3 22:48:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld_start.S,v 1.6 2003/02/28 22:37:35 mycroft Exp $	*/
+/*	$NetBSD: rtld_start.S,v 1.7 2010/12/03 22:48:25 joerg Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -67,6 +67,9 @@
 	.globl	_rtld_bind_start
 	.type	_rtld_bind_start,@function
 _rtld_bind_start:	# (obj, reloff)
+	# This function is called with a misaligned stack from the PLT
+	# due to the additional argument pushed.
+	# At this point %rsp % 16 == 8.
 	pushfq# save caller-saved registers
 	pushq	%rax
 	pushq	%rcx