From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 00:45:19 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67FFA1065739; Sun, 21 Nov 2010 00:45:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BFA68FC17; Sun, 21 Nov 2010 00:45:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL0jJMM031303; Sun, 21 Nov 2010 00:45:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL0jJQE031300; Sun, 21 Nov 2010 00:45:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011210045.oAL0jJQE031300@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Nov 2010 00:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215598 - in stable/8/sys: sparc64/include vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 00:45:19 -0000 Author: marius Date: Sun Nov 21 00:45:18 2010 New Revision: 215598 URL: http://svn.freebsd.org/changeset/base/215598 Log: MFC: r215093 Enable reservation-based physical memory allocation. Even without the creation of large page mappings in the pmap, it can provide modest performance benefits. In particular, for a "buildworld" on a 2x 1GHz Ultrasparc IIIi it reduced the wall clock time by 2.2% and the system time by 12.6%. Tested by: marius@ Modified: stable/8/sys/sparc64/include/vmparam.h stable/8/sys/vm/vm_reserv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/vmparam.h ============================================================================== --- stable/8/sys/sparc64/include/vmparam.h Sat Nov 20 22:30:09 2010 (r215597) +++ stable/8/sys/sparc64/include/vmparam.h Sun Nov 21 00:45:18 2010 (r215598) @@ -121,10 +121,17 @@ #define VM_NFREEORDER 12 /* - * Disable superpage reservations. + * Enable superpage reservations: 1 level. */ #ifndef VM_NRESERVLEVEL -#define VM_NRESERVLEVEL 0 +#define VM_NRESERVLEVEL 1 +#endif + +/* + * Level 0 reservations consist of 512 pages. + */ +#ifndef VM_LEVEL_0_ORDER +#define VM_LEVEL_0_ORDER 9 #endif /* Modified: stable/8/sys/vm/vm_reserv.c ============================================================================== --- stable/8/sys/vm/vm_reserv.c Sat Nov 20 22:30:09 2010 (r215597) +++ stable/8/sys/vm/vm_reserv.c Sun Nov 21 00:45:18 2010 (r215598) @@ -197,7 +197,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER } mtx_unlock(&vm_page_queue_free_mtx); sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level, - unused_pages * (PAGE_SIZE / 1024), counter); + unused_pages * ((int)PAGE_SIZE / 1024), counter); } sbuf_finish(&sbuf); error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 00:45:25 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2C371065739; Sun, 21 Nov 2010 00:45:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6EC08FC16; Sun, 21 Nov 2010 00:45:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL0jO3g031342; Sun, 21 Nov 2010 00:45:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL0jOMw031339; Sun, 21 Nov 2010 00:45:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011210045.oAL0jOMw031339@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Nov 2010 00:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215599 - in stable/7/sys: sparc64/include vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 00:45:25 -0000 Author: marius Date: Sun Nov 21 00:45:24 2010 New Revision: 215599 URL: http://svn.freebsd.org/changeset/base/215599 Log: MFC: r215093 Enable reservation-based physical memory allocation. Even without the creation of large page mappings in the pmap, it can provide modest performance benefits. In particular, for a "buildworld" on a 2x 1GHz Ultrasparc IIIi it reduced the wall clock time by 2.2% and the system time by 12.6%. Tested by: marius@ Modified: stable/7/sys/sparc64/include/vmparam.h stable/7/sys/vm/vm_reserv.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Sun Nov 21 00:45:18 2010 (r215598) +++ stable/7/sys/sparc64/include/vmparam.h Sun Nov 21 00:45:24 2010 (r215599) @@ -121,10 +121,17 @@ #define VM_NFREEORDER 12 /* - * Disable superpage reservations. + * Enable superpage reservations: 1 level. */ #ifndef VM_NRESERVLEVEL -#define VM_NRESERVLEVEL 0 +#define VM_NRESERVLEVEL 1 +#endif + +/* + * Level 0 reservations consist of 512 pages. + */ +#ifndef VM_LEVEL_0_ORDER +#define VM_LEVEL_0_ORDER 9 #endif /* Modified: stable/7/sys/vm/vm_reserv.c ============================================================================== --- stable/7/sys/vm/vm_reserv.c Sun Nov 21 00:45:18 2010 (r215598) +++ stable/7/sys/vm/vm_reserv.c Sun Nov 21 00:45:24 2010 (r215599) @@ -197,7 +197,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER } mtx_unlock(&vm_page_queue_free_mtx); sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level, - unused_pages * (PAGE_SIZE / 1024), counter); + unused_pages * ((int)PAGE_SIZE / 1024), counter); } sbuf_finish(&sbuf); error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 00:50:30 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0688F106564A; Sun, 21 Nov 2010 00:50:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E92858FC12; Sun, 21 Nov 2010 00:50:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL0oTkE031504; Sun, 21 Nov 2010 00:50:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL0oT0T031502; Sun, 21 Nov 2010 00:50:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011210050.oAL0oT0T031502@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Nov 2010 00:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215600 - stable/8/sys/opencrypto X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 00:50:30 -0000 Author: marius Date: Sun Nov 21 00:50:29 2010 New Revision: 215600 URL: http://svn.freebsd.org/changeset/base/215600 Log: MFC: r215295 Let cryptosoft(4) add its pseudo-device with a specific unit number and its probe method return BUS_PROBE_NOWILDCARD so it doesn't get attached to real devices hanging off of nexus(4) with no specific devclass set. Actually, the more desirable fix for this would be to get rid of the newbus interface of cryptosoft(4) altogether but apparently crypto(9) was written with support for cryptographic hardware in mind so that approach would require some KPI breaking changes which don't seem worth it. Modified: stable/8/sys/opencrypto/cryptosoft.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/8/sys/opencrypto/cryptosoft.c Sun Nov 21 00:45:24 2010 (r215599) +++ stable/8/sys/opencrypto/cryptosoft.c Sun Nov 21 00:50:29 2010 (r215600) @@ -1060,7 +1060,7 @@ swcr_identify(driver_t *drv, device_t pa { /* NB: order 10 is so we get attached after h/w devices */ if (device_find_child(parent, "cryptosoft", -1) == NULL && - BUS_ADD_CHILD(parent, 10, "cryptosoft", -1) == 0) + BUS_ADD_CHILD(parent, 10, "cryptosoft", 0) == 0) panic("cryptosoft: could not attach"); } @@ -1068,7 +1068,7 @@ static int swcr_probe(device_t dev) { device_set_desc(dev, "software crypto"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 00:50:31 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CB991065769; Sun, 21 Nov 2010 00:50:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78FFC8FC13; Sun, 21 Nov 2010 00:50:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL0oVax031538; Sun, 21 Nov 2010 00:50:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL0oVwq031536; Sun, 21 Nov 2010 00:50:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011210050.oAL0oVwq031536@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Nov 2010 00:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215601 - stable/7/sys/opencrypto X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 00:50:31 -0000 Author: marius Date: Sun Nov 21 00:50:31 2010 New Revision: 215601 URL: http://svn.freebsd.org/changeset/base/215601 Log: MFC: r215295 Let cryptosoft(4) add its pseudo-device with a specific unit number and its probe method return BUS_PROBE_NOWILDCARD so it doesn't get attached to real devices hanging off of nexus(4) with no specific devclass set. Actually, the more desirable fix for this would be to get rid of the newbus interface of cryptosoft(4) altogether but apparently crypto(9) was written with support for cryptographic hardware in mind so that approach would require some KPI breaking changes which don't seem worth it. Modified: stable/7/sys/opencrypto/cryptosoft.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/7/sys/opencrypto/cryptosoft.c Sun Nov 21 00:50:29 2010 (r215600) +++ stable/7/sys/opencrypto/cryptosoft.c Sun Nov 21 00:50:31 2010 (r215601) @@ -1003,7 +1003,7 @@ swcr_identify(device_t *dev, device_t pa { /* NB: order 10 is so we get attached after h/w devices */ if (device_find_child(parent, "cryptosoft", -1) == NULL && - BUS_ADD_CHILD(parent, 10, "cryptosoft", -1) == 0) + BUS_ADD_CHILD(parent, 10, "cryptosoft", 0) == 0) panic("cryptosoft: could not attach"); } @@ -1011,7 +1011,7 @@ static int swcr_probe(device_t dev) { device_set_desc(dev, "software crypto"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 00:53:20 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05BC2106564A; Sun, 21 Nov 2010 00:53:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E89BE8FC08; Sun, 21 Nov 2010 00:53:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL0rJeW031651; Sun, 21 Nov 2010 00:53:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL0rJeT031649; Sun, 21 Nov 2010 00:53:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011210053.oAL0rJeT031649@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Nov 2010 00:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215602 - stable/8/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 00:53:20 -0000 Author: marius Date: Sun Nov 21 00:53:19 2010 New Revision: 215602 URL: http://svn.freebsd.org/changeset/base/215602 Log: MFC: r215325 Use the correct variable for determining the verbosity level in mpt_lprtc(). While at it, fix the whitespace of that macro. PR: 149502 Submitted by: Andrew Boyer Modified: stable/8/sys/dev/mpt/mpt.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Sun Nov 21 00:50:31 2010 (r215601) +++ stable/8/sys/dev/mpt/mpt.h Sun Nov 21 00:53:19 2010 (r215602) @@ -1112,10 +1112,10 @@ do { \ mpt_prt(mpt, __VA_ARGS__); \ } while (0) -#define mpt_lprtc(mpt, level, ...) \ -do { \ - if (level <= (mpt)->debug_level) \ - mpt_prtc(mpt, __VA_ARGS__); \ +#define mpt_lprtc(mpt, level, ...) \ +do { \ + if (level <= (mpt)->verbose) \ + mpt_prtc(mpt, __VA_ARGS__); \ } while (0) #else void mpt_lprt(struct mpt_softc *, int, const char *, ...) From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 00:53:27 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 661F2106564A; Sun, 21 Nov 2010 00:53:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54BE58FC0C; Sun, 21 Nov 2010 00:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL0rRFU031689; Sun, 21 Nov 2010 00:53:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL0rRD6031687; Sun, 21 Nov 2010 00:53:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011210053.oAL0rRD6031687@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Nov 2010 00:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215603 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 00:53:27 -0000 Author: marius Date: Sun Nov 21 00:53:27 2010 New Revision: 215603 URL: http://svn.freebsd.org/changeset/base/215603 Log: MFC: r215325 Use the correct variable for determining the verbosity level in mpt_lprtc(). While at it, fix the whitespace of that macro. PR: 149502 Submitted by: Andrew Boyer Modified: stable/7/sys/dev/mpt/mpt.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Sun Nov 21 00:53:19 2010 (r215602) +++ stable/7/sys/dev/mpt/mpt.h Sun Nov 21 00:53:27 2010 (r215603) @@ -1110,10 +1110,10 @@ do { \ mpt_prt(mpt, __VA_ARGS__); \ } while (0) -#define mpt_lprtc(mpt, level, ...) \ -do { \ - if (level <= (mpt)->debug_level) \ - mpt_prtc(mpt, __VA_ARGS__); \ +#define mpt_lprtc(mpt, level, ...) \ +do { \ + if (level <= (mpt)->verbose) \ + mpt_prtc(mpt, __VA_ARGS__); \ } while (0) #else void mpt_lprt(struct mpt_softc *, int, const char *, ...) From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 09:50:12 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665E2106564A; Sun, 21 Nov 2010 09:50:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A44C8FC08; Sun, 21 Nov 2010 09:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL9oCF1042979; Sun, 21 Nov 2010 09:50:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL9oCp1042977; Sun, 21 Nov 2010 09:50:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011210950.oAL9oCp1042977@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Nov 2010 09:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215608 - stable/8/sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 09:50:12 -0000 Author: kib Date: Sun Nov 21 09:50:11 2010 New Revision: 215608 URL: http://svn.freebsd.org/changeset/base/215608 Log: MFC r215307: Implement a (soft) stack guard page for auto-growing stack mappings. Modified: stable/8/sys/vm/vm_map.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/vm/vm_map.c ============================================================================== --- stable/8/sys/vm/vm_map.c Sun Nov 21 04:02:37 2010 (r215607) +++ stable/8/sys/vm/vm_map.c Sun Nov 21 09:50:11 2010 (r215608) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -76,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -3221,6 +3223,12 @@ vm_map_stack(vm_map_t map, vm_offset_t a return (rv); } +static int stack_guard_page = 0; +TUNABLE_INT("security.bsd.stack_guard_page", &stack_guard_page); +SYSCTL_INT(_security_bsd, OID_AUTO, stack_guard_page, CTLFLAG_RW, + &stack_guard_page, 0, + "Insert stack guard page ahead of the growable segments."); + /* Attempts to grow a vm stack entry. Returns KERN_SUCCESS if the * desired address is already mapped, or if we successfully grow * the stack. Also returns KERN_SUCCESS if addr is outside the @@ -3317,7 +3325,7 @@ Retry: * This also effectively destroys any guard page the user might have * intended by limiting the stack size. */ - if (grow_amount > max_grow) { + if (grow_amount + (stack_guard_page ? PAGE_SIZE : 0) > max_grow) { if (vm_map_lock_upgrade(map)) goto Retry; @@ -3370,6 +3378,8 @@ Retry: if (addr < end) { stack_entry->avail_ssize = max_grow; addr = end; + if (stack_guard_page) + addr += PAGE_SIZE; } rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start, @@ -3402,6 +3412,8 @@ Retry: if (addr > end) { stack_entry->avail_ssize = end - stack_entry->end; addr = end; + if (stack_guard_page) + addr -= PAGE_SIZE; } grow_amount = addr - stack_entry->end; From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 10:00:43 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0D52106564A; Sun, 21 Nov 2010 10:00:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B61238FC1E; Sun, 21 Nov 2010 10:00:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALA0hIo043311; Sun, 21 Nov 2010 10:00:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALA0hl7043306; Sun, 21 Nov 2010 10:00:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011211000.oALA0hl7043306@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 21 Nov 2010 10:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215609 - in stable/8/sys: amd64/amd64 i386/i386 sys vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 10:00:44 -0000 Author: kib Date: Sun Nov 21 10:00:43 2010 New Revision: 215609 URL: http://svn.freebsd.org/changeset/base/215609 Log: MFC r215309: Use symbolic names instead of hardcoding values for magic p_osrel constants. MFC r215321: Do not use __FreeBSD_version prefix for the special osrel version. Modified: stable/8/sys/amd64/amd64/trap.c stable/8/sys/i386/i386/trap.c stable/8/sys/sys/param.h stable/8/sys/vm/vm_mmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/trap.c ============================================================================== --- stable/8/sys/amd64/amd64/trap.c Sun Nov 21 09:50:11 2010 (r215608) +++ stable/8/sys/amd64/amd64/trap.c Sun Nov 21 10:00:43 2010 (r215609) @@ -363,9 +363,8 @@ trap(struct trapframe *frame) * This check also covers the images * without the ABI-tag ELF note. */ - if (SV_CURPROC_ABI() == - SV_ABI_FREEBSD && - p->p_osrel >= 700004) { + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD + && p->p_osrel >= P_OSREL_SIGSEGV) { i = SIGSEGV; ucode = SEGV_ACCERR; } else { Modified: stable/8/sys/i386/i386/trap.c ============================================================================== --- stable/8/sys/i386/i386/trap.c Sun Nov 21 09:50:11 2010 (r215608) +++ stable/8/sys/i386/i386/trap.c Sun Nov 21 10:00:43 2010 (r215609) @@ -426,9 +426,8 @@ trap(struct trapframe *frame) * This check also covers the images * without the ABI-tag ELF note. */ - if (SV_CURPROC_ABI() == - SV_ABI_FREEBSD && - p->p_osrel >= 700004) { + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD + && p->p_osrel >= P_OSREL_SIGSEGV) { i = SIGSEGV; ucode = SEGV_ACCERR; } else { Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Sun Nov 21 09:50:11 2010 (r215608) +++ stable/8/sys/sys/param.h Sun Nov 21 10:00:43 2010 (r215609) @@ -60,6 +60,11 @@ #undef __FreeBSD_version #define __FreeBSD_version 801501 /* Master, propagated to newvers */ +#ifdef _KERNEL +#define P_OSREL_SIGSEGV 700004 +#define P_OSREL_MAP_ANON 800104 +#endif + #ifndef LOCORE #include #endif Modified: stable/8/sys/vm/vm_mmap.c ============================================================================== --- stable/8/sys/vm/vm_mmap.c Sun Nov 21 09:50:11 2010 (r215608) +++ stable/8/sys/vm/vm_mmap.c Sun Nov 21 10:00:43 2010 (r215609) @@ -231,7 +231,7 @@ mmap(td, uap) fp = NULL; /* make sure mapping fits into numeric range etc */ if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && - curproc->p_osrel >= 800104) || + curproc->p_osrel >= P_OSREL_MAP_ANON) || ((flags & MAP_ANON) && (uap->fd != -1 || pos != 0))) return (EINVAL); From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 10:45:10 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C892B106566B; Sun, 21 Nov 2010 10:45:10 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6AF48FC0A; Sun, 21 Nov 2010 10:45:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAjAs0051818; Sun, 21 Nov 2010 10:45:10 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAjA8O051816; Sun, 21 Nov 2010 10:45:10 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201011211045.oALAjA8O051816@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 21 Nov 2010 10:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215611 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 10:45:10 -0000 Author: simon Date: Sun Nov 21 10:45:10 2010 New Revision: 215611 URL: http://svn.freebsd.org/changeset/base/215611 Log: MFC r208028 by uqs: mdoc: move remaining sections into consistent order Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.8 Sun Nov 21 10:18:28 2010 (r215610) +++ stable/8/usr.sbin/newsyslog/newsyslog.8 Sun Nov 21 10:45:10 2010 (r215611) @@ -245,6 +245,13 @@ this has been changed to a colon (``:'') names may contain the dot character. The dot (``.'') character is still accepted for backwards compatibility. +.Sh SEE ALSO +.Xr bzip2 1 , +.Xr gzip 1 , +.Xr syslog 3 , +.Xr newsyslog.conf 5 , +.Xr chown 8 , +.Xr syslogd 8 .Sh HISTORY The .Nm @@ -257,12 +264,5 @@ and first appeared in MIT Project Athena .Pp Copyright 1987, Massachusetts Institute of Technology -.Sh "SEE ALSO" -.Xr bzip2 1 , -.Xr gzip 1 , -.Xr syslog 3 , -.Xr newsyslog.conf 5 , -.Xr chown 8 , -.Xr syslogd 8 .Sh BUGS Does not yet automatically read the logs to find security breaches. From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 10:49:41 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42726106566B; Sun, 21 Nov 2010 10:49:41 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30E5C8FC13; Sun, 21 Nov 2010 10:49:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAnf8x052007; Sun, 21 Nov 2010 10:49:41 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAnfH9052005; Sun, 21 Nov 2010 10:49:41 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211049.oALAnfH9052005@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215612 - stable/8/sys/net80211 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 10:49:41 -0000 Author: bschmidt Date: Sun Nov 21 10:49:40 2010 New Revision: 215612 URL: http://svn.freebsd.org/changeset/base/215612 Log: Compare the address of the array, not the array. Committed by: rpaulo Found with: Coverity Prevent(tm) CID: 3690 Modified: stable/8/sys/net80211/ieee80211_scan_sta.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- stable/8/sys/net80211/ieee80211_scan_sta.c Sun Nov 21 10:45:10 2010 (r215611) +++ stable/8/sys/net80211/ieee80211_scan_sta.c Sun Nov 21 10:49:40 2010 (r215612) @@ -1013,7 +1013,7 @@ match_bss(struct ieee80211vap *vap, */ if (se->se_capinfo & (IEEE80211_CAPINFO_IBSS|IEEE80211_CAPINFO_ESS)) fail |= MATCH_CAPINFO; - else if (se->se_meshid == NULL) + else if (&se->se_meshid == NULL) fail |= MATCH_MESH_NOID; else if (ms->ms_idlen != 0 && match_id(se->se_meshid, ms->ms_id, ms->ms_idlen)) From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 10:52:19 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54290106566C; Sun, 21 Nov 2010 10:52:19 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42AE08FC12; Sun, 21 Nov 2010 10:52:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAqJPt052132; Sun, 21 Nov 2010 10:52:19 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAqJAJ052130; Sun, 21 Nov 2010 10:52:19 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211052.oALAqJAJ052130@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215613 - stable/8/sys/net80211 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 10:52:19 -0000 Author: bschmidt Date: Sun Nov 21 10:52:18 2010 New Revision: 215613 URL: http://svn.freebsd.org/changeset/base/215613 Log: MFC r207322: Fix typo. No functional change. Obtained from: DragonFlyBSD Committed by: rpaulo Modified: stable/8/sys/net80211/ieee80211_node.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net80211/ieee80211_node.c ============================================================================== --- stable/8/sys/net80211/ieee80211_node.c Sun Nov 21 10:49:40 2010 (r215612) +++ stable/8/sys/net80211/ieee80211_node.c Sun Nov 21 10:52:18 2010 (r215613) @@ -432,7 +432,7 @@ ieee80211_reset_bss(struct ieee80211vap ieee80211_reset_erp(ic); ni = ieee80211_alloc_node(&ic->ic_sta, vap, vap->iv_myaddr); - KASSERT(ni != NULL, ("unable to setup inital BSS node")); + KASSERT(ni != NULL, ("unable to setup initial BSS node")); obss = vap->iv_bss; vap->iv_bss = ieee80211_ref_node(ni); if (obss != NULL) { From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 10:52:47 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE7811065670; Sun, 21 Nov 2010 10:52:47 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCFEA8FC20; Sun, 21 Nov 2010 10:52:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAqlgv052176; Sun, 21 Nov 2010 10:52:47 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAqlen052174; Sun, 21 Nov 2010 10:52:47 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211052.oALAqlen052174@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215614 - stable/7/sys/net80211 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 10:52:48 -0000 Author: bschmidt Date: Sun Nov 21 10:52:47 2010 New Revision: 215614 URL: http://svn.freebsd.org/changeset/base/215614 Log: MFC r207322: Fix typo. No functional change. Obtained from: DragonFlyBSD Committed by: rpaulo Modified: stable/7/sys/net80211/ieee80211_node.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net80211/ieee80211_node.c ============================================================================== --- stable/7/sys/net80211/ieee80211_node.c Sun Nov 21 10:52:18 2010 (r215613) +++ stable/7/sys/net80211/ieee80211_node.c Sun Nov 21 10:52:47 2010 (r215614) @@ -373,7 +373,7 @@ ieee80211_reset_bss(struct ieee80211com ieee80211_reset_erp(ic); ni = ieee80211_alloc_node(&ic->ic_sta, ic->ic_myaddr); - KASSERT(ni != NULL, ("unable to setup inital BSS node")); + KASSERT(ni != NULL, ("unable to setup initial BSS node")); obss = ic->ic_bss; ic->ic_bss = ieee80211_ref_node(ni); if (obss != NULL) { From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 10:55:44 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18E1D1065673; Sun, 21 Nov 2010 10:55:44 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0726A8FC18; Sun, 21 Nov 2010 10:55:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAthIN052359; Sun, 21 Nov 2010 10:55:43 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAthOo052357; Sun, 21 Nov 2010 10:55:43 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211055.oALAthOo052357@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215616 - stable/8/sys/net80211 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 10:55:44 -0000 Author: bschmidt Date: Sun Nov 21 10:55:43 2010 New Revision: 215616 URL: http://svn.freebsd.org/changeset/base/215616 Log: MFC r200242: Fix typo in comment Submitted by: Paul B Mahol Committed by: rpaulo Modified: stable/8/sys/net80211/ieee80211_hostap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net80211/ieee80211_hostap.c ============================================================================== --- stable/8/sys/net80211/ieee80211_hostap.c Sun Nov 21 10:55:16 2010 (r215615) +++ stable/8/sys/net80211/ieee80211_hostap.c Sun Nov 21 10:55:43 2010 (r215616) @@ -1260,7 +1260,7 @@ ieee80211_parse_wpa(struct ieee80211vap return IEEE80211_REASON_IE_INVALID; } frm += 6, len -= 4; /* NB: len is payload only */ - /* NB: iswapoui already validated the OUI and type */ + /* NB: iswpaoui already validated the OUI and type */ w = LE_READ_2(frm); if (w != WPA_VERSION) { IEEE80211_DISCARD_IE(vap, From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 10:56:05 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22A161065674; Sun, 21 Nov 2010 10:56:05 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 112838FC16; Sun, 21 Nov 2010 10:56:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAu4Zu052409; Sun, 21 Nov 2010 10:56:04 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAu4ne052407; Sun, 21 Nov 2010 10:56:04 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211056.oALAu4ne052407@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215617 - stable/7/sys/net80211 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 10:56:05 -0000 Author: bschmidt Date: Sun Nov 21 10:56:04 2010 New Revision: 215617 URL: http://svn.freebsd.org/changeset/base/215617 Log: MFC r200242: Fix typo in comment Submitted by: Paul B Mahol Committed by: rpaulo Modified: stable/7/sys/net80211/ieee80211_input.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net80211/ieee80211_input.c ============================================================================== --- stable/7/sys/net80211/ieee80211_input.c Sun Nov 21 10:55:43 2010 (r215616) +++ stable/7/sys/net80211/ieee80211_input.c Sun Nov 21 10:56:04 2010 (r215617) @@ -1464,7 +1464,7 @@ ieee80211_parse_wpa(struct ieee80211com return IEEE80211_REASON_IE_INVALID; } frm += 6, len -= 4; /* NB: len is payload only */ - /* NB: iswapoui already validated the OUI and type */ + /* NB: iswpaoui already validated the OUI and type */ w = LE_READ_2(frm); if (w != WPA_VERSION) { IEEE80211_DISCARD_IE(ic, From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 10:58:19 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22E99106566C; Sun, 21 Nov 2010 10:58:19 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 116058FC12; Sun, 21 Nov 2010 10:58:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAwI1Z052528; Sun, 21 Nov 2010 10:58:18 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAwIkp052526; Sun, 21 Nov 2010 10:58:18 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211058.oALAwIkp052526@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215618 - stable/8/sys/net80211 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 10:58:19 -0000 Author: bschmidt Date: Sun Nov 21 10:58:18 2010 New Revision: 215618 URL: http://svn.freebsd.org/changeset/base/215618 Log: MFC r199076: The isr_intval in ieee80211req_scan_result structure should be 16 bit. This makes ifconfig list scan display the correct beacon interval (previously it would int overflow). As a side effect, this makes the ieee80211req_scan_result word aligned. Submitted by: Paul B Mahol Committed by: rpaulo Modified: stable/8/sys/net80211/ieee80211_ioctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net80211/ieee80211_ioctl.h ============================================================================== --- stable/8/sys/net80211/ieee80211_ioctl.h Sun Nov 21 10:56:04 2010 (r215617) +++ stable/8/sys/net80211/ieee80211_ioctl.h Sun Nov 21 10:58:18 2010 (r215618) @@ -790,7 +790,7 @@ struct ieee80211req_scan_result { uint16_t isr_flags; /* channel flags */ int8_t isr_noise; int8_t isr_rssi; - uint8_t isr_intval; /* beacon interval */ + uint16_t isr_intval; /* beacon interval */ uint8_t isr_capinfo; /* capabilities */ uint8_t isr_erp; /* ERP element */ uint8_t isr_bssid[IEEE80211_ADDR_LEN]; From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 10:58:38 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25424106566B; Sun, 21 Nov 2010 10:58:38 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13B498FC12; Sun, 21 Nov 2010 10:58:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAwbxW052569; Sun, 21 Nov 2010 10:58:37 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAwbrl052567; Sun, 21 Nov 2010 10:58:37 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211058.oALAwbrl052567@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215619 - stable/7/sys/net80211 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 10:58:38 -0000 Author: bschmidt Date: Sun Nov 21 10:58:37 2010 New Revision: 215619 URL: http://svn.freebsd.org/changeset/base/215619 Log: MFC r199076: The isr_intval in ieee80211req_scan_result structure should be 16 bit. This makes ifconfig list scan display the correct beacon interval (previously it would int overflow). As a side effect, this makes the ieee80211req_scan_result word aligned. Submitted by: Paul B Mahol Committed by: rpaulo Modified: stable/7/sys/net80211/ieee80211_ioctl.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net80211/ieee80211_ioctl.h ============================================================================== --- stable/7/sys/net80211/ieee80211_ioctl.h Sun Nov 21 10:58:18 2010 (r215618) +++ stable/7/sys/net80211/ieee80211_ioctl.h Sun Nov 21 10:58:37 2010 (r215619) @@ -530,7 +530,7 @@ struct ieee80211req_scan_result { uint16_t isr_flags; /* channel flags */ int8_t isr_noise; int8_t isr_rssi; - uint8_t isr_intval; /* beacon interval */ + uint16_t isr_intval; /* beacon interval */ uint8_t isr_capinfo; /* capabilities */ uint8_t isr_erp; /* ERP element */ uint8_t isr_bssid[IEEE80211_ADDR_LEN]; From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 11:01:56 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E62BD106566B; Sun, 21 Nov 2010 11:01:56 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D327A8FC1C; Sun, 21 Nov 2010 11:01:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALB1uCH052734; Sun, 21 Nov 2010 11:01:56 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALB1uCY052732; Sun, 21 Nov 2010 11:01:56 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201011211101.oALB1uCY052732@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 21 Nov 2010 11:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215620 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 11:01:57 -0000 Author: simon Date: Sun Nov 21 11:01:56 2010 New Revision: 215620 URL: http://svn.freebsd.org/changeset/base/215620 Log: MFC r208648 by gordon (needed for MFC of r210372): Convert newsyslog to using queue(3) macros instead of a home rolled version. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Sun Nov 21 10:58:37 2010 (r215619) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Sun Nov 21 11:01:56 2010 (r215620) @@ -113,6 +113,7 @@ __FBSDID("$FreeBSD$"); #define DEBUG_MARKER "" struct conf_entry { + STAILQ_ENTRY(conf_entry) cf_nextp; char *log; /* Name of the log */ char *pid_file; /* PID file */ char *r_reason; /* The reason this file is being rotated */ @@ -129,7 +130,6 @@ struct conf_entry { int flags; /* CE_COMPACT, CE_BZCOMPACT, CE_BINARY */ int sig; /* Signal to send */ int def_cfg; /* Using the rule for this file */ - struct conf_entry *next;/* Linked list pointer */ }; struct sigwork_entry { @@ -153,6 +153,7 @@ typedef enum { FREE_ENT, KEEP_ENT } fk_entry; +STAILQ_HEAD(cflist, conf_entry); SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); @@ -188,9 +189,9 @@ char hostname[MAXHOSTNAMELEN]; /* hostna const char *path_syslogpid = _PATH_SYSLOGPID; -static struct conf_entry *get_worklist(char **files); -static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, - struct conf_entry **glob_p, struct conf_entry **defconf_p); +static struct cflist *get_worklist(char **files); +static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, + struct conf_entry *defconf_p); static char *sob(char *p); static char *son(char *p); static int isnumberstr(const char *); @@ -207,9 +208,8 @@ static struct zipwork_entry * sigwork_entry *, int, const char *); static void set_swpid(struct sigwork_entry *, const struct conf_entry *); static int sizefile(const char *); -static void expand_globs(struct conf_entry **work_p, - struct conf_entry **glob_p); -static void free_clist(struct conf_entry **firstent); +static void expand_globs(struct cflist *work_p, struct cflist *glob_p); +static void free_clist(struct cflist *list); static void free_entry(struct conf_entry *ent); static struct conf_entry *init_entry(const char *fname, struct conf_entry *src_entry); @@ -235,8 +235,8 @@ static void createlog(const struct conf_ int main(int argc, char **argv) { - fk_entry free_or_keep; - struct conf_entry *p, *q; + struct cflist *worklist; + struct conf_entry *p; struct sigwork_entry *stmp; struct zipwork_entry *ztmp; @@ -249,18 +249,17 @@ main(int argc, char **argv) if (needroot && getuid() && geteuid()) errx(1, "must have root privs"); - p = q = get_worklist(argv); + worklist = get_worklist(argv); /* * Rotate all the files which need to be rotated. Note that * some users have *hundreds* of entries in newsyslog.conf! */ - while (p) { - free_or_keep = do_entry(p); - p = p->next; - if (free_or_keep == FREE_ENT) - free_entry(q); - q = p; + while (!STAILQ_EMPTY(worklist)) { + p = STAILQ_FIRST(worklist); + STAILQ_REMOVE_HEAD(worklist, cf_nextp); + if (do_entry(p) == FREE_ENT) + free_entry(p); } /* @@ -367,7 +366,6 @@ init_entry(const char *fname, struct con tempwork->sig = SIGHUP; tempwork->def_cfg = 0; } - tempwork->next = NULL; return (tempwork); } @@ -405,21 +403,18 @@ free_entry(struct conf_entry *ent) } static void -free_clist(struct conf_entry **firstent) +free_clist(struct cflist *list) { - struct conf_entry *ent, *nextent; - - if (firstent == NULL) - return; /* There is nothing to do. */ + struct conf_entry *ent; - ent = *firstent; - firstent = NULL; - - while (ent) { - nextent = ent->next; + while (!STAILQ_EMPTY(list)) { + ent = STAILQ_FIRST(list); + STAILQ_REMOVE_HEAD(list, cf_nextp); free_entry(ent); - ent = nextent; } + + free(list); + list = NULL; } static fk_entry @@ -737,17 +732,26 @@ usage(void) * Parse a configuration file and return a linked list of all the logs * which should be processed. */ -static struct conf_entry * +static struct cflist * get_worklist(char **files) { FILE *f; const char *fname; char **given; - struct conf_entry *defconf, *dupent, *ent, *firstnew; - struct conf_entry *globlist, *lastnew, *worklist; + struct cflist *filelist, *globlist, *cmdlist; + struct conf_entry *defconf, *dupent, *ent; int gmatch, fnres; - defconf = globlist = worklist = NULL; + defconf = NULL; + + filelist = malloc(sizeof(struct cflist)); + if (filelist == NULL) + err(1, "malloc of filelist"); + STAILQ_INIT(filelist); + globlist = malloc(sizeof(struct cflist)); + if (globlist == NULL) + err(1, "malloc of globlist"); + STAILQ_INIT(globlist); fname = conf; if (fname == NULL) @@ -762,22 +766,22 @@ get_worklist(char **files) if (!f) err(1, "%s", fname); - parse_file(f, fname, &worklist, &globlist, &defconf); + parse_file(f, filelist, globlist, defconf); (void) fclose(f); /* * All config-file information has been read in and turned into - * a worklist and a globlist. If there were no specific files + * a filelist and a globlist. If there were no specific files * given on the run command, then the only thing left to do is to * call a routine which finds all files matched by the globlist - * and adds them to the worklist. Then return the worklist. + * and adds them to the filelist. Then return the worklist. */ if (*files == NULL) { - expand_globs(&worklist, &globlist); - free_clist(&globlist); + expand_globs(filelist, globlist); + free_clist(globlist); if (defconf != NULL) free_entry(defconf); - return (worklist); + return (filelist); /* NOTREACHED */ } @@ -799,7 +803,7 @@ get_worklist(char **files) * If newsyslog was run with a list of specific filenames, * then create a new worklist which has only those files in * it, picking up the rotation-rules for those files from - * the original worklist. + * the original filelist. * * XXX - Note that this will copy multiple rules for a single * logfile, if multiple entries are an exact match for @@ -807,21 +811,21 @@ get_worklist(char **files) * we want to continue to allow it? If so, it should * probably be handled more intelligently. */ - firstnew = lastnew = NULL; + cmdlist = malloc(sizeof(struct cflist)); + if (cmdlist == NULL) + err(1, "malloc of cmdlist"); + STAILQ_INIT(cmdlist); + for (given = files; *given; ++given) { /* * First try to find exact-matches for this given file. */ gmatch = 0; - for (ent = worklist; ent; ent = ent->next) { + STAILQ_FOREACH(ent, filelist, cf_nextp) { if (strcmp(ent->log, *given) == 0) { gmatch++; dupent = init_entry(*given, ent); - if (!firstnew) - firstnew = dupent; - else - lastnew->next = dupent; - lastnew = dupent; + STAILQ_INSERT_TAIL(cmdlist, dupent, cf_nextp); } } if (gmatch) { @@ -837,7 +841,7 @@ get_worklist(char **files) gmatch = 0; if (verbose > 2 && globlist != NULL) printf("\t+ Checking globs for %s\n", *given); - for (ent = globlist; ent; ent = ent->next) { + STAILQ_FOREACH(ent, globlist, cf_nextp) { fnres = fnmatch(ent->log, *given, FNM_PATHNAME); if (verbose > 2) printf("\t+ = %d for pattern %s\n", fnres, @@ -845,13 +849,9 @@ get_worklist(char **files) if (fnres == 0) { gmatch++; dupent = init_entry(*given, ent); - if (!firstnew) - firstnew = dupent; - else - lastnew->next = dupent; - lastnew = dupent; /* This new entry is not a glob! */ dupent->flags &= ~CE_GLOB; + STAILQ_INSERT_TAIL(cmdlist, dupent, cf_nextp); /* Only allow a match to one glob-entry */ break; } @@ -871,25 +871,21 @@ get_worklist(char **files) printf("\t+ No entry matched %s (will use %s)\n", *given, DEFAULT_MARKER); dupent = init_entry(*given, defconf); - if (!firstnew) - firstnew = dupent; - else - lastnew->next = dupent; /* Mark that it was *not* found in a config file */ dupent->def_cfg = 1; - lastnew = dupent; + STAILQ_INSERT_TAIL(cmdlist, dupent, cf_nextp); } /* * Free all the entries in the original work list, the list of * glob entries, and the default entry. */ - free_clist(&worklist); - free_clist(&globlist); + free_clist(filelist); + free_clist(globlist); free_entry(defconf); /* And finally, return a worklist which matches the given files. */ - return (firstnew); + return (cmdlist); } /* @@ -897,19 +893,15 @@ get_worklist(char **files) * which match those glob-entries onto the worklist. */ static void -expand_globs(struct conf_entry **work_p, struct conf_entry **glob_p) +expand_globs(struct cflist *work_p, struct cflist *glob_p) { int gmatch, gres; size_t i; char *mfname; - struct conf_entry *dupent, *ent, *firstmatch, *globent; - struct conf_entry *lastmatch; + struct conf_entry *dupent, *ent, *globent; glob_t pglob; struct stat st_fm; - if ((glob_p == NULL) || (*glob_p == NULL)) - return; /* There is nothing to do. */ - /* * The worklist contains all fully-specified (non-GLOB) names. * @@ -918,9 +910,7 @@ expand_globs(struct conf_entry **work_p, * that already exist. Do not add a glob-related entry for any * file which already exists in the fully-specified list. */ - firstmatch = lastmatch = NULL; - for (globent = *glob_p; globent; globent = globent->next) { - + STAILQ_FOREACH(globent, glob_p, cf_nextp) { gres = glob(globent->log, GLOB_NOCHECK, NULL, &pglob); if (gres != 0) { warn("cannot expand pattern (%d): %s", gres, @@ -935,7 +925,7 @@ expand_globs(struct conf_entry **work_p, /* See if this file already has a specific entry. */ gmatch = 0; - for (ent = *work_p; ent; ent = ent->next) { + STAILQ_FOREACH(ent, work_p, cf_nextp) { if (strcmp(mfname, ent->log) == 0) { gmatch++; break; @@ -962,29 +952,16 @@ expand_globs(struct conf_entry **work_p, if (verbose > 2) printf("\t+ . add file %s\n", mfname); dupent = init_entry(mfname, globent); - if (!firstmatch) - firstmatch = dupent; - else - lastmatch->next = dupent; - lastmatch = dupent; /* This new entry is not a glob! */ dupent->flags &= ~CE_GLOB; + + /* Add to the worklist. */ + STAILQ_INSERT_TAIL(work_p, dupent, cf_nextp); } globfree(&pglob); if (verbose > 2) printf("\t+ Done with pattern %s\n", globent->log); } - - /* Add the list of matched files to the end of the worklist. */ - if (!*work_p) - *work_p = firstmatch; - else { - ent = *work_p; - while (ent->next) - ent = ent->next; - ent->next = firstmatch; - } - } /* @@ -992,22 +969,16 @@ expand_globs(struct conf_entry **work_p, * process. */ static void -parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, - struct conf_entry **glob_p, struct conf_entry **defconf_p) +parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, + struct conf_entry *defconf_p) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; - struct conf_entry *lastglob, *lastwork, *working; + struct conf_entry *working; struct passwd *pwd; struct group *grp; int eol, ptm_opts, res, special; - /* - * XXX - for now, assume that only one config file will be read, - * ie, this routine is only called one time. - */ - lastglob = lastwork = NULL; - errline = NULL; while (fgets(line, BUFSIZ, cf)) { if ((line[0] == '\n') || (line[0] == '#') || @@ -1037,7 +1008,7 @@ parse_file(FILE *cf, const char *cfname, /* * Allow people to set debug options via the config file. - * (NOTE: debug optons are undocumented, and may disappear + * (NOTE: debug options are undocumented, and may disappear * at any time, etc). */ if (strcasecmp(DEBUG_MARKER, q) == 0) { @@ -1057,17 +1028,12 @@ parse_file(FILE *cf, const char *cfname, working = init_entry(q, NULL); if (strcasecmp(DEFAULT_MARKER, q) == 0) { special = 1; - if (defconf_p == NULL) { - warnx("Ignoring entry for %s in %s!", q, - cfname); - free_entry(working); - continue; - } else if (*defconf_p != NULL) { + if (defconf_p != NULL) { warnx("Ignoring duplicate entry for %s!", q); free_entry(working); continue; } - *defconf_p = working; + defconf_p = working; } q = parse = missing_field(sob(++parse), errline); @@ -1333,17 +1299,9 @@ no_trimat: if (special) { ; /* Do not add to any list */ } else if (working->flags & CE_GLOB) { - if (!*glob_p) - *glob_p = working; - else - lastglob->next = working; - lastglob = working; + STAILQ_INSERT_TAIL(glob_p, working, cf_nextp); } else { - if (!*work_p) - *work_p = working; - else - lastwork->next = working; - lastwork = working; + STAILQ_INSERT_TAIL(work_p, working, cf_nextp); } } if (errline != NULL) From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 11:03:23 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BD24106564A; Sun, 21 Nov 2010 11:03:23 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 397778FC18; Sun, 21 Nov 2010 11:03:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALB3NxS052823; Sun, 21 Nov 2010 11:03:23 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALB3NvB052818; Sun, 21 Nov 2010 11:03:23 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211103.oALB3NvB052818@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 11:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215621 - stable/8/sys/net80211 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 11:03:23 -0000 Author: bschmidt Date: Sun Nov 21 11:03:22 2010 New Revision: 215621 URL: http://svn.freebsd.org/changeset/base/215621 Log: MFC r203422,r203556: When taking the AMPDU reorder fastpath, need_tap wasn't being initialized. Initialize on declaration to avoid this. Found with: clang static analyzer Committed by: rpaulo Modified: stable/8/sys/net80211/ieee80211_adhoc.c stable/8/sys/net80211/ieee80211_hostap.c stable/8/sys/net80211/ieee80211_sta.c stable/8/sys/net80211/ieee80211_wds.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net80211/ieee80211_adhoc.c ============================================================================== --- stable/8/sys/net80211/ieee80211_adhoc.c Sun Nov 21 11:01:56 2010 (r215620) +++ stable/8/sys/net80211/ieee80211_adhoc.c Sun Nov 21 11:03:22 2010 (r215621) @@ -293,7 +293,7 @@ adhoc_input(struct ieee80211_node *ni, s struct ieee80211_frame *wh; struct ieee80211_key *key; struct ether_header *eh; - int hdrspace, need_tap; + int hdrspace, need_tap = 1; /* mbuf need to be tapped. */ uint8_t dir, type, subtype, qos; uint8_t *bssid; uint16_t rxseq; @@ -318,7 +318,6 @@ adhoc_input(struct ieee80211_node *ni, s KASSERT(ni != NULL, ("null node")); ni->ni_inact = ni->ni_inact_reload; - need_tap = 1; /* mbuf need to be tapped. */ type = -1; /* undefined */ if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { Modified: stable/8/sys/net80211/ieee80211_hostap.c ============================================================================== --- stable/8/sys/net80211/ieee80211_hostap.c Sun Nov 21 11:01:56 2010 (r215620) +++ stable/8/sys/net80211/ieee80211_hostap.c Sun Nov 21 11:03:22 2010 (r215621) @@ -480,7 +480,7 @@ hostap_input(struct ieee80211_node *ni, struct ieee80211_frame *wh; struct ieee80211_key *key; struct ether_header *eh; - int hdrspace, need_tap; + int hdrspace, need_tap = 1; /* mbuf need to be tapped. */ uint8_t dir, type, subtype, qos; uint8_t *bssid; uint16_t rxseq; @@ -505,7 +505,6 @@ hostap_input(struct ieee80211_node *ni, KASSERT(ni != NULL, ("null node")); ni->ni_inact = ni->ni_inact_reload; - need_tap = 1; /* mbuf need to be tapped. */ type = -1; /* undefined */ if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { Modified: stable/8/sys/net80211/ieee80211_sta.c ============================================================================== --- stable/8/sys/net80211/ieee80211_sta.c Sun Nov 21 11:01:56 2010 (r215620) +++ stable/8/sys/net80211/ieee80211_sta.c Sun Nov 21 11:03:22 2010 (r215621) @@ -520,7 +520,7 @@ sta_input(struct ieee80211_node *ni, str struct ieee80211_frame *wh; struct ieee80211_key *key; struct ether_header *eh; - int hdrspace, need_tap; + int hdrspace, need_tap = 1; /* mbuf need to be tapped. */ uint8_t dir, type, subtype, qos; uint8_t *bssid; uint16_t rxseq; @@ -545,7 +545,6 @@ sta_input(struct ieee80211_node *ni, str KASSERT(ni != NULL, ("null node")); ni->ni_inact = ni->ni_inact_reload; - need_tap = 1; /* mbuf need to be tapped. */ type = -1; /* undefined */ if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { Modified: stable/8/sys/net80211/ieee80211_wds.c ============================================================================== --- stable/8/sys/net80211/ieee80211_wds.c Sun Nov 21 11:01:56 2010 (r215620) +++ stable/8/sys/net80211/ieee80211_wds.c Sun Nov 21 11:03:22 2010 (r215621) @@ -414,7 +414,7 @@ wds_input(struct ieee80211_node *ni, str struct ieee80211_frame *wh; struct ieee80211_key *key; struct ether_header *eh; - int hdrspace, need_tap; + int hdrspace, need_tap = 1; /* mbuf need to be tapped. */ uint8_t dir, type, subtype, qos; uint16_t rxseq; @@ -437,7 +437,6 @@ wds_input(struct ieee80211_node *ni, str KASSERT(ni != NULL, ("null node")); - need_tap = 1; /* mbuf need to be tapped. */ type = -1; /* undefined */ if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 11:04:20 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22577106566B; Sun, 21 Nov 2010 11:04:20 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FDCF8FC1A; Sun, 21 Nov 2010 11:04:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALB4Jbg052895; Sun, 21 Nov 2010 11:04:19 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALB4J8H052892; Sun, 21 Nov 2010 11:04:19 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201011211104.oALB4J8H052892@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 21 Nov 2010 11:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215622 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 11:04:20 -0000 Author: simon Date: Sun Nov 21 11:04:19 2010 New Revision: 215622 URL: http://svn.freebsd.org/changeset/base/215622 Log: MFC r208649 by gordon (needed for MFC of r210372): Add file include processing for newsyslog. Format for the include line in /etc/newsyslog.conf is: /etc/defaults/newsyslog.conf Other notes of interest: Globbing is supported in statements. Properly detect circular include loop dependencies. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Sun Nov 21 11:03:22 2010 (r215621) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Sun Nov 21 11:04:19 2010 (r215622) @@ -111,6 +111,7 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_MARKER "" #define DEBUG_MARKER "" +#define INCLUDE_MARKER "" struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; @@ -149,6 +150,11 @@ struct zipwork_entry { char zw_fname[1]; /* the file to compress */ }; +struct include_entry { + STAILQ_ENTRY(include_entry) inc_nextp; + const char *file; /* Name of file to process */ +}; + typedef enum { FREE_ENT, KEEP_ENT } fk_entry; @@ -156,6 +162,7 @@ typedef enum { STAILQ_HEAD(cflist, conf_entry); SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); +STAILQ_HEAD(ilist, include_entry); int dbg_at_times; /* -D Show details of 'trim_at' code */ @@ -191,10 +198,12 @@ const char *path_syslogpid = _PATH_SYSLO static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p); + struct conf_entry *defconf_p, struct ilist *inclist); +static void add_to_queue(const char *fname, struct ilist *inclist); static char *sob(char *p); static char *son(char *p); static int isnumberstr(const char *); +static int isglobstr(const char *); static char *missing_field(char *p, char *errline); static void change_attrs(const char *, const struct conf_entry *); static fk_entry do_entry(struct conf_entry *); @@ -736,13 +745,15 @@ static struct cflist * get_worklist(char **files) { FILE *f; - const char *fname; char **given; - struct cflist *filelist, *globlist, *cmdlist; + struct cflist *cmdlist, *filelist, *globlist; struct conf_entry *defconf, *dupent, *ent; + struct ilist inclist; + struct include_entry *inc; int gmatch, fnres; defconf = NULL; + STAILQ_INIT(&inclist); filelist = malloc(sizeof(struct cflist)); if (filelist == NULL) @@ -753,21 +764,29 @@ get_worklist(char **files) err(1, "malloc of globlist"); STAILQ_INIT(globlist); - fname = conf; - if (fname == NULL) - fname = _PATH_CONF; + inc = malloc(sizeof(struct include_entry)); + if (inc == NULL) + err(1, "malloc of inc"); + inc->file = conf; + if (inc->file == NULL) + inc->file = _PATH_CONF; + STAILQ_INSERT_TAIL(&inclist, inc, inc_nextp); + + STAILQ_FOREACH(inc, &inclist, inc_nextp) { + if (strcmp(inc->file, "-") != 0) + f = fopen(inc->file, "r"); + else { + f = stdin; + inc->file = ""; + } + if (!f) + err(1, "%s", inc->file); - if (strcmp(fname, "-") != 0) - f = fopen(fname, "r"); - else { - f = stdin; - fname = ""; + if (verbose) + printf("Processing %s\n", inc->file); + parse_file(f, filelist, globlist, defconf, &inclist); + (void) fclose(f); } - if (!f) - err(1, "%s", fname); - - parse_file(f, filelist, globlist, defconf); - (void) fclose(f); /* * All config-file information has been read in and turned into @@ -970,14 +989,16 @@ expand_globs(struct cflist *work_p, stru */ static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p) + struct conf_entry *defconf_p, struct ilist *inclist) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; struct conf_entry *working; struct passwd *pwd; struct group *grp; + glob_t pglob; int eol, ptm_opts, res, special; + size_t i; errline = NULL; while (fgets(line, BUFSIZ, cf)) { @@ -1022,6 +1043,37 @@ parse_file(FILE *cf, struct cflist *work parse_doption(q); } continue; + } else if (strcasecmp(INCLUDE_MARKER, q) == 0) { + if (verbose) + printf("Found: %s", errline); + q = parse = missing_field(sob(++parse), errline); + parse = son(parse); + if (!*parse) { + warnx("include line missing argument:\n%s", + errline); + continue; + } + + *parse = '\0'; + + if (isglobstr(q)) { + res = glob(q, GLOB_NOCHECK, NULL, &pglob); + if (res != 0) { + warn("cannot expand pattern (%d): %s", + res, q); + continue; + } + + if (verbose > 2) + printf("\t+ Expanding pattern %s\n", q); + + for (i = 0; i < pglob.gl_matchc; i++) + add_to_queue(pglob.gl_pathv[i], + inclist); + globfree(&pglob); + } else + add_to_queue(q, inclist); + continue; } special = 0; @@ -1317,6 +1369,33 @@ missing_field(char *p, char *errline) return (p); } +/* + * Only add to the queue if the file hasn't already been added. This is + * done to prevent circular include loops. + */ +static void +add_to_queue(const char *fname, struct ilist *inclist) +{ + struct include_entry *inc; + + STAILQ_FOREACH(inc, inclist, inc_nextp) { + if (strcmp(fname, inc->file) == 0) { + warnx("duplicate include detected: %s", fname); + return; + } + } + + inc = malloc(sizeof(struct include_entry)); + if (inc == NULL) + err(1, "malloc of inc"); + inc->file = strdup(fname); + + if (verbose > 2) + printf("\t+ Adding %s to the processing queue.\n", fname); + + STAILQ_INSERT_TAIL(inclist, inc, inc_nextp); +} + static fk_entry do_rotate(const struct conf_entry *ent) { @@ -1921,6 +2000,19 @@ isnumberstr(const char *string) return (1); } +/* Check if string contains a glob */ +static int +isglobstr(const char *string) +{ + char chr; + + while ((chr = *string++)) { + if (chr == '*' || chr == '?' || chr == '[') + return (1); + } + return (0); +} + /* * Save the active log file under a new name. A link to the new name * is the quick-and-easy way to do this. If that fails (which it will Modified: stable/8/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Sun Nov 21 11:03:22 2010 (r215621) +++ stable/8/usr.sbin/newsyslog/newsyslog.conf.5 Sun Nov 21 11:04:19 2010 (r215622) @@ -69,13 +69,18 @@ is treated as an ordinary character. The fields of the configuration file are as follows: .Bl -tag -width indent .It Ar logfile_name -Name of the system log file to be archived, or the literal string -.Dq Aq Li default . +Name of the system log file to be archived, +or one of the literal strings +.Dq Aq Li default , +or +.Dq Aq Li include . The special default entry will only be used if a log file name is given as a command line argument to .Xr newsyslog 8 , and if that log file name is not matched by any other line in the configuration file. +The include entry is used to include other configuration +files and supports globbing. .It Ar owner : Ns Ar group This optional field specifies the owner and group for the archive file. The From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 11:08:23 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01854106564A; Sun, 21 Nov 2010 11:08:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E361A8FC17; Sun, 21 Nov 2010 11:08:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALB8MHO053032; Sun, 21 Nov 2010 11:08:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALB8MJV053030; Sun, 21 Nov 2010 11:08:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011211108.oALB8MJV053030@svn.freebsd.org> From: Michael Tuexen Date: Sun, 21 Nov 2010 11:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215623 - in stable/8/etc: . periodic/daily X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 11:08:23 -0000 Author: tuexen Date: Sun Nov 21 11:08:22 2010 New Revision: 215623 URL: http://svn.freebsd.org/changeset/base/215623 Log: MFC r215249: Add for existing protocol entries the missing SCTP port allocations and add protocol entries for protocols which have SCTP port allocations. These entries are according to http://www.iana.org/assignments/port-numbers as of today. Also add SCTP port allocation entires for the echo, daytime, and chargen service. Discussed with rwatson@ Modified: stable/8/etc/services Directory Properties: stable/8/etc/ (props changed) stable/8/etc/periodic/daily/ (props changed) stable/8/etc/periodic/daily/800.scrub-zfs (props changed) stable/8/etc/periodic/security/ (props changed) Modified: stable/8/etc/services ============================================================================== --- stable/8/etc/services Sun Nov 21 11:04:19 2010 (r215622) +++ stable/8/etc/services Sun Nov 21 11:08:22 2010 (r215623) @@ -33,24 +33,31 @@ echo 4/ddp #AppleTalk Echo Protoco rje 5/tcp #Remote Job Entry rje 5/udp #Remote Job Entry zip 6/ddp #Zone Information Protocol +echo 7/sctp echo 7/tcp echo 7/udp +discard 9/sctp sink null discard 9/tcp sink null discard 9/udp sink null systat 11/tcp users #Active Users systat 11/udp users #Active Users +daytime 13/sctp daytime 13/tcp daytime 13/udp qotd 17/tcp quote #Quote of the Day qotd 17/udp quote #Quote of the Day msp 18/tcp #Message Send Protocol msp 18/udp #Message Send Protocol +chargen 19/sctp ttytst source #Character Generator chargen 19/tcp ttytst source #Character Generator chargen 19/udp ttytst source #Character Generator +ftp-data 20/sctp #File Transfer [Default Data] ftp-data 20/tcp #File Transfer [Default Data] ftp-data 20/udp #File Transfer [Default Data] +ftp 21/sctp #File Transfer [Control] ftp 21/tcp #File Transfer [Control] ftp 21/udp #File Transfer [Control] +ssh 22/sctp #Secure Shell Login ssh 22/tcp #Secure Shell Login ssh 22/udp #Secure Shell Login telnet 23/tcp @@ -151,6 +158,7 @@ vettcp 78/tcp vettcp 78/udp finger 79/tcp finger 79/udp +http 80/sctp www www-http #World Wide Web HTTP http 80/tcp www www-http #World Wide Web HTTP http 80/udp www www-http #World Wide Web HTTP hosts2-ns 81/tcp #HOSTS2 Name Server @@ -350,6 +358,7 @@ xdmcp 177/tcp #X Display Manager Con xdmcp 177/udp #X Display Manager Control Protocol NextStep 178/tcp nextstep NeXTStep #NextStep Window Server NextStep 178/udp nextstep NeXTStep #NextStep Window Server +bgp 179/sctp #Border Gateway Protocol bgp 179/tcp #Border Gateway Protocol bgp 179/udp #Border Gateway Protocol ris 180/tcp #Intergraph @@ -738,6 +747,7 @@ decvms-sysmgt 441/tcp decvms-sysmgt 441/udp cvc_hostd 442/tcp cvc_hostd 442/udp +https 443/sctp https 443/tcp https 443/udp snpp 444/tcp #Simple Network Paging Protocol @@ -1519,7 +1529,9 @@ nfsd-keepalive 1110/udp #Client status supfiledbg 1127/tcp # for SUP nfa 1155/tcp #Network File Access nfa 1155/udp #Network File Access -phone 1167/udp #conference calling +cisco-ipsla 1167/sctp #Cisco IP SLAs Control Protocol +cisco-ipsla 1167/tcp #Cisco IP SLAs Control Protocol +cisco-ipsla 1167/udp #Cisco IP SLAs Control Protocol skkserv 1178/tcp #SKK (kanji input) lupa 1212/tcp lupa 1212/udp @@ -2117,6 +2129,7 @@ sdfunc 2046/udp #dls 2047/udp dls-monitor 2048/tcp dls-monitor 2048/udp +nfsd 2049/sctp nfs # NFS server daemon nfsd 2049/tcp nfs # NFS server daemon nfsd 2049/udp nfs # NFS server daemon #PROBLEMS!============================================================= @@ -2144,6 +2157,8 @@ hpssd 2207/tcp #HP Status and Service hpssd 2207/udp #HP Status and Services hpiod 2208/tcp #HP I/O Backend hpiod 2208/udp #HP I/O Backend +rcip-itu 2225/sctp #Resource Connection Initiation Protocol +rcip-itu 2225/tcp #Resource Connection Initiation Protocol ivs-video 2232/tcp #IVS Video default ivs-video 2232/udp #IVS Video default ivsd 2241/tcp #IVS Daemon @@ -2177,6 +2192,17 @@ dict 2628/udp #RFC 2229 listen 2766/tcp #System V listener port www-dev 2784/tcp #world wide web - development www-dev 2784/udp #world wide web - development +m2ua 2904/sctp #M2UA +m2ua 2904/tcp #M2UA +m2ua 2904/udp #M2UA +m3ua 2905/sctp #M3UA +m3ua 2905/tcp #M3UA +megaco-h248 2944/sctp #Megaco-H.248 text +megaco-h248 2944/tcp #Megaco H-248 +megaco-h248 2944/udp #Megaco H-248 +h248-binary 2945/sctp #Megaco/H.248 binary +h248-binary 2945/tcp #H248 Binary +h248-binary 2945/udp #H248 Binary eppc 3031/tcp #Remote AppleEvents/PPC Toolbox eppc 3031/udp #Remote AppleEvents/PPC Toolbox NSWS 3049/tcp @@ -2184,6 +2210,7 @@ NSWS 3049/udp gds_db 3050/tcp #InterBase Database Remote Protocol gds_db 3050/udp #InterBase Database Remote Protocol sj3 3086/tcp #SJ3 (kanji input) +itu-bicc-stc 3097/sctp #ITU-T Q.1902.1/Q.2150.3 vmodem 3141/tcp vmodem 3141/udp iscsi-target 3260/tcp # iSCSI port @@ -2203,10 +2230,19 @@ vat-control 3457/tcp #VAT default cont vat-control 3457/udp #VAT default control nut 3493/tcp #Network UPS Tools nut 3493/udp #Network UPS Tools +m2pa 3565/sctp #M2PA +m2pa 3565/tcp #M2PA tsp 3653/tcp #Tunnel Setup Protocol tsp 3653/udp #Tunnel Setup Protocol svn 3690/tcp #Subversion svn 3690/udp #Subversion +asap 3863/sctp #asap sctp +asap 3863/tcp #asap tcp port +asap 3863/udp #asap udp port +asap-tls 3864/sctp #asap-sctp/tls +asap-tls 3864/tcp #asap/tls tcp port +diameter 3868/tcp #DIAMETER +diameter 3868/sctp #DIAMETER udt_os 3900/tcp #Unidata UDT OS udt_os 3900/udp #Unidata UDT OS mapper-nodemgr 3984/tcp #MAPPER network node manager @@ -2243,6 +2279,12 @@ fax 4557/tcp #FAX transmission servic hylafax 4559/tcp #HylaFAX client-server protocol rfa 4672/tcp #remote file access server rfa 4672/udp #remote file access server +ipfix 4739/sctp #IP Flow Info Export +ipfix 4739/tcp #IP Flow Info Export +ipfix 4739/udp #IP Flow Info Export +ipfixs 4740/sctp #ipfix protocol over DTLS +ipfixs 4740/tcp #ipfix protocol over TLS +ipfixs 4740/udp #ipfix protocol over DTLS commplex-main 5000/tcp commplex-main 5000/udp commplex-link 5001/tcp @@ -2261,6 +2303,8 @@ sip 5060/tcp #Session Initialization sip 5060/udp #Session Initialization Protocol (VoIP) sip-tls 5061/tcp #SIP over TLS sip-tls 5061/udp #SIP over TLS +car 5090/sctp #Candidate AR +cxtp 5091/sctp #Context Transfer Protocol rmonitor_secure 5145/tcp rmonitor_secure 5145/udp aol 5190/tcp #America-Online @@ -2296,6 +2340,12 @@ mdns 5353/udp #Multicast DNS postgresql 5432/tcp #PostgreSQL Database postgresql 5432/udp #PostgreSQL Database rplay 5555/udp +amqp 5672/sctp #AMQP +amqp 5672/tcp #AMQP +amqp 5672/udp #AMQP +v5ua 5675/sctp #V5UA application port +v5ua 5675/tcp #V5UA application port +v5ua 5675/udp #V5UA application port canna 5680/tcp #Canna (Japanese Input) proshareaudio 5713/tcp #proshare conf audio proshareaudio 5713/udp #proshare conf audio @@ -2341,6 +2391,9 @@ xdsxdm 6558/udp sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unoffical) +frc-hp 6704/sctp #ForCES HP (High Priority) channel +frc-mp 6705/sctp #ForCES MP (Medium Priority) channel +frc-lp 6706/sctp #ForCES LP (Low priority) channel acmsoda 6969/tcp acmsoda 6969/udp afs3-fileserver 7000/tcp #file server itself @@ -2375,8 +2428,16 @@ fodms 7200/tcp #FODMS FLIP fodms 7200/udp #FODMS FLIP dlip 7201/tcp dlip 7201/udp +simco 7626/sctp #SImple Middlebox COnfiguration (SIMCO) +simco 7626/tcp #SImple Middlebox COnfiguration (SIMCO) Server ftp-proxy 8021/tcp # FTP proxy +pim 8471/sctp #PIM over Reliable Transport +pim 8471/tcp #PIM over Reliable Transport natd 8668/divert # Network Address Translation +lcs-ap 9082/sctp #LCS Application Protocol +aurora 9084/sctp #IBM AURORA Performance Visualizer +aurora 9084/tcp #IBM AURORA Performance Visualizer +aurora 9084/udp #IBM AURORA Performance Visualizer jetdirect 9100/tcp #HP JetDirect card git 9418/tcp #git pack transfer service git 9418/udp #git pack transfer service @@ -2384,18 +2445,37 @@ man 9535/tcp man 9535/udp sd 9876/tcp #Session Director sd 9876/udp #Session Director +iua 9900/sctp #IUA +iua 9900/tcp #IUA +iua 9900/udp #IUA +enrp 9901/sctp #enrp server channel +enrp 9901/udp #enrp server channel +enrp-tls 9902/sctp #enrp/tls server channel amanda 10080/tcp #Dump server control amanda 10080/udp #Dump server control amandaidx 10082/tcp #Amanda indexing amidxtape 10083/tcp #Amanda tape indexing +wmereceiving 11997/sctp #WorldMailExpress +wmedistribution 11998/sctp #WorldMailExpress +wmereporting 11999/sctp #WorldMailExpress +sua 14001/sctp #SUA +sua 14001/tcp #SUA isode-dua 17007/tcp isode-dua 17007/udp biimenu 18000/tcp #Beckman Instruments, Inc. biimenu 18000/udp #Beckman Instruments, Inc. +nfsrdma 20049/sctp #Network File System (NFS) over RDMA +nfsrdma 20049/tcp #Network File System (NFS) over RDMA +nfsrdma 20049/udp #Network File System (NFS) over RDMA wnn4 22273/tcp wnn6 #Wnn4 (Japanese input) wnn4_Cn 22289/tcp wnn6_Cn #Wnn4 (Chinese input) wnn4_Kr 22305/tcp wnn6_Kr #Wnn4 (Korean input) wnn4_Tw 22321/tcp wnn6_Tw #Wnn4 (Taiwanse input) wnn6_DS 26208/tcp #Wnn6 (Dserver) +sgsap 29118/sctp #SGsAP in 3GPP +sbcap 29168/sctp #SBcAP in 3GPP +iuhsctpassoc 29169/sctp #HNBAP and RUA Common Association +s1-control 36412/sctp #S1-Control Plane (3GPP) +x2-control 36422/sctp #X2-Control Plane (3GPP) dbbrowse 47557/tcp #Databeam Corporation dbbrowse 47557/udp #Databeam Corporation From owner-svn-src-stable@FreeBSD.ORG Sun Nov 21 11:10:10 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5876F1065672; Sun, 21 Nov 2010 11:10:10 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 459278FC08; Sun, 21 Nov 2010 11:10:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALBAAEB053115; Sun, 21 Nov 2010 11:10:10 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALBAA18053112; Sun, 21 Nov 2010 11:10:10 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201011211110.oALBAA18053112@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 21 Nov 2010 11:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215624 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 11:10:10 -0000 Author: simon Date: Sun Nov 21 11:10:09 2010 New Revision: 215624 URL: http://svn.freebsd.org/changeset/base/215624 Log: MFC r210372: Add support for creating the archived log filenames using a time-stamp instead of the traditional simple counter. Using the time-stamp based file-names, once a log file is archived, it will not change name until it is deleted. This means that many backup systems will only perform one backup of the archived log file, instead for performing a new backup of the logfile upon each logfile rotation. This implementation is separate from the patches in the mentioned PR, as I wasn't aware of the existence of the PR until after I had implemented the same functionality as the patches in the PR provide. Unlike the PR, this new code does honor the 'log count' in newsyslog.conf so old logfiles are deleted. This new code does not currently support never deleting the archived logfiles. Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.8 Sun Nov 21 11:08:22 2010 (r215623) +++ stable/8/usr.sbin/newsyslog/newsyslog.8 Sun Nov 21 11:10:09 2010 (r215624) @@ -31,6 +31,7 @@ .Op Fl a Ar directory .Op Fl d Ar directory .Op Fl f Ar config_file +.Op Fl t Ar timefmt .Op Ar .Sh DESCRIPTION The @@ -51,6 +52,11 @@ the last period's logs in it, has the next to last period's logs in it, and so on, up to a user-specified number of archived logs. +It is also possible to let archived log filenames be created using the +time the log file was archived instead of the sequential number using +the +.Fl t +option. Optionally the archived logs can be compressed to save space. .Pp @@ -142,6 +148,31 @@ However, this option is most likely to b with the .Fl R option, and in that case the compression will be done. +.It Fl t Ar timefmt +If specified +.Nm +will create the +.Dq rotated +logfiles using the specified time format instead of the default +sequential filenames. +The time format is described in the +.Xr strftime 3 +manual page. +If the +.Ar timefmt +argument is set to an empty string or the string +.Dq DEFAULT , +the default built in time format +is used. +If the +.Ar timefmt +string is changed the old files created using the previous time format +will not be be automatically removed (unless the new format is very +similar to the old format). +This is also the case when changing from sequential filenames to time +based file names, and the other way around. +The time format should contain at least year, month, day, and hour to +make sure rotating of old logfiles can select the correct logfiles. .It Fl C If specified once, then .Nm Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Sun Nov 21 11:08:22 2010 (r215623) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Sun Nov 21 11:10:09 2010 (r215624) @@ -69,9 +69,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include #include @@ -80,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -112,6 +115,9 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_MARKER "" #define DEBUG_MARKER "" #define INCLUDE_MARKER "" +#define DEFAULT_TIMEFNAME_FMT "%Y%m%dT%H%M%S" + +#define MAX_OLDLOGS 65536 /* Default maximum number of old logfiles */ struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; @@ -155,6 +161,11 @@ struct include_entry { const char *file; /* Name of file to process */ }; +struct oldlog_entry { + char *fname; /* Filename of the log file */ + time_t t; /* Parses timestamp of the logfile */ +}; + typedef enum { FREE_ENT, KEEP_ENT } fk_entry; @@ -182,6 +193,7 @@ int rotatereq = 0; /* -R = Always rotat /* that a list of files *are* given on */ /* the run command). */ char *requestor; /* The name given on a -R request */ +char *timefnamefmt = NULL; /* Use time based filenames instead of .0 etc */ char *archdirname; /* Directory path to old logfiles archive */ char *destdir = NULL; /* Directory to treat at root for logs */ const char *conf; /* Configuration file to use */ @@ -587,7 +599,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, "a:d:f:nrsvCD:FNPR:")) != -1) + while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:")) != -1) switch (ch) { case 'a': archtodir++; @@ -608,6 +620,13 @@ parse_args(int argc, char **argv) case 's': nosignal = 1; break; + case 't': + if (optarg[0] == '\0' || + strcmp(optarg, "DEFAULT") == 0) + timefnamefmt = strdup(DEFAULT_TIMEFNAME_FMT); + else + timefnamefmt = strdup(optarg); + break; case 'v': verbose++; break; @@ -733,7 +752,7 @@ usage(void) fprintf(stderr, "usage: newsyslog [-CFNnrsv] [-a directory] [-d directory] [-f config-file]\n" - " [-S pidfile] [ [-R requestor] filename ... ]\n"); + " [-S pidfile] [-t timefmt ] [ [-R requestor] filename ... ]\n"); exit(1); } @@ -1370,6 +1389,177 @@ missing_field(char *p, char *errline) } /* + * In our sort we return it in the reverse of what qsort normally + * would do, as we want the newest files first. If we have two + * entries with the same time we don't really care about order. + * + * Support function for qsort() in delete_oldest_timelog(). + */ +static int +oldlog_entry_compare(const void *a, const void *b) +{ + const struct oldlog_entry *ola = a, *olb = b; + + if (ola->t > olb->t) + return (-1); + else if (ola->t < olb->t) + return (1); + else + return (0); +} + +/* + * Delete the oldest logfiles, when using time based filenames. + */ +static void +delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) +{ + char *logfname, *s, *dir, errbuf[80]; + int logcnt, max_logcnt, dirfd, i; + struct oldlog_entry *oldlogs; + size_t logfname_len; + struct dirent *dp; + const char *cdir; + struct tm tm; + DIR *dirp; + + oldlogs = malloc(MAX_OLDLOGS * sizeof(struct oldlog_entry)); + max_logcnt = MAX_OLDLOGS; + logcnt = 0; + + if (archive_dir != NULL && archive_dir[0] != '\0') + cdir = archive_dir; + else + if ((cdir = dirname(ent->log)) == NULL) + err(1, "dirname()"); + if ((dir = strdup(cdir)) == NULL) + err(1, "strdup()"); + + if ((s = basename(ent->log)) == NULL) + err(1, "basename()"); + if ((logfname = strdup(s)) == NULL) + err(1, "strdup()"); + logfname_len = strlen(logfname); + if (strcmp(logfname, "/") == 0) + errx(1, "Invalid log filename - became '/'"); + + if (verbose > 2) + printf("Searching for old logs in %s\n", dir); + + /* First we create a 'list' of all archived logfiles */ + if ((dirp = opendir(dir)) == NULL) + err(1, "Cannot open log directory '%s'", dir); + dirfd = dirfd(dirp); + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_type != DT_REG) + continue; + + /* Ignore everything but files with our logfile prefix */ + if (strncmp(dp->d_name, logfname, logfname_len) != 0) + continue; + /* Ignore the actual non-rotated logfile */ + if (dp->d_namlen == logfname_len) + continue; + /* + * Make sure we created have found a logfile, so the + * postfix is valid, IE format is: '.