CVS commit: src/usr.sbin/ndp

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 14 06:52:41 UTC 2018

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

Log Message:
Use .Cm instead of .Li, same as arp.8.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/ndp/ndp.8

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

Modified files:

Index: src/usr.sbin/ndp/ndp.8
diff -u src/usr.sbin/ndp/ndp.8:1.27 src/usr.sbin/ndp/ndp.8:1.28
--- src/usr.sbin/ndp/ndp.8:1.27	Thu Jun  5 16:06:49 2014
+++ src/usr.sbin/ndp/ndp.8	Wed Feb 14 06:52:41 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ndp.8,v 1.27 2014/06/05 16:06:49 roy Exp $
+.\"	$NetBSD: ndp.8,v 1.28 2018/02/14 06:52:41 maxv Exp $
 .\"	$KAME: ndp.8,v 1.33 2005/10/19 14:57:42 suz Exp $
 .\"
 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -28,7 +28,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd June 5, 2014
+.Dd February 14, 2018
 .Dt NDP 8
 .Os
 .\"
@@ -247,10 +247,10 @@ Flush all the entries in the default rou
 .It Fl s
 Register an NDP entry for a node.
 The entry will be permanent unless the word
-.Li temp
+.Cm temp
 is given in the command.
 If the word
-.Li proxy
+.Cm proxy
 is given, this system will act as a proxy NDP server,
 responding to requests for
 .Ar hostname



CVS commit: src/sys/netinet6

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 14 05:29:39 UTC 2018

Modified Files:
src/sys/netinet6: ip6_input.c ip6_var.h

Log Message:
Re-make ip6_nexthdr global, it will be used in soon-to-be-added code...


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/netinet6/ip6_input.c
cvs rdiff -u -r1.79 -r1.80 src/sys/netinet6/ip6_var.h

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

Modified files:

Index: src/sys/netinet6/ip6_input.c
diff -u src/sys/netinet6/ip6_input.c:1.191 src/sys/netinet6/ip6_input.c:1.192
--- src/sys/netinet6/ip6_input.c:1.191	Mon Feb 12 12:52:12 2018
+++ src/sys/netinet6/ip6_input.c	Wed Feb 14 05:29:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_input.c,v 1.191 2018/02/12 12:52:12 maxv Exp $	*/
+/*	$NetBSD: ip6_input.c,v 1.192 2018/02/14 05:29:39 maxv Exp $	*/
 /*	$KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.191 2018/02/12 12:52:12 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_input.c,v 1.192 2018/02/14 05:29:39 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_gateway.h"
@@ -1402,7 +1402,7 @@ ip6_get_prevhdr(struct mbuf *m, int off)
 /*
  * get next header offset.  m will be retained.
  */
