CVS commit: src/lib/libc/gen
Module Name:src Committed By: roy Date: Mon Oct 26 11:44:30 UTC 2015 Modified Files: src/lib/libc/gen: syslog.c Log Message: Use strerror(3) instead of strerror_r(3) and an arbitary buffer size which could be too small. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/lib/libc/gen/syslog.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/syslog.c diff -u src/lib/libc/gen/syslog.c:1.54 src/lib/libc/gen/syslog.c:1.55 --- src/lib/libc/gen/syslog.c:1.54 Thu Sep 18 13:58:20 2014 +++ src/lib/libc/gen/syslog.c Mon Oct 26 11:44:30 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: syslog.c,v 1.54 2014/09/18 13:58:20 christos Exp $ */ +/* $NetBSD: syslog.c,v 1.55 2015/10/26 11:44:30 roy Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/29/95"; #else -__RCSID("$NetBSD: syslog.c,v 1.54 2014/09/18 13:58:20 christos Exp $"); +__RCSID("$NetBSD: syslog.c,v 1.55 2015/10/26 11:44:30 roy Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -378,17 +378,17 @@ vsyslogp_r(int pri, struct syslog_data * */ for (t = fmt_cpy, fmt_left = FMT_LEN; (ch = *fmt) != '\0'; ++fmt) { if (ch == '%' && fmt[1] == 'm') { - char ebuf[128]; - ++fmt; - if (signal_safe || - strerror_r(saved_errno, ebuf, sizeof(ebuf))) + const char *s; + + if (signal_safe || (s = strerror(saved_errno)) == NULL) prlen = snprintf_ss(t, fmt_left, "Error %d", saved_errno); else -prlen = snprintf_ss(t, fmt_left, "%s", ebuf); +prlen = strlcpy(t, s, fmt_left); if (prlen >= fmt_left) prlen = fmt_left - 1; t += prlen; + fmt++; fmt_left -= prlen; } else if (ch == '%' && fmt[1] == '%' && fmt_left > 2) { *t++ = '%';
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon Oct 26 09:06:52 UTC 2015 Modified Files: src/share/man/man9: kernhist.9 Log Message: Various fixes and improvements. Guess what the end of a sentence could be. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/kernhist.9 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/man9/kernhist.9 diff -u src/share/man/man9/kernhist.9:1.1 src/share/man/man9/kernhist.9:1.2 --- src/share/man/man9/kernhist.9:1.1 Mon Oct 26 07:07:36 2015 +++ src/share/man/man9/kernhist.9 Mon Oct 26 09:06:52 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: kernhist.9,v 1.1 2015/10/26 07:07:36 mrg Exp $ +.\" $NetBSD: kernhist.9,v 1.2 2015/10/26 09:06:52 wiz Exp $ .\" .\" Copyright (c) 2015 Matthew R. Green .\" All rights reserved. @@ -59,7 +59,7 @@ Below are the functions and macros provi .Sh DESCRIPTION The .Nm -facility provides a very low-level tracing facility, that can be called +facility provides a very low-level tracing facility that can be called extremely early in the kernel initialisation. It provides a simple restricted .Xr printf 3 @@ -76,10 +76,10 @@ Arguments that require additional derefe will not work in .Xr vmstat 1 , but will when called from -.Xr ddb 9 . +.Xr ddb 4 . .Pp A kernel history is a fixed-size buffer of an either statically or dynamically -allocated buffer, that is used and read in a cycled basis. +allocated buffer that is used and read in a cycled basis. It includes the time an entry was made, the CPU that the entry was recorded from, the .Xr printf 3 @@ -89,13 +89,15 @@ for this function, and the 4 argumnts. These macros provide access to most kernel history functionality: .Bl -tag -width 4n .It Fn KERNHIST_DECL name -Declares an extern struct kern_history +Declare an extern struct kern_history .Fa name . .It Fn KERNHIST_DEFINE name -Defines a struct kern_history +Define a struct kern_history .Fa name . .It Fn KERNHIST_INIT name num_entries -Dynamically initialise a kernel history called name with +Dynamically initialise a kernel history called name with +.Ar num_entries +entries. .It Fn KERNHIST_INITIALIZER name buffer Initialise a statically defined kernel history called .Fa name @@ -109,7 +111,7 @@ using the statically allocated .Fa buffer for history entries. .It Fn KERNHIST_FUNC fname -Declares necessary variables for +Declare necessary variables for .Nm to be used this function. Callable only once per function. @@ -118,7 +120,8 @@ For the given kernel history .Fa name , log the format and arguments in the history as a unique event. .It Fn KERNHIST_CALLED name -Declares a function as being called. Either this or +Declare a function as being called. +Either this or .Fn KERNHIST_CALLARGS must be used near the function entry point. .It Fn KERNHIST_CALLARGS name fmt arg0 arg1 arg2 arg3 @@ -128,7 +131,7 @@ that avoids that .Dq called! log message in addition to normal arguments. .It Fn KERNHIST_DUMP name -Calls +Call .Fn kernhist_dump on the named kernel history. .It Fn kernhist_dump history @@ -152,12 +155,12 @@ argument is currently ignored. .El .Sh SEE ALSO .Xr vmstat 1 , -.Xr usb 9 , +.Xr usb 4 , .Xr uvm 9 .\" .Sh EXAMPLES .\" .\" add example here of code usage -.\" +.\" .Sh HISTORY .Nm was originally written by
CVS commit: src/sys/arch/sparc/stand/ofwboot
Module Name:src Committed By: mrg Date: Mon Oct 26 07:11:33 UTC 2015 Modified Files: src/sys/arch/sparc/stand/ofwboot: Makefile Log Message: force -mcpu=v9 for ofwboot, which demands v9 cpus. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sparc/stand/ofwboot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc/stand/ofwboot/Makefile diff -u src/sys/arch/sparc/stand/ofwboot/Makefile:1.35 src/sys/arch/sparc/stand/ofwboot/Makefile:1.36 --- src/sys/arch/sparc/stand/ofwboot/Makefile:1.35 Sat Oct 10 06:49:40 2015 +++ src/sys/arch/sparc/stand/ofwboot/Makefile Mon Oct 26 07:11:33 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.35 2015/10/10 06:49:40 martin Exp $ +# $NetBSD: Makefile,v 1.36 2015/10/26 07:11:33 mrg Exp $ CURDIR= ${.CURDIR} S= ${CURDIR}/../../../.. @@ -26,7 +26,7 @@ LIBC= LIBCRTBEGIN= LIBCRTEND= -COPTS+= -ffreestanding +COPTS+= -ffreestanding -mcpu=v9 CWARNFLAGS+= -Wno-main CFLAGS+= ${COPTS} CPPFLAGS+= -D_STANDALONE
CVS commit: src
Module Name:src Committed By: mrg Date: Mon Oct 26 07:15:36 UTC 2015 Modified Files: src/distrib/sets/lists/xserver: md.amd64 md.i386 src/external/mit/xorg/lib/gallium: Makefile Log Message: build the nouveau gallium driver. To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/distrib/sets/lists/xserver/md.amd64 cvs rdiff -u -r1.104 -r1.105 src/distrib/sets/lists/xserver/md.i386 cvs rdiff -u -r1.7 -r1.8 src/external/mit/xorg/lib/gallium/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/xserver/md.amd64 diff -u src/distrib/sets/lists/xserver/md.amd64:1.86 src/distrib/sets/lists/xserver/md.amd64:1.87 --- src/distrib/sets/lists/xserver/md.amd64:1.86 Tue Oct 13 10:33:17 2015 +++ src/distrib/sets/lists/xserver/md.amd64 Mon Oct 26 07:15:36 2015 @@ -1,4 +1,4 @@ -# $NetBSD: md.amd64,v 1.86 2015/10/13 10:33:17 pgoyette Exp $ +# $NetBSD: md.amd64,v 1.87 2015/10/26 07:15:36 mrg Exp $ ./usr/X11R6/bin/X -unknown- x11 ./usr/X11R6/bin/XFree86 -unknown- x11 ./usr/X11R6/bin/gtf -unknown- x11 @@ -367,6 +367,8 @@ ./usr/X11R7/lib/modules/dri/mesa_dri_drivers.so.0 -unknown- xorg ./usr/X11R7/lib/modules/dri/mga_dri.so -unknown- obsolete ./usr/X11R7/lib/modules/dri/mga_dri.so.0 -unknown- obsolete +./usr/X11R7/lib/modules/dri/nouveau_dri.so -unknown- xorg +./usr/X11R7/lib/modules/dri/nouveau_dri.so.0 -unknown- xorg ./usr/X11R7/lib/modules/dri/r128_dri.so -unknown- obsolete ./usr/X11R7/lib/modules/dri/r128_dri.so.0 -unknown- obsolete ./usr/X11R7/lib/modules/dri/r200_dri.so -unknown- xorg Index: src/distrib/sets/lists/xserver/md.i386 diff -u src/distrib/sets/lists/xserver/md.i386:1.104 src/distrib/sets/lists/xserver/md.i386:1.105 --- src/distrib/sets/lists/xserver/md.i386:1.104 Tue Oct 13 10:33:17 2015 +++ src/distrib/sets/lists/xserver/md.i386 Mon Oct 26 07:15:36 2015 @@ -1,4 +1,4 @@ -# $NetBSD: md.i386,v 1.104 2015/10/13 10:33:17 pgoyette Exp $ +# $NetBSD: md.i386,v 1.105 2015/10/26 07:15:36 mrg Exp $ ./usr/X11R6/bin/X -unknown- x11 ./usr/X11R6/bin/XFree86 -unknown- x11 ./usr/X11R6/bin/gtf -unknown- x11 @@ -403,6 +403,8 @@ ./usr/X11R7/lib/modules/dri/mesa_dri_drivers.so.0 -unknown- xorg ./usr/X11R7/lib/modules/dri/mga_dri.so -unknown- obsolete ./usr/X11R7/lib/modules/dri/mga_dri.so.0 -unknown- obsolete +./usr/X11R7/lib/modules/dri/nouveau_dri.so -unknown- xorg +./usr/X11R7/lib/modules/dri/nouveau_dri.so.0 -unknown- xorg ./usr/X11R7/lib/modules/dri/r128_dri.so -unknown- obsolete ./usr/X11R7/lib/modules/dri/r128_dri.so.0 -unknown- obsolete ./usr/X11R7/lib/modules/dri/r200_dri.so -unknown- xorg Index: src/external/mit/xorg/lib/gallium/Makefile diff -u src/external/mit/xorg/lib/gallium/Makefile:1.7 src/external/mit/xorg/lib/gallium/Makefile:1.8 --- src/external/mit/xorg/lib/gallium/Makefile:1.7 Wed Sep 23 05:28:14 2015 +++ src/external/mit/xorg/lib/gallium/Makefile Mon Oct 26 07:15:36 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2015/09/23 05:28:14 mrg Exp $ +# $NetBSD: Makefile,v 1.8 2015/10/26 07:15:36 mrg Exp $ # Link the gallium mega driver. @@ -15,7 +15,7 @@ DRIDEBUGDIR= ${DEBUGDIR}${X11USRLIBDIR}/ DRIVERS= kms_swrast swrast .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" -DRIVERS+= r600 +DRIVERS+= r600 nouveau .endif CPPFLAGS+= \ @@ -47,6 +47,11 @@ GALLIUM_SUBDIRS= \ drivers/radeon \ drivers/r600 \ drivers/r600/sb \ + drivers/nouveau \ + drivers/nouveau/nv30 \ + drivers/nouveau/nv50 \ + drivers/nouveau/codegen \ + drivers/nouveau/nvc0 \ drivers/softpipe \ winsys/radeon/drm \ winsys/sw/null \ @@ -338,6 +343,116 @@ GALLIUM_SOURCES.drivers/r600/sb = \ CPPFLAGS.${_f} += -I${X11SRCDIR.MesaLib}/src/gallium/drivers/r600 .endfor +GALLIUM_SOURCES.drivers/nouveau = \ + nouveau_screen.c \ + nouveau_fence.c \ + nouveau_mm.c \ + nouveau_buffer.c \ + nouveau_heap.c \ + nouveau_video.c \ + nouveau_vp3_video.c \ + nouveau_vp3_video_bsp.c \ + nouveau_vp3_video_vp.c + +GALLIUM_SOURCES.drivers/nouveau/nv30 = \ + nv30_screen.c \ + nv30_context.c \ + nv30_format.c \ + nv30_resource.c \ + nv30_transfer.c \ + nv30_miptree.c \ + nv30_state.c \ + nv30_state_validate.c \ + nv30_texture.c \ + nv30_fragtex.c \ + nv40_verttex.c \ + nv30_fragprog.c \ + nv30_vertprog.c \ + nv30_clear.c \ + nv30_vbo.c \ + nv30_push.c \ + nv30_draw.c \ + nv30_query.c \ + nvfx_vertprog.c \ + nvfx_fragprog.c + +GALLIUM_SOURCES.drivers/nouveau/nv50 = \ + nv50_context.c \ + nv50_formats.c \ + nv50_miptree.c \ + nv50_resource.c \ + nv50_screen.c \ + nv50_state.c \ + nv50_state_validate.c \ + nv50_surface.c \ + nv50_tex.c \ + nv50_transfer.c \ + nv50_vbo.c \ + nv50_program.c \ + nv50_shader_state.c \ + nv50_push.c \ + nv50_query.c \ + nv84_video.c \ + nv84_video_bsp.c \ + nv84_video_vp.c \ + nv98_video.c \ + nv98_video_bsp.c \ + nv98_video_vp.c \ + nv98_video_ppp.c + +GALLIUM_SOURCES.drivers/nouveau/codegen =
CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo
Module Name:src Committed By: mrg Date: Mon Oct 26 07:12:08 UTC 2015 Modified Files: src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo: nouveau_engine_fifo_nve0.c Log Message: minor re-format of the previous. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c:1.5 src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c:1.6 --- src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c:1.5 Tue Oct 13 01:43:47 2015 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/fifo/nouveau_engine_fifo_nve0.c Mon Oct 26 07:12:08 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: nouveau_engine_fifo_nve0.c,v 1.5 2015/10/13 01:43:47 mrg Exp $ */ +/* $NetBSD: nouveau_engine_fifo_nve0.c,v 1.6 2015/10/26 07:12:08 mrg Exp $ */ /* * Copyright 2012 Red Hat Inc. @@ -25,7 +25,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nve0.c,v 1.5 2015/10/13 01:43:47 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_fifo_nve0.c,v 1.6 2015/10/26 07:12:08 mrg Exp $"); #include #include @@ -139,7 +139,8 @@ nve0_fifo_runlist_update(struct nve0_fif if (cold) { uint count = 2000; while (count-- > 0) { - if (!(nv_rd32(priv, 0x002284 + (engine * 0x08)) & 0x0010)) + if (!(nv_rd32(priv, 0x002284 + + (engine * 0x08)) & 0x0010)) break; delay(1000); }
CVS commit: src/sys/uvm
Module Name:src Committed By: mrg Date: Mon Oct 26 09:02:49 UTC 2015 Modified Files: src/sys/uvm: uvm_object.c Log Message: disable the previous for now; it fails for me on a different system. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/uvm/uvm_object.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/uvm/uvm_object.c diff -u src/sys/uvm/uvm_object.c:1.14 src/sys/uvm/uvm_object.c:1.15 --- src/sys/uvm/uvm_object.c:1.14 Mon Oct 26 07:13:01 2015 +++ src/sys/uvm/uvm_object.c Mon Oct 26 09:02:49 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_object.c,v 1.14 2015/10/26 07:13:01 mrg Exp $ */ +/* $NetBSD: uvm_object.c,v 1.15 2015/10/26 09:02:49 mrg Exp $ */ /* * Copyright (c) 2006, 2010 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_object.c,v 1.14 2015/10/26 07:13:01 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_object.c,v 1.15 2015/10/26 09:02:49 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -62,7 +62,9 @@ uvm_obj_init(struct uvm_object *uo, cons bool alock, u_int refs) { +#if 0 /* notyet */ KASSERT(ops); +#endif if (alock) { /* Allocate and assign a lock. */ uo->vmobjlock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
CVS commit: src
Module Name:src Committed By: mrg Date: Mon Oct 26 07:07:36 UTC 2015 Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man9: Makefile Added Files: src/share/man/man9: kernhist.9 Log Message: add documentation on "options KERNHIST". To generate a diff of this commit: cvs rdiff -u -r1.1998 -r1.1999 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.392 -r1.393 src/share/man/man9/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man9/kernhist.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1998 src/distrib/sets/lists/comp/mi:1.1999 --- src/distrib/sets/lists/comp/mi:1.1998 Wed Oct 14 15:20:44 2015 +++ src/distrib/sets/lists/comp/mi Mon Oct 26 07:07:36 2015 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1998 2015/10/14 15:20:44 christos Exp $ +# $NetBSD: mi,v 1.1999 2015/10/26 07:07:36 mrg Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -10055,6 +10055,7 @@ ./usr/share/man/cat9/kcpuset_use.0 comp-sys-catman .cat ./usr/share/man/cat9/kcpuset_zero.0 comp-sys-catman .cat ./usr/share/man/cat9/kernacc.0 comp-obsolete obsolete +./usr/share/man/cat9/kernhist.0 comp-sys-catman .cat ./usr/share/man/cat9/kfilter_register.0 comp-sys-catman .cat ./usr/share/man/cat9/kfilter_unregister.0 comp-sys-catman .cat ./usr/share/man/cat9/killproc.0 comp-sys-catman .cat @@ -16877,6 +16878,7 @@ ./usr/share/man/html9/kcpuset_unuse.html comp-sys-htmlman html ./usr/share/man/html9/kcpuset_use.html comp-sys-htmlman html ./usr/share/man/html9/kcpuset_zero.html comp-sys-htmlman html +./usr/share/man/html9/kernhist.html comp-sys-htmlman html ./usr/share/man/html9/kfilter_register.html comp-sys-htmlman html ./usr/share/man/html9/kfilter_unregister.html comp-sys-htmlman html ./usr/share/man/html9/killproc.html comp-sys-htmlman html @@ -23853,6 +23855,7 @@ ./usr/share/man/man9/kcpuset_use.9 comp-sys-man .man ./usr/share/man/man9/kcpuset_zero.9 comp-sys-man .man ./usr/share/man/man9/kernacc.9 comp-obsolete obsolete +./usr/share/man/man9/kernhist.9 comp-sys-man .man ./usr/share/man/man9/kfilter_register.9 comp-sys-man .man ./usr/share/man/man9/kfilter_unregister.9 comp-sys-man .man ./usr/share/man/man9/killproc.9 comp-sys-man .man Index: src/share/man/man9/Makefile diff -u src/share/man/man9/Makefile:1.392 src/share/man/man9/Makefile:1.393 --- src/share/man/man9/Makefile:1.392 Fri Oct 2 05:22:49 2015 +++ src/share/man/man9/Makefile Mon Oct 26 07:07:36 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.392 2015/10/02 05:22:49 msaitoh Exp $ +# $NetBSD: Makefile,v 1.393 2015/10/26 07:07:36 mrg Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -29,7 +29,7 @@ MAN= accept_filter.9 accf_data.9 accf_ht in_getifa.9 \ in4_cksum.9 inittodr.9 interrupt_distribute.9 intro.9 ioasic.9 \ ioctl.9 ipkdb.9 ipi.9 isa.9 isapnp.9 itimerfix.9 kauth.9 kcopy.9 \ - kcpuset.9 kmem.9 kpause.9 \ + kcpuset.9 kernhist.9 kmem.9 kpause.9 \ kfilter_register.9 knote.9 \ kprintf.9 kthread.9 linedisc.9 lock.9 log.9 ltsleep.9 \ LWP_CACHE_CREDS.9 \ Added files: Index: src/share/man/man9/kernhist.9 diff -u /dev/null src/share/man/man9/kernhist.9:1.1 --- /dev/null Mon Oct 26 07:07:36 2015 +++ src/share/man/man9/kernhist.9 Mon Oct 26 07:07:36 2015 @@ -0,0 +1,195 @@ +.\" $NetBSD: kernhist.9,v 1.1 2015/10/26 07:07:36 mrg Exp $ +.\" +.\" Copyright (c) 2015 Matthew R. Green +.\" 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. +.\" 3. The name of the author may not be used to endorse or promote products +.\"derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR
CVS commit: src/usr.sbin/traceroute
Module Name:src Committed By: shm Date: Mon Oct 26 08:53:45 UTC 2015 Modified Files: src/usr.sbin/traceroute: traceroute.c Log Message: Added missed break statement. (Missed break in -z option implicitly implies -P option) To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/usr.sbin/traceroute/traceroute.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/traceroute/traceroute.c diff -u src/usr.sbin/traceroute/traceroute.c:1.81 src/usr.sbin/traceroute/traceroute.c:1.82 --- src/usr.sbin/traceroute/traceroute.c:1.81 Thu Aug 16 00:40:28 2012 +++ src/usr.sbin/traceroute/traceroute.c Mon Oct 26 08:53:45 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: traceroute.c,v 1.81 2012/08/16 00:40:28 zafer Exp $ */ +/* $NetBSD: traceroute.c,v 1.82 2015/10/26 08:53:45 shm Exp $ */ /* * Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000 @@ -30,7 +30,7 @@ static const char rcsid[] = __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997,\ 1998, 1999, 2000\ The Regents of the University of California. All rights reserved."); -__RCSID("$NetBSD: traceroute.c,v 1.81 2012/08/16 00:40:28 zafer Exp $"); +__RCSID("$NetBSD: traceroute.c,v 1.82 2015/10/26 08:53:45 shm Exp $"); #endif #endif @@ -607,6 +607,7 @@ main(int argc, char **argv) case 'z': pausemsecs = str2val(optarg, "pause msecs", 0, 60 * 60 * 1000); + break; case 'P': off = IP_DF;
CVS commit: src/sys/uvm
Module Name:src Committed By: mrg Date: Mon Oct 26 07:13:01 UTC 2015 Modified Files: src/sys/uvm: uvm_object.c Log Message: in uvm_obj_init(), KASSERT(ops), to ensure we have an actual pager ops set for this object. suggested by chuq. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/uvm/uvm_object.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/uvm/uvm_object.c diff -u src/sys/uvm/uvm_object.c:1.13 src/sys/uvm/uvm_object.c:1.14 --- src/sys/uvm/uvm_object.c:1.13 Mon Aug 24 22:50:32 2015 +++ src/sys/uvm/uvm_object.c Mon Oct 26 07:13:01 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_object.c,v 1.13 2015/08/24 22:50:32 pooka Exp $ */ +/* $NetBSD: uvm_object.c,v 1.14 2015/10/26 07:13:01 mrg Exp $ */ /* * Copyright (c) 2006, 2010 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_object.c,v 1.13 2015/08/24 22:50:32 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_object.c,v 1.14 2015/10/26 07:13:01 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -62,6 +62,7 @@ uvm_obj_init(struct uvm_object *uo, cons bool alock, u_int refs) { + KASSERT(ops); if (alock) { /* Allocate and assign a lock. */ uo->vmobjlock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
CVS commit: src/lib/libc/net
Module Name:src Committed By: christos Date: Mon Oct 26 19:28:53 UTC 2015 Modified Files: src/lib/libc/net: getnetnamadr.c Log Message: PR/50367: Stefan Schaeckeler: Apply fix to obey RES_CHECKNAME to getnetbyaddr and getnetbyname. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/lib/libc/net/getnetnamadr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/net/getnetnamadr.c diff -u src/lib/libc/net/getnetnamadr.c:1.42 src/lib/libc/net/getnetnamadr.c:1.43 --- src/lib/libc/net/getnetnamadr.c:1.42 Tue Mar 13 17:13:41 2012 +++ src/lib/libc/net/getnetnamadr.c Mon Oct 26 15:28:53 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: getnetnamadr.c,v 1.42 2012/03/13 21:13:41 christos Exp $ */ +/* $NetBSD: getnetnamadr.c,v 1.43 2015/10/26 19:28:53 christos Exp $ */ /* Copyright (c) 1993 Carlos Leandro and Rui Salgueiro * Dep. Matematica Universidade de Coimbra, Portugal, Europe @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)getnetbyaddr static char sccsid_[] = "from getnetnamadr.c 1.4 (Coimbra) 93/06/03"; static char rcsid[] = "Id: getnetnamadr.c,v 8.8 1997/06/01 20:34:37 vixie Exp "; #else -__RCSID("$NetBSD: getnetnamadr.c,v 1.42 2012/03/13 21:13:41 christos Exp $"); +__RCSID("$NetBSD: getnetnamadr.c,v 1.43 2015/10/26 19:28:53 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -77,6 +77,12 @@ __weak_alias(getnetbyaddr,_getnetbyaddr) __weak_alias(getnetbyname,_getnetbyname) #endif +#define maybe_ok(res, nm, ok) (((res)->options & RES_NOCHECKNAME) != 0U || \ + (ok)(nm) != 0) +#define maybe_hnok(res, hn) maybe_ok((res), (hn), res_hnok) +#define maybe_dnok(res, dn) maybe_ok((res), (dn), res_dnok) + + extern int _net_stayopen; #define BYADDR 0 @@ -105,7 +111,7 @@ static struct netent net_entry; static char *net_aliases[MAXALIASES]; static int parse_reversed_addr(const char *, in_addr_t *); -static struct netent *getnetanswer(querybuf *, int, int); +static struct netent *getnetanswer(res_state, querybuf *, int, int); static int _files_getnetbyaddr(void *, void *, va_list); static int _files_getnetbyname(void *, void *, va_list); static int _dns_getnetbyaddr(void *, void *, va_list); @@ -159,7 +165,7 @@ parse_reversed_addr(const char *str, in_ } static struct netent * -getnetanswer(querybuf *answer, int anslen, int net_i) +getnetanswer(res_state res, querybuf *answer, int anslen, int net_i) { static char n_name[MAXDNAME]; static char netbuf[PACKETSZ]; @@ -172,6 +178,7 @@ getnetanswer(querybuf *answer, int ansle char *in, *bp, **ap, *ep; _DIAGASSERT(answer != NULL); + _DIAGASSERT(res != NULL); /* * find first satisfactory answer @@ -216,7 +223,7 @@ getnetanswer(querybuf *answer, int ansle n_name[0] = '\0'; while (--ancount >= 0 && cp < eom) { n = dn_expand(answer->buf, eom, cp, bp, (int)(ep - bp)); - if ((n < 0) || !res_dnok(bp)) + if ((n < 0) || !maybe_dnok(res, bp)) break; cp += n; (void)strlcpy(n_name, bp, sizeof(n_name)); @@ -226,7 +233,7 @@ getnetanswer(querybuf *answer, int ansle GETSHORT(n, cp); if (class == C_IN && type == T_PTR) { n = dn_expand(answer->buf, eom, cp, bp, (int)(ep - bp)); - if ((n < 0) || !res_hnok(bp)) { + if ((n < 0) || !maybe_hnok(res, bp)) { cp += n; return NULL; } @@ -359,7 +366,7 @@ _dns_getnetbyaddr(void *cbrv, void *cbda return NS_NOTFOUND; } __res_put_state(res); - np = getnetanswer(buf, anslen, BYADDR); + np = getnetanswer(res, buf, anslen, BYADDR); free(buf); if (np) { /* maybe net should be unsigned? */ @@ -471,7 +478,7 @@ _dns_getnetbyname(void *cbrv, void *cbda return NS_NOTFOUND; } __res_put_state(res); - np = getnetanswer(buf, anslen, BYNAME); + np = getnetanswer(res, buf, anslen, BYNAME); free(buf); if (np != NULL) {
CVS commit: src/lib/libc/net
Module Name:src Committed By: christos Date: Mon Oct 26 19:41:19 UTC 2015 Modified Files: src/lib/libc/net: getnetnamadr.c Log Message: put the state back after it is used. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/lib/libc/net/getnetnamadr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/net/getnetnamadr.c diff -u src/lib/libc/net/getnetnamadr.c:1.43 src/lib/libc/net/getnetnamadr.c:1.44 --- src/lib/libc/net/getnetnamadr.c:1.43 Mon Oct 26 15:28:53 2015 +++ src/lib/libc/net/getnetnamadr.c Mon Oct 26 15:41:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: getnetnamadr.c,v 1.43 2015/10/26 19:28:53 christos Exp $ */ +/* $NetBSD: getnetnamadr.c,v 1.44 2015/10/26 19:41:19 christos Exp $ */ /* Copyright (c) 1993 Carlos Leandro and Rui Salgueiro * Dep. Matematica Universidade de Coimbra, Portugal, Europe @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)getnetbyaddr static char sccsid_[] = "from getnetnamadr.c 1.4 (Coimbra) 93/06/03"; static char rcsid[] = "Id: getnetnamadr.c,v 8.8 1997/06/01 20:34:37 vixie Exp "; #else -__RCSID("$NetBSD: getnetnamadr.c,v 1.43 2015/10/26 19:28:53 christos Exp $"); +__RCSID("$NetBSD: getnetnamadr.c,v 1.44 2015/10/26 19:41:19 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -365,8 +365,8 @@ _dns_getnetbyaddr(void *cbrv, void *cbda __res_put_state(res); return NS_NOTFOUND; } - __res_put_state(res); np = getnetanswer(res, buf, anslen, BYADDR); + __res_put_state(res); free(buf); if (np) { /* maybe net should be unsigned? */ @@ -477,8 +477,8 @@ _dns_getnetbyname(void *cbrv, void *cbda __res_put_state(res); return NS_NOTFOUND; } - __res_put_state(res); np = getnetanswer(res, buf, anslen, BYNAME); + __res_put_state(res); free(buf); if (np != NULL) {
CVS commit: src/lib/libpanel
Module Name:src Committed By: uwe Date: Mon Oct 26 23:09:50 UTC 2015 Added Files: src/lib/libpanel: Makefile _deck.c above.c below.c bottom.c del.c getuser.c hidden.c hide.c move.c new.c panel.h panel_impl.h replace.c setuser.c shlib_version show.c top.c update.c window.c Log Message: First cut at ETI libpanel. Lacks man pages and tests. Not hooked into the build yet. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/libpanel/Makefile src/lib/libpanel/_deck.c \ src/lib/libpanel/above.c src/lib/libpanel/below.c \ src/lib/libpanel/bottom.c src/lib/libpanel/del.c \ src/lib/libpanel/getuser.c src/lib/libpanel/hidden.c \ src/lib/libpanel/hide.c src/lib/libpanel/move.c src/lib/libpanel/new.c \ src/lib/libpanel/panel.h src/lib/libpanel/panel_impl.h \ src/lib/libpanel/replace.c src/lib/libpanel/setuser.c \ src/lib/libpanel/shlib_version src/lib/libpanel/show.c \ src/lib/libpanel/top.c src/lib/libpanel/update.c \ src/lib/libpanel/window.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/libpanel/Makefile diff -u /dev/null src/lib/libpanel/Makefile:1.1 --- /dev/null Mon Oct 26 23:09:50 2015 +++ src/lib/libpanel/Makefile Mon Oct 26 23:09:49 2015 @@ -0,0 +1,31 @@ +# $NetBSD: Makefile,v 1.1 2015/10/26 23:09:49 uwe Exp $ + +WARNS= 4 + +LIB= panel + +INCS= panel.h + +SRCS= # + +SRCS+= _deck.c + +SRCS+= above.c +SRCS+= below.c +SRCS+= bottom.c +SRCS+= del.c +SRCS+= getuser.c +SRCS+= hidden.c +SRCS+= hide.c +SRCS+= move.c +SRCS+= new.c +SRCS+= replace.c +SRCS+= setuser.c +SRCS+= show.c +SRCS+= top.c +SRCS+= update.c +SRCS+= window.c + +#LIBDPLIBS+= curses ${.CURDIR}/../libcurses + +.include Index: src/lib/libpanel/_deck.c diff -u /dev/null src/lib/libpanel/_deck.c:1.1 --- /dev/null Mon Oct 26 23:09:50 2015 +++ src/lib/libpanel/_deck.c Mon Oct 26 23:09:49 2015 @@ -0,0 +1,34 @@ +/* $NetBSD: _deck.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */ + +/* + * Copyright (c) 2015 Valery Ushakov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__RCSID("$NetBSD: _deck.c,v 1.1 2015/10/26 23:09:49 uwe Exp $"); + +#include "panel_impl.h" + +struct deck _deck __dso_hidden = TAILQ_HEAD_INITIALIZER(_deck); +PANEL _stdscr_panel __dso_hidden; Index: src/lib/libpanel/above.c diff -u /dev/null src/lib/libpanel/above.c:1.1 --- /dev/null Mon Oct 26 23:09:50 2015 +++ src/lib/libpanel/above.c Mon Oct 26 23:09:49 2015 @@ -0,0 +1,45 @@ +/* $NetBSD: above.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */ + +/* + * Copyright (c) 2015 Valery Ushakov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY,
CVS commit: src/share/man/man4
Module Name:src Committed By: bad Date: Mon Oct 26 22:18:58 UTC 2015 Modified Files: src/share/man/man4: vlan.4 Log Message: Explain how exactly tagged packets are processed. While here remove a bit of non-techref wording and assume that people know what VLANs are good for.. XXX: pullup-7, pullup-6 To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/share/man/man4/vlan.4 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/man4/vlan.4 diff -u src/share/man/man4/vlan.4:1.31 src/share/man/man4/vlan.4:1.32 --- src/share/man/man4/vlan.4:1.31 Thu Dec 16 18:29:47 2010 +++ src/share/man/man4/vlan.4 Mon Oct 26 22:18:57 2015 @@ -1,6 +1,6 @@ -.\" $NetBSD: vlan.4,v 1.31 2010/12/16 18:29:47 wiz Exp $ +.\" $NetBSD: vlan.4,v 1.32 2015/10/26 22:18:57 bad Exp $ .\" -.\" Copyright (c) 2000 The NetBSD Foundation, Inc. +.\" Copyright (c) 2000, 2015 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 16, 2010 +.Dd October 26, 2015 .Dt VLAN 4 .Os .Sh NAME @@ -43,9 +43,8 @@ interface provides support for 802.1Q Virtual Local Area Networks .Pq Tn VLAN . This supports the -trunking of more than one network on a single network interface. -This is particularly useful on routers or on hosts which must be -connected to many different networks through a single physical interface. +trunking of more than one network on a single network interface by using +802.1Q tagged and untagged frames. .Pp To use a .Nm vlan @@ -58,7 +57,9 @@ distinguishes each .Tn VLAN from any others .Pc -and physical interface associated with the +and +.Pq parent +physical interface associated with the .Tn VLAN . This can be done by using the .Xr ifconfig 8 @@ -75,6 +76,35 @@ and .Dv SIOCSIFVLAN arguments. .Pp +Packets sent through a +.Nm +interface are tagged with the VID and passed to the parent interface for +transmission. +Tagged packets received on the parent interface are passed to the +.Nm +interface with the corresponding VID associated with the parent interface. +Packets sent directly through the parent interface are transmitted as +untagged frames. +Untagged frames received on the parent interface are handled by the +parent interface. +Tagged frames received on the parent interface with a VID of 0 and an +EtherType of IP or IPv6 are processed on the parent interface. +Tagged frames received on the parent interface for which no +.Nm +interface with a matching VID exists are dropped and counted as +.Dq unknown protocol . +.Po +These are displayed by the +.Xr ifconfig 8 +.Fl -v +option. +.Pc +.Pp +If the +.Nm +pseudo-device is not configured in the kernel only packets tagged with a +VID of 0 are processed. +.Pp To be compatible with other .Tn IEEE 802.1Q devices, the
CVS commit: src/lib/libc/net
Module Name:src Committed By: christos Date: Mon Oct 26 14:48:04 UTC 2015 Modified Files: src/lib/libc/net: getaddrinfo.c Log Message: PR/50367: Stefan Schaeckeler: libc resolver library does not resolve host names with underscores ("_"). According to resolv.conf(5) RES_NOCHECKNAME is on by default; well, it is and gethostbyname(3) obeys it (gethnamaddr.c:maybe_ok), but getaddrinfo(3) up till this commit not. XXX: pullup-7, pullup-6 To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 src/lib/libc/net/getaddrinfo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/net/getaddrinfo.c diff -u src/lib/libc/net/getaddrinfo.c:1.109 src/lib/libc/net/getaddrinfo.c:1.110 --- src/lib/libc/net/getaddrinfo.c:1.109 Thu Sep 10 10:05:06 2015 +++ src/lib/libc/net/getaddrinfo.c Mon Oct 26 10:48:04 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: getaddrinfo.c,v 1.109 2015/09/10 14:05:06 christos Exp $ */ +/* $NetBSD: getaddrinfo.c,v 1.110 2015/10/26 14:48:04 christos Exp $ */ /* $KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $ */ /* @@ -55,7 +55,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getaddrinfo.c,v 1.109 2015/09/10 14:05:06 christos Exp $"); +__RCSID("$NetBSD: getaddrinfo.c,v 1.110 2015/10/26 14:48:04 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #ifndef RUMP_ACTION @@ -226,8 +226,8 @@ static int addrconfig(uint64_t *); static int ip6_str2scopeid(char *, struct sockaddr_in6 *, u_int32_t *); #endif -static struct addrinfo *getanswer(const querybuf *, int, const char *, int, -const struct addrinfo *); +static struct addrinfo *getanswer(res_state, const querybuf *, int, +const char *, int, const struct addrinfo *); static void aisort(struct addrinfo *s, res_state res); static struct addrinfo * _dns_query(struct res_target *, const struct addrinfo *, res_state, int); @@ -1162,9 +1162,11 @@ ip6_str2scopeid(char *scope, struct sock static const char AskedForGot[] = "gethostby*.getanswer: asked for \"%s\", got \"%s\""; +#define maybe_ok(res, nm, ok) (((res)->options & RES_NOCHECKNAME) != 0U || \ + (ok)(nm) != 0) static struct addrinfo * -getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, -const struct addrinfo *pai) +getanswer(res_state res, const querybuf *answer, int anslen, const char *qname, +int qtype, const struct addrinfo *pai) { struct addrinfo sentinel, *cur; struct addrinfo ai, *aip; @@ -1186,6 +1188,7 @@ getanswer(const querybuf *answer, int an _DIAGASSERT(answer != NULL); _DIAGASSERT(qname != NULL); _DIAGASSERT(pai != NULL); + _DIAGASSERT(res != NULL); memset(, 0, sizeof(sentinel)); cur = @@ -1218,7 +1221,7 @@ getanswer(const querybuf *answer, int an return (NULL); } n = dn_expand(answer->buf, eom, cp, bp, (int)(ep - bp)); - if ((n < 0) || !(*name_ok)(bp)) { + if ((n < 0) || !maybe_ok(res, bp, name_ok)) { h_errno = NO_RECOVERY; return (NULL); } @@ -1243,7 +1246,7 @@ getanswer(const querybuf *answer, int an srvlist = NULL; while (ancount-- > 0 && cp < eom && !had_error) { n = dn_expand(answer->buf, eom, cp, bp, (int)(ep - bp)); - if ((n < 0) || !(*name_ok)(bp)) { + if ((n < 0) || !maybe_ok(res, bp, name_ok)) { had_error++; continue; } @@ -1262,7 +1265,7 @@ getanswer(const querybuf *answer, int an if ((qtype == T_A || qtype == T_ || qtype == T_ANY) && type == T_CNAME) { n = dn_expand(answer->buf, eom, cp, tbuf, (int)sizeof tbuf); - if ((n < 0) || !(*name_ok)(tbuf)) { + if ((n < 0) || !maybe_ok(res, tbuf, name_ok)) { had_error++; continue; } @@ -1353,7 +1356,7 @@ getanswer(const querybuf *answer, int an cp += INT16SZ; n = dn_expand(answer->buf, eom, cp, tbuf, (int)sizeof(tbuf)); - if ((n < 0) || !res_hnok(tbuf)) { + if ((n < 0) || !maybe_ok(res, tbuf, res_hnok)) { had_error++; continue; } @@ -1399,7 +1402,6 @@ getanswer(const querybuf *answer, int an } if (srvlist) { - res_state res; /* * Check for explicit rejection. */ @@ -1408,16 +1410,6 @@ getanswer(const querybuf *answer, int an h_errno = HOST_NOT_FOUND; return NULL; } - res = __res_get_state(); - if (res == NULL) { - while (srvlist != NULL) { -srv = srvlist; -srvlist = srvlist->next; -free(srv); - } - h_errno = NETDB_INTERNAL; - return NULL; - } while (srvlist) { struct res_target q, q2; @@ -1452,7 +1444,6 @@ getanswer(const querybuf *answer, int an } free(srv); } - __res_put_state(res); } if (haveanswer) { if (!sentinel.ai_next->ai_canonname) @@ -1541,14 +1532,14 @@ _dns_query(struct res_target *q, const s goto out; } - ai = getanswer(buf, q->n, q->name, q->qtype, pai); + ai = getanswer(res, buf, q->n, q->name, q->qtype, pai); if (ai) { cur->ai_next = ai; while (cur &&
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Mon Oct 26 15:07:07 UTC 2015 Modified Files: src/sys/dev/usb: usb_subr.c Log Message: Correct a comment. From Robert Sprowson. To generate a diff of this commit: cvs rdiff -u -r1.202 -r1.203 src/sys/dev/usb/usb_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usb_subr.c diff -u src/sys/dev/usb/usb_subr.c:1.202 src/sys/dev/usb/usb_subr.c:1.203 --- src/sys/dev/usb/usb_subr.c:1.202 Thu Jul 9 07:20:57 2015 +++ src/sys/dev/usb/usb_subr.c Mon Oct 26 15:07:07 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: usb_subr.c,v 1.202 2015/07/09 07:20:57 skrll Exp $ */ +/* $NetBSD: usb_subr.c,v 1.203 2015/10/26 15:07:07 skrll Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.202 2015/07/09 07:20:57 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.203 2015/10/26 15:07:07 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -1115,7 +1115,7 @@ usbd_new_device(device_t parent, usbd_bu dev->def_ep_desc.bInterval = 0; - /* doesn't matter, just don't let it uninitialized */ + /* doesn't matter, just don't leave it uninitialized */ dev->def_ep.datatoggle = 0; dev->quirks = _no_quirk;
CVS commit: src/external/gpl3/binutils/dist/binutils
Module Name:src Committed By: christos Date: Mon Oct 26 15:14:33 UTC 2015 Modified Files: src/external/gpl3/binutils/dist/binutils: arsup.c Log Message: use asprintf(3) To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 src/external/gpl3/binutils/dist/binutils/arsup.c 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/binutils/dist/binutils/arsup.c diff -u src/external/gpl3/binutils/dist/binutils/arsup.c:1.1.1.2 src/external/gpl3/binutils/dist/binutils/arsup.c:1.2 --- src/external/gpl3/binutils/dist/binutils/arsup.c:1.1.1.2 Sat Sep 24 18:39:13 2011 +++ src/external/gpl3/binutils/dist/binutils/arsup.c Mon Oct 26 11:14:33 2015 @@ -149,13 +149,20 @@ maybequit (void) void ar_open (char *name, int t) { - char *tname = (char *) xmalloc (strlen (name) + 10); + char *tname; const char *bname = lbasename (name); real_name = name; /* Prepend tmp- to the beginning, to avoid file-name clashes after truncation on filesystems with limited namespaces (DOS). */ - sprintf (tname, "%.*stmp-%s", (int) (bname - name), name, bname); + if (asprintf (, "%.*stmp-%s", (int) (bname - name), name, bname) == -1) +{ + fprintf (stderr, _("%s: Can't allocate memory for temp name (%s)\n"), + program_name, strerror(errno)); + maybequit (); + return; +} + obfd = bfd_openw (tname, NULL); if (!obfd)
CVS commit: src/share/man/man9
Module Name:src Committed By: mrg Date: Mon Oct 26 17:23:00 UTC 2015 Modified Files: src/share/man/man9: kernhist.9 Log Message: oops, i really did mean a section 9 reference for usb -- but as usbdi(9). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/kernhist.9 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/man9/kernhist.9 diff -u src/share/man/man9/kernhist.9:1.2 src/share/man/man9/kernhist.9:1.3 --- src/share/man/man9/kernhist.9:1.2 Mon Oct 26 09:06:52 2015 +++ src/share/man/man9/kernhist.9 Mon Oct 26 17:23:00 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: kernhist.9,v 1.2 2015/10/26 09:06:52 wiz Exp $ +.\" $NetBSD: kernhist.9,v 1.3 2015/10/26 17:23:00 mrg Exp $ .\" .\" Copyright (c) 2015 Matthew R. Green .\" All rights reserved. @@ -155,7 +155,7 @@ argument is currently ignored. .El .Sh SEE ALSO .Xr vmstat 1 , -.Xr usb 4 , +.Xr usbdi 9 , .Xr uvm 9 .\" .Sh EXAMPLES .\"