From owner-svn-src-stable@FreeBSD.ORG Sun Oct 16 01:24:59 2011 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 1BCDA106566C; Sun, 16 Oct 2011 01:24:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 96C6B8FC12; Sun, 16 Oct 2011 01:24:58 +0000 (UTC) Received: by ggeq3 with SMTP id q3so2747141gge.13 for ; Sat, 15 Oct 2011 18:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=GNw6A1J30hIkA4wKteidZDwSMhmRbWBA8RdRn0JnCbc=; b=tSysL1SvhCyq0j0yKrtcK+V1XGo3qUDAZS/VHCetQSZDJ23R40wC46GzUVB7HlPtL+ 3g4FSQgXDVw7Y6fSMKQzW9tbNOJsXWaQKWXW9LY5wZvH3hM2iUnUYNnz3tCk5qLYSPek 7/qRCZSoBMXjOWqnT8dDSxrzwGYGd27CJkMxQ= MIME-Version: 1.0 Received: by 10.236.178.41 with SMTP id e29mr19389524yhm.117.1318728297954; Sat, 15 Oct 2011 18:24:57 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.95.147 with HTTP; Sat, 15 Oct 2011 18:24:57 -0700 (PDT) In-Reply-To: <201110152123.p9FLN5Ht031202@svn.freebsd.org> References: <201110152123.p9FLN5Ht031202@svn.freebsd.org> Date: Sun, 16 Oct 2011 09:24:57 +0800 X-Google-Sender-Auth: FJmXmEaqmzXsqw_2uZEc7vwEpuY Message-ID: From: Adrian Chadd To: Ken Smith Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r226405 - in stable/9: . etc/defaults lib/libc/stdlib sys/amd64/conf sys/i386/conf sys/ia64/conf sys/pc98/conf sys/powerpc/conf sys/sparc64/conf 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, 16 Oct 2011 01:24:59 -0000 Hi! Would you consider leaving these in but just commenting them out? That way if a user hits a deadlock or memory corruption issue, we can just say "uncomment the section marked _debugging_ in your config file." Thanks, Adrian From owner-svn-src-stable@FreeBSD.ORG Sun Oct 16 15:55:24 2011 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 14F05106566C; Sun, 16 Oct 2011 15:55:24 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03E778FC0A; Sun, 16 Oct 2011 15:55:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9GFtNpe069359; Sun, 16 Oct 2011 15:55:23 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9GFtNmT069357; Sun, 16 Oct 2011 15:55:23 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201110161555.p9GFtNmT069357@svn.freebsd.org> From: Ken Smith Date: Sun, 16 Oct 2011 15:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226438 - stable/9/sys/conf 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, 16 Oct 2011 15:55:24 -0000 Author: kensmith Date: Sun Oct 16 15:55:23 2011 New Revision: 226438 URL: http://svn.freebsd.org/changeset/base/226438 Log: Ready for RC1. Approved by: re (implicit) Modified: stable/9/sys/conf/newvers.sh Modified: stable/9/sys/conf/newvers.sh ============================================================================== --- stable/9/sys/conf/newvers.sh Sun Oct 16 15:08:43 2011 (r226437) +++ stable/9/sys/conf/newvers.sh Sun Oct 16 15:55:23 2011 (r226438) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.0" -BRANCH="BETA3" +BRANCH="RC1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable@FreeBSD.ORG Mon Oct 17 03:35:24 2011 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 DC51B106566C; Mon, 17 Oct 2011 03:35:24 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB9538FC1A; Mon, 17 Oct 2011 03:35:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9H3ZOYf092948; Mon, 17 Oct 2011 03:35:24 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9H3ZOsT092946; Mon, 17 Oct 2011 03:35:24 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201110170335.p9H3ZOsT092946@svn.freebsd.org> From: Qing Li Date: Mon, 17 Oct 2011 03:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226455 - stable/9/sys/netinet6 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: Mon, 17 Oct 2011 03:35:25 -0000 Author: qingli Date: Mon Oct 17 03:35:24 2011 New Revision: 226455 URL: http://svn.freebsd.org/changeset/base/226455 Log: MFC 226453 The code change made in r226040 was incomplete and resulted in routes such as fe80::1%lo0 no being installed. This patch completes the original intended fix. Reviewed by: hrs. bz Approved by: re (ken) Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Mon Oct 17 00:05:31 2011 (r226454) +++ stable/9/sys/netinet6/in6.c Mon Oct 17 03:35:24 2011 (r226455) @@ -1805,14 +1805,17 @@ in6_ifinit(struct ifnet *ifp, struct in6 if (error != 0) return (error); ia->ia_flags |= IFA_ROUTE; + /* + * Handle the case for ::1 . + */ + if (ifp->if_flags & IFF_LOOPBACK) + ia->ia_flags |= IFA_RTSELF; } /* * add a loopback route to self */ - if (!(ia->ia_flags & IFA_RTSELF) - && (V_nd6_useloopback - && !(ifp->if_flags & IFF_LOOPBACK))) { + if (!(ia->ia_flags & IFA_RTSELF) && V_nd6_useloopback) { error = ifa_add_loopback_route((struct ifaddr *)ia, (struct sockaddr *)&ia->ia_addr); if (error == 0) From owner-svn-src-stable@FreeBSD.ORG Mon Oct 17 05:38:07 2011 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 9CD411065673; Mon, 17 Oct 2011 05:38:07 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AB058FC13; Mon, 17 Oct 2011 05:38:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9H5c7QX096730; Mon, 17 Oct 2011 05:38:07 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9H5c70h096723; Mon, 17 Oct 2011 05:38:07 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201110170538.p9H5c70h096723@svn.freebsd.org> From: David Schultz Date: Mon, 17 Oct 2011 05:38:07 +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: r226456 - in stable/8/lib/msun: man src 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: Mon, 17 Oct 2011 05:38:07 -0000 Author: das Date: Mon Oct 17 05:38:07 2011 New Revision: 226456 URL: http://svn.freebsd.org/changeset/base/226456 Log: MFC various log* improvements. r216247 - log2f style r216248 - log2f insignificant bug r219360 - log10 converted to use k_log r219361 - log10f converted to use k_log r226375 - log2/log10 style r226376 - log2/log10 bde's improvements; fix log(1) with FE_DOWNWARD rounding Modified: stable/8/lib/msun/man/math.3 stable/8/lib/msun/src/e_log10.c stable/8/lib/msun/src/e_log10f.c stable/8/lib/msun/src/e_log2.c stable/8/lib/msun/src/e_log2f.c stable/8/lib/msun/src/k_logf.h Directory Properties: stable/8/lib/msun/ (props changed) Modified: stable/8/lib/msun/man/math.3 ============================================================================== --- stable/8/lib/msun/man/math.3 Mon Oct 17 03:35:24 2011 (r226455) +++ stable/8/lib/msun/man/math.3 Mon Oct 17 05:38:07 2011 (r226456) @@ -198,7 +198,7 @@ yn Bessel function of the second kind of .El .Pp The routines -in this section may not produce a result that is correctly rounded, +in this section might not produce a result that is correctly rounded, so reproducible results cannot be guaranteed across platforms. For most of these functions, however, incorrect rounding occurs rarely, and then only in very-close-to-halfway cases. @@ -234,9 +234,8 @@ Many of the routines to compute transcen inaccurate results in other than the default rounding mode. .Pp On the i386 platform, trigonometric argument reduction is not -performed accurately for very large arguments, resulting in errors -greater than 1 -.Em ulp +performed accurately for huge arguments, resulting in +large errors for such arguments to .Fn cos , .Fn sin , Modified: stable/8/lib/msun/src/e_log10.c ============================================================================== --- stable/8/lib/msun/src/e_log10.c Mon Oct 17 03:35:24 2011 (r226455) +++ stable/8/lib/msun/src/e_log10.c Mon Oct 17 05:38:07 2011 (r226456) @@ -14,45 +14,18 @@ #include __FBSDID("$FreeBSD$"); -/* __ieee754_log10(x) - * Return the base 10 logarithm of x - * - * Method : - * Let log10_2hi = leading 40 bits of log10(2) and - * log10_2lo = log10(2) - log10_2hi, - * ivln10 = 1/log(10) rounded. - * Then - * n = ilogb(x), - * if(n<0) n = n+1; - * x = scalbn(x,-n); - * log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x)) - * - * Note 1: - * To guarantee log10(10**n)=n, where 10**n is normal, the rounding - * mode must set to Round-to-Nearest. - * Note 2: - * [1/log(10)] rounded to 53 bits has error .198 ulps; - * log10 is monotonic at all binary break points. - * - * Special cases: - * log10(x) is NaN with signal if x < 0; - * log10(+INF) is +INF with no signal; log10(0) is -INF with signal; - * log10(NaN) is that NaN with no signal; - * log10(10**N) = N for N=0,1,...,22. - * - * Constants: - * The hexadecimal values are the intended ones for the following constants. - * The decimal values may be used, provided that the compiler will convert - * from decimal to binary accurately enough to produce the hexadecimal values - * shown. +/* + * Return the base 10 logarithm of x. See k_log.c for details on the algorithm. */ #include "math.h" #include "math_private.h" +#include "k_log.h" static const double two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */ +ivln10hi = 4.34294481878168880939e-01, /* 0x3fdbcb7b, 0x15200000 */ +ivln10lo = 2.50829467116452752298e-11, /* 0x3dbb9438, 0xca9aadd5 */ log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */ log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */ @@ -61,7 +34,7 @@ static const double zero = 0.0; double __ieee754_log10(double x) { - double y,z; + double f,hi,lo,y,z; int32_t i,k,hx; u_int32_t lx; @@ -77,10 +50,15 @@ __ieee754_log10(double x) } if (hx >= 0x7ff00000) return x+x; k += (hx>>20)-1023; - i = ((u_int32_t)k&0x80000000)>>31; - hx = (hx&0x000fffff)|((0x3ff-i)<<20); - y = (double)(k+i); - SET_HIGH_WORD(x,hx); - z = y*log10_2lo + ivln10*__ieee754_log(x); + hx &= 0x000fffff; + i = (hx+0x95f64)&0x100000; + SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */ + k += (i>>20); + y = (double)k; + f = __kernel_log(x); + hi = x = x - 1; + SET_LOW_WORD(hi,0); + lo = x - hi; + z = y*log10_2lo + (x+f)*ivln10lo + (lo+f)*ivln10hi + hi*ivln10hi; return z+y*log10_2hi; } Modified: stable/8/lib/msun/src/e_log10f.c ============================================================================== --- stable/8/lib/msun/src/e_log10f.c Mon Oct 17 03:35:24 2011 (r226455) +++ stable/8/lib/msun/src/e_log10f.c Mon Oct 17 05:38:07 2011 (r226456) @@ -1,7 +1,3 @@ -/* e_log10f.c -- float version of e_log10.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -16,12 +12,18 @@ #include __FBSDID("$FreeBSD$"); +/* + * Return the base 10 logarithm of x. See k_log.c for details on the algorithm. + */ + #include "math.h" #include "math_private.h" +#include "k_logf.h" static const float two25 = 3.3554432000e+07, /* 0x4c000000 */ -ivln10 = 4.3429449201e-01, /* 0x3ede5bd9 */ +ivln10hi = 4.3432617188e-01, /* 0x3ede6000 */ +ivln10lo = -3.1689971365e-05, /* 0xb804ead9 */ log10_2hi = 3.0102920532e-01, /* 0x3e9a2080 */ log10_2lo = 7.9034151668e-07; /* 0x355427db */ @@ -30,7 +32,7 @@ static const float zero = 0.0; float __ieee754_log10f(float x) { - float y,z; + float f,hi,lo,y,z; int32_t i,k,hx; GET_FLOAT_WORD(hx,x); @@ -45,10 +47,16 @@ __ieee754_log10f(float x) } if (hx >= 0x7f800000) return x+x; k += (hx>>23)-127; - i = ((u_int32_t)k&0x80000000)>>31; - hx = (hx&0x007fffff)|((0x7f-i)<<23); - y = (float)(k+i); - SET_FLOAT_WORD(x,hx); - z = y*log10_2lo + ivln10*__ieee754_logf(x); + hx &= 0x007fffff; + i = (hx+(0x4afb0d))&0x800000; + SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ + k += (i>>23); + y = (float)k; + f = __kernel_logf(x); + x = x - (float)1.0; + GET_FLOAT_WORD(hx,x); + SET_FLOAT_WORD(hi,hx&0xfffff000); + lo = x - hi; + z = y*log10_2lo + (x+f)*ivln10lo + (lo+f)*ivln10hi + hi*ivln10hi; return z+y*log10_2hi; } Modified: stable/8/lib/msun/src/e_log2.c ============================================================================== --- stable/8/lib/msun/src/e_log2.c Mon Oct 17 03:35:24 2011 (r226455) +++ stable/8/lib/msun/src/e_log2.c Mon Oct 17 05:38:07 2011 (r226456) @@ -14,8 +14,8 @@ #include __FBSDID("$FreeBSD$"); -/* log2(x) - * Return the base 2 logarithm of x. +/* + * Return the base 2 logarithm of x. See k_log.c for details on the algorithm. */ #include "math.h" @@ -24,8 +24,8 @@ __FBSDID("$FreeBSD$"); static const double two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -ivln2hi = 0x1.71547652000p+0, -ivln2lo = 0x1.705fc2eefa2p-33; +ivln2hi = 1.44269504072144627571e+00, /* 0x3ff71547, 0x65200000 */ +ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ static const double zero = 0.0; Modified: stable/8/lib/msun/src/e_log2f.c ============================================================================== --- stable/8/lib/msun/src/e_log2f.c Mon Oct 17 03:35:24 2011 (r226455) +++ stable/8/lib/msun/src/e_log2f.c Mon Oct 17 05:38:07 2011 (r226456) @@ -12,14 +12,18 @@ #include __FBSDID("$FreeBSD$"); +/* + * Return the base 2 logarithm of x. See k_log.c for details on the algorithm. + */ + #include "math.h" #include "math_private.h" #include "k_logf.h" static const float two25 = 3.3554432000e+07, /* 0x4c000000 */ -ivln2hi = 0x1.716p+0f, -ivln2lo = -0x1.7135a8fa03d11p-13; +ivln2hi = 1.4428710938e+00, /* 0x3fb8b000 */ +ivln2lo = -1.7605285393e-04; /* 0xb9389ad4 */ static const float zero = 0.0; @@ -46,7 +50,7 @@ __ieee754_log2f(float x) SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ k += (i>>23); f = __kernel_logf(x); - x = x - 1; + x = x - (float)1.0; GET_FLOAT_WORD(hx,x); SET_FLOAT_WORD(hi,hx&0xfffff000); lo = x - hi; Modified: stable/8/lib/msun/src/k_logf.h ============================================================================== --- stable/8/lib/msun/src/k_logf.h Mon Oct 17 03:35:24 2011 (r226455) +++ stable/8/lib/msun/src/k_logf.h Mon Oct 17 05:38:07 2011 (r226456) @@ -12,8 +12,8 @@ #include __FBSDID("$FreeBSD$"); -/* __kernel_logf(x) - * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. +/* + * float version of __kernel_log(x). See k_log.c for details. */ static const float @@ -33,7 +33,7 @@ __kernel_logf(float x) f = x-(float)1.0; if((0x007fffff&(0x8000+ix))<0xc000) { /* -2**-9 <= f < 2**-9 */ - if(f==0.0) return 0.0; + if(f==0.0f) return 0.0f; return f*f*((float)0.33333333333333333*f-(float)0.5); } s = f/((float)2.0+f); From owner-svn-src-stable@FreeBSD.ORG Mon Oct 17 05:38:22 2011 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 BEB9D1065673; Mon, 17 Oct 2011 05:38:22 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC07D8FC0A; Mon, 17 Oct 2011 05:38:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9H5cM7p096784; Mon, 17 Oct 2011 05:38:22 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9H5cM5U096770; Mon, 17 Oct 2011 05:38:22 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201110170538.p9H5cM5U096770@svn.freebsd.org> From: David Schultz Date: Mon, 17 Oct 2011 05:38:22 +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: r226457 - in stable/7/lib/msun: . man src 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: Mon, 17 Oct 2011 05:38:22 -0000 Author: das Date: Mon Oct 17 05:38:22 2011 New Revision: 226457 URL: http://svn.freebsd.org/changeset/base/226457 Log: Belated MFC of log2 and log2f to 7-STABLE by popular demand, along with other log* improvements. r175461 - log(3) manpage (partial MFC) r216210 - add k_log (used by log*) r216211 - add log2 and log2f r216247 - log2f style r216248 - log2f insignificant bug r219360 - log10 converted to use k_log r219361 - log10f converted to use k_log r226375 - log2/log10 style r226376 - log2/log10 bde's improvements; fix log(1) with FE_DOWNWARD rounding Added: stable/7/lib/msun/man/log.3 - copied, changed from r175461, head/lib/msun/man/log.3 stable/7/lib/msun/src/e_log2.c - copied, changed from r216211, head/lib/msun/src/e_log2.c stable/7/lib/msun/src/e_log2f.c - copied, changed from r216211, head/lib/msun/src/e_log2f.c stable/7/lib/msun/src/k_log.h - copied, changed from r216210, head/lib/msun/src/k_log.h stable/7/lib/msun/src/k_logf.h - copied, changed from r216210, head/lib/msun/src/k_logf.h Modified: stable/7/lib/msun/Makefile stable/7/lib/msun/Symbol.map stable/7/lib/msun/man/exp.3 stable/7/lib/msun/man/math.3 stable/7/lib/msun/src/e_log10.c stable/7/lib/msun/src/e_log10f.c stable/7/lib/msun/src/math.h stable/7/lib/msun/src/math_private.h Directory Properties: stable/7/lib/msun/ (props changed) Modified: stable/7/lib/msun/Makefile ============================================================================== --- stable/7/lib/msun/Makefile Mon Oct 17 05:38:07 2011 (r226456) +++ stable/7/lib/msun/Makefile Mon Oct 17 05:38:22 2011 (r226457) @@ -33,7 +33,8 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c e_expf.c e_fmod.c e_fmodf.c e_gamma.c e_gamma_r.c e_gammaf.c \ e_gammaf_r.c e_hypot.c e_hypotf.c e_j0.c e_j0f.c e_j1.c e_j1f.c \ e_jn.c e_jnf.c e_lgamma.c e_lgamma_r.c e_lgammaf.c e_lgammaf_r.c \ - e_log.c e_log10.c e_log10f.c e_logf.c e_pow.c e_powf.c e_rem_pio2.c \ + e_log.c e_log10.c e_log10f.c e_log2.c e_log2f.c e_logf.c \ + e_pow.c e_powf.c e_rem_pio2.c \ e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \ e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c fenv.c \ k_cos.c k_cosf.c k_rem_pio2.c k_sin.c k_sinf.c \ @@ -97,7 +98,7 @@ MAN= acos.3 acosh.3 asin.3 asinh.3 atan. feclearexcept.3 feenableexcept.3 fegetenv.3 \ fegetround.3 fenv.3 floor.3 \ fma.3 fmax.3 fmod.3 hypot.3 ieee.3 ieee_test.3 ilogb.3 j0.3 \ - lgamma.3 lrint.3 lround.3 math.3 nextafter.3 remainder.3 rint.3 \ + lgamma.3 log.3 lrint.3 lround.3 math.3 nextafter.3 remainder.3 rint.3 \ round.3 scalbn.3 signbit.3 sin.3 sinh.3 sqrt.3 tan.3 tanh.3 trunc.3 MLINKS+=acos.3 acosf.3 @@ -115,7 +116,7 @@ MLINKS+=copysign.3 copysignf.3 copysign. MLINKS+=cos.3 cosf.3 MLINKS+=cosh.3 coshf.3 MLINKS+=erf.3 erfc.3 erf.3 erff.3 erf.3 erfcf.3 -MLINKS+=exp.3 expm1.3 exp.3 log.3 exp.3 log10.3 exp.3 log1p.3 exp.3 pow.3 \ +MLINKS+=exp.3 expm1.3 exp.3 log10.3 exp.3 log1p.3 exp.3 pow.3 \ exp.3 exp2.3 exp.3 exp2f.3 exp.3 expf.3 \ exp.3 expm1f.3 exp.3 logf.3 exp.3 powf.3 \ exp.3 log10f.3 exp.3 log1pf.3 @@ -140,6 +141,7 @@ MLINKS+=ilogb.3 ilogbf.3 ilogb.3 ilogbl. MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 y1f.3 j0.3 yn.3 MLINKS+=j0.3 j0f.3 j0.3 j1f.3 j0.3 jnf.3 j0.3 y0f.3 j0.3 ynf.3 MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 lgammaf.3 lgamma.3 tgamma.3 +MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log1p.3 log.3 log1pf.3 log.3 logf.3 log.3 log2.3 log.3 log2f.3 MLINKS+=lrint.3 llrint.3 lrint.3 llrintf.3 lrint.3 lrintf.3 MLINKS+=lround.3 llround.3 lround.3 llroundf.3 lround.3 llroundl.3 \ lround.3 lroundf.3 lround.3 lroundl.3 Modified: stable/7/lib/msun/Symbol.map ============================================================================== --- stable/7/lib/msun/Symbol.map Mon Oct 17 05:38:07 2011 (r226456) +++ stable/7/lib/msun/Symbol.map Mon Oct 17 05:38:22 2011 (r226457) @@ -181,3 +181,9 @@ FBSD_1.0 { drem; dremf; }; + +/* First added in 9.0-CURRENT */ +FBSD_1.2 { + log2; + log2f; +}; Modified: stable/7/lib/msun/man/exp.3 ============================================================================== --- stable/7/lib/msun/man/exp.3 Mon Oct 17 05:38:07 2011 (r226456) +++ stable/7/lib/msun/man/exp.3 Mon Oct 17 05:38:22 2011 (r226457) @@ -28,7 +28,7 @@ .\" from: @(#)exp.3 6.12 (Berkeley) 7/31/91 .\" $FreeBSD$ .\" -.Dd April 5, 2005 +.Dd January 17, 2008 .Dt EXP 3 .Os .Sh NAME @@ -39,15 +39,9 @@ .Nm exp2f , .Nm expm1 , .Nm expm1f , -.Nm log , -.Nm logf , -.Nm log10 , -.Nm log10f , -.Nm log1p , -.Nm log1pf , .Nm pow , .Nm powf -.Nd exponential, logarithm, power functions +.Nd exponential and power functions .Sh LIBRARY .Lb libm .Sh SYNOPSIS @@ -65,18 +59,6 @@ .Ft float .Fn expm1f "float x" .Ft double -.Fn log "double x" -.Ft float -.Fn logf "float x" -.Ft double -.Fn log10 "double x" -.Ft float -.Fn log10f "float x" -.Ft double -.Fn log1p "double x" -.Ft float -.Fn log1pf "float x" -.Ft double .Fn pow "double x" "double y" .Ft float .Fn powf "float x" "float y" @@ -92,7 +74,7 @@ exponential value of the given argument .Pp The .Fn exp2 -and the +and .Fn exp2f functions compute the base 2 exponential of the given argument .Fa x . @@ -105,29 +87,6 @@ functions compute the value exp(x)\-1 ac .Fa x . .Pp The -.Fn log -and the -.Fn logf -functions compute the value of the natural logarithm of argument -.Fa x . -.Pp -The -.Fn log10 -and the -.Fn log10f -functions compute the value of the logarithm of argument -.Fa x -to base 10. -.Pp -The -.Fn log1p -and the -.Fn log1pf -functions compute -the value of log(1+x) accurately even for tiny argument -.Fa x . -.Pp -The .Fn pow and the .Fn powf @@ -159,30 +118,7 @@ raise an invalid exception and return an < 0 and .Fa y is not an integer. -An attempt to take the logarithm of \*(Pm0 will result in -a divide-by-zero exception, and an infinity will be returned. -An attempt to take the logarithm of a negative number will -result in an invalid exception, and an \*(Na will be generated. .Sh NOTES -The functions exp(x)\-1 and log(1+x) are called -expm1 and logp1 in -.Tn BASIC -on the Hewlett\-Packard -.Tn HP Ns \-71B -and -.Tn APPLE -Macintosh, -.Tn EXP1 -and -.Tn LN1 -in Pascal, exp1 and log1 in C -on -.Tn APPLE -Macintoshes, where they have been provided to make -sure financial calculations of ((1+x)**n\-1)/x, namely -expm1(n\(**log1p(x))/x, will be accurate when x is tiny. -They also provide accurate inverse hyperbolic functions. -.Pp The function .Fn pow x 0 returns x**0 = 1 for all x including x = 0, \*(If, and \*(Na . @@ -229,4 +165,9 @@ and infinite x, i.e., independently of x .El .Sh SEE ALSO .Xr fenv 3 , +.Xr ldexp 3 , +.Xr log 3 , .Xr math 3 +.Sh STANDARDS +These functions conform to +.St -isoC-99 . Copied and modified: stable/7/lib/msun/man/log.3 (from r175461, head/lib/msun/man/log.3) ============================================================================== --- head/lib/msun/man/log.3 Fri Jan 18 21:43:00 2008 (r175461, copy source) +++ stable/7/lib/msun/man/log.3 Mon Oct 17 05:38:22 2011 (r226457) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2008 David Schultz +.\" Copyright (c) 2008-2010 David Schultz .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,15 +24,16 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2008 +.Dd December 5, 2010 .Dt LOG 3 .Os .Sh NAME .Nm log , .Nm logf , -.Nm logl , .Nm log10 , .Nm log10f , +.Nm log2 , +.Nm log2f , .Nm log1p , .Nm log1pf .Nd logarithm functions @@ -49,6 +50,10 @@ .Ft float .Fn log10f "float x" .Ft double +.Fn log2 "double x" +.Ft float +.Fn log2f "float x" +.Ft double .Fn log1p "double x" .Ft float .Fn log1pf "float x" @@ -65,6 +70,12 @@ The and .Fn log10f functions compute the logarithm base 10 of +.Fa x , +while +.Fn log2 +and +.Fn log2f +compute the logarithm base 2 of .Fa x . .Pp The @@ -97,6 +108,8 @@ The .Fn logf , .Fn log10 , .Fn log10f , +.Fn log2 , +.Fn log2f , .Fn log1p , and .Fn log1pf Modified: stable/7/lib/msun/man/math.3 ============================================================================== --- stable/7/lib/msun/man/math.3 Mon Oct 17 05:38:07 2011 (r226456) +++ stable/7/lib/msun/man/math.3 Mon Oct 17 05:38:22 2011 (r226457) @@ -28,7 +28,7 @@ .\" from: @(#)math.3 6.10 (Berkeley) 5/6/91 .\" $FreeBSD$ .\" -.Dd November 6, 2005 +.Dd December 5, 2010 .Dt MATH 3 .Os .if n \{\ @@ -180,7 +180,7 @@ lgamma log gamma function log natural logarithm log10 logarithm to base 10 log1p log(1+x) -.\" log2 base 2 logarithm +log2 base 2 logarithm pow exponential x**y sin trigonometric function sinh hyperbolic function @@ -192,8 +192,8 @@ y1 Bessel function of the second kind of yn Bessel function of the second kind of the order n .El .Pp -Unlike the algebraic functions listed earlier, the routines -in this section may not produce a result that is correctly rounded, +The routines +in this section might not produce a result that is correctly rounded, so reproducible results cannot be guaranteed across platforms. For most of these functions, however, incorrect rounding occurs rarely, and then only in very-close-to-halfway cases. @@ -218,20 +218,18 @@ and values, were written for or imported into subsequent versions of FreeBSD. .Sh BUGS The -.Fn log2 -and .Fn nan -functions are missing, and many functions are not available in their +function is missing, and many functions are not available in their .Vt "long double" variants. .Pp Many of the routines to compute transcendental functions produce inaccurate results in other than the default rounding mode. .Pp -On some architectures, trigonometric argument reduction is not -performed accurately, resulting in errors greater than 1 -.Em ulp -for large arguments to +On the i386 platform, trigonometric argument reduction is not +performed accurately for huge arguments, resulting in +large errors +for such arguments to .Fn cos , .Fn sin , and Modified: stable/7/lib/msun/src/e_log10.c ============================================================================== --- stable/7/lib/msun/src/e_log10.c Mon Oct 17 05:38:07 2011 (r226456) +++ stable/7/lib/msun/src/e_log10.c Mon Oct 17 05:38:22 2011 (r226457) @@ -15,45 +15,22 @@ static char rcsid[] = "$FreeBSD$"; #endif -/* __ieee754_log10(x) - * Return the base 10 logarithm of x - * - * Method : - * Let log10_2hi = leading 40 bits of log10(2) and - * log10_2lo = log10(2) - log10_2hi, - * ivln10 = 1/log(10) rounded. - * Then - * n = ilogb(x), - * if(n<0) n = n+1; - * x = scalbn(x,-n); - * log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x)) +/* + * Return the base 10 logarithm of x. See e_log.c and k_log.h for most + * comments. * - * Note 1: - * To guarantee log10(10**n)=n, where 10**n is normal, the rounding - * mode must set to Round-to-Nearest. - * Note 2: - * [1/log(10)] rounded to 53 bits has error .198 ulps; - * log10 is monotonic at all binary break points. - * - * Special cases: - * log10(x) is NaN with signal if x < 0; - * log10(+INF) is +INF with no signal; log10(0) is -INF with signal; - * log10(NaN) is that NaN with no signal; - * log10(10**N) = N for N=0,1,...,22. - * - * Constants: - * The hexadecimal values are the intended ones for the following constants. - * The decimal values may be used, provided that the compiler will convert - * from decimal to binary accurately enough to produce the hexadecimal values - * shown. + * log10(x) = (f - 0.5*f*f + k_log1p(f)) / ln10 + k * log10(2) + * in not-quite-routine extra precision. */ #include "math.h" #include "math_private.h" +#include "k_log.h" static const double two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */ +ivln10hi = 4.34294481878168880939e-01, /* 0x3fdbcb7b, 0x15200000 */ +ivln10lo = 2.50829467116452752298e-11, /* 0x3dbb9438, 0xca9aadd5 */ log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */ log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */ @@ -62,26 +39,50 @@ static const double zero = 0.0; double __ieee754_log10(double x) { - double y,z; + double f,hfsq,hi,lo,r,val_hi,val_lo,w,y,y2; int32_t i,k,hx; u_int32_t lx; EXTRACT_WORDS(hx,lx,x); - k=0; - if (hx < 0x00100000) { /* x < 2**-1022 */ - if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ - if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 54; x *= two54; /* subnormal number, scale up x */ + k=0; + if (hx < 0x00100000) { /* x < 2**-1022 */ + if (((hx&0x7fffffff)|lx)==0) + return -two54/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); - } + } if (hx >= 0x7ff00000) return x+x; + if (hx == 0x3ff00000 && lx == 0) + return zero; /* log(1) = +0 */ k += (hx>>20)-1023; - i = ((u_int32_t)k&0x80000000)>>31; - hx = (hx&0x000fffff)|((0x3ff-i)<<20); - y = (double)(k+i); - SET_HIGH_WORD(x,hx); - z = y*log10_2lo + ivln10*__ieee754_log(x); - return z+y*log10_2hi; + hx &= 0x000fffff; + i = (hx+0x95f64)&0x100000; + SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */ + k += (i>>20); + y = (double)k; + f = x - 1.0; + hfsq = 0.5*f*f; + r = k_log1p(f); + + /* See e_log2.c for most details. */ + hi = f - hfsq; + SET_LOW_WORD(hi,0); + lo = (f - hi) - hfsq + r; + val_hi = hi*ivln10hi; + y2 = y*log10_2hi; + val_lo = y*log10_2lo + (lo+hi)*ivln10lo + lo*ivln10hi; + + /* + * Extra precision in for adding y*log10_2hi is not strictly needed + * since there is no very large cancellation near x = sqrt(2) or + * x = 1/sqrt(2), but we do it anyway since it costs little on CPUs + * with some parallelism and it reduces the error for many args. + */ + w = y2 + val_hi; + val_lo += (y2 - w) + val_hi; + val_hi = w; + + return val_lo + val_hi; } Modified: stable/7/lib/msun/src/e_log10f.c ============================================================================== --- stable/7/lib/msun/src/e_log10f.c Mon Oct 17 05:38:07 2011 (r226456) +++ stable/7/lib/msun/src/e_log10f.c Mon Oct 17 05:38:22 2011 (r226457) @@ -1,7 +1,3 @@ -/* e_log10f.c -- float version of e_log10.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -17,12 +13,18 @@ static char rcsid[] = "$FreeBSD$"; #endif +/* + * Float version of e_log10.c. See the latter for most comments. + */ + #include "math.h" #include "math_private.h" +#include "k_logf.h" static const float two25 = 3.3554432000e+07, /* 0x4c000000 */ -ivln10 = 4.3429449201e-01, /* 0x3ede5bd9 */ +ivln10hi = 4.3432617188e-01, /* 0x3ede6000 */ +ivln10lo = -3.1689971365e-05, /* 0xb804ead9 */ log10_2hi = 3.0102920532e-01, /* 0x3e9a2080 */ log10_2lo = 7.9034151668e-07; /* 0x355427db */ @@ -31,25 +33,40 @@ static const float zero = 0.0; float __ieee754_log10f(float x) { - float y,z; + float f,hfsq,hi,lo,r,y,y2; int32_t i,k,hx; GET_FLOAT_WORD(hx,x); - k=0; - if (hx < 0x00800000) { /* x < 2**-126 */ - if ((hx&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ - if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 25; x *= two25; /* subnormal number, scale up x */ + k=0; + if (hx < 0x00800000) { /* x < 2**-126 */ + if ((hx&0x7fffffff)==0) + return -two25/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(hx,x); - } + } if (hx >= 0x7f800000) return x+x; + if (hx == 0x3f800000) + return zero; /* log(1) = +0 */ k += (hx>>23)-127; - i = ((u_int32_t)k&0x80000000)>>31; - hx = (hx&0x007fffff)|((0x7f-i)<<23); - y = (float)(k+i); - SET_FLOAT_WORD(x,hx); - z = y*log10_2lo + ivln10*__ieee754_logf(x); - return z+y*log10_2hi; + hx &= 0x007fffff; + i = (hx+(0x4afb0d))&0x800000; + SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ + k += (i>>23); + y = (float)k; + f = x - (float)1.0; + hfsq = (float)0.5*f*f; + r = k_log1pf(f); + + /* See e_log2f.c and e_log2.c for details. */ + if (sizeof(float_t) > sizeof(float)) + return (r - hfsq + f) * ((float_t)ivln10lo + ivln10hi) + + y * ((float_t)log10_2lo + log10_2hi); + hi = f - hfsq; + GET_FLOAT_WORD(hx,hi); + SET_FLOAT_WORD(hi,hx&0xfffff000); + lo = (f - hi) - hfsq + r; + return y*log10_2lo + (lo+hi)*ivln10lo + lo*ivln10hi + hi*ivln10hi + + y*log10_2hi; } Copied and modified: stable/7/lib/msun/src/e_log2.c (from r216211, head/lib/msun/src/e_log2.c) ============================================================================== --- head/lib/msun/src/e_log2.c Sun Dec 5 22:11:22 2010 (r216211, copy source) +++ stable/7/lib/msun/src/e_log2.c Mon Oct 17 05:38:22 2011 (r226457) @@ -14,8 +14,14 @@ #include __FBSDID("$FreeBSD$"); -/* log2(x) - * Return the base 2 logarithm of x. +/* + * Return the base 2 logarithm of x. See e_log.c and k_log.h for most + * comments. + * + * This reduces x to {k, 1+f} exactly as in e_log.c, then calls the kernel, + * then does the combining and scaling steps + * log2(x) = (f - 0.5*f*f + k_log1p(f)) / ln2 + k + * in not-quite-routine extra precision. */ #include "math.h" @@ -24,37 +30,81 @@ __FBSDID("$FreeBSD$"); static const double two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -ivln2hi = 0x1.71547652000p+0, -ivln2lo = 0x1.705fc2eefa2p-33; +ivln2hi = 1.44269504072144627571e+00, /* 0x3ff71547, 0x65200000 */ +ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ static const double zero = 0.0; double __ieee754_log2(double x) { - double f,hi,lo; + double f,hfsq,hi,lo,r,val_hi,val_lo,w,y; int32_t i,k,hx; u_int32_t lx; EXTRACT_WORDS(hx,lx,x); - k=0; - if (hx < 0x00100000) { /* x < 2**-1022 */ - if (((hx&0x7fffffff)|lx)==0) - return -two54/zero; /* log(+-0)=-inf */ - if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 54; x *= two54; /* subnormal number, scale up x */ + k=0; + if (hx < 0x00100000) { /* x < 2**-1022 */ + if (((hx&0x7fffffff)|lx)==0) + return -two54/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); - } + } if (hx >= 0x7ff00000) return x+x; + if (hx == 0x3ff00000 && lx == 0) + return zero; /* log(1) = +0 */ k += (hx>>20)-1023; hx &= 0x000fffff; i = (hx+0x95f64)&0x100000; SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */ k += (i>>20); - f = __kernel_log(x); - hi = x = x - 1; + y = (double)k; + f = x - 1.0; + hfsq = 0.5*f*f; + r = k_log1p(f); + + /* + * f-hfsq must (for args near 1) be evaluated in extra precision + * to avoid a large cancellation when x is near sqrt(2) or 1/sqrt(2). + * This is fairly efficient since f-hfsq only depends on f, so can + * be evaluated in parallel with R. Not combining hfsq with R also + * keeps R small (though not as small as a true `lo' term would be), + * so that extra precision is not needed for terms involving R. + * + * Compiler bugs involving extra precision used to break Dekker's + * theorem for spitting f-hfsq as hi+lo, unless double_t was used + * or the multi-precision calculations were avoided when double_t + * has extra precision. These problems are now automatically + * avoided as a side effect of the optimization of combining the + * Dekker splitting step with the clear-low-bits step. + * + * y must (for args near sqrt(2) and 1/sqrt(2)) be added in extra + * precision to avoid a very large cancellation when x is very near + * these values. Unlike the above cancellations, this problem is + * specific to base 2. It is strange that adding +-1 is so much + * harder than adding +-ln2 or +-log10_2. + * + * This uses Dekker's theorem to normalize y+val_hi, so the + * compiler bugs are back in some configurations, sigh. And I + * don't want to used double_t to avoid them, since that gives a + * pessimization and the support for avoiding the pessimization + * is not yet available. + * + * The multi-precision calculations for the multiplications are + * routine. + */ + hi = f - hfsq; SET_LOW_WORD(hi,0); - lo = x - hi; - return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; + lo = (f - hi) - hfsq + r; + val_hi = hi*ivln2hi; + val_lo = (lo+hi)*ivln2lo + lo*ivln2hi; + + /* spadd(val_hi, val_lo, y), except for not using double_t: */ + w = y + val_hi; + val_lo += (y - w) + val_hi; + val_hi = w; + + return val_lo + val_hi; } Copied and modified: stable/7/lib/msun/src/e_log2f.c (from r216211, head/lib/msun/src/e_log2f.c) ============================================================================== --- head/lib/msun/src/e_log2f.c Sun Dec 5 22:11:22 2010 (r216211, copy source) +++ stable/7/lib/msun/src/e_log2f.c Mon Oct 17 05:38:22 2011 (r226457) @@ -12,43 +12,70 @@ #include __FBSDID("$FreeBSD$"); +/* + * Float version of e_log2.c. See the latter for most comments. + */ + #include "math.h" #include "math_private.h" #include "k_logf.h" static const float two25 = 3.3554432000e+07, /* 0x4c000000 */ -ivln2hi = 0x1.716p+0f, -ivln2lo = -0x1.7135a8fa03d11p-13; +ivln2hi = 1.4428710938e+00, /* 0x3fb8b000 */ +ivln2lo = -1.7605285393e-04; /* 0xb9389ad4 */ static const float zero = 0.0; float __ieee754_log2f(float x) { - float f,hi,lo; + float f,hfsq,hi,lo,r,y; int32_t i,k,hx; GET_FLOAT_WORD(hx,x); - k=0; - if (hx < 0x00800000) { /* x < 2**-126 */ - if ((hx&0x7fffffff)==0) - return -two25/zero; /* log(+-0)=-inf */ - if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ - k -= 25; x *= two25; /* subnormal number, scale up x */ + k=0; + if (hx < 0x00800000) { /* x < 2**-126 */ + if ((hx&0x7fffffff)==0) + return -two25/zero; /* log(+-0)=-inf */ + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ + k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(hx,x); - } + } if (hx >= 0x7f800000) return x+x; + if (hx == 0x3f800000) + return zero; /* log(1) = +0 */ k += (hx>>23)-127; hx &= 0x007fffff; i = (hx+(0x4afb0d))&0x800000; SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ k += (i>>23); - f = __kernel_logf(x); - x = x - 1; - GET_FLOAT_WORD(hx,x); + y = (float)k; + f = x - (float)1.0; + hfsq = (float)0.5*f*f; + r = k_log1pf(f); + + /* + * We no longer need to avoid falling into the multi-precision + * calculations due to compiler bugs breaking Dekker's theorem. + * Keep avoiding this as an optimization. See e_log2.c for more + * details (some details are here only because the optimization + * is not yet available in double precision). + * + * Another compiler bug turned up. With gcc on i386, + * (ivln2lo + ivln2hi) would be evaluated in float precision + * despite runtime evaluations using double precision. So we + * must cast one of its terms to float_t. This makes the whole + * expression have type float_t, so return is forced to waste + * time clobbering its extra precision. + */ + if (sizeof(float_t) > sizeof(float)) + return (r - hfsq + f) * ((float_t)ivln2lo + ivln2hi) + y; + + hi = f - hfsq; + GET_FLOAT_WORD(hx,hi); SET_FLOAT_WORD(hi,hx&0xfffff000); - lo = x - hi; - return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; + lo = (f - hi) - hfsq + r; + return (lo+hi)*ivln2lo + lo*ivln2hi + hi*ivln2hi + y; } Copied and modified: stable/7/lib/msun/src/k_log.h (from r216210, head/lib/msun/src/k_log.h) ============================================================================== --- head/lib/msun/src/k_log.h Sun Dec 5 22:11:03 2010 (r216210, copy source) +++ stable/7/lib/msun/src/k_log.h Mon Oct 17 05:38:22 2011 (r226457) @@ -14,8 +14,9 @@ #include __FBSDID("$FreeBSD$"); -/* __kernel_log(x) - * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. +/* + * k_log1p(f): + * Return log(1+f) - f for 1+f in ~[sqrt(2)/2, sqrt(2)]. * * The following describes the overall strategy for computing * logarithms in base e. The argument reduction and adding the final @@ -80,37 +81,20 @@ Lg6 = 1.531383769920937332e-01, /* 3FC3 Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ /* - * We always inline __kernel_log(), since doing so produces a + * We always inline k_log1p(), since doing so produces a * substantial performance improvement (~40% on amd64). */ static inline double -__kernel_log(double x) +k_log1p(double f) { - double hfsq,f,s,z,R,w,t1,t2; - int32_t hx,i,j; - u_int32_t lx; - - EXTRACT_WORDS(hx,lx,x); + double hfsq,s,z,R,w,t1,t2; - f = x-1.0; - if((0x000fffff&(2+hx))<3) { /* -2**-20 <= f < 2**-20 */ - if(f==0.0) return 0.0; - return f*f*(0.33333333333333333*f-0.5); - } - s = f/(2.0+f); + s = f/(2.0+f); z = s*s; - hx &= 0x000fffff; - i = hx-0x6147a; w = z*z; - j = 0x6b851-hx; - t1= w*(Lg2+w*(Lg4+w*Lg6)); - t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); - i |= j; + t1= w*(Lg2+w*(Lg4+w*Lg6)); + t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); R = t2+t1; - if (i>0) { - hfsq=0.5*f*f; - return s*(hfsq+R) - hfsq; - } else { - return s*(R-f); - } + hfsq=0.5*f*f; + return s*(hfsq+R); } Copied and modified: stable/7/lib/msun/src/k_logf.h (from r216210, head/lib/msun/src/k_logf.h) ============================================================================== --- head/lib/msun/src/k_logf.h Sun Dec 5 22:11:03 2010 (r216210, copy source) +++ stable/7/lib/msun/src/k_logf.h Mon Oct 17 05:38:22 2011 (r226457) @@ -12,8 +12,8 @@ #include __FBSDID("$FreeBSD$"); -/* __kernel_logf(x) - * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. +/* + * Float version of k_log.h. See the latter for most comments. */ static const float @@ -24,32 +24,16 @@ Lg3 = 0x91e9ee.0p-25, /* 0.28498786 Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ static inline float -__kernel_logf(float x) +k_log1pf(float f) { - float hfsq,f,s,z,R,w,t1,t2; - int32_t ix,i,j; + float hfsq,s,z,R,w,t1,t2; - GET_FLOAT_WORD(ix,x); - - f = x-(float)1.0; - if((0x007fffff&(0x8000+ix))<0xc000) { /* -2**-9 <= f < 2**-9 */ - if(f==0.0) return 0.0; - return f*f*((float)0.33333333333333333*f-(float)0.5); - } s = f/((float)2.0+f); z = s*s; - ix &= 0x007fffff; - i = ix-(0x6147a<<3); w = z*z; - j = (0x6b851<<3)-ix; t1= w*(Lg2+w*Lg4); t2= z*(Lg1+w*Lg3); - i |= j; R = t2+t1; - if(i>0) { - hfsq=(float)0.5*f*f; - return s*(hfsq+R) - hfsq; - } else { - return s*(R-f); - } + hfsq=(float)0.5*f*f; + return s*(hfsq+R); } Modified: stable/7/lib/msun/src/math.h ============================================================================== --- stable/7/lib/msun/src/math.h Mon Oct 17 05:38:07 2011 (r226456) +++ stable/7/lib/msun/src/math.h Mon Oct 17 05:38:22 2011 (r226457) @@ -235,6 +235,7 @@ double lgamma(double); long long llrint(double); long long llround(double); double log1p(double); +double log2(double); double logb(double); long lrint(double); long lround(double); @@ -314,6 +315,7 @@ int ilogbf(float) __pure2; float ldexpf(float, int); float log10f(float); float log1pf(float); +float log2f(float); float logf(float); float modff(float, float *); /* fundamentally !__pure2 */ Modified: stable/7/lib/msun/src/math_private.h ============================================================================== --- stable/7/lib/msun/src/math_private.h Mon Oct 17 05:38:07 2011 (r226456) +++ stable/7/lib/msun/src/math_private.h Mon Oct 17 05:38:22 2011 (r226457) @@ -206,6 +206,7 @@ cpackl(long double x, long double y) #define __ieee754_acos acos #define __ieee754_acosh acosh #define __ieee754_log log +#define __ieee754_log2 log2 #define __ieee754_atanh atanh #define __ieee754_asin asin #define __ieee754_atan2 atan2 @@ -244,6 +245,7 @@ cpackl(long double x, long double y) #define __ieee754_lgammaf_r lgammaf_r #define __ieee754_gammaf_r gammaf_r #define __ieee754_log10f log10f +#define __ieee754_log2f log2f #define __ieee754_sinhf sinhf #define __ieee754_hypotf hypotf #define __ieee754_j0f j0f From owner-svn-src-stable@FreeBSD.ORG Mon Oct 17 14:48:12 2011 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 109CE106566B; Mon, 17 Oct 2011 14:48:12 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailA.acsu.buffalo.edu (localmaila.acsu.buffalo.edu [128.205.5.196]) by mx1.freebsd.org (Postfix) with ESMTP id CE9E78FC17; Mon, 17 Oct 2011 14:48:11 +0000 (UTC) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 28493F911; Mon, 17 Oct 2011 10:40:15 -0400 (EDT) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailA.acsu.buffalo.edu (Postfix) with ESMTP id 6DA3BF8EF; Mon, 17 Oct 2011 10:40:14 -0400 (EDT) Received: from smtp4.acsu.buffalo.edu (smtp4.acsu.buffalo.edu [128.205.5.229]) by localmailA.acsu.buffalo.edu (Prefixe) with ESMTP id 634DBF2DE; Mon, 17 Oct 2011 10:40:14 -0400 (EDT) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) (Authenticated sender: kensmith@buffalo.edu) by smtp4.acsu.buffalo.edu (Postfix) with ESMTPSA id 381DA4584E; Mon, 17 Oct 2011 10:40:14 -0400 (EDT) From: Ken Smith To: Adrian Chadd In-Reply-To: References: <201110152123.p9FLN5Ht031202@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-wIC/k1ayJsLMkn1msOta" Date: Mon, 17 Oct 2011 10:40:13 -0400 Message-ID: <1318862413.55691.12.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r226405 - in stable/9: . etc/defaults lib/libc/stdlib sys/amd64/conf sys/i386/conf sys/ia64/conf sys/pc98/conf sys/powerpc/conf sys/sparc64/conf 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: Mon, 17 Oct 2011 14:48:12 -0000 --=-wIC/k1ayJsLMkn1msOta Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Sun, 2011-10-16 at 09:24 +0800, Adrian Chadd wrote: > Hi! >=20 > Would you consider leaving these in but just commenting them out? >=20 > That way if a user hits a deadlock or memory corruption issue, we can > just say "uncomment the section marked _debugging_ in your config > file." >=20 > Thanks, I'm not completely against it. My *slight* hesitation in doing it would be that from my experience these knobs aren't a one-size-fits-all thing for people trying to debug stuff in production. So you sorta need to know a bit more about what you're doing when fiddling with them. Turning them all on is probably OK for a workstation user but less likely to be OK for a server admin. Some may want/need to add in KDB_UNATTENDED depending on their circumstances, etc. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-wIC/k1ayJsLMkn1msOta Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk6cPkMACgkQ/G14VSmup/ZfTgCgkHNoPAY2pbKhsVOsJ+pVYab6 0TsAn19tx0AJv/BaeIEGptFGzmg7UzsK =1jvF -----END PGP SIGNATURE----- --=-wIC/k1ayJsLMkn1msOta-- From owner-svn-src-stable@FreeBSD.ORG Tue Oct 18 01:56:43 2011 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 8F5BA106564A; Tue, 18 Oct 2011 01:56:43 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EACE8FC08; Tue, 18 Oct 2011 01:56:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9I1uhJn050892; Tue, 18 Oct 2011 01:56:43 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9I1uhYc050890; Tue, 18 Oct 2011 01:56:43 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201110180156.p9I1uhYc050890@svn.freebsd.org> From: Qing Li Date: Tue, 18 Oct 2011 01:56: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: r226485 - stable/8/sys/netinet6 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: Tue, 18 Oct 2011 01:56:43 -0000 Author: qingli Date: Tue Oct 18 01:56:43 2011 New Revision: 226485 URL: http://svn.freebsd.org/changeset/base/226485 Log: MFC 226453 The code change made in r226040 was incomplete and resulted in routes such as fe80::1%lo0 no being installed. This patch completes the original intended fix. Reviewed by: hrs, bz Modified: stable/8/sys/netinet6/in6.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) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Mon Oct 17 23:36:29 2011 (r226484) +++ stable/8/sys/netinet6/in6.c Tue Oct 18 01:56:43 2011 (r226485) @@ -1777,14 +1777,17 @@ in6_ifinit(struct ifnet *ifp, struct in6 if (error != 0) return (error); ia->ia_flags |= IFA_ROUTE; + /* + * Handle the case for ::1 . + */ + if (ifp->if_flags & IFF_LOOPBACK) + ia->ia_flags |= IFA_RTSELF; } /* * add a loopback route to self */ - if (!(ia->ia_flags & IFA_RTSELF) - && (V_nd6_useloopback - && !(ifp->if_flags & IFF_LOOPBACK))) { + if (!(ia->ia_flags & IFA_RTSELF) && V_nd6_useloopback) { error = ifa_add_loopback_route((struct ifaddr *)ia, (struct sockaddr *)&ia->ia_addr); if (error == 0) From owner-svn-src-stable@FreeBSD.ORG Tue Oct 18 13:48:32 2011 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 585511065675; Tue, 18 Oct 2011 13:48:32 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 474898FC13; Tue, 18 Oct 2011 13:48:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9IDmWHQ076156; Tue, 18 Oct 2011 13:48:32 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9IDmWii076154; Tue, 18 Oct 2011 13:48:32 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201110181348.p9IDmWii076154@svn.freebsd.org> From: Ken Smith Date: Tue, 18 Oct 2011 13:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226511 - stable/9/usr.sbin/bsdinstall/scripts 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: Tue, 18 Oct 2011 13:48:32 -0000 Author: kensmith Date: Tue Oct 18 13:48:31 2011 New Revision: 226511 URL: http://svn.freebsd.org/changeset/base/226511 Log: MFC r226507: > Escape the newline so we get a proper line continuation. Without this > the text of the menu selections doesn't get displayed properly and it > makes the installer appear to lock up for no obvious reason. > > Reviewed by: nwhitehorn Insta-MFC being done because 9.0-RC1 builds are being held for this. Approved by: re (kib, bz) Modified: stable/9/usr.sbin/bsdinstall/scripts/auto Directory Properties: stable/9/usr.sbin/bsdinstall/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/9/usr.sbin/bsdinstall/scripts/auto Tue Oct 18 13:45:16 2011 (r226510) +++ stable/9/usr.sbin/bsdinstall/scripts/auto Tue Oct 18 13:48:31 2011 (r226511) @@ -158,7 +158,7 @@ finalconfig() { REVISIT=$(dialog --backtitle "FreeBSD Installer" \ --title "Final Configuration" --no-cancel --menu \ "Setup of your FreeBSD system is nearly complete. You can now modify your configuration choices or apply more complex changes using a shell." 0 0 0 \ - "Exit" "Apply configuration and exit installer" + "Exit" "Apply configuration and exit installer" \ "Add User" "Add a user to the system" \ "Root Password" "Change root password" \ "Hostname" "Set system hostname" \ From owner-svn-src-stable@FreeBSD.ORG Wed Oct 19 11:48:21 2011 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 A659A106568C; Wed, 19 Oct 2011 11:48:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 945278FC15; Wed, 19 Oct 2011 11:48:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9JBmLku023171; Wed, 19 Oct 2011 11:48:21 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9JBmL1j023161; Wed, 19 Oct 2011 11:48:21 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201110191148.p9JBmL1j023161@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 19 Oct 2011 11:48:21 +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: r226538 - stable/8/lib/libfetch 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: Wed, 19 Oct 2011 11:48:21 -0000 Author: des Date: Wed Oct 19 11:48:21 2011 New Revision: 226538 URL: http://svn.freebsd.org/changeset/base/226538 Log: MFH r221820-221823,225814,22653: whitespace, warnings, cosmetic nits Modified: stable/8/lib/libfetch/Makefile stable/8/lib/libfetch/common.c stable/8/lib/libfetch/common.h stable/8/lib/libfetch/fetch.3 stable/8/lib/libfetch/fetch.c stable/8/lib/libfetch/fetch.h stable/8/lib/libfetch/file.c stable/8/lib/libfetch/ftp.c stable/8/lib/libfetch/http.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/Makefile ============================================================================== --- stable/8/lib/libfetch/Makefile Wed Oct 19 11:43:51 2011 (r226537) +++ stable/8/lib/libfetch/Makefile Wed Oct 19 11:48:21 2011 (r226538) @@ -26,7 +26,6 @@ LDADD= -lmd CFLAGS+= -DFTP_COMBINE_CWDS CSTD?= c99 -WARNS?= 2 SHLIB_MAJOR= 6 Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Wed Oct 19 11:43:51 2011 (r226537) +++ stable/8/lib/libfetch/common.c Wed Oct 19 11:48:21 2011 (r226538) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/lib/libfetch/common.h ============================================================================== --- stable/8/lib/libfetch/common.h Wed Oct 19 11:43:51 2011 (r226537) +++ stable/8/lib/libfetch/common.h Wed Oct 19 11:48:21 2011 (r226538) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/lib/libfetch/fetch.3 ============================================================================== --- stable/8/lib/libfetch/fetch.3 Wed Oct 19 11:43:51 2011 (r226537) +++ stable/8/lib/libfetch/fetch.3 Wed Oct 19 11:48:21 2011 (r226538) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 1998-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: stable/8/lib/libfetch/fetch.c ============================================================================== --- stable/8/lib/libfetch/fetch.c Wed Oct 19 11:43:51 2011 (r226537) +++ stable/8/lib/libfetch/fetch.c Wed Oct 19 11:48:21 2011 (r226538) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/lib/libfetch/fetch.h ============================================================================== --- stable/8/lib/libfetch/fetch.h Wed Oct 19 11:43:51 2011 (r226537) +++ stable/8/lib/libfetch/fetch.h Wed Oct 19 11:48:21 2011 (r226538) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/lib/libfetch/file.c ============================================================================== --- stable/8/lib/libfetch/file.c Wed Oct 19 11:43:51 2011 (r226537) +++ stable/8/lib/libfetch/file.c Wed Oct 19 11:48:21 2011 (r226538) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: stable/8/lib/libfetch/ftp.c ============================================================================== --- stable/8/lib/libfetch/ftp.c Wed Oct 19 11:43:51 2011 (r226537) +++ stable/8/lib/libfetch/ftp.c Wed Oct 19 11:48:21 2011 (r226538) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); * * Major Changelog: * - * Dag-Erling Coïdan Smørgrav + * Dag-Erling Smørgrav * 9 Jun 1998 * * Incorporated into libfetch @@ -127,7 +127,7 @@ unmappedaddr(struct sockaddr_in6 *sin6) !IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) return; sin4 = (struct sockaddr_in *)sin6; - addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; + addr = *(u_int32_t *)(uintptr_t)&sin6->sin6_addr.s6_addr[12]; port = sin6->sin6_port; memset(sin4, 0, sizeof(struct sockaddr_in)); sin4->sin_addr.s_addr = addr; Modified: stable/8/lib/libfetch/http.c ============================================================================== --- stable/8/lib/libfetch/http.c Wed Oct 19 11:43:51 2011 (r226537) +++ stable/8/lib/libfetch/http.c Wed Oct 19 11:48:21 2011 (r226538) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -454,7 +454,7 @@ http_match(const char *str, const char * * Get the next header and return the appropriate symbolic code. We * need to read one line ahead for checking for a continuation line * belonging to the current header (continuation lines start with - * white space). + * white space). * * We get called with a fresh line already in the conn buffer, either * from the previous http_next_header() invocation, or, the first @@ -462,7 +462,7 @@ http_match(const char *str, const char * * * This stops when we encounter an empty line (we dont read beyond the header * area). - * + * * Note that the "headerbuf" is just a place to return the result. Its * contents are not used for the next call. This means that no cleanup * is needed when ie doing another connection, just call the cleanup when @@ -487,7 +487,7 @@ init_http_headerbuf(http_headerbuf_t *bu buf->buflen = 0; } -static void +static void clean_http_headerbuf(http_headerbuf_t *buf) { if (buf->buf) @@ -496,10 +496,10 @@ clean_http_headerbuf(http_headerbuf_t *b } /* Remove whitespace at the end of the buffer */ -static void +static void http_conn_trimright(conn_t *conn) { - while (conn->buflen && + while (conn->buflen && isspace((unsigned char)conn->buf[conn->buflen - 1])) conn->buflen--; conn->buf[conn->buflen] = '\0'; @@ -508,11 +508,11 @@ http_conn_trimright(conn_t *conn) static hdr_t http_next_header(conn_t *conn, http_headerbuf_t *hbuf, const char **p) { - int i, len; + unsigned int i, len; - /* + /* * Have to do the stripping here because of the first line. So - * it's done twice for the subsequent lines. No big deal + * it's done twice for the subsequent lines. No big deal */ http_conn_trimright(conn); if (conn->buflen == 0) @@ -527,19 +527,19 @@ http_next_header(conn_t *conn, http_head strcpy(hbuf->buf, conn->buf); hbuf->buflen = conn->buflen; - /* + /* * Fetch possible continuation lines. Stop at 1st non-continuation - * and leave it in the conn buffer - */ + * and leave it in the conn buffer + */ for (i = 0; i < HTTP_MAX_CONT_LINES; i++) { if (fetch_getln(conn) == -1) return (hdr_syserror); - /* + /* * Note: we carry on the idea from the previous version * that a pure whitespace line is equivalent to an empty * one (so it's not continuation and will be handled when - * we are called next) + * we are called next) */ http_conn_trimright(conn); if (conn->buf[0] != ' ' && conn->buf[0] != "\t"[0]) @@ -555,7 +555,7 @@ http_next_header(conn_t *conn, http_head } strcpy(hbuf->buf + hbuf->buflen, conn->buf); hbuf->buflen += conn->buflen; - } + } /* * We could check for malformed headers but we don't really care. @@ -574,12 +574,12 @@ http_next_header(conn_t *conn, http_head * [Proxy-]Authenticate header parsing */ -/* - * Read doublequote-delimited string into output buffer obuf (allocated +/* + * Read doublequote-delimited string into output buffer obuf (allocated * by caller, whose responsibility it is to ensure that it's big enough) * cp points to the first char after the initial '"' - * Handles \ quoting - * Returns pointer to the first char after the terminating double quote, or + * Handles \ quoting + * Returns pointer to the first char after the terminating double quote, or * NULL for error. */ static const char * @@ -620,7 +620,7 @@ typedef struct { int nc; /* Nonce count */ } http_auth_challenge_t; -static void +static void init_http_auth_challenge(http_auth_challenge_t *b) { b->scheme = HTTPAS_UNKNOWN; @@ -628,18 +628,18 @@ init_http_auth_challenge(http_auth_chall b->stale = b->nc = 0; } -static void +static void clean_http_auth_challenge(http_auth_challenge_t *b) { - if (b->realm) + if (b->realm) free(b->realm); - if (b->qop) + if (b->qop) free(b->qop); - if (b->nonce) + if (b->nonce) free(b->nonce); - if (b->opaque) + if (b->opaque) free(b->opaque); - if (b->algo) + if (b->algo) free(b->algo); init_http_auth_challenge(b); } @@ -652,7 +652,7 @@ typedef struct { int valid; /* We did parse an authenticate header */ } http_auth_challenges_t; -static void +static void init_http_auth_challenges(http_auth_challenges_t *cs) { int i; @@ -661,7 +661,7 @@ init_http_auth_challenges(http_auth_chal cs->count = cs->valid = 0; } -static void +static void clean_http_auth_challenges(http_auth_challenges_t *cs) { int i; @@ -675,19 +675,19 @@ clean_http_auth_challenges(http_auth_cha init_http_auth_challenges(cs); } -/* +/* * Enumeration for lexical elements. Separators will be returned as their own * ascii value */ typedef enum {HTTPHL_WORD=256, HTTPHL_STRING=257, HTTPHL_END=258, HTTPHL_ERROR = 259} http_header_lex_t; -/* +/* * Determine what kind of token comes next and return possible value * in buf, which is supposed to have been allocated big enough by - * caller. Advance input pointer and return element type. + * caller. Advance input pointer and return element type. */ -static int +static int http_header_lex(const char **cpp, char *buf) { size_t l; @@ -716,7 +716,7 @@ http_header_lex(const char **cpp, char * return (HTTPHL_WORD); } -/* +/* * Read challenges from http xxx-authenticate header and accumulate them * in the challenges list structure. * @@ -728,7 +728,7 @@ http_header_lex(const char **cpp, char * * * We support both approaches anyway */ -static int +static int http_parse_authenticate(const char *cp, http_auth_challenges_t *cs) { int ret = -1; @@ -752,7 +752,7 @@ http_parse_authenticate(const char *cp, /* Loop on challenges */ for (; cs->count < MAX_CHALLENGES; cs->count++) { - cs->challenges[cs->count] = + cs->challenges[cs->count] = malloc(sizeof(http_auth_challenge_t)); if (cs->challenges[cs->count] == NULL) { fetch_syserr(); @@ -765,14 +765,14 @@ http_parse_authenticate(const char *cp, cs->challenges[cs->count]->scheme = HTTPAS_DIGEST; } else { cs->challenges[cs->count]->scheme = HTTPAS_UNKNOWN; - /* - * Continue parsing as basic or digest may + /* + * Continue parsing as basic or digest may * follow, and the syntax is the same for * all. We'll just ignore this one when * looking at the list */ } - + /* Loop on attributes */ for (;;) { /* Key */ @@ -791,31 +791,31 @@ http_parse_authenticate(const char *cp, goto out; if (!strcasecmp(key, "realm")) - cs->challenges[cs->count]->realm = + cs->challenges[cs->count]->realm = strdup(value); else if (!strcasecmp(key, "qop")) - cs->challenges[cs->count]->qop = + cs->challenges[cs->count]->qop = strdup(value); else if (!strcasecmp(key, "nonce")) - cs->challenges[cs->count]->nonce = + cs->challenges[cs->count]->nonce = strdup(value); else if (!strcasecmp(key, "opaque")) - cs->challenges[cs->count]->opaque = + cs->challenges[cs->count]->opaque = strdup(value); else if (!strcasecmp(key, "algorithm")) - cs->challenges[cs->count]->algo = + cs->challenges[cs->count]->algo = strdup(value); else if (!strcasecmp(key, "stale")) - cs->challenges[cs->count]->stale = + cs->challenges[cs->count]->stale = strcasecmp(value, "no"); /* Else ignore unknown attributes */ /* Comma or Next challenge or End */ lex = http_header_lex(&cp, key); - /* - * If we get a word here, this is the beginning of the - * next challenge. Break the attributes loop - */ + /* + * If we get a word here, this is the beginning of the + * next challenge. Break the attributes loop + */ if (lex == HTTPHL_WORD) break; @@ -832,10 +832,10 @@ http_parse_authenticate(const char *cp, } /* End attributes loop */ } /* End challenge loop */ - /* - * Challenges max count exceeded. This really can't happen - * with normal data, something's fishy -> error - */ + /* + * Challenges max count exceeded. This really can't happen + * with normal data, something's fishy -> error + */ out: if (key) @@ -1011,16 +1011,16 @@ init_http_auth_params(http_auth_params_t s->scheme = s->realm = s->user = s->password = 0; } -static void +static void clean_http_auth_params(http_auth_params_t *s) { - if (s->scheme) + if (s->scheme) free(s->scheme); - if (s->realm) + if (s->realm) free(s->realm); - if (s->user) + if (s->user) free(s->user); - if (s->password) + if (s->password) free(s->password); init_http_auth_params(s); } @@ -1075,7 +1075,7 @@ http_authfromenv(const char *p, http_aut } ret = 0; out: - if (ret == -1) + if (ret == -1) clean_http_auth_params(parms); if (str) free(str); @@ -1083,11 +1083,11 @@ out: } -/* +/* * Digest response: the code to compute the digest is taken from the - * sample implementation in RFC2616 + * sample implementation in RFC2616 */ -#define IN +#define IN const #define OUT #define HASHLEN 16 @@ -1096,7 +1096,7 @@ typedef char HASH[HASHLEN]; typedef char HASHHEX[HASHHEXLEN+1]; static const char *hexchars = "0123456789abcdef"; -static void +static void CvtHex(IN HASH Bin, OUT HASHHEX Hex) { unsigned short i; @@ -1112,7 +1112,7 @@ CvtHex(IN HASH Bin, OUT HASHHEX Hex) }; /* calculate H(A1) as per spec */ -static void +static void DigestCalcHA1( IN char * pszAlg, IN char * pszUserName, @@ -1147,7 +1147,7 @@ DigestCalcHA1( } /* calculate request-digest/response-digest as per HTTP Digest spec */ -static void +static void DigestCalcResponse( IN HASHHEX HA1, /* H(A1) */ IN char * pszNonce, /* nonce from server */ @@ -1160,7 +1160,7 @@ DigestCalcResponse( OUT HASHHEX Response /* request-digest or response-digest */ ) { -/* DEBUG(fprintf(stderr, +/* DEBUG(fprintf(stderr, "Calc: HA1[%s] Nonce[%s] qop[%s] method[%s] URI[%s]\n", HA1, pszNonce, pszQop, pszMethod, pszDigestUri));*/ MD5_CTX Md5Ctx; @@ -1199,8 +1199,8 @@ DigestCalcResponse( CvtHex(RespHash, Response); } -/* - * Generate/Send a Digest authorization header +/* + * Generate/Send a Digest authorization header * This looks like: [Proxy-]Authorization: credentials * * credentials = "Digest" digest-response @@ -1233,10 +1233,10 @@ http_digest_auth(conn_t *conn, const cha DEBUG(fprintf(stderr, "realm/nonce not set in challenge\n")); return(-1); } - if (!c->algo) + if (!c->algo) c->algo = strdup(""); - if (asprintf(&options, "%s%s%s%s", + if (asprintf(&options, "%s%s%s%s", *c->algo? ",algorithm=" : "", c->algo, c->opaque? ",opaque=" : "", c->opaque?c->opaque:"")== -1) return (-1); @@ -1264,13 +1264,13 @@ http_digest_auth(conn_t *conn, const cha r = http_cmd(conn, "%s: Digest username=\"%s\",realm=\"%s\"," "nonce=\"%s\",uri=\"%s\",response=\"%s\"," "qop=\"auth\", cnonce=\"%s\", nc=%s%s", - hdr, parms->user, c->realm, + hdr, parms->user, c->realm, c->nonce, url->doc, digest, cnonce, noncecount, options); } else { r = http_cmd(conn, "%s: Digest username=\"%s\",realm=\"%s\"," "nonce=\"%s\",uri=\"%s\",response=\"%s\"%s", - hdr, parms->user, c->realm, + hdr, parms->user, c->realm, c->nonce, url->doc, digest, options); } if (options) @@ -1301,7 +1301,7 @@ http_basic_auth(conn_t *conn, const char } /* - * Chose the challenge to answer and call the appropriate routine to + * Chose the challenge to answer and call the appropriate routine to * produce the header. */ static int @@ -1327,16 +1327,16 @@ http_authorize(conn_t *conn, const char } /* Error if "Digest" was specified and there is no Digest challenge */ - if (!digest && (parms->scheme && + if (!digest && (parms->scheme && !strcasecmp(parms->scheme, "digest"))) { - DEBUG(fprintf(stderr, + DEBUG(fprintf(stderr, "Digest auth in env, not supported by peer\n")); return (-1); } - /* - * If "basic" was specified in the environment, or there is no Digest + /* + * If "basic" was specified in the environment, or there is no Digest * challenge, do the basic thing. Don't need a challenge for this, - * so no need to check basic!=NULL + * so no need to check basic!=NULL */ if (!digest || (parms->scheme && !strcasecmp(parms->scheme,"basic"))) return (http_basic_auth(conn,hdr,parms->user,parms->password)); @@ -1492,7 +1492,7 @@ http_request(struct url *URL, const char http_auth_challenges_t proxy_challenges; /* The following calls don't allocate anything */ - init_http_headerbuf(&headerbuf); + init_http_headerbuf(&headerbuf); init_http_auth_challenges(&server_challenges); init_http_auth_challenges(&proxy_challenges); @@ -1578,65 +1578,65 @@ http_request(struct url *URL, const char /* virtual host */ http_cmd(conn, "Host: %s", host); - /* - * Proxy authorization: we only send auth after we received - * a 407 error. We do not first try basic anyway (changed - * when support was added for digest-auth) - */ + /* + * Proxy authorization: we only send auth after we received + * a 407 error. We do not first try basic anyway (changed + * when support was added for digest-auth) + */ if (purl && proxy_challenges.valid) { http_auth_params_t aparams; init_http_auth_params(&aparams); if (*purl->user || *purl->pwd) { - aparams.user = purl->user ? + aparams.user = purl->user ? strdup(purl->user) : strdup(""); aparams.password = purl->pwd? strdup(purl->pwd) : strdup(""); - } else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && + } else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && *p != '\0') { if (http_authfromenv(p, &aparams) < 0) { http_seterr(HTTP_NEED_PROXY_AUTH); goto ouch; } } - http_authorize(conn, "Proxy-Authorization", + http_authorize(conn, "Proxy-Authorization", &proxy_challenges, &aparams, url); clean_http_auth_params(&aparams); } - /* - * Server authorization: we never send "a priori" + /* + * Server authorization: we never send "a priori" * Basic auth, which used to be done if user/pass were * set in the url. This would be weird because we'd send the - * password in the clear even if Digest is finally to be + * password in the clear even if Digest is finally to be * used (it would have made more sense for the - * pre-digest version to do this when Basic was specified - * in the environment) - */ + * pre-digest version to do this when Basic was specified + * in the environment) + */ if (server_challenges.valid) { http_auth_params_t aparams; init_http_auth_params(&aparams); if (*url->user || *url->pwd) { - aparams.user = url->user ? + aparams.user = url->user ? strdup(url->user) : strdup(""); - aparams.password = url->pwd ? + aparams.password = url->pwd ? strdup(url->pwd) : strdup(""); - } else if ((p = getenv("HTTP_AUTH")) != NULL && + } else if ((p = getenv("HTTP_AUTH")) != NULL && *p != '\0') { if (http_authfromenv(p, &aparams) < 0) { http_seterr(HTTP_NEED_AUTH); goto ouch; } - } else if (fetchAuthMethod && + } else if (fetchAuthMethod && fetchAuthMethod(url) == 0) { - aparams.user = url->user ? + aparams.user = url->user ? strdup(url->user) : strdup(""); - aparams.password = url->pwd ? + aparams.password = url->pwd ? strdup(url->pwd) : strdup(""); } else { http_seterr(HTTP_NEED_AUTH); goto ouch; } - http_authorize(conn, "Authorization", + http_authorize(conn, "Authorization", &server_challenges, &aparams, url); clean_http_auth_params(&aparams); } @@ -1804,12 +1804,12 @@ http_request(struct url *URL, const char } while (h > hdr_end); /* we need to provide authentication */ - if (conn->err == HTTP_NEED_AUTH || + if (conn->err == HTTP_NEED_AUTH || conn->err == HTTP_NEED_PROXY_AUTH) { e = conn->err; - if ((conn->err == HTTP_NEED_AUTH && - !server_challenges.valid) || - (conn->err == HTTP_NEED_PROXY_AUTH && + if ((conn->err == HTTP_NEED_AUTH && + !server_challenges.valid) || + (conn->err == HTTP_NEED_PROXY_AUTH && !proxy_challenges.valid)) { /* 401/7 but no www/proxy-authenticate ?? */ DEBUG(fprintf(stderr, "401/7 and no auth header\n")); From owner-svn-src-stable@FreeBSD.ORG Wed Oct 19 11:49:14 2011 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 CB8EE10656A6; Wed, 19 Oct 2011 11:49:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB12A8FC27; Wed, 19 Oct 2011 11:49:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9JBnEuY023248; Wed, 19 Oct 2011 11:49:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9JBnEK6023245; Wed, 19 Oct 2011 11:49:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201110191149.p9JBnEK6023245@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 19 Oct 2011 11:49:14 +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: r226539 - stable/8/lib/libfetch 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: Wed, 19 Oct 2011 11:49:14 -0000 Author: des Date: Wed Oct 19 11:49:14 2011 New Revision: 226539 URL: http://svn.freebsd.org/changeset/base/226539 Log: MFH r221830: mark all sockets and file descriptors close-on-exec PR: bin/151866 Modified: stable/8/lib/libfetch/common.c stable/8/lib/libfetch/file.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Wed Oct 19 11:48:21 2011 (r226538) +++ stable/8/lib/libfetch/common.c Wed Oct 19 11:49:14 2011 (r226539) @@ -213,6 +213,7 @@ fetch_reopen(int sd) /* allocate and fill connection structure */ if ((conn = calloc(1, sizeof(*conn))) == NULL) return (NULL); + fcntl(sd, F_SETFD, FD_CLOEXEC); conn->sd = sd; ++conn->ref; return (conn); Modified: stable/8/lib/libfetch/file.c ============================================================================== --- stable/8/lib/libfetch/file.c Wed Oct 19 11:48:21 2011 (r226538) +++ stable/8/lib/libfetch/file.c Wed Oct 19 11:49:14 2011 (r226539) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -57,6 +58,7 @@ fetchXGetFile(struct url *u, struct url_ fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } @@ -84,6 +86,7 @@ fetchPutFile(struct url *u, const char * fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } From owner-svn-src-stable@FreeBSD.ORG Wed Oct 19 12:14:15 2011 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 179FC1065675; Wed, 19 Oct 2011 12:14:15 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06A818FC0A; Wed, 19 Oct 2011 12:14:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9JCEELK024266; Wed, 19 Oct 2011 12:14:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9JCEEmp024264; Wed, 19 Oct 2011 12:14:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201110191214.p9JCEEmp024264@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 19 Oct 2011 12:14:14 +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: r226540 - stable/8/usr.bin/fetch 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: Wed, 19 Oct 2011 12:14:15 -0000 Author: des Date: Wed Oct 19 12:14:14 2011 New Revision: 226540 URL: http://svn.freebsd.org/changeset/base/226540 Log: MFH r225599,225800,225805: improve handling of resumed http transfers PR: bin/117277 Modified: stable/8/usr.bin/fetch/fetch.c Directory Properties: stable/8/usr.bin/fetch/ (props changed) Modified: stable/8/usr.bin/fetch/fetch.c ============================================================================== --- stable/8/usr.bin/fetch/fetch.c Wed Oct 19 11:49:14 2011 (r226539) +++ stable/8/usr.bin/fetch/fetch.c Wed Oct 19 12:14:14 2011 (r226540) @@ -522,6 +522,12 @@ fetch(char *URL, const char *path) "does not match remote", path); goto failure_keep; } + } else if (url->offset > sb.st_size) { + /* gap between what we asked for and what we got */ + warnx("%s: gap in resume mode", URL); + fclose(of); + of = NULL; + /* picked up again later */ } else if (us.size != -1) { if (us.size == sb.st_size) /* nothing to do */ @@ -534,7 +540,7 @@ fetch(char *URL, const char *path) goto failure; } /* we got it, open local file */ - if ((of = fopen(path, "a")) == NULL) { + if ((of = fopen(path, "r+")) == NULL) { warn("%s: fopen()", path); goto failure; } @@ -551,8 +557,16 @@ fetch(char *URL, const char *path) fclose(of); of = NULL; sb = nsb; + /* picked up again later */ } } + /* seek to where we left off */ + if (of != NULL && fseeko(of, url->offset, SEEK_SET) != 0) { + warn("%s: fseeko()", path); + fclose(of); + of = NULL; + /* picked up again later */ + } } else if (m_flag && sb.st_size != -1) { /* mirror mode, local file exists */ if (sb.st_size == us.size && sb.st_mtime == us.mtime) From owner-svn-src-stable@FreeBSD.ORG Wed Oct 19 12:15:16 2011 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 6E24F1065672; Wed, 19 Oct 2011 12:15:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D85E8FC12; Wed, 19 Oct 2011 12:15:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9JCFG1n024356; Wed, 19 Oct 2011 12:15:16 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9JCFG40024352; Wed, 19 Oct 2011 12:15:16 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201110191215.p9JCFG40024352@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 19 Oct 2011 12:15:16 +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: r226541 - stable/8/usr.bin/fetch 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: Wed, 19 Oct 2011 12:15:16 -0000 Author: des Date: Wed Oct 19 12:15:16 2011 New Revision: 226541 URL: http://svn.freebsd.org/changeset/base/226541 Log: MFH r225982: fix name in copyright statements Modified: stable/8/usr.bin/fetch/fetch.1 stable/8/usr.bin/fetch/fetch.c Directory Properties: stable/8/usr.bin/fetch/ (props changed) Modified: stable/8/usr.bin/fetch/fetch.1 ============================================================================== --- stable/8/usr.bin/fetch/fetch.1 Wed Oct 19 12:14:14 2011 (r226540) +++ stable/8/usr.bin/fetch/fetch.1 Wed Oct 19 12:15:16 2011 (r226541) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 2000-2004 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. Modified: stable/8/usr.bin/fetch/fetch.c ============================================================================== --- stable/8/usr.bin/fetch/fetch.c Wed Oct 19 12:14:14 2011 (r226540) +++ stable/8/usr.bin/fetch/fetch.c Wed Oct 19 12:15:16 2011 (r226541) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-stable@FreeBSD.ORG Wed Oct 19 23:02:58 2011 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 38978106564A; Wed, 19 Oct 2011 23:02:58 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2782F8FC0C; Wed, 19 Oct 2011 23:02:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9JN2wEj046252; Wed, 19 Oct 2011 23:02:58 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9JN2w8C046249; Wed, 19 Oct 2011 23:02:58 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201110192302.p9JN2w8C046249@svn.freebsd.org> From: Ken Smith Date: Wed, 19 Oct 2011 23:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226548 - in stable/9: . sys/ia64/conf 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: Wed, 19 Oct 2011 23:02:58 -0000 Author: kensmith Date: Wed Oct 19 23:02:57 2011 New Revision: 226548 URL: http://svn.freebsd.org/changeset/base/226548 Log: Remove the last of the debugging support (INVARIANT*) from the ia64 GENERIC config file, the ia64 kernel runs OK without it. Reviewed by: marcel Approved by: re (implicit) Modified: stable/9/UPDATING stable/9/sys/ia64/conf/GENERIC Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Wed Oct 19 21:55:20 2011 (r226547) +++ stable/9/UPDATING Wed Oct 19 23:02:57 2011 (r226548) @@ -9,11 +9,6 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. -NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW ON IA64: - For ia64 the INVARIANTS and INVARIANT_SUPPORT kernel options - were left in the GENERIC kernel because the kernel does not - work properly without them. - 20110913: This commit modifies vfs_register() so that it uses a hash calculation to set vfc_typenum, which is enabled by default. Modified: stable/9/sys/ia64/conf/GENERIC ============================================================================== --- stable/9/sys/ia64/conf/GENERIC Wed Oct 19 21:55:20 2011 (r226547) +++ stable/9/sys/ia64/conf/GENERIC Wed Oct 19 23:02:57 2011 (r226548) @@ -33,8 +33,6 @@ options GEOM_LABEL # Provides labelizat options INCLUDE_CONFIG_FILE # Include this file in kernel options INET # InterNETworking options INET6 # IPv6 communications protocols -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # required by INVARIANTS options KTRACE # ktrace(1) syscall trace support options MAC # TrustedBSD MAC Framework options MD_ROOT # MD usable as root device From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 14:45:17 2011 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 27D7B1065674; Thu, 20 Oct 2011 14:45:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1704A8FC12; Thu, 20 Oct 2011 14:45:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KEjGT6078880; Thu, 20 Oct 2011 14:45:16 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KEjG2h078878; Thu, 20 Oct 2011 14:45:16 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201110201445.p9KEjG2h078878@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 20 Oct 2011 14:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226565 - stable/9/usr.sbin/usbdump 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: Thu, 20 Oct 2011 14:45:17 -0000 Author: hselasky Date: Thu Oct 20 14:45:16 2011 New Revision: 226565 URL: http://svn.freebsd.org/changeset/base/226565 Log: MFC r226474: Make the usbdump utility work again by using the correct BPF structures. Approved by: re (kib) Modified: stable/9/usr.sbin/usbdump/usbdump.c Directory Properties: stable/9/usr.sbin/usbdump/ (props changed) Modified: stable/9/usr.sbin/usbdump/usbdump.c ============================================================================== --- stable/9/usr.sbin/usbdump/usbdump.c Thu Oct 20 13:41:37 2011 (r226564) +++ stable/9/usr.sbin/usbdump/usbdump.c Thu Oct 20 14:45:16 2011 (r226565) @@ -283,7 +283,7 @@ hexdump(const uint8_t *region, uint32_t } static void -print_apacket(const struct bpf_xhdr *hdr, const uint8_t *ptr, int ptr_len) +print_apacket(const struct bpf_hdr *hdr, const uint8_t *ptr, int ptr_len) { struct tm *tm; struct usbpf_pkthdr up_temp; @@ -318,8 +318,8 @@ print_apacket(const struct bpf_xhdr *hdr up->up_packet_count = le32toh(up->up_packet_count); up->up_endpoint = le32toh(up->up_endpoint); - tv.tv_sec = hdr->bh_tstamp.bt_sec; - tv.tv_usec = hdr->bh_tstamp.bt_frac; + tv.tv_sec = hdr->bh_tstamp.tv_sec; + tv.tv_usec = hdr->bh_tstamp.tv_usec; tm = localtime(&tv.tv_sec); len = strftime(buf, sizeof(buf), "%H:%M:%S", tm); @@ -386,12 +386,12 @@ print_apacket(const struct bpf_xhdr *hdr static void print_packets(uint8_t *data, const int datalen) { - const struct bpf_xhdr *hdr; + const struct bpf_hdr *hdr; uint8_t *ptr; uint8_t *next; for (ptr = data; ptr < (data + datalen); ptr = next) { - hdr = (const struct bpf_xhdr *)ptr; + hdr = (const struct bpf_hdr *)ptr; next = ptr + BPF_WORDALIGN(hdr->bh_hdrlen + hdr->bh_caplen); if (w_arg == NULL) { From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 14:56:44 2011 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 A3DBD106567D; Thu, 20 Oct 2011 14:56:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 797DD8FC12; Thu, 20 Oct 2011 14:56:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KEui7i079264; Thu, 20 Oct 2011 14:56:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KEui96079262; Thu, 20 Oct 2011 14:56:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201110201456.p9KEui96079262@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 20 Oct 2011 14:56:44 +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: r226566 - stable/8/usr.sbin/usbdump 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: Thu, 20 Oct 2011 14:56:44 -0000 Author: hselasky Date: Thu Oct 20 14:56:44 2011 New Revision: 226566 URL: http://svn.freebsd.org/changeset/base/226566 Log: MFC r226474: Make the usbdump utility work again by using the correct BPF structures. Modified: stable/8/usr.sbin/usbdump/usbdump.c Directory Properties: stable/8/usr.sbin/usbdump/ (props changed) Modified: stable/8/usr.sbin/usbdump/usbdump.c ============================================================================== --- stable/8/usr.sbin/usbdump/usbdump.c Thu Oct 20 14:45:16 2011 (r226565) +++ stable/8/usr.sbin/usbdump/usbdump.c Thu Oct 20 14:56:44 2011 (r226566) @@ -70,12 +70,6 @@ struct usbcap_filehdr { uint8_t reserved[26]; } __packed; -#if __FreeBSD_version < 900000 -#define bpf_xhdr bpf_hdr -#define bt_sec tv_sec -#define bt_frac tv_usec -#endif - static int doexit = 0; static int pkt_captured = 0; static int verbose = 0; @@ -289,7 +283,7 @@ hexdump(const uint8_t *region, uint32_t } static void -print_apacket(const struct bpf_xhdr *hdr, const uint8_t *ptr, int ptr_len) +print_apacket(const struct bpf_hdr *hdr, const uint8_t *ptr, int ptr_len) { struct tm *tm; struct usbpf_pkthdr up_temp; @@ -324,8 +318,8 @@ print_apacket(const struct bpf_xhdr *hdr up->up_packet_count = le32toh(up->up_packet_count); up->up_endpoint = le32toh(up->up_endpoint); - tv.tv_sec = hdr->bh_tstamp.bt_sec; - tv.tv_usec = hdr->bh_tstamp.bt_frac; + tv.tv_sec = hdr->bh_tstamp.tv_sec; + tv.tv_usec = hdr->bh_tstamp.tv_usec; tm = localtime(&tv.tv_sec); len = strftime(buf, sizeof(buf), "%H:%M:%S", tm); @@ -392,12 +386,12 @@ print_apacket(const struct bpf_xhdr *hdr static void print_packets(uint8_t *data, const int datalen) { - const struct bpf_xhdr *hdr; + const struct bpf_hdr *hdr; uint8_t *ptr; uint8_t *next; for (ptr = data; ptr < (data + datalen); ptr = next) { - hdr = (const struct bpf_xhdr *)ptr; + hdr = (const struct bpf_hdr *)ptr; next = ptr + BPF_WORDALIGN(hdr->bh_hdrlen + hdr->bh_caplen); if (w_arg == NULL) { From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 15:34:18 2011 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 4D1C9106566C; Thu, 20 Oct 2011 15:34:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 327708FC08; Thu, 20 Oct 2011 15:34:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KFYIsK080475; Thu, 20 Oct 2011 15:34:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KFYIZQ080473; Thu, 20 Oct 2011 15:34:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201110201534.p9KFYIZQ080473@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 20 Oct 2011 15:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226567 - stable/9/sys/powerpc/powerpc 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: Thu, 20 Oct 2011 15:34:18 -0000 Author: nwhitehorn Date: Thu Oct 20 15:34:17 2011 New Revision: 226567 URL: http://svn.freebsd.org/changeset/base/226567 Log: MFC r226410: Enforce a memory barrier in stream operations, as is done on other bus_space calls. This makes ath(4) work correctly on PowerPC. Submitted by: adrian Tested by: andreast Approved by: re (kib) Modified: stable/9/sys/powerpc/powerpc/bus_machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- stable/9/sys/powerpc/powerpc/bus_machdep.c Thu Oct 20 14:56:44 2011 (r226566) +++ stable/9/sys/powerpc/powerpc/bus_machdep.c Thu Oct 20 15:34:17 2011 (r226567) @@ -293,6 +293,7 @@ bs_be_ws_1(bus_space_handle_t bsh, bus_s addr = __ppc_ba(bsh, ofs); *addr = val; + __asm __volatile("eieio; sync"); CTR4(KTR_BE_IO, "%s(bsh=%#x, ofs=%#x, val=%#x)", __func__, bsh, ofs, val); } @@ -303,6 +304,7 @@ bs_be_ws_2(bus_space_handle_t bsh, bus_s addr = __ppc_ba(bsh, ofs); *addr = val; + __asm __volatile("eieio; sync"); CTR4(KTR_BE_IO, "%s(bsh=%#x, ofs=%#x, val=%#x)", __func__, bsh, ofs, val); } @@ -313,6 +315,7 @@ bs_be_ws_4(bus_space_handle_t bsh, bus_s addr = __ppc_ba(bsh, ofs); *addr = val; + __asm __volatile("eieio; sync"); CTR4(KTR_BE_IO, "%s(bsh=%#x, ofs=%#x, val=%#x)", __func__, bsh, ofs, val); } @@ -323,6 +326,7 @@ bs_be_ws_8(bus_space_handle_t bsh, bus_s addr = __ppc_ba(bsh, ofs); *addr = val; + __asm __volatile("eieio; sync"); } static void @@ -488,6 +492,7 @@ bs_le_rs_1(bus_space_handle_t bsh, bus_s addr = __ppc_ba(bsh, ofs); res = *addr; + __asm __volatile("eieio; sync"); CTR4(KTR_LE_IO, "%s(bsh=%#x, ofs=%#x) = %#x", __func__, bsh, ofs, res); return (res); } @@ -500,6 +505,7 @@ bs_le_rs_2(bus_space_handle_t bsh, bus_s addr = __ppc_ba(bsh, ofs); __asm __volatile("lhbrx %0, 0, %1" : "=r"(res) : "r"(addr)); + __asm __volatile("eieio; sync"); CTR4(KTR_LE_IO, "%s(bsh=%#x, ofs=%#x) = %#x", __func__, bsh, ofs, res); return (res); } @@ -512,6 +518,7 @@ bs_le_rs_4(bus_space_handle_t bsh, bus_s addr = __ppc_ba(bsh, ofs); __asm __volatile("lwbrx %0, 0, %1" : "=r"(res) : "r"(addr)); + __asm __volatile("eieio; sync"); CTR4(KTR_LE_IO, "%s(bsh=%#x, ofs=%#x) = %#x", __func__, bsh, ofs, res); return (res); } From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 15:53:27 2011 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 34743106566B; Thu, 20 Oct 2011 15:53:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2283C8FC14; Thu, 20 Oct 2011 15:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KFrRnB081194; Thu, 20 Oct 2011 15:53:27 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KFrRa9081192; Thu, 20 Oct 2011 15:53:27 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201110201553.p9KFrRa9081192@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Oct 2011 15:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226570 - stable/9/sys/netinet6 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: Thu, 20 Oct 2011 15:53:27 -0000 Author: glebius Date: Thu Oct 20 15:53:26 2011 New Revision: 226570 URL: http://svn.freebsd.org/changeset/base/226570 Log: MFhead r226338: Restore functions in6_ifaddloop() and in6_ifremloop() that were inlined by Qing Li in his big new-ARP commit. I am going to utilize them in my newcarp work, and also these functions left declared in in6_var.h for all the time they were absent. Reviewed by: bz Approved by: re (kib) Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Thu Oct 20 15:46:54 2011 (r226569) +++ stable/9/sys/netinet6/in6.c Thu Oct 20 15:53:26 2011 (r226570) @@ -136,7 +136,89 @@ static void in6_unlink_ifa(struct in6_if int (*faithprefix_p)(struct in6_addr *); +#define ifa2ia6(ifa) ((struct in6_ifaddr *)(ifa)) +#define ia62ifa(ia6) (&((ia6)->ia_ifa)) + +void +in6_ifaddloop(struct ifaddr *ifa) +{ + struct sockaddr_dl gateway; + struct sockaddr_in6 mask, addr; + struct rtentry rt; + struct in6_ifaddr *ia; + struct ifnet *ifp; + struct llentry *ln; + + ia = ifa2ia6(ifa); + ifp = ifa->ifa_ifp; + IF_AFDATA_LOCK(ifp); + ifa->ifa_rtrequest = NULL; + + /* XXX QL + * we need to report rt_newaddrmsg + */ + ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR | + LLE_EXCLUSIVE), (struct sockaddr *)&ia->ia_addr); + IF_AFDATA_UNLOCK(ifp); + if (ln != NULL) { + ln->la_expire = 0; /* for IPv6 this means permanent */ + ln->ln_state = ND6_LLINFO_REACHABLE; + /* + * initialize for rtmsg generation + */ + bzero(&gateway, sizeof(gateway)); + gateway.sdl_len = sizeof(gateway); + gateway.sdl_family = AF_LINK; + gateway.sdl_nlen = 0; + gateway.sdl_alen = 6; + memcpy(gateway.sdl_data, &ln->ll_addr.mac_aligned, + sizeof(ln->ll_addr)); + LLE_WUNLOCK(ln); + } + + bzero(&rt, sizeof(rt)); + rt.rt_gateway = (struct sockaddr *)&gateway; + memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); + memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); + rt_mask(&rt) = (struct sockaddr *)&mask; + rt_key(&rt) = (struct sockaddr *)&addr; + rt.rt_flags = RTF_UP | RTF_HOST | RTF_STATIC; + rt_newaddrmsg(RTM_ADD, ifa, 0, &rt); +} + +void +in6_ifremloop(struct ifaddr *ifa) +{ + struct sockaddr_dl gateway; + struct sockaddr_in6 mask, addr; + struct rtentry rt0; + struct in6_ifaddr *ia; + struct ifnet *ifp; + ia = ifa2ia6(ifa); + ifp = ifa->ifa_ifp; + IF_AFDATA_LOCK(ifp); + lla_lookup(LLTABLE6(ifp), (LLE_DELETE | LLE_IFADDR), + (struct sockaddr *)&ia->ia_addr); + IF_AFDATA_UNLOCK(ifp); + + /* + * initialize for rtmsg generation + */ + bzero(&gateway, sizeof(gateway)); + gateway.sdl_len = sizeof(gateway); + gateway.sdl_family = AF_LINK; + gateway.sdl_nlen = 0; + gateway.sdl_alen = ifp->if_addrlen; + bzero(&rt0, sizeof(rt0)); + rt0.rt_gateway = (struct sockaddr *)&gateway; + memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); + memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); + rt_mask(&rt0) = (struct sockaddr *)&mask; + rt_key(&rt0) = (struct sockaddr *)&addr; + rt0.rt_flags = RTF_HOST | RTF_STATIC; + rt_newaddrmsg(RTM_DELETE, ifa, 0, &rt0); +} int in6_mask2len(struct in6_addr *mask, u_char *lim0) @@ -174,9 +256,6 @@ in6_mask2len(struct in6_addr *mask, u_ch return x * 8 + y; } -#define ifa2ia6(ifa) ((struct in6_ifaddr *)(ifa)) -#define ia62ifa(ia6) (&((ia6)->ia_ifa)) - #ifdef COMPAT_FREEBSD32 struct in6_ndifreq32 { char ifname[IFNAMSIZ]; @@ -1218,9 +1297,6 @@ in6_purgeaddr(struct ifaddr *ifa) struct in6_ifaddr *ia = (struct in6_ifaddr *) ifa; struct in6_multi_mship *imm; struct sockaddr_in6 mltaddr, mltmask; - struct rtentry rt0; - struct sockaddr_dl gateway; - struct sockaddr_in6 mask, addr; int plen, error; struct rtentry *rt; struct ifaddr *ifa0, *nifa; @@ -1259,28 +1335,7 @@ in6_purgeaddr(struct ifaddr *ifa) /* stop DAD processing */ nd6_dad_stop(ifa); - IF_AFDATA_LOCK(ifp); - lla_lookup(LLTABLE6(ifp), (LLE_DELETE | LLE_IFADDR), - (struct sockaddr *)&ia->ia_addr); - IF_AFDATA_UNLOCK(ifp); - - /* - * initialize for rtmsg generation - */ - bzero(&gateway, sizeof(gateway)); - gateway.sdl_len = sizeof(gateway); - gateway.sdl_family = AF_LINK; - gateway.sdl_nlen = 0; - gateway.sdl_alen = ifp->if_addrlen; - /* */ - bzero(&rt0, sizeof(rt0)); - rt0.rt_gateway = (struct sockaddr *)&gateway; - memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); - memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); - rt_mask(&rt0) = (struct sockaddr *)&mask; - rt_key(&rt0) = (struct sockaddr *)&addr; - rt0.rt_flags = RTF_HOST | RTF_STATIC; - rt_newaddrmsg(RTM_DELETE, ifa, 0, &rt0); + in6_ifremloop(ifa); /* * leave from multicast groups we have joined for the interface @@ -1823,46 +1878,8 @@ in6_ifinit(struct ifnet *ifp, struct in6 } /* Add ownaddr as loopback rtentry, if necessary (ex. on p2p link). */ - if (newhost) { - struct llentry *ln; - struct rtentry rt; - struct sockaddr_dl gateway; - struct sockaddr_in6 mask, addr; - - IF_AFDATA_LOCK(ifp); - ia->ia_ifa.ifa_rtrequest = NULL; - - /* XXX QL - * we need to report rt_newaddrmsg - */ - ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR | LLE_EXCLUSIVE), - (struct sockaddr *)&ia->ia_addr); - IF_AFDATA_UNLOCK(ifp); - if (ln != NULL) { - ln->la_expire = 0; /* for IPv6 this means permanent */ - ln->ln_state = ND6_LLINFO_REACHABLE; - /* - * initialize for rtmsg generation - */ - bzero(&gateway, sizeof(gateway)); - gateway.sdl_len = sizeof(gateway); - gateway.sdl_family = AF_LINK; - gateway.sdl_nlen = 0; - gateway.sdl_alen = 6; - memcpy(gateway.sdl_data, &ln->ll_addr.mac_aligned, sizeof(ln->ll_addr)); - /* */ - LLE_WUNLOCK(ln); - } - - bzero(&rt, sizeof(rt)); - rt.rt_gateway = (struct sockaddr *)&gateway; - memcpy(&mask, &ia->ia_prefixmask, sizeof(ia->ia_prefixmask)); - memcpy(&addr, &ia->ia_addr, sizeof(ia->ia_addr)); - rt_mask(&rt) = (struct sockaddr *)&mask; - rt_key(&rt) = (struct sockaddr *)&addr; - rt.rt_flags = RTF_UP | RTF_HOST | RTF_STATIC; - rt_newaddrmsg(RTM_ADD, &ia->ia_ifa, 0, &rt); - } + if (newhost) + in6_ifaddloop(&(ia->ia_ifa)); return (error); } From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 15:55:02 2011 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 37537106566B; Thu, 20 Oct 2011 15:55:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05E0A8FC0A; Thu, 20 Oct 2011 15:55:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KFt13A081296; Thu, 20 Oct 2011 15:55:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KFt1jR081295; Thu, 20 Oct 2011 15:55:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201110201555.p9KFt1jR081295@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Oct 2011 15:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226571 - stable/9/sys/netinet 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: Thu, 20 Oct 2011 15:55:02 -0000 Author: glebius Date: Thu Oct 20 15:55:01 2011 New Revision: 226571 URL: http://svn.freebsd.org/changeset/base/226571 Log: MFhead r226367: Never switch directly from INIT to MASTER, since this produces nasty status flaps. PR: kern/161123 Submitted by: Damien Fleuriot OpenBSD: ip_carp.c, rev. 1.115 Approved by: re (kib) Modified: stable/9/sys/netinet/ip_carp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/ip_carp.c ============================================================================== --- stable/9/sys/netinet/ip_carp.c Thu Oct 20 15:53:26 2011 (r226570) +++ stable/9/sys/netinet/ip_carp.c Thu Oct 20 15:55:01 2011 (r226571) @@ -1424,24 +1424,10 @@ carp_setrun(struct carp_softc *sc, sa_fa switch (sc->sc_state) { case INIT: - if (carp_opts[CARPCTL_PREEMPT] && !carp_suppress_preempt) { - carp_send_ad_locked(sc); -#ifdef INET - carp_send_arp(sc); -#endif -#ifdef INET6 - carp_send_na(sc); -#endif /* INET6 */ - CARP_LOG("%s: INIT -> MASTER (preempting)\n", - SC2IFP(sc)->if_xname); - carp_set_state(sc, MASTER); - carp_setroute(sc, RTM_ADD); - } else { - CARP_LOG("%s: INIT -> BACKUP\n", SC2IFP(sc)->if_xname); - carp_set_state(sc, BACKUP); - carp_setroute(sc, RTM_DELETE); - carp_setrun(sc, 0); - } + CARP_LOG("%s: INIT -> BACKUP\n", SC2IFP(sc)->if_xname); + carp_set_state(sc, BACKUP); + carp_setroute(sc, RTM_DELETE); + carp_setrun(sc, 0); break; case BACKUP: callout_stop(&sc->sc_ad_tmo); From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 15:58:06 2011 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 23317106566B; Thu, 20 Oct 2011 15:58:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10EE28FC12; Thu, 20 Oct 2011 15:58:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KFw5eu081446; Thu, 20 Oct 2011 15:58:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KFw550081440; Thu, 20 Oct 2011 15:58:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201110201558.p9KFw550081440@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Oct 2011 15:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226572 - stable/9/sys/netinet 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: Thu, 20 Oct 2011 15:58:06 -0000 Author: glebius Date: Thu Oct 20 15:58:05 2011 New Revision: 226572 URL: http://svn.freebsd.org/changeset/base/226572 Log: MFhead 226401,226402: Remove last remnants of classful addressing: - Remove ia_net, ia_netmask, ia_netbroadcast from struct in_ifaddr. - Remove net.inet.ip.subnetsarelocal, I bet no one need it in 2011. - fix bug when we were not forwarding to a host which matches classful net address. For example router having 192.168.x.y/16 network attached, would not forward traffic to 192.168.*.0, which are legal IPs in CIDR world. - For compatibility, leave autoguessing of mask based on class. Reviewed by: andre, bz, rwatson Add support for IPv4 /31 prefixes, as described in RFC3021. To run a /31 network, participating hosts MUST drop support for directed broadcasts, and treat the first and last addresses on subnet as unicast. The broadcast address for the prefix should be the link local broadcast address, INADDR_BROADCAST. Approved by: re (kib) Modified: stable/9/sys/netinet/in.c stable/9/sys/netinet/in.h stable/9/sys/netinet/in_debug.c stable/9/sys/netinet/in_var.h stable/9/sys/netinet/ip_input.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Thu Oct 20 15:55:01 2011 (r226571) +++ stable/9/sys/netinet/in.c Thu Oct 20 15:58:05 2011 (r226572) @@ -76,11 +76,6 @@ static int in_ifinit(struct ifnet *, struct in_ifaddr *, struct sockaddr_in *, int); static void in_purgemaddrs(struct ifnet *); -static VNET_DEFINE(int, subnetsarelocal); -#define V_subnetsarelocal VNET(subnetsarelocal) -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, subnets_are_local, CTLFLAG_RW, - &VNET_NAME(subnetsarelocal), 0, - "Treat all subnets as directly connected"); static VNET_DEFINE(int, sameprefixcarponly); #define V_sameprefixcarponly VNET(sameprefixcarponly) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, same_prefix_carp_only, CTLFLAG_RW, @@ -95,9 +90,7 @@ VNET_DECLARE(struct arpstat, arpstat); /* * Return 1 if an internet address is for a ``local'' host - * (one to which we have a connection). If subnetsarelocal - * is true, this includes other subnets of the local net. - * Otherwise, it includes only the directly-connected (sub)nets. + * (one to which we have a connection). */ int in_localaddr(struct in_addr in) @@ -106,19 +99,10 @@ in_localaddr(struct in_addr in) register struct in_ifaddr *ia; IN_IFADDR_RLOCK(); - if (V_subnetsarelocal) { - TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { - if ((i & ia->ia_netmask) == ia->ia_net) { - IN_IFADDR_RUNLOCK(); - return (1); - } - } - } else { - TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { - if ((i & ia->ia_subnetmask) == ia->ia_subnet) { - IN_IFADDR_RUNLOCK(); - return (1); - } + TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { + if ((i & ia->ia_subnetmask) == ia->ia_subnet) { + IN_IFADDR_RUNLOCK(); + return (1); } } IN_IFADDR_RUNLOCK(); @@ -890,23 +874,19 @@ in_ifinit(struct ifnet *ifp, struct in_i in_ifscrub(ifp, ia, LLE_STATIC); ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr; } - if (IN_CLASSA(i)) - ia->ia_netmask = IN_CLASSA_NET; - else if (IN_CLASSB(i)) - ia->ia_netmask = IN_CLASSB_NET; - else - ia->ia_netmask = IN_CLASSC_NET; /* - * The subnet mask usually includes at least the standard network part, - * but may may be smaller in the case of supernetting. - * If it is set, we believe it. + * Be compatible with network classes, if netmask isn't supplied, + * guess it based on classes. */ if (ia->ia_subnetmask == 0) { - ia->ia_subnetmask = ia->ia_netmask; + if (IN_CLASSA(i)) + ia->ia_subnetmask = IN_CLASSA_NET; + else if (IN_CLASSB(i)) + ia->ia_subnetmask = IN_CLASSB_NET; + else + ia->ia_subnetmask = IN_CLASSC_NET; ia->ia_sockmask.sin_addr.s_addr = htonl(ia->ia_subnetmask); - } else - ia->ia_netmask &= ia->ia_subnetmask; - ia->ia_net = i & ia->ia_netmask; + } ia->ia_subnet = i & ia->ia_subnetmask; in_socktrim(&ia->ia_sockmask); /* @@ -919,10 +899,11 @@ in_ifinit(struct ifnet *ifp, struct in_i */ ia->ia_ifa.ifa_metric = ifp->if_metric; if (ifp->if_flags & IFF_BROADCAST) { - ia->ia_broadaddr.sin_addr.s_addr = - htonl(ia->ia_subnet | ~ia->ia_subnetmask); - ia->ia_netbroadcast.s_addr = - htonl(ia->ia_net | ~ ia->ia_netmask); + if (ia->ia_subnetmask == IN_RFC3021_MASK) + ia->ia_broadaddr.sin_addr.s_addr = INADDR_BROADCAST; + else + ia->ia_broadaddr.sin_addr.s_addr = + htonl(ia->ia_subnet | ~ia->ia_subnetmask); } else if (ifp->if_flags & IFF_LOOPBACK) { ia->ia_dstaddr = ia->ia_addr; flags |= RTF_HOST; @@ -1253,11 +1234,12 @@ in_broadcast(struct in_addr in, struct i TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (ifa->ifa_addr->sa_family == AF_INET && (in.s_addr == ia->ia_broadaddr.sin_addr.s_addr || - in.s_addr == ia->ia_netbroadcast.s_addr || /* - * Check for old-style (host 0) broadcast. + * Check for old-style (host 0) broadcast, but + * taking into account that RFC 3021 obsoletes it. */ - t == ia->ia_subnet || t == ia->ia_net) && + (ia->ia_subnetmask != IN_RFC3021_MASK && + t == ia->ia_subnet)) && /* * Check for an all one subnetmask. These * only exist when an interface gets a secondary Modified: stable/9/sys/netinet/in.h ============================================================================== --- stable/9/sys/netinet/in.h Thu Oct 20 15:55:01 2011 (r226571) +++ stable/9/sys/netinet/in.h Thu Oct 20 15:58:05 2011 (r226572) @@ -392,6 +392,8 @@ __END_DECLS #define IN_LOOPBACKNET 127 /* official! */ +#define IN_RFC3021_MASK (u_int32_t)0xfffffffe + /* * Options for use with [gs]etsockopt at the IP level. * First word of comment is data type; bool is stored in int. Modified: stable/9/sys/netinet/in_debug.c ============================================================================== --- stable/9/sys/netinet/in_debug.c Thu Oct 20 15:55:01 2011 (r226571) +++ stable/9/sys/netinet/in_debug.c Thu Oct 20 15:58:05 2011 (r226572) @@ -86,11 +86,8 @@ in_show_in_ifaddr(struct in_ifaddr *ia) #define IA_DB_RPINTF_DPTR(f, e) db_printf("\t *%s = " f "\n", #e, *ia->e); db_printf("\tin_ifaddr = %p\n", ia); IA_DB_RPINTF_PTR("%p", ia_ifa); - IA_DB_RPINTF("0x%08lx", ia_net); - IA_DB_RPINTF("0x%08lx", ia_netmask); IA_DB_RPINTF("0x%08lx", ia_subnet); IA_DB_RPINTF("0x%08lx", ia_subnetmask); - IA_DB_RPINTF("0x%08x", ia_netbroadcast.s_addr); IA_DB_RPINTF("%p", ia_hash.le_next); IA_DB_RPINTF("%p", ia_hash.le_prev); IA_DB_RPINTF_DPTR("%p", ia_hash.le_prev); Modified: stable/9/sys/netinet/in_var.h ============================================================================== --- stable/9/sys/netinet/in_var.h Thu Oct 20 15:55:01 2011 (r226571) +++ stable/9/sys/netinet/in_var.h Thu Oct 20 15:58:05 2011 (r226572) @@ -60,12 +60,9 @@ struct in_ifaddr { struct ifaddr ia_ifa; /* protocol-independent info */ #define ia_ifp ia_ifa.ifa_ifp #define ia_flags ia_ifa.ifa_flags - /* ia_{,sub}net{,mask} in host order */ - u_long ia_net; /* network number of interface */ - u_long ia_netmask; /* mask of net part */ - u_long ia_subnet; /* subnet number, including net */ - u_long ia_subnetmask; /* mask of subnet part */ - struct in_addr ia_netbroadcast; /* to recognize net broadcasts */ + /* ia_subnet{,mask} in host order */ + u_long ia_subnet; /* subnet address */ + u_long ia_subnetmask; /* mask of subnet */ LIST_ENTRY(in_ifaddr) ia_hash; /* entry in bucket of inet addresses */ TAILQ_ENTRY(in_ifaddr) ia_link; /* list of internet addresses */ struct sockaddr_in ia_addr; /* reserve space for interface name */ Modified: stable/9/sys/netinet/ip_input.c ============================================================================== --- stable/9/sys/netinet/ip_input.c Thu Oct 20 15:55:01 2011 (r226571) +++ stable/9/sys/netinet/ip_input.c Thu Oct 20 15:58:05 2011 (r226572) @@ -622,11 +622,6 @@ passin: IF_ADDR_UNLOCK(ifp); goto ours; } - if (ia->ia_netbroadcast.s_addr == ip->ip_dst.s_addr) { - ifa_ref(ifa); - IF_ADDR_UNLOCK(ifp); - goto ours; - } #ifdef BOOTP_COMPAT if (IA_SIN(ia)->sin_addr.s_addr == INADDR_ANY) { ifa_ref(ifa); From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 16:08:11 2011 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 9B2DD1065673; Thu, 20 Oct 2011 16:08:11 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8965C8FC14; Thu, 20 Oct 2011 16:08:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KG8BOs081808; Thu, 20 Oct 2011 16:08:11 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KG8BUO081802; Thu, 20 Oct 2011 16:08:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201110201608.p9KG8BUO081802@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 20 Oct 2011 16:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226573 - in stable/9/usr.bin/grep: . regex 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: Thu, 20 Oct 2011 16:08:11 -0000 Author: gabor Date: Thu Oct 20 16:08:11 2011 New Revision: 226573 URL: http://svn.freebsd.org/changeset/base/226573 Log: MFC r226432, r226273: - Use getprogname() instead of __progname - Allow disabling bzip2 support with WITHOUT_BZIP2 - Fix handling patterns that start with a dot - Remove superfluous semicolon - Fix counting of match limit (-m) Approved by: re (kib), delphij (mentor, implicit) Modified: stable/9/usr.bin/grep/Makefile stable/9/usr.bin/grep/file.c stable/9/usr.bin/grep/grep.c stable/9/usr.bin/grep/regex/tre-fastmatch.c stable/9/usr.bin/grep/util.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/Makefile ============================================================================== --- stable/9/usr.bin/grep/Makefile Thu Oct 20 15:58:05 2011 (r226572) +++ stable/9/usr.bin/grep/Makefile Thu Oct 20 16:08:11 2011 (r226573) @@ -26,9 +26,6 @@ LINKS= ${BINDIR}/grep ${BINDIR}/egrep \ ${BINDIR}/grep ${BINDIR}/zgrep \ ${BINDIR}/grep ${BINDIR}/zegrep \ ${BINDIR}/grep ${BINDIR}/zfgrep \ - ${BINDIR}/grep ${BINDIR}/bzgrep \ - ${BINDIR}/grep ${BINDIR}/bzegrep \ - ${BINDIR}/grep ${BINDIR}/bzfgrep \ ${BINDIR}/grep ${BINDIR}/xzgrep \ ${BINDIR}/grep ${BINDIR}/xzegrep \ ${BINDIR}/grep ${BINDIR}/xzfgrep \ @@ -41,9 +38,6 @@ MLINKS= grep.1 egrep.1 \ grep.1 zgrep.1 \ grep.1 zegrep.1 \ grep.1 zfgrep.1 \ - grep.1 bzgrep.1 \ - grep.1 bzegrep.1 \ - grep.1 bzfgrep.1 \ grep.1 xzgrep.1 \ grep.1 xzegrep.1 \ grep.1 xzfgrep.1 \ @@ -52,8 +46,22 @@ MLINKS= grep.1 egrep.1 \ grep.1 lzfgrep.1 .endif -LDADD= -lz -lbz2 -llzma -DPADD= ${LIBZ} ${LIBBZ2} ${LIBLZMA} +LDADD= -lz -llzma +DPADD= ${LIBZ} ${LIBLZMA} + +.if !defined(WITHOUT_BZIP2) +LDADD+= -lbz2 +DPADD+= ${LIBBZ2} + +LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \ + ${BINDIR}/grep ${BINDIR}/bzegrep \ + ${BINDIR}/grep ${BINDIR}/bzfgrep +MLINKS+= grep.1 bzgrep.1 \ + grep.1 bzegrep.1 \ + grep.1 bzfgrep.1 +.else +CFLAGS+= -DWITHOUT_BZIP2 +.endif .if !defined(WITHOUT_GNU_COMPAT) CFLAGS+= -I/usr/include/gnu Modified: stable/9/usr.bin/grep/file.c ============================================================================== --- stable/9/usr.bin/grep/file.c Thu Oct 20 15:58:05 2011 (r226572) +++ stable/9/usr.bin/grep/file.c Thu Oct 20 16:08:11 2011 (r226573) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -51,14 +50,20 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_BZIP2 +#include +#endif + #include "grep.h" #define MAXBUFSIZ (32 * 1024) #define LNBUFBUMP 80 static gzFile gzbufdesc; -static BZFILE* bzbufdesc; static lzma_stream lstrm = LZMA_STREAM_INIT; +#ifndef WITHOUT_BZIP2 +static BZFILE* bzbufdesc; +#endif static unsigned char *buffer; static unsigned char *bufpos; @@ -72,7 +77,6 @@ static inline int grep_refill(struct file *f) { ssize_t nr; - int bzerr; if (filebehave == FILE_MMAP) return (0); @@ -80,9 +84,12 @@ grep_refill(struct file *f) bufpos = buffer; bufrem = 0; - if (filebehave == FILE_GZIP) + if (filebehave == FILE_GZIP) { nr = gzread(gzbufdesc, buffer, MAXBUFSIZ); - else if (filebehave == FILE_BZIP && bzbufdesc != NULL) { +#ifndef WITHOUT_BZIP2 + } else if (filebehave == FILE_BZIP && bzbufdesc != NULL) { + int bzerr; + nr = BZ2_bzRead(&bzerr, bzbufdesc, buffer, MAXBUFSIZ); switch (bzerr) { case BZ_OK: @@ -108,6 +115,7 @@ grep_refill(struct file *f) /* Make sure we exit with an error */ nr = -1; } +#endif } else if ((filebehave == FILE_XZ) || (filebehave == FILE_LZMA)) { lzma_action action = LZMA_RUN; uint8_t in_buf[MAXBUFSIZ]; @@ -271,9 +279,11 @@ grep_open(const char *path) (gzbufdesc = gzdopen(f->fd, "r")) == NULL) goto error2; +#ifndef WITHOUT_BZIP2 if (filebehave == FILE_BZIP && (bzbufdesc = BZ2_bzdopen(f->fd, "r")) == NULL) goto error2; +#endif /* Fill read buffer, also catches errors early */ if (bufrem == 0 && grep_refill(f) != 0) Modified: stable/9/usr.bin/grep/grep.c ============================================================================== --- stable/9/usr.bin/grep/grep.c Thu Oct 20 15:58:05 2011 (r226572) +++ stable/9/usr.bin/grep/grep.c Thu Oct 20 16:08:11 2011 (r226573) @@ -150,15 +150,13 @@ bool prev; /* flag whether or not the int tail; /* lines left to print */ bool notfound; /* file not found */ -extern char *__progname; - /* * Prints usage information and returns 2. */ static void usage(void) { - fprintf(stderr, getstr(4), __progname); + fprintf(stderr, getstr(4), getprogname()); fprintf(stderr, "%s", getstr(5)); fprintf(stderr, "%s", getstr(5)); fprintf(stderr, "%s", getstr(6)); @@ -332,7 +330,8 @@ int main(int argc, char *argv[]) { char **aargv, **eargv, *eopts; - char *pn, *ep; + char *ep; + const char *pn; unsigned long long l; unsigned int aargc, eargc, i; int c, lastc, needpattern, newarg, prevoptind; @@ -346,7 +345,7 @@ main(int argc, char *argv[]) /* Check what is the program name of the binary. In this way we can have all the funcionalities in one binary without the need of scripting and using ugly hacks. */ - pn = __progname; + pn = getprogname(); if (pn[0] == 'b' && pn[1] == 'z') { filebehave = FILE_BZIP; pn += 2; @@ -508,6 +507,10 @@ main(int argc, char *argv[]) cflags |= REG_ICASE; break; case 'J': +#ifdef WITHOUT_BZIP2 + errno = EOPNOTSUPP; + err(2, "bzip2 support was disabled at compile-time"); +#endif filebehave = FILE_BZIP; break; case 'L': @@ -568,7 +571,7 @@ main(int argc, char *argv[]) filebehave = FILE_MMAP; break; case 'V': - printf(getstr(9), __progname, VERSION); + printf(getstr(9), getprogname(), VERSION); exit(0); case 'v': vflag = true; Modified: stable/9/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- stable/9/usr.bin/grep/regex/tre-fastmatch.c Thu Oct 20 15:58:05 2011 (r226572) +++ stable/9/usr.bin/grep/regex/tre-fastmatch.c Thu Oct 20 16:08:11 2011 (r226573) @@ -1,4 +1,4 @@ -/* $FreeBSD$ */ +/* $FreeBSD$ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -548,7 +548,7 @@ tre_compile_fast(fastmatch_t *fg, const int cflags) { tre_char_t *tmp; - size_t pos = 0, hasdot = 0, whasdot = 0;; + size_t pos = 0, hasdot = 0, whasdot = 0; ssize_t firstdot = -1, wfirstdot = -1; bool escaped = false; bool *_escmap = NULL; @@ -694,7 +694,7 @@ badpat: return REG_BADPAT; } - fg->hasdot = whasdot; + fg->hasdot = wfirstdot > -1; /* * The pattern has been processed and copied to tmp as a literal string Modified: stable/9/usr.bin/grep/util.c ============================================================================== --- stable/9/usr.bin/grep/util.c Thu Oct 20 15:58:05 2011 (r226572) +++ stable/9/usr.bin/grep/util.c Thu Oct 20 16:08:11 2011 (r226573) @@ -233,7 +233,7 @@ procfile(const char *fn) linesqueued++; } c += t; - if (mflag && mcount < 0) + if (mflag && mcount <= 0) break; } if (Bflag > 0) From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 16:40:38 2011 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 8317E106566B; Thu, 20 Oct 2011 16:40:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 0F5F58FC14; Thu, 20 Oct 2011 16:40:38 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 2A89F25D388E; Thu, 20 Oct 2011 16:40:37 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 76BFABD3C46; Thu, 20 Oct 2011 16:40:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 3WnsghmqY3Bq; Thu, 20 Oct 2011 16:40:35 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id D2A42BD3C31; Thu, 20 Oct 2011 16:40:34 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201110201558.p9KFw550081440@svn.freebsd.org> Date: Thu, 20 Oct 2011 16:40:33 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <9A674915-EF68-4CEA-93CB-CDE349082019@FreeBSD.org> References: <201110201558.p9KFw550081440@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1084) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r226572 - stable/9/sys/netinet 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: Thu, 20 Oct 2011 16:40:38 -0000 On 20. Oct 2011, at 15:58 , Gleb Smirnoff wrote: > Author: glebius > Date: Thu Oct 20 15:58:05 2011 > New Revision: 226572 > URL: http://svn.freebsd.org/changeset/base/226572 >=20 > Log: > MFhead 226401,226402: >=20 > Remove last remnants of classful addressing: >=20 > - Remove ia_net, ia_netmask, ia_netbroadcast from struct in_ifaddr. > - Remove net.inet.ip.subnetsarelocal, I bet no one need it in 2011. > - fix bug when we were not forwarding to a host which matches = classful > net address. For example router having 192.168.x.y/16 network = attached, > would not forward traffic to 192.168.*.0, which are legal IPs in > CIDR world. > - For compatibility, leave autoguessing of mask based on class. >=20 > Reviewed by: andre, bz, rwatson >=20 > Add support for IPv4 /31 prefixes, as described in RFC3021. >=20 > To run a /31 network, participating hosts MUST drop support > for directed broadcasts, and treat the first and last addresses > on subnet as unicast. The broadcast address for the prefix > should be the link local broadcast address, INADDR_BROADCAST. ... > Modified: stable/9/sys/netinet/in_var.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/sys/netinet/in_var.h Thu Oct 20 15:55:01 2011 = (r226571) > +++ stable/9/sys/netinet/in_var.h Thu Oct 20 15:58:05 2011 = (r226572) > @@ -60,12 +60,9 @@ struct in_ifaddr { > struct ifaddr ia_ifa; /* protocol-independent info */ > #define ia_ifp ia_ifa.ifa_ifp > #define ia_flags ia_ifa.ifa_flags > - /* ia_{,sub}net{,mask} in host = order */ > - u_long ia_net; /* network number of interface = */ > - u_long ia_netmask; /* mask of net part */ > - u_long ia_subnet; /* subnet number, including net = */ > - u_long ia_subnetmask; /* mask of subnet part */ > - struct in_addr ia_netbroadcast; /* to recognize net broadcasts = */ > + /* ia_subnet{,mask} in host = order */ > + u_long ia_subnet; /* subnet address */ > + u_long ia_subnetmask; /* mask of subnet */ > LIST_ENTRY(in_ifaddr) ia_hash; /* entry in bucket of inet = addresses */ > TAILQ_ENTRY(in_ifaddr) ia_link; /* list of internet addresses */ > struct sockaddr_in ia_addr; /* reserve space for interface = name */ This should at least break parts of netstat and ifmcstat as I had told = you in private email before. --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 17:09:54 2011 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 051E41065676; Thu, 20 Oct 2011 17:09:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7FE68FC14; Thu, 20 Oct 2011 17:09:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KH9reb083752; Thu, 20 Oct 2011 17:09:53 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KH9rJS083750; Thu, 20 Oct 2011 17:09:53 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201110201709.p9KH9rJS083750@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 20 Oct 2011 17:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226574 - stable/9/sys/netinet 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: Thu, 20 Oct 2011 17:09:54 -0000 Author: np Date: Thu Oct 20 17:09:53 2011 New Revision: 226574 URL: http://svn.freebsd.org/changeset/base/226574 Log: MFC r226318: Make sure the inp wasn't dropped when rexmt let go of the inp and pcbinfo locks. Approved by: re (kib) Modified: stable/9/sys/netinet/tcp_timer.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_timer.c ============================================================================== --- stable/9/sys/netinet/tcp_timer.c Thu Oct 20 16:08:11 2011 (r226573) +++ stable/9/sys/netinet/tcp_timer.c Thu Oct 20 17:09:53 2011 (r226574) @@ -495,6 +495,13 @@ tcp_timer_rexmt(void * xtp) CURVNET_RESTORE(); return; } + if (inp->inp_flags & INP_DROPPED) { + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } + tp = tcp_drop(tp, tp->t_softerror ? tp->t_softerror : ETIMEDOUT); headlocked = 1; From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 17:33:23 2011 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 53FB51065673; Thu, 20 Oct 2011 17:33:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4270D8FC19; Thu, 20 Oct 2011 17:33:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KHXND5084529; Thu, 20 Oct 2011 17:33:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KHXN93084527; Thu, 20 Oct 2011 17:33:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201110201733.p9KHXN93084527@svn.freebsd.org> From: Dimitry Andric Date: Thu, 20 Oct 2011 17:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226575 - stable/9/gnu/usr.bin/cc/cc_tools 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: Thu, 20 Oct 2011 17:33:23 -0000 Author: dim Date: Thu Oct 20 17:33:22 2011 New Revision: 226575 URL: http://svn.freebsd.org/changeset/base/226575 Log: Update gcc's __FreeBSD__ and __FreeBSD_cc_version macros for FreeBSD 9. This is a direct commit to stable/9, since the macro values are different in head. Approved by: re (kib) Modified: stable/9/gnu/usr.bin/cc/cc_tools/freebsd-native.h Modified: stable/9/gnu/usr.bin/cc/cc_tools/freebsd-native.h ============================================================================== --- stable/9/gnu/usr.bin/cc/cc_tools/freebsd-native.h Thu Oct 20 17:09:53 2011 (r226574) +++ stable/9/gnu/usr.bin/cc/cc_tools/freebsd-native.h Thu Oct 20 17:33:22 2011 (r226575) @@ -7,8 +7,8 @@ #define FREEBSD_NATIVE 1 /* Fake out gcc/config/freebsd.h. */ -#define FBSD_MAJOR 8 -#define FBSD_CC_VER 800001 /* form like __FreeBSD_version */ +#define FBSD_MAJOR 9 +#define FBSD_CC_VER 900001 /* form like __FreeBSD_version */ #undef SYSTEM_INCLUDE_DIR /* We don't need one for now. */ #undef TOOL_INCLUDE_DIR /* We don't need one for now. */ From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 18:39:01 2011 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 C73FE106564A; Thu, 20 Oct 2011 18:39:01 +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 B512E8FC13; Thu, 20 Oct 2011 18:39:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KId1dd086600; Thu, 20 Oct 2011 18:39:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KId1px086598; Thu, 20 Oct 2011 18:39:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110201839.p9KId1px086598@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 Oct 2011 18:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226576 - stable/9/sys/dev/iscsi/initiator 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: Thu, 20 Oct 2011 18:39:01 -0000 Author: kib Date: Thu Oct 20 18:39:01 2011 New Revision: 226576 URL: http://svn.freebsd.org/changeset/base/226576 Log: MFC r226208: Do not ignore block offsets. PR: kern/160943 Approved by: re (bz) Modified: stable/9/sys/dev/iscsi/initiator/iscsi_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/iscsi/initiator/iscsi_subr.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsi_subr.c Thu Oct 20 17:33:22 2011 (r226575) +++ stable/9/sys/dev/iscsi/initiator/iscsi_subr.c Thu Oct 20 18:39:01 2011 (r226576) @@ -84,6 +84,7 @@ iscsi_r2t(isc_session_t *sp, pduq_t *opq caddr_t bp = csio->data_ptr; bo = ntohl(r2t->bo); + bp += MIN(bo, edtl - ddtl); bleft = ddtl; if(sp->opt.maxXmitDataSegmentLength > 0) // danny's RFC From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 18:47:58 2011 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 8387B1065677; Thu, 20 Oct 2011 18:47:58 +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 583F28FC14; Thu, 20 Oct 2011 18:47:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KIlwth086947; Thu, 20 Oct 2011 18:47:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KIlwCP086944; Thu, 20 Oct 2011 18:47:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110201847.p9KIlwCP086944@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 Oct 2011 18:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226577 - in stable/9/sys: fs/devfs sys 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: Thu, 20 Oct 2011 18:47:58 -0000 Author: kib Date: Thu Oct 20 18:47:58 2011 New Revision: 226577 URL: http://svn.freebsd.org/changeset/base/226577 Log: MFC r226041: Export devfs inode number allocator for the kernel consumers. Approved by: re (bz) Modified: stable/9/sys/fs/devfs/devfs_devs.c stable/9/sys/sys/conf.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/fs/devfs/devfs_devs.c ============================================================================== --- stable/9/sys/fs/devfs/devfs_devs.c Thu Oct 20 18:39:01 2011 (r226576) +++ stable/9/sys/fs/devfs/devfs_devs.c Thu Oct 20 18:47:58 2011 (r226577) @@ -171,8 +171,7 @@ devfs_free(struct cdev *cdev) cdp = cdev2priv(cdev); if (cdev->si_cred != NULL) crfree(cdev->si_cred); - if (cdp->cdp_inode > 0) - free_unr(devfs_inos, cdp->cdp_inode); + devfs_free_cdp_inode(cdp->cdp_inode); if (cdp->cdp_maxdirent > 0) free(cdp->cdp_dirents, M_DEVFS2); free(cdp, M_CDEVP); @@ -394,7 +393,7 @@ devfs_delete(struct devfs_mount *dm, str mac_devfs_destroy(de); #endif if (de->de_inode > DEVFS_ROOTINO) { - free_unr(devfs_inos, de->de_inode); + devfs_free_cdp_inode(de->de_inode); de->de_inode = 0; } if (DEVFS_DE_DROP(de)) @@ -685,6 +684,21 @@ devfs_destroy(struct cdev *dev) devfs_generation++; } +ino_t +devfs_alloc_cdp_inode(void) +{ + + return (alloc_unr(devfs_inos)); +} + +void +devfs_free_cdp_inode(ino_t ino) +{ + + if (ino > 0) + free_unr(devfs_inos, ino); +} + static void devfs_devs_init(void *junk __unused) { Modified: stable/9/sys/sys/conf.h ============================================================================== --- stable/9/sys/sys/conf.h Thu Oct 20 18:39:01 2011 (r226576) +++ stable/9/sys/sys/conf.h Thu Oct 20 18:47:58 2011 (r226577) @@ -301,6 +301,9 @@ int devfs_set_cdevpriv(void *priv, cdevp void devfs_clear_cdevpriv(void); void devfs_fpdrop(struct file *fp); /* XXX This is not public KPI */ +ino_t devfs_alloc_cdp_inode(void); +void devfs_free_cdp_inode(ino_t ino); + #define UID_ROOT 0 #define UID_BIN 3 #define UID_UUCP 66 From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 18:54:05 2011 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 681A31065670; Thu, 20 Oct 2011 18:54:05 +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 55A0C8FC08; Thu, 20 Oct 2011 18:54:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KIs5kF087172; Thu, 20 Oct 2011 18:54:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KIs5Z8087169; Thu, 20 Oct 2011 18:54:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110201854.p9KIs5Z8087169@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 Oct 2011 18:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226578 - in stable/9/sys: kern sys 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: Thu, 20 Oct 2011 18:54:05 -0000 Author: kib Date: Thu Oct 20 18:54:05 2011 New Revision: 226578 URL: http://svn.freebsd.org/changeset/base/226578 Log: MFC r226042: Supply unique (st_dev, st_ino) value pair for the fstat(2) done on the pipes. Approved by: re (bz) Modified: stable/9/sys/kern/sys_pipe.c stable/9/sys/sys/pipe.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sys_pipe.c ============================================================================== --- stable/9/sys/kern/sys_pipe.c Thu Oct 20 18:47:58 2011 (r226577) +++ stable/9/sys/kern/sys_pipe.c Thu Oct 20 18:54:05 2011 (r226578) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -224,6 +225,8 @@ static int pipe_zone_init(void *mem, int static void pipe_zone_fini(void *mem, int size); static uma_zone_t pipe_zone; +static struct unrhdr *pipeino_unr; +static dev_t pipedev_ino; SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL); @@ -235,6 +238,10 @@ pipeinit(void *dummy __unused) pipe_zone_ctor, NULL, pipe_zone_init, pipe_zone_fini, UMA_ALIGN_PTR, 0); KASSERT(pipe_zone != NULL, ("pipe_zone not initialized")); + pipeino_unr = new_unrhdr(1, INT32_MAX, NULL); + KASSERT(pipeino_unr != NULL, ("pipe fake inodes not initialized")); + pipedev_ino = devfs_alloc_cdp_inode(); + KASSERT(pipedev_ino > 0, ("pipe dev inode not initialized")); } static int @@ -562,6 +569,12 @@ pipe_create(pipe, backing) /* If we're not backing this pipe, no need to do anything. */ error = 0; } + if (error == 0) { + pipe->pipe_ino = alloc_unr(pipeino_unr); + if (pipe->pipe_ino == -1) + /* pipeclose will clear allocated kva */ + error = ENOMEM; + } return (error); } @@ -1408,9 +1421,10 @@ pipe_stat(fp, ub, active_cred, td) ub->st_ctim = pipe->pipe_ctime; ub->st_uid = fp->f_cred->cr_uid; ub->st_gid = fp->f_cred->cr_gid; + ub->st_dev = pipedev_ino; + ub->st_ino = pipe->pipe_ino; /* - * Left as 0: st_dev, st_ino, st_nlink, st_rdev, st_flags, st_gen. - * XXX (st_dev, st_ino) should be unique. + * Left as 0: st_nlink, st_rdev, st_flags, st_gen. */ return (0); } @@ -1463,6 +1477,7 @@ pipeclose(cpipe) { struct pipepair *pp; struct pipe *ppipe; + ino_t ino; KASSERT(cpipe != NULL, ("pipeclose: cpipe == NULL")); @@ -1521,6 +1536,12 @@ pipeclose(cpipe) knlist_destroy(&cpipe->pipe_sel.si_note); /* + * Postpone the destroy of the fake inode number allocated for + * our end, until pipe mtx is unlocked. + */ + ino = cpipe->pipe_ino; + + /* * If both endpoints are now closed, release the memory for the * pipe pair. If not, unlock. */ @@ -1532,6 +1553,9 @@ pipeclose(cpipe) uma_zfree(pipe_zone, cpipe->pipe_pair); } else PIPE_UNLOCK(cpipe); + + if (ino > 0) + free_unr(pipeino_unr, cpipe->pipe_ino); } /*ARGSUSED*/ Modified: stable/9/sys/sys/pipe.h ============================================================================== --- stable/9/sys/sys/pipe.h Thu Oct 20 18:47:58 2011 (r226577) +++ stable/9/sys/sys/pipe.h Thu Oct 20 18:54:05 2011 (r226578) @@ -112,6 +112,7 @@ struct pipe { u_int pipe_state; /* pipe status info */ int pipe_busy; /* busy flag, mostly to handle rundown sanely */ int pipe_present; /* still present? */ + ino_t pipe_ino; /* fake inode for stat(2) */ }; /* From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 19:16:52 2011 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 C7ECF106564A; Thu, 20 Oct 2011 19:16:52 +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 B61738FC12; Thu, 20 Oct 2011 19:16:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KJGqJA087934; Thu, 20 Oct 2011 19:16:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KJGqaJ087932; Thu, 20 Oct 2011 19:16:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110201916.p9KJGqaJ087932@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 Oct 2011 19:16:52 +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: r226579 - stable/8/sys/dev/iscsi/initiator 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: Thu, 20 Oct 2011 19:16:52 -0000 Author: kib Date: Thu Oct 20 19:16:52 2011 New Revision: 226579 URL: http://svn.freebsd.org/changeset/base/226579 Log: MFC r226208: Do not ignore block offsets. PR: kern/160943 Modified: stable/8/sys/dev/iscsi/initiator/iscsi_subr.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/iscsi/initiator/iscsi_subr.c ============================================================================== --- stable/8/sys/dev/iscsi/initiator/iscsi_subr.c Thu Oct 20 18:54:05 2011 (r226578) +++ stable/8/sys/dev/iscsi/initiator/iscsi_subr.c Thu Oct 20 19:16:52 2011 (r226579) @@ -84,6 +84,7 @@ iscsi_r2t(isc_session_t *sp, pduq_t *opq caddr_t bp = csio->data_ptr; bo = ntohl(r2t->bo); + bp += MIN(bo, edtl - ddtl); bleft = ddtl; if(sp->opt.maxXmitDataSegmentLength > 0) // danny's RFC From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 19:23:22 2011 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 001C51065679; Thu, 20 Oct 2011 19:23:21 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E26198FC0C; Thu, 20 Oct 2011 19:23:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KJNLlQ088182; Thu, 20 Oct 2011 19:23:21 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KJNLjx088180; Thu, 20 Oct 2011 19:23:21 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201110201923.p9KJNLjx088180@svn.freebsd.org> From: Sean Bruno Date: Thu, 20 Oct 2011 19:23:21 +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: r226580 - stable/7/libexec/tftpd 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: Thu, 20 Oct 2011 19:23:22 -0000 Author: sbruno Date: Thu Oct 20 19:23:21 2011 New Revision: 226580 URL: http://svn.freebsd.org/changeset/base/226580 Log: MFC r224536: Confirmed behavior of a Cisco 6509 in production. In the old TFTP server, there was an undocumented behavior where the block counter would rollover to 0 if a file larger than 65535 blocks was transferred. With the default block size of 512 octets per block, this is a file size of approximately 32 megabytes. The new TFTP server code would report an error and stop transferring the file if a file was larger than 65535 blocks. This patch restores the old TFTP server's behavior to the new TFTP server code. If a TFTP client transfers a file larger than 65535 blocks, and does *not* specify the "rollover" option, then automatically rollover the block counter to 0 every time we reach 65535 blocks. This restores interoperability with the FreeBSD 6 TFTP client. Without this change, if a FreeBSD 6 TFTP client tried to retrieve a file larger than 65535 blocks from a FreeBSD 9 TFTP server , the transfer would fail. The same file could be retrieved successfully if the same FreeBSD 6 TFTP client was used against a FreeBSD 6 TFTP server. Approved by: re (kib) Tested by: Pawan Gupta , Obtained from: Juniper Networks FreeBSD7 Reviewed by: Yahoo Inc. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M tftpd/tftp-transfer.c Modified: stable/7/libexec/tftpd/tftp-transfer.c Modified: stable/7/libexec/tftpd/tftp-transfer.c ============================================================================== --- stable/7/libexec/tftpd/tftp-transfer.c Thu Oct 20 19:16:52 2011 (r226579) +++ stable/7/libexec/tftpd/tftp-transfer.c Thu Oct 20 19:23:21 2011 (r226580) @@ -129,14 +129,16 @@ tftp_send(int peer, uint16_t *block, str (*block)++; if (oldblock > *block) { if (options[OPT_ROLLOVER].o_request == NULL) { - tftp_log(LOG_ERR, - "Block rollover but not allowed."); - send_error(peer, EBADOP); - gettimeofday(&(ts->tstop), NULL); - return; + /* + * "rollover" option not specified in + * tftp client. Default to rolling block + * counter to 0. + */ + *block = 0; + } else { + *block = atoi(options[OPT_ROLLOVER].o_request); } - *block = atoi(options[OPT_ROLLOVER].o_request); ts->rollovers++; } gettimeofday(&(ts->tstop), NULL); @@ -196,14 +198,16 @@ tftp_receive(int peer, uint16_t *block, (*block)++; if (oldblock > *block) { if (options[OPT_ROLLOVER].o_request == NULL) { - tftp_log(LOG_ERR, - "Block rollover but not allowed."); - send_error(peer, EBADOP); - gettimeofday(&(ts->tstop), NULL); - return; + /* + * "rollover" option not specified in + * tftp client. Default to rolling block + * counter to 0. + */ + *block = 0; + } else { + *block = atoi(options[OPT_ROLLOVER].o_request); } - *block = atoi(options[OPT_ROLLOVER].o_request); ts->rollovers++; } From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 19:56:08 2011 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 128F81065674; Thu, 20 Oct 2011 19:56:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 9B4928FC15; Thu, 20 Oct 2011 19:56:07 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p9KJu3d1033377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Oct 2011 22:56:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p9KJu2UY070266; Thu, 20 Oct 2011 22:56:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p9KJu2O8070265; Thu, 20 Oct 2011 22:56:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 20 Oct 2011 22:56:02 +0300 From: Kostik Belousov To: Sean Bruno Message-ID: <20111020195602.GD50300@deviant.kiev.zoral.com.ua> References: <201110201923.p9KJNLjx088180@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uLm21ivgZj9Xvi41" Content-Disposition: inline In-Reply-To: <201110201923.p9KJNLjx088180@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r226580 - stable/7/libexec/tftpd 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: Thu, 20 Oct 2011 19:56:08 -0000 --uLm21ivgZj9Xvi41 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 20, 2011 at 07:23:21PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Thu Oct 20 19:23:21 2011 > New Revision: 226580 > URL: http://svn.freebsd.org/changeset/base/226580 >=20 > Log: > MFC r224536: > Confirmed behavior of a Cisco 6509 in production. > =20 > In the old TFTP server, there was an undocumented behavior where > the block counter would rollover to 0 if a file larger > than 65535 blocks was transferred. With the default block size > of 512 octets per block, this is a file size of approximately 32 megaby= tes. > =20 > The new TFTP server code would report an error and stop transferring > the file if a file was larger than 65535 blocks. > =20 > This patch restores the old TFTP server's behavior to the new > TFTP server code. If a TFTP client transfers a file larger > than 65535 blocks, and does *not* specify the "rollover" option, > then automatically rollover the block counter to 0 every time > we reach 65535 blocks. > =20 > This restores interoperability with the FreeBSD 6 TFTP client. > Without this change, if a FreeBSD 6 TFTP client tried to > retrieve a file larger than 65535 blocks from a FreeBSD 9 TFTP server > , the transfer would fail. > The same file could be retrieved successfully if the same FreeBSD 6 > TFTP client was used against a FreeBSD 6 TFTP server. > =20 > Approved by: re (kib) It was not. It looks like people just think that 'Approved by: kib' is some voodo that must be appended for no reason. Today it is second time happened for the commit that I did not approved. It does not matter much for the branch opened for the general commits. Still, I would prefer that people do not falsely accuse me of wrongdoing :). > Tested by: Pawan Gupta , > Obtained from: Juniper Networks > FreeBSD7 Reviewed by: Yahoo Inc. > =20 > > Submitted by: If someone else sent in the change. > > Reviewed by: If someone else reviewed your modification. > > Approved by: If you needed approval for this commit. > > Obtained from: If the change is from a third party. > > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > > Security: Vulnerability reference (one per line) or description. > > Empty fields above will be automatically removed. > =20 > M tftpd/tftp-transfer.c >=20 > Modified: > stable/7/libexec/tftpd/tftp-transfer.c >=20 > Modified: stable/7/libexec/tftpd/tftp-transfer.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/7/libexec/tftpd/tftp-transfer.c Thu Oct 20 19:16:52 2011 (r226= 579) > +++ stable/7/libexec/tftpd/tftp-transfer.c Thu Oct 20 19:23:21 2011 (r226= 580) > @@ -129,14 +129,16 @@ tftp_send(int peer, uint16_t *block, str > (*block)++; > if (oldblock > *block) { > if (options[OPT_ROLLOVER].o_request =3D=3D NULL) { > - tftp_log(LOG_ERR, > - "Block rollover but not allowed."); > - send_error(peer, EBADOP); > - gettimeofday(&(ts->tstop), NULL); > - return; > + /* > + * "rollover" option not specified in > + * tftp client. Default to rolling block > + * counter to 0. > + */ > + *block =3D 0; > + } else { > + *block =3D atoi(options[OPT_ROLLOVER].o_request); > } > =20 > - *block =3D atoi(options[OPT_ROLLOVER].o_request); > ts->rollovers++; > } > gettimeofday(&(ts->tstop), NULL); > @@ -196,14 +198,16 @@ tftp_receive(int peer, uint16_t *block,=20 > (*block)++; > if (oldblock > *block) { > if (options[OPT_ROLLOVER].o_request =3D=3D NULL) { > - tftp_log(LOG_ERR, > - "Block rollover but not allowed."); > - send_error(peer, EBADOP); > - gettimeofday(&(ts->tstop), NULL); > - return; > + /* > + * "rollover" option not specified in > + * tftp client. Default to rolling block > + * counter to 0. > + */ > + *block =3D 0; > + } else { > + *block =3D atoi(options[OPT_ROLLOVER].o_request); > } > =20 > - *block =3D atoi(options[OPT_ROLLOVER].o_request); > ts->rollovers++; > } > =20 --uLm21ivgZj9Xvi41 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6gfNIACgkQC3+MBN1Mb4jN1QCgx7o4jAnkdwQriqN3ov5LOWXn eUEAn1wIChRx6yh/ZnE9K6PrqzofNXYl =1RD/ -----END PGP SIGNATURE----- --uLm21ivgZj9Xvi41-- From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 20:31:09 2011 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 93061106564A; Thu, 20 Oct 2011 20:31:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 813408FC14; Thu, 20 Oct 2011 20:31:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KKV9GY090386; Thu, 20 Oct 2011 20:31:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KKV98F090384; Thu, 20 Oct 2011 20:31:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201110202031.p9KKV98F090384@svn.freebsd.org> From: Xin LI Date: Thu, 20 Oct 2011 20:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226581 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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: Thu, 20 Oct 2011 20:31:09 -0000 Author: delphij Date: Thu Oct 20 20:31:09 2011 New Revision: 226581 URL: http://svn.freebsd.org/changeset/base/226581 Log: MFC r226483: Fix a bug in sa_find_sizes() which could lead to panic: When calculating space needed for SA_BONUS buffers, hdrsize is always rounded up to next 8-aligned boundary. However, in two places the round up was done against sum of 'total' plus hdrsize. On the other hand, hdrsize increments by 4 each time, which means in certain conditions, we would end up returning with will_spill == 0 and (total + hdrsize) larger than full_space, leading to a failed assertion because it's invalid for dmu_set_bonus. Sponsored by: iXsystems, Inc. Reviewed by: mm Approved by: re (kib) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Thu Oct 20 19:23:21 2011 (r226580) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Thu Oct 20 20:31:09 2011 (r226581) @@ -605,14 +605,14 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ * and spill buffer. */ if (buftype == SA_BONUS && *index == -1 && - P2ROUNDUP(*total + hdrsize, 8) > + (*total + P2ROUNDUP(hdrsize, 8)) > (full_space - sizeof (blkptr_t))) { *index = i; done = B_TRUE; } next: - if (P2ROUNDUP(*total + hdrsize, 8) > full_space && + if ((*total + P2ROUNDUP(hdrsize, 8)) > full_space && buftype == SA_BONUS) *will_spill = B_TRUE; } From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 20:33:32 2011 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 4FF0D1065670; Thu, 20 Oct 2011 20:33:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F00D8FC1D; Thu, 20 Oct 2011 20:33:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KKXWMH090504; Thu, 20 Oct 2011 20:33:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KKXWEt090502; Thu, 20 Oct 2011 20:33:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201110202033.p9KKXWEt090502@svn.freebsd.org> From: Xin LI Date: Thu, 20 Oct 2011 20:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226582 - stable/9/sys/dev/tws 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: Thu, 20 Oct 2011 20:33:32 -0000 Author: delphij Date: Thu Oct 20 20:33:31 2011 New Revision: 226582 URL: http://svn.freebsd.org/changeset/base/226582 Log: MFC r226476: Return BUS_PROBE_DEFAULT instead of 0 (BUS_PROBE_SPECIFIC), allowing vendor provided driver to override in kernel driver. Approved by: re (kib) Modified: stable/9/sys/dev/tws/tws.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/tws/tws.c ============================================================================== --- stable/9/sys/dev/tws/tws.c Thu Oct 20 20:31:09 2011 (r226581) +++ stable/9/sys/dev/tws/tws.c Thu Oct 20 20:33:31 2011 (r226582) @@ -172,7 +172,7 @@ tws_probe(device_t dev) first_ctlr = 0; } - return(0); + return(BUS_PROBE_DEFAULT); } return (ENXIO); } From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 21:48:10 2011 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 35FED106564A; Thu, 20 Oct 2011 21:48:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 243E28FC14; Thu, 20 Oct 2011 21:48:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KLmA16093101; Thu, 20 Oct 2011 21:48:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KLmAnp093099; Thu, 20 Oct 2011 21:48:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201110202148.p9KLmAnp093099@svn.freebsd.org> From: Xin LI Date: Thu, 20 Oct 2011 21:48: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: r226588 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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: Thu, 20 Oct 2011 21:48:10 -0000 Author: delphij Date: Thu Oct 20 21:48:09 2011 New Revision: 226588 URL: http://svn.freebsd.org/changeset/base/226588 Log: MFC r226483: Fix a bug in sa_find_sizes() which could lead to panic: When calculating space needed for SA_BONUS buffers, hdrsize is always rounded up to next 8-aligned boundary. However, in two places the round up was done against sum of 'total' plus hdrsize. On the other hand, hdrsize increments by 4 each time, which means in certain conditions, we would end up returning with will_spill == 0 and (total + hdrsize) larger than full_space, leading to a failed assertion because it's invalid for dmu_set_bonus. Sponsored by: iXsystems, Inc. Reviewed by: mm Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Thu Oct 20 21:15:43 2011 (r226587) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Thu Oct 20 21:48:09 2011 (r226588) @@ -605,14 +605,14 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ * and spill buffer. */ if (buftype == SA_BONUS && *index == -1 && - P2ROUNDUP(*total + hdrsize, 8) > + (*total + P2ROUNDUP(hdrsize, 8)) > (full_space - sizeof (blkptr_t))) { *index = i; done = B_TRUE; } next: - if (P2ROUNDUP(*total + hdrsize, 8) > full_space && + if ((*total + P2ROUNDUP(hdrsize, 8)) > full_space && buftype == SA_BONUS) *will_spill = B_TRUE; } From owner-svn-src-stable@FreeBSD.ORG Thu Oct 20 21:49:26 2011 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 A83B71065670; Thu, 20 Oct 2011 21:49:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 975898FC12; Thu, 20 Oct 2011 21:49:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9KLnQEg093191; Thu, 20 Oct 2011 21:49:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9KLnQpI093189; Thu, 20 Oct 2011 21:49:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201110202149.p9KLnQpI093189@svn.freebsd.org> From: Xin LI Date: Thu, 20 Oct 2011 21:49:26 +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: r226589 - stable/8/sys/dev/tws 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: Thu, 20 Oct 2011 21:49:26 -0000 Author: delphij Date: Thu Oct 20 21:49:26 2011 New Revision: 226589 URL: http://svn.freebsd.org/changeset/base/226589 Log: MFC r226476: Return BUS_PROBE_DEFAULT instead of 0 (BUS_PROBE_SPECIFIC), allowing vendor provided driver to override in kernel driver. Modified: stable/8/sys/dev/tws/tws.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/tws/tws.c ============================================================================== --- stable/8/sys/dev/tws/tws.c Thu Oct 20 21:48:09 2011 (r226588) +++ stable/8/sys/dev/tws/tws.c Thu Oct 20 21:49:26 2011 (r226589) @@ -172,7 +172,7 @@ tws_probe(device_t dev) first_ctlr = 0; } - return(0); + return(BUS_PROBE_DEFAULT); } return (ENXIO); } From owner-svn-src-stable@FreeBSD.ORG Fri Oct 21 05:37:40 2011 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 E00D1106566C; Fri, 21 Oct 2011 05:37:40 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE8118FC12; Fri, 21 Oct 2011 05:37:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9L5be4P008040; Fri, 21 Oct 2011 05:37:40 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9L5belh008038; Fri, 21 Oct 2011 05:37:40 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201110210537.p9L5belh008038@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 21 Oct 2011 05:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226591 - stable/9/usr.bin/script 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: Fri, 21 Oct 2011 05:37:41 -0000 Author: trociny Date: Fri Oct 21 05:37:40 2011 New Revision: 226591 URL: http://svn.freebsd.org/changeset/base/226591 Log: MFC r226403: In r225809 the intention was to send VEOF only once if STDIN was not a terminal. Unfortunately the fix was incorrect and for flushtime > 0 it keept sending VEOF. Sent VEOF generates ^D\b\b echoed by the terminal, which was reported in bin/161526. Note, we still send VEOF at least once. Otherwise commands like below would hang forever: echo 1 |script /tmp/script.out cat PR: bin/161526 Reported by: Adrian Wontroba , Stefan Bethke Tested by: Stefan Bethke Approved by: re (kib) Modified: stable/9/usr.bin/script/script.c Directory Properties: stable/9/usr.bin/script/ (props changed) Modified: stable/9/usr.bin/script/script.c ============================================================================== --- stable/9/usr.bin/script/script.c Thu Oct 20 22:38:24 2011 (r226590) +++ stable/9/usr.bin/script/script.c Fri Oct 21 05:37:40 2011 (r226591) @@ -163,12 +163,15 @@ main(int argc, char *argv[]) FD_SET(master, &rfd); if (readstdin) FD_SET(STDIN_FILENO, &rfd); - if ((!readstdin && ttyflg) || flushtime > 0) { - tv.tv_sec = !readstdin && ttyflg ? 1 : - flushtime - (tvec - start); + if (!readstdin && ttyflg) { + tv.tv_sec = 1; tv.tv_usec = 0; tvp = &tv; readstdin = 1; + } else if (flushtime > 0) { + tv.tv_sec = flushtime - (tvec - start); + tv.tv_usec = 0; + tvp = &tv; } else { tvp = NULL; } From owner-svn-src-stable@FreeBSD.ORG Fri Oct 21 05:40:31 2011 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 076BD106566B; Fri, 21 Oct 2011 05:40:31 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA0178FC14; Fri, 21 Oct 2011 05:40:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9L5eUoo008167; Fri, 21 Oct 2011 05:40:30 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9L5eUM9008165; Fri, 21 Oct 2011 05:40:30 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201110210540.p9L5eUM9008165@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 21 Oct 2011 05:40:30 +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: r226592 - stable/8/usr.bin/script 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: Fri, 21 Oct 2011 05:40:31 -0000 Author: trociny Date: Fri Oct 21 05:40:30 2011 New Revision: 226592 URL: http://svn.freebsd.org/changeset/base/226592 Log: MFC r226403: In r225809 the intention was to send VEOF only once if STDIN was not a terminal. Unfortunately the fix was incorrect and for flushtime > 0 it keept sending VEOF. Sent VEOF generates ^D\b\b echoed by the terminal, which was reported in bin/161526. Note, we still send VEOF at least once. Otherwise commands like below would hang forever: echo 1 |script /tmp/script.out cat PR: bin/161526 Reported by: Adrian Wontroba , Stefan Bethke Tested by: Stefan Bethke Modified: stable/8/usr.bin/script/script.c Directory Properties: stable/8/usr.bin/script/ (props changed) Modified: stable/8/usr.bin/script/script.c ============================================================================== --- stable/8/usr.bin/script/script.c Fri Oct 21 05:37:40 2011 (r226591) +++ stable/8/usr.bin/script/script.c Fri Oct 21 05:40:30 2011 (r226592) @@ -168,12 +168,15 @@ main(int argc, char *argv[]) FD_SET(master, &rfd); if (readstdin) FD_SET(STDIN_FILENO, &rfd); - if ((!readstdin && ttyflg) || flushtime > 0) { - tv.tv_sec = !readstdin && ttyflg ? 1 : - flushtime - (tvec - start); + if (!readstdin && ttyflg) { + tv.tv_sec = 1; tv.tv_usec = 0; tvp = &tv; readstdin = 1; + } else if (flushtime > 0) { + tv.tv_sec = flushtime - (tvec - start); + tv.tv_usec = 0; + tvp = &tv; } else { tvp = NULL; } From owner-svn-src-stable@FreeBSD.ORG Fri Oct 21 05:41:21 2011 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 0D1531065676; Fri, 21 Oct 2011 05:41:21 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFC928FC0A; Fri, 21 Oct 2011 05:41:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9L5fKV6008237; Fri, 21 Oct 2011 05:41:20 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9L5fKrF008235; Fri, 21 Oct 2011 05:41:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201110210541.p9L5fKrF008235@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 21 Oct 2011 05:41:20 +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: r226593 - stable/7/usr.bin/script 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: Fri, 21 Oct 2011 05:41:21 -0000 Author: trociny Date: Fri Oct 21 05:41:20 2011 New Revision: 226593 URL: http://svn.freebsd.org/changeset/base/226593 Log: MFC r226403: In r225809 the intention was to send VEOF only once if STDIN was not a terminal. Unfortunately the fix was incorrect and for flushtime > 0 it keept sending VEOF. Sent VEOF generates ^D\b\b echoed by the terminal, which was reported in bin/161526. Note, we still send VEOF at least once. Otherwise commands like below would hang forever: echo 1 |script /tmp/script.out cat PR: bin/161526 Reported by: Adrian Wontroba , Stefan Bethke Tested by: Stefan Bethke Modified: stable/7/usr.bin/script/script.c Directory Properties: stable/7/usr.bin/script/ (props changed) Modified: stable/7/usr.bin/script/script.c ============================================================================== --- stable/7/usr.bin/script/script.c Fri Oct 21 05:40:30 2011 (r226592) +++ stable/7/usr.bin/script/script.c Fri Oct 21 05:41:20 2011 (r226593) @@ -167,12 +167,15 @@ main(int argc, char *argv[]) FD_SET(master, &rfd); if (readstdin) FD_SET(STDIN_FILENO, &rfd); - if ((!readstdin && ttyflg) || flushtime > 0) { - tv.tv_sec = !readstdin && ttyflg ? 1 : - flushtime - (tvec - start); + if (!readstdin && ttyflg) { + tv.tv_sec = 1; tv.tv_usec = 0; tvp = &tv; readstdin = 1; + } else if (flushtime > 0) { + tv.tv_sec = flushtime - (tvec - start); + tv.tv_usec = 0; + tvp = &tv; } else { tvp = NULL; } From owner-svn-src-stable@FreeBSD.ORG Fri Oct 21 22:07:52 2011 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 DA37E106566B; Fri, 21 Oct 2011 22:07:52 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF3408FC0A; Fri, 21 Oct 2011 22:07:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9LM7qop043350; Fri, 21 Oct 2011 22:07:52 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9LM7q1K043348; Fri, 21 Oct 2011 22:07:52 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201110212207.p9LM7q1K043348@svn.freebsd.org> From: Kirk McKusick Date: Fri, 21 Oct 2011 22:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226621 - stable/9/sbin/tunefs 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: Fri, 21 Oct 2011 22:07:53 -0000 Author: mckusick Date: Fri Oct 21 22:07:52 2011 New Revision: 226621 URL: http://svn.freebsd.org/changeset/base/226621 Log: MFC 226266: After creating a filesystem using newfs -j the time stamps are all zero and thus report as having been made in January 1970. Apart from looking a bit silly, it also triggers alarms from scripts that detect weird time stamps. This update sets all 4 (or 3, in the case of UFS1) time stamps to the current time when enabling journaling during newfs or later when enabling it with tunefs. Reported by: Hans Ottevanger Approved by: re (kib) Modified: stable/9/sbin/tunefs/tunefs.c Modified: stable/9/sbin/tunefs/tunefs.c ============================================================================== --- stable/9/sbin/tunefs/tunefs.c Fri Oct 21 21:49:34 2011 (r226620) +++ stable/9/sbin/tunefs/tunefs.c Fri Oct 21 22:07:52 2011 (r226621) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* the optimization warning string template */ @@ -923,6 +924,7 @@ journal_alloc(int64_t size) ino_t ino; int blks; int mode; + time_t utime; int i; cgp = &disk.d_cg; @@ -983,18 +985,26 @@ journal_alloc(int64_t size) */ dp2 = ip; dp1 = ip; + time(&utime); if (sblock.fs_magic == FS_UFS1_MAGIC) { bzero(dp1, sizeof(*dp1)); dp1->di_size = size; dp1->di_mode = IFREG | IREAD; dp1->di_nlink = 1; dp1->di_flags = SF_IMMUTABLE | SF_NOUNLINK | UF_NODUMP; + dp1->di_atime = utime; + dp1->di_mtime = utime; + dp1->di_ctime = utime; } else { bzero(dp2, sizeof(*dp2)); dp2->di_size = size; dp2->di_mode = IFREG | IREAD; dp2->di_nlink = 1; dp2->di_flags = SF_IMMUTABLE | SF_NOUNLINK | UF_NODUMP; + dp2->di_atime = utime; + dp2->di_mtime = utime; + dp2->di_ctime = utime; + dp2->di_birthtime = utime; } for (i = 0; i < NDADDR && resid; i++, resid--) { blk = journal_balloc(); From owner-svn-src-stable@FreeBSD.ORG Fri Oct 21 22:12:25 2011 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 572A81065674; Fri, 21 Oct 2011 22:12:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45E7D8FC12; Fri, 21 Oct 2011 22:12:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9LMCPvo043556; Fri, 21 Oct 2011 22:12:25 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9LMCPDl043554; Fri, 21 Oct 2011 22:12:25 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201110212212.p9LMCPDl043554@svn.freebsd.org> From: Kirk McKusick Date: Fri, 21 Oct 2011 22:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226622 - stable/9/sys/kern 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: Fri, 21 Oct 2011 22:12:25 -0000 Author: mckusick Date: Fri Oct 21 22:12:24 2011 New Revision: 226622 URL: http://svn.freebsd.org/changeset/base/226622 Log: MFC: 226265 When unmounting a filesystem always wait for the vfs_busy lock to clear so that if no vnodes in the filesystem are actively in use the unmount will succeed rather than failing with EBUSY. Reported by: Garrett Cooper Reviewed by: Attilio Rao and Kostik Belousov Tested by: Garrett Cooper Approved by: re (kib) PR: kern/161016 Modified: stable/9/sys/kern/vfs_mount.c Modified: stable/9/sys/kern/vfs_mount.c ============================================================================== --- stable/9/sys/kern/vfs_mount.c Fri Oct 21 22:07:52 2011 (r226621) +++ stable/9/sys/kern/vfs_mount.c Fri Oct 21 22:12:24 2011 (r226622) @@ -1227,18 +1227,6 @@ dounmount(mp, flags, td) mp->mnt_kern_flag |= MNTK_UNMOUNTF; error = 0; if (mp->mnt_lockref) { - if ((flags & MNT_FORCE) == 0) { - mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_NOINSMNTQ | - MNTK_UNMOUNTF); - if (mp->mnt_kern_flag & MNTK_MWAIT) { - mp->mnt_kern_flag &= ~MNTK_MWAIT; - wakeup(mp); - } - MNT_IUNLOCK(mp); - if (coveredvp) - VOP_UNLOCK(coveredvp, 0); - return (EBUSY); - } mp->mnt_kern_flag |= MNTK_DRAINING; error = msleep(&mp->mnt_lockref, MNT_MTX(mp), PVFS, "mount drain", 0); From owner-svn-src-stable@FreeBSD.ORG Sat Oct 22 01:29:36 2011 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 14AB71065674; Sat, 22 Oct 2011 01:29:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE3CF8FC13; Sat, 22 Oct 2011 01:29:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9M1TZAF051088; Sat, 22 Oct 2011 01:29:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9M1TZsY051086; Sat, 22 Oct 2011 01:29:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201110220129.p9M1TZsY051086@svn.freebsd.org> From: Adrian Chadd Date: Sat, 22 Oct 2011 01:29:35 +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: r226624 - stable/8/sys/dev/usb/wlan 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: Sat, 22 Oct 2011 01:29:36 -0000 Author: adrian Date: Sat Oct 22 01:29:35 2011 New Revision: 226624 URL: http://svn.freebsd.org/changeset/base/226624 Log: Merge r226465 (below message) and r226467 (subsequent compile fixes). Fix an issue with 11g beacon frames which looks to be a limitation on the largest multi-write size. From the submitter: == I looked further into the magic 88-byte threshold after which the bug occurs. It turns out that figure included the 24-byte tx_desc, and up to 64 bytes of beacon frame (header+data). rum_write_multi doesn't seem happy with writing >64 bytes at a time to the MAC register. If I break it up into separate calls (e.g. bytes 0-63, then bytes 64-65, written at the appropriate offset) I see the proper beacon frames being transmitted now. == Submitted by: Steven Chamberlain Modified: stable/8/sys/dev/usb/wlan/if_rum.c Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Fri Oct 21 22:28:15 2011 (r226623) +++ stable/8/sys/dev/usb/wlan/if_rum.c Sat Oct 22 01:29:35 2011 (r226624) @@ -1407,20 +1407,27 @@ rum_write_multi(struct rum_softc *sc, ui { struct usb_device_request req; usb_error_t error; + int offset; req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = RT2573_WRITE_MULTI_MAC; USETW(req.wValue, 0); - USETW(req.wIndex, reg); - USETW(req.wLength, len); - error = rum_do_request(sc, &req, buf); - if (error != 0) { - device_printf(sc->sc_dev, - "could not multi write MAC register: %s\n", - usbd_errstr(error)); + /* write at most 64 bytes at a time */ + for (offset = 0; offset < len; offset += 64) { + USETW(req.wIndex, reg + offset); + USETW(req.wLength, MIN(len - offset, 64)); + + error = rum_do_request(sc, &req, (char *)buf + offset); + if (error != 0) { + device_printf(sc->sc_dev, + "could not multi write MAC register: %s\n", + usbd_errstr(error)); + return (error); + } } - return (error); + + return (USB_ERR_NORMAL_COMPLETION); } static void From owner-svn-src-stable@FreeBSD.ORG Sat Oct 22 09:29:44 2011 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 6338E106564A; Sat, 22 Oct 2011 09:29: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 526D48FC08; Sat, 22 Oct 2011 09:29:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9M9Ti5V070818; Sat, 22 Oct 2011 09:29:44 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9M9TiWe070816; Sat, 22 Oct 2011 09:29:44 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201110220929.p9M9TiWe070816@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 22 Oct 2011 09:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226626 - stable/9/sys/dev/iwn 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: Sat, 22 Oct 2011 09:29:44 -0000 Author: bschmidt Date: Sat Oct 22 09:29:44 2011 New Revision: 226626 URL: http://svn.freebsd.org/changeset/base/226626 Log: Fix bmiss notifications, events should be sent when NOT scanning. Approved by: re (kib) Modified: stable/9/sys/dev/iwn/if_iwn.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/9/sys/dev/iwn/if_iwn.c Sat Oct 22 04:39:12 2011 (r226625) +++ stable/9/sys/dev/iwn/if_iwn.c Sat Oct 22 09:29:44 2011 (r226626) @@ -2929,7 +2929,7 @@ iwn_notif_intr(struct iwn_softc *sc) * reinitialize the sensitivity state machine. */ if (vap->iv_state == IEEE80211_S_RUN && - (ic->ic_flags & IEEE80211_F_SCAN) != 0) { + (ic->ic_flags & IEEE80211_F_SCAN) == 0) { if (misses > 5) (void)iwn_init_sensitivity(sc); if (misses >= vap->iv_bmissthreshold) { From owner-svn-src-stable@FreeBSD.ORG Sat Oct 22 09:43:36 2011 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 0D5411065673; Sat, 22 Oct 2011 09:43:36 +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 F08CE8FC0A; Sat, 22 Oct 2011 09:43:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9M9hZEe071389; Sat, 22 Oct 2011 09:43:35 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9M9hZMk071387; Sat, 22 Oct 2011 09:43:35 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201110220943.p9M9hZMk071387@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 22 Oct 2011 09:43:35 +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: r226628 - stable/8/sys/dev/iwn 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: Sat, 22 Oct 2011 09:43:36 -0000 Author: bschmidt Date: Sat Oct 22 09:43:35 2011 New Revision: 226628 URL: http://svn.freebsd.org/changeset/base/226628 Log: Fix bmiss notifications, events should be sent when NOT scanning. Modified: stable/8/sys/dev/iwn/if_iwn.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Sat Oct 22 09:38:03 2011 (r226627) +++ stable/8/sys/dev/iwn/if_iwn.c Sat Oct 22 09:43:35 2011 (r226628) @@ -2709,7 +2709,7 @@ iwn_notif_intr(struct iwn_softc *sc) * reinitialize the sensitivity state machine. */ if (vap->iv_state == IEEE80211_S_RUN && - (ic->ic_flags & IEEE80211_F_SCAN) != 0) { + (ic->ic_flags & IEEE80211_F_SCAN) == 0) { if (misses > 5) (void)iwn_init_sensitivity(sc); if (misses >= vap->iv_bmissthreshold) { From owner-svn-src-stable@FreeBSD.ORG Sat Oct 22 17:51:45 2011 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 A37C4106574A; Sat, 22 Oct 2011 17:51:45 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C4F8FC0C; Sat, 22 Oct 2011 17:51:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9MHpjrf089678; Sat, 22 Oct 2011 17:51:45 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9MHpjF4089676; Sat, 22 Oct 2011 17:51:45 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201110221751.p9MHpjF4089676@svn.freebsd.org> From: Christian Brueffer Date: Sat, 22 Oct 2011 17:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226637 - stable/9/sys/kgssapi/krb5 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: Sat, 22 Oct 2011 17:51:45 -0000 Author: brueffer Date: Sat Oct 22 17:51:45 2011 New Revision: 226637 URL: http://svn.freebsd.org/changeset/base/226637 Log: MFC: r226185 Add missing break statement to make sure all 3DES etypes really are treated the same. Approved by: re (kib) Modified: stable/9/sys/kgssapi/krb5/krb5_mech.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kgssapi/krb5/krb5_mech.c ============================================================================== --- stable/9/sys/kgssapi/krb5/krb5_mech.c Sat Oct 22 16:53:29 2011 (r226636) +++ stable/9/sys/kgssapi/krb5/krb5_mech.c Sat Oct 22 17:51:45 2011 (r226637) @@ -288,6 +288,7 @@ get_keys(struct krb5_context *kc) case ETYPE_DES3_CBC_SHA1: case ETYPE_OLD_DES3_CBC_SHA1: etype = ETYPE_DES3_CBC_SHA1; + break; default: etype = keydata->kk_type; From owner-svn-src-stable@FreeBSD.ORG Sat Oct 22 18:06:56 2011 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 C41E9106566C; Sat, 22 Oct 2011 18:06:56 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B37EA8FC0C; Sat, 22 Oct 2011 18:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9MI6ugh090257; Sat, 22 Oct 2011 18:06:56 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9MI6uuw090255; Sat, 22 Oct 2011 18:06:56 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201110221806.p9MI6uuw090255@svn.freebsd.org> From: Christian Brueffer Date: Sat, 22 Oct 2011 18:06: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: r226639 - stable/8/sys/kgssapi/krb5 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: Sat, 22 Oct 2011 18:06:56 -0000 Author: brueffer Date: Sat Oct 22 18:06:56 2011 New Revision: 226639 URL: http://svn.freebsd.org/changeset/base/226639 Log: MFC: r226185 Add missing break statement to make sure all 3DES etypes really are treated the same. Modified: stable/8/sys/kgssapi/krb5/krb5_mech.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) Modified: stable/8/sys/kgssapi/krb5/krb5_mech.c ============================================================================== --- stable/8/sys/kgssapi/krb5/krb5_mech.c Sat Oct 22 17:56:24 2011 (r226638) +++ stable/8/sys/kgssapi/krb5/krb5_mech.c Sat Oct 22 18:06:56 2011 (r226639) @@ -288,6 +288,7 @@ get_keys(struct krb5_context *kc) case ETYPE_DES3_CBC_SHA1: case ETYPE_OLD_DES3_CBC_SHA1: etype = ETYPE_DES3_CBC_SHA1; + break; default: etype = keydata->kk_type; From owner-svn-src-stable@FreeBSD.ORG Sat Oct 22 18:20:12 2011 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 606A3106564A; Sat, 22 Oct 2011 18:20:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F9E88FC16; Sat, 22 Oct 2011 18:20:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9MIKChd090722; Sat, 22 Oct 2011 18:20:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9MIKCVt090720; Sat, 22 Oct 2011 18:20:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201110221820.p9MIKCVt090720@svn.freebsd.org> From: Christian Brueffer Date: Sat, 22 Oct 2011 18:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226640 - stable/9/sys/compat/linux 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: Sat, 22 Oct 2011 18:20:12 -0000 Author: brueffer Date: Sat Oct 22 18:20:12 2011 New Revision: 226640 URL: http://svn.freebsd.org/changeset/base/226640 Log: MFC: r226247, r226253 Properly free linux_gidset in case of an error. Approved by: re (kib) Modified: stable/9/sys/compat/linux/linux_uid16.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/compat/linux/linux_uid16.c ============================================================================== --- stable/9/sys/compat/linux/linux_uid16.c Sat Oct 22 18:06:56 2011 (r226639) +++ stable/9/sys/compat/linux/linux_uid16.c Sat Oct 22 18:20:12 2011 (r226640) @@ -113,8 +113,10 @@ linux_setgroups16(struct thread *td, str return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); - if (error) + if (error) { + free(linux_gidset, M_TEMP); return (error); + } newcred = crget(); p = td->td_proc; PROC_LOCK(p); From owner-svn-src-stable@FreeBSD.ORG Sat Oct 22 18:23:32 2011 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 8F1731065673; Sat, 22 Oct 2011 18:23:32 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E5BE8FC18; Sat, 22 Oct 2011 18:23:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9MINWsR090889; Sat, 22 Oct 2011 18:23:32 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9MINWde090887; Sat, 22 Oct 2011 18:23:32 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201110221823.p9MINWde090887@svn.freebsd.org> From: Christian Brueffer Date: Sat, 22 Oct 2011 18:23:32 +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: r226641 - stable/8/sys/compat/linux 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: Sat, 22 Oct 2011 18:23:32 -0000 Author: brueffer Date: Sat Oct 22 18:23:32 2011 New Revision: 226641 URL: http://svn.freebsd.org/changeset/base/226641 Log: MFC: r226247, r226253 Properly free linux_gidset in case of an error. Modified: stable/8/sys/compat/linux/linux_uid16.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) Modified: stable/8/sys/compat/linux/linux_uid16.c ============================================================================== --- stable/8/sys/compat/linux/linux_uid16.c Sat Oct 22 18:20:12 2011 (r226640) +++ stable/8/sys/compat/linux/linux_uid16.c Sat Oct 22 18:23:32 2011 (r226641) @@ -113,8 +113,10 @@ linux_setgroups16(struct thread *td, str return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); - if (error) + if (error) { + free(linux_gidset, M_TEMP); return (error); + } newcred = crget(); p = td->td_proc; PROC_LOCK(p);