-static int
+int
 ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp)
 {
 	struct ip6_hdr ip6;

Index: src/sys/netinet6/ip6_var.h
diff -u src/sys/netinet6/ip6_var.h:1.79 src/sys/netinet6/ip6_var.h:1.80
--- src/sys/netinet6/ip6_var.h:1.79	Tue Jan 30 15:54:02 2018
+++ src/sys/netinet6/ip6_var.h	Wed Feb 14 05:29:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_var.h,v 1.79 2018/01/30 15:54:02 maxv Exp $	*/
+/*	$NetBSD: ip6_var.h,v 1.80 2018/02/14 05:29:39 maxv Exp $	*/
 /*	$KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $	*/
 
 /*
@@ -287,6 +287,7 @@ void	ip6_freepcbopts(struct ip6_pktopts 
 void	ip6_freemoptions(struct ip6_moptions *);
 int	ip6_unknown_opt(u_int8_t *, struct mbuf *, int);
 int	ip6_get_prevhdr(struct mbuf *, int);
+int	ip6_nexthdr(struct mbuf *, int, int, int *);
 int	ip6_lasthdr(struct mbuf *, int, int, int *);
 
 struct m_tag *ip6_addaux(struct mbuf *);



CVS commit: src/sys/netinet

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 14 05:24:44 UTC 2018

Modified Files:
src/sys/netinet: udp_usrreq.c

Log Message:
Revert my two last changes in this file. They are apparently causing
problems with racoon, I'll investigate this later.


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 src/sys/netinet/udp_usrreq.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/netinet/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.241 src/sys/netinet/udp_usrreq.c:1.242
--- src/sys/netinet/udp_usrreq.c:1.241	Mon Feb 12 09:31:06 2018
+++ src/sys/netinet/udp_usrreq.c	Wed Feb 14 05:24:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_usrreq.c,v 1.241 2018/02/12 09:31:06 maxv Exp $	*/
+/*	$NetBSD: udp_usrreq.c,v 1.242 2018/02/14 05:24:44 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.241 2018/02/12 09:31:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.242 2018/02/14 05:24:44 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -139,7 +139,7 @@ percpu_t *udpstat_percpu;
 
 #ifdef INET
 #ifdef IPSEC
-static void udp4_espinudp(struct mbuf *, int, struct sockaddr *,
+static int udp4_espinudp(struct mbuf **, int, struct sockaddr *,
 struct socket *);
 #endif
 static void udp4_sendup(struct mbuf *, int, struct sockaddr *,
@@ -405,6 +405,14 @@ udp_input(struct mbuf *m, ...)
 		return;
 	}
 
+	ip = mtod(m, struct ip *);
+	IP6_EXTHDR_GET(uh, struct udphdr *, m, iphlen, sizeof(struct udphdr));
+	if (uh == NULL) {
+		UDP_STATINC(UDP_STAT_HDROPS);
+		return;
+	}
+	/* XXX Re-enforce alignment? */
+
 #ifdef INET6
 	if (IN_MULTICAST(ip->ip_dst.s_addr) || n == 0) {
 		struct sockaddr_in6 src6, dst6;
@@ -598,9 +606,25 @@ udp4_realinput(struct sockaddr_in *src, 
 		/* Handle ESP over UDP */
 		if (inp->inp_flags & INP_ESPINUDP_ALL) {
 			struct sockaddr *sa = (struct sockaddr *)src;
-			udp4_espinudp(m, off, sa, inp->inp_socket);
-			*mp = NULL;
-			goto bad;
+
+			switch (udp4_espinudp(mp, off, sa, inp->inp_socket)) {
+			case -1: /* Error, m was freed */
+rcvcnt = -1;
+goto bad;
+
+			case 1: /* ESP over UDP */
+rcvcnt++;
+goto bad;
+
+			case 0: /* plain UDP */
+			default: /* Unexpected */
+/*
+ * Normal UDP processing will take place,
+ * m may have changed.
+ */
+m = *mp;
+break;
+			}
 		}
 #endif
 
@@ -1222,10 +1246,13 @@ udp_statinc(u_int stat)
 
 #if defined(INET) && defined(IPSEC)
 /*
- * This function always frees the mbuf.
+ * Returns:
+ * 1 if the packet was processed
+ * 0 if normal UDP processing should take place
+ *-1 if an error occurred and m was freed
  */
-static void
-udp4_espinudp(struct mbuf *m, int off, struct sockaddr *src,
+static int
+udp4_espinudp(struct mbuf **mp, int off, struct sockaddr *src,
 struct socket *so)
 {
 	size_t len;
@@ -1238,6 +1265,7 @@ udp4_espinudp(struct mbuf *m, int off, s
 	struct m_tag *tag;
 	struct udphdr *udphdr;
 	u_int16_t sport, dport;
+	struct mbuf *m = *mp;
 
 	/*
 	 * Collapse the mbuf chain if the first mbuf is too short
@@ -1248,9 +1276,10 @@ udp4_espinudp(struct mbuf *m, int off, s
 		minlen = m->m_pkthdr.len;
 
 	if (m->m_len < minlen) {
-		if ((m = m_pullup(m, minlen)) == NULL) {
-			return;
+		if ((*mp = m_pullup(m, minlen)) == NULL) {
+			return -1;
 		}
+		m = *mp;
 	}
 
 	len = m->m_len - off;
@@ -1259,7 +1288,9 @@ udp4_espinudp(struct mbuf *m, int off, s
 
 	/* Ignore keepalive packets */
 	if ((len == 1) && (*(unsigned char *)data == 0xff)) {
-		goto out;
+		m_freem(m);
+		*mp = NULL; /* avoid any further processing by caller ... */
+		return 1;
 	}
 
 	/*
@@ -1270,9 +1301,8 @@ udp4_espinudp(struct mbuf *m, int off, s
 	if (inp->inp_flags & INP_ESPINUDP) {
 		u_int32_t *st = (u_int32_t *)data;
 
-		if ((len <= sizeof(struct esp)) || (*st == 0)) {
-			goto out;
-		}
+		if ((len <= sizeof(struct esp)) || (*st == 0))
+			return 0; /* Normal UDP processing */
 
 		skip = sizeof(struct udphdr);
 	}
@@ -1281,9 +1311,8 @@ udp4_espinudp(struct mbuf *m, int off, s
 		u_int32_t *st = (u_int32_t *)data;
 
 		if ((len <= sizeof(u_int64_t) + sizeof(struct esp)) ||
-		((st[0] | st[1]) != 0)) {
-			goto out;
-		}
+		((st[0] | st[1]) != 0))
+			return 0; /* Normal UDP processing */
 
 		skip = sizeof(struct udphdr) + sizeof(u_int64_t);
 	}
@@ -1330,7 +1359,8 @@ udp4_espinudp(struct mbuf *m, int off, s
 	 */
 	if ((tag = m_tag_get(PACKET_TAG_IPSEC_NAT_T_PORTS,
 	sizeof(sport) + sizeof(dport), M_DONTWAIT)) == NULL) {
-		goto out;
+		m_freem(m);
+		return -1;
 	}
 	((u_int16_t *)(tag + 1))[0] = sport;
 	((u_int16_t *)(tag + 1))[1] = dport;
@@ -1341,11 +1371,9 @@ udp4_espinudp(struct mbuf *m, int off, s
 	else
 		m_freem(m);
 
-	return;
-
-out:
-	m_freem(m);
-	return;
+	/* We handled it, it shouldn't be handled by UDP */
+	*mp = NULL; /* 

CVS commit: src/sys/kern

2018-02-13 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Feb 14 03:56:26 UTC 2018

Modified Files:
src/sys/kern: subr_lockdebug.c

Log Message:
Use cpu_softintr_p


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/kern/subr_lockdebug.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/kern/subr_lockdebug.c
diff -u src/sys/kern/subr_lockdebug.c:1.58 src/sys/kern/subr_lockdebug.c:1.59
--- src/sys/kern/subr_lockdebug.c:1.58	Sat Sep 16 23:55:33 2017
+++ src/sys/kern/subr_lockdebug.c	Wed Feb 14 03:56:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_lockdebug.c,v 1.58 2017/09/16 23:55:33 christos Exp $	*/
+/*	$NetBSD: subr_lockdebug.c,v 1.59 2018/02/14 03:56:26 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.58 2017/09/16 23:55:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.59 2018/02/14 03:56:26 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -369,7 +369,7 @@ lockdebug_more(int s)
 	 * Can't call kmem_alloc() if in interrupt context.  XXX We could
 	 * deadlock, because we don't know which locks the caller holds.
 	 */
-	if (cpu_intr_p() || (curlwp->l_pflag & LP_INTR) != 0) {
+	if (cpu_intr_p() || cpu_softintr_p()) {
 		return s;
 	}
 



CVS commit: src/external/gpl3/gcc/lib/libubsan

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 03:37:39 UTC 2018

Modified Files:
src/external/gpl3/gcc/lib/libubsan: Makefile

Log Message:
need -lrt for shm_{open,close}


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc/lib/libubsan/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/lib/libubsan/Makefile
diff -u src/external/gpl3/gcc/lib/libubsan/Makefile:1.4 src/external/gpl3/gcc/lib/libubsan/Makefile:1.5
--- src/external/gpl3/gcc/lib/libubsan/Makefile:1.4	Sat Feb  3 20:16:33 2018
+++ src/external/gpl3/gcc/lib/libubsan/Makefile	Tue Feb 13 22:37:39 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2018/02/04 01:16:33 mrg Exp $
+#	$NetBSD: Makefile,v 1.5 2018/02/14 03:37:39 christos Exp $
 
 UNSUPPORTED_COMPILER.clang=	# defined
 
@@ -28,6 +28,7 @@ COPTS.${_s}.cc+=-frtti
 
 LIB=	ubsan
 SRCS+=	${UBSAN_SRCS}
+LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
 
 .if ${MACHINE_ARCH} == "vax"
 COPTS += -O1



CVS commit: src/external/gpl3/gcc/lib/libasan

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 02:12:36 UTC 2018

Modified Files:
src/external/gpl3/gcc/lib/libasan: Makefile

Log Message:
depend on librt for shm_{open,close}


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/gpl3/gcc/lib/libasan/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/lib/libasan/Makefile
diff -u src/external/gpl3/gcc/lib/libasan/Makefile:1.20 src/external/gpl3/gcc/lib/libasan/Makefile:1.21
--- src/external/gpl3/gcc/lib/libasan/Makefile:1.20	Tue Feb  6 21:32:39 2018
+++ src/external/gpl3/gcc/lib/libasan/Makefile	Tue Feb 13 21:12:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2018/02/07 02:32:39 mrg Exp $
+# $NetBSD: Makefile,v 1.21 2018/02/14 02:12:35 christos Exp $
 
 UNSUPPORTED_COMPILER.clang=	# defined
 
@@ -37,6 +37,7 @@ asan_win_dynamic_runtime_thunk.cc
 
 LIB=	asan
 SRCS+=	${ASAN_SRCS}
+LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
 
 .if ${MACHINE_ARCH} == "vax"
 COPTS.asan_allocator.cc += -O1



CVS commit: src/external/gpl3/gcc/lib

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 02:12:07 UTC 2018

Modified Files:
src/external/gpl3/gcc/lib: Makefile.sanitizer

Log Message:
Asan needs bits and pieces of ubsan now; go figure.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/lib/Makefile.sanitizer

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

Modified files:

Index: src/external/gpl3/gcc/lib/Makefile.sanitizer
diff -u src/external/gpl3/gcc/lib/Makefile.sanitizer:1.3 src/external/gpl3/gcc/lib/Makefile.sanitizer:1.4
--- src/external/gpl3/gcc/lib/Makefile.sanitizer:1.3	Sat Feb  3 20:16:32 2018
+++ src/external/gpl3/gcc/lib/Makefile.sanitizer	Tue Feb 13 21:12:07 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.sanitizer,v 1.3 2018/02/04 01:16:32 mrg Exp $
+#	$NetBSD: Makefile.sanitizer,v 1.4 2018/02/14 02:12:07 christos Exp $
 
 SANITIZER=${GCCDIST}/libsanitizer
 .PATH: ${SANITIZER}/interception ${SANITIZER}/sanitizer_common
@@ -9,7 +9,7 @@ interception_mac.cc \
 interception_type_test.cc \
 interception_win.cc
 
-SANITIZER_SRCS= \
+SANITIZER_SRCS+= \
 sanitizer_allocator.cc \
 sanitizer_common.cc \
 sanitizer_common_libcdep.cc \
@@ -52,10 +52,17 @@ sanitizer_tls_get_addr.cc \
 sanitizer_unwind_linux_libcdep.cc \
 sanitizer_win.cc
 
+.PATH: ${SANITIZER}/ubsan
+UBSAN_SRCS+= \
+ubsan_diag.cc \
+ubsan_init.cc \
+ubsan_flags.cc \
+ubsan_value.cc
+
 # The linux build does this to avoid preinit sections on shared libraries
 CSHLIBFLAGS+= -DPIC
 
-SRCS+=	${INTERCEPTION_SRCS} ${SANITIZER_SRCS}
+SRCS+=	${INTERCEPTION_SRCS} ${SANITIZER_SRCS} ${UBSAN_SRCS}
 CPPFLAGS+=-I${SANITIZER}/include -I${SANITIZER}
 CPPFLAGS.sanitizer_netbsd.cc+=-I${GCCDIST}/gcc/ginclude
 CPPFLAGS+=-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/asan

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 02:11:22 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_interceptors.cc

Log Message:
our __csa_atexit does not like NULL dso; use atexit(3) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.3	Thu Feb  1 22:41:11 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc	Tue Feb 13 21:11:22 2018
@@ -705,10 +705,17 @@ INTERCEPTOR(long long, atoll, const char
 }
 #endif  // ASAN_INTERCEPT_ATOLL_AND_STRTOLL
 
+#ifdef SANITIZER_NETBSD
+extern "C" void atexit(void (*)(void));
+static void Atexit(void) {
+  StopInitOrderChecking();
+}
+#else
 static void AtCxaAtexit(void *unused) {
   (void)unused;
   StopInitOrderChecking();
 }
+#endif
 
 #if ASAN_INTERCEPT___CXA_ATEXIT
 INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg,
@@ -718,7 +725,11 @@ INTERCEPTOR(int, __cxa_atexit, void (*fu
 #endif
   ENSURE_ASAN_INITED();
   int res = REAL(__cxa_atexit)(func, arg, dso_handle);
+#ifdef SANITIZER_NETBSD
+  ::atexit(Atexit);
+#else
   REAL(__cxa_atexit)(AtCxaAtexit, nullptr, nullptr);
+#endif
   return res;
 }
 #endif  // ASAN_INTERCEPT___CXA_ATEXIT



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 02:10:32 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_flags.inc

Log Message:
enable addr2line


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc:1.1.1.1	Thu Feb  1 20:58:46 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc	Tue Feb 13 21:10:32 2018
@@ -27,7 +27,7 @@ COMMON_FLAG(
 "Path to external symbolizer. If empty, the tool will search $PATH for "
 "the symbolizer.")
 COMMON_FLAG(
-bool, allow_addr2line, false,
+bool, allow_addr2line, true,
 "If set, allows online symbolizer to run addr2line binary to symbolize "
 "stack traces (addr2line will only be used if llvm-symbolizer binary is "
 "unavailable.")



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 02:10:06 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_unwind_linux_libcdep.cc

Log Message:
- enable netbsd
- add cast to (uptr) for _Unwind_GetIP


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.1.1.1	Thu Feb  1 20:58:46 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc	Tue Feb 13 21:10:06 2018
@@ -10,7 +10,7 @@
 //===--===//
 
 #include "sanitizer_platform.h"
-#if SANITIZER_FREEBSD || SANITIZER_LINUX
+#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
 #include "sanitizer_common.h"
 #include "sanitizer_stacktrace.h"
 
@@ -88,7 +88,7 @@ uptr Unwind_GetIP(struct _Unwind_Context
   // Clear the Thumb bit.
   return val & ~(uptr)1;
 #else
-  return _Unwind_GetIP(ctx);
+  return (uptr)_Unwind_GetIP(ctx);
 #endif
 }
 



CVS commit: src/crypto/external/bsd/openssl/dist/crypto/evp

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 13 22:35:47 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/evp: m_sha1.c

Log Message:
Provide SHAR384 flavors: The OpenSSL SHA512_Final implementation is re-used
to implement SHA384_Final, but does the right thing by checking the internally
kept digest size. The NetBSD libc implementation provides two entry points
that write a different size digest, so if we use the SHA512_Final from here
we end up overwriting memory.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.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/external/bsd/openssl/dist/crypto/evp/m_sha1.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c:1.8 src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c:1.9
--- src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c:1.8	Thu Feb  8 16:51:28 2018
+++ src/crypto/external/bsd/openssl/dist/crypto/evp/m_sha1.c	Tue Feb 13 17:35:47 2018
@@ -178,6 +178,16 @@ static int init384(EVP_MD_CTX *ctx)
 return SHA384_Init(EVP_MD_CTX_md_data(ctx));
 }
 
+static int update384(EVP_MD_CTX *ctx, const void *data, size_t count)
+{
+return SHA384_Update(EVP_MD_CTX_md_data(ctx), data, count);
+}
+
+static int final384(EVP_MD_CTX *ctx, unsigned char *md)
+{
+return SHA384_Final(md, EVP_MD_CTX_md_data(ctx));
+}
+
 static int init512(EVP_MD_CTX *ctx)
 {
 return SHA512_Init(EVP_MD_CTX_md_data(ctx));
@@ -200,8 +210,8 @@ static const EVP_MD sha384_md = {
 SHA384_DIGEST_LENGTH,
 EVP_MD_FLAG_DIGALGID_ABSENT,
 init384,
-update512,
-final512,
+update384,
+final384,
 NULL,
 NULL,
 SHA512_CBLOCK,



CVS commit: src/crypto/external/bsd/openssl/dist/include/openssl

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 13 22:32:10 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/dist/include/openssl: sha.h

Log Message:
Provide the means to use the libc sha2 internally instead of the openssl
implementation; this does not really matter since their structs are larger
than ours, but it helps when we want to verify that we are not using any
of the openssl code.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssl/dist/include/openssl/sha.h

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/include/openssl/sha.h
diff -u src/crypto/external/bsd/openssl/dist/include/openssl/sha.h:1.1.1.1 src/crypto/external/bsd/openssl/dist/include/openssl/sha.h:1.2
--- src/crypto/external/bsd/openssl/dist/include/openssl/sha.h:1.1.1.1	Thu Feb  8 15:56:57 2018
+++ src/crypto/external/bsd/openssl/dist/include/openssl/sha.h	Tue Feb 13 17:32:10 2018
@@ -10,6 +10,10 @@
 #ifndef HEADER_SHA_H
 # define HEADER_SHA_H
 
+#ifdef USE_LIBC_SHA2
+# include 
+#endif
+
 # include 
 # include 
 
@@ -44,6 +48,7 @@ int SHA1_Final(unsigned char *md, SHA_CT
 unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
 void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
 
+#ifndef USE_LIBC_SHA2
 # define SHA256_CBLOCK   (SHA_LBLOCK*4)/* SHA-256 treats input data as a
 * contiguous array of 32 bit wide
 * big-endian values. */
@@ -112,6 +117,14 @@ int SHA512_Final(unsigned char *md, SHA5
 unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
 void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
 
+#else
+#define SHA256_CBLOCK 64
+#define SHA512_CBLOCK 128
+unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
+unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
+unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
+#endif
+
 #ifdef  __cplusplus
 }
 #endif



CVS commit: src/crypto/external/bsd/openssl/dist/crypto/bn

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 13 22:29:14 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/bn: bn_rand.c

Log Message:
Add a (void *) cast to make things compile with our own sha2 header


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn_rand.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/external/bsd/openssl/dist/crypto/bn/bn_rand.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/bn_rand.c:1.1.1.5 src/crypto/external/bsd/openssl/dist/crypto/bn/bn_rand.c:1.2
--- src/crypto/external/bsd/openssl/dist/crypto/bn/bn_rand.c:1.1.1.5	Thu Feb  8 15:56:49 2018
+++ src/crypto/external/bsd/openssl/dist/crypto/bn/bn_rand.c	Tue Feb 13 17:29:14 2018
@@ -232,7 +232,7 @@ int BN_generate_dsa_nonce(BIGNUM *out, c
 if (RAND_bytes(random_bytes, sizeof(random_bytes)) != 1)
 goto err;
 SHA512_Init();
-SHA512_Update(, , sizeof(done));
+SHA512_Update(, (void *), sizeof(done));
 SHA512_Update(, private_bytes, sizeof(private_bytes));
 SHA512_Update(, message, message_len);
 SHA512_Update(, random_bytes, sizeof(random_bytes));



CVS commit: src/usr.bin/make

2018-02-13 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue Feb 13 19:37:31 UTC 2018

Modified Files:
src/usr.bin/make: meta.c

Log Message:
Avoid unused variable warning


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/make/meta.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/make/meta.c
diff -u src/usr.bin/make/meta.c:1.69 src/usr.bin/make/meta.c:1.70
--- src/usr.bin/make/meta.c:1.69	Thu Aug 10 21:07:48 2017
+++ src/usr.bin/make/meta.c	Tue Feb 13 19:37:30 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: meta.c,v 1.69 2017/08/10 21:07:48 sjg Exp $ */
+/*  $NetBSD: meta.c,v 1.70 2018/02/13 19:37:30 sjg Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -786,7 +786,9 @@ meta_cmd_finish(void *pbmp)
 {
 int error = 0;
 BuildMon *pbm = pbmp;
+#ifdef USE_FILEMON
 int x;
+#endif
 
 if (!pbm)
 	pbm = 



CVS commit: src/crypto/external/bsd/openssl/dist/test

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 13 17:39:38 UTC 2018

Added Files:
src/crypto/external/bsd/openssl/dist/test: constant_time_test.c
evp_extra_test.c heartbeat_test.c

Log Message:
add missing test files added in the vendor branch.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 \
src/crypto/external/bsd/openssl/dist/test/constant_time_test.c \
src/crypto/external/bsd/openssl/dist/test/evp_extra_test.c
cvs rdiff -u -r0 -r1.4 \
src/crypto/external/bsd/openssl/dist/test/heartbeat_test.c

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

Added files:

Index: src/crypto/external/bsd/openssl/dist/test/constant_time_test.c
diff -u /dev/null src/crypto/external/bsd/openssl/dist/test/constant_time_test.c:1.3
--- /dev/null	Tue Feb 13 12:39:38 2018
+++ src/crypto/external/bsd/openssl/dist/test/constant_time_test.c	Tue Feb 13 12:39:38 2018
@@ -0,0 +1,268 @@
+/*
+ * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "internal/constant_time_locl.h"
+#include "e_os.h"
+
+#include 
+#include 
+#include 
+
+static const unsigned int CONSTTIME_TRUE = (unsigned)(~0);
+static const unsigned int CONSTTIME_FALSE = 0;
+static const unsigned char CONSTTIME_TRUE_8 = 0xff;
+static const unsigned char CONSTTIME_FALSE_8 = 0;
+
+static int test_binary_op(unsigned int (*op) (unsigned int a, unsigned int b),
+  const char *op_name, unsigned int a, unsigned int b,
+  int is_true)
+{
+unsigned c = op(a, b);
+if (is_true && c != CONSTTIME_TRUE) {
+fprintf(stderr, "Test failed for %s(%du, %du): expected %du "
+"(TRUE), got %du\n", op_name, a, b, CONSTTIME_TRUE, c);
+return 1;
+} else if (!is_true && c != CONSTTIME_FALSE) {
+fprintf(stderr, "Test failed for  %s(%du, %du): expected %du "
+"(FALSE), got %du\n", op_name, a, b, CONSTTIME_FALSE, c);
+return 1;
+}
+return 0;
+}
+
+static int test_binary_op_8(unsigned
+char (*op) (unsigned int a, unsigned int b),
+const char *op_name, unsigned int a,
+unsigned int b, int is_true)
+{
+unsigned char c = op(a, b);
+if (is_true && c != CONSTTIME_TRUE_8) {
+fprintf(stderr, "Test failed for %s(%du, %du): expected %u "
+"(TRUE), got %u\n", op_name, a, b, CONSTTIME_TRUE_8, c);
+return 1;
+} else if (!is_true && c != CONSTTIME_FALSE_8) {
+fprintf(stderr, "Test failed for  %s(%du, %du): expected %u "
+"(FALSE), got %u\n", op_name, a, b, CONSTTIME_FALSE_8, c);
+return 1;
+}
+return 0;
+}
+
+static int test_is_zero(unsigned int a)
+{
+unsigned int c = constant_time_is_zero(a);
+if (a == 0 && c != CONSTTIME_TRUE) {
+fprintf(stderr, "Test failed for constant_time_is_zero(%du): "
+"expected %du (TRUE), got %du\n", a, CONSTTIME_TRUE, c);
+return 1;
+} else if (a != 0 && c != CONSTTIME_FALSE) {
+fprintf(stderr, "Test failed for constant_time_is_zero(%du): "
+"expected %du (FALSE), got %du\n", a, CONSTTIME_FALSE, c);
+return 1;
+}
+return 0;
+}
+
+static int test_is_zero_8(unsigned int a)
+{
+unsigned char c = constant_time_is_zero_8(a);
+if (a == 0 && c != CONSTTIME_TRUE_8) {
+fprintf(stderr, "Test failed for constant_time_is_zero(%du): "
+"expected %u (TRUE), got %u\n", a, CONSTTIME_TRUE_8, c);
+return 1;
+} else if (a != 0 && c != CONSTTIME_FALSE) {
+fprintf(stderr, "Test failed for constant_time_is_zero(%du): "
+"expected %u (FALSE), got %u\n", a, CONSTTIME_FALSE_8, c);
+return 1;
+}
+return 0;
+}
+
+static int test_select(unsigned int a, unsigned int b)
+{
+unsigned int selected = constant_time_select(CONSTTIME_TRUE, a, b);
+if (selected != a) {
+fprintf(stderr, "Test failed for constant_time_select(%du, %du,"
+"%du): expected %du(first value), got %du\n",
+CONSTTIME_TRUE, a, b, a, selected);
+return 1;
+}
+selected = constant_time_select(CONSTTIME_FALSE, a, b);
+if (selected != b) {
+fprintf(stderr, "Test failed for constant_time_select(%du, %du,"
+"%du): expected %du(second value), got %du\n",
+CONSTTIME_FALSE, a, b, b, selected);
+return 1;
+}
+return 0;
+}
+
+static int test_select_8(unsigned char a, unsigned char b)
+{
+unsigned char selected = constant_time_select_8(CONSTTIME_TRUE_8, a, b);
+ 

CVS commit: src/sys/net

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 15:21:59 UTC 2018

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

Log Message:
Make the arpresolve branch more readable, fix typo, fix XXX (which I
added), add missing pserialize_read_exit (which I forgot).


To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/sys/net/if_ethersubr.c

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

Modified files:

Index: src/sys/net/if_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.259 src/sys/net/if_ethersubr.c:1.260
--- src/sys/net/if_ethersubr.c:1.259	Tue Feb 13 10:50:38 2018
+++ src/sys/net/if_ethersubr.c	Tue Feb 13 15:21:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.259 2018/02/13 10:50:38 maxv Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.260 2018/02/13 15:21:59 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.259 2018/02/13 10:50:38 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.260 2018/02/13 15:21:59 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -198,10 +198,10 @@ ether_output(struct ifnet * const ifp0, 
 	struct ifnet *ifp = ifp0;
 #ifdef INET
 	struct arphdr *ah;
-#endif /* INET */
+#endif
 #ifdef NETATALK
 	struct at_ifaddr *aa;
-#endif /* NETATALK */
+#endif
 
 #ifdef MBUFTRACE
 	m_claimm(m, ifp->if_mowner);
@@ -229,7 +229,7 @@ ether_output(struct ifnet * const ifp0, 
 		(IFF_UP | IFF_RUNNING))
 			senderr(ENETDOWN);
 	}
-#endif /* NCARP > 0 */
+#endif
 
 	if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) != (IFF_UP | IFF_RUNNING))
 		senderr(ENETDOWN);
@@ -242,9 +242,10 @@ ether_output(struct ifnet * const ifp0, 
 			memcpy(edst, etherbroadcastaddr, sizeof(edst));
 		else if (m->m_flags & M_MCAST)
 			ETHER_MAP_IP_MULTICAST((dst)->sin_addr, edst);
-		else if ((error = arpresolve(ifp, rt, m, dst, edst,
-		sizeof(edst))) != 0) {
-			return error == EWOULDBLOCK ? 0 : error;
+		else {
+			error = arpresolve(ifp, rt, m, dst, edst, sizeof(edst));
+			if (error)
+return (error == EWOULDBLOCK) ? 0 : error;
 		}
 		/* If broadcasting on a simplex interface, loopback a copy */
 		if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
@@ -309,7 +310,7 @@ ether_output(struct ifnet * const ifp0, 
 
 		if (!aarpresolve(ifp, m, (const struct sockaddr_at *)dst, edst)) {
 #ifdef NETATALKDEBUG
-			printf("aarpresolv failed\n");
+			printf("aarpresolve failed\n");
 #endif
 			KERNEL_UNLOCK_ONE(NULL);
 			return (0);
@@ -323,8 +324,7 @@ ether_output(struct ifnet * const ifp0, 
 		if (ifa == NULL) {
 			pserialize_read_exit(s);
 			KERNEL_UNLOCK_ONE(NULL);
-			/* XXX error? */
-			goto bad;
+			senderr(EADDRNOTAVAIL);
 		}
 		aa = (struct at_ifaddr *)ifa;
 
@@ -339,6 +339,7 @@ ether_output(struct ifnet * const ifp0, 
 
 			M_PREPEND(m, sizeof(struct llc), M_DONTWAIT);
 			if (m == NULL) {
+pserialize_read_exit(s);
 KERNEL_UNLOCK_ONE(NULL);
 senderr(ENOBUFS);
 			}



CVS commit: src/sys/netinet

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 14:50:28 UTC 2018

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Mmh. Add a missing check: if ARP was disabled on the interface, don't
process ARP packets. Otherwise the kernel will add ARP entries even if

ifconfig wm0 -arp

was entered.


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.264 src/sys/netinet/if_arp.c:1.265
--- src/sys/netinet/if_arp.c:1.264	Tue Feb 13 10:47:41 2018
+++ src/sys/netinet/if_arp.c	Tue Feb 13 14:50:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.264 2018/02/13 10:47:41 maxv Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.265 2018/02/13 14:50:28 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.264 2018/02/13 10:47:41 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.265 2018/02/13 14:50:28 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -324,7 +324,7 @@ arptimer(void *arg)
 	LLE_WLOCK(lle);
 	if (callout_pending(>la_timer)) {
 		/*
-		 * Here we are a bit odd here in the treatment of
+		 * Here we are a bit odd in the treatment of
 		 * active/pending. If the pending bit is set, it got
 		 * rescheduled before I ran. The active
 		 * bit we ignore, since if it was stopped
@@ -725,6 +725,7 @@ arpresolve(struct ifnet *ifp, const stru
 	bool renew;
 	int error;
 	struct ifnet *origifp = ifp;
+
 #if NCARP > 0
 	if (rt != NULL && rt->rt_ifp->if_type == IFT_CARP)
 		ifp = rt->rt_ifp;
@@ -1058,6 +1059,8 @@ in_arpinput(struct mbuf *m)
 	rcvif = ifp = m_get_rcvif_psref(m, );
 	if (__predict_false(rcvif == NULL))
 		goto out;
+	if (rcvif->if_flags & IFF_NOARP)
+		goto out;
 
 	memcpy(, ar_spa(ah), sizeof(isaddr));
 	memcpy(, ar_tpa(ah), sizeof(itaddr));
@@ -1882,6 +1885,9 @@ in_revarpinput(struct mbuf *m)
 	rcvif = m_get_rcvif(m, );
 	if (__predict_false(rcvif == NULL))
 		goto out;
+	if (rcvif->if_flags & IFF_NOARP)
+		goto out;
+
 	switch (rcvif->if_type) {
 	case IFT_IEEE1394:
 		/* ARP without target hardware address is not supported */



CVS import: src/crypto/external/bsd/openssl/dist/test

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 13 14:46:39 UTC 2018

Update of /cvsroot/src/crypto/external/bsd/openssl/dist/test
In directory ivanova.netbsd.org:/tmp/cvs-serv18120

Log Message:
add missing tests

Status:

Vendor Tag: OPENSSL
Release Tags:   openssl-1-1-0g

U src/crypto/external/bsd/openssl/dist/test/constant_time_test.c
U src/crypto/external/bsd/openssl/dist/test/evp_extra_test.c
U src/crypto/external/bsd/openssl/dist/test/heartbeat_test.c

No conflicts created by this import



CVS import: src/crypto/external/bsd/openssl/dist/test

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 13 14:45:54 UTC 2018

Update of /cvsroot/src/crypto/external/bsd/openssl/dist/test
In directory ivanova.netbsd.org:/tmp/cvs-serv11416

Log Message:
add missing tests

Status:

Vendor Tag: OPENSSL
Release Tags:   openssl-1-1-0g


No conflicts created by this import



CVS commit: src/sys/dev/i2c

2018-02-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Feb 13 13:19:30 UTC 2018

Modified Files:
src/sys/dev/i2c: files.i2c

Log Message:
Delete 'define dbcool {}' line commented out in previous.  It's bogus
and the gcc6 correctly complains about that when it compiles ioconf.c

PR toolchain/53023


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/i2c/files.i2c

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

Modified files:

Index: src/sys/dev/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.83 src/sys/dev/i2c/files.i2c:1.84
--- src/sys/dev/i2c/files.i2c:1.83	Tue Feb 13 07:21:19 2018
+++ src/sys/dev/i2c/files.i2c	Tue Feb 13 13:19:30 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.83 2018/02/13 07:21:19 pgoyette Exp $
+#	$NetBSD: files.i2c,v 1.84 2018/02/13 13:19:30 uwe Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -130,7 +130,6 @@ attach	xrtc at iic
 file	dev/i2c/x1226.cxrtc
 
 # Analog Devices dBCool family of thermal monitors / fan controllers
-#define dbcool {}
 device dbcool: sysmon_envsys
 attach dbcool at iic
 file dev/i2c/dbcool.c			dbcool



CVS commit: src/sbin/fsck_ffs

2018-02-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Feb 13 11:20:08 UTC 2018

Modified Files:
src/sbin/fsck_ffs: pass1.c

Log Message:
Treat an inode with "mode == 0" and "blocks != 0" as partially allocated
and clear it as ffs_newvnode() tests for "blocks == 0".


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

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

Modified files:

Index: src/sbin/fsck_ffs/pass1.c
diff -u src/sbin/fsck_ffs/pass1.c:1.57 src/sbin/fsck_ffs/pass1.c:1.58
--- src/sbin/fsck_ffs/pass1.c:1.57	Wed Feb  8 16:11:40 2017
+++ src/sbin/fsck_ffs/pass1.c	Tue Feb 13 11:20:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pass1.c,v 1.57 2017/02/08 16:11:40 rin Exp $	*/
+/*	$NetBSD: pass1.c,v 1.58 2018/02/13 11:20:08 hannken Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)pass1.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: pass1.c,v 1.57 2017/02/08 16:11:40 rin Exp $");
+__RCSID("$NetBSD: pass1.c,v 1.58 2018/02/13 11:20:08 hannken Exp $");
 #endif
 #endif /* not lint */
 
@@ -253,8 +253,9 @@ checkinode(ino_t inumber, struct inodesc
 		(memcmp(dp->dp1.di_db, ufs1_zino.di_db,
 			UFS_NDADDR * sizeof(int32_t)) ||
 		memcmp(dp->dp1.di_ib, ufs1_zino.di_ib,
-			UFS_NIADDR * sizeof(int32_t ||
-		mode || size) {
+			UFS_NIADDR * sizeof(int32_t
+		||
+		mode || size || DIP(dp, blocks)) {
 			pfatal("PARTIALLY ALLOCATED INODE I=%llu",
 			(unsigned long long)inumber);
 			if (reply("CLEAR") == 1) {



CVS commit: src/sys/net

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 10:50:38 UTC 2018

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

Log Message:
Remove KERNEL_LOCK around the MPLS code. It's not needed, since we're only
touching the tag of the mbuf - the tag belongs only to the mbuf, and the
mbuf is not shared.

ok knakahara@


To generate a diff of this commit:
cvs rdiff -u -r1.258 -r1.259 src/sys/net/if_ethersubr.c

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

Modified files:

Index: src/sys/net/if_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.258 src/sys/net/if_ethersubr.c:1.259
--- src/sys/net/if_ethersubr.c:1.258	Mon Feb 12 12:17:38 2018
+++ src/sys/net/if_ethersubr.c	Tue Feb 13 10:50:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.258 2018/02/12 12:17:38 maxv Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.259 2018/02/13 10:50:38 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.258 2018/02/12 12:17:38 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.259 2018/02/13 10:50:38 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -380,7 +380,6 @@ ether_output(struct ifnet * const ifp0, 
 	}
 
 #ifdef MPLS
-	KERNEL_LOCK(1, NULL);
 	{
 		struct m_tag *mtag;
 		mtag = m_tag_find(m, PACKET_TAG_MPLS, NULL);
@@ -390,7 +389,6 @@ ether_output(struct ifnet * const ifp0, 
 			m_tag_delete(m, mtag);
 		}
 	}
-	KERNEL_UNLOCK_ONE(NULL);
 #endif
 
 	if (mcopy)



CVS commit: src/sys/netinet

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 10:47:41 UTC 2018

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Be tougher:

 * In arpintr(), don't allow IEEE1394 packets on non-IEEE1394 interfaces.

 * In revarpinput(), kick IEEE1394 packets right away. They are not
   supported.


To generate a diff of this commit:
cvs rdiff -u -r1.263 -r1.264 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.263 src/sys/netinet/if_arp.c:1.264
--- src/sys/netinet/if_arp.c:1.263	Tue Feb 13 10:31:01 2018
+++ src/sys/netinet/if_arp.c	Tue Feb 13 10:47:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.263 2018/02/13 10:31:01 maxv Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.264 2018/02/13 10:47:41 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.263 2018/02/13 10:31:01 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.264 2018/02/13 10:47:41 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -948,12 +948,12 @@ arpintr(void)
 			goto free;
 		}
 
+		/*
+		 * We don't want non-IEEE1394 ARP packets on IEEE1394
+		 * interfaces, and vice versa. Our life depends on that.
+		 */
 		switch (rcvif->if_type) {
 		case IFT_IEEE1394:
-			/*
-			 * We don't want non-IEEE1394 ARP packets on IEEE1394
-			 * interfaces. Our life depends on that.
-			 */
 			if (ntohs(ar->ar_hrd) != ARPHRD_IEEE1394) {
 m_put_rcvif(rcvif, );
 ARP_STATINC(ARP_STAT_RCVBADPROTO);
@@ -964,6 +964,12 @@ arpintr(void)
 			ar->ar_hln + 2 * ar->ar_pln;
 			break;
 		default:
+			if (ntohs(ar->ar_hrd) == ARPHRD_IEEE1394) {
+m_put_rcvif(rcvif, );
+ARP_STATINC(ARP_STAT_RCVBADPROTO);
+goto free;
+			}
+
 			arplen = sizeof(struct arphdr) +
 			2 * ar->ar_hln + 2 * ar->ar_pln;
 			break;
@@ -1827,6 +1833,10 @@ revarpinput(struct mbuf *m)
 		return;
 	ar = mtod(m, struct arphdr *);
 
+	if (ntohs(ar->ar_hrd) == ARPHRD_IEEE1394) {
+		goto out;
+	}
+
 	arplen = sizeof(struct arphdr) + 2 * (ar->ar_hln + ar->ar_pln);
 	if (m->m_len < arplen && (m = m_pullup(m, arplen)) == NULL)
 		return;
@@ -1842,6 +1852,7 @@ revarpinput(struct mbuf *m)
 		break;
 	}
 
+out:
 	m_freem(m);
 }
 



CVS commit: src/sys/netinet

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 10:31:01 UTC 2018

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Same change as rev1.258, but this time in revarpinput: use m_pullup.


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.262 src/sys/netinet/if_arp.c:1.263
--- src/sys/netinet/if_arp.c:1.262	Tue Feb 13 10:20:50 2018
+++ src/sys/netinet/if_arp.c	Tue Feb 13 10:31:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.262 2018/02/13 10:20:50 maxv Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.263 2018/02/13 10:31:01 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.262 2018/02/13 10:20:50 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.263 2018/02/13 10:31:01 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1820,16 +1820,18 @@ void
 revarpinput(struct mbuf *m)
 {
 	struct arphdr *ar;
+	int arplen;
 
-	if (m->m_len < sizeof(struct arphdr))
-		goto out;
+	arplen = sizeof(struct arphdr);
+	if (m->m_len < arplen && (m = m_pullup(m, arplen)) == NULL)
+		return;
 	ar = mtod(m, struct arphdr *);
-#if 0 /* XXX I don't think we need this... and it will prevent other LL */
-	if (ntohs(ar->ar_hrd) != ARPHRD_ETHER)
-		goto out;
-#endif
-	if (m->m_len < sizeof(struct arphdr) + 2 * (ar->ar_hln + ar->ar_pln))
-		goto out;
+
+	arplen = sizeof(struct arphdr) + 2 * (ar->ar_hln + ar->ar_pln);
+	if (m->m_len < arplen && (m = m_pullup(m, arplen)) == NULL)
+		return;
+	ar = mtod(m, struct arphdr *);
+
 	switch (ntohs(ar->ar_pro)) {
 	case ETHERTYPE_IP:
 	case ETHERTYPE_IPTRAILERS:
@@ -1839,7 +1841,7 @@ revarpinput(struct mbuf *m)
 	default:
 		break;
 	}
-out:
+
 	m_freem(m);
 }
 



CVS commit: src/sys/netinet

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 10:20:50 UTC 2018

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Minor stylistic changes, and use C99 types.


To generate a diff of this commit:
cvs rdiff -u -r1.261 -r1.262 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.261 src/sys/netinet/if_arp.c:1.262
--- src/sys/netinet/if_arp.c:1.261	Tue Feb 13 10:05:05 2018
+++ src/sys/netinet/if_arp.c	Tue Feb 13 10:20:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.261 2018/02/13 10:05:05 maxv Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.262 2018/02/13 10:20:50 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.261 2018/02/13 10:05:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.262 2018/02/13 10:20:50 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -157,7 +157,7 @@ static void arp_init(void);
 
 static void arprequest(struct ifnet *,
 const struct in_addr *, const struct in_addr *,
-const u_int8_t *);
+const uint8_t *);
 static void arpannounce1(struct ifaddr *);
 static struct sockaddr *arp_setgate(struct rtentry *, struct sockaddr *,
 const struct sockaddr *);
@@ -222,10 +222,10 @@ static int log_unknown_network = 1;
 #define	LLA_ADDRSTRLEN	(16 * 3)
 
 static char *
-lla_snprintf(char *, u_int8_t *, int);
+lla_snprintf(char *, uint8_t *, int);
 
 static char *
-lla_snprintf(char *dst, u_int8_t *adrp, int len)
+lla_snprintf(char *dst, uint8_t *adrp, int len)
 {
 	int i;
 	char *p;
@@ -631,7 +631,7 @@ arp_rtrequest(int req, struct rtentry *r
 static void
 arprequest(struct ifnet *ifp,
 const struct in_addr *sip, const struct in_addr *tip,
-const u_int8_t *enaddr)
+const uint8_t *enaddr)
 {
 	struct mbuf *m;
 	struct arphdr *ah;
@@ -814,8 +814,7 @@ notfound:
 		LLE_WUNLOCK(la);
 
 		if (renew) {
-			const u_int8_t *enaddr =
-			CLLADDR(ifp->if_sadl);
+			const uint8_t *enaddr = CLLADDR(ifp->if_sadl);
 			arprequest(origifp,
 			(rt->rt_ifa->ifa_addr)->sin_addr,
 			(dst)->sin_addr, enaddr);
@@ -875,8 +874,7 @@ notfound:
 		EHOSTUNREACH : EHOSTDOWN;
 
 	if (renew) {
-		const u_int8_t *enaddr =
-		CLLADDR(ifp->if_sadl);
+		const uint8_t *enaddr = CLLADDR(ifp->if_sadl);
 		la->la_expire = time_uptime;
 		arp_settimer(la, arpt_down);
 		la->la_asked++;
@@ -1022,7 +1020,7 @@ in_arpinput(struct mbuf *m)
 	struct in_ifaddr *bridge_ia = NULL;
 #endif
 #if NCARP > 0
-	u_int32_t count = 0, index = 0;
+	uint32_t count = 0, index = 0;
 #endif
 	struct sockaddr sa;
 	struct in_addr isaddr, itaddr, myaddr;
@@ -1100,7 +1098,7 @@ in_arpinput(struct mbuf *m)
 		if (rcvif->if_bridge != NULL &&
 		rcvif->if_bridge == ia->ia_ifp->if_bridge)
 			bridge_ia = ia;
-#endif /* NBRIDGE > 0 */
+#endif
 	}
 
 #if NBRIDGE > 0
@@ -1260,7 +1258,7 @@ in_arpinput(struct mbuf *m)
 			}
 		}
 	}
-#endif /* NTOKEN > 0 */
+#endif
 
 	KASSERT(sizeof(la->ll_addr) >= ifp->if_addrlen);
 	memcpy(>ll_addr, ar_sha(ah), ifp->if_addrlen);
@@ -1322,6 +1320,7 @@ reply:
 		/* Proxy ARP */
 		struct llentry *lle = NULL;
 		struct sockaddr_in sin;
+
 #if NCARP > 0
 		if (ifp->if_type == IFT_CARP) {
 			struct ifnet *_rcvif = m_get_rcvif(m, );
@@ -1361,9 +1360,7 @@ reply:
 	ah->ar_pro = htons(ETHERTYPE_IP); /* let's be sure! */
 	switch (ifp->if_type) {
 	case IFT_IEEE1394:
-		/*
-		 * ieee1394 arp reply is broadcast
-		 */
+		/* ieee1394 arp reply is broadcast */
 		m->m_flags &= ~M_MCAST;
 		m->m_flags |= M_BCAST;
 		m->m_len = sizeof(*ah) + (2 * ah->ar_pln) + ah->ar_hln;



CVS commit: src/usr.sbin/rarpd

2018-02-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Feb 13 10:17:04 UTC 2018

Modified Files:
src/usr.sbin/rarpd: rarpd.c

Log Message:
Adapt to ar_tha() changes in if_arp.h rev1.31.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/rarpd/rarpd.c

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

Modified files:

Index: src/usr.sbin/rarpd/rarpd.c
diff -u src/usr.sbin/rarpd/rarpd.c:1.59 src/usr.sbin/rarpd/rarpd.c:1.60
--- src/usr.sbin/rarpd/rarpd.c:1.59	Tue Aug 30 20:25:18 2011
+++ src/usr.sbin/rarpd/rarpd.c	Tue Feb 13 10:17:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rarpd.c,v 1.59 2011/08/30 20:25:18 joerg Exp $	*/
+/*	$NetBSD: rarpd.c,v 1.60 2018/02/13 10:17:04 martin Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -25,7 +25,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990\
 #endif /* not lint */
 
 #ifndef lint
-__RCSID("$NetBSD: rarpd.c,v 1.59 2011/08/30 20:25:18 joerg Exp $");
+__RCSID("$NetBSD: rarpd.c,v 1.60 2018/02/13 10:17:04 martin Exp $");
 #endif
 
 
@@ -414,7 +414,7 @@ rarp_check(u_char *p, int len)
 	}
 	{
 #ifdef __NetBSD__
-		caddr_t tha = ar_tha(ap);
+		uint8_t *tha = ar_tha(ap);
 
 		if (!tha || memcmp(ar_sha(ap), tha, 6) != 0) {
 #else



CVS commit: src/sys/netinet

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 10:05:05 UTC 2018

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Replace dead code by KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.260 -r1.261 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.260 src/sys/netinet/if_arp.c:1.261
--- src/sys/netinet/if_arp.c:1.260	Tue Feb 13 08:51:37 2018
+++ src/sys/netinet/if_arp.c	Tue Feb 13 10:05:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.260 2018/02/13 08:51:37 maxv Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.261 2018/02/13 10:05:05 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.260 2018/02/13 08:51:37 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.261 2018/02/13 10:05:05 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1232,20 +1232,7 @@ in_arpinput(struct mbuf *m)
 		}
 	}
 
-	/* XXX llentry should have addrlen? */
-#if 0
-	/*
-	 * sanity check for the address length.
-	 * XXX this does not work for protocols with variable address
-	 * length. -is
-	 */
-	if (sdl->sdl_alen && sdl->sdl_alen != ah->ar_hln) {
-		ARP_STATINC(ARP_STAT_RCVLENCHG);
-		log(LOG_WARNING,
-		"arp from %s: new addr len %d, was %d\n",
-		IN_PRINT(ipbuf, ), ah->ar_hln, sdl->sdl_alen);
-	}
-#endif
+	KASSERT(ifp->if_sadl->sdl_alen == ifp->if_addrlen);
 
 #if NTOKEN > 0
 	/*



CVS commit: src/distrib/sets/lists

2018-02-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Feb 13 10:02:12 UTC 2018

Modified Files:
src/distrib/sets/lists/base: ad.mips shl.mi
src/distrib/sets/lists/comp: ad.mips ad.powerpc ad.sh3 md.amd64 md.i386
mi shl.mi
src/distrib/sets/lists/debug: mi shl.mi

Log Message:
obsolete some GCC 4.8 files.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/distrib/sets/lists/base/ad.mips
cvs rdiff -u -r1.831 -r1.832 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.72 -r1.73 src/distrib/sets/lists/comp/ad.mips
cvs rdiff -u -r1.89 -r1.90 src/distrib/sets/lists/comp/ad.powerpc
cvs rdiff -u -r1.37 -r1.38 src/distrib/sets/lists/comp/ad.sh3
cvs rdiff -u -r1.256 -r1.257 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.178 -r1.179 src/distrib/sets/lists/comp/md.i386
cvs rdiff -u -r1.2180 -r1.2181 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.312 -r1.313 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.241 -r1.242 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.192 -r1.193 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/ad.mips
diff -u src/distrib/sets/lists/base/ad.mips:1.76 src/distrib/sets/lists/base/ad.mips:1.77
--- src/distrib/sets/lists/base/ad.mips:1.76	Sat Feb  3 21:27:45 2018
+++ src/distrib/sets/lists/base/ad.mips	Tue Feb 13 10:02:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips,v 1.76 2018/02/03 21:27:45 mrg Exp $
+# $NetBSD: ad.mips,v 1.77 2018/02/13 10:02:12 mrg Exp $
 ./lib/libc_fp.sobase-sys-shlib		dynamicroot,softfloat,arch64
 ./lib/libc_fp.so.0base-sys-shlib		dynamicroot,softfloat,arch64
 ./lib/libc_fp.so.0.0base-sys-shlib		dynamicroot,softfloat,arch64
@@ -13,7 +13,6 @@
 ./usr/lib/o32/libc_fp.so			base-compat-shlib	compat,pic,arch64
 ./usr/lib/o32/libc_fp.so.0			base-compat-shlib	compat,pic,arch64
 ./usr/lib/o32/libc_fp.so.0.0			base-compat-shlib	compat,pic,arch64
-./usr/lib/o32/libgomp.so.1.1			base-compat-shlib	compat,pic,arch64,gcc=48
 ./usr/lib/o32/libgomp.so.1.2			base-compat-shlib	compat,pic,arch64,gcc=5
 ./usr/lib/o32/libgomp.so.1.3			base-compat-shlib	compat,pic,arch64,gcc=6
 ./usr/libexec/ld.elf_so-64			base-compat-shlib	compat,pic,arch64

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.831 src/distrib/sets/lists/base/shl.mi:1.832
--- src/distrib/sets/lists/base/shl.mi:1.831	Thu Feb  8 03:27:50 2018
+++ src/distrib/sets/lists/base/shl.mi	Tue Feb 13 10:02:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.831 2018/02/08 03:27:50 christos Exp $
+# $NetBSD: shl.mi,v 1.832 2018/02/13 10:02:12 mrg Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -178,8 +178,6 @@
 ./usr/lib/libarchive.so.4			base-sys-shlib		compatfile
 ./usr/lib/libarchive.so.4.0			base-sys-shlib		compatfile
 ./usr/lib/libasan.sobase-sys-shlib		compatfile,gcc
-./usr/lib/libasan.so.0base-sys-shlib		compatfile,gcc=48
-./usr/lib/libasan.so.0.0			base-sys-shlib		compatfile,gcc=48
 ./usr/lib/libasan.so.2base-sys-shlib		compatfile,gcc=5
 ./usr/lib/libasan.so.2.0			base-sys-shlib		compatfile,gcc=5
 ./usr/lib/libasan.so.3base-sys-shlib		compatfile,gcc=6
@@ -304,7 +302,6 @@
 ./usr/lib/libgnumalloc.so.1.0			base-sys-shlib		compatfile
 ./usr/lib/libgomp.sobase-sys-shlib		compatfile,gcc
 ./usr/lib/libgomp.so.1base-sys-shlib		compatfile,gcc
-./usr/lib/libgomp.so.1.1			base-sys-shlib		compatfile,gcc=48
 ./usr/lib/libgomp.so.1.2			base-sys-shlib		compatfile,gcc=5,!machine_arch=mips64eb,!machine_arch=mips64el
 ./usr/lib/libgomp.so.1.2			base-sys-shlib		gcc=5,machine_arch=mips64eb
 ./usr/lib/libgomp.so.1.2			base-sys-shlib		gcc=5,machine_arch=mips64el
@@ -815,7 +812,6 @@
 ./usr/lib/libssl.so.13.0			base-crypto-shlib	compatfile,openssl=11
 ./usr/lib/libstdc++.sobase-sys-shlib		compatfile,gcc,cxx,libstdcxx
 ./usr/lib/libstdc++.so.8			base-sys-shlib		compatfile,gcc,cxx,libstdcxx
-./usr/lib/libstdc++.so.7.3			base-sys-shlib		compatfile,gcc=48,cxx,libstdcxx
 ./usr/lib/libstdc++.so.8.0			base-sys-shlib		compatfile,gcc=5,cxx,libstdcxx
 ./usr/lib/libstdc++.so.8.1			base-sys-shlib		compatfile,gcc=6,cxx,libstdcxx
 ./usr/lib/libtelnet.sobase-obsolete		obsolete

Index: src/distrib/sets/lists/comp/ad.mips
diff -u src/distrib/sets/lists/comp/ad.mips:1.72 src/distrib/sets/lists/comp/ad.mips:1.73
--- src/distrib/sets/lists/comp/ad.mips:1.72	Sat Feb  3 21:27:45 2018
+++ src/distrib/sets/lists/comp/ad.mips	Tue Feb 13 10:02:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips,v 1.72 2018/02/03 21:27:45 mrg Exp $
+# $NetBSD: ad.mips,v 1.73 2018/02/13 10:02:12 mrg Exp $
 -./usr/lib/64/libgomp.a
 -./usr/lib/64/libgomp.so
 -./usr/lib/64/libgomp.so.1
@@ -15,8 +15,8 @@
 ./usr/include/g++/bits/mips64/c++config.h	comp-c-include		compat,arch64,gcc
 ./usr/include/g++/bits/mipso32			comp-c-include		compat,arch64
 

CVS commit: src/crypto/external/bsd/openssh/dist

2018-02-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Feb 13 09:51:33 UTC 2018

Modified Files:
src/crypto/external/bsd/openssh/dist: sshkey.c

Log Message:
Fix copy & pasto (dsa code vs. rsa code) in previous, fixes PR lib/53012
and recentish sshfs test failures.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/crypto/external/bsd/openssh/dist/sshkey.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/external/bsd/openssh/dist/sshkey.c
diff -u src/crypto/external/bsd/openssh/dist/sshkey.c:1.12 src/crypto/external/bsd/openssh/dist/sshkey.c:1.13
--- src/crypto/external/bsd/openssh/dist/sshkey.c:1.12	Mon Feb  5 00:13:50 2018
+++ src/crypto/external/bsd/openssh/dist/sshkey.c	Tue Feb 13 09:51:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sshkey.c,v 1.12 2018/02/05 00:13:50 christos Exp $	*/
+/*	$NetBSD: sshkey.c,v 1.13 2018/02/13 09:51:33 martin Exp $	*/
 /* $OpenBSD: sshkey.c,v 1.56 2017/08/12 06:42:52 djm Exp $ */
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
@@ -26,7 +26,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-__RCSID("$NetBSD: sshkey.c,v 1.12 2018/02/05 00:13:50 christos Exp $");
+__RCSID("$NetBSD: sshkey.c,v 1.13 2018/02/13 09:51:33 martin Exp $");
 
 #include 
 #include 
@@ -258,7 +258,7 @@ sshkey_size(const struct sshkey *k)
 #if OPENSSL_VERSION_NUMBER >= 0x1010UL
 		return RSA_bits(k->rsa);
 #else
-		return BN_num_bits(k->rsa->p);
+		return BN_num_bits(k->rsa->n);
 #endif
 	case KEY_DSA:
 	case KEY_DSA_CERT:



CVS commit: src/sys/conf

2018-02-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Feb 13 09:50:36 UTC 2018

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

Log Message:
use -fno-delete-null-pointer-checks for kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 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.262 src/sys/conf/Makefile.kern.inc:1.263
--- src/sys/conf/Makefile.kern.inc:1.262	Mon Jan 22 17:38:46 2018
+++ src/sys/conf/Makefile.kern.inc	Tue Feb 13 09:50:35 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.262 2018/01/22 17:38:46 christos Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.263 2018/02/13 09:50:35 mrg Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -98,6 +98,7 @@ CWARNFLAGS.ah_regdomain.c= ${${ACTIVE_CC
 CWARNFLAGS.ioconf.c= ${${ACTIVE_CC} == "clang":? -Wno-unused-const-variable :}
 
 CFLAGS+=	-ffreestanding -fno-zero-initialized-in-bss
+CFLAGS+=	-fno-delete-null-pointer-checks
 CFLAGS+=	${DEBUG} ${COPTS}
 AFLAGS+=	-D_LOCORE -Wa,--fatal-warnings
 



CVS commit: src/sys/kern

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 09:26:18 UTC 2018

Modified Files:
src/sys/kern: kern_tc.c

Log Message:
Put time_second and time_uptime in different cache lines, probably saves
us some false sharing.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/kern/kern_tc.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/kern/kern_tc.c
diff -u src/sys/kern/kern_tc.c:1.48 src/sys/kern/kern_tc.c:1.49
--- src/sys/kern/kern_tc.c:1.48	Thu Nov  2 15:28:23 2017
+++ src/sys/kern/kern_tc.c	Tue Feb 13 09:26:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_tc.c,v 1.48 2017/11/02 15:28:23 riastradh Exp $ */
+/* $NetBSD: kern_tc.c,v 1.49 2018/02/13 09:26:17 maxv Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
 #include 
 /* __FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.166 2005/09/19 22:16:31 andre Exp $"); */
-__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.48 2017/11/02 15:28:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.49 2018/02/13 09:26:17 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ntp.h"
@@ -131,8 +131,8 @@ static struct timehands *volatile timeha
 struct timecounter *timecounter = _timecounter;
 static struct timecounter *timecounters = _timecounter;
 
-volatile time_t time_second = 1;
-volatile time_t time_uptime = 1;
+volatile time_t time_second __cacheline_aligned = 1;
+volatile time_t time_uptime __cacheline_aligned = 1;
 
 static struct bintime timebasebin;
 



CVS commit: src/sys/netinet

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 08:51:38 UTC 2018

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Don't force ARPHRD_IEEE1394 on IEEE1394 interfaces. If it's not there, then
kick the packet. And do this earlier.


To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.259 src/sys/netinet/if_arp.c:1.260
--- src/sys/netinet/if_arp.c:1.259	Tue Feb 13 08:20:12 2018
+++ src/sys/netinet/if_arp.c	Tue Feb 13 08:51:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.259 2018/02/13 08:20:12 maxv Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.260 2018/02/13 08:51:37 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.259 2018/02/13 08:20:12 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.260 2018/02/13 08:51:37 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -949,8 +949,19 @@ arpintr(void)
 			ARP_STATINC(ARP_STAT_RCVNOINT);
 			goto free;
 		}
+
 		switch (rcvif->if_type) {
 		case IFT_IEEE1394:
+			/*
+			 * We don't want non-IEEE1394 ARP packets on IEEE1394
+			 * interfaces. Our life depends on that.
+			 */
+			if (ntohs(ar->ar_hrd) != ARPHRD_IEEE1394) {
+m_put_rcvif(rcvif, );
+ARP_STATINC(ARP_STAT_RCVBADPROTO);
+goto free;
+			}
+
 			arplen = sizeof(struct arphdr) +
 			ar->ar_hln + 2 * ar->ar_pln;
 			break;
@@ -959,6 +970,7 @@ arpintr(void)
 			2 * ar->ar_hln + 2 * ar->ar_pln;
 			break;
 		}
+
 		m_put_rcvif(rcvif, );
 
 		if (m->m_len < arplen && (m = m_pullup(m, arplen)) == NULL)
@@ -1043,23 +1055,6 @@ in_arpinput(struct mbuf *m)
 	if (__predict_false(rcvif == NULL))
 		goto out;
 
-	/*
-	 * Fix up ah->ar_hrd if necessary, before using ar_tha() or ar_tpa().
-	 * XXX check ar_hrd more strictly?
-	 */
-	switch (ifp->if_type) {
-	case IFT_IEEE1394:
-		if (ntohs(ah->ar_hrd) == ARPHRD_IEEE1394)
-			;
-		else {
-			/* XXX this is to make sure we compute ar_tha right */
-			ah->ar_hrd = htons(ARPHRD_IEEE1394);
-		}
-		break;
-	default:
-		break;
-	}
-
 	memcpy(, ar_spa(ah), sizeof(isaddr));
 	memcpy(, ar_tpa(ah), sizeof(itaddr));
 



CVS commit: src/sys/net

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 08:43:26 UTC 2018

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

Log Message:
Define ar_* as inlined functions, not as macros. Makes it easier to
understand why ARPHRD_IEEE1394 needs to be handled with care - it doesn't
have ar_tha.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/net/if_arp.h

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

Modified files:

Index: src/sys/net/if_arp.h
diff -u src/sys/net/if_arp.h:1.30 src/sys/net/if_arp.h:1.31
--- src/sys/net/if_arp.h:1.30	Mon Aug 31 08:05:20 2015
+++ src/sys/net/if_arp.h	Tue Feb 13 08:43:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.h,v 1.30 2015/08/31 08:05:20 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.h,v 1.31 2018/02/13 08:43:26 maxv Exp $	*/
 
 /*
  * Copyright (c) 1986, 1993
@@ -68,20 +68,43 @@ struct	arphdr {
 #ifdef COMMENT_ONLY
 	uint8_t  ar_sha[];	/* sender hardware address */
 	uint8_t  ar_spa[];	/* sender protocol address */
-	uint8_t  ar_tha[];	/* target hardware address */
+	uint8_t  ar_tha[];	/* target hardware address (!IEEE1394) */
 	uint8_t  ar_tpa[];	/* target protocol address */
 #endif
-#define ar_sha(ap) (((char *)((ap)+1))+0)
-#define ar_spa(ap) (((char *)((ap)+1))+(ap)->ar_hln)
-#define ar_tha(ap) \
-	(ntohs((ap)->ar_hrd) == ARPHRD_IEEE1394 \
-		? NULL : (((char *)((ap)+1))+(ap)->ar_hln+(ap)->ar_pln))
-#define ar_tpa(ap) \
-	(ntohs((ap)->ar_hrd) == ARPHRD_IEEE1394 \
-		? (((char *)((ap)+1))+(ap)->ar_hln+(ap)->ar_pln) \
-		: (((char *)((ap)+1))+(ap)->ar_hln+(ap)->ar_pln+(ap)->ar_hln))
 } __packed;
 
+static inline uint8_t *
+ar_sha(struct arphdr *ap)
+{
+	return ((uint8_t *)(ap + 1)) + 0;
+}
+
+static inline uint8_t *
+ar_spa(struct arphdr *ap)
+{
+	return ((uint8_t *)(ap + 1)) + ap->ar_hln;
+}
+
+static inline uint8_t *
+ar_tha(struct arphdr *ap)
+{
+	if (ntohs(ap->ar_hrd) == ARPHRD_IEEE1394) {
+		return NULL;
+	} else {
+		return ((uint8_t *)(ap + 1)) + ap->ar_hln + ap->ar_pln;
+	}
+}
+
+static inline uint8_t *
+ar_tpa(struct arphdr *ap)
+{
+	if (ntohs(ap->ar_hrd) == ARPHRD_IEEE1394) {
+		return ((uint8_t *)(ap + 1)) + ap->ar_hln + ap->ar_pln;
+	} else {
+		return ((uint8_t *)(ap + 1)) + ap->ar_hln + ap->ar_pln +
+		ap->ar_hln;
+	}
+}
 
 /*
  * ARP ioctl request



CVS commit: src/sys/netinet

2018-02-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Feb 13 08:20:12 UTC 2018

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Use only one label, clearer.


To generate a diff of this commit:
cvs rdiff -u -r1.258 -r1.259 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.258 src/sys/netinet/if_arp.c:1.259
--- src/sys/netinet/if_arp.c:1.258	Tue Feb 13 07:51:24 2018
+++ src/sys/netinet/if_arp.c	Tue Feb 13 08:20:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.258 2018/02/13 07:51:24 maxv Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.259 2018/02/13 08:20:12 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.258 2018/02/13 07:51:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.259 2018/02/13 08:20:12 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1033,14 +1033,15 @@ in_arpinput(struct mbuf *m)
 
 	ifp = if_get_bylla(ar_sha(ah), ah->ar_hln, );
 	if (ifp) {
+		/* it's from me, ignore it. */
 		if_put(ifp, );
 		ARP_STATINC(ARP_STAT_RCVLOCALSHA);
-		goto out;	/* it's from me, ignore it. */
+		goto out;
 	}
 
 	rcvif = ifp = m_get_rcvif_psref(m, );
 	if (__predict_false(rcvif == NULL))
-		goto drop;
+		goto out;
 
 	/*
 	 * Fix up ah->ar_hrd if necessary, before using ar_tha() or ar_tpa().
@@ -1367,7 +1368,7 @@ reply:
 		} else {
 			if (lle != NULL)
 LLE_RUNLOCK(lle);
-			goto drop;
+			goto out;
 		}
 	}
 	ia4_release(ia, _ia);
@@ -1405,7 +1406,6 @@ reply:
 out:
 	if (la != NULL)
 		LLE_WUNLOCK(la);
-drop:
 	if (ia != NULL)
 		ia4_release(ia, _ia);
 	if (rcvif != NULL)