From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 00:52:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AB91106566B; Sun, 5 Feb 2012 00:52:00 +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 3B2948FC15; Sun, 5 Feb 2012 00:52:00 +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 q150q0oL059307; Sun, 5 Feb 2012 00:52:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q150q0KL059305; Sun, 5 Feb 2012 00:52:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202050052.q150q0KL059305@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 00:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231003 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 00:52:00 -0000 Author: nwhitehorn Date: Sun Feb 5 00:51:59 2012 New Revision: 231003 URL: http://svn.freebsd.org/changeset/base/231003 Log: Add support for bus_adjust_resource() on all PowerPC/AIM PCI bridges. With this change, NEW_PCIB appears to work without incident at least on a G5 iMac. More testing will be required before it is turned on in GENERIC. Modified: head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 00:31:07 2012 (r231002) +++ head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 00:51:59 2012 (r231003) @@ -71,6 +71,9 @@ static int ofw_pci_activate_resource(de static int ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res); +static int ofw_pci_adjust_resource(device_t bus, device_t child, + int type, struct resource *res, u_long start, + u_long end); /* * pcib interface. @@ -106,6 +109,7 @@ static device_method_t ofw_pci_methods[] DEVMETHOD(bus_release_resource, ofw_pci_release_resource), DEVMETHOD(bus_activate_resource, ofw_pci_activate_resource), DEVMETHOD(bus_deactivate_resource, ofw_pci_deactivate_resource), + DEVMETHOD(bus_adjust_resource, ofw_pci_adjust_resource), /* pcib interface */ DEVMETHOD(pcib_maxslots, ofw_pci_maxslots), @@ -421,6 +425,30 @@ ofw_pci_deactivate_resource(device_t bus return (rman_deactivate_resource(res)); } +static int +ofw_pci_adjust_resource(device_t bus, device_t child, int type, + struct resource *res, u_long start, u_long end) +{ + struct rman *rm = NULL; + struct ofw_pci_softc *sc = device_get_softc(bus); + + switch (type) { + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + default: + return (ENXIO); + } + + if (!rman_is_region_manager(res, rm)) + return (EINVAL); + return (rman_adjust_resource(res, start, end)); +} + + static phandle_t ofw_pci_get_node(device_t bus, device_t dev) { From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 04:49:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A854106566C; Sun, 5 Feb 2012 04:49:32 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 294098FC0C; Sun, 5 Feb 2012 04:49: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 q154nWeJ067151; Sun, 5 Feb 2012 04:49:32 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q154nWHV067148; Sun, 5 Feb 2012 04:49:32 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202050449.q154nWHV067148@svn.freebsd.org> From: David Xu Date: Sun, 5 Feb 2012 04:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231006 - in head/sys: compat/freebsd32 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 04:49:32 -0000 Author: davidxu Date: Sun Feb 5 04:49:31 2012 New Revision: 231006 URL: http://svn.freebsd.org/changeset/base/231006 Log: Add 32-bit compat code for AIO kevent flags introduced in revision 230857. Modified: head/sys/compat/freebsd32/freebsd32_signal.h head/sys/kern/vfs_aio.c Modified: head/sys/compat/freebsd32/freebsd32_signal.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_signal.h Sun Feb 5 03:23:26 2012 (r231005) +++ head/sys/compat/freebsd32/freebsd32_signal.h Sun Feb 5 04:49:31 2012 (r231006) @@ -92,6 +92,7 @@ struct sigevent32 { uint32_t _function; uint32_t _attribute; } _sigev_thread; + unsigned short _kevent_flags; uint32_t __spare__[8]; } _sigev_un; }; Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sun Feb 5 03:23:26 2012 (r231005) +++ head/sys/kern/vfs_aio.c Sun Feb 5 04:49:31 2012 (r231006) @@ -2706,6 +2706,7 @@ convert_sigevent32(struct sigevent32 *si break; case SIGEV_KEVENT: CP(*sig32, *sig, sigev_notify_kqueue); + CP(*sig32, *sig, sigev_notify_kevent_flags); PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); break; default: From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 07:46:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2897A106564A; Sun, 5 Feb 2012 07:46:06 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id ACB6E8FC08; Sun, 5 Feb 2012 07:46:04 +0000 (UTC) Received: by lagz14 with SMTP id z14so3245496lag.13 for ; Sat, 04 Feb 2012 23:46:03 -0800 (PST) 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 :content-transfer-encoding; bh=Zf+m5iA6U1+uSGhj63F3T+U7rlxNRsGekZU67WV+c6s=; b=E4yRLzbWJHVFvOZhwpU8870t8JFeSU6jbuAOIeYW5D7H9g4eIQmQBQ43jfb2Pc1z+/ vly6yPB6H3R/6gTQh5kntl+ElJdbLQqxMXYi1OKKpTPqAwagKkmL7k3ee9kDn96E/GGc 5tyU3zEPsQKHq5vifvy7p6uA4Ym+wi52tThJs= MIME-Version: 1.0 Received: by 10.152.133.229 with SMTP id pf5mr6968614lab.18.1328427963547; Sat, 04 Feb 2012 23:46:03 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.2.138 with HTTP; Sat, 4 Feb 2012 23:46:03 -0800 (PST) In-Reply-To: <201202041337.q14DbVTn037485@svn.freebsd.org> References: <201202041337.q14DbVTn037485@svn.freebsd.org> Date: Sun, 5 Feb 2012 10:46:03 +0300 X-Google-Sender-Auth: oCFXi5SYP0KzdDT7RF0RXgSS_Mg Message-ID: From: Sergey Kandaurov To: Jaakko Heinonen Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230979 - head/usr.bin/touch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 07:46:06 -0000 On 4 February 2012 17:37, Jaakko Heinonen wrote: > Author: jh > Date: Sat Feb =A04 13:37:31 2012 > New Revision: 230979 > URL: http://svn.freebsd.org/changeset/base/230979 > > Log: > =A0Remove useless and potentially dangerous rw() function which tries to > =A0update access and modification times by reading and writing the file. > =A0chmod(2) in rw() doesn't help because utimes(2) allow owner and the > =A0super-user to change times. Using just utimes(2) should be sufficient. > > =A0The -f option becomes no-op. > > =A0Reviewed by: =A0jilles > > Modified: > =A0head/usr.bin/touch/touch.1 > =A0head/usr.bin/touch/touch.c Thank you. FYI, this code was written before utimes(2) was born (yes, before 4.2BSD), so it was technically correct to remove it for more than 20 years ago. > > Modified: head/usr.bin/touch/touch.1 > =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 > --- head/usr.bin/touch/touch.1 =A0Sat Feb =A04 13:12:52 2012 =A0 =A0 =A0 = =A0(r230978) > +++ head/usr.bin/touch/touch.1 =A0Sat Feb =A04 13:37:31 2012 =A0 =A0 =A0 = =A0(r230979) > @@ -31,7 +31,7 @@ > =A0.\" =A0 =A0 @(#)touch.1 =A0 =A08.3 (Berkeley) 4/28/95 > =A0.\" $FreeBSD$ > =A0.\" > -.Dd April 28, 1995 > +.Dd February 4, 2012 > =A0.Dt TOUCH 1 > =A0.Os > =A0.Sh NAME > @@ -40,7 +40,7 @@ > =A0.Sh SYNOPSIS > =A0.Nm > =A0.Op Fl A Ar [-][[hh]mm]SS > -.Op Fl acfhm > +.Op Fl achm > =A0.Op Fl r Ar file > =A0.Op Fl t Ar [[CC]YY]MMDDhhmm[.SS] > =A0.Ar > @@ -109,9 +109,6 @@ The > =A0.Nm > =A0utility does not treat this as an error. > =A0No error messages are displayed and the exit value is not affected. > -.It Fl f > -Attempt to force the update, even if the file permissions do not > -currently permit it. > =A0.It Fl h > =A0If the file is a symbolic link, change the times of the link > =A0itself rather than the file that the link points to. > > Modified: head/usr.bin/touch/touch.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 > --- head/usr.bin/touch/touch.c =A0Sat Feb =A04 13:12:52 2012 =A0 =A0 =A0 = =A0(r230978) > +++ head/usr.bin/touch/touch.c =A0Sat Feb =A04 13:37:31 2012 =A0 =A0 =A0 = =A0(r230979) > @@ -55,7 +55,6 @@ static const char sccsid[] =3D "@(#)touch. > =A0#include > =A0#include > > -int =A0 =A0rw(char *, struct stat *, int); > =A0void =A0 stime_arg1(char *, struct timeval *); > =A0void =A0 stime_arg2(char *, int, struct timeval *); > =A0void =A0 stime_file(char *, struct timeval *); > @@ -69,12 +68,12 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0struct timeval tv[2]; > =A0 =A0 =A0 =A0int (*stat_f)(const char *, struct stat *); > =A0 =A0 =A0 =A0int (*utimes_f)(const char *, const struct timeval *); > - =A0 =A0 =A0 int Aflag, aflag, cflag, fflag, mflag, ch, fd, len, rval, t= imeset; > + =A0 =A0 =A0 int Aflag, aflag, cflag, mflag, ch, fd, len, rval, timeset; > =A0 =A0 =A0 =A0char *p; > =A0 =A0 =A0 =A0char *myname; > > =A0 =A0 =A0 =A0myname =3D basename(argv[0]); > - =A0 =A0 =A0 Aflag =3D aflag =3D cflag =3D fflag =3D mflag =3D timeset = =3D 0; > + =A0 =A0 =A0 Aflag =3D aflag =3D cflag =3D mflag =3D timeset =3D 0; > =A0 =A0 =A0 =A0stat_f =3D stat; > =A0 =A0 =A0 =A0utimes_f =3D utimes; > =A0 =A0 =A0 =A0if (gettimeofday(&tv[0], NULL)) > @@ -92,7 +91,7 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cflag =3D 1; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 'f': > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fflag =3D 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* No-op for compatibility.= */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 'h': > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cflag =3D 1; > @@ -222,14 +221,8 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!utimes_f(*argv, NULL)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue; > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Try reading/writing. */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!S_ISLNK(sb.st_mode) && !S_ISDIR(sb.st_= mode)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (rw(*argv, &sb, fflag)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", *argv); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", *argv); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0exit(rval); > =A0} > @@ -368,59 +361,10 @@ stime_file(char *fname, struct timeval * > =A0 =A0 =A0 =A0TIMESPEC_TO_TIMEVAL(tvp + 1, &sb.st_mtim); > =A0} > > -int > -rw(char *fname, struct stat *sbp, int force) > -{ > - =A0 =A0 =A0 int fd, needed_chmod, rval; > - =A0 =A0 =A0 u_char byte; > - > - =A0 =A0 =A0 /* Try regular files. */ > - =A0 =A0 =A0 if (!S_ISREG(sbp->st_mode)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warnx("%s: %s", fname, strerror(EFTYPE)); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (1); > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 needed_chmod =3D rval =3D 0; > - =A0 =A0 =A0 if ((fd =3D open(fname, O_RDWR, 0)) =3D=3D -1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!force || chmod(fname, DEFFILEMODE)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((fd =3D open(fname, O_RDWR, 0)) =3D=3D = -1) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 needed_chmod =3D 1; > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 if (sbp->st_size !=3D 0) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (read(fd, &byte, sizeof(byte)) !=3D size= of(byte)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (lseek(fd, (off_t)0, SEEK_SET) =3D=3D -1= ) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (write(fd, &byte, sizeof(byte)) !=3D siz= eof(byte)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 } else { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (write(fd, &byte, sizeof(byte)) !=3D siz= eof(byte)) { > -err: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", fname); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (ftruncate(fd, (off_t)0)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s: file modified", f= name); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 if (close(fd) && rval !=3D 1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", fname); > - =A0 =A0 =A0 } > - =A0 =A0 =A0 if (needed_chmod && chmod(fname, sbp->st_mode) && rval !=3D= 1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s: permissions modified", fname); > - =A0 =A0 =A0 } > - =A0 =A0 =A0 return (rval); > -} > - > =A0void > =A0usage(char *myname) > =A0{ > - =A0 =A0 =A0 fprintf(stderr, "usage:\n" "%s [-A [-][[hh]mm]SS] [-acfhm] = [-r file] " > + =A0 =A0 =A0 fprintf(stderr, "usage:\n" "%s [-A [-][[hh]mm]SS] [-achm] [= -r file] " > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"[-t [[CC]YY]MMDDhhmm[.SS]] file ...\n", m= yname); > =A0 =A0 =A0 =A0exit(1); > =A0} --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 08:17:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E3A71065672; Sun, 5 Feb 2012 08:17:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 0B26E8FC13; Sun, 5 Feb 2012 08:17:46 +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 D811325D37C0; Sun, 5 Feb 2012 08:17:44 +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 D816ABDAB0E; Sun, 5 Feb 2012 08:17:43 +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 7WL5OAYT86mL; Sun, 5 Feb 2012 08:17:42 +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 4A93DBDAB0D; Sun, 5 Feb 2012 08:17:42 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201202042300.q14N0SYD055615@svn.freebsd.org> Date: Sun, 5 Feb 2012 08:17:40 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <5B5FCCB9-8BA0-4945-AA75-3E62ED5B3DFE@lists.zabbadoz.net> References: <201202042300.q14N0SYD055615@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230997 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 08:17:46 -0000 On 4. Feb 2012, at 23:00 , Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Feb 4 23:00:27 2012 > New Revision: 230997 > URL: http://svn.freebsd.org/changeset/base/230997 >=20 > Log: > Fix installation script after r230482 -- a missing character = apparently. > Now, back to convalescing. Cool. Thanks! I'll give it a try. > Modified: > head/release/rc.local >=20 > Modified: head/release/rc.local > = =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 > --- head/release/rc.local Sat Feb 4 20:17:07 2012 = (r230996) > +++ head/release/rc.local Sat Feb 4 23:00:27 2012 = (r230997) > @@ -18,7 +18,7 @@ if [ $? -eq 0 ]; then > # goes multiuser > touch /tmp/bsdinstall_log > tail -f /tmp/bsdinstall_log > /dev/ttyv2 & > - /usr/libexec/getty autologin ttyv3 > + /usr/libexec/getty autologin ttyv3 & > EXTERNAL_VTY_STARTED=3D1 > fi > else --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 08:31:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D0D7106564A; Sun, 5 Feb 2012 08:31:15 +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 5BF858FC19; Sun, 5 Feb 2012 08:31: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 q158VF7K073864; Sun, 5 Feb 2012 08:31:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q158VFO7073862; Sun, 5 Feb 2012 08:31:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202050831.q158VFO7073862@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 08:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231009 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 08:31:15 -0000 Author: glebius Date: Sun Feb 5 08:31:15 2012 New Revision: 231009 URL: http://svn.freebsd.org/changeset/base/231009 Log: In ifa_init() initialize if_data.ifi_datalen. This would be required after upcoming changes from bz@. Discussed with: bz Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Feb 5 07:19:00 2012 (r231008) +++ head/sys/net/if.c Sun Feb 5 08:31:15 2012 (r231009) @@ -1416,6 +1416,7 @@ ifa_init(struct ifaddr *ifa) mtx_init(&ifa->ifa_mtx, "ifaddr", NULL, MTX_DEF); refcount_init(&ifa->ifa_refcnt, 1); + ifa->if_data.ifi_datalen = sizeof(ifa->if_data); } void From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 08:53:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4D4E106566B; Sun, 5 Feb 2012 08:53:05 +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 A3A768FC08; Sun, 5 Feb 2012 08:53: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 q158r5ci074553; Sun, 5 Feb 2012 08:53:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q158r5l5074551; Sun, 5 Feb 2012 08:53:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202050853.q158r5l5074551@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 08:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231010 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 08:53:05 -0000 Author: glebius Date: Sun Feb 5 08:53:05 2012 New Revision: 231010 URL: http://svn.freebsd.org/changeset/base/231010 Log: Better comment for ifa_init(), ifa_ref(), ifa_free(). Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Feb 5 08:31:15 2012 (r231009) +++ head/sys/net/if.c Sun Feb 5 08:53:05 2012 (r231010) @@ -1408,7 +1408,7 @@ if_maddr_runlock(struct ifnet *ifp) } /* - * Reference count functions for ifaddrs. + * Initialization, desctruction and refcounting functions for ifaddrs. */ void ifa_init(struct ifaddr *ifa) From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 09:17:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2325106564A; Sun, 5 Feb 2012 09:17:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53E18FC0A; Sun, 5 Feb 2012 09:17:49 +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 q159HnWt075347; Sun, 5 Feb 2012 09:17:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q159Hnp9075338; Sun, 5 Feb 2012 09:17:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202050917.q159Hnp9075338@svn.freebsd.org> From: Ed Schouten Date: Sun, 5 Feb 2012 09:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231011 - head/usr.bin/systat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 09:17:50 -0000 Author: ed Date: Sun Feb 5 09:17:49 2012 New Revision: 231011 URL: http://svn.freebsd.org/changeset/base/231011 Log: Whitespace fixes. - Remove redundant empty lines. - Replace ^L by \014. This allows you to safely cat/grep/etc this file without causing confusion. Modified: head/usr.bin/systat/icmp.c head/usr.bin/systat/ifstat.c head/usr.bin/systat/iostat.c head/usr.bin/systat/ip.c head/usr.bin/systat/netcmds.c head/usr.bin/systat/netstat.c head/usr.bin/systat/pigs.c head/usr.bin/systat/tcp.c Modified: head/usr.bin/systat/icmp.c ============================================================================== --- head/usr.bin/systat/icmp.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/icmp.c Sun Feb 5 09:17:49 2012 (r231011) @@ -277,4 +277,3 @@ fetchicmp(void) if (sysctl(name, 4, &icmpstat, &len, 0, 0) < 0) return; } - Modified: head/usr.bin/systat/ifstat.c ============================================================================== --- head/usr.bin/systat/ifstat.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/ifstat.c Sun Feb 5 09:17:49 2012 (r231011) @@ -58,7 +58,6 @@ static const int col3 = C3; static const int col4 = C4; static const int col5 = C5; - SLIST_HEAD(, if_stat) curlist; SLIST_HEAD(, if_stat_disp) displist; @@ -85,7 +84,7 @@ static void sort_interface_list(void); static u_int getifnum(void); #define IFSTAT_ERR(n, s) do { \ - putchar(' '); \ + putchar('\014'); \ closeifstat(wnd); \ err((n), (s)); \ } while (0) @@ -143,7 +142,6 @@ static u_int getifnum(void); mvprintw(p->if_ypos+1, col2-3, "%s", (const char *)"out"); \ } while (0) - WINDOW * openifstat(void) { @@ -170,7 +168,6 @@ closeifstat(WINDOW *w) return; } - void labelifstat(void) { @@ -254,7 +251,6 @@ fetchifstat(void) IFSTAT_ERR(2, "error getting time of day"); (void)getifmibdata(ifp->if_row, &ifp->if_mib); - new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; new_outb = ifp->if_mib.ifmd_data.ifi_obytes; Modified: head/usr.bin/systat/iostat.c ============================================================================== --- head/usr.bin/systat/iostat.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/iostat.c Sun Feb 5 09:17:49 2012 (r231011) @@ -254,7 +254,6 @@ barlabels(int row) return (row); } - void showiostat(void) { Modified: head/usr.bin/systat/ip.c ============================================================================== --- head/usr.bin/systat/ip.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/ip.c Sun Feb 5 09:17:49 2012 (r231011) @@ -337,4 +337,3 @@ fetchip(void) if (sysctl(name, 4, &curstat.u, &len, 0, 0) < 0) return; } - Modified: head/usr.bin/systat/netcmds.c ============================================================================== --- head/usr.bin/systat/netcmds.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/netcmds.c Sun Feb 5 09:17:49 2012 (r231011) @@ -121,7 +121,6 @@ netcmd(const char *cmd, const char *args return (0); } - static void changeitems(const char *args, int onoff) { Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/netstat.c Sun Feb 5 09:17:49 2012 (r231011) @@ -349,7 +349,6 @@ enter_sysctl(struct inpcb *inp, struct x } } - static struct netinfo * enter(struct inpcb *inp, int state, const char *proto) { @@ -437,7 +436,6 @@ enter(struct inpcb *inp, int state, cons #define SNDCC RCVCC+7 #define STATE SNDCC+7 - void labelnetstat(void) { Modified: head/usr.bin/systat/pigs.c ============================================================================== --- head/usr.bin/systat/pigs.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/pigs.c Sun Feb 5 09:17:49 2012 (r231011) @@ -81,7 +81,6 @@ closepigs(WINDOW *w) delwin(w); } - void showpigs(void) { Modified: head/usr.bin/systat/tcp.c ============================================================================== --- head/usr.bin/systat/tcp.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/tcp.c Sun Feb 5 09:17:49 2012 (r231011) @@ -324,4 +324,3 @@ fetchtcp(void) if (sysctl(name, 4, &curstat, &len, 0, 0) < 0) return; } - From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 09:40:54 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CCBC1065673; Sun, 5 Feb 2012 09:40:54 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 07C788FC17; Sun, 5 Feb 2012 09:40:53 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 38121624; Sun, 5 Feb 2012 10:40:52 +0100 (CET) Date: Sun, 5 Feb 2012 10:39:38 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120205093938.GC30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UPT3ojh+0CqEDtpF" Content-Disposition: inline In-Reply-To: <86zkcy5ur9.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 09:40:54 -0000 --UPT3ojh+0CqEDtpF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 04, 2012 at 08:16:42PM +0200, Mikolaj Golub wrote: > ref8-amd64:/home/trociny% uname -r > 8.2-STABLE > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > daemon: process already running, pid: 19799 >=20 > kopusha:~% uname -r =20 > 10.0-CURRENT > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~%=20 Mikolaj, eventhough what we had in 8.2-STABLE looks correct, it also isn't correct. Passing open descriptor to a process that doesn't expect that is bad behaviour. If you pass, eg. open descriptor to a directory and the process is using chroot(2) or jail(2) to sandbox itself it will be able to escape from that sandbox. Passing descriptor to a file has smaller security implication, but it is still wrong. For example hastd, as you probably know, asserts, before sandboxing, that he knows about all open descriptors - if there are some unknown descriptors open it won't run. Also, daemon was passing open descriptor to a pidfile that the child process cannot clean up, because he doesn't know its name. This leaves pidfile with stale PID in it once the process exits, which is also bad. In my opinion, to make daemon(8) work with pidfiles, it cannot exit after executing the given command. It should stay around with pidfile open and just wait for the child to exit. Once the child exits, it should remove the pidfile and also exit. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --UPT3ojh+0CqEDtpF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uTloACgkQForvXbEpPzTCcACgqsmztAXiyZj/9qGD/Gs5FQix lV8Anj5C6M3S6VkO/I8cBwIh94U+hzrQ =Nzp3 -----END PGP SIGNATURE----- --UPT3ojh+0CqEDtpF-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 10:00:38 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6D7A106566C; Sun, 5 Feb 2012 10:00:38 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 53DE38FC14; Sun, 5 Feb 2012 10:00:38 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id D0751635; Sun, 5 Feb 2012 11:00:36 +0100 (CET) Date: Sun, 5 Feb 2012 10:59:22 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120205095922.GD30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TybLhxa8M7aNoW+V" Content-Disposition: inline In-Reply-To: <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 10:00:38 -0000 --TybLhxa8M7aNoW+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 04, 2012 at 10:32:56AM -0600, Guy Helmer wrote: >=20 > On Feb 4, 2012, at 1:42 AM, Pawel Jakub Dawidek wrote: >=20 > > On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: > >> Author: ghelmer > >> Date: Wed Feb 1 16:40:59 2012 > >> New Revision: 230869 > >> URL: http://svn.freebsd.org/changeset/base/230869 > >>=20 > >> Log: > >> Change the notes about the pidfile to include Doug's preference > >> for pre-creating the pidfile with appropriate owner and permissions. > >>=20 > >> Requested by dougb > >=20 > > Pre-creating pidfiles? That sounds weird. The common practise is to turn > > eg. /var/run/.pid into /var/run//pid where directory > > has appropriate permissions. Pre-creating pidfiles is simply wrong, > > because applications create pidfile on start and unlink it on exit. > > If application has no permission to remove files from /var/run/ it will > > leave pidfile with stale PID in it, which is bad. Changing application > > to truncate pidfile on exit instead of unlinking it also is a bad idea > > especially because there is working solution - pid directory. >=20 > I prefer this approach, but dougb prefers the other approach. Each has po= sitives and negatives. I tried to accommodate both approaches. I seem to miss positives of the other approach. Leaving stale PIDs in pidfile is something we should avoid at all costs, so recommending that in the manual page is not the best recommendation. I for one would prefer to recommend against it. Even if pidfile is truncated on exit it still leave a mess in /var/run/. But currently it is not truncated on exit (pidfile(3) just unlinks the file, without truncating it first), so we end up with stale PIDs. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --TybLhxa8M7aNoW+V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uUvoACgkQForvXbEpPzQgKwCfSTpBlcqXLjv04P0OEz3ylK8q Us4AoPG0JMJ/P88IbMb39P+d4Q/wj06z =aepb -----END PGP SIGNATURE----- --TybLhxa8M7aNoW+V-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 10:59:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8E17106566B; Sun, 5 Feb 2012 10:59:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F458FC0C; Sun, 5 Feb 2012 10:59:50 +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 q15AxoWG079846; Sun, 5 Feb 2012 10:59:50 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15AxoaY079844; Sun, 5 Feb 2012 10:59:50 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202051059.q15AxoaY079844@svn.freebsd.org> From: Martin Matuska Date: Sun, 5 Feb 2012 10:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231012 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 10:59:51 -0000 Author: mm Date: Sun Feb 5 10:59:50 2012 New Revision: 231012 URL: http://svn.freebsd.org/changeset/base/231012 Log: Analogous to r230407 a separate path buffer in vfs_mount.c is required for r230129. Fixes a out of bounds write to fspath. MFC after: 10 days Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Feb 5 09:17:49 2012 (r231011) +++ head/sys/kern/vfs_mount.c Sun Feb 5 10:59:50 2012 (r231012) @@ -1039,6 +1039,7 @@ vfs_domount( struct vfsconf *vfsp; struct nameidata nd; struct vnode *vp; + char *pathbuf; int error; /* @@ -1102,12 +1103,15 @@ vfs_domount( NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) { - error = vn_path_to_global_path(td, vp, fspath, MNAMELEN); + pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); + strcpy(pathbuf, fspath); + error = vn_path_to_global_path(td, vp, pathbuf, MNAMELEN); /* debug.disablefullpath == 1 results in ENODEV */ if (error == 0 || error == ENODEV) { - error = vfs_domount_first(td, vfsp, fspath, vp, + error = vfs_domount_first(td, vfsp, pathbuf, vp, fsflags, optlist); } + free(pathbuf, M_TEMP); } else error = vfs_domount_update(td, vp, fsflags, optlist); mtx_unlock(&Giant); From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 12:46:58 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id CFCF21065670; Sun, 5 Feb 2012 12:46:58 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id CF259152746; Sun, 5 Feb 2012 12:46:54 +0000 (UTC) Message-ID: <4F2E7A3D.8080107@FreeBSD.org> Date: Sun, 05 Feb 2012 04:46:53 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> <20120205095922.GD30033@garage.freebsd.pl> In-Reply-To: <20120205095922.GD30033@garage.freebsd.pl> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigFF0521E5838021636E017BFA" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 12:46:58 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFF0521E5838021636E017BFA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 02/05/2012 01:59, Pawel Jakub Dawidek wrote: > I seem to miss positives of the other approach. Leaving stale PIDs in > pidfile is something we should avoid at all costs, so recommending that= > in the manual page is not the best recommendation.=20 Which is worse ... potentially stale pidfiles that get cleaned up at every boot, or stale directories that never do? I'm also not sure why you think this method will leave behind a stale pidfile. The idea is that the pidfile is pre-created with the ownership that daemon is going to su to, for the express purpose of allowing it to delete the pidfile when the process exits. If you're saying that this method doesn't work then please point out the problem ASAP because numerous ports rc.d scripts do this now. Doug --=20 It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------enigFF0521E5838021636E017BFA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJPLno+AAoJEFzGhvEaGryElFgH/RvHS89EyN3lc2pyWH+jnkCv +U8RI1um7BsZXLh5DpqtgawGzz13x5pd8dikDqmbAoqWQwCJfGWksywdiQP+z/KW 0EM/0YKYH09EdzzyI1Vl+gkajreHHLfUTse19vDubCsKuqje4AqmMEmU4fz1ry6z fNm/UNUG42gJCi0ytL1RlEHc810g+akYkGWknjDav/RDUFINjQxmrNUWOI0WgBUx OdTg7MhdXK6LWP6kjaB/j2Ur8B5wCrhfrqFQpStVqreVhxl3aOM13wNsEPGHrd2Z xgSlyMOW/mYHMGXKzccLdSGwEKipGJ+OFYCygSRgyHj4uXuykm2gZFBSFWIP8qo= =WPR0 -----END PGP SIGNATURE----- --------------enigFF0521E5838021636E017BFA-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 12:52:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6896106566B; Sun, 5 Feb 2012 12:52:28 +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 B5AA28FC18; Sun, 5 Feb 2012 12:52:28 +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 q15CqSfb083289; Sun, 5 Feb 2012 12:52:28 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15CqS91083287; Sun, 5 Feb 2012 12:52:28 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202051252.q15CqS91083287@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 12:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231013 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 12:52:28 -0000 Author: glebius Date: Sun Feb 5 12:52:28 2012 New Revision: 231013 URL: http://svn.freebsd.org/changeset/base/231013 Log: Fix typo in r231010. Submitted by: linimon Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Feb 5 10:59:50 2012 (r231012) +++ head/sys/net/if.c Sun Feb 5 12:52:28 2012 (r231013) @@ -1408,7 +1408,7 @@ if_maddr_runlock(struct ifnet *ifp) } /* - * Initialization, desctruction and refcounting functions for ifaddrs. + * Initialization, destruction and refcounting functions for ifaddrs. */ void ifa_init(struct ifaddr *ifa) From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 13:29:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A26210656A5; Sun, 5 Feb 2012 13:29:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF778FC1E; Sun, 5 Feb 2012 13:29: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 q15DT2Ff084402; Sun, 5 Feb 2012 13:29:02 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15DT1kB084400; Sun, 5 Feb 2012 13:29:01 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201202051329.q15DT1kB084400@svn.freebsd.org> From: Justin Hibbits Date: Sun, 5 Feb 2012 13:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231014 - head/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 13:29:02 -0000 Author: jhibbits Date: Sun Feb 5 13:29:01 2012 New Revision: 231014 URL: http://svn.freebsd.org/changeset/base/231014 Log: Add exca to powerpc modules build as a dependency for cbb. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Feb 5 12:52:28 2012 (r231013) +++ head/sys/modules/Makefile Sun Feb 5 13:29:01 2012 (r231014) @@ -764,6 +764,7 @@ _cardbus= cardbus _cbb= cbb _cfi= cfi _cpufreq= cpufreq +_exca= exca _nvram= powermac_nvram _pccard= pccard _smbfs= smbfs From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 13:31:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5CCF106566C; Sun, 5 Feb 2012 13:31:02 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 761FB8FC13; Sun, 5 Feb 2012 13:31:02 +0000 (UTC) Received: by iaeo4 with SMTP id o4so10890331iae.13 for ; Sun, 05 Feb 2012 05:31:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; bh=dxyW2yIiTe46XNOpNFyjHpUK0JTk1qayWvl1EEg/i2k=; b=kCmqy9UWyhv5GLxRIaImW1+nVPa4VE4Tiv/YLsjD3sRPPDNNn1GixlaNrtBZWIiTZk sJbWJdeUvM7J1HvteiybD71GhDWZzHE2Z6GV3UlS37bDA4n/7tkToqOQvcxlphwD2uup 2Oq5ko6CgzHgQQTXj84+P/SgiXsbO1sMwqSuk= Received: by 10.42.107.9 with SMTP id b9mr7896587icp.23.1328448661844; Sun, 05 Feb 2012 05:31:01 -0800 (PST) Received: from triad.knownspace (216-15-41-8.c3-0.gth-ubr1.lnh-gth.md.cable.rcn.com. [216.15.41.8]) by mx.google.com with ESMTPS id l28sm21085130ibc.3.2012.02.05.05.31.00 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 05:31:00 -0800 (PST) Message-Id: <7D839B6E-E8CD-463B-B117-BCB07F07EF20@gmail.com> From: Justin Hibbits To: Justin Hibbits In-Reply-To: <201202051329.q15DT1kB084400@svn.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 5 Feb 2012 08:28:37 -0500 References: <201202051329.q15DT1kB084400@svn.freebsd.org> X-Mailer: Apple Mail (2.936) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231014 - head/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 13:31:02 -0000 On Feb 5, 2012, at 8:29 AM, Justin Hibbits wrote: > Author: jhibbits > Date: Sun Feb 5 13:29:01 2012 > New Revision: 231014 > URL: http://svn.freebsd.org/changeset/base/231014 > > Log: > Add exca to powerpc modules build as a dependency for cbb. Approved by: nwhitehorn (mentor) sigh. I really should stop committing first thing in the morning. From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 13:52:49 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB87F1065670; Sun, 5 Feb 2012 13:52:49 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 577E88FC0A; Sun, 5 Feb 2012 13:52:49 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 547446D0; Sun, 5 Feb 2012 14:52:47 +0100 (CET) Date: Sun, 5 Feb 2012 14:51:33 +0100 From: Pawel Jakub Dawidek To: Doug Barton Message-ID: <20120205135131.GG30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> <20120205095922.GD30033@garage.freebsd.pl> <4F2E7A3D.8080107@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m972NQjnE83KvVa/" Content-Disposition: inline In-Reply-To: <4F2E7A3D.8080107@FreeBSD.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 13:52:49 -0000 --m972NQjnE83KvVa/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 05, 2012 at 04:46:53AM -0800, Doug Barton wrote: > On 02/05/2012 01:59, Pawel Jakub Dawidek wrote: >=20 > > I seem to miss positives of the other approach. Leaving stale PIDs in > > pidfile is something we should avoid at all costs, so recommending that > > in the manual page is not the best recommendation.=20 >=20 > Which is worse ... potentially stale pidfiles that get cleaned up at > every boot, or stale directories that never do? Every boot might be very rare situation on servers. Those directories should be cleaned when application is deinstalled and not when process exits. > I'm also not sure why you think this method will leave behind a stale > pidfile. The idea is that the pidfile is pre-created with the ownership > that daemon is going to su to, for the express purpose of allowing it to > delete the pidfile when the process exits. If you're saying that this > method doesn't work then please point out the problem ASAP because > numerous ports rc.d scripts do this now. Great, but this is not how UNIX permissions work. To remove directory entry you have to have rights to modify the directory. Having write permission to file within the directory won't allow you to remove it. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --m972NQjnE83KvVa/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uiWMACgkQForvXbEpPzTwVACfTREBUze/Wxv98p0JKuqZ6kQE RLgAnjQWJISuF1L4C5y97X/keDPGi+eX =ufav -----END PGP SIGNATURE----- --m972NQjnE83KvVa/-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 15:21:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA7D1065674; Sun, 5 Feb 2012 15:21:08 +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 CBBF68FC14; Sun, 5 Feb 2012 15:21:08 +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 q15FL8lN088404; Sun, 5 Feb 2012 15:21:08 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FL800088402; Sun, 5 Feb 2012 15:21:08 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051521.q15FL800088402@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231015 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:21:09 -0000 Author: trociny Date: Sun Feb 5 15:21:08 2012 New Revision: 231015 URL: http://svn.freebsd.org/changeset/base/231015 Log: Fix the regression introduced in r226859: if the local component is out of date BIO_READ requests got lost instead of being sent to the remote component. Reviewed by: pjd MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Feb 5 13:29:01 2012 (r231014) +++ head/sbin/hastd/primary.c Sun Feb 5 15:21:08 2012 (r231015) @@ -1255,7 +1255,7 @@ ggate_recv_thread(void *arg) pjdlog_debug(2, "ggate_recv: (%p) Moving request to the send queues.", hio); refcount_init(&hio->hio_countdown, ncomps); - for (ii = ncomp; ii < ncomps; ii++) + for (ii = ncomp; ii < ncomp + ncomps; ii++) QUEUE_INSERT1(hio, send, ii); } /* NOTREACHED */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 15:23:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20ABE106566C; Sun, 5 Feb 2012 15:23:33 +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 0FE5C8FC0A; Sun, 5 Feb 2012 15:23:33 +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 q15FNWsY088524; Sun, 5 Feb 2012 15:23:32 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FNWUQ088522; Sun, 5 Feb 2012 15:23:32 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051523.q15FNWUQ088522@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231016 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:23:33 -0000 Author: trociny Date: Sun Feb 5 15:23:32 2012 New Revision: 231016 URL: http://svn.freebsd.org/changeset/base/231016 Log: If a local write request is from the synchronization thread, when it is synchronizing data that is out of date on the local component, we should not send G_GATE_CMD_DONE acknowledge to the kernel. This fixes the issue, observed in async mode, when on synchronization from the remote component the worker terminated with "G_GATE_CMD_DONE failed" error. Reported by: Artem Kajalainen Reviewed by: pjd MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Feb 5 15:21:08 2012 (r231015) +++ head/sbin/hastd/primary.c Sun Feb 5 15:23:32 2012 (r231016) @@ -1326,7 +1326,8 @@ local_send_thread(void *arg) } else { hio->hio_errors[ncomp] = 0; if (hio->hio_replication == - HAST_REPLICATION_ASYNC) { + HAST_REPLICATION_ASYNC && + !ISSYNCREQ(hio)) { ggio->gctl_error = 0; write_complete(res, hio); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 15:51:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEFA8106564A; Sun, 5 Feb 2012 15:51:19 +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 DB43F8FC13; Sun, 5 Feb 2012 15:51:19 +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 q15FpJPR089434; Sun, 5 Feb 2012 15:51:19 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FpJJ7089415; Sun, 5 Feb 2012 15:51:19 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051551.q15FpJJ7089415@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:51:19 +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: r231017 - in stable/9/sbin: hastctl hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:51:20 -0000 Author: trociny Date: Sun Feb 5 15:51:19 2012 New Revision: 231017 URL: http://svn.freebsd.org/changeset/base/231017 Log: MFC r229699, r229744, r229778, r229944, r229945, r229946, r230092, r230395, r230396, r230436, r230457, r230515, r230976: r229744 (pjd): fork(2) returns -1 on failure, not some random negative number. r229699 (pjd): Constify argument. r229778 (uqs): Spelling fixes for sbin/ r229944 (pjd): Don't touch pidfiles when running in foreground. Before that change we would create an empty pidfile on start and check if it changed on SIGHUP. r229945 (pjd): For functions that return -1 on failure check exactly for -1 and not for any negative number. r229946 (pjd): - Fix a bug where pidfile was removed in SIGHUP when it hasn't changed in configuration file. - Log the fact that pidfile has changed. r230092 (pjd): Style cleanups. r230395 (pjd): Remove unused token 'port'. r230396 (pjd): Remove another unused token. r230436 (pjd): Fix minor memory leak. r230457 (pjd): Free memory that won't be used in child. r230515 (pjd): - Fix documentation to note that /etc/hast.conf is the default configuration file for hastd(8) and hastctl(8) and not hast.conf. - In copyright statement correct that this file is documentation, not software. - Bump date. r230976 (pjd): Fix typo in comment. Modified: stable/9/sbin/hastctl/hastctl.8 stable/9/sbin/hastctl/hastctl.c stable/9/sbin/hastd/activemap.c stable/9/sbin/hastd/control.c stable/9/sbin/hastd/ebuf.c stable/9/sbin/hastd/event.c stable/9/sbin/hastd/hast.conf.5 stable/9/sbin/hastd/hast_compression.c stable/9/sbin/hastd/hast_proto.c stable/9/sbin/hastd/hastd.c stable/9/sbin/hastd/hooks.c stable/9/sbin/hastd/lzf.h stable/9/sbin/hastd/metadata.c stable/9/sbin/hastd/nv.c stable/9/sbin/hastd/parse.y stable/9/sbin/hastd/primary.c stable/9/sbin/hastd/proto.c stable/9/sbin/hastd/proto_common.c stable/9/sbin/hastd/proto_socketpair.c stable/9/sbin/hastd/proto_tcp.c stable/9/sbin/hastd/proto_uds.c stable/9/sbin/hastd/secondary.c stable/9/sbin/hastd/subr.c stable/9/sbin/hastd/subr.h stable/9/sbin/hastd/token.l Directory Properties: stable/9/sbin/hastctl/ (props changed) stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastctl/hastctl.8 ============================================================================== --- stable/9/sbin/hastctl/hastctl.8 Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastctl/hastctl.8 Sun Feb 5 15:51:19 2012 (r231017) @@ -97,7 +97,7 @@ If extent size is too small, there will related to dirty map updates, which will degrade performance of the given resource. If extent size is too large, synchronization, even in case of short -outage, can take a long time increasing the risk of loosing up-to-date +outage, can take a long time increasing the risk of losing up-to-date node before synchronization process is completed. The default extent size is .Va 2MB . Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastctl/hastctl.c Sun Feb 5 15:51:19 2012 (r231017) @@ -104,7 +104,7 @@ create_one(struct hast_resource *res, in ec = 0; pjdlog_prefix_set("[%s] ", res->hr_name); - if (provinfo(res, true) < 0) { + if (provinfo(res, true) == -1) { ec = EX_NOINPUT; goto end; } @@ -146,7 +146,7 @@ create_one(struct hast_resource *res, in res->hr_localoff = METADATA_SIZE + mapsize; - if (metadata_write(res) < 0) { + if (metadata_write(res) == -1) { ec = EX_IOERR; goto end; } @@ -401,15 +401,15 @@ main(int argc, char *argv[]) debug++; break; case 'e': - if (expand_number(optarg, &extentsize) < 0) + if (expand_number(optarg, &extentsize) == -1) errx(EX_USAGE, "Invalid extentsize"); break; case 'k': - if (expand_number(optarg, &keepdirty) < 0) + if (expand_number(optarg, &keepdirty) == -1) errx(EX_USAGE, "Invalid keepdirty"); break; case 'm': - if (expand_number(optarg, &mediasize) < 0) + if (expand_number(optarg, &mediasize) == -1) errx(EX_USAGE, "Invalid mediasize"); break; case 'h': @@ -479,13 +479,13 @@ main(int argc, char *argv[]) } /* Setup control connection... */ - if (proto_client(NULL, cfg->hc_controladdr, &controlconn) < 0) { + if (proto_client(NULL, cfg->hc_controladdr, &controlconn) == -1) { pjdlog_exit(EX_OSERR, "Unable to setup control connection to %s", cfg->hc_controladdr); } /* ...and connect to hastd. */ - if (proto_connect(controlconn, HAST_TIMEOUT) < 0) { + if (proto_connect(controlconn, HAST_TIMEOUT) == -1) { pjdlog_exit(EX_OSERR, "Unable to connect to hastd via %s", cfg->hc_controladdr); } @@ -494,14 +494,14 @@ main(int argc, char *argv[]) exit(EX_CONFIG); /* Send the command to the server... */ - if (hast_proto_send(NULL, controlconn, nv, NULL, 0) < 0) { + if (hast_proto_send(NULL, controlconn, nv, NULL, 0) == -1) { pjdlog_exit(EX_UNAVAILABLE, "Unable to send command to hastd via %s", cfg->hc_controladdr); } nv_free(nv); /* ...and receive reply. */ - if (hast_proto_recv_hdr(controlconn, &nv) < 0) { + if (hast_proto_recv_hdr(controlconn, &nv) == -1) { pjdlog_exit(EX_UNAVAILABLE, "cannot receive reply from hastd via %s", cfg->hc_controladdr); Modified: stable/9/sbin/hastd/activemap.c ============================================================================== --- stable/9/sbin/hastd/activemap.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/activemap.c Sun Feb 5 15:51:19 2012 (r231017) @@ -219,7 +219,7 @@ keepdirty_add(struct activemap *amp, int kd = keepdirty_find(amp, extent); if (kd != NULL) { /* - * Only move element at the begining. + * Only move element at the beginning. */ TAILQ_REMOVE(&->am_keepdirty, kd, kd_next); TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next); @@ -573,7 +573,7 @@ activemap_sync_rewind(struct activemap * return; } /* - * Mark that we want to start synchronization from the begining. + * Mark that we want to start synchronization from the beginning. */ amp->am_syncoff = -1; } Modified: stable/9/sbin/hastd/control.c ============================================================================== --- stable/9/sbin/hastd/control.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/control.c Sun Feb 5 15:51:19 2012 (r231017) @@ -115,7 +115,7 @@ control_set_role_common(struct hastd_con * doing that work. */ if (res->hr_workerpid != 0) { - if (kill(res->hr_workerpid, SIGTERM) < 0) { + if (kill(res->hr_workerpid, SIGTERM) == -1) { pjdlog_errno(LOG_WARNING, "Unable to kill worker process %u", (unsigned int)res->hr_workerpid); @@ -167,7 +167,7 @@ control_status_worker(struct hast_resour "Unable to prepare control header"); goto end; } - if (hast_proto_send(res, res->hr_ctrl, cnvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_ctrl, cnvout, NULL, 0) == -1) { error = errno; pjdlog_errno(LOG_ERR, "Unable to send control header"); goto end; @@ -176,7 +176,7 @@ control_status_worker(struct hast_resour /* * Receive response. */ - if (hast_proto_recv_hdr(res->hr_ctrl, &cnvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &cnvin) == -1) { error = errno; pjdlog_errno(LOG_ERR, "Unable to receive control header"); goto end; @@ -293,7 +293,7 @@ control_handle(struct hastd_config *cfg) uint8_t cmd, role; int error; - if (proto_accept(cfg->hc_controlconn, &conn) < 0) { + if (proto_accept(cfg->hc_controlconn, &conn) == -1) { pjdlog_errno(LOG_ERR, "Unable to accept control connection"); return; } @@ -302,7 +302,7 @@ control_handle(struct hastd_config *cfg) nvin = nvout = NULL; role = HAST_ROLE_UNDEF; - if (hast_proto_recv_hdr(conn, &nvin) < 0) { + if (hast_proto_recv_hdr(conn, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive control header"); nvin = NULL; goto close; @@ -395,7 +395,7 @@ fail: if (error != 0) nv_add_int16(nvout, error, "error"); - if (hast_proto_send(NULL, conn, nvout, NULL, 0) < 0) + if (hast_proto_send(NULL, conn, nvout, NULL, 0) == -1) pjdlog_errno(LOG_ERR, "Unable to send control response"); close: if (nvin != NULL) @@ -417,7 +417,7 @@ ctrl_thread(void *arg) uint8_t cmd; for (;;) { - if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) == -1) { if (sigexit_received) pthread_exit(NULL); pjdlog_errno(LOG_ERR, @@ -481,7 +481,7 @@ ctrl_thread(void *arg) nv_free(nvout); continue; } - if (hast_proto_send(NULL, res->hr_ctrl, nvout, NULL, 0) < 0) { + if (hast_proto_send(NULL, res->hr_ctrl, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send reply to control message"); } Modified: stable/9/sbin/hastd/ebuf.c ============================================================================== --- stable/9/sbin/hastd/ebuf.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/ebuf.c Sun Feb 5 15:51:19 2012 (r231017) @@ -116,7 +116,7 @@ ebuf_add_head(struct ebuf *eb, const voi * We can't add more entries at the front, so we have to extend * our buffer. */ - if (ebuf_head_extend(eb, size) < 0) + if (ebuf_head_extend(eb, size) == -1) return (-1); } PJDLOG_ASSERT(size <= (size_t)(eb->eb_used - eb->eb_start)); @@ -143,7 +143,7 @@ ebuf_add_tail(struct ebuf *eb, const voi * We can't add more entries at the back, so we have to extend * our buffer. */ - if (ebuf_tail_extend(eb, size) < 0) + if (ebuf_tail_extend(eb, size) == -1) return (-1); } PJDLOG_ASSERT(size <= Modified: stable/9/sbin/hastd/event.c ============================================================================== --- stable/9/sbin/hastd/event.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/event.c Sun Feb 5 15:51:19 2012 (r231017) @@ -61,11 +61,11 @@ event_send(const struct hast_resource *r "Unable to prepare event header"); goto done; } - if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send event header"); goto done; } - if (hast_proto_recv_hdr(res->hr_event, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_event, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive event header"); goto done; } @@ -92,7 +92,7 @@ event_recv(const struct hast_resource *r nvin = nvout = NULL; - if (hast_proto_recv_hdr(res->hr_event, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_event, &nvin) == -1) { /* * First error log as debug. This is because worker process * most likely exited. @@ -145,7 +145,7 @@ event_recv(const struct hast_resource *r "Unable to prepare event header"); goto fail; } - if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send event header"); goto fail; } Modified: stable/9/sbin/hastd/hast.conf.5 ============================================================================== --- stable/9/sbin/hastd/hast.conf.5 Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hast.conf.5 Sun Feb 5 15:51:19 2012 (r231017) @@ -1,8 +1,8 @@ .\" Copyright (c) 2010 The FreeBSD Foundation -.\" Copyright (c) 2010-2011 Pawel Jakub Dawidek +.\" Copyright (c) 2010-2012 Pawel Jakub Dawidek .\" All rights reserved. .\" -.\" This software was developed by Pawel Jakub Dawidek under sponsorship from +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship from .\" the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2011 +.Dd January 25, 2012 .Dt HAST.CONF 5 .Os .Sh NAME @@ -389,7 +389,9 @@ statement. .Bl -tag -width ".Pa /var/run/hastctl" -compact .It Pa /etc/hast.conf The default -.Nm +.Xr hastctl 8 +and +.Xr hastd 8 configuration file. .It Pa /var/run/hastctl Control socket used by the Modified: stable/9/sbin/hastd/hast_compression.c ============================================================================== --- stable/9/sbin/hastd/hast_compression.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hast_compression.c Sun Feb 5 15:51:19 2012 (r231017) @@ -55,7 +55,7 @@ allzeros(const void *data, size_t size) * Because inside the loop we don't check at every step, we would * get an answer only after walking through entire buffer. * To return early if the buffer doesn't contain all zeros, we probe - * 8 bytes at the begining, in the middle and at the end of the buffer + * 8 bytes at the beginning, in the middle and at the end of the buffer * first. */ Modified: stable/9/sbin/hastd/hast_proto.c ============================================================================== --- stable/9/sbin/hastd/hast_proto.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hast_proto.c Sun Feb 5 15:51:19 2012 (r231017) @@ -114,13 +114,13 @@ hast_proto_send(const struct hast_resour hdr.version = HAST_PROTO_VERSION; hdr.size = htole32((uint32_t)ebuf_size(eb)); - if (ebuf_add_head(eb, &hdr, sizeof(hdr)) < 0) + if (ebuf_add_head(eb, &hdr, sizeof(hdr)) == -1) goto end; hptr = ebuf_data(eb, &hsize); - if (proto_send(conn, hptr, hsize) < 0) + if (proto_send(conn, hptr, hsize) == -1) goto end; - if (data != NULL && proto_send(conn, dptr, size) < 0) + if (data != NULL && proto_send(conn, dptr, size) == -1) goto end; ret = 0; @@ -141,7 +141,7 @@ hast_proto_recv_hdr(const struct proto_c eb = NULL; nv = NULL; - if (proto_recv(conn, &hdr, sizeof(hdr)) < 0) + if (proto_recv(conn, &hdr, sizeof(hdr)) == -1) goto fail; if (hdr.version != HAST_PROTO_VERSION) { @@ -154,11 +154,11 @@ hast_proto_recv_hdr(const struct proto_c eb = ebuf_alloc(hdr.size); if (eb == NULL) goto fail; - if (ebuf_add_tail(eb, NULL, hdr.size) < 0) + if (ebuf_add_tail(eb, NULL, hdr.size) == -1) goto fail; hptr = ebuf_data(eb, NULL); PJDLOG_ASSERT(hptr != NULL); - if (proto_recv(conn, hptr, hdr.size) < 0) + if (proto_recv(conn, hptr, hdr.size) == -1) goto fail; nv = nv_ntoh(eb); if (nv == NULL) @@ -196,7 +196,7 @@ hast_proto_recv_data(const struct hast_r } else if (dsize == 0) { (void)nv_set_error(nv, 0); } else { - if (proto_recv(conn, data, dsize) < 0) + if (proto_recv(conn, data, dsize) == -1) goto end; for (ii = sizeof(pipeline) / sizeof(pipeline[0]); ii > 0; ii--) { Modified: stable/9/sbin/hastd/hastd.c ============================================================================== --- stable/9/sbin/hastd/hastd.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hastd.c Sun Feb 5 15:51:19 2012 (r231017) @@ -68,6 +68,8 @@ static struct hastd_config *cfg; bool sigexit_received = false; /* PID file handle. */ struct pidfh *pfh; +/* Do we run in foreground? */ +static bool foreground; /* How often check for hooks running for too long. */ #define REPORT_INTERVAL 5 @@ -97,10 +99,10 @@ g_gate_load(void) void descriptors_cleanup(struct hast_resource *res) { - struct hast_resource *tres; + struct hast_resource *tres, *tmres; struct hastd_listen *lst; - TAILQ_FOREACH(tres, &cfg->hc_resources, hr_next) { + TAILQ_FOREACH_SAFE(tres, &cfg->hc_resources, hr_next, tmres) { if (tres == res) { PJDLOG_VERIFY(res->hr_role == HAST_ROLE_SECONDARY || (res->hr_remotein == NULL && @@ -117,13 +119,17 @@ descriptors_cleanup(struct hast_resource proto_close(tres->hr_event); if (tres->hr_conn != NULL) proto_close(tres->hr_conn); + TAILQ_REMOVE(&cfg->hc_resources, tres, hr_next); + free(tres); } if (cfg->hc_controlin != NULL) proto_close(cfg->hc_controlin); proto_close(cfg->hc_controlconn); - TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { + while ((lst = TAILQ_FIRST(&cfg->hc_listen)) != NULL) { + TAILQ_REMOVE(&cfg->hc_listen, lst, hl_next); if (lst->hl_conn != NULL) proto_close(lst->hl_conn); + free(lst); } (void)pidfile_close(pfh); hook_fini(); @@ -172,7 +178,7 @@ descriptors_assert(const struct hast_res msg[0] = '\0'; maxfd = sysconf(_SC_OPEN_MAX); - if (maxfd < 0) { + if (maxfd == -1) { pjdlog_init(pjdlogmode); pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); @@ -450,7 +456,7 @@ resource_reload(const struct hast_resour pjdlog_error("Unable to allocate header for reload message."); return; } - if (hast_proto_send(res, res->hr_ctrl, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_ctrl, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send reload message"); nv_free(nvout); return; @@ -458,7 +464,7 @@ resource_reload(const struct hast_resour nv_free(nvout); /* Receive response. */ - if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive reload reply"); return; } @@ -494,7 +500,7 @@ hastd_reload(void) */ if (strcmp(cfg->hc_controladdr, newcfg->hc_controladdr) != 0) { if (proto_server(newcfg->hc_controladdr, - &newcfg->hc_controlconn) < 0) { + &newcfg->hc_controlconn) == -1) { pjdlog_errno(LOG_ERR, "Unable to listen on control address %s", newcfg->hc_controladdr); @@ -531,7 +537,7 @@ hastd_reload(void) /* * Check if pidfile's path has changed. */ - if (strcmp(cfg->hc_pidfile, newcfg->hc_pidfile) != 0) { + if (!foreground && strcmp(cfg->hc_pidfile, newcfg->hc_pidfile) != 0) { newpfh = pidfile_open(newcfg->hc_pidfile, 0600, &otherpid); if (newpfh == NULL) { if (errno == EEXIST) { @@ -543,7 +549,7 @@ hastd_reload(void) "Unable to open or create pidfile %s", newcfg->hc_pidfile); } - } else if (pidfile_write(newpfh) < 0) { + } else if (pidfile_write(newpfh) == -1) { /* Write PID to a file. */ pjdlog_errno(LOG_WARNING, "Unable to write PID to file %s", @@ -571,10 +577,14 @@ hastd_reload(void) /* * Switch to new pidfile. */ - (void)pidfile_remove(pfh); - pfh = newpfh; - (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile, - sizeof(cfg->hc_pidfile)); + if (newpfh != NULL) { + pjdlog_info("Pidfile changed from %s to %s.", cfg->hc_pidfile, + newcfg->hc_pidfile); + (void)pidfile_remove(pfh); + pfh = newpfh; + (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile, + sizeof(cfg->hc_pidfile)); + } /* * Switch to new listen addresses. Close all that were removed. */ @@ -742,7 +752,7 @@ listen_accept(struct hastd_listen *lst) proto_local_address(lst->hl_conn, laddr, sizeof(laddr)); pjdlog_debug(1, "Accepting connection to %s.", laddr); - if (proto_accept(lst->hl_conn, &conn) < 0) { + if (proto_accept(lst->hl_conn, &conn) == -1) { pjdlog_errno(LOG_ERR, "Unable to accept connection %s", laddr); return; } @@ -752,7 +762,7 @@ listen_accept(struct hastd_listen *lst) pjdlog_info("Connection from %s to %s.", raddr, laddr); /* Error in setting timeout is not critical, but why should it fail? */ - if (proto_timeout(conn, HAST_TIMEOUT) < 0) + if (proto_timeout(conn, HAST_TIMEOUT) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); nvin = nvout = nverr = NULL; @@ -771,7 +781,7 @@ listen_accept(struct hastd_listen *lst) } /* Ok, remote host can access at least one resource. */ - if (hast_proto_recv_hdr(conn, &nvin) < 0) { + if (hast_proto_recv_hdr(conn, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive header from %s", raddr); goto close; @@ -786,7 +796,7 @@ listen_accept(struct hastd_listen *lst) pjdlog_debug(2, "%s: resource=%s", raddr, resname); token = nv_get_uint8_array(nvin, &size, "token"); /* - * NULL token means that this is first conection. + * NULL token means that this is first connection. */ if (token != NULL && size != sizeof(res->hr_token)) { pjdlog_error("Received token of invalid size from %s (expected %zu, got %zu).", @@ -859,7 +869,7 @@ listen_accept(struct hastd_listen *lst) "Worker process exists (pid=%u), stopping it.", (unsigned int)res->hr_workerpid); /* Stop child process. */ - if (kill(res->hr_workerpid, SIGINT) < 0) { + if (kill(res->hr_workerpid, SIGINT) == -1) { pjdlog_errno(LOG_ERR, "Unable to stop worker process (pid=%u)", (unsigned int)res->hr_workerpid); @@ -909,7 +919,7 @@ listen_accept(struct hastd_listen *lst) strerror(nv_error(nvout))); goto fail; } - if (hast_proto_send(NULL, conn, nvout, NULL, 0) < 0) { + if (hast_proto_send(NULL, conn, nvout, NULL, 0) == -1) { int error = errno; pjdlog_errno(LOG_ERR, "Unable to send response to %s", @@ -938,7 +948,7 @@ fail: "Unable to prepare error header for %s", raddr); goto close; } - if (hast_proto_send(NULL, conn, nverr, NULL, 0) < 0) { + if (hast_proto_send(NULL, conn, nverr, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send error to %s", raddr); goto close; } @@ -963,20 +973,20 @@ connection_migrate(struct hast_resource PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY); - if (proto_recv(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_recv(res->hr_conn, &val, sizeof(val)) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive connection command"); return; } if (proto_client(res->hr_sourceaddr[0] != '\0' ? res->hr_sourceaddr : NULL, - res->hr_remoteaddr, &conn) < 0) { + res->hr_remoteaddr, &conn) == -1) { val = errno; pjdlog_errno(LOG_WARNING, "Unable to create outgoing connection to %s", res->hr_remoteaddr); goto out; } - if (proto_connect(conn, -1) < 0) { + if (proto_connect(conn, -1) == -1) { val = errno; pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); @@ -985,11 +995,11 @@ connection_migrate(struct hast_resource } val = 0; out: - if (proto_send(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_send(res->hr_conn, &val, sizeof(val)) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send reply to connection request"); } - if (val == 0 && proto_connection_send(res->hr_conn, conn) < 0) + if (val == 0 && proto_connection_send(res->hr_conn, conn) == -1) pjdlog_errno(LOG_WARNING, "Unable to send connection"); pjdlog_prefix_set("%s", ""); @@ -1155,7 +1165,6 @@ main(int argc, char *argv[]) struct hastd_listen *lst; const char *pidfile; pid_t otherpid; - bool foreground; int debuglevel; sigset_t mask; @@ -1220,16 +1229,23 @@ main(int argc, char *argv[]) pjdlog_exitx(EX_CONFIG, "Pidfile path is too long."); } } - pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - pjdlog_exitx(EX_TEMPFAIL, - "Another hastd is already running, pidfile: %s, pid: %jd.", - cfg->hc_pidfile, (intmax_t)otherpid); - } - /* If we cannot create pidfile for other reasons, only warn. */ - pjdlog_errno(LOG_WARNING, "Unable to open or create pidfile %s", - cfg->hc_pidfile); + + if (!foreground) { + pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + pjdlog_exitx(EX_TEMPFAIL, + "Another hastd is already running, pidfile: %s, pid: %jd.", + cfg->hc_pidfile, (intmax_t)otherpid); + } + /* + * If we cannot create pidfile for other reasons, + * only warn. + */ + pjdlog_errno(LOG_WARNING, + "Unable to open or create pidfile %s", + cfg->hc_pidfile); + } } /* @@ -1253,14 +1269,14 @@ main(int argc, char *argv[]) PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); /* Listen on control address. */ - if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) < 0) { + if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to listen on control address %s", cfg->hc_controladdr); } /* Listen for remote connections. */ TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { - if (proto_server(lst->hl_addr, &lst->hl_conn) < 0) { + if (proto_server(lst->hl_addr, &lst->hl_conn) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to listen on address %s", lst->hl_addr); @@ -1268,7 +1284,7 @@ main(int argc, char *argv[]) } if (!foreground) { - if (daemon(0, 0) < 0) { + if (daemon(0, 0) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to daemonize"); } @@ -1277,7 +1293,7 @@ main(int argc, char *argv[]) pjdlog_mode_set(PJDLOG_MODE_SYSLOG); /* Write PID to a file. */ - if (pidfile_write(pfh) < 0) { + if (pidfile_write(pfh) == -1) { pjdlog_errno(LOG_WARNING, "Unable to write PID to a file %s", cfg->hc_pidfile); Modified: stable/9/sbin/hastd/hooks.c ============================================================================== --- stable/9/sbin/hastd/hooks.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/hooks.c Sun Feb 5 15:51:19 2012 (r231017) @@ -105,26 +105,26 @@ descriptors(void) * Redirect stdin, stdout and stderr to /dev/null. */ fd = open(_PATH_DEVNULL, O_RDONLY); - if (fd < 0) { + if (fd == -1) { pjdlog_errno(LOG_WARNING, "Unable to open %s for reading", _PATH_DEVNULL); } else if (fd != STDIN_FILENO) { - if (dup2(fd, STDIN_FILENO) < 0) { + if (dup2(fd, STDIN_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stdin"); } close(fd); } fd = open(_PATH_DEVNULL, O_WRONLY); - if (fd < 0) { + if (fd == -1) { pjdlog_errno(LOG_WARNING, "Unable to open %s for writing", _PATH_DEVNULL); } else { - if (fd != STDOUT_FILENO && dup2(fd, STDOUT_FILENO) < 0) { + if (fd != STDOUT_FILENO && dup2(fd, STDOUT_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stdout"); } - if (fd != STDERR_FILENO && dup2(fd, STDERR_FILENO) < 0) { + if (fd != STDERR_FILENO && dup2(fd, STDERR_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stderr"); } Modified: stable/9/sbin/hastd/lzf.h ============================================================================== --- stable/9/sbin/hastd/lzf.h Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/lzf.h Sun Feb 5 15:51:19 2012 (r231017) @@ -146,7 +146,7 @@ lzf_decompress (const void *const in_dat /* * Avoid assigning values to errno variable? for some embedding purposes - * (linux kernel for example), this is neccessary. NOTE: this breaks + * (linux kernel for example), this is necessary. NOTE: this breaks * the documentation in lzf.h. */ #ifndef AVOID_ERRNO @@ -167,7 +167,7 @@ lzf_decompress (const void *const in_dat * and return EINVAL if the input stream has been corrupted. This * only shields against overflowing the input buffer and will not * detect most corrupted streams. - * This check is not normally noticable on modern hardware + * This check is not normally noticeable on modern hardware * (<1% slowdown), but might slow down older cpus considerably. */ #ifndef CHECK_INPUT Modified: stable/9/sbin/hastd/metadata.c ============================================================================== --- stable/9/sbin/hastd/metadata.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/metadata.c Sun Feb 5 15:51:19 2012 (r231017) @@ -61,14 +61,14 @@ metadata_read(struct hast_resource *res, * Is this first metadata_read() call for this resource? */ if (res->hr_localfd == -1) { - if (provinfo(res, openrw) < 0) { + if (provinfo(res, openrw) == -1) { rerrno = errno; goto fail; } opened_here = true; pjdlog_debug(1, "Obtained info about %s.", res->hr_localpath); if (openrw) { - if (flock(res->hr_localfd, LOCK_EX | LOCK_NB) < 0) { + if (flock(res->hr_localfd, LOCK_EX | LOCK_NB) == -1) { rerrno = errno; if (errno == EOPNOTSUPP) { pjdlog_warning("Unable to lock %s (operation not supported), but continuing.", @@ -91,7 +91,7 @@ metadata_read(struct hast_resource *res, "Unable to allocate memory to read metadata"); goto fail; } - if (ebuf_add_tail(eb, NULL, METADATA_SIZE) < 0) { + if (ebuf_add_tail(eb, NULL, METADATA_SIZE) == -1) { rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to allocate memory to read metadata"); @@ -101,7 +101,7 @@ metadata_read(struct hast_resource *res, buf = ebuf_data(eb, NULL); PJDLOG_ASSERT(buf != NULL); done = pread(res->hr_localfd, buf, METADATA_SIZE, 0); - if (done < 0 || done != METADATA_SIZE) { + if (done == -1 || done != METADATA_SIZE) { rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to read metadata"); ebuf_free(eb); @@ -213,7 +213,7 @@ metadata_write(struct hast_resource *res PJDLOG_ASSERT(size < METADATA_SIZE); bcopy(ptr, buf, size); done = pwrite(res->hr_localfd, buf, METADATA_SIZE, 0); - if (done < 0 || done != METADATA_SIZE) { + if (done == -1 || done != METADATA_SIZE) { pjdlog_errno(LOG_ERR, "Unable to write metadata"); goto end; } Modified: stable/9/sbin/hastd/nv.c ============================================================================== --- stable/9/sbin/hastd/nv.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/nv.c Sun Feb 5 15:51:19 2012 (r231017) @@ -385,7 +385,7 @@ nv_ntoh(struct ebuf *eb) nv->nv_ebuf = eb; nv->nv_magic = NV_MAGIC; - if (nv_validate(nv, &extra) < 0) { + if (nv_validate(nv, &extra) == -1) { rerrno = errno; nv->nv_magic = 0; free(nv); @@ -480,7 +480,7 @@ nv_add_stringv(struct nv *nv, const char ssize_t size; size = vasprintf(&value, valuefmt, valueap); - if (size < 0) { + if (size == -1) { if (nv->nv_error == 0) nv->nv_error = ENOMEM; return; @@ -627,7 +627,7 @@ nv_dump(struct nv *nv) unsigned int ii; bool swap; - if (nv_validate(nv, NULL) < 0) { + if (nv_validate(nv, NULL) == -1) { printf("error: %d\n", errno); return; } @@ -784,7 +784,7 @@ nv_add(struct nv *nv, const unsigned cha bcopy(name, nvh->nvh_name, namesize); /* Add header first. */ - if (ebuf_add_tail(nv->nv_ebuf, nvh, NVH_HSIZE(nvh)) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, nvh, NVH_HSIZE(nvh)) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; @@ -793,7 +793,7 @@ nv_add(struct nv *nv, const unsigned cha } free(nvh); /* Add the actual data. */ - if (ebuf_add_tail(nv->nv_ebuf, value, vsize) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, value, vsize) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; @@ -804,7 +804,7 @@ nv_add(struct nv *nv, const unsigned cha if (vsize == 0) return; PJDLOG_ASSERT(vsize > 0 && vsize <= sizeof(align)); - if (ebuf_add_tail(nv->nv_ebuf, align, vsize) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, align, vsize) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; Modified: stable/9/sbin/hastd/parse.y ============================================================================== --- stable/9/sbin/hastd/parse.y Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/parse.y Sun Feb 5 15:51:19 2012 (r231017) @@ -85,7 +85,7 @@ isitme(const char *name) size_t bufsize; /* - * First check if the give name matches our full hostname. + * First check if the given name matches our full hostname. */ if (gethostname(buf, sizeof(buf)) < 0) { pjdlog_errno(LOG_ERR, "gethostname() failed"); @@ -369,8 +369,8 @@ yy_config_free(struct hastd_config *conf } %} -%token CONTROL PIDFILE LISTEN PORT REPLICATION CHECKSUM COMPRESSION METAFLUSH -%token TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE SOURCE ON OFF +%token CONTROL PIDFILE LISTEN REPLICATION CHECKSUM COMPRESSION METAFLUSH +%token TIMEOUT EXEC RESOURCE NAME LOCAL REMOTE SOURCE ON OFF %token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF %token NUM STR OB CB @@ -812,6 +812,7 @@ resource_start: STR sizeof(curres->hr_name)) >= sizeof(curres->hr_name)) { pjdlog_error("Resource name is too long."); + free(curres); free($1); return (1); } Modified: stable/9/sbin/hastd/primary.c ============================================================================== --- stable/9/sbin/hastd/primary.c Sun Feb 5 15:23:32 2012 (r231016) +++ stable/9/sbin/hastd/primary.c Sun Feb 5 15:51:19 2012 (r231017) @@ -254,7 +254,7 @@ cleanup(struct hast_resource *res) ggiod.gctl_version = G_GATE_VERSION; ggiod.gctl_unit = res->hr_ggateunit; ggiod.gctl_force = 1; - if (ioctl(res->hr_ggatefd, G_GATE_CMD_DESTROY, &ggiod) < 0) { + if (ioctl(res->hr_ggatefd, G_GATE_CMD_DESTROY, &ggiod) == -1) { pjdlog_errno(LOG_WARNING, "Unable to destroy hast/%s device", res->hr_provname); @@ -451,7 +451,7 @@ init_resuid(struct hast_resource *res) /* Initialize unique resource identifier. */ arc4random_buf(&res->hr_resuid, sizeof(res->hr_resuid)); mtx_unlock(&metadata_lock); - if (metadata_write(res) < 0) + if (metadata_write(res) == -1) exit(EX_NOINPUT); return (true); } @@ -463,19 +463,19 @@ init_local(struct hast_resource *res) unsigned char *buf; size_t mapsize; - if (metadata_read(res, true) < 0) + if (metadata_read(res, true) == -1) exit(EX_NOINPUT); mtx_init(&res->hr_amp_lock); if (activemap_init(&res->hr_amp, res->hr_datasize, res->hr_extentsize, - res->hr_local_sectorsize, res->hr_keepdirty) < 0) { + res->hr_local_sectorsize, res->hr_keepdirty) == -1) { primary_exit(EX_TEMPFAIL, "Unable to create activemap"); } mtx_init(&range_lock); cv_init(&range_regular_cond); - if (rangelock_init(&range_regular) < 0) + if (rangelock_init(&range_regular) == -1) primary_exit(EX_TEMPFAIL, "Unable to create regular range lock"); cv_init(&range_sync_cond); - if (rangelock_init(&range_sync) < 0) + if (rangelock_init(&range_sync) == -1) primary_exit(EX_TEMPFAIL, "Unable to create sync range lock"); mapsize = activemap_ondisk_size(res->hr_amp); buf = calloc(1, mapsize); @@ -500,7 +500,7 @@ init_local(struct hast_resource *res) */ res->hr_primary_localcnt = 0; res->hr_primary_remotecnt = 0; - if (metadata_write(res) < 0) + if (metadata_write(res) == -1) exit(EX_NOINPUT); } @@ -511,11 +511,11 @@ primary_connect(struct hast_resource *re int16_t val; val = 1; - if (proto_send(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_send(res->hr_conn, &val, sizeof(val)) == -1) { primary_exit(EX_TEMPFAIL, "Unable to send connection request to parent"); } - if (proto_recv(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_recv(res->hr_conn, &val, sizeof(val)) == -1) { primary_exit(EX_TEMPFAIL, "Unable to receive reply to connection request from parent"); } @@ -525,18 +525,18 @@ primary_connect(struct hast_resource *re res->hr_remoteaddr); return (-1); } - if (proto_connection_recv(res->hr_conn, true, &conn) < 0) { + if (proto_connection_recv(res->hr_conn, true, &conn) == -1) { primary_exit(EX_TEMPFAIL, "Unable to receive connection from parent"); } - if (proto_connect_wait(conn, res->hr_timeout) < 0) { + if (proto_connect_wait(conn, res->hr_timeout) == -1) { pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); proto_close(conn); return (-1); } /* Error in setting timeout is not critical, but why should it fail? */ - if (proto_timeout(conn, res->hr_timeout) < 0) + if (proto_timeout(conn, res->hr_timeout) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); *connp = conn; @@ -583,7 +583,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); goto close; } - if (hast_proto_send(res, out, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, out, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -591,7 +591,7 @@ init_remote(struct hast_resource *res, s goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(out, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -655,7 +655,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); goto close; } - if (hast_proto_send(res, in, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, in, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -663,7 +663,7 @@ init_remote(struct hast_resource *res, s goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(out, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -726,7 +726,7 @@ init_remote(struct hast_resource *res, s * download its activemap. */ if (hast_proto_recv_data(res, out, nvin, map, - mapsize) < 0) { + mapsize) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive remote activemap"); nv_free(nvin); @@ -801,7 +801,7 @@ init_ggate(struct hast_resource *res) * We communicate with ggate via /dev/ggctl. Open it. */ res->hr_ggatefd = open("/dev/" G_GATE_CTL_NAME, O_RDWR); - if (res->hr_ggatefd < 0) + if (res->hr_ggatefd == -1) primary_exit(EX_OSFILE, "Unable to open /dev/" G_GATE_CTL_NAME); /* * Create provider before trying to connect, as connection failure @@ -859,7 +859,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel for sending control commands from * parent to child. */ - if (proto_client(NULL, "socketpair://", &res->hr_ctrl) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_ctrl) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -868,7 +868,7 @@ hastd_primary(struct hast_resource *res) /* * Create communication channel for sending events from child to parent. */ - if (proto_client(NULL, "socketpair://", &res->hr_event) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_event) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -878,7 +878,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel for sending connection requests from * child to parent. */ - if (proto_client(NULL, "socketpair://", &res->hr_conn) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_conn) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -886,7 +886,7 @@ hastd_primary(struct hast_resource *res) } pid = fork(); - if (pid < 0) { + if (pid == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_TEMPFAIL, "Unable to fork"); @@ -933,7 +933,7 @@ hastd_primary(struct hast_resource *res) /* * Create the guard thread first, so we can handle signals from the - * very begining. + * very beginning. */ error = pthread_create(&td, NULL, guard_thread, res); PJDLOG_ASSERT(error == 0); @@ -1095,7 +1095,7 @@ write_complete(struct hast_resource *res mtx_unlock(&metadata_lock); } rw_unlock(&hio_remote_lock[ncomp]); - if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) < 0) + if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) == -1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 15:54:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4220E1065670; Sun, 5 Feb 2012 15:54:33 +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 2E8D78FC08; Sun, 5 Feb 2012 15:54:33 +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 q15FsXih089714; Sun, 5 Feb 2012 15:54:33 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FsW9x089696; Sun, 5 Feb 2012 15:54:32 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051554.q15FsW9x089696@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:54: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: r231018 - in stable/8/sbin: hastctl hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:54:33 -0000 Author: trociny Date: Sun Feb 5 15:54:32 2012 New Revision: 231018 URL: http://svn.freebsd.org/changeset/base/231018 Log: MFC r229699, r229744, r229778, r229944, r229945, r229946, r230092, r230395, r230396, r230436, r230457, r230515, r230976: r229699 (pjd): Constify argument. r229744 (pjd): fork(2) returns -1 on failure, not some random negative number. r229778 (uqs): Spelling fixes for sbin/ r229944 (pjd): Don't touch pidfiles when running in foreground. Before that change we would create an empty pidfile on start and check if it changed on SIGHUP. r229945 (pjd): For functions that return -1 on failure check exactly for -1 and not for any negative number. r229946 (pjd): - Fix a bug where pidfile was removed in SIGHUP when it hasn't changed in configuration file. - Log the fact that pidfile has changed. r230092 (pjd): Style cleanups. r230395 (pjd): Remove unused token 'port'. r230396 (pjd): Remove another unused token. r230436 (pjd): Fix minor memory leak. r230457 (pjd): Free memory that won't be used in child. r230515 (pjd): - Fix documentation to note that /etc/hast.conf is the default configuration file for hastd(8) and hastctl(8) and not hast.conf. - In copyright statement correct that this file is documentation, not software. - Bump date. r230976 (pjd): Fix typo in comment. Modified: stable/8/sbin/hastctl/hastctl.8 stable/8/sbin/hastctl/hastctl.c stable/8/sbin/hastd/activemap.c stable/8/sbin/hastd/control.c stable/8/sbin/hastd/ebuf.c stable/8/sbin/hastd/event.c stable/8/sbin/hastd/hast.conf.5 stable/8/sbin/hastd/hast_compression.c stable/8/sbin/hastd/hast_proto.c stable/8/sbin/hastd/hastd.c stable/8/sbin/hastd/hooks.c stable/8/sbin/hastd/lzf.h stable/8/sbin/hastd/metadata.c stable/8/sbin/hastd/nv.c stable/8/sbin/hastd/parse.y stable/8/sbin/hastd/primary.c stable/8/sbin/hastd/proto.c stable/8/sbin/hastd/proto_common.c stable/8/sbin/hastd/proto_socketpair.c stable/8/sbin/hastd/proto_tcp.c stable/8/sbin/hastd/proto_uds.c stable/8/sbin/hastd/secondary.c stable/8/sbin/hastd/subr.c stable/8/sbin/hastd/subr.h stable/8/sbin/hastd/token.l Directory Properties: stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastctl/hastctl.8 ============================================================================== --- stable/8/sbin/hastctl/hastctl.8 Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastctl/hastctl.8 Sun Feb 5 15:54:32 2012 (r231018) @@ -97,7 +97,7 @@ If extent size is too small, there will related to dirty map updates, which will degrade performance of the given resource. If extent size is too large, synchronization, even in case of short -outage, can take a long time increasing the risk of loosing up-to-date +outage, can take a long time increasing the risk of losing up-to-date node before synchronization process is completed. The default extent size is .Va 2MB . Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastctl/hastctl.c Sun Feb 5 15:54:32 2012 (r231018) @@ -104,7 +104,7 @@ create_one(struct hast_resource *res, in ec = 0; pjdlog_prefix_set("[%s] ", res->hr_name); - if (provinfo(res, true) < 0) { + if (provinfo(res, true) == -1) { ec = EX_NOINPUT; goto end; } @@ -146,7 +146,7 @@ create_one(struct hast_resource *res, in res->hr_localoff = METADATA_SIZE + mapsize; - if (metadata_write(res) < 0) { + if (metadata_write(res) == -1) { ec = EX_IOERR; goto end; } @@ -401,15 +401,15 @@ main(int argc, char *argv[]) debug++; break; case 'e': - if (expand_number(optarg, &extentsize) < 0) + if (expand_number(optarg, &extentsize) == -1) errx(EX_USAGE, "Invalid extentsize"); break; case 'k': - if (expand_number(optarg, &keepdirty) < 0) + if (expand_number(optarg, &keepdirty) == -1) errx(EX_USAGE, "Invalid keepdirty"); break; case 'm': - if (expand_number(optarg, &mediasize) < 0) + if (expand_number(optarg, &mediasize) == -1) errx(EX_USAGE, "Invalid mediasize"); break; case 'h': @@ -479,13 +479,13 @@ main(int argc, char *argv[]) } /* Setup control connection... */ - if (proto_client(NULL, cfg->hc_controladdr, &controlconn) < 0) { + if (proto_client(NULL, cfg->hc_controladdr, &controlconn) == -1) { pjdlog_exit(EX_OSERR, "Unable to setup control connection to %s", cfg->hc_controladdr); } /* ...and connect to hastd. */ - if (proto_connect(controlconn, HAST_TIMEOUT) < 0) { + if (proto_connect(controlconn, HAST_TIMEOUT) == -1) { pjdlog_exit(EX_OSERR, "Unable to connect to hastd via %s", cfg->hc_controladdr); } @@ -494,14 +494,14 @@ main(int argc, char *argv[]) exit(EX_CONFIG); /* Send the command to the server... */ - if (hast_proto_send(NULL, controlconn, nv, NULL, 0) < 0) { + if (hast_proto_send(NULL, controlconn, nv, NULL, 0) == -1) { pjdlog_exit(EX_UNAVAILABLE, "Unable to send command to hastd via %s", cfg->hc_controladdr); } nv_free(nv); /* ...and receive reply. */ - if (hast_proto_recv_hdr(controlconn, &nv) < 0) { + if (hast_proto_recv_hdr(controlconn, &nv) == -1) { pjdlog_exit(EX_UNAVAILABLE, "cannot receive reply from hastd via %s", cfg->hc_controladdr); Modified: stable/8/sbin/hastd/activemap.c ============================================================================== --- stable/8/sbin/hastd/activemap.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/activemap.c Sun Feb 5 15:54:32 2012 (r231018) @@ -219,7 +219,7 @@ keepdirty_add(struct activemap *amp, int kd = keepdirty_find(amp, extent); if (kd != NULL) { /* - * Only move element at the begining. + * Only move element at the beginning. */ TAILQ_REMOVE(&->am_keepdirty, kd, kd_next); TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next); @@ -573,7 +573,7 @@ activemap_sync_rewind(struct activemap * return; } /* - * Mark that we want to start synchronization from the begining. + * Mark that we want to start synchronization from the beginning. */ amp->am_syncoff = -1; } Modified: stable/8/sbin/hastd/control.c ============================================================================== --- stable/8/sbin/hastd/control.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/control.c Sun Feb 5 15:54:32 2012 (r231018) @@ -115,7 +115,7 @@ control_set_role_common(struct hastd_con * doing that work. */ if (res->hr_workerpid != 0) { - if (kill(res->hr_workerpid, SIGTERM) < 0) { + if (kill(res->hr_workerpid, SIGTERM) == -1) { pjdlog_errno(LOG_WARNING, "Unable to kill worker process %u", (unsigned int)res->hr_workerpid); @@ -167,7 +167,7 @@ control_status_worker(struct hast_resour "Unable to prepare control header"); goto end; } - if (hast_proto_send(res, res->hr_ctrl, cnvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_ctrl, cnvout, NULL, 0) == -1) { error = errno; pjdlog_errno(LOG_ERR, "Unable to send control header"); goto end; @@ -176,7 +176,7 @@ control_status_worker(struct hast_resour /* * Receive response. */ - if (hast_proto_recv_hdr(res->hr_ctrl, &cnvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &cnvin) == -1) { error = errno; pjdlog_errno(LOG_ERR, "Unable to receive control header"); goto end; @@ -293,7 +293,7 @@ control_handle(struct hastd_config *cfg) uint8_t cmd, role; int error; - if (proto_accept(cfg->hc_controlconn, &conn) < 0) { + if (proto_accept(cfg->hc_controlconn, &conn) == -1) { pjdlog_errno(LOG_ERR, "Unable to accept control connection"); return; } @@ -302,7 +302,7 @@ control_handle(struct hastd_config *cfg) nvin = nvout = NULL; role = HAST_ROLE_UNDEF; - if (hast_proto_recv_hdr(conn, &nvin) < 0) { + if (hast_proto_recv_hdr(conn, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive control header"); nvin = NULL; goto close; @@ -395,7 +395,7 @@ fail: if (error != 0) nv_add_int16(nvout, error, "error"); - if (hast_proto_send(NULL, conn, nvout, NULL, 0) < 0) + if (hast_proto_send(NULL, conn, nvout, NULL, 0) == -1) pjdlog_errno(LOG_ERR, "Unable to send control response"); close: if (nvin != NULL) @@ -417,7 +417,7 @@ ctrl_thread(void *arg) uint8_t cmd; for (;;) { - if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) == -1) { if (sigexit_received) pthread_exit(NULL); pjdlog_errno(LOG_ERR, @@ -481,7 +481,7 @@ ctrl_thread(void *arg) nv_free(nvout); continue; } - if (hast_proto_send(NULL, res->hr_ctrl, nvout, NULL, 0) < 0) { + if (hast_proto_send(NULL, res->hr_ctrl, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send reply to control message"); } Modified: stable/8/sbin/hastd/ebuf.c ============================================================================== --- stable/8/sbin/hastd/ebuf.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/ebuf.c Sun Feb 5 15:54:32 2012 (r231018) @@ -116,7 +116,7 @@ ebuf_add_head(struct ebuf *eb, const voi * We can't add more entries at the front, so we have to extend * our buffer. */ - if (ebuf_head_extend(eb, size) < 0) + if (ebuf_head_extend(eb, size) == -1) return (-1); } PJDLOG_ASSERT(size <= (size_t)(eb->eb_used - eb->eb_start)); @@ -143,7 +143,7 @@ ebuf_add_tail(struct ebuf *eb, const voi * We can't add more entries at the back, so we have to extend * our buffer. */ - if (ebuf_tail_extend(eb, size) < 0) + if (ebuf_tail_extend(eb, size) == -1) return (-1); } PJDLOG_ASSERT(size <= Modified: stable/8/sbin/hastd/event.c ============================================================================== --- stable/8/sbin/hastd/event.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/event.c Sun Feb 5 15:54:32 2012 (r231018) @@ -61,11 +61,11 @@ event_send(const struct hast_resource *r "Unable to prepare event header"); goto done; } - if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send event header"); goto done; } - if (hast_proto_recv_hdr(res->hr_event, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_event, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive event header"); goto done; } @@ -92,7 +92,7 @@ event_recv(const struct hast_resource *r nvin = nvout = NULL; - if (hast_proto_recv_hdr(res->hr_event, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_event, &nvin) == -1) { /* * First error log as debug. This is because worker process * most likely exited. @@ -145,7 +145,7 @@ event_recv(const struct hast_resource *r "Unable to prepare event header"); goto fail; } - if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send event header"); goto fail; } Modified: stable/8/sbin/hastd/hast.conf.5 ============================================================================== --- stable/8/sbin/hastd/hast.conf.5 Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hast.conf.5 Sun Feb 5 15:54:32 2012 (r231018) @@ -1,8 +1,8 @@ .\" Copyright (c) 2010 The FreeBSD Foundation -.\" Copyright (c) 2010-2011 Pawel Jakub Dawidek +.\" Copyright (c) 2010-2012 Pawel Jakub Dawidek .\" All rights reserved. .\" -.\" This software was developed by Pawel Jakub Dawidek under sponsorship from +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship from .\" the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2011 +.Dd January 25, 2012 .Dt HAST.CONF 5 .Os .Sh NAME @@ -389,7 +389,9 @@ statement. .Bl -tag -width ".Pa /var/run/hastctl" -compact .It Pa /etc/hast.conf The default -.Nm +.Xr hastctl 8 +and +.Xr hastd 8 configuration file. .It Pa /var/run/hastctl Control socket used by the Modified: stable/8/sbin/hastd/hast_compression.c ============================================================================== --- stable/8/sbin/hastd/hast_compression.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hast_compression.c Sun Feb 5 15:54:32 2012 (r231018) @@ -55,7 +55,7 @@ allzeros(const void *data, size_t size) * Because inside the loop we don't check at every step, we would * get an answer only after walking through entire buffer. * To return early if the buffer doesn't contain all zeros, we probe - * 8 bytes at the begining, in the middle and at the end of the buffer + * 8 bytes at the beginning, in the middle and at the end of the buffer * first. */ Modified: stable/8/sbin/hastd/hast_proto.c ============================================================================== --- stable/8/sbin/hastd/hast_proto.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hast_proto.c Sun Feb 5 15:54:32 2012 (r231018) @@ -114,13 +114,13 @@ hast_proto_send(const struct hast_resour hdr.version = HAST_PROTO_VERSION; hdr.size = htole32((uint32_t)ebuf_size(eb)); - if (ebuf_add_head(eb, &hdr, sizeof(hdr)) < 0) + if (ebuf_add_head(eb, &hdr, sizeof(hdr)) == -1) goto end; hptr = ebuf_data(eb, &hsize); - if (proto_send(conn, hptr, hsize) < 0) + if (proto_send(conn, hptr, hsize) == -1) goto end; - if (data != NULL && proto_send(conn, dptr, size) < 0) + if (data != NULL && proto_send(conn, dptr, size) == -1) goto end; ret = 0; @@ -141,7 +141,7 @@ hast_proto_recv_hdr(const struct proto_c eb = NULL; nv = NULL; - if (proto_recv(conn, &hdr, sizeof(hdr)) < 0) + if (proto_recv(conn, &hdr, sizeof(hdr)) == -1) goto fail; if (hdr.version != HAST_PROTO_VERSION) { @@ -154,11 +154,11 @@ hast_proto_recv_hdr(const struct proto_c eb = ebuf_alloc(hdr.size); if (eb == NULL) goto fail; - if (ebuf_add_tail(eb, NULL, hdr.size) < 0) + if (ebuf_add_tail(eb, NULL, hdr.size) == -1) goto fail; hptr = ebuf_data(eb, NULL); PJDLOG_ASSERT(hptr != NULL); - if (proto_recv(conn, hptr, hdr.size) < 0) + if (proto_recv(conn, hptr, hdr.size) == -1) goto fail; nv = nv_ntoh(eb); if (nv == NULL) @@ -196,7 +196,7 @@ hast_proto_recv_data(const struct hast_r } else if (dsize == 0) { (void)nv_set_error(nv, 0); } else { - if (proto_recv(conn, data, dsize) < 0) + if (proto_recv(conn, data, dsize) == -1) goto end; for (ii = sizeof(pipeline) / sizeof(pipeline[0]); ii > 0; ii--) { Modified: stable/8/sbin/hastd/hastd.c ============================================================================== --- stable/8/sbin/hastd/hastd.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hastd.c Sun Feb 5 15:54:32 2012 (r231018) @@ -68,6 +68,8 @@ static struct hastd_config *cfg; bool sigexit_received = false; /* PID file handle. */ struct pidfh *pfh; +/* Do we run in foreground? */ +static bool foreground; /* How often check for hooks running for too long. */ #define REPORT_INTERVAL 5 @@ -97,10 +99,10 @@ g_gate_load(void) void descriptors_cleanup(struct hast_resource *res) { - struct hast_resource *tres; + struct hast_resource *tres, *tmres; struct hastd_listen *lst; - TAILQ_FOREACH(tres, &cfg->hc_resources, hr_next) { + TAILQ_FOREACH_SAFE(tres, &cfg->hc_resources, hr_next, tmres) { if (tres == res) { PJDLOG_VERIFY(res->hr_role == HAST_ROLE_SECONDARY || (res->hr_remotein == NULL && @@ -117,13 +119,17 @@ descriptors_cleanup(struct hast_resource proto_close(tres->hr_event); if (tres->hr_conn != NULL) proto_close(tres->hr_conn); + TAILQ_REMOVE(&cfg->hc_resources, tres, hr_next); + free(tres); } if (cfg->hc_controlin != NULL) proto_close(cfg->hc_controlin); proto_close(cfg->hc_controlconn); - TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { + while ((lst = TAILQ_FIRST(&cfg->hc_listen)) != NULL) { + TAILQ_REMOVE(&cfg->hc_listen, lst, hl_next); if (lst->hl_conn != NULL) proto_close(lst->hl_conn); + free(lst); } (void)pidfile_close(pfh); hook_fini(); @@ -172,7 +178,7 @@ descriptors_assert(const struct hast_res msg[0] = '\0'; maxfd = sysconf(_SC_OPEN_MAX); - if (maxfd < 0) { + if (maxfd == -1) { pjdlog_init(pjdlogmode); pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); @@ -450,7 +456,7 @@ resource_reload(const struct hast_resour pjdlog_error("Unable to allocate header for reload message."); return; } - if (hast_proto_send(res, res->hr_ctrl, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_ctrl, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send reload message"); nv_free(nvout); return; @@ -458,7 +464,7 @@ resource_reload(const struct hast_resour nv_free(nvout); /* Receive response. */ - if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive reload reply"); return; } @@ -494,7 +500,7 @@ hastd_reload(void) */ if (strcmp(cfg->hc_controladdr, newcfg->hc_controladdr) != 0) { if (proto_server(newcfg->hc_controladdr, - &newcfg->hc_controlconn) < 0) { + &newcfg->hc_controlconn) == -1) { pjdlog_errno(LOG_ERR, "Unable to listen on control address %s", newcfg->hc_controladdr); @@ -531,7 +537,7 @@ hastd_reload(void) /* * Check if pidfile's path has changed. */ - if (strcmp(cfg->hc_pidfile, newcfg->hc_pidfile) != 0) { + if (!foreground && strcmp(cfg->hc_pidfile, newcfg->hc_pidfile) != 0) { newpfh = pidfile_open(newcfg->hc_pidfile, 0600, &otherpid); if (newpfh == NULL) { if (errno == EEXIST) { @@ -543,7 +549,7 @@ hastd_reload(void) "Unable to open or create pidfile %s", newcfg->hc_pidfile); } - } else if (pidfile_write(newpfh) < 0) { + } else if (pidfile_write(newpfh) == -1) { /* Write PID to a file. */ pjdlog_errno(LOG_WARNING, "Unable to write PID to file %s", @@ -571,10 +577,14 @@ hastd_reload(void) /* * Switch to new pidfile. */ - (void)pidfile_remove(pfh); - pfh = newpfh; - (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile, - sizeof(cfg->hc_pidfile)); + if (newpfh != NULL) { + pjdlog_info("Pidfile changed from %s to %s.", cfg->hc_pidfile, + newcfg->hc_pidfile); + (void)pidfile_remove(pfh); + pfh = newpfh; + (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile, + sizeof(cfg->hc_pidfile)); + } /* * Switch to new listen addresses. Close all that were removed. */ @@ -742,7 +752,7 @@ listen_accept(struct hastd_listen *lst) proto_local_address(lst->hl_conn, laddr, sizeof(laddr)); pjdlog_debug(1, "Accepting connection to %s.", laddr); - if (proto_accept(lst->hl_conn, &conn) < 0) { + if (proto_accept(lst->hl_conn, &conn) == -1) { pjdlog_errno(LOG_ERR, "Unable to accept connection %s", laddr); return; } @@ -752,7 +762,7 @@ listen_accept(struct hastd_listen *lst) pjdlog_info("Connection from %s to %s.", raddr, laddr); /* Error in setting timeout is not critical, but why should it fail? */ - if (proto_timeout(conn, HAST_TIMEOUT) < 0) + if (proto_timeout(conn, HAST_TIMEOUT) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); nvin = nvout = nverr = NULL; @@ -771,7 +781,7 @@ listen_accept(struct hastd_listen *lst) } /* Ok, remote host can access at least one resource. */ - if (hast_proto_recv_hdr(conn, &nvin) < 0) { + if (hast_proto_recv_hdr(conn, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive header from %s", raddr); goto close; @@ -786,7 +796,7 @@ listen_accept(struct hastd_listen *lst) pjdlog_debug(2, "%s: resource=%s", raddr, resname); token = nv_get_uint8_array(nvin, &size, "token"); /* - * NULL token means that this is first conection. + * NULL token means that this is first connection. */ if (token != NULL && size != sizeof(res->hr_token)) { pjdlog_error("Received token of invalid size from %s (expected %zu, got %zu).", @@ -859,7 +869,7 @@ listen_accept(struct hastd_listen *lst) "Worker process exists (pid=%u), stopping it.", (unsigned int)res->hr_workerpid); /* Stop child process. */ - if (kill(res->hr_workerpid, SIGINT) < 0) { + if (kill(res->hr_workerpid, SIGINT) == -1) { pjdlog_errno(LOG_ERR, "Unable to stop worker process (pid=%u)", (unsigned int)res->hr_workerpid); @@ -909,7 +919,7 @@ listen_accept(struct hastd_listen *lst) strerror(nv_error(nvout))); goto fail; } - if (hast_proto_send(NULL, conn, nvout, NULL, 0) < 0) { + if (hast_proto_send(NULL, conn, nvout, NULL, 0) == -1) { int error = errno; pjdlog_errno(LOG_ERR, "Unable to send response to %s", @@ -938,7 +948,7 @@ fail: "Unable to prepare error header for %s", raddr); goto close; } - if (hast_proto_send(NULL, conn, nverr, NULL, 0) < 0) { + if (hast_proto_send(NULL, conn, nverr, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send error to %s", raddr); goto close; } @@ -963,20 +973,20 @@ connection_migrate(struct hast_resource PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY); - if (proto_recv(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_recv(res->hr_conn, &val, sizeof(val)) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive connection command"); return; } if (proto_client(res->hr_sourceaddr[0] != '\0' ? res->hr_sourceaddr : NULL, - res->hr_remoteaddr, &conn) < 0) { + res->hr_remoteaddr, &conn) == -1) { val = errno; pjdlog_errno(LOG_WARNING, "Unable to create outgoing connection to %s", res->hr_remoteaddr); goto out; } - if (proto_connect(conn, -1) < 0) { + if (proto_connect(conn, -1) == -1) { val = errno; pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); @@ -985,11 +995,11 @@ connection_migrate(struct hast_resource } val = 0; out: - if (proto_send(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_send(res->hr_conn, &val, sizeof(val)) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send reply to connection request"); } - if (val == 0 && proto_connection_send(res->hr_conn, conn) < 0) + if (val == 0 && proto_connection_send(res->hr_conn, conn) == -1) pjdlog_errno(LOG_WARNING, "Unable to send connection"); pjdlog_prefix_set("%s", ""); @@ -1155,7 +1165,6 @@ main(int argc, char *argv[]) struct hastd_listen *lst; const char *pidfile; pid_t otherpid; - bool foreground; int debuglevel; sigset_t mask; @@ -1220,16 +1229,23 @@ main(int argc, char *argv[]) pjdlog_exitx(EX_CONFIG, "Pidfile path is too long."); } } - pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - pjdlog_exitx(EX_TEMPFAIL, - "Another hastd is already running, pidfile: %s, pid: %jd.", - cfg->hc_pidfile, (intmax_t)otherpid); - } - /* If we cannot create pidfile for other reasons, only warn. */ - pjdlog_errno(LOG_WARNING, "Unable to open or create pidfile %s", - cfg->hc_pidfile); + + if (!foreground) { + pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + pjdlog_exitx(EX_TEMPFAIL, + "Another hastd is already running, pidfile: %s, pid: %jd.", + cfg->hc_pidfile, (intmax_t)otherpid); + } + /* + * If we cannot create pidfile for other reasons, + * only warn. + */ + pjdlog_errno(LOG_WARNING, + "Unable to open or create pidfile %s", + cfg->hc_pidfile); + } } /* @@ -1253,14 +1269,14 @@ main(int argc, char *argv[]) PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); /* Listen on control address. */ - if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) < 0) { + if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to listen on control address %s", cfg->hc_controladdr); } /* Listen for remote connections. */ TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { - if (proto_server(lst->hl_addr, &lst->hl_conn) < 0) { + if (proto_server(lst->hl_addr, &lst->hl_conn) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to listen on address %s", lst->hl_addr); @@ -1268,7 +1284,7 @@ main(int argc, char *argv[]) } if (!foreground) { - if (daemon(0, 0) < 0) { + if (daemon(0, 0) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to daemonize"); } @@ -1277,7 +1293,7 @@ main(int argc, char *argv[]) pjdlog_mode_set(PJDLOG_MODE_SYSLOG); /* Write PID to a file. */ - if (pidfile_write(pfh) < 0) { + if (pidfile_write(pfh) == -1) { pjdlog_errno(LOG_WARNING, "Unable to write PID to a file %s", cfg->hc_pidfile); Modified: stable/8/sbin/hastd/hooks.c ============================================================================== --- stable/8/sbin/hastd/hooks.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/hooks.c Sun Feb 5 15:54:32 2012 (r231018) @@ -105,26 +105,26 @@ descriptors(void) * Redirect stdin, stdout and stderr to /dev/null. */ fd = open(_PATH_DEVNULL, O_RDONLY); - if (fd < 0) { + if (fd == -1) { pjdlog_errno(LOG_WARNING, "Unable to open %s for reading", _PATH_DEVNULL); } else if (fd != STDIN_FILENO) { - if (dup2(fd, STDIN_FILENO) < 0) { + if (dup2(fd, STDIN_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stdin"); } close(fd); } fd = open(_PATH_DEVNULL, O_WRONLY); - if (fd < 0) { + if (fd == -1) { pjdlog_errno(LOG_WARNING, "Unable to open %s for writing", _PATH_DEVNULL); } else { - if (fd != STDOUT_FILENO && dup2(fd, STDOUT_FILENO) < 0) { + if (fd != STDOUT_FILENO && dup2(fd, STDOUT_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stdout"); } - if (fd != STDERR_FILENO && dup2(fd, STDERR_FILENO) < 0) { + if (fd != STDERR_FILENO && dup2(fd, STDERR_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stderr"); } Modified: stable/8/sbin/hastd/lzf.h ============================================================================== --- stable/8/sbin/hastd/lzf.h Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/lzf.h Sun Feb 5 15:54:32 2012 (r231018) @@ -146,7 +146,7 @@ lzf_decompress (const void *const in_dat /* * Avoid assigning values to errno variable? for some embedding purposes - * (linux kernel for example), this is neccessary. NOTE: this breaks + * (linux kernel for example), this is necessary. NOTE: this breaks * the documentation in lzf.h. */ #ifndef AVOID_ERRNO @@ -167,7 +167,7 @@ lzf_decompress (const void *const in_dat * and return EINVAL if the input stream has been corrupted. This * only shields against overflowing the input buffer and will not * detect most corrupted streams. - * This check is not normally noticable on modern hardware + * This check is not normally noticeable on modern hardware * (<1% slowdown), but might slow down older cpus considerably. */ #ifndef CHECK_INPUT Modified: stable/8/sbin/hastd/metadata.c ============================================================================== --- stable/8/sbin/hastd/metadata.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/metadata.c Sun Feb 5 15:54:32 2012 (r231018) @@ -61,14 +61,14 @@ metadata_read(struct hast_resource *res, * Is this first metadata_read() call for this resource? */ if (res->hr_localfd == -1) { - if (provinfo(res, openrw) < 0) { + if (provinfo(res, openrw) == -1) { rerrno = errno; goto fail; } opened_here = true; pjdlog_debug(1, "Obtained info about %s.", res->hr_localpath); if (openrw) { - if (flock(res->hr_localfd, LOCK_EX | LOCK_NB) < 0) { + if (flock(res->hr_localfd, LOCK_EX | LOCK_NB) == -1) { rerrno = errno; if (errno == EOPNOTSUPP) { pjdlog_warning("Unable to lock %s (operation not supported), but continuing.", @@ -91,7 +91,7 @@ metadata_read(struct hast_resource *res, "Unable to allocate memory to read metadata"); goto fail; } - if (ebuf_add_tail(eb, NULL, METADATA_SIZE) < 0) { + if (ebuf_add_tail(eb, NULL, METADATA_SIZE) == -1) { rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to allocate memory to read metadata"); @@ -101,7 +101,7 @@ metadata_read(struct hast_resource *res, buf = ebuf_data(eb, NULL); PJDLOG_ASSERT(buf != NULL); done = pread(res->hr_localfd, buf, METADATA_SIZE, 0); - if (done < 0 || done != METADATA_SIZE) { + if (done == -1 || done != METADATA_SIZE) { rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to read metadata"); ebuf_free(eb); @@ -213,7 +213,7 @@ metadata_write(struct hast_resource *res PJDLOG_ASSERT(size < METADATA_SIZE); bcopy(ptr, buf, size); done = pwrite(res->hr_localfd, buf, METADATA_SIZE, 0); - if (done < 0 || done != METADATA_SIZE) { + if (done == -1 || done != METADATA_SIZE) { pjdlog_errno(LOG_ERR, "Unable to write metadata"); goto end; } Modified: stable/8/sbin/hastd/nv.c ============================================================================== --- stable/8/sbin/hastd/nv.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/nv.c Sun Feb 5 15:54:32 2012 (r231018) @@ -385,7 +385,7 @@ nv_ntoh(struct ebuf *eb) nv->nv_ebuf = eb; nv->nv_magic = NV_MAGIC; - if (nv_validate(nv, &extra) < 0) { + if (nv_validate(nv, &extra) == -1) { rerrno = errno; nv->nv_magic = 0; free(nv); @@ -480,7 +480,7 @@ nv_add_stringv(struct nv *nv, const char ssize_t size; size = vasprintf(&value, valuefmt, valueap); - if (size < 0) { + if (size == -1) { if (nv->nv_error == 0) nv->nv_error = ENOMEM; return; @@ -627,7 +627,7 @@ nv_dump(struct nv *nv) unsigned int ii; bool swap; - if (nv_validate(nv, NULL) < 0) { + if (nv_validate(nv, NULL) == -1) { printf("error: %d\n", errno); return; } @@ -784,7 +784,7 @@ nv_add(struct nv *nv, const unsigned cha bcopy(name, nvh->nvh_name, namesize); /* Add header first. */ - if (ebuf_add_tail(nv->nv_ebuf, nvh, NVH_HSIZE(nvh)) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, nvh, NVH_HSIZE(nvh)) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; @@ -793,7 +793,7 @@ nv_add(struct nv *nv, const unsigned cha } free(nvh); /* Add the actual data. */ - if (ebuf_add_tail(nv->nv_ebuf, value, vsize) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, value, vsize) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; @@ -804,7 +804,7 @@ nv_add(struct nv *nv, const unsigned cha if (vsize == 0) return; PJDLOG_ASSERT(vsize > 0 && vsize <= sizeof(align)); - if (ebuf_add_tail(nv->nv_ebuf, align, vsize) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, align, vsize) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; Modified: stable/8/sbin/hastd/parse.y ============================================================================== --- stable/8/sbin/hastd/parse.y Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/parse.y Sun Feb 5 15:54:32 2012 (r231018) @@ -85,7 +85,7 @@ isitme(const char *name) size_t bufsize; /* - * First check if the give name matches our full hostname. + * First check if the given name matches our full hostname. */ if (gethostname(buf, sizeof(buf)) < 0) { pjdlog_errno(LOG_ERR, "gethostname() failed"); @@ -369,8 +369,8 @@ yy_config_free(struct hastd_config *conf } %} -%token CONTROL PIDFILE LISTEN PORT REPLICATION CHECKSUM COMPRESSION METAFLUSH -%token TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE SOURCE ON OFF +%token CONTROL PIDFILE LISTEN REPLICATION CHECKSUM COMPRESSION METAFLUSH +%token TIMEOUT EXEC RESOURCE NAME LOCAL REMOTE SOURCE ON OFF %token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF %token NUM STR OB CB @@ -812,6 +812,7 @@ resource_start: STR sizeof(curres->hr_name)) >= sizeof(curres->hr_name)) { pjdlog_error("Resource name is too long."); + free(curres); free($1); return (1); } Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Sun Feb 5 15:51:19 2012 (r231017) +++ stable/8/sbin/hastd/primary.c Sun Feb 5 15:54:32 2012 (r231018) @@ -254,7 +254,7 @@ cleanup(struct hast_resource *res) ggiod.gctl_version = G_GATE_VERSION; ggiod.gctl_unit = res->hr_ggateunit; ggiod.gctl_force = 1; - if (ioctl(res->hr_ggatefd, G_GATE_CMD_DESTROY, &ggiod) < 0) { + if (ioctl(res->hr_ggatefd, G_GATE_CMD_DESTROY, &ggiod) == -1) { pjdlog_errno(LOG_WARNING, "Unable to destroy hast/%s device", res->hr_provname); @@ -451,7 +451,7 @@ init_resuid(struct hast_resource *res) /* Initialize unique resource identifier. */ arc4random_buf(&res->hr_resuid, sizeof(res->hr_resuid)); mtx_unlock(&metadata_lock); - if (metadata_write(res) < 0) + if (metadata_write(res) == -1) exit(EX_NOINPUT); return (true); } @@ -463,19 +463,19 @@ init_local(struct hast_resource *res) unsigned char *buf; size_t mapsize; - if (metadata_read(res, true) < 0) + if (metadata_read(res, true) == -1) exit(EX_NOINPUT); mtx_init(&res->hr_amp_lock); if (activemap_init(&res->hr_amp, res->hr_datasize, res->hr_extentsize, - res->hr_local_sectorsize, res->hr_keepdirty) < 0) { + res->hr_local_sectorsize, res->hr_keepdirty) == -1) { primary_exit(EX_TEMPFAIL, "Unable to create activemap"); } mtx_init(&range_lock); cv_init(&range_regular_cond); - if (rangelock_init(&range_regular) < 0) + if (rangelock_init(&range_regular) == -1) primary_exit(EX_TEMPFAIL, "Unable to create regular range lock"); cv_init(&range_sync_cond); - if (rangelock_init(&range_sync) < 0) + if (rangelock_init(&range_sync) == -1) primary_exit(EX_TEMPFAIL, "Unable to create sync range lock"); mapsize = activemap_ondisk_size(res->hr_amp); buf = calloc(1, mapsize); @@ -500,7 +500,7 @@ init_local(struct hast_resource *res) */ res->hr_primary_localcnt = 0; res->hr_primary_remotecnt = 0; - if (metadata_write(res) < 0) + if (metadata_write(res) == -1) exit(EX_NOINPUT); } @@ -511,11 +511,11 @@ primary_connect(struct hast_resource *re int16_t val; val = 1; - if (proto_send(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_send(res->hr_conn, &val, sizeof(val)) == -1) { primary_exit(EX_TEMPFAIL, "Unable to send connection request to parent"); } - if (proto_recv(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_recv(res->hr_conn, &val, sizeof(val)) == -1) { primary_exit(EX_TEMPFAIL, "Unable to receive reply to connection request from parent"); } @@ -525,18 +525,18 @@ primary_connect(struct hast_resource *re res->hr_remoteaddr); return (-1); } - if (proto_connection_recv(res->hr_conn, true, &conn) < 0) { + if (proto_connection_recv(res->hr_conn, true, &conn) == -1) { primary_exit(EX_TEMPFAIL, "Unable to receive connection from parent"); } - if (proto_connect_wait(conn, res->hr_timeout) < 0) { + if (proto_connect_wait(conn, res->hr_timeout) == -1) { pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); proto_close(conn); return (-1); } /* Error in setting timeout is not critical, but why should it fail? */ - if (proto_timeout(conn, res->hr_timeout) < 0) + if (proto_timeout(conn, res->hr_timeout) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); *connp = conn; @@ -583,7 +583,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); goto close; } - if (hast_proto_send(res, out, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, out, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -591,7 +591,7 @@ init_remote(struct hast_resource *res, s goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(out, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -655,7 +655,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); goto close; } - if (hast_proto_send(res, in, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, in, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -663,7 +663,7 @@ init_remote(struct hast_resource *res, s goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(out, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -726,7 +726,7 @@ init_remote(struct hast_resource *res, s * download its activemap. */ if (hast_proto_recv_data(res, out, nvin, map, - mapsize) < 0) { + mapsize) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive remote activemap"); nv_free(nvin); @@ -801,7 +801,7 @@ init_ggate(struct hast_resource *res) * We communicate with ggate via /dev/ggctl. Open it. */ res->hr_ggatefd = open("/dev/" G_GATE_CTL_NAME, O_RDWR); - if (res->hr_ggatefd < 0) + if (res->hr_ggatefd == -1) primary_exit(EX_OSFILE, "Unable to open /dev/" G_GATE_CTL_NAME); /* * Create provider before trying to connect, as connection failure @@ -859,7 +859,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel for sending control commands from * parent to child. */ - if (proto_client(NULL, "socketpair://", &res->hr_ctrl) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_ctrl) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -868,7 +868,7 @@ hastd_primary(struct hast_resource *res) /* * Create communication channel for sending events from child to parent. */ - if (proto_client(NULL, "socketpair://", &res->hr_event) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_event) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -878,7 +878,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel for sending connection requests from * child to parent. */ - if (proto_client(NULL, "socketpair://", &res->hr_conn) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_conn) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -886,7 +886,7 @@ hastd_primary(struct hast_resource *res) } pid = fork(); - if (pid < 0) { + if (pid == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_TEMPFAIL, "Unable to fork"); @@ -933,7 +933,7 @@ hastd_primary(struct hast_resource *res) /* * Create the guard thread first, so we can handle signals from the - * very begining. + * very beginning. */ error = pthread_create(&td, NULL, guard_thread, res); PJDLOG_ASSERT(error == 0); @@ -1095,7 +1095,7 @@ write_complete(struct hast_resource *res mtx_unlock(&metadata_lock); } rw_unlock(&hio_remote_lock[ncomp]); - if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) < 0) + if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) == -1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 15:59:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324071065672; Sun, 5 Feb 2012 15:59:19 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 210F88FC14; Sun, 5 Feb 2012 15:59:19 +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 q15FxI7Y089922; Sun, 5 Feb 2012 15:59:18 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FxIMQ089920; Sun, 5 Feb 2012 15:59:18 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201202051559.q15FxIMQ089920@svn.freebsd.org> From: Andreas Tobler Date: Sun, 5 Feb 2012 15:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231019 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:59:19 -0000 Author: andreast Date: Sun Feb 5 15:59:18 2012 New Revision: 231019 URL: http://svn.freebsd.org/changeset/base/231019 Log: Revert the _NOPROF entries on cpu_throw, cpu_switch and savectx. They can be profiled too now. MFC after: 2 weeks Modified: head/sys/powerpc/aim/swtch64.S Modified: head/sys/powerpc/aim/swtch64.S ============================================================================== --- head/sys/powerpc/aim/swtch64.S Sun Feb 5 15:54:32 2012 (r231018) +++ head/sys/powerpc/aim/swtch64.S Sun Feb 5 15:59:18 2012 (r231019) @@ -68,7 +68,7 @@ /* * void cpu_throw(struct thread *old, struct thread *new) */ -ENTRY_NOPROF(cpu_throw) +ENTRY(cpu_throw) mr %r13, %r4 b cpu_switchin @@ -79,7 +79,7 @@ ENTRY_NOPROF(cpu_throw) * * Switch to a new thread saving the current state in the old thread. */ -ENTRY_NOPROF(cpu_switch) +ENTRY(cpu_switch) ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. These can now be used for scratch */ @@ -237,7 +237,7 @@ blocked_loop: * savectx(pcb) * Update pcb, saving current processor state */ -ENTRY_NOPROF(savectx) +ENTRY(savectx) std %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs. */ std %r13,PCB_CONTEXT+1*8(%r3) std %r14,PCB_CONTEXT+2*8(%r3) From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 16:08:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49C13106566C; Sun, 5 Feb 2012 16:08:46 +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 1D5058FC08; Sun, 5 Feb 2012 16:08:46 +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 q15G8jeZ090307; Sun, 5 Feb 2012 16:08:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15G8jqp090305; Sun, 5 Feb 2012 16:08:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051608.q15G8jqp090305@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:08: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: r231020 - stable/9/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:08:46 -0000 Author: nwhitehorn Date: Sun Feb 5 16:08:45 2012 New Revision: 231020 URL: http://svn.freebsd.org/changeset/base/231020 Log: MFC r230309: Warn if trying to install over an existing partition, which usually fails anyway due to libarchive not being able to overwrite schg flags. PR: bin/164278 Modified: stable/9/usr.sbin/bsdinstall/partedit/partedit.c Directory Properties: stable/9/usr.sbin/bsdinstall/ (props changed) stable/9/usr.sbin/bsdinstall/scripts/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/partedit/partedit.c ============================================================================== --- stable/9/usr.sbin/bsdinstall/partedit/partedit.c Sun Feb 5 15:59:18 2012 (r231019) +++ stable/9/usr.sbin/bsdinstall/partedit/partedit.c Sun Feb 5 16:08:45 2012 (r231020) @@ -240,23 +240,41 @@ delete_part_metadata(const char *name) static int validate_setup(void) { - struct partition_metadata *md; - int root_found = FALSE; + struct partition_metadata *md, *root = NULL; + int cancel; TAILQ_FOREACH(md, &part_metadata, metadata) { if (md->fstab != NULL && strcmp(md->fstab->fs_file, "/") == 0) - root_found = TRUE; + root = md; /* XXX: Check for duplicate mountpoints */ } - if (!root_found) { + if (root == NULL) { dialog_msgbox("Error", "No root partition was found. " "The root FreeBSD partition must have a mountpoint of '/'.", 0, 0, TRUE); return (FALSE); } + /* + * Check for root partitions that we aren't formatting, which is + * usually a mistake + */ + if (root->newfs == NULL) { + dialog_vars.defaultno = TRUE; + cancel = dialog_yesno("Warning", "The chosen root partition " + "has a preexisting filesystem. If it contains an existing " + "FreeBSD system, please update it with freebsd-update " + "instead of installing a new system on it. The partition " + "can also be erased by pressing \"No\" and then deleting " + "and recreating it. Are you sure you want to proceed?", + 0, 0); + dialog_vars.defaultno = FALSE; + if (cancel) + return (FALSE); + } + return (TRUE); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 16:14:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB882106564A; Sun, 5 Feb 2012 16:14:23 +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 9EE1B8FC12; Sun, 5 Feb 2012 16:14: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 q15GENrq090541; Sun, 5 Feb 2012 16:14:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GENlt090538; Sun, 5 Feb 2012 16:14:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051614.q15GENlt090538@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:14: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: r231021 - in stable/9/sys/powerpc: ofw powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:14:23 -0000 Author: nwhitehorn Date: Sun Feb 5 16:14:23 2012 New Revision: 231021 URL: http://svn.freebsd.org/changeset/base/231021 Log: MFC r230398: Prevent an error resulting from signed/unsigned comparison on systems that do not comply with the OF spec. Submitted by: Anders Gavare Modified: stable/9/sys/powerpc/ofw/ofw_machdep.c stable/9/sys/powerpc/powermac/macio.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) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_machdep.c Sun Feb 5 16:08:45 2012 (r231020) +++ stable/9/sys/powerpc/ofw/ofw_machdep.c Sun Feb 5 16:14:23 2012 (r231021) @@ -171,10 +171,10 @@ parse_ofw_memory(phandle_t node, const c */ phandle = OF_finddevice("/"); if (OF_getprop(phandle, "#address-cells", &address_cells, - sizeof(address_cells)) < sizeof(address_cells)) + sizeof(address_cells)) < (ssize_t)sizeof(address_cells)) address_cells = 1; if (OF_getprop(phandle, "#size-cells", &size_cells, - sizeof(size_cells)) < sizeof(size_cells)) + sizeof(size_cells)) < (ssize_t)sizeof(size_cells)) size_cells = 1; /* Modified: stable/9/sys/powerpc/powermac/macio.c ============================================================================== --- stable/9/sys/powerpc/powermac/macio.c Sun Feb 5 16:08:45 2012 (r231020) +++ stable/9/sys/powerpc/powermac/macio.c Sun Feb 5 16:14:23 2012 (r231021) @@ -293,7 +293,7 @@ macio_attach(device_t dev) * Locate the device node and it's base address */ if (OF_getprop(root, "assigned-addresses", - reg, sizeof(reg)) < sizeof(reg)) { + reg, sizeof(reg)) < (ssize_t)sizeof(reg)) { return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 16:16:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AD27106566C; Sun, 5 Feb 2012 16:16:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 6B08B8FC0A; Sun, 5 Feb 2012 16:16:24 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id F12675824F; Sun, 5 Feb 2012 09:49:12 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 5gpzRRBTdP2p; Sun, 5 Feb 2012 09:49:12 -0600 (CST) Received: from elpis.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 4844F58141; Sun, 5 Feb 2012 09:49:12 -0600 (CST) Message-ID: <4F2EA4F7.9010204@freebsd.org> Date: Sun, 05 Feb 2012 09:49:11 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.13) Gecko/20110202 Thunderbird/3.1.7 MIME-Version: 1.0 To: TAKAHASHI Yoshihiro References: <201201231544.q0NFirMh032859@svn.freebsd.org> <20120123160340.GI95413@hoeg.nl> <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> <20120128.193030.322386357550021613.nyan@FreeBSD.org> In-Reply-To: <20120128.193030.322386357550021613.nyan@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:16:24 -0000 On 01/28/12 04:30, TAKAHASHI Yoshihiro wrote: > In article<1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> > Nathan Whitehorn writes: > >> I think we didn't make PC98 release media for 9.0, but that's a good >> point. I'm out of commission right now due to an injury, so patches >> would be welcome. >>>> TERM=xterm >>> This code is also used on pc98, right? I think on pc98 we still need >>> to >>> use TERM=cons25w, to support Japanese character sets and keyboard >>> input. > How about the attached patch? > > --- > TAKAHASHI Yoshihiro The top half looks OK. The bottom half (the menu) is relevant only for serial consoles. I guess people could be viewing a remote serial console on a PC-98 graphics console, but then it shouldn't be conditionalized on PC98 machines. -Nathan From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 16:17:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72F8D1065690; Sun, 5 Feb 2012 16:17:15 +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 46B698FC0C; Sun, 5 Feb 2012 16:17: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 q15GHFEo090699; Sun, 5 Feb 2012 16:17:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GHF6Q090697; Sun, 5 Feb 2012 16:17:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051617.q15GHF6Q090697@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:17:15 +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: r231022 - stable/9/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:17:15 -0000 Author: nwhitehorn Date: Sun Feb 5 16:17:14 2012 New Revision: 231022 URL: http://svn.freebsd.org/changeset/base/231022 Log: Pick a constant high IRQ value for the PS3 IPI, which lets PS3 devices be usefully loaded and unloaded as modules. Submitted by: geoffrey dot levand at mail dot ru Modified: stable/9/sys/powerpc/ps3/ps3pic.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) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/powerpc/ps3/ps3pic.c ============================================================================== --- stable/9/sys/powerpc/ps3/ps3pic.c Sun Feb 5 16:14:23 2012 (r231021) +++ stable/9/sys/powerpc/ps3/ps3pic.c Sun Feb 5 16:17:14 2012 (r231022) @@ -62,6 +62,7 @@ struct ps3pic_softc { volatile uint64_t *mask_thread1; uint64_t sc_ipi_outlet[2]; + uint64_t sc_ipi_virq; int sc_vector[64]; }; @@ -131,20 +132,23 @@ ps3pic_attach(device_t dev) thread = 32 - fls(mfctrl()); lv1_configure_irq_state_bitmap(ppe, thread, vtophys(sc->bitmap_thread0)); + + sc->sc_ipi_virq = 63; + #ifdef SMP lv1_configure_irq_state_bitmap(ppe, !thread, vtophys(sc->bitmap_thread1)); /* Map both IPIs to the same VIRQ to avoid changes in intr_machdep */ lv1_construct_event_receive_port(&sc->sc_ipi_outlet[0]); - lv1_connect_irq_plug_ext(ppe, thread, sc->sc_ipi_outlet[0], + lv1_connect_irq_plug_ext(ppe, thread, sc->sc_ipi_virq, sc->sc_ipi_outlet[0], 0); lv1_construct_event_receive_port(&sc->sc_ipi_outlet[1]); - lv1_connect_irq_plug_ext(ppe, !thread, sc->sc_ipi_outlet[0], + lv1_connect_irq_plug_ext(ppe, !thread, sc->sc_ipi_virq, sc->sc_ipi_outlet[1], 0); #endif - powerpc_register_pic(dev, 0, sc->sc_ipi_outlet[0], 1, FALSE); + powerpc_register_pic(dev, 0, sc->sc_ipi_virq, 1, FALSE); return (0); } @@ -216,7 +220,7 @@ ps3pic_mask(device_t dev, u_int irq) sc = device_get_softc(dev); /* Do not mask IPIs! */ - if (irq == sc->sc_ipi_outlet[0]) + if (irq == sc->sc_ipi_virq) return; atomic_clear_64(&sc->mask_thread0[0], 1UL << (63 - irq)); From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 16:23:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37F55106564A; Sun, 5 Feb 2012 16:23:56 +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 264D98FC12; Sun, 5 Feb 2012 16:23: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 q15GNuOw090978; Sun, 5 Feb 2012 16:23:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GNtZP090976; Sun, 5 Feb 2012 16:23:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051623.q15GNtZP090976@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:23:55 +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: r231023 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:23:56 -0000 Author: nwhitehorn Date: Sun Feb 5 16:23:55 2012 New Revision: 231023 URL: http://svn.freebsd.org/changeset/base/231023 Log: MFC r230247: Revert r212360 now that PowerPC can handle large sparse arguments to pmap_remove() (changed in r228412). Modified: stable/9/sys/vm/vm_pageout.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) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/vm/vm_pageout.c ============================================================================== --- stable/9/sys/vm/vm_pageout.c Sun Feb 5 16:17:14 2012 (r231022) +++ stable/9/sys/vm/vm_pageout.c Sun Feb 5 16:23:55 2012 (r231023) @@ -714,11 +714,8 @@ vm_pageout_map_deactivate_pages(map, des * table pages. */ if (desired == 0 && nothingwired) { - tmpe = map->header.next; - while (tmpe != &map->header) { - pmap_remove(vm_map_pmap(map), tmpe->start, tmpe->end); - tmpe = tmpe->next; - } + pmap_remove(vm_map_pmap(map), vm_map_min(map), + vm_map_max(map)); } vm_map_unlock(map); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 16:41:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A5FD106566B; Sun, 5 Feb 2012 16:41:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED8F98FC19; Sun, 5 Feb 2012 16:41: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 q15Gf60Q091588; Sun, 5 Feb 2012 16:41:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Gf6vE091586; Sun, 5 Feb 2012 16:41:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202051641.q15Gf6vE091586@svn.freebsd.org> From: Alexander Motin Date: Sun, 5 Feb 2012 16:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231024 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:41:07 -0000 Author: mav Date: Sun Feb 5 16:41:06 2012 New Revision: 231024 URL: http://svn.freebsd.org/changeset/base/231024 Log: Remove extra semicolon. Submitted by: emaste Modified: head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Sun Feb 5 16:23:55 2012 (r231023) +++ head/sys/dev/sound/pci/hda/hdacc.c Sun Feb 5 16:41:06 2012 (r231024) @@ -612,7 +612,7 @@ hdacc_stream_intr(device_t dev, int dir, struct hdacc_softc *codec = device_get_softc(dev); device_t child; - if ((child = codec->streams[dir][stream]) != NULL); + if ((child = codec->streams[dir][stream]) != NULL) HDAC_STREAM_INTR(child, dir, stream); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 16:53:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69EFB106566B; Sun, 5 Feb 2012 16:53:03 +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 5746D8FC14; Sun, 5 Feb 2012 16:53:03 +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 q15Gr3rx092066; Sun, 5 Feb 2012 16:53:03 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Gr3AB092056; Sun, 5 Feb 2012 16:53:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202051653.q15Gr3AB092056@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 16:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231025 - in head: share/man/man4 sys/netinet sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:53:03 -0000 Author: glebius Date: Sun Feb 5 16:53:02 2012 New Revision: 231025 URL: http://svn.freebsd.org/changeset/base/231025 Log: Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT, that allow to control initial timeout, idle time, idle re-send interval and idle send count on a per-socket basis. Reviewed by: andre, bz, lstewart Modified: head/share/man/man4/tcp.4 head/sys/netinet/tcp.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/sys/param.h Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Sun Feb 5 16:41:06 2012 (r231024) +++ head/share/man/man4/tcp.4 Sun Feb 5 16:53:02 2012 (r231025) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 14, 2011 +.Dd February 5, 2012 .Dt TCP 4 .Os .Sh NAME @@ -146,6 +146,65 @@ connection. See .Xr mod_cc 4 for details. +.It Dv TCP_KEEPINIT +This write-only +.Xr setsockopt 2 +option accepts a per-socket timeout argument of +.Vt "u_int" +in seconds, for new, non-established +.Tn TCP +connections. +For the global default in milliseconds see +.Va keepinit +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPIDLE +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +for the amount of time, in seconds, that the connection must be idle +before keepalive probes (if enabled) are sent for the connection of this +socket. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default in milliseconds see +.Va keepidle +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPINTVL +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +to set the per-socket interval, in seconds, between keepalive probes sent +to a peer. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default in milliseconds see +.Va keepintvl +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPCNT +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +and allows a per-socket tuning of the number of probes sent, with no response, +before the connection will be dropped. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default see the +.Va keepcnt +in the +.Sx MIB Variables +section further down. .It Dv TCP_NODELAY Under most circumstances, .Tn TCP @@ -296,17 +355,21 @@ The Maximum Segment Lifetime, in millise Timeout, in milliseconds, for new, non-established .Tn TCP connections. +The default is 75000 msec. .It Va keepidle Amount of time, in milliseconds, that the connection must be idle before keepalive probes (if enabled) are sent. +The default is 7200000 msec (2 hours). .It Va keepintvl The interval, in milliseconds, between keepalive probes sent to remote machines, when no response is received on a .Va keepidle probe. -After -.Dv TCPTV_KEEPCNT -(default 8) probes are sent, with no response, the connection is dropped. +The default is 75000 msec. +.It Va keepcnt +Number of probes sent, with no response, before a connection +is dropped. +The default is 8 packets. .It Va always_keepalive Assume that .Dv SO_KEEPALIVE Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp.h Sun Feb 5 16:53:02 2012 (r231025) @@ -159,6 +159,10 @@ struct tcphdr { #define TCP_MD5SIG 0x10 /* use MD5 digests (RFC2385) */ #define TCP_INFO 0x20 /* retrieve tcp_info structure */ #define TCP_CONGESTION 0x40 /* get/set congestion control algorithm */ +#define TCP_KEEPINIT 0x80 /* N, time to establish connection */ +#define TCP_KEEPIDLE 0x100 /* L,N,X start keeplives after this period */ +#define TCP_KEEPINTVL 0x200 /* L,N interval between keepalives */ +#define TCP_KEEPCNT 0x400 /* L,N number of keepalives before close */ #define TCP_CA_NAME_MAX 16 /* max congestion control name length */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_input.c Sun Feb 5 16:53:02 2012 (r231025) @@ -1446,7 +1446,7 @@ tcp_do_segment(struct mbuf *m, struct tc */ tp->t_rcvtime = ticks; if (TCPS_HAVEESTABLISHED(tp->t_state)) - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); /* * Unscale the window into a 32-bit value. @@ -1889,7 +1889,8 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tp->t_state = TCPS_ESTABLISHED; cc_conn_init(tp); - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPIDLE(tp)); } } else { /* @@ -2293,7 +2294,7 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tp->t_state = TCPS_ESTABLISHED; cc_conn_init(tp); - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); } /* * If segment contains data or ACK, will call tcp_reass() @@ -2630,12 +2631,11 @@ process_ACK: * compressed state. */ if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { - int timeout; - soisdisconnected(so); - timeout = (tcp_fast_finwait2_recycle) ? - tcp_finwait2_timeout : tcp_maxidle; - tcp_timer_activate(tp, TT_2MSL, timeout); + tcp_timer_activate(tp, TT_2MSL, + (tcp_fast_finwait2_recycle ? + tcp_finwait2_timeout : + TP_MAXIDLE(tp))); } tp->t_state = TCPS_FIN_WAIT_2; } Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_syncache.c Sun Feb 5 16:53:02 2012 (r231025) @@ -845,7 +845,15 @@ syncache_socket(struct syncache *sc, str */ if (sc->sc_rxmits > 1) tp->snd_cwnd = tp->t_maxseg; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + + /* + * Copy and activate timers. + */ + tp->t_keepinit = sototcpcb(lso)->t_keepinit; + tp->t_keepidle = sototcpcb(lso)->t_keepidle; + tp->t_keepintvl = sototcpcb(lso)->t_keepintvl; + tp->t_keepcnt = sototcpcb(lso)->t_keepcnt; + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); INP_WUNLOCK(inp); Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_timer.c Sun Feb 5 16:53:02 2012 (r231025) @@ -111,12 +111,12 @@ int tcp_finwait2_timeout; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, finwait2_timeout, CTLTYPE_INT|CTLFLAG_RW, &tcp_finwait2_timeout, 0, sysctl_msec_to_ticks, "I", "FIN-WAIT2 timeout"); +int tcp_keepcnt = TCPTV_KEEPCNT; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, keepcnt, CTLFLAG_RW, &tcp_keepcnt, 0, + "Number of keepalive probes to send"); -static int tcp_keepcnt = TCPTV_KEEPCNT; /* max idle probes */ int tcp_maxpersistidle; - /* max idle time in persist */ -int tcp_maxidle; static int per_cpu_timers = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW, @@ -138,7 +138,6 @@ tcp_slowtimo(void) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - tcp_maxidle = tcp_keepcnt * tcp_keepintvl; INP_INFO_WLOCK(&V_tcbinfo); (void) tcp_tw_2msl_scan(0); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -255,9 +254,9 @@ tcp_timer_2msl(void *xtp) tp = tcp_close(tp); } else { if (tp->t_state != TCPS_TIME_WAIT && - ticks - tp->t_rcvtime <= tcp_maxidle) - callout_reset_on(&tp->t_timers->tt_2msl, tcp_keepintvl, - tcp_timer_2msl, tp, INP_CPU(inp)); + ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) + callout_reset_on(&tp->t_timers->tt_2msl, + TP_KEEPINTVL(tp), tcp_timer_2msl, tp, INP_CPU(inp)); else tp = tcp_close(tp); } @@ -318,7 +317,7 @@ tcp_timer_keep(void *xtp) goto dropit; if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { - if (ticks - tp->t_rcvtime >= tcp_keepidle + tcp_maxidle) + if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; /* * Send a packet designed to force a response @@ -340,9 +339,11 @@ tcp_timer_keep(void *xtp) tp->rcv_nxt, tp->snd_una - 1, 0); free(t_template, M_TEMP); } - callout_reset_on(&tp->t_timers->tt_keep, tcp_keepintvl, tcp_timer_keep, tp, INP_CPU(inp)); + callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), + tcp_timer_keep, tp, INP_CPU(inp)); } else - callout_reset_on(&tp->t_timers->tt_keep, tcp_keepidle, tcp_timer_keep, tp, INP_CPU(inp)); + callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), + tcp_timer_keep, tp, INP_CPU(inp)); #ifdef TCPDEBUG if (inp->inp_socket->so_options & SO_DEBUG) Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_timer.h Sun Feb 5 16:53:02 2012 (r231025) @@ -153,10 +153,16 @@ struct tcp_timer { #define TT_KEEP 0x08 #define TT_2MSL 0x10 +#define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit) +#define TP_KEEPIDLE(tp) ((tp)->t_keepidle ? (tp)->t_keepidle : tcp_keepidle) +#define TP_KEEPINTVL(tp) ((tp)->t_keepintvl ? (tp)->t_keepintvl : tcp_keepintvl) +#define TP_KEEPCNT(tp) ((tp)->t_keepcnt ? (tp)->t_keepcnt : tcp_keepcnt) +#define TP_MAXIDLE(tp) (TP_KEEPCNT(tp) * TP_KEEPINTVL(tp)) + extern int tcp_keepinit; /* time to establish connection */ extern int tcp_keepidle; /* time before keepalive probes begin */ extern int tcp_keepintvl; /* time between keepalive probes */ -extern int tcp_maxidle; /* time to drop after starting probes */ +extern int tcp_keepcnt; /* number of keepalives */ extern int tcp_delacktime; /* time before sending a delayed ACK */ extern int tcp_maxpersistidle; extern int tcp_rexmit_min; Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_usrreq.c Sun Feb 5 16:53:02 2012 (r231025) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1118,7 +1119,7 @@ tcp_connect(struct tcpcb *tp, struct soc soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); tp->iss = tcp_new_isn(tp); tcp_sendseqinit(tp); @@ -1191,7 +1192,7 @@ tcp6_connect(struct tcpcb *tp, struct so soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); tp->iss = tcp_new_isn(tp); tcp_sendseqinit(tp); @@ -1272,6 +1273,7 @@ int tcp_ctloutput(struct socket *so, struct sockopt *sopt) { int error, opt, optval; + u_int ui; struct inpcb *inp; struct tcpcb *tp; struct tcp_info ti; @@ -1439,6 +1441,59 @@ tcp_ctloutput(struct socket *so, struct INP_WUNLOCK(inp); break; + case TCP_KEEPIDLE: + case TCP_KEEPINTVL: + case TCP_KEEPCNT: + case TCP_KEEPINIT: + INP_WUNLOCK(inp); + error = sooptcopyin(sopt, &ui, sizeof(ui), sizeof(ui)); + if (error) + return (error); + + if (ui > (UINT_MAX / hz)) { + error = EINVAL; + break; + } + ui *= hz; + + INP_WLOCK_RECHECK(inp); + switch (sopt->sopt_name) { + case TCP_KEEPIDLE: + tp->t_keepidle = ui; + /* + * XXX: better check current remaining + * timeout and "merge" it with new value. + */ + if ((tp->t_state > TCPS_LISTEN) && + (tp->t_state <= TCPS_CLOSING)) + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPIDLE(tp)); + break; + case TCP_KEEPINTVL: + tp->t_keepintvl = ui; + if ((tp->t_state == TCPS_FIN_WAIT_2) && + (TP_MAXIDLE(tp) > 0)) + tcp_timer_activate(tp, TT_2MSL, + TP_MAXIDLE(tp)); + break; + case TCP_KEEPCNT: + tp->t_keepcnt = ui; + if ((tp->t_state == TCPS_FIN_WAIT_2) && + (TP_MAXIDLE(tp) > 0)) + tcp_timer_activate(tp, TT_2MSL, + TP_MAXIDLE(tp)); + break; + case TCP_KEEPINIT: + tp->t_keepinit = ui; + if (tp->t_state == TCPS_SYN_RECEIVED || + tp->t_state == TCPS_SYN_SENT) + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPINIT(tp)); + break; + } + INP_WUNLOCK(inp); + break; + default: INP_WUNLOCK(inp); error = ENOPROTOOPT; @@ -1636,7 +1691,7 @@ tcp_usrclosed(struct tcpcb *tp) int timeout; timeout = (tcp_fast_finwait2_recycle) ? - tcp_finwait2_timeout : tcp_maxidle; + tcp_finwait2_timeout : TP_MAXIDLE(tp); tcp_timer_activate(tp, TT_2MSL, timeout); } } Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_var.h Sun Feb 5 16:53:02 2012 (r231025) @@ -203,7 +203,12 @@ struct tcpcb { struct cc_var *ccv; /* congestion control specific vars */ struct osd *osd; /* storage for Khelp module data */ - uint32_t t_ispare[12]; /* 4 keep timers, 5 UTO, 3 TBD */ + u_int t_keepinit; /* time to establish connection */ + u_int t_keepidle; /* time before keepalive probes begin */ + u_int t_keepintvl; /* interval between keepalives */ + u_int t_keepcnt; /* number of keepalives before close */ + + uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ void *t_pspare2[4]; /* 4 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/sys/param.h Sun Feb 5 16:53:02 2012 (r231025) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000006 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000007 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 16:54:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19E76106566C; Sun, 5 Feb 2012 16:54:27 +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 08B508FC1C; Sun, 5 Feb 2012 16:54: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 q15GsQ2m092139; Sun, 5 Feb 2012 16:54:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GsQcc092137; Sun, 5 Feb 2012 16:54:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051654.q15GsQcc092137@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:54:27 -0000 Author: nwhitehorn Date: Sun Feb 5 16:54:26 2012 New Revision: 231026 URL: http://svn.freebsd.org/changeset/base/231026 Log: Make sure to remap adjusted resources. Modified: head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 16:53:02 2012 (r231025) +++ head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 16:54:26 2012 (r231026) @@ -431,6 +431,7 @@ ofw_pci_adjust_resource(device_t bus, de { struct rman *rm = NULL; struct ofw_pci_softc *sc = device_get_softc(bus); + int error; switch (type) { case SYS_RES_MEMORY: @@ -445,7 +446,22 @@ ofw_pci_adjust_resource(device_t bus, de if (!rman_is_region_manager(res, rm)) return (EINVAL); - return (rman_adjust_resource(res, start, end)); + + error = rman_adjust_resource(res, start, end); + if (error) + return (error); + + if (rman_get_flags(res) & RF_ACTIVE) { + /* Remap memory resources */ + error = ofw_pci_deactivate_resource(bus, child, type, + rman_get_rid(res), res); + if (error) + return (error); + error = ofw_pci_activate_resource(bus, child, type, + rman_get_rid(res), res); + } + + return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 18:16:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B540106566C; Sun, 5 Feb 2012 18:16:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 399C08FC08; Sun, 5 Feb 2012 18:16:39 +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 q15IGd2C094704; Sun, 5 Feb 2012 18:16:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15IGdUY094702; Sun, 5 Feb 2012 18:16:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051816.q15IGdUY094702@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 18:16:39 +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: r231028 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 18:16:39 -0000 Author: tuexen Date: Sun Feb 5 18:16:38 2012 New Revision: 231028 URL: http://svn.freebsd.org/changeset/base/231028 Log: MFC r228102: Remove debug code. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Feb 5 17:37:26 2012 (r231027) +++ stable/9/sys/netinet/sctp_pcb.c Sun Feb 5 18:16:38 2012 (r231028) @@ -6918,11 +6918,6 @@ skip_vtag_check: return (1); } - -static sctp_assoc_t reneged_asoc_ids[256]; -static uint8_t reneged_at = 0; - - static void sctp_drain_mbufs(struct sctp_inpcb *inp, struct sctp_tcb *stcb) { @@ -7027,8 +7022,6 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, /* sa_ignore NO_NULL_CHK */ sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_DRAIN, SCTP_SO_NOT_LOCKED); - reneged_asoc_ids[reneged_at] = sctp_get_associd(stcb); - reneged_at++; } /* * Another issue, in un-setting the TSN's in the mapping array we From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 18:21:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99081106564A; Sun, 5 Feb 2012 18:21:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 874798FC14; Sun, 5 Feb 2012 18:21:04 +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 q15IL4lS094889; Sun, 5 Feb 2012 18:21:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15IL4TS094886; Sun, 5 Feb 2012 18:21:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051821.q15IL4TS094886@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 18:21:04 +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: r231029 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 18:21:04 -0000 Author: tuexen Date: Sun Feb 5 18:21:03 2012 New Revision: 231029 URL: http://svn.freebsd.org/changeset/base/231029 Log: MFC r228391: Fix a bug reported by Irene Ruengeler which resulted in not sending out HEARTBEATs when requested by the user. The HEARTBEATs were only queued, but not actually sent out. Modified: stable/9/sys/netinet/sctp_constants.h stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Feb 5 18:16:38 2012 (r231028) +++ stable/9/sys/netinet/sctp_constants.h Sun Feb 5 18:21:03 2012 (r231029) @@ -391,6 +391,8 @@ __FBSDID("$FreeBSD$"); #define SCTP_OUTPUT_FROM_COOKIE_ACK 14 #define SCTP_OUTPUT_FROM_DRAIN 15 #define SCTP_OUTPUT_FROM_CLOSING 16 +#define SCTP_OUTPUT_FROM_SOCKOPT 17 + /* SCTP chunk types are moved sctp.h for application (NAT, FW) use */ /* align to 32-bit sizes */ Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Feb 5 18:16:38 2012 (r231028) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Feb 5 18:21:03 2012 (r231029) @@ -4642,6 +4642,7 @@ sctp_setopt(struct socket *so, int optna if (paddrp->spp_flags & SPP_HB_DEMAND) { /* on demand HB */ sctp_send_hb(stcb, net, SCTP_SO_LOCKED); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); } if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) { From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 18:39:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0F61106566B; Sun, 5 Feb 2012 18:39:11 +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 CEB228FC0C; Sun, 5 Feb 2012 18:39: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 q15IdBcK095554; Sun, 5 Feb 2012 18:39:11 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15IdBLH095551; Sun, 5 Feb 2012 18:39:11 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202051839.q15IdBLH095551@svn.freebsd.org> From: Sean Bruno Date: Sun, 5 Feb 2012 18:39: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: r231030 - in stable/9: share/man/man4 sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 18:39:12 -0000 Author: sbruno Date: Sun Feb 5 18:39:11 2012 New Revision: 231030 URL: http://svn.freebsd.org/changeset/base/231030 Log: MFC r230313, r230316, r230323, r230588 Support new raid controllers Modified: stable/9/share/man/man4/ciss.4 stable/9/sys/dev/ciss/ciss.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/share/man/man4/ciss.4 ============================================================================== --- stable/9/share/man/man4/ciss.4 Sun Feb 5 18:21:03 2012 (r231029) +++ stable/9/share/man/man4/ciss.4 Sun Feb 5 18:39:11 2012 (r231030) @@ -2,7 +2,7 @@ .\" Written by Tom Rhodes .\" This file is in the public domain. .\" -.Dd November 3, 2005 +.Dd January 26, 2012 .Dt CISS 4 .Os .Sh NAME @@ -121,6 +121,10 @@ HP Smart Array E200i .It HP Smart Array P212 .It +HP Smart Array P220i +.It +HP Smart Array P222 +.It HP Smart Array P400 .It HP Smart Array P400i @@ -131,8 +135,16 @@ HP Smart Array P410i .It HP Smart Array P411 .It +HP Smart Array P420 +.It +HP Smart Array P420i +.It +HP Smart Array P421 +.It HP Smart Array P600 .It +HP Smart Array P721m +.It HP Smart Array P800 .It HP Smart Array P812 Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Sun Feb 5 18:21:03 2012 (r231029) +++ stable/9/sys/dev/ciss/ciss.c Sun Feb 5 18:39:11 2012 (r231030) @@ -328,6 +328,13 @@ static struct { 0x103C, 0x3249, CISS_BOARD_SA5, "HP Smart Array P812" }, { 0x103C, 0x324A, CISS_BOARD_SA5, "HP Smart Array P712m" }, { 0x103C, 0x324B, CISS_BOARD_SA5, "HP Smart Array" }, + { 0x103C, 0x3350, CISS_BOARD_SA5, "HP Smart Array P222" }, + { 0x103C, 0x3351, CISS_BOARD_SA5, "HP Smart Array P420" }, + { 0x103C, 0x3352, CISS_BOARD_SA5, "HP Smart Array P421" }, + { 0x103C, 0x3353, CISS_BOARD_SA5, "HP Smart Array P822" }, + { 0x103C, 0x3354, CISS_BOARD_SA5, "HP Smart Array P420i" }, + { 0x103C, 0x3355, CISS_BOARD_SA5, "HP Smart Array P220i" }, + { 0x103C, 0x3356, CISS_BOARD_SA5, "HP Smart Array P721m" }, { 0, 0, 0, NULL } }; @@ -4534,7 +4541,8 @@ ciss_ioctl(struct cdev *dev, u_long cmd, pis->bus = pci_get_bus(sc->ciss_dev); pis->dev_fn = pci_get_slot(sc->ciss_dev); - pis->board_id = pci_get_devid(sc->ciss_dev); + pis->board_id = (pci_get_subvendor(sc->ciss_dev) << 16) | + pci_get_subdevice(sc->ciss_dev); break; } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:10:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 610671065677; Sun, 5 Feb 2012 19:10:49 +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 3061F8FC0A; Sun, 5 Feb 2012 19:10:49 +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 q15JAnox096630; Sun, 5 Feb 2012 19:10:49 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JAm7E096627; Sun, 5 Feb 2012 19:10:48 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202051910.q15JAm7E096627@svn.freebsd.org> From: Sean Bruno Date: Sun, 5 Feb 2012 19:10:48 +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: r231032 - in stable/8: share/man/man4 sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:10:49 -0000 Author: sbruno Date: Sun Feb 5 19:10:48 2012 New Revision: 231032 URL: http://svn.freebsd.org/changeset/base/231032 Log: MFC r230313, r230316, r230323, r230588 Support new raid controllers Modified: stable/8/share/man/man4/ciss.4 stable/8/sys/dev/ciss/ciss.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/share/man/man4/ciss.4 ============================================================================== --- stable/8/share/man/man4/ciss.4 Sun Feb 5 18:55:20 2012 (r231031) +++ stable/8/share/man/man4/ciss.4 Sun Feb 5 19:10:48 2012 (r231032) @@ -2,7 +2,7 @@ .\" Written by Tom Rhodes .\" This file is in the public domain. .\" -.Dd November 3, 2005 +.Dd January 26, 2012 .Dt CISS 4 .Os .Sh NAME @@ -121,6 +121,10 @@ HP Smart Array E200i .It HP Smart Array P212 .It +HP Smart Array P220i +.It +HP Smart Array P222 +.It HP Smart Array P400 .It HP Smart Array P400i @@ -131,8 +135,16 @@ HP Smart Array P410i .It HP Smart Array P411 .It +HP Smart Array P420 +.It +HP Smart Array P420i +.It +HP Smart Array P421 +.It HP Smart Array P600 .It +HP Smart Array P721m +.It HP Smart Array P800 .It HP Smart Array P812 Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Sun Feb 5 18:55:20 2012 (r231031) +++ stable/8/sys/dev/ciss/ciss.c Sun Feb 5 19:10:48 2012 (r231032) @@ -328,6 +328,13 @@ static struct { 0x103C, 0x3249, CISS_BOARD_SA5, "HP Smart Array P812" }, { 0x103C, 0x324A, CISS_BOARD_SA5, "HP Smart Array P712m" }, { 0x103C, 0x324B, CISS_BOARD_SA5, "HP Smart Array" }, + { 0x103C, 0x3350, CISS_BOARD_SA5, "HP Smart Array P222" }, + { 0x103C, 0x3351, CISS_BOARD_SA5, "HP Smart Array P420" }, + { 0x103C, 0x3352, CISS_BOARD_SA5, "HP Smart Array P421" }, + { 0x103C, 0x3353, CISS_BOARD_SA5, "HP Smart Array P822" }, + { 0x103C, 0x3354, CISS_BOARD_SA5, "HP Smart Array P420i" }, + { 0x103C, 0x3355, CISS_BOARD_SA5, "HP Smart Array P220i" }, + { 0x103C, 0x3356, CISS_BOARD_SA5, "HP Smart Array P721m" }, { 0, 0, 0, NULL } }; @@ -4530,7 +4537,8 @@ ciss_ioctl(struct cdev *dev, u_long cmd, pis->bus = pci_get_bus(sc->ciss_dev); pis->dev_fn = pci_get_slot(sc->ciss_dev); - pis->board_id = pci_get_devid(sc->ciss_dev); + pis->board_id = (pci_get_subvendor(sc->ciss_dev) << 16) | + pci_get_subdevice(sc->ciss_dev); break; } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:22:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAA50106566C; Sun, 5 Feb 2012 19:22:20 +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 A991E8FC18; Sun, 5 Feb 2012 19:22: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 q15JMKXv097068; Sun, 5 Feb 2012 19:22:20 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JMKF8097065; Sun, 5 Feb 2012 19:22:20 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202051922.q15JMKF8097065@svn.freebsd.org> From: Sean Bruno Date: Sun, 5 Feb 2012 19:22: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: r231033 - in stable/7: share/man/man4 sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:22:21 -0000 Author: sbruno Date: Sun Feb 5 19:22:20 2012 New Revision: 231033 URL: http://svn.freebsd.org/changeset/base/231033 Log: MFC r230313, r230316, r230323, r230588 Support new raid controllers Modified: stable/7/share/man/man4/ciss.4 stable/7/sys/dev/ciss/ciss.c Directory Properties: stable/7/share/man/man4/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/share/man/man4/ciss.4 ============================================================================== --- stable/7/share/man/man4/ciss.4 Sun Feb 5 19:10:48 2012 (r231032) +++ stable/7/share/man/man4/ciss.4 Sun Feb 5 19:22:20 2012 (r231033) @@ -2,7 +2,7 @@ .\" Written by Tom Rhodes .\" This file is in the public domain. .\" -.Dd November 3, 2005 +.Dd January 26, 2012 .Dt CISS 4 .Os .Sh NAME @@ -121,6 +121,10 @@ HP Smart Array E200i .It HP Smart Array P212 .It +HP Smart Array P220i +.It +HP Smart Array P222 +.It HP Smart Array P400 .It HP Smart Array P400i @@ -131,8 +135,16 @@ HP Smart Array P410i .It HP Smart Array P411 .It +HP Smart Array P420 +.It +HP Smart Array P420i +.It +HP Smart Array P421 +.It HP Smart Array P600 .It +HP Smart Array P721m +.It HP Smart Array P800 .It HP Smart Array P812 Modified: stable/7/sys/dev/ciss/ciss.c ============================================================================== --- stable/7/sys/dev/ciss/ciss.c Sun Feb 5 19:10:48 2012 (r231032) +++ stable/7/sys/dev/ciss/ciss.c Sun Feb 5 19:22:20 2012 (r231033) @@ -306,6 +306,13 @@ static struct { 0x103C, 0x3249, CISS_BOARD_SA5, "HP Smart Array P812" }, { 0x103C, 0x324A, CISS_BOARD_SA5, "HP Smart Array P712m" }, { 0x103C, 0x324B, CISS_BOARD_SA5, "HP Smart Array" }, + { 0x103C, 0x3350, CISS_BOARD_SA5, "HP Smart Array P222" }, + { 0x103C, 0x3351, CISS_BOARD_SA5, "HP Smart Array P420" }, + { 0x103C, 0x3352, CISS_BOARD_SA5, "HP Smart Array P421" }, + { 0x103C, 0x3353, CISS_BOARD_SA5, "HP Smart Array P822" }, + { 0x103C, 0x3354, CISS_BOARD_SA5, "HP Smart Array P420i" }, + { 0x103C, 0x3355, CISS_BOARD_SA5, "HP Smart Array P220i" }, + { 0x103C, 0x3356, CISS_BOARD_SA5, "HP Smart Array P721m" }, { 0, 0, 0, NULL } }; @@ -4230,7 +4237,8 @@ ciss_ioctl(struct cdev *dev, u_long cmd, pis->bus = pci_get_bus(sc->ciss_dev); pis->dev_fn = pci_get_slot(sc->ciss_dev); - pis->board_id = pci_get_devid(sc->ciss_dev); + pis->board_id = (pci_get_subvendor(sc->ciss_dev) << 16) | + pci_get_subdevice(sc->ciss_dev); break; } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:29:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B995D106566B; Sun, 5 Feb 2012 19:29:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3C538FC19; Sun, 5 Feb 2012 19:29: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 q15JTF4F097330; Sun, 5 Feb 2012 19:29:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JTFLS097328; Sun, 5 Feb 2012 19:29:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051929.q15JTFLS097328@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:29:15 +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: r231034 - stable/9/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:29:15 -0000 Author: tuexen Date: Sun Feb 5 19:29:14 2012 New Revision: 231034 URL: http://svn.freebsd.org/changeset/base/231034 Log: MFC 228531: Fix a bug where sctp_sendmdg() uses uninitialized memory. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Sun Feb 5 19:22:20 2012 (r231033) +++ stable/9/lib/libc/net/sctp_sys_calls.c Sun Feb 5 19:29:14 2012 (r231034) @@ -560,6 +560,7 @@ sctp_sendmsg(int s, #ifdef SYS_sctp_generic_sendmsg struct sctp_sndrcvinfo sinfo; + memset(&sinfo, 0, sizeof(struct sctp_sndrcvinfo)); sinfo.sinfo_ppid = ppid; sinfo.sinfo_flags = flags; sinfo.sinfo_stream = stream_no; From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:30:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 232CB106566C; Sun, 5 Feb 2012 19:30:19 +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 0D94D8FC15; Sun, 5 Feb 2012 19:30:19 +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 q15JUIrh097405; Sun, 5 Feb 2012 19:30:18 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JUIZY097403; Sun, 5 Feb 2012 19:30:18 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202051930.q15JUIZY097403@svn.freebsd.org> From: Sean Bruno Date: Sun, 5 Feb 2012 19:30: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: r231035 - stable/9/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:30:19 -0000 Author: sbruno Date: Sun Feb 5 19:30:18 2012 New Revision: 231035 URL: http://svn.freebsd.org/changeset/base/231035 Log: MFC r230325 Wrap changes from svn r212126 inside LOADER_NFS_SUPPORT Modified: stable/9/sys/boot/i386/libi386/pxe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/libi386/pxe.c ============================================================================== --- stable/9/sys/boot/i386/libi386/pxe.c Sun Feb 5 19:29:14 2012 (r231034) +++ stable/9/sys/boot/i386/libi386/pxe.c Sun Feb 5 19:30:18 2012 (r231035) @@ -405,6 +405,7 @@ pxe_perror(int err) return; } +#ifdef LOADER_NFS_SUPPORT /* * Reach inside the libstand NFS code and dig out an NFS handle * for the root filesystem. @@ -515,6 +516,7 @@ pxe_setnfshandle(char *rootpath) setenv("boot.nfsroot.nfshandlelen", buf, 1); } #endif /* OLD_NFSV2 */ +#endif /* LOADER_NFS_SUPPORT */ void pxenv_call(int func) From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:33:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 397861065673; Sun, 5 Feb 2012 19:33:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFE68FC13; Sun, 5 Feb 2012 19:33:54 +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 q15JXr08097588; Sun, 5 Feb 2012 19:33:53 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JXrrS097586; Sun, 5 Feb 2012 19:33:53 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051933.q15JXrrS097586@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:33: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: r231036 - stable/9/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:33:54 -0000 Author: tuexen Date: Sun Feb 5 19:33:53 2012 New Revision: 231036 URL: http://svn.freebsd.org/changeset/base/231036 Log: MFC r228630: Address warnings found by clang. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Sun Feb 5 19:30:18 2012 (r231035) +++ stable/9/lib/libc/net/sctp_sys_calls.c Sun Feb 5 19:33:53 2012 (r231036) @@ -245,7 +245,8 @@ sctp_bindx(int sd, struct sockaddr *addr struct sockaddr *sa; struct sockaddr_in *sin; struct sockaddr_in6 *sin6; - int i, sz, argsz; + int i; + size_t argsz; uint16_t sport = 0; /* validate the flags */ @@ -269,7 +270,6 @@ sctp_bindx(int sd, struct sockaddr *addr /* First pre-screen the addresses */ sa = addrs; for (i = 0; i < addrcnt; i++) { - sz = sa->sa_len; if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) goto out_error; @@ -307,7 +307,7 @@ sctp_bindx(int sd, struct sockaddr *addr goto out_error; } - sa = (struct sockaddr *)((caddr_t)sa + sz); + sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } sa = addrs; /* @@ -319,7 +319,6 @@ sctp_bindx(int sd, struct sockaddr *addr sin->sin_port = sport; } for (i = 0; i < addrcnt; i++) { - sz = sa->sa_len; if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) goto out_error; @@ -335,13 +334,13 @@ sctp_bindx(int sd, struct sockaddr *addr } memset(gaddrs, 0, argsz); gaddrs->sget_assoc_id = 0; - memcpy(gaddrs->addr, sa, sz); + memcpy(gaddrs->addr, sa, sa->sa_len); if (setsockopt(sd, IPPROTO_SCTP, flags, gaddrs, (socklen_t) argsz) != 0) { free(gaddrs); return (-1); } - sa = (struct sockaddr *)((caddr_t)sa + sz); + sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } free(gaddrs); return (0); @@ -427,10 +426,9 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, { struct sctp_getaddresses *addrs; struct sockaddr *sa; - struct sockaddr *re; sctp_assoc_t asoc; caddr_t lim; - socklen_t siz; + socklen_t opt_len; int cnt; if (raddrs == NULL) { @@ -438,30 +436,28 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, return (-1); } asoc = id; - siz = sizeof(sctp_assoc_t); + opt_len = (socklen_t) sizeof(sctp_assoc_t); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_REMOTE_ADDR_SIZE, - &asoc, &siz) != 0) { + &asoc, &opt_len) != 0) { return (-1); } /* size required is returned in 'asoc' */ - siz = (size_t)asoc; - siz += sizeof(struct sctp_getaddresses); - addrs = calloc(1, siz); + opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); + addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { return (-1); } addrs->sget_assoc_id = id; /* Now lets get the array of addresses */ if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_PEER_ADDRESSES, - addrs, &siz) != 0) { + addrs, &opt_len) != 0) { free(addrs); return (-1); } - re = (struct sockaddr *)&addrs->addr[0]; - *raddrs = re; + *raddrs = (struct sockaddr *)&addrs->addr[0]; cnt = 0; sa = (struct sockaddr *)&addrs->addr[0]; - lim = (caddr_t)addrs + siz; + lim = (caddr_t)addrs + opt_len; while (((caddr_t)sa < lim) && (sa->sa_len > 0)) { sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); cnt++; @@ -484,11 +480,10 @@ int sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) { struct sctp_getaddresses *addrs; - struct sockaddr *re; caddr_t lim; struct sockaddr *sa; - int size_of_addresses; - socklen_t siz; + size_t size_of_addresses; + socklen_t opt_len; int cnt; if (raddrs == NULL) { @@ -496,9 +491,9 @@ sctp_getladdrs(int sd, sctp_assoc_t id, return (-1); } size_of_addresses = 0; - siz = sizeof(int); + opt_len = (socklen_t) sizeof(int); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDR_SIZE, - &size_of_addresses, &siz) != 0) { + &size_of_addresses, &opt_len) != 0) { errno = ENOMEM; return (-1); } @@ -506,9 +501,10 @@ sctp_getladdrs(int sd, sctp_assoc_t id, errno = ENOTCONN; return (-1); } - siz = size_of_addresses + sizeof(struct sockaddr_storage); - siz += sizeof(struct sctp_getaddresses); - addrs = calloc(1, siz); + opt_len = (socklen_t) (size_of_addresses + + sizeof(struct sockaddr_storage) + + sizeof(struct sctp_getaddresses)); + addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; return (-1); @@ -516,16 +512,15 @@ sctp_getladdrs(int sd, sctp_assoc_t id, addrs->sget_assoc_id = id; /* Now lets get the array of addresses */ if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs, - &siz) != 0) { + &opt_len) != 0) { free(addrs); errno = ENOMEM; return (-1); } - re = (struct sockaddr *)&addrs->addr[0]; - *raddrs = re; + *raddrs = (struct sockaddr *)&addrs->addr[0]; cnt = 0; sa = (struct sockaddr *)&addrs->addr[0]; - lim = (caddr_t)addrs + siz; + lim = (caddr_t)addrs + opt_len; while (((caddr_t)sa < lim) && (sa->sa_len > 0)) { sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); cnt++; @@ -732,7 +727,8 @@ sctp_sendx(int sd, const void *msg, size ssize_t ret; int i, cnt, *aa, saved_errno; char *buf; - int add_len, len, no_end_cx = 0; + int no_end_cx = 0; + size_t len, add_len; struct sockaddr *at; if (addrs == NULL) { @@ -782,7 +778,7 @@ sctp_sendx(int sd, const void *msg, size aa = (int *)buf; *aa = cnt; aa++; - memcpy((caddr_t)aa, addrs, (len - sizeof(int))); + memcpy((caddr_t)aa, addrs, (size_t)(len - sizeof(int))); ret = setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X_DELAYED, (void *)buf, (socklen_t) len); @@ -859,7 +855,6 @@ sctp_recvmsg(int s, #else struct sctp_sndrcvinfo *s_info; ssize_t sz; - int sinfo_found = 0; struct msghdr msg; struct iovec iov; char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; @@ -888,7 +883,6 @@ sctp_recvmsg(int s, return (sz); } s_info = NULL; - len = sz; if (sinfo) { sinfo->sinfo_assoc_id = 0; } @@ -909,7 +903,6 @@ sctp_recvmsg(int s, /* Copy it to the user */ if (sinfo) *sinfo = *s_info; - sinfo_found = 1; break; } else if (cmsg->cmsg_type == SCTP_EXTRCV) { /* @@ -922,7 +915,6 @@ sctp_recvmsg(int s, if (sinfo) { memcpy(sinfo, s_info, sizeof(struct sctp_extrcvinfo)); } - sinfo_found = 1; break; } @@ -1055,7 +1047,7 @@ sctp_sendv(int sd, cmsgbuf = malloc(CMSG_SPACE(sizeof(struct sctp_sndinfo)) + CMSG_SPACE(sizeof(struct sctp_prinfo)) + CMSG_SPACE(sizeof(struct sctp_authinfo)) + - addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); + (size_t)addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); if (cmsgbuf == NULL) { errno = ENOBUFS; return (-1); From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:38:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9AD0106564A; Sun, 5 Feb 2012 19:38:22 +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 B3E478FC14; Sun, 5 Feb 2012 19: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 q15JcMFF097760; Sun, 5 Feb 2012 19:38:22 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JcMsW097758; Sun, 5 Feb 2012 19:38:22 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202051938.q15JcMsW097758@svn.freebsd.org> From: Sean Bruno Date: Sun, 5 Feb 2012 19:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231037 - stable/8/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:38:22 -0000 Author: sbruno Date: Sun Feb 5 19:38:22 2012 New Revision: 231037 URL: http://svn.freebsd.org/changeset/base/231037 Log: MFC r230325 Wrap changes from svn r212126 inside LOADER_NFS_SUPPORT Modified: stable/8/sys/boot/i386/libi386/pxe.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/boot/i386/libi386/pxe.c ============================================================================== --- stable/8/sys/boot/i386/libi386/pxe.c Sun Feb 5 19:33:53 2012 (r231036) +++ stable/8/sys/boot/i386/libi386/pxe.c Sun Feb 5 19:38:22 2012 (r231037) @@ -405,6 +405,7 @@ pxe_perror(int err) return; } +#ifdef LOADER_NFS_SUPPORT /* * Reach inside the libstand NFS code and dig out an NFS handle * for the root filesystem. @@ -515,6 +516,7 @@ pxe_setnfshandle(char *rootpath) setenv("boot.nfsroot.nfshandlelen", buf, 1); } #endif /* OLD_NFSV2 */ +#endif /* LOADER_NFS_SUPPORT */ void pxenv_call(int func) From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:49:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 838EC106564A; Sun, 5 Feb 2012 19:49:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31D8D8FC13; Sun, 5 Feb 2012 19:49: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 q15JnZIE098214; Sun, 5 Feb 2012 19:49:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15JnYbT098196; Sun, 5 Feb 2012 19:49:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051949.q15JnYbT098196@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:49:34 +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: r231038 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:49:35 -0000 Author: tuexen Date: Sun Feb 5 19:49:34 2012 New Revision: 231038 URL: http://svn.freebsd.org/changeset/base/231038 Log: MFC 228653: Fix unused parameter warnings. While there, fix some whitespace issues. Modified: stable/9/sys/netinet/sctp.h stable/9/sys/netinet/sctp_asconf.c stable/9/sys/netinet/sctp_asconf.h stable/9/sys/netinet/sctp_auth.c stable/9/sys/netinet/sctp_auth.h stable/9/sys/netinet/sctp_bsd_addr.c stable/9/sys/netinet/sctp_bsd_addr.h stable/9/sys/netinet/sctp_cc_functions.c stable/9/sys/netinet/sctp_constants.h stable/9/sys/netinet/sctp_crc32.h stable/9/sys/netinet/sctp_dtrace_declare.h stable/9/sys/netinet/sctp_dtrace_define.h stable/9/sys/netinet/sctp_header.h stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_indata.h stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_input.h stable/9/sys/netinet/sctp_os.h stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_pcb.h stable/9/sys/netinet/sctp_peeloff.c stable/9/sys/netinet/sctp_peeloff.h stable/9/sys/netinet/sctp_ss_functions.c stable/9/sys/netinet/sctp_structs.h stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h stable/9/sys/netinet/sctp_timer.c stable/9/sys/netinet/sctp_timer.h stable/9/sys/netinet/sctp_uio.h stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctp_var.h stable/9/sys/netinet/sctputil.c stable/9/sys/netinet/sctputil.h stable/9/sys/netinet6/sctp6_usrreq.c stable/9/sys/netinet6/sctp6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp.h ============================================================================== --- stable/9/sys/netinet/sctp.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_asconf.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -1261,8 +1261,7 @@ sctp_path_check_and_react(struct sctp_tc * flag: 1=success, 0=failure. */ static void -sctp_asconf_addr_mgmt_ack(struct sctp_tcb *stcb, struct sctp_ifa *addr, - uint16_t type, uint32_t flag) +sctp_asconf_addr_mgmt_ack(struct sctp_tcb *stcb, struct sctp_ifa *addr, uint32_t flag) { /* * do the necessary asoc list work- if we get a failure indication, @@ -1712,7 +1711,7 @@ sctp_asconf_process_param_ack(struct sct case SCTP_ADD_IP_ADDRESS: SCTPDBG(SCTP_DEBUG_ASCONF1, "process_param_ack: added IP address\n"); - sctp_asconf_addr_mgmt_ack(stcb, aparam->ifa, param_type, flag); + sctp_asconf_addr_mgmt_ack(stcb, aparam->ifa, flag); break; case SCTP_DEL_IP_ADDRESS: SCTPDBG(SCTP_DEBUG_ASCONF1, @@ -2102,7 +2101,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * int -sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val) +sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; @@ -2150,7 +2149,7 @@ sctp_asconf_iterator_ep(struct sctp_inpc } static int -sctp_asconf_iterator_ep_end(struct sctp_inpcb *inp, void *ptr, uint32_t val) +sctp_asconf_iterator_ep_end(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_ifa *ifa; struct sctp_asconf_iterator *asc; @@ -2182,7 +2181,7 @@ sctp_asconf_iterator_ep_end(struct sctp_ void sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - void *ptr, uint32_t val) + void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; @@ -2350,7 +2349,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } void -sctp_asconf_iterator_end(void *ptr, uint32_t val) +sctp_asconf_iterator_end(void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; @@ -3009,8 +3008,7 @@ next_addr: * 1 if found, 0 if not */ static uint32_t -sctp_addr_in_initack(struct sctp_tcb *stcb, struct mbuf *m, uint32_t offset, - uint32_t length, struct sockaddr *sa) +sctp_addr_in_initack(struct mbuf *m, uint32_t offset, uint32_t length, struct sockaddr *sa) { struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; @@ -3155,8 +3153,7 @@ sctp_check_address_list_ep(struct sctp_t continue; } /* check to see if in the init-ack */ - if (!sctp_addr_in_initack(stcb, m, offset, length, - &laddr->ifa->address.sa)) { + if (!sctp_addr_in_initack(m, offset, length, &laddr->ifa->address.sa)) { /* try to add it */ sctp_addr_mgmt_assoc(stcb->sctp_ep, stcb, laddr->ifa, SCTP_ADD_IP_ADDRESS, SCTP_ADDR_NOT_LOCKED); @@ -3179,6 +3176,15 @@ sctp_check_address_list_all(struct sctp_ struct sctp_ifa *sctp_ifa; uint32_t vrf_id; +#ifdef INET + struct sockaddr_in *sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 *sin6; + +#endif + if (stcb) { vrf_id = stcb->asoc.vrf_id; } else { @@ -3202,9 +3208,35 @@ sctp_check_address_list_all(struct sctp_ if (sctp_cmpaddr(&sctp_ifa->address.sa, init_addr)) { continue; } + switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + sin = (struct sockaddr_in *)&sctp_ifa->address.sin; + if ((ipv4_scope == 0) && + (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) { + /* private address not in scope */ + continue; + } + break; +#endif +#ifdef INET6 + case AF_INET6: + sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sin6; + if ((local_scope == 0) && + (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))) { + continue; + } + if ((site_scope == 0) && + (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { + continue; + } + break; +#endif + default: + break; + } /* check to see if in the init-ack */ - if (!sctp_addr_in_initack(stcb, m, offset, length, - &sctp_ifa->address.sa)) { + if (!sctp_addr_in_initack(m, offset, length, &sctp_ifa->address.sa)) { /* try to add it */ sctp_addr_mgmt_assoc(stcb->sctp_ep, stcb, sctp_ifa, SCTP_ADD_IP_ADDRESS, Modified: stable/9/sys/netinet/sctp_asconf.h ============================================================================== --- stable/9/sys/netinet/sctp_asconf.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_asconf.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_auth.c ============================================================================== --- stable/9/sys/netinet/sctp_auth.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_auth.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -1891,7 +1891,7 @@ sctp_notify_authentication(struct sctp_t /* append to socket */ control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, - 0, 0, 0, 0, 0, 0, m_notify); + 0, 0, stcb->asoc.context, 0, 0, 0, m_notify); if (control == NULL) { /* no memory */ sctp_m_freem(m_notify); Modified: stable/9/sys/netinet/sctp_auth.h ============================================================================== --- stable/9/sys/netinet/sctp_auth.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_auth.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_bsd_addr.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -83,11 +83,11 @@ sctp_wakeup_iterator(void) } static void -sctp_iterator_thread(void *v) +sctp_iterator_thread(void *v SCTP_UNUSED) { SCTP_IPI_ITERATOR_WQ_LOCK(); /* In FreeBSD this thread never terminates. */ - while (1) { + for (;;) { msleep(&sctp_it_ctl.iterator_running, &sctp_it_ctl.ipi_iterator_wq_mtx, 0, "waiting_for_work", 0); Modified: stable/9/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_bsd_addr.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/9/sys/netinet/sctp_cc_functions.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_cc_functions.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -508,8 +508,7 @@ out_decision: } static int -cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, - uint64_t vtag, uint8_t inst_ind) +cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t vtag) { uint64_t oth, probepoint; @@ -643,7 +642,7 @@ cc_bw_limit(struct sctp_tcb *stcb, struc } bw_offset = net->cc_mod.rtcc.lbw >> bw_shift; if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { - ret = cc_bw_increase(stcb, net, nbw, vtag, inst_ind); + ret = cc_bw_increase(stcb, net, nbw, vtag); goto out; } rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); @@ -664,7 +663,7 @@ out: static void sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit, int use_rtcc) + int accum_moved, int reneged_all SCTP_UNUSED, int will_exit, int use_rtcc) { struct sctp_nets *net; int old_cwnd; @@ -1301,7 +1300,7 @@ sctp_cwnd_update_rtcc_tsn_acknowledged(s } static void -sctp_cwnd_prepare_rtcc_net_for_sack(struct sctp_tcb *stcb, +sctp_cwnd_prepare_rtcc_net_for_sack(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net) { if (net->cc_mod.rtcc.tls_needs_set > 0) { @@ -1473,7 +1472,7 @@ sctp_cwnd_rtcc_socket_option(struct sctp } static void -sctp_cwnd_update_rtcc_packet_transmitted(struct sctp_tcb *stcb, +sctp_cwnd_update_rtcc_packet_transmitted(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net) { if (net->cc_mod.rtcc.tls_needs_set == 0) { @@ -1492,8 +1491,9 @@ sctp_cwnd_update_rtcc_after_sack(struct } static void -sctp_rtt_rtcc_calculated(struct sctp_tcb *stcb, - struct sctp_nets *net, struct timeval *now) +sctp_rtt_rtcc_calculated(struct sctp_tcb *stcb SCTP_UNUSED, + struct sctp_nets *net, + struct timeval *now SCTP_UNUSED) { net->cc_mod.rtcc.rtt_set_this_sack = 1; } @@ -1731,7 +1731,7 @@ sctp_hs_cwnd_update_after_fr(struct sctp static void sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit) + int accum_moved, int reneged_all SCTP_UNUSED, int will_exit) { struct sctp_nets *net; @@ -1879,7 +1879,7 @@ htcp_cwnd_undo(struct sctp_tcb *stcb, st #endif static inline void -measure_rtt(struct sctp_tcb *stcb, struct sctp_nets *net) +measure_rtt(struct sctp_nets *net) { uint32_t srtt = net->lastsa >> SCTP_RTT_SHIFT; @@ -1897,7 +1897,7 @@ measure_rtt(struct sctp_tcb *stcb, struc } static void -measure_achieved_throughput(struct sctp_tcb *stcb, struct sctp_nets *net) +measure_achieved_throughput(struct sctp_nets *net) { uint32_t now = sctp_get_tick_count(); @@ -1997,7 +1997,7 @@ htcp_alpha_update(struct htcp *ca) * were getting just too full now). */ static void -htcp_param_update(struct sctp_tcb *stcb, struct sctp_nets *net) +htcp_param_update(struct sctp_nets *net) { uint32_t minRTT = net->cc_mod.htcp_ca.minRTT; uint32_t maxRTT = net->cc_mod.htcp_ca.maxRTT; @@ -2014,9 +2014,9 @@ htcp_param_update(struct sctp_tcb *stcb, } static uint32_t -htcp_recalc_ssthresh(struct sctp_tcb *stcb, struct sctp_nets *net) +htcp_recalc_ssthresh(struct sctp_nets *net) { - htcp_param_update(stcb, net); + htcp_param_update(net); return max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu); } @@ -2051,7 +2051,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s } } } else { - measure_rtt(stcb, net); + measure_rtt(net); /* * In dangerous area, increase slowly. In theory this is @@ -2093,7 +2093,7 @@ htcp_min_cwnd(struct sctp_tcb *stcb, str #endif static void -htcp_init(struct sctp_tcb *stcb, struct sctp_nets *net) +htcp_init(struct sctp_nets *net) { memset(&net->cc_mod.htcp_ca, 0, sizeof(struct htcp)); net->cc_mod.htcp_ca.alpha = ALPHA_BASE; @@ -2111,7 +2111,7 @@ sctp_htcp_set_initial_cc_param(struct sc */ net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); net->ssthresh = stcb->asoc.peers_rwnd; - htcp_init(stcb, net); + htcp_init(net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { sctp_log_cwnd(stcb, net, 0, SCTP_CWND_INITIALIZATION); @@ -2121,7 +2121,7 @@ sctp_htcp_set_initial_cc_param(struct sc static void sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit) + int accum_moved, int reneged_all SCTP_UNUSED, int will_exit) { struct sctp_nets *net; @@ -2176,7 +2176,7 @@ sctp_htcp_cwnd_update_after_sack(struct if (accum_moved || ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { htcp_cong_avoid(stcb, net); - measure_achieved_throughput(stcb, net); + measure_achieved_throughput(net); } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, @@ -2212,7 +2212,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc /* JRS - reset as if state were changed */ htcp_reset(&net->cc_mod.htcp_ca); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); + net->ssthresh = htcp_recalc_ssthresh(net); net->cwnd = net->ssthresh; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), @@ -2266,7 +2266,7 @@ sctp_htcp_cwnd_update_after_timeout(stru /* JRS - reset as if the state were being changed to timeout */ htcp_reset(&net->cc_mod.htcp_ca); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); + net->ssthresh = htcp_recalc_ssthresh(net); net->cwnd = net->mtu; net->partial_bytes_acked = 0; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { @@ -2276,7 +2276,7 @@ sctp_htcp_cwnd_update_after_timeout(stru static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, - struct sctp_nets *net, int in_window, int num_pkt_lost) + struct sctp_nets *net, int in_window, int num_pkt_lost SCTP_UNUSED) { int old_cwnd; @@ -2286,7 +2286,7 @@ sctp_htcp_cwnd_update_after_ecn_echo(str if (in_window == 0) { htcp_reset(&net->cc_mod.htcp_ca); SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); + net->ssthresh = htcp_recalc_ssthresh(net); if (net->ssthresh < net->mtu) { net->ssthresh = net->mtu; /* here back off the timer as well, to slow us down */ Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_constants.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -1017,20 +1017,9 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) - -#define SCTP_GETTIME_TIMESPEC(x) (getnanouptime(x)) -#define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) -#define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) +#define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) +#define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) #endif -/*#if defined(__FreeBSD__) || defined(__APPLE__)*/ -/*#define SCTP_GETTIME_TIMEVAL(x) { \*/ -/* (x)->tv_sec = ticks / 1000; \*/ -/* (x)->tv_usec = (ticks % 1000) * 1000; \*/ -/*}*/ - -/*#else*/ -/*#define SCTP_GETTIME_TIMEVAL(x) (microtime(x))*/ -/*#endif __FreeBSD__ */ #if defined(_KERNEL) || defined(__Userspace__) #define sctp_sowwakeup(inp, so) \ Modified: stable/9/sys/netinet/sctp_crc32.h ============================================================================== --- stable/9/sys/netinet/sctp_crc32.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_crc32.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/9/sys/netinet/sctp_dtrace_declare.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_dtrace_declare.h Sun Feb 5 19:49:34 2012 (r231038) @@ -6,11 +6,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/9/sys/netinet/sctp_dtrace_define.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_dtrace_define.h Sun Feb 5 19:49:34 2012 (r231038) @@ -6,11 +6,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_header.h ============================================================================== --- stable/9/sys/netinet/sctp_header.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_header.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_indata.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -137,7 +137,7 @@ sctp_build_readq_entry(struct sctp_tcb * read_queue_e->sinfo_ssn = stream_seq; read_queue_e->sinfo_flags = (flags << 8); read_queue_e->sinfo_ppid = ppid; - read_queue_e->sinfo_context = stcb->asoc.context; + read_queue_e->sinfo_context = context; read_queue_e->sinfo_timetolive = 0; read_queue_e->sinfo_tsn = tsn; read_queue_e->sinfo_cumtsn = tsn; @@ -846,7 +846,6 @@ sctp_queue_data_for_reasm(struct sctp_tc { struct mbuf *oper; uint32_t cum_ackp1, last_tsn, prev_tsn, post_tsn; - u_char last_flags; struct sctp_tmit_chunk *at, *prev, *next; prev = next = NULL; @@ -1033,7 +1032,6 @@ sctp_queue_data_for_reasm(struct sctp_tc sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } else { - last_flags = at->rec.data.rcv_flags; last_tsn = at->rec.data.TSN_seq; prev = at; if (TAILQ_NEXT(at, sctp_next) == NULL) { @@ -1455,7 +1453,7 @@ sctp_process_a_data_chunk(struct sctp_tc struct sctp_tmit_chunk *chk; uint32_t tsn, gap; struct mbuf *dmbuf; - int indx, the_len; + int the_len; int need_reasm_check = 0; uint16_t strmno, strmseq; struct mbuf *oper; @@ -1587,7 +1585,6 @@ sctp_process_a_data_chunk(struct sctp_tc } else { SCTP_STAT_INCR(sctps_datadroprwnd); } - indx = *break_flag; *break_flag = 1; return (0); } @@ -2259,7 +2256,6 @@ sctp_slide_mapping_arrays(struct sctp_tc uint32_t old_cumack, old_base, old_highest, highest_tsn; asoc = &stcb->asoc; - at = 0; old_cumack = asoc->cumulative_tsn; old_base = asoc->mapping_array_base_tsn; @@ -2408,7 +2404,7 @@ sctp_slide_mapping_arrays(struct sctp_tc } void -sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap, int *abort_flag) +sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) { struct sctp_association *asoc; uint32_t highest_tsn; @@ -2824,10 +2820,7 @@ sctp_process_data(struct mbuf **mm, int stcb->asoc.send_sack = 1; } /* Start a sack timer or QUEUE a SACK for sending */ - sctp_sack_check(stcb, was_a_gap, &abort_flag); - if (abort_flag) - return (2); - + sctp_sack_check(stcb, was_a_gap); return (0); } @@ -2837,7 +2830,7 @@ sctp_process_segment_range(struct sctp_t int *num_frs, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int *ecn_seg_sums, int *rto_ok) + int *rto_ok) { struct sctp_tmit_chunk *tp1; unsigned int theTSN; @@ -3059,8 +3052,7 @@ static int sctp_handle_segments(struct mbuf *m, int *offset, struct sctp_tcb *stcb, struct sctp_association *asoc, uint32_t last_tsn, uint32_t * biggest_tsn_acked, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int num_seg, int num_nr_seg, int *ecn_seg_sums, - int *rto_ok) + int num_seg, int num_nr_seg, int *rto_ok) { struct sctp_gap_ack_block *frag, block; struct sctp_tmit_chunk *tp1; @@ -3106,7 +3098,7 @@ sctp_handle_segments(struct mbuf *m, int } if (sctp_process_segment_range(stcb, &tp1, last_tsn, frag_strt, frag_end, non_revocable, &num_frs, biggest_newly_acked_tsn, - this_sack_lowest_newack, ecn_seg_sums, rto_ok)) { + this_sack_lowest_newack, rto_ok)) { chunk_freed = 1; } prev_frag_end = frag_end; @@ -3761,7 +3753,6 @@ sctp_fs_audit(struct sctp_association *a static void sctp_window_probe_recovery(struct sctp_tcb *stcb, struct sctp_association *asoc, - struct sctp_nets *net, struct sctp_tmit_chunk *tp1) { tp1->window_probe = 0; @@ -4029,7 +4020,7 @@ sctp_express_handle_sack(struct sctp_tcb SOCKBUF_LOCK(&stcb->sctp_socket->so_snd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { /* sa_ignore NO_NULL_CHK */ - sctp_wakeup_log(stcb, cumack, 1, SCTP_WAKESND_FROM_SACK); + sctp_wakeup_log(stcb, 1, SCTP_WAKESND_FROM_SACK); } #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); @@ -4050,7 +4041,7 @@ sctp_express_handle_sack(struct sctp_tcb #endif } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { - sctp_wakeup_log(stcb, cumack, 1, SCTP_NOWAKE_FROM_SACK); + sctp_wakeup_log(stcb, 1, SCTP_NOWAKE_FROM_SACK); } } @@ -4136,7 +4127,7 @@ again: TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (tp1->window_probe) { /* move back to data send queue */ - sctp_window_probe_recovery(stcb, asoc, net, tp1); + sctp_window_probe_recovery(stcb, asoc, tp1); break; } } @@ -4344,7 +4335,7 @@ again: void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, - struct sctp_tcb *stcb, struct sctp_nets *net_from, + struct sctp_tcb *stcb, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, uint32_t cum_ack, uint32_t rwnd, int ecne_seen) @@ -4352,7 +4343,6 @@ sctp_handle_sack(struct mbuf *m, int off struct sctp_association *asoc; struct sctp_tmit_chunk *tp1, *tp2; uint32_t last_tsn, biggest_tsn_acked, biggest_tsn_newly_acked, this_sack_lowest_newack; - uint32_t sav_cum_ack; uint16_t wake_him = 0; uint32_t send_s = 0; long j; @@ -4362,7 +4352,6 @@ sctp_handle_sack(struct mbuf *m, int off int win_probe_recovery = 0; int win_probe_recovered = 0; struct sctp_nets *net = NULL; - int ecn_seg_sums = 0; int done_once; int rto_ok = 1; uint8_t reneged_all = 0; @@ -4392,7 +4381,6 @@ sctp_handle_sack(struct mbuf *m, int off SCTP_TCB_LOCK_ASSERT(stcb); /* CMT DAC algo */ this_sack_lowest_newack = 0; - j = 0; SCTP_STAT_INCR(sctps_slowpath_sack); last_tsn = cum_ack; cmt_dac_flag = flags & SCTP_SACK_CMT_DAC; @@ -4492,8 +4480,6 @@ sctp_handle_sack(struct mbuf *m, int off /* acking something behind */ return; } - sav_cum_ack = asoc->last_acked_seq; - /* update the Rwnd of the peer */ if (TAILQ_EMPTY(&asoc->sent_queue) && TAILQ_EMPTY(&asoc->send_queue) && @@ -4690,8 +4676,7 @@ sctp_handle_sack(struct mbuf *m, int off */ if (sctp_handle_segments(m, &offset_seg, stcb, asoc, last_tsn, &biggest_tsn_acked, &biggest_tsn_newly_acked, &this_sack_lowest_newack, - num_seg, num_nr_seg, &ecn_seg_sums, - &rto_ok)) { + num_seg, num_nr_seg, &rto_ok)) { wake_him++; } if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { @@ -4788,7 +4773,7 @@ sctp_handle_sack(struct mbuf *m, int off #endif SOCKBUF_LOCK(&stcb->sctp_socket->so_snd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { - sctp_wakeup_log(stcb, cum_ack, wake_him, SCTP_WAKESND_FROM_SACK); + sctp_wakeup_log(stcb, wake_him, SCTP_WAKESND_FROM_SACK); } #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); @@ -4809,7 +4794,7 @@ sctp_handle_sack(struct mbuf *m, int off #endif } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { - sctp_wakeup_log(stcb, cum_ack, wake_him, SCTP_NOWAKE_FROM_SACK); + sctp_wakeup_log(stcb, wake_him, SCTP_NOWAKE_FROM_SACK); } } @@ -5112,7 +5097,7 @@ again: */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (tp1->window_probe) { - sctp_window_probe_recovery(stcb, asoc, net, tp1); + sctp_window_probe_recovery(stcb, asoc, tp1); break; } } @@ -5222,8 +5207,7 @@ again: } void -sctp_update_acked(struct sctp_tcb *stcb, struct sctp_shutdown_chunk *cp, - struct sctp_nets *netp, int *abort_flag) +sctp_update_acked(struct sctp_tcb *stcb, struct sctp_shutdown_chunk *cp, int *abort_flag) { /* Copy cum-ack */ uint32_t cum_ack, a_rwnd; @@ -5389,13 +5373,12 @@ sctp_handle_forward_tsn(struct sctp_tcb */ struct sctp_association *asoc; uint32_t new_cum_tsn, gap; - unsigned int i, fwd_sz, cumack_set_flag, m_size; + unsigned int i, fwd_sz, m_size; uint32_t str_seq; struct sctp_stream_in *strm; struct sctp_tmit_chunk *chk, *nchk; struct sctp_queued_to_read *ctl, *sv; - cumack_set_flag = 0; asoc = &stcb->asoc; if ((fwd_sz = ntohs(fwd->ch.chunk_length)) < sizeof(struct sctp_forward_tsn_chunk)) { SCTPDBG(SCTP_DEBUG_INDATA1, Modified: stable/9/sys/netinet/sctp_indata.h ============================================================================== --- stable/9/sys/netinet/sctp_indata.h Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_indata.h Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -94,7 +94,7 @@ sctp_express_handle_sack(struct sctp_tcb void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, - struct sctp_tcb *stcb, struct sctp_nets *net_from, + struct sctp_tcb *stcb, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, uint32_t cum_ack, uint32_t rwnd, int ecne_seen); @@ -110,8 +110,7 @@ struct sctp_tmit_chunk * void sctp_service_queues(struct sctp_tcb *, struct sctp_association *); void -sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, - struct sctp_nets *, int *); + sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, int *); int sctp_process_data(struct mbuf **, int, int *, int, struct sctphdr *, @@ -120,7 +119,7 @@ sctp_process_data(struct mbuf **, int, i void sctp_slide_mapping_arrays(struct sctp_tcb *stcb); -void sctp_sack_check(struct sctp_tcb *, int, int *); +void sctp_sack_check(struct sctp_tcb *, int); #endif #endif Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:38:22 2012 (r231037) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:49:34 2012 (r231038) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -84,7 +84,7 @@ sctp_stop_all_cookie_timers(struct sctp_ static void sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net, int *abort_no_unlock, uint32_t vrf_id, uint16_t port) + int *abort_no_unlock, uint32_t vrf_id, uint16_t port) { struct sctp_init *init; struct mbuf *op_err; @@ -258,8 +258,7 @@ sctp_is_there_unsent_data(struct sctp_tc } static int -sctp_process_init(struct sctp_init_chunk *cp, struct sctp_tcb *stcb, - struct sctp_nets *net) +sctp_process_init(struct sctp_init_chunk *cp, struct sctp_tcb *stcb) { struct sctp_init *init; struct sctp_association *asoc; @@ -433,13 +432,13 @@ sctp_process_init_ack(struct mbuf *m, in asoc = &stcb->asoc; asoc->peer_supports_nat = (uint8_t) nat_friendly; /* process the peer's parameters in the INIT-ACK */ - retval = sctp_process_init((struct sctp_init_chunk *)cp, stcb, net); + retval = sctp_process_init((struct sctp_init_chunk *)cp, stcb); if (retval < 0) { return (retval); } initack_limit = offset + ntohs(cp->ch.chunk_length); /* load all addresses */ - if ((retval = sctp_load_addresses_from_init(stcb, m, iphlen, + if ((retval = sctp_load_addresses_from_init(stcb, m, (offset + sizeof(struct sctp_init_chunk)), initack_limit, sh, NULL))) { /* Huh, we should abort */ @@ -521,7 +520,7 @@ sctp_process_init_ack(struct mbuf *m, in mp->resv = 0; } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - sh, op_err, 0, net->port); + sh, op_err, vrf_id, net->port); *abort_no_unlock = 1; } return (retval); @@ -871,7 +870,7 @@ sctp_handle_shutdown(struct sctp_shutdow /* Shutdown NOT the expected size */ return; } else { - sctp_update_acked(stcb, cp, net, abort_flag); + sctp_update_acked(stcb, cp, abort_flag); if (*abort_flag) { return; } @@ -953,7 +952,7 @@ sctp_handle_shutdown(struct sctp_shutdow } static void -sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp, +sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1410,7 +1409,7 @@ static struct sctp_tcb * sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, - struct sockaddr *init_src, int *notification, sctp_assoc_t * sac_assoc_id, + struct sockaddr *init_src, int *notification, uint32_t vrf_id, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, uint16_t port) { struct sctp_association *asoc; @@ -1526,7 +1525,7 @@ sctp_process_cookie_existing(struct mbuf * the right seq no's. */ /* First we must process the INIT !! */ - retval = sctp_process_init(init_cp, stcb, net); + retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 3; @@ -1613,7 +1612,7 @@ sctp_process_cookie_existing(struct mbuf * somehow abort.. but we do have an existing asoc. This * really should not fail. */ - if (sctp_load_addresses_from_init(stcb, m, iphlen, + if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) @@ -1749,13 +1748,13 @@ sctp_process_cookie_existing(struct mbuf } /* process the INIT info (peer's info) */ - retval = sctp_process_init(init_cp, stcb, net); + retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 9; return (NULL); } - if (sctp_load_addresses_from_init(stcb, m, iphlen, + if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) @@ -1852,7 +1851,6 @@ sctp_process_cookie_existing(struct mbuf sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_15); sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); - *sac_assoc_id = sctp_get_associd(stcb); /* notify upper layer */ *notification = SCTP_NOTIFY_ASSOC_RESTART; atomic_add_int(&stcb->asoc.refcnt, 1); @@ -1928,7 +1926,7 @@ sctp_process_cookie_existing(struct mbuf SCTP_INP_WUNLOCK(stcb->sctp_ep); SCTP_INP_INFO_WUNLOCK(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:52:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233F81065672; Sun, 5 Feb 2012 19:52:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CF9E8FC08; Sun, 5 Feb 2012 19:52: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 q15JqtrK098372; Sun, 5 Feb 2012 19:52:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Jqthi098363; Sun, 5 Feb 2012 19:52:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051952.q15Jqthi098363@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:52:55 +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: r231039 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:52:56 -0000 Author: tuexen Date: Sun Feb 5 19:52:55 2012 New Revision: 231039 URL: http://svn.freebsd.org/changeset/base/231039 Log: MFC 228907: Address issues found by clang. While there, fix also some style issues. Modified: stable/9/sys/netinet/sctp_asconf.c stable/9/sys/netinet/sctp_auth.c stable/9/sys/netinet/sctp_cc_functions.c stable/9/sys/netinet/sctp_constants.h stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_ss_functions.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_timer.c stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctp_var.h stable/9/sys/netinet/sctputil.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_asconf.c Sun Feb 5 19:52:55 2012 (r231039) @@ -138,7 +138,7 @@ sctp_asconf_success_response(uint32_t id if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_success_response: couldn't get mbuf!\n"); - return NULL; + return (NULL); } aph = mtod(m_reply, struct sctp_asconf_paramhdr *); aph->correlation_id = id; @@ -147,7 +147,7 @@ sctp_asconf_success_response(uint32_t id SCTP_BUF_LEN(m_reply) = aph->ph.param_length; aph->ph.param_length = htons(aph->ph.param_length); - return m_reply; + return (m_reply); } static struct mbuf * @@ -166,7 +166,7 @@ sctp_asconf_error_response(uint32_t id, if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_error_response: couldn't get mbuf!\n"); - return NULL; + return (NULL); } aph = mtod(m_reply, struct sctp_asconf_paramhdr *); error = (struct sctp_error_cause *)(aph + 1); @@ -183,7 +183,7 @@ sctp_asconf_error_response(uint32_t id, "asconf_error_response: tlv_length (%xh) too big\n", tlv_length); sctp_m_freem(m_reply); /* discard */ - return NULL; + return (NULL); } if (error_tlv != NULL) { tlv = (uint8_t *) (error + 1); @@ -193,7 +193,7 @@ sctp_asconf_error_response(uint32_t id, error->length = htons(error->length); aph->ph.param_length = htons(aph->ph.param_length); - return m_reply; + return (m_reply); } static struct mbuf * @@ -231,7 +231,7 @@ sctp_process_asconf_add_ip(struct mbuf * case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; @@ -254,7 +254,7 @@ sctp_process_asconf_add_ip(struct mbuf * case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; @@ -277,7 +277,7 @@ sctp_process_asconf_add_ip(struct mbuf * m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* end switch */ /* if 0.0.0.0/::0, add the source address instead */ @@ -314,7 +314,7 @@ sctp_process_asconf_add_ip(struct mbuf * sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); } } - return m_reply; + return (m_reply); } static int @@ -326,7 +326,7 @@ sctp_asconf_del_remote_addrs_except(stru src_net = sctp_findnet(stcb, src); if (src_net == NULL) { /* not found */ - return -1; + return (-1); } /* delete all destination addresses except the source */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -342,7 +342,7 @@ sctp_asconf_del_remote_addrs_except(stru (struct sockaddr *)&net->ro._l_addr, SCTP_SO_NOT_LOCKED); } } - return 0; + return (0); } static struct mbuf * @@ -382,7 +382,7 @@ sctp_process_asconf_delete_ip(struct mbu case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; @@ -402,7 +402,7 @@ sctp_process_asconf_delete_ip(struct mbu case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; @@ -423,7 +423,7 @@ sctp_process_asconf_delete_ip(struct mbu m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* make sure the source address is not being deleted */ @@ -433,7 +433,7 @@ sctp_process_asconf_delete_ip(struct mbu m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* if deleting 0.0.0.0/::0, delete all addresses except src addr */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { @@ -452,7 +452,7 @@ sctp_process_asconf_delete_ip(struct mbu m_reply = sctp_asconf_success_response(aph->correlation_id); } - return m_reply; + return (m_reply); } /* delete the address */ result = sctp_del_remote_addr(stcb, sa); @@ -474,7 +474,7 @@ sctp_process_asconf_delete_ip(struct mbu /* notify upper layer */ sctp_ulp_notify(SCTP_NOTIFY_ASCONF_DELETE_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED); } - return m_reply; + return (m_reply); } static struct mbuf * @@ -511,7 +511,7 @@ sctp_process_asconf_set_primary(struct m case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; @@ -529,7 +529,7 @@ sctp_process_asconf_set_primary(struct m case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; @@ -548,7 +548,7 @@ sctp_process_asconf_set_primary(struct m m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* if 0.0.0.0/::0, use the source address instead */ @@ -620,7 +620,7 @@ sctp_process_asconf_set_primary(struct m aparam_length); } - return m_reply; + return (m_reply); } /* @@ -2530,9 +2530,9 @@ sctp_is_addr_pending(struct sctp_tcb *st */ if (add_cnt > del_cnt || (add_cnt == del_cnt && last_param_type == SCTP_ADD_IP_ADDRESS)) { - return 1; + return (1); } - return 0; + return (0); } static struct sockaddr * Modified: stable/9/sys/netinet/sctp_auth.c ============================================================================== --- stable/9/sys/netinet/sctp_auth.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_auth.c Sun Feb 5 19:52:55 2012 (r231039) @@ -469,7 +469,6 @@ sctp_compute_hashkey(sctp_key_t * key1, } if (sctp_get_keylen(key2)) { bcopy(key2->key, key_ptr, key2->keylen); - key_ptr += key2->keylen; } } else { /* key is shared + key2 + key1 */ @@ -483,7 +482,6 @@ sctp_compute_hashkey(sctp_key_t * key1, } if (sctp_get_keylen(key1)) { bcopy(key1->key, key_ptr, key1->keylen); - key_ptr += key1->keylen; } } return (new_key); Modified: stable/9/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/9/sys/netinet/sctp_cc_functions.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_cc_functions.c Sun Feb 5 19:52:55 2012 (r231039) @@ -80,7 +80,6 @@ sctp_set_initial_cc_param(struct sctp_tc } } net->ssthresh = assoc->peers_rwnd; - SDT_PROBE(sctp, cwnd, net, init, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, 0, net->cwnd); @@ -339,7 +338,6 @@ cc_bw_same(struct sctp_tcb *stcb, struct ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), net->flight_size, probepoint); - if ((net->cc_mod.rtcc.steady_step) && (inst_ind != SCTP_INST_LOOSING)) { if (net->cc_mod.rtcc.last_step_state == 5) net->cc_mod.rtcc.step_cnt++; @@ -389,7 +387,6 @@ cc_bw_decrease(struct sctp_tcb *stcb, st ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), net->flight_size, probepoint); - if (net->cc_mod.rtcc.ret_from_eq) { /* * Switch over to CA if we are less @@ -408,7 +405,6 @@ cc_bw_decrease(struct sctp_tcb *stcb, st ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), net->flight_size, probepoint); - /* Someone else - fight for more? */ if (net->cc_mod.rtcc.steady_step) { oth = net->cc_mod.rtcc.vol_reduce; @@ -553,7 +549,8 @@ cc_bw_increase(struct sctp_tcb *stcb, st static int cc_bw_limit(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw) { - uint64_t bw_offset, rtt_offset, rtt, vtag, probepoint; + uint64_t bw_offset, rtt_offset; + uint64_t probepoint, rtt, vtag; uint64_t bytes_for_this_rtt, inst_bw; uint64_t div, inst_off; int bw_shift; @@ -619,15 +616,15 @@ cc_bw_limit(struct sctp_tcb *stcb, struc inst_ind = SCTP_INST_NEUTRAL; probepoint |= ((0xb << 16) | inst_ind); } else { + inst_ind = net->cc_mod.rtcc.last_inst_ind; inst_bw = bytes_for_this_rtt / (uint64_t) (net->rtt); /* Can't determine do not change */ - inst_ind = net->cc_mod.rtcc.last_inst_ind; probepoint |= ((0xc << 16) | inst_ind); } } else { + inst_ind = net->cc_mod.rtcc.last_inst_ind; inst_bw = bytes_for_this_rtt; /* Can't determine do not change */ - inst_ind = net->cc_mod.rtcc.last_inst_ind; probepoint |= ((0xd << 16) | inst_ind); } SDT_PROBE(sctp, cwnd, net, rttvar, @@ -702,15 +699,18 @@ sctp_cwnd_update_after_sack_common(struc } } } - if (t_ucwnd_sbw == 0) { - t_ucwnd_sbw = 1; - } if (t_path_mptcp > 0) { mptcp_like_alpha = max_path / (t_path_mptcp * t_path_mptcp); } else { mptcp_like_alpha = 1; } } + if (t_ssthresh == 0) { + t_ssthresh = 1; + } + if (t_ucwnd_sbw == 0) { + t_ucwnd_sbw = 1; + } /******************************/ /* update cwnd and Early FR */ /******************************/ @@ -1012,6 +1012,9 @@ sctp_cwnd_update_after_timeout(struct sc t_ucwnd_sbw += (uint64_t) lnet->cwnd / (uint64_t) srtt; } } + if (t_ssthresh < 1) { + t_ssthresh = 1; + } if (t_ucwnd_sbw < 1) { t_ucwnd_sbw = 1; } @@ -1841,19 +1844,19 @@ static int use_bandwidth_switch = 1; static inline int between(uint32_t seq1, uint32_t seq2, uint32_t seq3) { - return seq3 - seq2 >= seq1 - seq2; + return (seq3 - seq2 >= seq1 - seq2); } static inline uint32_t htcp_cong_time(struct htcp *ca) { - return sctp_get_tick_count() - ca->last_cong; + return (sctp_get_tick_count() - ca->last_cong); } static inline uint32_t htcp_ccount(struct htcp *ca) { - return htcp_cong_time(ca) / ca->minRTT; + return (htcp_cong_time(ca) / ca->minRTT); } static inline void @@ -1873,7 +1876,7 @@ htcp_cwnd_undo(struct sctp_tcb *stcb, st net->cc_mod.htcp_ca.last_cong = net->cc_mod.htcp_ca.undo_last_cong; net->cc_mod.htcp_ca.maxRTT = net->cc_mod.htcp_ca.undo_maxRTT; net->cc_mod.htcp_ca.old_maxB = net->cc_mod.htcp_ca.undo_old_maxB; - return max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->cc_mod.htcp_ca.beta) * net->mtu); + return (max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->cc_mod.htcp_ca.beta) * net->mtu)); } #endif @@ -2017,7 +2020,7 @@ static uint32_t htcp_recalc_ssthresh(struct sctp_nets *net) { htcp_param_update(net); - return max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu); + return (max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu)); } static void @@ -2087,7 +2090,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s static uint32_t htcp_min_cwnd(struct sctp_tcb *stcb, struct sctp_nets *net) { - return net->ssthresh; + return (net->ssthresh); } #endif Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_constants.h Sun Feb 5 19:52:55 2012 (r231039) @@ -396,7 +396,7 @@ __FBSDID("$FreeBSD$"); /* SCTP chunk types are moved sctp.h for application (NAT, FW) use */ /* align to 32-bit sizes */ -#define SCTP_SIZE32(x) ((((x)+3) >> 2) << 2) +#define SCTP_SIZE32(x) ((((x) + 3) >> 2) << 2) #define IS_SCTP_CONTROL(a) ((a)->chunk_type != SCTP_DATA) #define IS_SCTP_DATA(a) ((a)->chunk_type == SCTP_DATA) @@ -933,7 +933,7 @@ __FBSDID("$FreeBSD$"); } else { \ gap = (MAX_TSN - mapping_tsn) + tsn + 1; \ } \ - } while(0) + } while (0) #define SCTP_RETRAN_DONE -1 Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_indata.c Sun Feb 5 19:52:55 2012 (r231039) @@ -845,7 +845,7 @@ sctp_queue_data_for_reasm(struct sctp_tc struct sctp_tmit_chunk *chk, int *abort_flag) { struct mbuf *oper; - uint32_t cum_ackp1, last_tsn, prev_tsn, post_tsn; + uint32_t cum_ackp1, prev_tsn, post_tsn; struct sctp_tmit_chunk *at, *prev, *next; prev = next = NULL; @@ -1032,7 +1032,6 @@ sctp_queue_data_for_reasm(struct sctp_tc sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } else { - last_tsn = at->rec.data.TSN_seq; prev = at; if (TAILQ_NEXT(at, sctp_next) == NULL) { /* @@ -1698,12 +1697,10 @@ sctp_process_a_data_chunk(struct sctp_tc if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { struct mbuf *mat; - mat = dmbuf; - while (mat) { + for (mat = dmbuf; mat; mat = SCTP_BUF_NEXT(mat)) { if (SCTP_BUF_IS_EXTENDED(mat)) { sctp_log_mb(mat, SCTP_MBUF_ICOPY); } - mat = SCTP_BUF_NEXT(mat); } } #endif @@ -1724,10 +1721,8 @@ sctp_process_a_data_chunk(struct sctp_tc struct mbuf *lat; l_len = 0; - lat = dmbuf; - while (lat) { + for (lat = dmbuf; lat; lat = SCTP_BUF_NEXT(lat)) { l_len += SCTP_BUF_LEN(lat); - lat = SCTP_BUF_NEXT(lat); } } if (l_len > the_len) { @@ -1804,15 +1799,10 @@ failed_express_del: if (tsn == (control->sinfo_tsn + 1)) { /* Yep, we can add it on */ int end = 0; - uint32_t cumack; if (chunk_flags & SCTP_DATA_LAST_FRAG) { end = 1; } - cumack = asoc->cumulative_tsn; - if ((cumack + 1) == tsn) - cumack = tsn; - if (sctp_append_to_readq(stcb->sctp_ep, stcb, control, dmbuf, end, tsn, &stcb->sctp_socket->so_rcv)) { @@ -2634,7 +2624,7 @@ sctp_process_data(struct mbuf **mm, int if (length - *offset < chk_length) { /* all done, mutulated chunk */ stop_proc = 1; - break; + continue; } if (ch->ch.chunk_type == SCTP_DATA) { if ((size_t)chk_length < sizeof(struct sctp_data_chunk) + 1) { @@ -2690,7 +2680,7 @@ sctp_process_data(struct mbuf **mm, int * drop rep space left. */ stop_proc = 1; - break; + continue; } } else { /* not a data chunk in the data region */ @@ -2698,7 +2688,7 @@ sctp_process_data(struct mbuf **mm, int case SCTP_INITIATION: case SCTP_INITIATION_ACK: case SCTP_SELECTIVE_ACK: - case SCTP_NR_SELECTIVE_ACK: /* EY */ + case SCTP_NR_SELECTIVE_ACK: case SCTP_HEARTBEAT_REQUEST: case SCTP_HEARTBEAT_ACK: case SCTP_ABORT_ASSOCIATION: @@ -2772,7 +2762,7 @@ sctp_process_data(struct mbuf **mm, int } /* else skip this bad chunk and * continue... */ break; - }; /* switch of chunk type */ + } /* switch of chunk type */ } *offset += SCTP_SIZE32(chk_length); if ((*offset >= length) || stop_proc) { @@ -2785,10 +2775,9 @@ sctp_process_data(struct mbuf **mm, int if (ch == NULL) { *offset = length; stop_proc = 1; - break; - + continue; } - } /* while */ + } if (break_flag) { /* * we need to report rwnd overrun drops. @@ -3598,7 +3587,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t * this guy had a RTO calculation pending on * it, cancel it */ - if (tp1->whoTo->rto_needed == 0) { + if ((tp1->whoTo != NULL) && + (tp1->whoTo->rto_needed == 0)) { tp1->whoTo->rto_needed = 1; } tp1->do_rtt = 0; Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:52:55 2012 (r231039) @@ -1418,7 +1418,6 @@ sctp_process_cookie_existing(struct mbuf struct sctp_nets *net; struct mbuf *op_err; struct sctp_paramhdr *ph; - int chk_length; int init_offset, initack_offset, i; int retval; int spec_flag = 0; @@ -1468,7 +1467,6 @@ sctp_process_cookie_existing(struct mbuf /* could not pull a INIT chunk in cookie */ return (NULL); } - chk_length = ntohs(init_cp->ch.chunk_length); if (init_cp->ch.chunk_type != SCTP_INITIATION) { return (NULL); } @@ -1476,7 +1474,7 @@ sctp_process_cookie_existing(struct mbuf * find and validate the INIT-ACK chunk in the cookie (my info) the * INIT-ACK follows the INIT chunk */ - initack_offset = init_offset + SCTP_SIZE32(chk_length); + initack_offset = init_offset + SCTP_SIZE32(ntohs(init_cp->ch.chunk_length)); initack_cp = (struct sctp_init_ack_chunk *) sctp_m_getptr(m, initack_offset, sizeof(struct sctp_init_ack_chunk), (uint8_t *) & initack_buf); @@ -1484,7 +1482,6 @@ sctp_process_cookie_existing(struct mbuf /* could not pull INIT-ACK chunk in cookie */ return (NULL); } - chk_length = ntohs(initack_cp->ch.chunk_length); if (initack_cp->ch.chunk_type != SCTP_INITIATION_ACK) { return (NULL); } @@ -1984,11 +1981,9 @@ sctp_process_cookie_new(struct mbuf *m, struct sockaddr_storage sa_store; struct sockaddr *initack_src = (struct sockaddr *)&sa_store; struct sctp_association *asoc; - int chk_length; int init_offset, initack_offset, initack_limit; int retval; int error = 0; - uint32_t old_tag; uint8_t auth_chunk_buf[SCTP_PARAM_BUFFER_SIZE]; #ifdef INET @@ -2020,12 +2015,11 @@ sctp_process_cookie_new(struct mbuf *m, "process_cookie_new: could not pull INIT chunk hdr\n"); return (NULL); } - chk_length = ntohs(init_cp->ch.chunk_length); if (init_cp->ch.chunk_type != SCTP_INITIATION) { SCTPDBG(SCTP_DEBUG_INPUT1, "HUH? process_cookie_new: could not find INIT chunk!\n"); return (NULL); } - initack_offset = init_offset + SCTP_SIZE32(chk_length); + initack_offset = init_offset + SCTP_SIZE32(ntohs(init_cp->ch.chunk_length)); /* * find and validate the INIT-ACK chunk in the cookie (my info) the * INIT-ACK follows the INIT chunk @@ -2038,7 +2032,6 @@ sctp_process_cookie_new(struct mbuf *m, SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: could not pull INIT-ACK chunk hdr\n"); return (NULL); } - chk_length = ntohs(initack_cp->ch.chunk_length); if (initack_cp->ch.chunk_type != SCTP_INITIATION_ACK) { return (NULL); } @@ -2115,7 +2108,6 @@ sctp_process_cookie_new(struct mbuf *m, return (NULL); } /* process the INIT-ACK info (my info) */ - old_tag = asoc->my_vtag; asoc->my_vtag = ntohl(initack_cp->init.initiate_tag); asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); @@ -2702,10 +2694,9 @@ sctp_handle_cookie_echo(struct mbuf *m, */ if (netl == NULL) { /* TSNH! Huh, why do I need to add this address here? */ - int ret; - - ret = sctp_add_remote_addr(*stcb, to, NULL, SCTP_DONOT_SETSCOPE, - SCTP_IN_COOKIE_PROC); + if (sctp_add_remote_addr(*stcb, to, NULL, SCTP_DONOT_SETSCOPE, SCTP_IN_COOKIE_PROC)) { + return (NULL); + } netl = sctp_findnet(*stcb, to); } if (netl) { @@ -3003,7 +2994,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch struct sctp_nets *net; struct sctp_tmit_chunk *lchk; struct sctp_ecne_chunk bkup; - uint8_t override_bit = 0; + uint8_t override_bit; uint32_t tsn, window_data_tsn; int len; unsigned int pkt_cnt; @@ -3050,27 +3041,33 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (tsn == net->last_cwr_tsn) { /* Found him, send it off */ - goto out; + break; } } - /* - * If we reach here, we need to send a special CWR that says - * hey, we did this a long time ago and you lost the - * response. - */ - net = TAILQ_FIRST(&stcb->asoc.nets); - override_bit = SCTP_CWR_REDUCE_OVERRIDE; + if (net == NULL) { + /* + * If we reach here, we need to send a special CWR + * that says hey, we did this a long time ago and + * you lost the response. + */ + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + /* TSNH */ + return; + } + override_bit = SCTP_CWR_REDUCE_OVERRIDE; + } else { + override_bit = 0; + } + } else { + override_bit = 0; } -out: if (SCTP_TSN_GT(tsn, net->cwr_window_tsn) && ((override_bit & SCTP_CWR_REDUCE_OVERRIDE) == 0)) { /* * JRS - Use the congestion control given in the pluggable * CC module */ - int ocwnd; - - ocwnd = net->cwnd; stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 0, pkt_cnt); /* * We reduce once every RTT. So we will only lower cwnd at @@ -5074,7 +5071,6 @@ process_control_chunks: } SCTPDBG(SCTP_DEBUG_INPUT3, "GAK, null buffer\n"); - auth_skipped = 0; *offset = length; return (NULL); } @@ -5697,7 +5693,8 @@ sctp_common_input_processing(struct mbuf */ } /* take care of ecn */ - if ((stcb->asoc.ecn_allowed == 1) && + if ((data_processed == 1) && + (stcb->asoc.ecn_allowed == 1) && ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS)) { /* Yep, we need to add a ECNE */ sctp_send_ecn_echo(stcb, net, high_tsn); @@ -5807,12 +5804,10 @@ sctp_input_with_port(struct mbuf *i_pak, #ifdef SCTP_MBUF_LOGGING /* Log in any input mbufs */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - mat = m; - while (mat) { + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { if (SCTP_BUF_IS_EXTENDED(mat)) { sctp_log_mb(mat, SCTP_MBUF_INPUT); } - mat = SCTP_BUF_NEXT(mat); } } #endif Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Feb 5 19:49:34 2012 (r231038) +++ stable/9/sys/netinet/sctp_output.c Sun Feb 5 19:52:55 2012 (r231039) @@ -2156,23 +2156,20 @@ skip_count: } cnt++; } - if (cnt > SCTP_ADDRESS_LIMIT) { - limit_out = 1; - } /* * To get through a NAT we only list addresses if we have * more than one. That way if you just bind a single address * we let the source of the init dictate our address. */ if (cnt > 1) { + cnt = cnt_inits_to; LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { - cnt = 0; if (laddr->ifa == NULL) { continue; } - if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) + if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) { continue; - + } if (sctp_is_address_in_scope(laddr->ifa, scope->ipv4_addr_legal, scope->ipv6_addr_legal, @@ -3758,7 +3755,6 @@ sctp_add_cookie(struct mbuf *init, int i /* tack the INIT and then the INIT-ACK onto the chain */ cookie_sz = 0; - m_at = mret; for (m_at = mret; m_at; m_at = SCTP_BUF_NEXT(m_at)) { cookie_sz += SCTP_BUF_LEN(m_at); if (SCTP_BUF_NEXT(m_at) == NULL) { @@ -3766,7 +3762,6 @@ sctp_add_cookie(struct mbuf *init, int i break; } } - for (m_at = copy_init; m_at; m_at = SCTP_BUF_NEXT(m_at)) { cookie_sz += SCTP_BUF_LEN(m_at); if (SCTP_BUF_NEXT(m_at) == NULL) { @@ -3774,7 +3769,6 @@ sctp_add_cookie(struct mbuf *init, int i break; } } - for (m_at = copy_initack; m_at; m_at = SCTP_BUF_NEXT(m_at)) { cookie_sz += SCTP_BUF_LEN(m_at); if (SCTP_BUF_NEXT(m_at) == NULL) { @@ -4792,7 +4786,6 @@ sctp_send_initiate(struct sctp_inpcb *in SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); } } - m_at = m; /* now the addresses */ { struct sctp_scoping scp; @@ -4801,9 +4794,10 @@ sctp_send_initiate(struct sctp_inpcb *in * To optimize this we could put the scoping stuff into a * structure and remove the individual uint8's from the * assoc structure. Then we could just sifa in the address - * within the stcb.. but for now this is a quick hack to get + * within the stcb. But for now this is a quick hack to get * the address stuff teased apart. */ + scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; scp.loopback_scope = stcb->asoc.loopback_scope; @@ -4811,7 +4805,7 @@ sctp_send_initiate(struct sctp_inpcb *in scp.local_scope = stcb->asoc.local_scope; scp.site_scope = stcb->asoc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); + sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to); } /* calulate the size and update pkt header and chunk header */ @@ -4841,7 +4835,6 @@ sctp_send_initiate(struct sctp_inpcb *in sctp_m_freem(m); return; } - p_len += padval; } SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - calls lowlevel_output\n"); ret = sctp_lowlevel_chunk_output(inp, stcb, net, @@ -5062,7 +5055,6 @@ sctp_arethere_unrecognized_parameters(st return (NULL); } m_copyback(op_err, err_at, plen, (caddr_t)phdr); - err_at += plen; } return (op_err); break; @@ -5305,6 +5297,7 @@ sctp_are_there_new_addresses(struct sctp p4 = (struct sctp_ipv4addr_param *)phdr; sin4.sin_addr.s_addr = p4->addr; sa_touse = (struct sockaddr *)&sin4; + break; } #endif #ifdef INET6 @@ -5322,10 +5315,12 @@ sctp_are_there_new_addresses(struct sctp memcpy((caddr_t)&sin6.sin6_addr, p6->addr, sizeof(p6->addr)); sa_touse = (struct sockaddr *)&sin6; + break; } #endif default: sa_touse = NULL; + break; } if (sa_touse) { /* ok, sa_touse points to one to check */ @@ -5534,7 +5529,7 @@ do_a_abort: default: goto do_a_abort; break; - }; + } if (net == NULL) { to = (struct sockaddr *)&store; @@ -5954,6 +5949,7 @@ do_a_abort: llen = 0; ol = op_err; + while (ol) { llen += SCTP_BUF_LEN(ol); ol = SCTP_BUF_NEXT(ol); @@ -6023,15 +6019,11 @@ do_a_abort: padval = p_len % 4; if ((padval) && (mp_last)) { /* see my previous comments on mp_last */ - int ret; - - ret = sctp_add_pad_tombuf(mp_last, (4 - padval)); - if (ret) { + if (sctp_add_pad_tombuf(mp_last, (4 - padval))) { /* Houston we have a problem, no space */ sctp_m_freem(m); return; } - p_len += padval; } if (stc.loopback_scope) { over_addr = &store1; @@ -6230,7 +6222,7 @@ sctp_msg_append(struct sctp_tcb *stcb, struct mbuf *m, struct sctp_sndrcvinfo *srcv, int hold_stcb_lock) { - int error = 0, holds_lock; + int error = 0; struct mbuf *at; struct sctp_stream_queue_pending *sp = NULL; struct sctp_stream_out *strm; @@ -6239,7 +6231,6 @@ sctp_msg_append(struct sctp_tcb *stcb, * Given an mbuf chain, put it into the association send queue and * place it on the wheel */ - holds_lock = hold_stcb_lock; if (srcv->sinfo_stream >= stcb->asoc.streamoutcnt) { /* Invalid stream number */ SCTP_LTRACE_ERR_RET_PKT(m, NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); @@ -6308,7 +6299,9 @@ sctp_msg_append(struct sctp_tcb *stcb, sctp_auth_key_acquire(stcb, sp->auth_keyid); sp->holds_key_ref = 1; } - SCTP_TCB_SEND_LOCK(stcb); + if (hold_stcb_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&stcb->asoc.stream_queue_cnt, 1); TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); @@ -6318,7 +6311,9 @@ sctp_msg_append(struct sctp_tcb *stcb, } stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp, 1); m = NULL; - SCTP_TCB_SEND_UNLOCK(stcb); + if (hold_stcb_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } out_now: if (m) { sctp_m_freem(m); @@ -7585,7 +7580,6 @@ dont_do_it: out_of: if (send_lock_up) { SCTP_TCB_SEND_UNLOCK(stcb); - send_lock_up = 0; } return (to_move); } @@ -7600,7 +7594,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb ) { struct sctp_association *asoc; - struct sctp_stream_out *strq, *strqn; + struct sctp_stream_out *strq; int goal_mtu, moved_how_much, total_moved = 0, bail = 0; int locked, giveup; @@ -7629,7 +7623,6 @@ sctp_fill_outqueue(struct sctp_tcb *stcb strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); locked = 0; } - strqn = strq; while ((goal_mtu > 0) && strq) { giveup = 0; bail = 0; @@ -7942,7 +7935,7 @@ again_one_more_time: */ continue; } - ctl_cnt = bundle_at = 0; + bundle_at = 0; endoutchain = outchain = NULL; no_fragmentflg = 1; one_chunk = 0; @@ -8640,7 +8633,6 @@ again_one_more_time: chk->window_probe = 0; data_list[bundle_at++] = chk; if (bundle_at >= SCTP_MAX_DATA_BUNDLING) { - mtu = 0; break; } if (chk->sent == SCTP_DATAGRAM_UNSENT) { @@ -8757,7 +8749,7 @@ no_data_fill: } else { asoc->ifp_had_enobuf = 0; } - outchain = endoutchain = NULL; + endoutchain = NULL; auth = NULL; auth_offset = 0; if (bundle_at || hbflag) { @@ -9221,7 +9213,7 @@ sctp_send_asconf_ack(struct sctp_tcb *st */ struct sctp_tmit_chunk *chk; struct sctp_asconf_ack *ack, *latest_ack; - struct mbuf *m_ack, *m; + struct mbuf *m_ack; struct sctp_nets *net = NULL; SCTP_TCB_LOCK_ASSERT(stcb); @@ -9300,7 +9292,6 @@ sctp_send_asconf_ack(struct sctp_tcb *st chk->data = m_ack; chk->send_size = 0; /* Get size */ - m = m_ack; chk->send_size = ack->len; chk->rec.chunk_id.id = SCTP_ASCONF_ACK; chk->rec.chunk_id.can_take_data = 1; @@ -9393,7 +9384,6 @@ sctp_chunk_retransmission(struct sctp_in ctl_cnt++; if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) { fwd_tsn = 1; - fwd = chk; } /* * Add an AUTH chunk, if chunk requires it save the @@ -9431,7 +9421,7 @@ sctp_chunk_retransmission(struct sctp_in SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } - m = endofchain = NULL; + endofchain = NULL; auth = NULL; auth_offset = 0; /* @@ -9601,16 +9591,13 @@ one_chunk_around: * now are there anymore forward from chk to pick * up? */ - fwd = TAILQ_NEXT(chk, sctp_next); - while (fwd) { + for (fwd = TAILQ_NEXT(chk, sctp_next); fwd != NULL; fwd = TAILQ_NEXT(fwd, sctp_next)) { if (fwd->sent != SCTP_DATAGRAM_RESEND) { /* Nope, not for retran */ - fwd = TAILQ_NEXT(fwd, sctp_next); continue; } if (fwd->whoTo != net) { /* Nope, not the net in question */ - fwd = TAILQ_NEXT(fwd, sctp_next); continue; } if (data_auth_reqd && (auth == NULL)) { @@ -9658,7 +9645,6 @@ one_chunk_around: if (bundle_at >= SCTP_MAX_DATA_BUNDLING) { break; } - fwd = TAILQ_NEXT(fwd, sctp_next); } else { /* can't fit so we are done */ break; @@ -9690,7 +9676,7 @@ one_chunk_around: SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } - m = endofchain = NULL; + endofchain = NULL; auth = NULL; auth_offset = 0; /* For HB's */ @@ -10252,12 +10238,14 @@ sctp_fill_in_rest: * we report. */ at = TAILQ_FIRST(&asoc->sent_queue); - for (i = 0; i < cnt_of_skipped; i++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:56:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A899106567C; Sun, 5 Feb 2012 19:56:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0F78FC0A; Sun, 5 Feb 2012 19:56: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 q15Ju7dq098533; Sun, 5 Feb 2012 19:56:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Ju7OD098531; Sun, 5 Feb 2012 19:56:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051956.q15Ju7OD098531@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:56:07 +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: r231040 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:56:08 -0000 Author: tuexen Date: Sun Feb 5 19:56:07 2012 New Revision: 231040 URL: http://svn.freebsd.org/changeset/base/231040 Log: MFC r229729: Use NULL instead of 0. Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Feb 5 19:52:55 2012 (r231039) +++ stable/9/sys/netinet/sctputil.c Sun Feb 5 19:56:07 2012 (r231040) @@ -1459,7 +1459,7 @@ sctp_timeout_handler(void *t) type = tmr->type; if (inp) { SCTP_INP_INCR_REF(inp); - if ((inp->sctp_socket == 0) && + if ((inp->sctp_socket == NULL) && ((tmr->type != SCTP_TIMER_TYPE_INPKILL) && (tmr->type != SCTP_TIMER_TYPE_INIT) && (tmr->type != SCTP_TIMER_TYPE_SEND) && From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 19:59:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1FC11065677; Sun, 5 Feb 2012 19:59:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAA548FC12; Sun, 5 Feb 2012 19:59: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 q15Jx1b1098671; Sun, 5 Feb 2012 19:59:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Jx1No098669; Sun, 5 Feb 2012 19:59:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202051959.q15Jx1No098669@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 19:59: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: r231041 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 19:59:02 -0000 Author: tuexen Date: Sun Feb 5 19:59:01 2012 New Revision: 231041 URL: http://svn.freebsd.org/changeset/base/231041 Log: MFC r229774: Improve the handling of received INITs. Send an ABORT when not accepting the connection. Also fix a crash, which could happen when the user closed the socket. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:56:07 2012 (r231040) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 19:59:01 2012 (r231041) @@ -88,43 +88,14 @@ sctp_handle_init(struct mbuf *m, int iph { struct sctp_init *init; struct mbuf *op_err; - uint32_t init_limit; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_init: handling INIT tcb:%p\n", stcb); if (stcb == NULL) { SCTP_INP_RLOCK(inp); - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - goto outnow; - } - } - op_err = NULL; - init = &cp->init; - /* First are we accepting? */ - if ((inp->sctp_socket->so_qlimit == 0) && (stcb == NULL)) { - SCTPDBG(SCTP_DEBUG_INPUT2, - "sctp_handle_init: Abort, so_qlimit:%d\n", - inp->sctp_socket->so_qlimit); - /* - * FIX ME ?? What about TCP model and we have a - * match/restart case? Actually no fix is needed. the lookup - * will always find the existing assoc so stcb would not be - * NULL. It may be questionable to do this since we COULD - * just send back the INIT-ACK and hope that the app did - * accept()'s by the time the COOKIE was sent. But there is - * a price to pay for COOKIE generation and I don't want to - * pay it on the chance that the app will actually do some - * accepts(). The App just looses and should NOT be in this - * state :-) - */ - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; } + /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { - /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, vrf_id, port); @@ -133,6 +104,7 @@ sctp_handle_init(struct mbuf *m, int iph goto outnow; } /* validate parameters */ + init = &cp->init; if (init->initiate_tag == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); @@ -169,19 +141,49 @@ sctp_handle_init(struct mbuf *m, int iph *abort_no_unlock = 1; goto outnow; } - init_limit = offset + ntohs(cp->ch.chunk_length); if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), - init_limit)) { + offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); if (stcb) *abort_no_unlock = 1; goto outnow; } - /* send an INIT-ACK w/cookie */ - SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, - ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + /* + * We are only accepting if we have a socket with positive + * so_qlimit. + */ + if ((stcb == NULL) && + ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (inp->sctp_socket == NULL) || + (inp->sctp_socket->so_qlimit == 0))) { + /* + * FIX ME ?? What about TCP model and we have a + * match/restart case? Actually no fix is needed. the lookup + * will always find the existing assoc so stcb would not be + * NULL. It may be questionable to do this since we COULD + * just send back the INIT-ACK and hope that the app did + * accept()'s by the time the COOKIE was sent. But there is + * a price to pay for COOKIE generation and I don't want to + * pay it on the chance that the app will actually do some + * accepts(). The App just looses and should NOT be in this + * state :-) + */ + sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + vrf_id, port); + goto outnow; + } + if ((stcb != NULL) && + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { + SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending SHUTDOWN-ACK\n"); + sctp_send_shutdown_ack(stcb, NULL); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); + } else { + SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, + ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + } outnow: if (stcb == NULL) { SCTP_INP_RUNLOCK(inp); @@ -1025,7 +1027,7 @@ sctp_handle_shutdown_ack(struct sctp_shu if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /* Set the connected flag to disconnected */ - stcb->sctp_ep->sctp_socket->so_snd.sb_cc = 0; + stcb->sctp_socket->so_snd.sb_cc = 0; } } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); @@ -4499,7 +4501,6 @@ __attribute__((noinline)) * process all control chunks... */ if (((ch->chunk_type == SCTP_SELECTIVE_ACK) || - /* EY */ (ch->chunk_type == SCTP_NR_SELECTIVE_ACK) || (ch->chunk_type == SCTP_HEARTBEAT_REQUEST)) && (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { @@ -4613,54 +4614,30 @@ process_control_chunks: } switch (ch->chunk_type) { case SCTP_INITIATION: - /* must be first and only chunk */ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT\n"); - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore? */ - if ((stcb) && (stcb->asoc.total_output_queue_size)) { - /* - * collision case where we are - * sending to them too - */ - ; - } else { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - *offset = length; - return (NULL); - } - } - if ((chk_length > SCTP_LARGEST_INIT_ACCEPTED) || - (num_chunks > 1) || + /* The INIT chunk must be the only chunk. */ + if ((num_chunks > 1) || (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + sctp_abort_association(inp, stcb, m, + iphlen, sh, NULL, vrf_id, port); *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } - if ((stcb != NULL) && - (SCTP_GET_STATE(&stcb->asoc) == - SCTP_STATE_SHUTDOWN_ACK_SENT)) { - sctp_send_shutdown_ack(stcb, NULL); + /* Honor our resource limit. */ + if (chk_length > SCTP_LARGEST_INIT_ACCEPTED) { + struct mbuf *op_err; + + op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); + sctp_abort_association(inp, stcb, m, + iphlen, sh, op_err, vrf_id, port); *offset = length; - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } - if (netp) { - sctp_handle_init(m, iphlen, *offset, sh, - (struct sctp_init_chunk *)ch, inp, - stcb, &abort_no_unlock, vrf_id, port); - } - if (abort_no_unlock) - return (NULL); - + sctp_handle_init(m, iphlen, *offset, sh, + (struct sctp_init_chunk *)ch, inp, + stcb, &abort_no_unlock, vrf_id, port); *offset = length; - if (locked_tcb) { + if ((!abort_no_unlock) && (locked_tcb)) { SCTP_TCB_UNLOCK(locked_tcb); } return (NULL); @@ -4668,7 +4645,6 @@ process_control_chunks: case SCTP_PAD_CHUNK: break; case SCTP_INITIATION_ACK: - /* must be first and only chunk */ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT-ACK\n"); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -4697,6 +4673,7 @@ process_control_chunks: return (NULL); } } + /* The INIT-CK chunk must be the only chunk. */ if ((num_chunks > 1) || (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { *offset = length; @@ -4711,16 +4688,17 @@ process_control_chunks: } else { ret = -1; } + *offset = length; + if (abort_no_unlock) { + return (NULL); + } /* * Special case, I must call the output routine to * get the cookie echoed */ - if (abort_no_unlock) - return (NULL); - - if ((stcb) && ret == 0) + if ((stcb != NULL) && (ret == 0)) { sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); - *offset = length; + } if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); } @@ -4977,7 +4955,6 @@ process_control_chunks: case SCTP_OPERATION_ERROR: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP-ERR\n"); if ((stcb) && netp && *netp && sctp_handle_error(ch, stcb, *netp) < 0) { - *offset = length; return (NULL); } @@ -5009,23 +4986,11 @@ process_control_chunks: if ((stcb == NULL) && (inp->sctp_socket->so_qlen >= inp->sctp_socket->so_qlimit)) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit))) { - struct mbuf *oper; - struct sctp_paramhdr *phdr; + struct mbuf *op_err; - oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); - if (oper) { - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr); - phdr = mtod(oper, - struct sctp_paramhdr *); - phdr->param_type = - htons(SCTP_CAUSE_OUT_OF_RESC); - phdr->param_length = - htons(sizeof(struct sctp_paramhdr)); - } + op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, stcb, m, - iphlen, sh, oper, vrf_id, port); + iphlen, sh, op_err, vrf_id, port); } *offset = length; return (NULL); From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:00:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0122A106566B; Sun, 5 Feb 2012 20:00:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DECA58FC14; Sun, 5 Feb 2012 20:00:39 +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 q15K0dCd098793; Sun, 5 Feb 2012 20:00:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K0d5g098790; Sun, 5 Feb 2012 20:00:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201202052000.q15K0d5g098790@svn.freebsd.org> From: Rui Paulo Date: Sun, 5 Feb 2012 20:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231042 - in head/sys/boot/ficl: . i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:00:40 -0000 Author: rpaulo Date: Sun Feb 5 20:00:39 2012 New Revision: 231042 URL: http://svn.freebsd.org/changeset/base/231042 Log: Fix clang warnings. Modified: head/sys/boot/ficl/fileaccess.c head/sys/boot/ficl/i386/sysdep.h Modified: head/sys/boot/ficl/fileaccess.c ============================================================================== --- head/sys/boot/ficl/fileaccess.c Sun Feb 5 19:59:01 2012 (r231041) +++ head/sys/boot/ficl/fileaccess.c Sun Feb 5 20:00:39 2012 (r231042) @@ -420,6 +420,6 @@ void ficlCompileFile(FICL_SYSTEM *pSys) ficlSetEnv(pSys, "file-ext", FICL_TRUE); #endif /* FICL_HAVE_FTRUNCATE */ #else - &pSys; + (void)pSys; #endif /* FICL_WANT_FILE */ } Modified: head/sys/boot/ficl/i386/sysdep.h ============================================================================== --- head/sys/boot/ficl/i386/sysdep.h Sun Feb 5 19:59:01 2012 (r231041) +++ head/sys/boot/ficl/i386/sysdep.h Sun Feb 5 20:00:39 2012 (r231042) @@ -58,7 +58,7 @@ #include #if !defined IGNORE /* Macro to silence unused param warnings */ -#define IGNORE(x) &x +#define IGNORE(x) (void)x #endif /* @@ -405,7 +405,7 @@ void *ficlRealloc(void *p, size_t size); #if FICL_MULTITHREAD int ficlLockDictionary(short fLock); #else -#define ficlLockDictionary(x) 0 /* ignore */ +#define ficlLockDictionary(x) /* ignore */ #endif /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:04:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18FBF106566C; Sun, 5 Feb 2012 20:04:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED8A58FC08; Sun, 5 Feb 2012 20:04: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 q15K4LC8098984; Sun, 5 Feb 2012 20:04:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K4Luo098980; Sun, 5 Feb 2012 20:04:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052004.q15K4Luo098980@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:04:21 +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: r231043 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:04:22 -0000 Author: tuexen Date: Sun Feb 5 20:04:21 2012 New Revision: 231043 URL: http://svn.freebsd.org/changeset/base/231043 Log: MFC 229775: Retire the SCTP sysctl "strict_init". We always perform the validation and there is no reason to make is configuarable. Discussed with rrs@. Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:00:39 2012 (r231042) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:04:21 2012 (r231043) @@ -4617,7 +4617,7 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT\n"); /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || - (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + (length - *offset > (int)SCTP_SIZE32(chk_length))) { sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); *offset = length; @@ -4673,9 +4673,9 @@ process_control_chunks: return (NULL); } } - /* The INIT-CK chunk must be the only chunk. */ + /* The INIT-ACK chunk must be the only chunk. */ if ((num_chunks > 1) || - (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sun Feb 5 20:00:39 2012 (r231042) +++ stable/9/sys/netinet/sctp_sysctl.c Sun Feb 5 20:04:21 2012 (r231043) @@ -58,7 +58,6 @@ sctp_init_sysctls() #if !defined(SCTP_WITH_NO_CSUM) SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; #endif - SCTP_BASE_SYSCTL(sctp_strict_init) = SCTPCTL_STRICT_INIT_DEFAULT; SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -608,7 +607,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #if !defined(SCTP_WITH_NO_CSUM) RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); #endif - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_init), SCTPCTL_STRICT_INIT_MIN, SCTPCTL_STRICT_INIT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); @@ -881,10 +879,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU", - SCTPCTL_STRICT_INIT_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", SCTPCTL_PEER_CHKOH_DESC); Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Sun Feb 5 20:00:39 2012 (r231042) +++ stable/9/sys/netinet/sctp_sysctl.h Sun Feb 5 20:04:21 2012 (r231043) @@ -50,7 +50,6 @@ struct sctp_sysctl { #if !defined(SCTP_WITH_NO_CSUM) uint32_t sctp_no_csum_on_loopback; #endif - uint32_t sctp_strict_init; uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; @@ -169,12 +168,6 @@ struct sctp_sysctl { #define SCTPCTL_LOOPBACK_NOCSUM_MAX 1 #define SCTPCTL_LOOPBACK_NOCSUM_DEFAULT 1 -/* strict_init: Enable strict INIT/INIT-ACK singleton enforcement */ -#define SCTPCTL_STRICT_INIT_DESC "Enable strict INIT/INIT-ACK singleton enforcement" -#define SCTPCTL_STRICT_INIT_MIN 0 -#define SCTPCTL_STRICT_INIT_MAX 1 -#define SCTPCTL_STRICT_INIT_DEFAULT 1 - /* peer_chkoh: Amount to debit peers rwnd per chunk sent */ #define SCTPCTL_PEER_CHKOH_DESC "Amount to debit peers rwnd per chunk sent" #define SCTPCTL_PEER_CHKOH_MIN 0 From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:04:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3CB01065670; Sun, 5 Feb 2012 20:04:43 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC1DD8FC19; Sun, 5 Feb 2012 20:04: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 q15K4hId099037; Sun, 5 Feb 2012 20:04:43 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K4hrC099031; Sun, 5 Feb 2012 20:04:43 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201202052004.q15K4hrC099031@svn.freebsd.org> From: Andreas Tobler Date: Sun, 5 Feb 2012 20:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231044 - in head: lib/libc/powerpc lib/libc/powerpc/gen lib/libc/powerpc64 lib/libc/powerpc64/gen sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:04:44 -0000 Author: andreast Date: Sun Feb 5 20:04:43 2012 New Revision: 231044 URL: http://svn.freebsd.org/changeset/base/231044 Log: Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE which has the same API as __weak_reference(). Give 'x' in SYS.h a more meaningful name. Tested on 32- and 64-bit PowerMac. Reviewed by: bde Modified: head/lib/libc/powerpc/SYS.h head/lib/libc/powerpc/gen/setjmp.S head/lib/libc/powerpc64/SYS.h head/lib/libc/powerpc64/gen/setjmp.S head/sys/powerpc/include/asm.h Modified: head/lib/libc/powerpc/SYS.h ============================================================================== --- head/lib/libc/powerpc/SYS.h Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc/SYS.h Sun Feb 5 20:04:43 2012 (r231044) @@ -33,38 +33,38 @@ #include #include -#define _SYSCALL(x) \ +#define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ +#define SYSCALL(name) \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ +#define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) -#define RSYSCALL(x) \ +#define RSYSCALL(name) \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) Modified: head/lib/libc/powerpc/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/setjmp.S Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc/gen/setjmp.S Sun Feb 5 20:04:43 2012 (r231044) @@ -69,7 +69,7 @@ ENTRY(setjmp) li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(CNAME(__longjmp), longjmp) ENTRY(__longjmp) lmw %r9,20(%r3) /* restore regs */ mr %r6,%r4 /* save val param */ Modified: head/lib/libc/powerpc64/SYS.h ============================================================================== --- head/lib/libc/powerpc64/SYS.h Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc64/SYS.h Sun Feb 5 20:04:43 2012 (r231044) @@ -33,13 +33,13 @@ #include #include -#define _SYSCALL(x) \ +#define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ +#define SYSCALL(name) \ .text; \ .align 2; \ 2: mflr %r0; \ @@ -51,18 +51,18 @@ ld %r0,16(%r1); \ mtlr %r0; \ blr; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ +#define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bnslr; \ mflr %r0; \ std %r0,16(%r1); \ @@ -74,13 +74,13 @@ ENTRY(__CONCAT(__sys_,x)); \ mtlr %r0; \ blr; -#define RSYSCALL(x) \ +#define RSYSCALL(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ \ mflr %r0; \ Modified: head/lib/libc/powerpc64/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/setjmp.S Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc64/gen/setjmp.S Sun Feb 5 20:04:43 2012 (r231044) @@ -93,7 +93,7 @@ ENTRY(setjmp) li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) ld %r9,40 + 0*8(%r3) ld %r10,40 + 1*8(%r3) Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Sun Feb 5 20:04:21 2012 (r231043) +++ head/sys/powerpc/include/asm.h Sun Feb 5 20:04:43 2012 (r231044) @@ -116,9 +116,9 @@ #define __FBSDID(s) /* nothing */ #endif /* not lint and not STRIP_FBSDID */ -#define WEAK_ALIAS(alias,sym) \ +#define WEAK_REFERENCE(sym, alias) \ .weak alias; \ - alias = sym + .equ alias,sym #ifdef __STDC__ #define WARN_REFERENCES(_sym,_msg) \ From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:06:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAF201065673; Sun, 5 Feb 2012 20:06:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D427D8FC17; Sun, 5 Feb 2012 20:06: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 q15K6hEC099158; Sun, 5 Feb 2012 20:06:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K6hd8099152; Sun, 5 Feb 2012 20:06:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052006.q15K6hd8099152@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:06:43 +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: r231045 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:06:44 -0000 Author: tuexen Date: Sun Feb 5 20:06:43 2012 New Revision: 231045 URL: http://svn.freebsd.org/changeset/base/231045 Log: MFC r229805: Add an SCTP sysctl "blackhole", similar to the one for TCP. If set to 1, no ABORT is sent back in response to an incoming INIT. If set to 2, no ABORT is sent back in response to an out of the blue packet. If set to 0 (the default), ABORTs are sent. Discussed with rrs@. Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h stable/9/sys/netinet/sctputil.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:06:43 2012 (r231045) @@ -170,8 +170,9 @@ sctp_handle_init(struct mbuf *m, int iph * accepts(). The App just looses and should NOT be in this * state :-) */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, - vrf_id, port); + if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } goto outnow; } if ((stcb != NULL) && @@ -5927,8 +5928,13 @@ sctp_skip_csum_4: if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { goto bad; } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } + } goto bad; } else if (stcb == NULL) { refcount_up = 1; Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet/sctp_sysctl.c Sun Feb 5 20:06:43 2012 (r231045) @@ -117,6 +117,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; SCTP_BASE_SYSCTL(sctp_steady_step) = SCTPCTL_RTTVAR_STEADYS_DEFAULT; SCTP_BASE_SYSCTL(sctp_use_dccc_ecn) = SCTPCTL_RTTVAR_DCCCECN_DEFAULT; + SCTP_BASE_SYSCTL(sctp_blackhole) = SCTPCTL_BLACKHOLE_DEFAULT; #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); @@ -670,6 +671,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #endif RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); #ifdef SCTP_DEBUG RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); @@ -1132,6 +1134,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), 0, sysctl_sctp_check, "IU", SCTPCTL_RTTVAR_DCCCECN_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, blackhole, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_blackhole), 0, sysctl_sctp_check, "IU", + SCTPCTL_BLACKHOLE_DESC); + #ifdef SCTP_DEBUG SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet/sctp_sysctl.h Sun Feb 5 20:06:43 2012 (r231045) @@ -115,6 +115,7 @@ struct sctp_sysctl { uint32_t sctp_vtag_time_wait; uint32_t sctp_buffer_splitting; uint32_t sctp_initial_cwnd; + uint32_t sctp_blackhole; #if defined(SCTP_DEBUG) uint32_t sctp_debug_on; #endif @@ -526,6 +527,11 @@ struct sctp_sysctl { #define SCTPCTL_RTTVAR_DCCCECN_MAX 1 #define SCTPCTL_RTTVAR_DCCCECN_DEFAULT 1 /* 0 means disable feature */ +#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing" +#define SCTPCTL_BLACKHOLE_MIN 0 +#define SCTPCTL_BLACKHOLE_MAX 2 +#define SCTPCTL_BLACKHOLE_DEFAULT SCTPCTL_BLACKHOLE_MIN + #if defined(SCTP_DEBUG) /* debug: Configure debug output */ #define SCTPCTL_DEBUG_DESC "Configure debug output" Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet/sctputil.c Sun Feb 5 20:06:43 2012 (r231045) @@ -3800,6 +3800,7 @@ sctp_handle_ootb(struct mbuf *m, int iph { struct sctp_chunkhdr *ch, chunk_buf; unsigned int chk_length; + int contains_init_chunk; SCTP_STAT_INCR_COUNTER32(sctps_outoftheblue); /* Generate a TO address for future reference */ @@ -3809,6 +3810,7 @@ sctp_handle_ootb(struct mbuf *m, int iph SCTP_CALLED_DIRECTLY_NOCMPSET); } } + contains_init_chunk = 0; ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, sizeof(*ch), (uint8_t *) & chunk_buf); while (ch != NULL) { @@ -3818,6 +3820,9 @@ sctp_handle_ootb(struct mbuf *m, int iph break; } switch (ch->chunk_type) { + case SCTP_INIT: + contains_init_chunk = 1; + break; case SCTP_COOKIE_ECHO: /* We hit here only if the assoc is being freed */ return; @@ -3843,7 +3848,11 @@ sctp_handle_ootb(struct mbuf *m, int iph ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, sizeof(*ch), (uint8_t *) & chunk_buf); } - sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (contains_init_chunk == 0))) { + sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + } } /* Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sun Feb 5 20:04:43 2012 (r231044) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sun Feb 5 20:06:43 2012 (r231045) @@ -236,8 +236,13 @@ sctp_skip_csum: if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { goto bad; } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } + } goto bad; } else if (stcb == NULL) { refcount_up = 1; From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:07:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFB77106564A; Sun, 5 Feb 2012 20:07:45 +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 C05218FC13; Sun, 5 Feb 2012 20:07: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 q15K7jjN099237; Sun, 5 Feb 2012 20:07:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K7jQx099235; Sun, 5 Feb 2012 20:07:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202052007.q15K7jQx099235@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 20:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231046 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:07:46 -0000 Author: nwhitehorn Date: Sun Feb 5 20:07:45 2012 New Revision: 231046 URL: http://svn.freebsd.org/changeset/base/231046 Log: Inherit from PCI bridge driver instead of manually specifying all of its methods. Obtained from: sparc64 MFC after: 1 week Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Sun Feb 5 20:06:43 2012 (r231045) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Sun Feb 5 20:07:45 2012 (r231046) @@ -56,31 +56,10 @@ static int ofw_pcib_pci_route_interrupt( static device_method_t ofw_pcib_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ofw_pcib_pci_probe), - DEVMETHOD(device_attach, ofw_pcib_pci_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_read_ivar, pcib_read_ivar), - DEVMETHOD(bus_write_ivar, pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(device_attach, ofw_pcib_pci_attach), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), - DEVMETHOD(pcib_read_config, pcib_read_config), - DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, ofw_pcib_pci_route_interrupt), - DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), - DEVMETHOD(pcib_release_msi, pcib_release_msi), - DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), - DEVMETHOD(pcib_release_msix, pcib_release_msix), - DEVMETHOD(pcib_map_msi, pcib_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_pci_get_node), @@ -101,8 +80,8 @@ struct ofw_pcib_softc { struct ofw_bus_iinfo ops_iinfo; }; -DEFINE_CLASS_0(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, - sizeof(struct ofw_pcib_softc)); +DEFINE_CLASS_1(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, + sizeof(struct ofw_pcib_softc), pcib_driver); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_pci_driver, pcib_devclass, 0, 0); static int From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:09:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03B24106564A; Sun, 5 Feb 2012 20:09:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF9B08FC08; Sun, 5 Feb 2012 20:09:50 +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 q15K9ox5099343; Sun, 5 Feb 2012 20:09:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K9o4F099339; Sun, 5 Feb 2012 20:09:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202052009.q15K9o4F099339@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 5 Feb 2012 20:09:50 +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: r231047 - in stable/9/sys: conf dev/sound/pci gnu/dev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:09:51 -0000 Author: pfg Date: Sun Feb 5 20:09:50 2012 New Revision: 231047 URL: http://svn.freebsd.org/changeset/base/231047 Log: MFC: r230897 Use new OSS-based BSD-licensed header for cs sound driver. The cs driver requires a table with firmware values. An alternative firmware is available in a similar Open Sound System driver. This is actually a partial revert of Revision 77504. The csa driver is now free of the GPL. Tested by: joel Approved by: jhb (mentor) Added: stable/9/sys/dev/sound/pci/cs461x_dsp.h - copied unchanged from r230897, head/sys/dev/sound/pci/cs461x_dsp.h Deleted: stable/9/sys/gnu/dev/ Modified: stable/9/sys/conf/files stable/9/sys/dev/sound/pci/csa.c stable/9/sys/dev/sound/pci/csareg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sun Feb 5 20:07:45 2012 (r231046) +++ stable/9/sys/conf/files Sun Feb 5 20:09:50 2012 (r231047) @@ -1708,8 +1708,7 @@ dev/sound/pci/als4000.c optional snd_al dev/sound/pci/atiixp.c optional snd_atiixp pci dev/sound/pci/cmi.c optional snd_cmi pci dev/sound/pci/cs4281.c optional snd_cs4281 pci -dev/sound/pci/csa.c optional snd_csa pci \ - warning "kernel contains GPL contaminated csaimg.h header" +dev/sound/pci/csa.c optional snd_csa pci dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci dev/sound/pci/emu10k1.c optional snd_emu10k1 pci Copied: stable/9/sys/dev/sound/pci/cs461x_dsp.h (from r230897, head/sys/dev/sound/pci/cs461x_dsp.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/sound/pci/cs461x_dsp.h Sun Feb 5 20:09:50 2012 (r231047, copy of r230897, head/sys/dev/sound/pci/cs461x_dsp.h) @@ -0,0 +1,3497 @@ +/* $FreeBSD$ */ +/*- + * Copyright (C) 1996-2008, 4Front Technologies + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +/* + * This file is based on cs461x_dsp.h from the Open Sound System. + * Purpose: Firmware for cs461x/cs461x cards. + */ + +#ifndef _DEV_SOUND_PCI_CS461X_DSP_H +#define _DEV_SOUND_PCI_CS461X_DSP_H + +struct cs461x_firmware_struct cs461x_firmware = { + {{0x00000000, 0x00003000}, {0x00010000, 0x00003800}, + {0x00020000, 0x00007000}}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000163, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00200040, 0x00008010, 0x00000000, + 0x00000000, 0x80000001, 0x00000001, 0x00060000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00900080, 0x00000173, 0x00000000, + 0x00000000, 0x00000010, 0x00800000, 0x00900000, + 0xf2c0000f, 0x00000200, 0x00000000, 0x00010600, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000163, 0x330300c2, + 0x06000000, 0x00000000, 0x80008000, 0x80008000, + 0x3fc0000f, 0x00000301, 0x00010400, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00b00000, 0x00d0806d, 0x330480c3, + 0x04800000, 0x00000001, 0x00800001, 0x0000ffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x066a0130, 0x06350070, 0x0000929d, 0x929d929d, + 0x00000000, 0x0000735a, 0x00000600, 0x00000000, + 0x929d735a, 0x00000000, 0x00010000, 0x735a735a, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x000000f0, 0x0000804f, 0x000000c3, + 0x05000000, 0x00a00010, 0x00000000, 0x80008000, + 0x00000000, 0x00000000, 0x00000700, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000080, 0x00a00000, 0x0000809a, 0x000000c2, + 0x07400000, 0x00000000, 0x80008000, 0xffffffff, + 0x00c80028, 0x00005555, 0x00000000, 0x000107a0, + 0x00c80028, 0x000000c2, 0x06800000, 0x00000000, + 0x06e00080, 0x00300000, 0x000080bb, 0x000000c9, + 0x07a00000, 0x04000000, 0x80008000, 0xffffffff, + 0x00c80028, 0x00005555, 0x00000000, 0x00000780, + 0x00c80028, 0x000000c5, 0xff800000, 0x00000000, + 0x00640080, 0x00c00000, 0x00008197, 0x000000c9, + 0x07800000, 0x04000000, 0x80008000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000805e, 0x000000c1, + 0x00000000, 0x00800000, 0x80008000, 0x80008000, + 0x00020000, 0x0000ffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x07c00000, 0x00900000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000018e, 0x000000c2, + 0x07c00000, 0x00000000, 0x80008000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00e00100, 0x00000173, 0x00000000, + 0x00000000, 0x00400010, 0x00800000, 0x00e00000, + 0x00000000, 0x00000000, 0x08400000, 0x00900000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01100000, 0x0000018e, 0x000000c2, + 0x08400000, 0x00000000, 0x80008000, 0xffffffff, + 0x007fff80, 0x00280058, 0x01300000, 0x00000000, + 0x00000000, 0x2aab0000, 0x00000000, 0x00000000, + 0x00000000, 0x01200000, 0x0000026c, 0x000000c2, + 0x08c00000, 0x18000000, 0x80008000, 0x80008000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000805e, 0x000000c1, + 0x00000000, 0x01000000, 0x80008000, 0x80008000, + 0x00000000, 0x00000110, 0x00000000, 0x00000000, + 0x00000000, 0x00000082, 0x09000000, 0x00000000, + 0x00000000, 0x00000600, 0x013d0233, 0x20ff0040, + 0x00000000, 0x0000804c, 0x000101d8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x929d0600, 0x929d929d, 0x929d929d, 0x929d0000, + 0x929d929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x00100635, 0x060b013f, 0x00000004, + 0x00000001, 0x007a0002, 0x00000000, 0x066e0610, + 0x0105929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0xa431ac75, 0x0001735a, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0x735a0051, + 0x00000000, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0x00000000, 0x06400136, + 0x0000270f, 0x00010000, 0x007a0000, 0x00000000, + 0x068e0645, 0x0105929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0xa431ac75, 0x0001735a, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0x735a0100, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:18:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 927D1106564A; Sun, 5 Feb 2012 20:18:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 797BF8FC0C; Sun, 5 Feb 2012 20:18:54 +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 q15KIsde099694; Sun, 5 Feb 2012 20:18:54 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15KIsfU099690; Sun, 5 Feb 2012 20:18:54 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202052018.q15KIsfU099690@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 5 Feb 2012 20:18:54 +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: r231048 - in stable/8/sys: conf dev/sound/pci gnu/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:18:54 -0000 Author: pfg Date: Sun Feb 5 20:18:53 2012 New Revision: 231048 URL: http://svn.freebsd.org/changeset/base/231048 Log: MFC: r230897 Use new OSS-based BSD-licensed header for cs sound driver. The cs driver requires a table with firmware values. An alternative firmware is available in a similar Open Sound System driver. This is actually a partial revert of Revision 77504. The csa driver is now free of the GPL. Tested by: joel Approved by: jhb (mentor) Added: stable/8/sys/dev/sound/pci/cs461x_dsp.h - copied unchanged from r230897, head/sys/dev/sound/pci/cs461x_dsp.h Deleted: stable/8/sys/gnu/dev/sound/pci/csaimg.h Modified: stable/8/sys/conf/files stable/8/sys/dev/sound/pci/csa.c stable/8/sys/dev/sound/pci/csareg.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Sun Feb 5 20:09:50 2012 (r231047) +++ stable/8/sys/conf/files Sun Feb 5 20:18:53 2012 (r231048) @@ -1582,8 +1582,7 @@ dev/sound/pci/als4000.c optional snd_al dev/sound/pci/atiixp.c optional snd_atiixp pci dev/sound/pci/cmi.c optional snd_cmi pci dev/sound/pci/cs4281.c optional snd_cs4281 pci -dev/sound/pci/csa.c optional snd_csa pci \ - warning "kernel contains GPL contaminated csaimg.h header" +dev/sound/pci/csa.c optional snd_csa pci dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci dev/sound/pci/emu10k1.c optional snd_emu10k1 pci Copied: stable/8/sys/dev/sound/pci/cs461x_dsp.h (from r230897, head/sys/dev/sound/pci/cs461x_dsp.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/sound/pci/cs461x_dsp.h Sun Feb 5 20:18:53 2012 (r231048, copy of r230897, head/sys/dev/sound/pci/cs461x_dsp.h) @@ -0,0 +1,3497 @@ +/* $FreeBSD$ */ +/*- + * Copyright (C) 1996-2008, 4Front Technologies + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +/* + * This file is based on cs461x_dsp.h from the Open Sound System. + * Purpose: Firmware for cs461x/cs461x cards. + */ + +#ifndef _DEV_SOUND_PCI_CS461X_DSP_H +#define _DEV_SOUND_PCI_CS461X_DSP_H + +struct cs461x_firmware_struct cs461x_firmware = { + {{0x00000000, 0x00003000}, {0x00010000, 0x00003800}, + {0x00020000, 0x00007000}}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000163, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00200040, 0x00008010, 0x00000000, + 0x00000000, 0x80000001, 0x00000001, 0x00060000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00900080, 0x00000173, 0x00000000, + 0x00000000, 0x00000010, 0x00800000, 0x00900000, + 0xf2c0000f, 0x00000200, 0x00000000, 0x00010600, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000163, 0x330300c2, + 0x06000000, 0x00000000, 0x80008000, 0x80008000, + 0x3fc0000f, 0x00000301, 0x00010400, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00b00000, 0x00d0806d, 0x330480c3, + 0x04800000, 0x00000001, 0x00800001, 0x0000ffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x066a0130, 0x06350070, 0x0000929d, 0x929d929d, + 0x00000000, 0x0000735a, 0x00000600, 0x00000000, + 0x929d735a, 0x00000000, 0x00010000, 0x735a735a, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x000000f0, 0x0000804f, 0x000000c3, + 0x05000000, 0x00a00010, 0x00000000, 0x80008000, + 0x00000000, 0x00000000, 0x00000700, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000080, 0x00a00000, 0x0000809a, 0x000000c2, + 0x07400000, 0x00000000, 0x80008000, 0xffffffff, + 0x00c80028, 0x00005555, 0x00000000, 0x000107a0, + 0x00c80028, 0x000000c2, 0x06800000, 0x00000000, + 0x06e00080, 0x00300000, 0x000080bb, 0x000000c9, + 0x07a00000, 0x04000000, 0x80008000, 0xffffffff, + 0x00c80028, 0x00005555, 0x00000000, 0x00000780, + 0x00c80028, 0x000000c5, 0xff800000, 0x00000000, + 0x00640080, 0x00c00000, 0x00008197, 0x000000c9, + 0x07800000, 0x04000000, 0x80008000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000805e, 0x000000c1, + 0x00000000, 0x00800000, 0x80008000, 0x80008000, + 0x00020000, 0x0000ffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x07c00000, 0x00900000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000018e, 0x000000c2, + 0x07c00000, 0x00000000, 0x80008000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00e00100, 0x00000173, 0x00000000, + 0x00000000, 0x00400010, 0x00800000, 0x00e00000, + 0x00000000, 0x00000000, 0x08400000, 0x00900000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01100000, 0x0000018e, 0x000000c2, + 0x08400000, 0x00000000, 0x80008000, 0xffffffff, + 0x007fff80, 0x00280058, 0x01300000, 0x00000000, + 0x00000000, 0x2aab0000, 0x00000000, 0x00000000, + 0x00000000, 0x01200000, 0x0000026c, 0x000000c2, + 0x08c00000, 0x18000000, 0x80008000, 0x80008000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000805e, 0x000000c1, + 0x00000000, 0x01000000, 0x80008000, 0x80008000, + 0x00000000, 0x00000110, 0x00000000, 0x00000000, + 0x00000000, 0x00000082, 0x09000000, 0x00000000, + 0x00000000, 0x00000600, 0x013d0233, 0x20ff0040, + 0x00000000, 0x0000804c, 0x000101d8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x929d0600, 0x929d929d, 0x929d929d, 0x929d0000, + 0x929d929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x00100635, 0x060b013f, 0x00000004, + 0x00000001, 0x007a0002, 0x00000000, 0x066e0610, + 0x0105929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0xa431ac75, 0x0001735a, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0x735a0051, + 0x00000000, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0x00000000, 0x06400136, + 0x0000270f, 0x00010000, 0x007a0000, 0x00000000, + 0x068e0645, 0x0105929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0xa431ac75, 0x0001735a, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0x735a0100, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:45:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7E30106564A; Sun, 5 Feb 2012 20:45:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B287E8FC08; Sun, 5 Feb 2012 20:45: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 q15KjWU6000731; Sun, 5 Feb 2012 20:45:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15KjWbi000729; Sun, 5 Feb 2012 20:45:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052045.q15KjWbi000729@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:45: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: r231049 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:45:32 -0000 Author: tuexen Date: Sun Feb 5 20:45:32 2012 New Revision: 231049 URL: http://svn.freebsd.org/changeset/base/231049 Log: MFC r230104: Fix two bugs, which result in a panic when calling getsockopt() using SCTP_RECVINFO or SCTP_NXTINFO. Reported by Clement Lecigne and forwarded to us by zi@. Modified: stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Feb 5 20:18:53 2012 (r231048) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Feb 5 20:45:32 2012 (r231049) @@ -3019,7 +3019,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_RLOCK(inp); onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO); SCTP_INP_RUNLOCK(inp); } @@ -3038,7 +3038,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_RLOCK(inp); onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO); SCTP_INP_RUNLOCK(inp); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:47:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0B1D1065674; Sun, 5 Feb 2012 20:47:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AFF38FC12; Sun, 5 Feb 2012 20:47: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 q15KlR6e000847; Sun, 5 Feb 2012 20:47:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15KlRI9000844; Sun, 5 Feb 2012 20:47:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052047.q15KlRI9000844@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:47: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: r231050 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:47:27 -0000 Author: tuexen Date: Sun Feb 5 20:47:26 2012 New Revision: 231050 URL: http://svn.freebsd.org/changeset/base/231050 Log: MFC r230136: Two cleanups. No functional change. Modified: stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Feb 5 20:45:32 2012 (r231049) +++ stable/9/sys/netinet/sctp_output.c Sun Feb 5 20:47:26 2012 (r231050) @@ -12815,9 +12815,9 @@ sctp_lower_sosend(struct socket *so, goto out_unlocked; } } - if ((SCTP_SO_IS_NBIO(so) + if (SCTP_SO_IS_NBIO(so) || (flags & MSG_NBIO) - )) { + ) { non_blocking = 1; } /* would we block? */ Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Feb 5 20:45:32 2012 (r231049) +++ stable/9/sys/netinet/sctputil.c Sun Feb 5 20:47:26 2012 (r231050) @@ -6372,7 +6372,7 @@ sctp_bindx_delete_address(struct sctp_in return; } addr_touse = sa; -#if defined(INET6) && !defined(__Userspace__) /* TODO port in6_sin6_2_sin */ +#if defined(INET6) if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:49:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B669106566B; Sun, 5 Feb 2012 20:49:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E99FA8FC08; Sun, 5 Feb 2012 20:49:03 +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 q15Kn367000954; Sun, 5 Feb 2012 20:49:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Kn35j000952; Sun, 5 Feb 2012 20:49:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052049.q15Kn35j000952@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:49:03 +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: r231051 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:49:04 -0000 Author: tuexen Date: Sun Feb 5 20:49:03 2012 New Revision: 231051 URL: http://svn.freebsd.org/changeset/base/231051 Log: MFC r230138: Small cleanup, no functional change. Modified: stable/9/sys/netinet6/sctp6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/sctp6_var.h ============================================================================== --- stable/9/sys/netinet6/sctp6_var.h Sun Feb 5 20:47:26 2012 (r231050) +++ stable/9/sys/netinet6/sctp6_var.h Sun Feb 5 20:49:03 2012 (r231051) @@ -37,7 +37,6 @@ #include __FBSDID("$FreeBSD$"); -/* TODO __Userspace__ IPv6 stuff... */ #if defined(_KERNEL) SYSCTL_DECL(_net_inet6_sctp6); From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:50:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EBCB1065670; Sun, 5 Feb 2012 20:50:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 796AE8FC13; Sun, 5 Feb 2012 20:50: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 q15Kou9p001065; Sun, 5 Feb 2012 20:50:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Kousb001063; Sun, 5 Feb 2012 20:50:56 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052050.q15Kousb001063@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:50:56 +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: r231052 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:50:56 -0000 Author: tuexen Date: Sun Feb 5 20:50:56 2012 New Revision: 231052 URL: http://svn.freebsd.org/changeset/base/231052 Log: MFC r230379: Fix a problem when using the CBAPI. While there, remove an old comment which does not apply anymore. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:49:03 2012 (r231051) +++ stable/9/sys/netinet/sctp_input.c Sun Feb 5 20:50:56 2012 (r231052) @@ -1024,12 +1024,11 @@ sctp_handle_shutdown_ack(struct sctp_shu sctp_send_shutdown_complete(stcb, net, 0); /* notify upper layer protocol */ if (stcb->sctp_socket) { - sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - /* Set the connected flag to disconnected */ stcb->sctp_socket->so_snd.sb_cc = 0; } + sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); /* free the TCB but first save off the ep */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:53:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83F21106566C; Sun, 5 Feb 2012 20:53:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE1B8FC14; Sun, 5 Feb 2012 20:53: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 q15Kr77M001190; Sun, 5 Feb 2012 20:53:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Kr7WD001188; Sun, 5 Feb 2012 20:53:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202052053.q15Kr7WD001188@svn.freebsd.org> From: Michael Tuexen Date: Sun, 5 Feb 2012 20:53:07 +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: r231053 - stable/9/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:53:07 -0000 Author: tuexen Date: Sun Feb 5 20:53:06 2012 New Revision: 231053 URL: http://svn.freebsd.org/changeset/base/231053 Log: MFC r230555: Don't print a warning when using netstat to print SCTP statistics when there is not SCTP in the kernel. This problem was reported by Sean Mahood. Modified: stable/9/usr.bin/netstat/sctp.c Directory Properties: stable/9/usr.bin/ (props changed) stable/9/usr.bin/netstat/ (props changed) Modified: stable/9/usr.bin/netstat/sctp.c ============================================================================== --- stable/9/usr.bin/netstat/sctp.c Sun Feb 5 20:50:56 2012 (r231052) +++ stable/9/usr.bin/netstat/sctp.c Sun Feb 5 20:53:06 2012 (r231053) @@ -611,7 +611,8 @@ sctp_stats(u_long off, const char *name, memset(&zerostat, 0, len); if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len, zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.sctp.stats"); + if (errno != ENOENT) + warn("sysctl: net.inet.sctp.stats"); return; } } else From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 20:55:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA92106564A; Sun, 5 Feb 2012 20:55:38 +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 8ACB58FC0C; Sun, 5 Feb 2012 20:55:38 +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 q15KtcV6001309; Sun, 5 Feb 2012 20:55:38 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Ktcw4001307; Sun, 5 Feb 2012 20:55:38 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202052055.q15Ktcw4001307@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Feb 2012 20:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231054 - head/usr.bin/rpcgen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:55:38 -0000 Author: dim Date: Sun Feb 5 20:55:38 2012 New Revision: 231054 URL: http://svn.freebsd.org/changeset/base/231054 Log: In usr.bin/rpcgen/rpc_main.c, properly check the return value of strlcpy(), in addition to checking that of strlcat(). MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Sun Feb 5 20:53:06 2012 (r231053) +++ head/usr.bin/rpcgen/rpc_main.c Sun Feb 5 20:55:38 2012 (r231054) @@ -1125,9 +1125,11 @@ parseargs(int argc, const char *argv[], if (++i == argc) { return (0); } - (void) strlcpy(pathbuf, argv[i], sizeof(pathbuf)); - if (strlcat(pathbuf, "/cpp", sizeof(pathbuf)) - >= sizeof(pathbuf)) { + if (strlcpy(pathbuf, argv[i], + sizeof(pathbuf)) >= sizeof(pathbuf) + || strlcat(pathbuf, "/cpp", + sizeof(pathbuf)) >= + sizeof(pathbuf)) { warnx("argument too long"); return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 21:27:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBBB106566B; Sun, 5 Feb 2012 21:27:16 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5E51B8FC18; Sun, 5 Feb 2012 21:27:15 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so5877497bkb.13 for ; Sun, 05 Feb 2012 13:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=yyvWPrW2AY2nBUBHxvGc02Sw0GBokmc1Eux2SiP6Rrc=; b=hyz8sO2K72oJiCm/OAtJ2tYoSzcLwpkj88aNAriyol75oj0Bb0nmAEQX9ChCkrSaoN z3rUvBEZdwbktsx+Po7th/pbSJXY5415qAtxmxvYrQcdOH8w8fKKJXenVTw9d9m+Lw0d stdxB4UR2IUhDgxB/A+kQwM5ScxNQjoJMiBg0= Received: by 10.204.129.200 with SMTP id p8mr7322015bks.114.1328477234411; Sun, 05 Feb 2012 13:27:14 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id t17sm38600935bke.6.2012.02.05.13.27.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 13:27:13 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> X-Comment-To: Pawel Jakub Dawidek Sender: Mikolaj Golub Date: Sun, 05 Feb 2012 23:27:10 +0200 In-Reply-To: <20120205093938.GC30033@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Sun, 5 Feb 2012 10:39:38 +0100") Message-ID: <86lioh7yz5.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 21:27:16 -0000 --=-=-= On Sun, 5 Feb 2012 10:39:38 +0100 Pawel Jakub Dawidek wrote: PJD> On Sat, Feb 04, 2012 at 08:16:42PM +0200, Mikolaj Golub wrote: >> ref8-amd64:/home/trociny% uname -r >> 8.2-STABLE >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> daemon: process already running, pid: 19799 >> >> kopusha:~% uname -r >> 10.0-CURRENT >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~% PJD> Mikolaj, eventhough what we had in 8.2-STABLE looks correct, it also PJD> isn't correct. PJD> Passing open descriptor to a process that doesn't expect that is bad PJD> behaviour. If you pass, eg. open descriptor to a directory and the PJD> process is using chroot(2) or jail(2) to sandbox itself it will be able PJD> to escape from that sandbox. Passing descriptor to a file has smaller PJD> security implication, but it is still wrong. For example hastd, as you PJD> probably know, asserts, before sandboxing, that he knows about all open PJD> descriptors - if there are some unknown descriptors open it won't run. PJD> Also, daemon was passing open descriptor to a pidfile that the child PJD> process cannot clean up, because he doesn't know its name. This leaves PJD> pidfile with stale PID in it once the process exits, which is also bad. PJD> In my opinion, to make daemon(8) work with pidfiles, it cannot exit PJD> after executing the given command. It should stay around with pidfile PJD> open and just wait for the child to exit. Once the child exits, it PJD> should remove the pidfile and also exit. Ok, using hastd code as a reference :-) here is my implementation. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=daemon.c.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231014) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,26 +32,31 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include #include #include +#include +#include #include #include #include static void restrict_process(const char *); +static void wait_child(pid_t, sigset_t *); +static void dummy_sighandler(int); static void usage(void); int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + sigset_t mask, oldmask; + int ch, nochdir, noclose; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; pidfile = user = NULL; @@ -82,40 +87,96 @@ main(int argc, char *argv[]) if (user != NULL) restrict_process(user); + if (pidfile == NULL) { + /* + * This is a simple case. Daemonize and exec. + */ + if (daemon(nochdir, noclose) == -1) + err(1, NULL); + + execvp(argv[0], argv); + + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + /* * Try to open the pidfile before calling daemon(3), - * to be able to report the error intelligently + * to be able to report the error intelligently. */ - if (pidfile) { - pfh = pidfile_open(pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - errx(3, "process already running, pid: %d", - otherpid); - } - err(2, "pidfile ``%s''", pidfile); + pfh = pidfile_open(pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + otherpid); } + err(2, "pidfile ``%s''", pidfile); } - if (daemon(nochdir, noclose) == -1) err(1, NULL); + /* + * We want to keep pidfile open while the command is running + * and remove it on exit. So we execute the command in a + * forked process and wait for the child to exit. We don't + * want the waiting daemon to be killed leaving the running + * process and the stale pidfile, so we pass received SIGHUP, + * SIGINT and SIGTERM to the children expecting to get SIGCHLD + * eventually. + */ - /* Now that we are the child, write out the pid */ - if (pidfile) - pidfile_write(pfh); - - execvp(argv[0], argv); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error + * Restore default actions for interesting signals in case + * the parent process decided to ignore some of them. */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) + if (signal(SIGHUP, SIG_DFL) == SIG_ERR) + err(1, "signal"); + if (signal(SIGINT, SIG_DFL) == SIG_ERR) + err(1, "signal"); + if (signal(SIGTERM, SIG_DFL) == SIG_ERR) + err(1, "signal"); + /* + * Because SIGCHLD is ignored by default, setup dummy handler + * for it, so we can mask it. + */ + if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) + err(1, "signal"); + /* + * Block interesting signals. + */ + sigemptyset(&mask); + sigaddset(&mask, SIGHUP); + sigaddset(&mask, SIGINT); + sigaddset(&mask, SIGTERM); + sigaddset(&mask, SIGCHLD); + if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) + err(1, "sigprocmask"); + /* + * Fork a child to exec and wait until it exits to remove the + * pidfile. + */ + pid = fork(); + if (pid == -1) { pidfile_remove(pfh); + err(1, "fork"); + } + if (pid == 0) { + /* Restore old sigmask in the child. */ + if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) + err(1, "sigprocmask"); + /* Now that we are the child, write out the pid. */ + pidfile_write(pfh); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + execvp(argv[0], argv); + + /* execvp() failed. */ + err(1, "%s", argv[0]); + } + wait_child(pid, &mask); + pidfile_remove(pfh); + exit(0); } static void @@ -132,6 +193,30 @@ restrict_process(const char *user) } static void +wait_child(pid_t pid, sigset_t *mask) +{ + int signo; + + while ((signo = sigwaitinfo(mask, NULL)) != -1) { + switch (signo) { + case SIGCHLD: + return; + default: + if (kill(pid, signo) == -1) { + warn("kill"); + return; + } + } + } +} + +static void +dummy_sighandler(int sig __unused) +{ + /* Nothing to do. */ +} + +static void usage(void) { (void)fprintf(stderr, --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 21:48:05 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E62106566C; Sun, 5 Feb 2012 21:48:05 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 5F19C8FC19; Sun, 5 Feb 2012 21:48:04 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id E59BB804; Sun, 5 Feb 2012 22:48:02 +0100 (CET) Date: Sun, 5 Feb 2012 22:46:48 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120205214647.GI30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="STPqjqpCrtky8aYs" Content-Disposition: inline In-Reply-To: <86lioh7yz5.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 21:48:05 -0000 --STPqjqpCrtky8aYs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: > Ok, using hastd code as a reference :-) here is my implementation. - I'd not pass selected signals to the child. The parent can still be killed with a whole bunch of different signals that are not passed or cannot be caught or the child process handle them gracefully. Signals should be send to the PID from the pidfile anyway. If someone is sending signals to the parent he has no right to expect well behaviour from the parent. - Now that we handle the pidfile fully in the parent, I'd move dropping provileges after fork(2) and pidfile_write(3). This way pidfiles will always be created with root privileges and we can forget about all the mess with pid directories, etc. - With the above you can wait for child to exit with simple wait(2). --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --STPqjqpCrtky8aYs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8u+McACgkQForvXbEpPzSvqgCg9ndmZ+VXAVgb7SUXpHp7dGAJ 08cAniBzA5lGP0hWm5fFuMwN/cCqH+7n =eWsn -----END PGP SIGNATURE----- --STPqjqpCrtky8aYs-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 22:51:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC641106564A; Sun, 5 Feb 2012 22:51:53 +0000 (UTC) (envelope-from jos@catnook.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 660448FC13; Sun, 5 Feb 2012 22:51:53 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so8756748obc.13 for ; Sun, 05 Feb 2012 14:51:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.174.101 with SMTP id br5mr6888432obc.0.1328480789567; Sun, 05 Feb 2012 14:26:29 -0800 (PST) Received: by 10.60.0.170 with HTTP; Sun, 5 Feb 2012 14:26:29 -0800 (PST) Received: by 10.60.0.170 with HTTP; Sun, 5 Feb 2012 14:26:29 -0800 (PST) In-Reply-To: <20120205214647.GI30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> Date: Sun, 5 Feb 2012 14:26:29 -0800 Message-ID: From: Jos Backus To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@freebsd.org, Guy Helmer , svn-src-all@freebsd.org, Andrey Zonov , Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 22:51:53 -0000 Hi Pawel, On Feb 5, 2012 1:48 PM, "Pawel Jakub Dawidek" wrote: > > On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: > > Ok, using hastd code as a reference :-) here is my implementation. > > - I'd not pass selected signals to the child. The parent can still be > killed with a whole bunch of different signals that are not passed or > cannot be caught or the child process handle them gracefully. > Signals should be send to the PID from the pidfile anyway. If someone > is sending signals to the parent he has no right to expect well > behaviour from the parent. > > - Now that we handle the pidfile fully in the parent, I'd move dropping > provileges after fork(2) and pidfile_write(3). This way pidfiles will > always be created with root privileges and we can forget about all the > mess with pid directories, etc. > > - With the above you can wait for child to exit with simple wait(2). If you are going to wait for the child anyway, you are doing almost everything supervise does. All you now need is a Unix domain socket interface so you can receive commands in daemon(1), and run daemon(1) at boot. AND you can remove all the pidfile code :) Jos From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 23:02:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542FB1065679; Sun, 5 Feb 2012 23:02:15 +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 F18968FC1A; Sun, 5 Feb 2012 23:02: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 q15N2Eu9005377; Sun, 5 Feb 2012 23:02:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15N2EMI005375; Sun, 5 Feb 2012 23:02:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202052302.q15N2EMI005375@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Feb 2012 23:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231055 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 23:02:15 -0000 Author: dim Date: Sun Feb 5 23:02:13 2012 New Revision: 231055 URL: http://svn.freebsd.org/changeset/base/231055 Log: Regenerate src.conf.5, after r230972 added the WITHOUT_SOURCELESS build options. MFC after: 2 weeks Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Feb 5 20:55:38 2012 (r231054) +++ head/share/man/man5/src.conf.5 Sun Feb 5 23:02:13 2012 (r231055) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd January 13, 2012 +.Dd February 5, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -869,6 +869,23 @@ as a set-user-ID root program. Set to not build the .Bx 4.4 legacy docs. +.It Va WITHOUT_SOURCELESS +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS 230972 2012-02-04 00:54:43Z rmh +Set to not build kernel modules that include sourceless code (either microcode or native code for host CPU). +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_SOURCELESS_HOST +.It +.Va WITHOUT_SOURCELESS_UCODE +.El +.It Va WITHOUT_SOURCELESS_HOST +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_HOST 230972 2012-02-04 00:54:43Z rmh +Set to not build kernel modules that include sourceless native code for host CPU. +.It Va WITHOUT_SOURCELESS_UCODE +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_UCODE 230972 2012-02-04 00:54:43Z rmh +Set to not build kernel modules that include sourceless microcode. .It Va WITHOUT_SSP .\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru Set to not build world with propolice stack smashing protection. From owner-svn-src-all@FreeBSD.ORG Sun Feb 5 23:56:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACA13106566B; Sun, 5 Feb 2012 23:56: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 928CF8FC08; Sun, 5 Feb 2012 23:56: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 q15NuNJk007250; Sun, 5 Feb 2012 23:56:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15NuNuh007220; Sun, 5 Feb 2012 23:56:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202052356.q15NuNuh007220@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Feb 2012 23:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231057 - in head: contrib/llvm/tools/bugpoint contrib/llvm/tools/llc contrib/llvm/tools/lli contrib/llvm/tools/llvm-ar contrib/llvm/tools/llvm-as contrib/llvm/tools/llvm-bcanalyzer con... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 23:56:23 -0000 Author: dim Date: Sun Feb 5 23:56:22 2012 New Revision: 231057 URL: http://svn.freebsd.org/changeset/base/231057 Log: Add a WITH_CLANG_EXTRAS option for src.conf(5), disabled by default, that builds the following additional llvm/clang tools: - bugpoint - llc - lli - llvm-ar - llvm-as - llvm-bcanalyzer - llvm-diff - llvm-dis - llvm-extract - llvm-ld - llvm-link - llvm-mc - llvm-nm - llvm-objdump - llvm-prof - llvm-ranlib - llvm-rtdyld - llvm-stub - macho-dump - opt These tools are mainly useful for people that want to manipulate llvm bitcode (.bc) and llvm assembly language (.ll) files, or want to tinker with llvm and clang themselves. MFC after: 2 weeks Added: head/contrib/llvm/tools/bugpoint/ - copied from r230910, vendor/llvm/dist/tools/bugpoint/ head/contrib/llvm/tools/llc/ - copied from r230910, vendor/llvm/dist/tools/llc/ head/contrib/llvm/tools/lli/ - copied from r230910, vendor/llvm/dist/tools/lli/ head/contrib/llvm/tools/llvm-ar/ - copied from r230910, vendor/llvm/dist/tools/llvm-ar/ head/contrib/llvm/tools/llvm-as/ - copied from r230910, vendor/llvm/dist/tools/llvm-as/ head/contrib/llvm/tools/llvm-bcanalyzer/ - copied from r230910, vendor/llvm/dist/tools/llvm-bcanalyzer/ head/contrib/llvm/tools/llvm-diff/ - copied from r230910, vendor/llvm/dist/tools/llvm-diff/ head/contrib/llvm/tools/llvm-dis/ - copied from r230910, vendor/llvm/dist/tools/llvm-dis/ head/contrib/llvm/tools/llvm-extract/ - copied from r230910, vendor/llvm/dist/tools/llvm-extract/ head/contrib/llvm/tools/llvm-ld/ - copied from r230910, vendor/llvm/dist/tools/llvm-ld/ head/contrib/llvm/tools/llvm-link/ - copied from r230910, vendor/llvm/dist/tools/llvm-link/ head/contrib/llvm/tools/llvm-mc/ - copied from r230910, vendor/llvm/dist/tools/llvm-mc/ head/contrib/llvm/tools/llvm-nm/ - copied from r230910, vendor/llvm/dist/tools/llvm-nm/ head/contrib/llvm/tools/llvm-objdump/ - copied from r230910, vendor/llvm/dist/tools/llvm-objdump/ head/contrib/llvm/tools/llvm-prof/ - copied from r230910, vendor/llvm/dist/tools/llvm-prof/ head/contrib/llvm/tools/llvm-ranlib/ - copied from r230910, vendor/llvm/dist/tools/llvm-ranlib/ head/contrib/llvm/tools/llvm-rtdyld/ - copied from r230910, vendor/llvm/dist/tools/llvm-rtdyld/ head/contrib/llvm/tools/llvm-stub/ - copied from r230910, vendor/llvm/dist/tools/llvm-stub/ head/contrib/llvm/tools/macho-dump/ - copied from r230910, vendor/llvm/dist/tools/macho-dump/ head/contrib/llvm/tools/opt/ - copied from r230910, vendor/llvm/dist/tools/opt/ head/lib/clang/libllvmarchive/ head/lib/clang/libllvmarchive/Makefile (contents, props changed) head/lib/clang/libllvmdebuginfo/ head/lib/clang/libllvmdebuginfo/Makefile (contents, props changed) head/lib/clang/libllvmexecutionengine/ head/lib/clang/libllvmexecutionengine/Makefile (contents, props changed) head/lib/clang/libllvminterpreter/ head/lib/clang/libllvminterpreter/Makefile (contents, props changed) head/lib/clang/libllvmjit/ head/lib/clang/libllvmjit/Makefile (contents, props changed) head/lib/clang/libllvmlinker/ head/lib/clang/libllvmlinker/Makefile (contents, props changed) head/lib/clang/libllvmmcdisassembler/ head/lib/clang/libllvmmcdisassembler/Makefile (contents, props changed) head/lib/clang/libllvmmcjit/ head/lib/clang/libllvmmcjit/Makefile (contents, props changed) head/lib/clang/libllvmobject/ head/lib/clang/libllvmobject/Makefile (contents, props changed) head/lib/clang/libllvmruntimedyld/ head/lib/clang/libllvmruntimedyld/Makefile (contents, props changed) head/tools/build/options/WITH_CLANG_EXTRAS (contents, props changed) head/usr.bin/clang/bugpoint/ head/usr.bin/clang/bugpoint/Makefile (contents, props changed) head/usr.bin/clang/bugpoint/bugpoint.1 (contents, props changed) head/usr.bin/clang/llc/ head/usr.bin/clang/llc/Makefile (contents, props changed) head/usr.bin/clang/llc/llc.1 (contents, props changed) head/usr.bin/clang/lli/ head/usr.bin/clang/lli/Makefile (contents, props changed) head/usr.bin/clang/lli/lli.1 (contents, props changed) head/usr.bin/clang/llvm-ar/ head/usr.bin/clang/llvm-ar/Makefile (contents, props changed) head/usr.bin/clang/llvm-ar/llvm-ar.1 (contents, props changed) head/usr.bin/clang/llvm-as/ head/usr.bin/clang/llvm-as/Makefile (contents, props changed) head/usr.bin/clang/llvm-as/llvm-as.1 (contents, props changed) head/usr.bin/clang/llvm-bcanalyzer/ head/usr.bin/clang/llvm-bcanalyzer/Makefile (contents, props changed) head/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 (contents, props changed) head/usr.bin/clang/llvm-diff/ head/usr.bin/clang/llvm-diff/Makefile (contents, props changed) head/usr.bin/clang/llvm-diff/llvm-diff.1 (contents, props changed) head/usr.bin/clang/llvm-dis/ head/usr.bin/clang/llvm-dis/Makefile (contents, props changed) head/usr.bin/clang/llvm-dis/llvm-dis.1 (contents, props changed) head/usr.bin/clang/llvm-extract/ head/usr.bin/clang/llvm-extract/Makefile (contents, props changed) head/usr.bin/clang/llvm-extract/llvm-extract.1 (contents, props changed) head/usr.bin/clang/llvm-ld/ head/usr.bin/clang/llvm-ld/Makefile (contents, props changed) head/usr.bin/clang/llvm-ld/llvm-ld.1 (contents, props changed) head/usr.bin/clang/llvm-link/ head/usr.bin/clang/llvm-link/Makefile (contents, props changed) head/usr.bin/clang/llvm-link/llvm-link.1 (contents, props changed) head/usr.bin/clang/llvm-mc/ head/usr.bin/clang/llvm-mc/Makefile (contents, props changed) head/usr.bin/clang/llvm-nm/ head/usr.bin/clang/llvm-nm/Makefile (contents, props changed) head/usr.bin/clang/llvm-nm/llvm-nm.1 (contents, props changed) head/usr.bin/clang/llvm-objdump/ head/usr.bin/clang/llvm-objdump/Makefile (contents, props changed) head/usr.bin/clang/llvm-prof/ head/usr.bin/clang/llvm-prof/Makefile (contents, props changed) head/usr.bin/clang/llvm-prof/llvm-prof.1 (contents, props changed) head/usr.bin/clang/llvm-ranlib/ head/usr.bin/clang/llvm-ranlib/Makefile (contents, props changed) head/usr.bin/clang/llvm-ranlib/llvm-ranlib.1 (contents, props changed) head/usr.bin/clang/llvm-rtdyld/ head/usr.bin/clang/llvm-rtdyld/Makefile (contents, props changed) head/usr.bin/clang/llvm-stub/ head/usr.bin/clang/llvm-stub/Makefile (contents, props changed) head/usr.bin/clang/macho-dump/ head/usr.bin/clang/macho-dump/Makefile (contents, props changed) head/usr.bin/clang/opt/ head/usr.bin/clang/opt/Makefile (contents, props changed) head/usr.bin/clang/opt/opt.1 (contents, props changed) Modified: head/lib/clang/Makefile head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmipa/Makefile head/lib/clang/libllvmipo/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmscalaropts/Makefile head/lib/clang/libllvmsupport/Makefile head/lib/clang/libllvmtransformutils/Makefile head/lib/clang/libllvmx86disassembler/Makefile head/share/man/man5/src.conf.5 head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .if !make(install) SUBDIR= libclanganalysis \ libclangarcmigrate \ @@ -60,6 +62,19 @@ SUBDIR= libclanganalysis \ libllvmx86info \ libllvmx86instprinter \ libllvmx86utils + +.if ${MK_CLANG_EXTRAS} != "no" +SUBDIR+=libllvmarchive \ + libllvmdebuginfo \ + libllvmexecutionengine \ + libllvminterpreter \ + libllvmjit \ + libllvmlinker \ + libllvmmcdisassembler \ + libllvmmcjit \ + libllvmobject \ + libllvmruntimedyld +.endif .endif SUBDIR+= include Modified: head/lib/clang/libllvmanalysis/Makefile ============================================================================== --- head/lib/clang/libllvmanalysis/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmanalysis/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmanalysis SRCDIR= lib/Analysis @@ -55,6 +57,14 @@ SRCS= AliasAnalysis.cpp \ TypeBasedAliasAnalysis.cpp \ ValueTracking.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= BlockFrequencyInfo.cpp \ + LibCallSemantics.cpp \ + PathNumbering.cpp \ + PathProfileInfo.cpp \ + PathProfileVerifier.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Added: head/lib/clang/libllvmarchive/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmarchive/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +LIB= llvmarchive + +SRCDIR= lib/Archive +SRCS= Archive.cpp \ + ArchiveReader.cpp \ + ArchiveWriter.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmdebuginfo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmdebuginfo/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +LIB= llvmdebuginfo + +SRCDIR= lib/DebugInfo +SRCS= DIContext.cpp \ + DWARFAbbreviationDeclaration.cpp \ + DWARFCompileUnit.cpp \ + DWARFContext.cpp \ + DWARFDebugAbbrev.cpp \ + DWARFDebugArangeSet.cpp \ + DWARFDebugAranges.cpp \ + DWARFDebugInfoEntry.cpp \ + DWARFDebugLine.cpp \ + DWARFFormValue.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmexecutionengine/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmexecutionengine/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +LIB= llvmexecutionengine + +SRCDIR= lib/ExecutionEngine +SRCS= ExecutionEngine.cpp \ + ExecutionEngineBindings.cpp \ + TargetSelect.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvminterpreter/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvminterpreter/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +LIB= llvminterpreter + +SRCDIR= lib/ExecutionEngine/Interpreter +SRCS= Execution.cpp \ + ExternalFunctions.cpp \ + Interpreter.cpp \ + +TGHDRS= Intrinsics + +.include "../clang.lib.mk" Modified: head/lib/clang/libllvmipa/Makefile ============================================================================== --- head/lib/clang/libllvmipa/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmipa/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmipa SRCDIR= lib/Analysis/IPA @@ -8,6 +10,10 @@ SRCS= CallGraph.cpp \ FindUsedTypes.cpp \ GlobalsModRef.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= IPA.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmipo/Makefile ============================================================================== --- head/lib/clang/libllvmipo/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmipo/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmipo SRCDIR= lib/Transforms/IPO @@ -23,6 +25,10 @@ SRCS= ArgumentPromotion.cpp \ StripDeadPrototypes.cpp \ StripSymbols.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= IPO.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Added: head/lib/clang/libllvmjit/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmjit/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +LIB= llvmjit + +SRCDIR= lib/ExecutionEngine/JIT +SRCS= Intercept.cpp \ + JIT.cpp \ + JITDebugRegisterer.cpp \ + JITDwarfEmitter.cpp \ + JITEmitter.cpp \ + JITMemoryManager.cpp \ + OProfileJITEventListener.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmlinker/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmlinker/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +LIB= llvmlinker + +SRCDIR= lib/Linker +SRCS= LinkArchives.cpp \ + LinkItems.cpp \ + LinkModules.cpp \ + Linker.cpp + +.include "../clang.lib.mk" Modified: head/lib/clang/libllvmmc/Makefile ============================================================================== --- head/lib/clang/libllvmmc/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmmc/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmc SRCDIR= lib/MC @@ -43,4 +45,8 @@ SRCS= ELFObjectWriter.cpp \ WinCOFFObjectWriter.cpp \ WinCOFFStreamer.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= MCDisassembler.cpp +.endif + .include "../clang.lib.mk" Added: head/lib/clang/libllvmmcdisassembler/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmmcdisassembler/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +LIB= llvmmcdisassembler + +SRCDIR= lib/MC/MCDisassembler +SRCS= Disassembler.cpp \ + EDDisassembler.cpp \ + EDInst.cpp \ + EDOperand.cpp \ + EDToken.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmmcjit/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmmcjit/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= llvmmcjit + +SRCDIR= lib/ExecutionEngine/MCJIT +SRCS= Intercept.cpp \ + MCJIT.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmobject/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmobject/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +LIB= llvmobject + +SRCDIR= lib/Object +SRCS= Archive.cpp \ + Binary.cpp \ + COFFObjectFile.cpp \ + ELFObjectFile.cpp \ + Error.cpp \ + MachOObject.cpp \ + MachOObjectFile.cpp \ + Object.cpp \ + ObjectFile.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmruntimedyld/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmruntimedyld/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= llvmruntimedyld + +SRCDIR= lib/ExecutionEngine/RuntimeDyld +SRCS= RuntimeDyld.cpp \ + RuntimeDyldMachO.cpp + +.include "../clang.lib.mk" Modified: head/lib/clang/libllvmscalaropts/Makefile ============================================================================== --- head/lib/clang/libllvmscalaropts/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmscalaropts/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmscalaropts SRCDIR= lib/Transforms/Scalar @@ -31,6 +33,13 @@ SRCS= ADCE.cpp \ Sink.cpp \ TailRecursionElimination.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= LoopInstSimplify.cpp \ + LowerAtomic.cpp \ + Reg2Mem.cpp \ + Scalar.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmsupport/Makefile ============================================================================== --- head/lib/clang/libllvmsupport/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmsupport/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmsupport SRCDIR= lib/Support @@ -67,4 +69,14 @@ SRCS= APFloat.cpp \ system_error.cpp LLVM_REQUIRES_RTTI= +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= BlockFrequency.cpp \ + BranchProbability.cpp \ + DataExtractor.cpp \ + Disassembler.cpp \ + FileUtilities.cpp \ + MemoryObject.cpp \ + SystemUtils.cpp +.endif + .include "../clang.lib.mk" Modified: head/lib/clang/libllvmtransformutils/Makefile ============================================================================== --- head/lib/clang/libllvmtransformutils/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmtransformutils/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmtransformutils SRCDIR= lib/Transforms/Utils @@ -29,6 +31,11 @@ SRCS= AddrModeMatcher.cpp \ UnifyFunctionExitNodes.cpp \ ValueMapper.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= SimplifyInstructions.cpp \ + Utils.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmx86disassembler/Makefile ============================================================================== --- head/lib/clang/libllvmx86disassembler/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmx86disassembler/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,11 +1,17 @@ # $FreeBSD$ +.include + LIB= llvmx86disassembler SRCDIR= lib/Target/X86/Disassembler INCDIR= lib/Target/X86 SRCS= X86Disassembler.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= X86DisassemblerDecoder.c +.endif + TGHDRS= X86GenDisassemblerTables \ X86GenEDInfo \ X86GenInstrInfo \ Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Feb 5 23:02:41 2012 (r231056) +++ head/share/man/man5/src.conf.5 Sun Feb 5 23:56:22 2012 (r231057) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd February 5, 2012 +.Dd February 6, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -271,12 +271,21 @@ Set to not build the Clang C/C++ compile .Pp It is a default setting on arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb and sparc64/sparc64. +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_CLANG_EXTRAS +.El .It Va WITH_CLANG .\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru Set to build the Clang C/C++ compiler. .Pp It is a default setting on amd64/amd64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +.It Va WITH_CLANG_EXTRAS +.\" $FreeBSD$ +Set to build additional clang and llvm tools, such as bugpoint. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Feb 5 23:02:41 2012 (r231056) +++ head/share/mk/bsd.own.mk Sun Feb 5 23:56:22 2012 (r231057) @@ -418,6 +418,7 @@ __DEFAULT_NO_OPTIONS = \ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + CLANG_EXTRAS \ CTF \ HESIOD \ ICONV \ @@ -524,6 +525,10 @@ MK_ZFS:= no MK_CTF:= no .endif +.if ${MK_CLANG} == "no" +MK_CLANG_EXTRAS:= no +.endif + .if ${MK_CRYPT} == "no" MK_OPENSSL:= no MK_OPENSSH:= no Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 5 23:02:41 2012 (r231056) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 5 23:56:22 2012 (r231057) @@ -671,6 +671,44 @@ OLD_FILES+=usr/share/man/man1/clang-cpp. OLD_FILES+=usr/share/man/man1/tblgen.1.gz .endif +.if ${MK_CLANG_EXTRAS} == no +OLD_FILES+=usr/bin/bugpoint +OLD_FILES+=usr/bin/llc +OLD_FILES+=usr/bin/lli +OLD_FILES+=usr/bin/llvm-ar +OLD_FILES+=usr/bin/llvm-as +OLD_FILES+=usr/bin/llvm-bcanalyzer +OLD_FILES+=usr/bin/llvm-diff +OLD_FILES+=usr/bin/llvm-dis +OLD_FILES+=usr/bin/llvm-extract +OLD_FILES+=usr/bin/llvm-ld +OLD_FILES+=usr/bin/llvm-link +OLD_FILES+=usr/bin/llvm-mc +OLD_FILES+=usr/bin/llvm-nm +OLD_FILES+=usr/bin/llvm-objdump +OLD_FILES+=usr/bin/llvm-prof +OLD_FILES+=usr/bin/llvm-ranlib +OLD_FILES+=usr/bin/llvm-rtdyld +OLD_FILES+=usr/bin/llvm-stub +OLD_FILES+=usr/bin/macho-dump +OLD_FILES+=usr/bin/opt +OLD_FILES+=usr/share/man/man1/bugpoint.1.gz +OLD_FILES+=usr/share/man/man1/llc.1.gz +OLD_FILES+=usr/share/man/man1/lli.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz +OLD_FILES+=usr/share/man/man1/llvm-as.1.gz +OLD_FILES+=usr/share/man/man1/llvm-bcanalyzer.1.gz +OLD_FILES+=usr/share/man/man1/llvm-diff.1.gz +OLD_FILES+=usr/share/man/man1/llvm-dis.1.gz +OLD_FILES+=usr/share/man/man1/llvm-extract.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ld.1.gz +OLD_FILES+=usr/share/man/man1/llvm-link.1.gz +OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz +OLD_FILES+=usr/share/man/man1/llvm-prof.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz +OLD_FILES+=usr/share/man/man1/opt.1.gz +.endif + .if ${MK_CPP} == no OLD_FILES+=usr/bin/cpp OLD_FILES+=usr/share/man/man1/cpp.1.gz Added: head/tools/build/options/WITH_CLANG_EXTRAS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_CLANG_EXTRAS Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build additional clang and llvm tools, such as bugpoint. Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/usr.bin/clang/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,30 @@ # $FreeBSD$ +.include + SUBDIR= clang clang-tblgen tblgen +.if ${MK_CLANG_EXTRAS} != "no" +SUBDIR+=bugpoint \ + llc \ + lli \ + llvm-ar \ + llvm-as \ + llvm-bcanalyzer \ + llvm-diff \ + llvm-dis \ + llvm-extract \ + llvm-ld \ + llvm-link \ + llvm-mc \ + llvm-nm \ + llvm-objdump \ + llvm-prof \ + llvm-ranlib \ + llvm-rtdyld \ + llvm-stub \ + macho-dump \ + opt +.endif + .include Added: head/usr.bin/clang/bugpoint/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/bugpoint/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +PROG_CXX=bugpoint + +SRCDIR= tools/bugpoint +SRCS= BugDriver.cpp \ + CrashDebugger.cpp \ + ExecutionDriver.cpp \ + ExtractFunction.cpp \ + FindBugs.cpp \ + Miscompilation.cpp \ + OptimizerDriver.cpp \ + ToolRunner.cpp \ + bugpoint.cpp + +TGHDRS= Intrinsics +LIBDEPS=llvmbitwriter \ + llvmlinker \ + llvmarchive \ + llvmbitreader \ + llvmipo \ + llvmscalaropts \ + llvminstcombine \ + llvminstrumentation \ + llvmtransformutils \ + llvmipa \ + llvmanalysis \ + llvmtarget \ + llvmmc \ + llvmasmparser \ + llvmcore \ + llvmsupport + +.include "../clang.prog.mk" Added: head/usr.bin/clang/bugpoint/bugpoint.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/bugpoint/bugpoint.1 Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,291 @@ +.\" $FreeBSD$ +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "BUGPOINT 1" +.TH BUGPOINT 1 "2011-10-17" "LLVM 3.0" "LLVM Command Guide" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +bugpoint \- automatic test case reduction tool +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBbugpoint\fR [\fIoptions\fR] [\fIinput \s-1LLVM\s0 ll/bc files\fR] [\fI\s-1LLVM\s0 passes\fR] \fB\-\-args\fR +\&\fIprogram arguments\fR +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBbugpoint\fR narrows down the source of problems in \s-1LLVM\s0 tools and passes. It +can be used to debug three types of failures: optimizer crashes, miscompilations +by optimizers, or bad native code generation (including problems in the static +and \s-1JIT\s0 compilers). It aims to reduce large test cases to small, useful ones. +For more information on the design and inner workings of \fBbugpoint\fR, as well as +advice for using bugpoint, see \fIllvm/docs/Bugpoint.html\fR in the \s-1LLVM\s0 +distribution. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-\-additional\-so\fR \fIlibrary\fR" 4 +.IX Item "--additional-so library" +Load the dynamic shared object \fIlibrary\fR into the test program whenever it is +run. This is useful if you are debugging programs which depend on non-LLVM +libraries (such as the X or curses libraries) to run. +.IP "\fB\-\-append\-exit\-code\fR=\fI{true,false}\fR" 4 +.IX Item "--append-exit-code={true,false}" +Append the test programs exit code to the output file so that a change in exit +code is considered a test failure. Defaults to false. +.IP "\fB\-\-args\fR \fIprogram args\fR" 4 +.IX Item "--args program args" +Pass all arguments specified after \-args to the test program whenever it runs. +Note that if any of the \fIprogram args\fR start with a '\-', you should use: +.Sp +.Vb 1 +\& bugpoint [bugpoint args] \-\-args \-\- [program args] +.Ve +.Sp +The \*(L"\-\-\*(R" right after the \fB\-\-args\fR option tells \fBbugpoint\fR to consider any +options starting with \f(CW\*(C`\-\*(C'\fR to be part of the \fB\-\-args\fR option, not as options to +\&\fBbugpoint\fR itself. +.IP "\fB\-\-tool\-args\fR \fItool args\fR" 4 +.IX Item "--tool-args tool args" +Pass all arguments specified after \-\-tool\-args to the \s-1LLVM\s0 tool under test +(\fBllc\fR, \fBlli\fR, etc.) whenever it runs. You should use this option in the +following way: +.Sp +.Vb 1 +\& bugpoint [bugpoint args] \-\-tool\-args \-\- [tool args] +.Ve +.Sp +The \*(L"\-\-\*(R" right after the \fB\-\-tool\-args\fR option tells \fBbugpoint\fR to consider any +options starting with \f(CW\*(C`\-\*(C'\fR to be part of the \fB\-\-tool\-args\fR option, not as +options to \fBbugpoint\fR itself. (See \fB\-\-args\fR, above.) +.IP "\fB\-\-safe\-tool\-args\fR \fItool args\fR" 4 +.IX Item "--safe-tool-args tool args" +Pass all arguments specified after \fB\-\-safe\-tool\-args\fR to the \*(L"safe\*(R" execution +tool. +.IP "\fB\-\-gcc\-tool\-args\fR \fIgcc tool args\fR" 4 +.IX Item "--gcc-tool-args gcc tool args" +Pass all arguments specified after \fB\-\-gcc\-tool\-args\fR to the invocation of +\&\fBgcc\fR. +.IP "\fB\-\-opt\-args\fR \fIopt args\fR" 4 +.IX Item "--opt-args opt args" +Pass all arguments specified after \fB\-\-opt\-args\fR to the invocation of \fBopt\fR. +.IP "\fB\-\-disable\-{dce,simplifycfg}\fR" 4 +.IX Item "--disable-{dce,simplifycfg}" +Do not run the specified passes to clean up and reduce the size of the test +program. By default, \fBbugpoint\fR uses these passes internally when attempting to +reduce test programs. If you're trying to find a bug in one of these passes, +\&\fBbugpoint\fR may crash. +.IP "\fB\-\-enable\-valgrind\fR" 4 +.IX Item "--enable-valgrind" +Use valgrind to find faults in the optimization phase. This will allow +bugpoint to find otherwise asymptomatic problems caused by memory +mis-management. +.IP "\fB\-find\-bugs\fR" 4 +.IX Item "-find-bugs" +Continually randomize the specified passes and run them on the test program +until a bug is found or the user kills \fBbugpoint\fR. +.IP "\fB\-help\fR" 4 +.IX Item "-help" +Print a summary of command line options. +.IP "\fB\-\-input\fR \fIfilename\fR" 4 +.IX Item "--input filename" +Open \fIfilename\fR and redirect the standard input of the test program, whenever +it runs, to come from that file. +.IP "\fB\-\-load\fR \fIplugin\fR" 4 +.IX Item "--load plugin" +Load the dynamic object \fIplugin\fR into \fBbugpoint\fR itself. This object should +register new optimization passes. Once loaded, the object will add new command +line options to enable various optimizations. To see the new complete list of +optimizations, use the \fB\-help\fR and \fB\-\-load\fR options together; for example: +.Sp +.Vb 1 +\& bugpoint \-\-load myNewPass.so \-help +.Ve +.IP "\fB\-\-mlimit\fR \fImegabytes\fR" 4 +.IX Item "--mlimit megabytes" +Specifies an upper limit on memory usage of the optimization and codegen. Set +to zero to disable the limit. +.IP "\fB\-\-output\fR \fIfilename\fR" 4 +.IX Item "--output filename" +Whenever the test program produces output on its standard output stream, it +should match the contents of \fIfilename\fR (the \*(L"reference output\*(R"). If you +do not use this option, \fBbugpoint\fR will attempt to generate a reference output +by compiling the program with the \*(L"safe\*(R" backend and running it. +.IP "\fB\-\-profile\-info\-file\fR \fIfilename\fR" 4 +.IX Item "--profile-info-file filename" +Profile file loaded by \fB\-\-profile\-loader\fR. +.IP "\fB\-\-run\-{int,jit,llc,cbe,custom}\fR" 4 +.IX Item "--run-{int,jit,llc,cbe,custom}" +Whenever the test program is compiled, \fBbugpoint\fR should generate code for it +using the specified code generator. These options allow you to choose the +interpreter, the \s-1JIT\s0 compiler, the static native code compiler, the C +backend, or a custom command (see \fB\-\-exec\-command\fR) respectively. +.IP "\fB\-\-safe\-{llc,cbe,custom}\fR" 4 +.IX Item "--safe-{llc,cbe,custom}" +When debugging a code generator, \fBbugpoint\fR should use the specified code +generator as the \*(L"safe\*(R" code generator. This is a known-good code generator +used to generate the \*(L"reference output\*(R" if it has not been provided, and to +compile portions of the program that as they are excluded from the testcase. +These options allow you to choose the +static native code compiler, the C backend, or a custom command, +(see \fB\-\-exec\-command\fR) respectively. The interpreter and the \s-1JIT\s0 backends +cannot currently be used as the \*(L"safe\*(R" backends. +.IP "\fB\-\-exec\-command\fR \fIcommand\fR" 4 +.IX Item "--exec-command command" +This option defines the command to use with the \fB\-\-run\-custom\fR and +\&\fB\-\-safe\-custom\fR options to execute the bitcode testcase. This can +be useful for cross-compilation. +.IP "\fB\-\-compile\-command\fR \fIcommand\fR" 4 +.IX Item "--compile-command command" +This option defines the command to use with the \fB\-\-compile\-custom\fR +option to compile the bitcode testcase. This can be useful for +testing compiler output without running any link or execute stages. To +generate a reduced unit test, you may add \s-1CHECK\s0 directives to the +testcase and pass the name of an executable compile-command script in this form: +.Sp +.Vb 3 +\& #!/bin/sh +\& llc "$@" +\& not FileCheck [bugpoint input file].ll < bugpoint\-test\-program.s +.Ve +.Sp +This script will \*(L"fail\*(R" as long as FileCheck passes. So the result +will be the minimum bitcode that passes FileCheck. +.IP "\fB\-\-safe\-path\fR \fIpath\fR" 4 +.IX Item "--safe-path path" +This option defines the path to the command to execute with the +\&\fB\-\-safe\-{int,jit,llc,cbe,custom}\fR +option. +.SH "EXIT STATUS" +.IX Header "EXIT STATUS" +If \fBbugpoint\fR succeeds in finding a problem, it will exit with 0. Otherwise, +if an error occurs, it will exit with a non-zero value. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +opt +.SH "AUTHOR" +.IX Header "AUTHOR" +Maintained by the \s-1LLVM\s0 Team (). Added: head/usr.bin/clang/llc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llc/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,45 @@ +# $FreeBSD$ + +PROG_CXX=llc + +SRCDIR= tools/llc +SRCS= llc.cpp + +LIBDEPS=llvmasmparser \ + llvmbitreader \ + llvmarmdisassembler \ + llvmarmasmparser \ + llvmarmcodegen \ + llvmarmdesc \ + llvmarminstprinter \ + llvmarminfo \ + llvmmipscodegen \ + llvmmipsdesc \ + llvmmipsinstprinter \ + llvmmipsinfo \ + llvmpowerpccodegen \ + llvmpowerpcdesc \ + llvmpowerpcinstprinter \ + llvmpowerpcinfo \ + llvmx86disassembler \ + llvmx86asmparser \ + llvmx86codegen \ + llvmx86desc \ + llvmselectiondag \ + llvmasmprinter \ + llvmmcparser \ + llvmcodegen \ + llvmscalaropts \ + llvminstcombine \ + llvmtransformutils \ + llvmipa \ + llvmanalysis \ + llvmtarget \ + llvmx86instprinter \ + llvmx86utils \ + llvmcore \ + llvmx86info \ + llvmmc \ + llvmsupport + +.include "../clang.prog.mk" Added: head/usr.bin/clang/llc/llc.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llc/llc.1 Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,285 @@ +.\" $FreeBSD$ +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 00:26:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FD45106566C; Mon, 6 Feb 2012 00:26:30 +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 4F3998FC12; Mon, 6 Feb 2012 00:26: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 q160QUiw008219; Mon, 6 Feb 2012 00:26:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q160QUkG008217; Mon, 6 Feb 2012 00:26:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202060026.q160QUkG008217@svn.freebsd.org> From: Adrian Chadd Date: Mon, 6 Feb 2012 00:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231058 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 00:26:30 -0000 Author: adrian Date: Mon Feb 6 00:26:29 2012 New Revision: 231058 URL: http://svn.freebsd.org/changeset/base/231058 Log: Update the mesh reason codes to match the latest 802.11s specification. Submitted by: Reviewed by: rpaulo Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sun Feb 5 23:56:22 2012 (r231057) +++ head/sys/net80211/ieee80211.h Mon Feb 6 00:26:29 2012 (r231058) @@ -927,19 +927,21 @@ enum { IEEE80211_REASON_SETUP_NEEDED = 38, /* 11e */ IEEE80211_REASON_TIMEOUT = 39, /* 11e */ - /* values not yet allocated by ANA */ - IEEE80211_REASON_PEER_LINK_CANCELED = 2, /* 11s */ - IEEE80211_REASON_MESH_MAX_PEERS = 3, /* 11s */ - IEEE80211_REASON_MESH_CPVIOLATION = 4, /* 11s */ - IEEE80211_REASON_MESH_CLOSE_RCVD = 5, /* 11s */ - IEEE80211_REASON_MESH_MAX_RETRIES = 6, /* 11s */ - IEEE80211_REASON_MESH_CONFIRM_TIMEOUT = 7, /* 11s */ - IEEE80211_REASON_MESH_INVALID_GTK = 8, /* 11s */ - IEEE80211_REASON_MESH_INCONS_PARAMS = 9, /* 11s */ - IEEE80211_REASON_MESH_INVALID_SECURITY = 10, /* 11s */ - IEEE80211_REASON_MESH_PERR_UNSPEC = 11, /* 11s */ - IEEE80211_REASON_MESH_PERR_NO_FI = 12, /* 11s */ - IEEE80211_REASON_MESH_PERR_DEST_UNREACH = 13, /* 11s */ + IEEE80211_REASON_PEER_LINK_CANCELED = 52, /* 11s */ + IEEE80211_REASON_MESH_MAX_PEERS = 53, /* 11s */ + IEEE80211_REASON_MESH_CPVIOLATION = 54, /* 11s */ + IEEE80211_REASON_MESH_CLOSE_RCVD = 55, /* 11s */ + IEEE80211_REASON_MESH_MAX_RETRIES = 56, /* 11s */ + IEEE80211_REASON_MESH_CONFIRM_TIMEOUT = 57, /* 11s */ + IEEE80211_REASON_MESH_INVALID_GTK = 58, /* 11s */ + IEEE80211_REASON_MESH_INCONS_PARAMS = 59, /* 11s */ + IEEE80211_REASON_MESH_INVALID_SECURITY = 60, /* 11s */ + IEEE80211_REASON_MESH_PERR_NO_PROXY = 61, /* 11s */ + IEEE80211_REASON_MESH_PERR_NO_FI = 62, /* 11s */ + IEEE80211_REASON_MESH_PERR_DEST_UNREACH = 63, /* 11s */ + IEEE80211_REASON_MESH_MAC_ALRDY_EXISTS_MBSS = 64, /* 11s */ + IEEE80211_REASON_MESH_CHAN_SWITCH_REG = 65, /* 11s */ + IEEE80211_REASON_MESH_CHAN_SWITCH_UNSPEC = 66, /* 11s */ IEEE80211_STATUS_SUCCESS = 0, IEEE80211_STATUS_UNSPECIFIED = 1, From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 04:15:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 517E41065672; Mon, 6 Feb 2012 04:15:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id C204B8FC0C; Mon, 6 Feb 2012 04:15:32 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q164FS13029085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Feb 2012 15:15:29 +1100 Date: Mon, 6 Feb 2012 15:15:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andreas Tobler In-Reply-To: <201202052004.q15K4hrC099031@svn.freebsd.org> Message-ID: <20120206151515.W1346@besplex.bde.org> References: <201202052004.q15K4hrC099031@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231044 - in head: lib/libc/powerpc lib/libc/powerpc/gen lib/libc/powerpc64 lib/libc/powerpc64/gen sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 04:15:33 -0000 On Sun, 5 Feb 2012, Andreas Tobler wrote: > Log: > Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE which > has the same API as __weak_reference(). Give 'x' in SYS.h a more meaningful > name. > > Tested on 32- and 64-bit PowerMac. > > Reviewed by: bde Thanks. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 06:03:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27375106564A; Mon, 6 Feb 2012 06:03:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11B2E8FC14; Mon, 6 Feb 2012 06:03: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 q1663GRp019219; Mon, 6 Feb 2012 06:03:16 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1663GZR019217; Mon, 6 Feb 2012 06:03:16 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202060603.q1663GZR019217@svn.freebsd.org> From: Kevin Lo Date: Mon, 6 Feb 2012 06:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231060 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 06:03:17 -0000 Author: kevlo Date: Mon Feb 6 06:03:16 2012 New Revision: 231060 URL: http://svn.freebsd.org/changeset/base/231060 Log: - Use uint8_t for the variable x and spell the size of the variable as sizeof(x) - Capitalized comment - Parentheses around return value Requested by: bde Modified: head/sys/kern/subr_mchain.c Modified: head/sys/kern/subr_mchain.c ============================================================================== --- head/sys/kern/subr_mchain.c Mon Feb 6 04:23:37 2012 (r231059) +++ head/sys/kern/subr_mchain.c Mon Feb 6 06:03:16 2012 (r231060) @@ -62,7 +62,7 @@ mb_init(struct mbchain *mbp) m = m_gethdr(M_WAIT, MT_DATA); m->m_len = 0; mb_initm(mbp, m); - return 0; + return (0); } void @@ -89,13 +89,13 @@ mb_detach(struct mbchain *mbp) m = mbp->mb_top; mbp->mb_top = NULL; - return m; + return (m); } int mb_fixhdr(struct mbchain *mbp) { - return mbp->mb_top->m_pkthdr.len = m_fixhdr(mbp->mb_top); + return (mbp->mb_top->m_pkthdr.len = m_fixhdr(mbp->mb_top)); } /* @@ -124,70 +124,70 @@ mb_reserve(struct mbchain *mbp, int size mbp->mb_count += size; bpos = mtod(m, caddr_t) + m->m_len; m->m_len += size; - return bpos; + return (bpos); } int mb_put_padbyte(struct mbchain *mbp) { caddr_t dst; - char x = 0; + uint8_t x = 0; dst = mtod(mbp->mb_cur, caddr_t) + mbp->mb_cur->m_len; - /* only add padding if address is odd */ + /* Only add padding if address is odd */ if ((unsigned long)dst & 1) - return mb_put_mem(mbp, (caddr_t)&x, 1, MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); else - return 0; + return (0); } int mb_put_uint8(struct mbchain *mbp, uint8_t x) { - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint16be(struct mbchain *mbp, uint16_t x) { x = htobe16(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint16le(struct mbchain *mbp, uint16_t x) { x = htole16(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint32be(struct mbchain *mbp, uint32_t x) { x = htobe32(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint32le(struct mbchain *mbp, uint32_t x) { x = htole32(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_int64be(struct mbchain *mbp, int64_t x) { x = htobe64(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_int64le(struct mbchain *mbp, int64_t x) { x = htole64(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int @@ -220,7 +220,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_ dstlen = mleft; error = mbp->mb_copy(mbp, source, dst, &srclen, &dstlen); if (error) - return error; + return (error); break; case MB_MINLINE: for (src = source, count = cplen; count; count--) @@ -232,7 +232,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_ case MB_MUSER: error = copyin(source, dst, cplen); if (error) - return error; + return (error); break; case MB_MZERO: bzero(dst, cplen); @@ -246,7 +246,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_ } mbp->mb_cur = m; mbp->mb_mleft = mleft; - return 0; + return (0); } int @@ -261,7 +261,7 @@ mb_put_mbuf(struct mbchain *mbp, struct } mbp->mb_mleft = M_TRAILINGSPACE(m); mbp->mb_cur = m; - return 0; + return (0); } /* @@ -277,7 +277,7 @@ mb_put_uio(struct mbchain *mbp, struct u while (size > 0 && uiop->uio_resid) { if (uiop->uio_iovcnt <= 0 || uiop->uio_iov == NULL) - return EFBIG; + return (EFBIG); left = uiop->uio_iov->iov_len; if (left == 0) { uiop->uio_iov++; @@ -288,7 +288,7 @@ mb_put_uio(struct mbchain *mbp, struct u left = size; error = mb_put_mem(mbp, uiop->uio_iov->iov_base, left, mtype); if (error) - return error; + return (error); uiop->uio_offset += left; uiop->uio_resid -= left; uiop->uio_iov->iov_base = @@ -296,7 +296,7 @@ mb_put_uio(struct mbchain *mbp, struct u uiop->uio_iov->iov_len -= left; size -= left; } - return 0; + return (0); } /* @@ -310,7 +310,7 @@ md_init(struct mdchain *mdp) m = m_gethdr(M_WAIT, MT_DATA); m->m_len = 0; md_initm(mdp, m); - return 0; + return (0); } void @@ -360,25 +360,25 @@ md_next_record(struct mdchain *mdp) struct mbuf *m; if (mdp->md_top == NULL) - return ENOENT; + return (ENOENT); m = mdp->md_top->m_nextpkt; md_done(mdp); if (m == NULL) - return ENOENT; + return (ENOENT); md_initm(mdp, m); - return 0; + return (0); } int md_get_uint8(struct mdchain *mdp, uint8_t *x) { - return md_get_mem(mdp, x, 1, MB_MINLINE); + return (md_get_mem(mdp, x, 1, MB_MINLINE)); } int md_get_uint16(struct mdchain *mdp, uint16_t *x) { - return md_get_mem(mdp, (caddr_t)x, 2, MB_MINLINE); + return (md_get_mem(mdp, (caddr_t)x, 2, MB_MINLINE)); } int @@ -389,7 +389,7 @@ md_get_uint16le(struct mdchain *mdp, uin if (x != NULL) *x = le16toh(v); - return error; + return (error); } int @@ -400,13 +400,13 @@ md_get_uint16be(struct mdchain *mdp, uin if (x != NULL) *x = be16toh(v); - return error; + return (error); } int md_get_uint32(struct mdchain *mdp, uint32_t *x) { - return md_get_mem(mdp, (caddr_t)x, 4, MB_MINLINE); + return (md_get_mem(mdp, (caddr_t)x, 4, MB_MINLINE)); } int @@ -418,7 +418,7 @@ md_get_uint32be(struct mdchain *mdp, uin error = md_get_uint32(mdp, &v); if (x != NULL) *x = be32toh(v); - return error; + return (error); } int @@ -430,13 +430,13 @@ md_get_uint32le(struct mdchain *mdp, uin error = md_get_uint32(mdp, &v); if (x != NULL) *x = le32toh(v); - return error; + return (error); } int md_get_int64(struct mdchain *mdp, int64_t *x) { - return md_get_mem(mdp, (caddr_t)x, 8, MB_MINLINE); + return (md_get_mem(mdp, (caddr_t)x, 8, MB_MINLINE)); } int @@ -448,7 +448,7 @@ md_get_int64be(struct mdchain *mdp, int6 error = md_get_int64(mdp, &v); if (x != NULL) *x = be64toh(v); - return error; + return (error); } int @@ -460,7 +460,7 @@ md_get_int64le(struct mdchain *mdp, int6 error = md_get_int64(mdp, &v); if (x != NULL) *x = le64toh(v); - return error; + return (error); } int @@ -474,7 +474,7 @@ md_get_mem(struct mdchain *mdp, caddr_t while (size > 0) { if (m == NULL) { MBERROR("incomplete copy\n"); - return EBADRPC; + return (EBADRPC); } s = mdp->md_pos; count = mtod(m, u_char*) + m->m_len - s; @@ -506,7 +506,7 @@ md_get_mem(struct mdchain *mdp, caddr_t } target += count; } - return 0; + return (0); } int @@ -517,7 +517,7 @@ md_get_mbuf(struct mdchain *mdp, int siz rm = m_copym(m, mdp->md_pos - mtod(m, u_char*), size, M_WAIT); md_get_mem(mdp, NULL, size, MB_MZERO); *ret = rm; - return 0; + return (0); } int @@ -530,7 +530,7 @@ md_get_uio(struct mdchain *mdp, struct u mtype = (uiop->uio_segflg == UIO_SYSSPACE) ? MB_MSYSTEM : MB_MUSER; while (size > 0 && uiop->uio_resid) { if (uiop->uio_iovcnt <= 0 || uiop->uio_iov == NULL) - return EFBIG; + return (EFBIG); left = uiop->uio_iov->iov_len; if (left == 0) { uiop->uio_iov++; @@ -542,7 +542,7 @@ md_get_uio(struct mdchain *mdp, struct u left = size; error = md_get_mem(mdp, uiocp, left, mtype); if (error) - return error; + return (error); uiop->uio_offset += left; uiop->uio_resid -= left; uiop->uio_iov->iov_base = @@ -550,5 +550,5 @@ md_get_uio(struct mdchain *mdp, struct u uiop->uio_iov->iov_len -= left; size -= left; } - return 0; + return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 07:39:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9B51106564A; Mon, 6 Feb 2012 07:39:54 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6ED918FC15; Mon, 6 Feb 2012 07:39:53 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so6141252bkb.13 for ; Sun, 05 Feb 2012 23:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=V9qFGYI00/KfxgwblkohphIHs3hT2fmugMeHB6NixuY=; b=BVvYVNqcUOGmraH1tiH6eWEOjp5vN3wXQ9K3wSzBfflqXoqpBL5UdjYse63wxb1kuF wmSEctwWmyoPe8c8xkC8yUfX3+l94EWWGDni3yE7EmV5Fz8j3ubEnTMQZee8NwZ5LwC9 X0B6oKyKg9OzgDXiqwTtNK491NegnfLWWh/ew= Received: by 10.204.173.11 with SMTP id n11mr7904131bkz.120.1328513992428; Sun, 05 Feb 2012 23:39:52 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id sp6sm42640572bkb.2.2012.02.05.23.39.49 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 23:39:50 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek Organization: TOA Ukraine References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> Sender: Mikolaj Golub Date: Mon, 06 Feb 2012 09:39:47 +0200 In-Reply-To: <20120205214647.GI30033@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Sun, 5 Feb 2012 22:46:48 +0100") Message-ID: <86sjiov29o.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 07:39:54 -0000 --=-=-= On Sun, 5 Feb 2012 22:46:48 +0100 Pawel Jakub Dawidek wrote: PJD> On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: >> Ok, using hastd code as a reference :-) here is my implementation. PJD> - I'd not pass selected signals to the child. The parent can still be PJD> killed with a whole bunch of different signals that are not passed or PJD> cannot be caught or the child process handle them gracefully. PJD> Signals should be send to the PID from the pidfile anyway. If someone PJD> is sending signals to the parent he has no right to expect well PJD> behaviour from the parent. Well, sending a whole bunch of different signals to parent we might not expect right behavior, but why not to provide it for the "standard" ones? E.g. on shutdown init(8) will send SIGTERM and the daemon will gracefully exit terminating the child and cleaning up the pidfile. If the the child process does not handle SIGTERM gracefully I don't see much difference from having only this one process alive or two (with its monitoring daemon). The pidfile is seen in ps(1) output for the daemon process, which allows to identify the monitoring daemon with its child. Or we could change its proctitle to something like "daemon: cmdname[pid]", similar to what sshd does. So people would expect that terminating a daemon will terminate the process it monitors. PJD> - Now that we handle the pidfile fully in the parent, I'd move dropping PJD> provileges after fork(2) and pidfile_write(3). This way pidfiles will PJD> always be created with root privileges and we can forget about all the PJD> mess with pid directories, etc. PJD> - With the above you can wait for child to exit with simple wait(2). Yes, it looks like much simpler, see the attached patch. But I don't think I like it much as it still looks like a half measure to me. -- Mikolaj Golub --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=daemon.c.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231060) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -49,9 +50,9 @@ int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + int ch, nochdir, noclose, status; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; pidfile = user = NULL; @@ -79,43 +80,61 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - if (user != NULL) - restrict_process(user); + if (pidfile == NULL) { + /* + * This is a simple case. Daemonize and exec. + */ + if (daemon(nochdir, noclose) == -1) + err(1, NULL); + if (user != NULL) + restrict_process(user); + + execvp(argv[0], argv); + + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently */ - if (pidfile) { - pfh = pidfile_open(pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - errx(3, "process already running, pid: %d", - otherpid); - } - err(2, "pidfile ``%s''", pidfile); + pfh = pidfile_open(pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + otherpid); } + err(2, "pidfile ``%s''", pidfile); } if (daemon(nochdir, noclose) == -1) err(1, NULL); - /* Now that we are the child, write out the pid */ - if (pidfile) + pid = fork(); + if (pid == -1) { + pidfile_remove(pfh); + err(1, "fork"); + } + if (pid == 0) { + /* Now that we are the child, write out the pid. */ pidfile_write(pfh); - execvp(argv[0], argv); + if (user != NULL) + restrict_process(user); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error - */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) - pidfile_remove(pfh); + execvp(argv[0], argv); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + /* execvp() failed. */ + err(1, "%s", argv[0]); + } + (void)wait(&status); + pidfile_remove(pfh); + exit(0); } static void --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 08:28:21 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36089106564A; Mon, 6 Feb 2012 08:28:21 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC528FC14; Mon, 6 Feb 2012 08:28:20 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id DC39E924; Mon, 6 Feb 2012 09:28:18 +0100 (CET) Date: Mon, 6 Feb 2012 09:27:06 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120206082706.GA1324@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: <86sjiov29o.fsf@in138.ua3> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 08:28:21 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 09:39:47AM +0200, Mikolaj Golub wrote: >=20 > On Sun, 5 Feb 2012 22:46:48 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: > >> Ok, using hastd code as a reference :-) here is my implementation. >=20 > PJD> - I'd not pass selected signals to the child. The parent can still = be > PJD> killed with a whole bunch of different signals that are not passe= d or > PJD> cannot be caught or the child process handle them gracefully. > PJD> Signals should be send to the PID from the pidfile anyway. If som= eone > PJD> is sending signals to the parent he has no right to expect well > PJD> behaviour from the parent. >=20 > Well, sending a whole bunch of different signals to parent we might not e= xpect > right behavior, but why not to provide it for the "standard" ones? E.g. on > shutdown init(8) will send SIGTERM and the daemon will gracefully exit > terminating the child and cleaning up the pidfile. If the the child proce= ss > does not handle SIGTERM gracefully I don't see much difference from having > only this one process alive or two (with its monitoring daemon). >=20 > The pidfile is seen in ps(1) output for the daemon process, which allows = to > identify the monitoring daemon with its child. Or we could change its > proctitle to something like "daemon: cmdname[pid]", similar to what sshd = does. > So people would expect that terminating a daemon will terminate the proce= ss it > monitors. >=20 > PJD> - Now that we handle the pidfile fully in the parent, I'd move drop= ping > PJD> provileges after fork(2) and pidfile_write(3). This way pidfiles = will > PJD> always be created with root privileges and we can forget about al= l the > PJD> mess with pid directories, etc. >=20 > PJD> - With the above you can wait for child to exit with simple wait(2). >=20 > Yes, it looks like much simpler, see the attached patch. But I don't thin= k I > like it much as it still looks like a half measure to me. I like this approach much better, as it is just simpler, but it is your call, Mikolaj. For the patch itself. You don't have to have two separate cases depending on request for pidfile. You can specify NULL pfh to the pidfile functions. Even in example from the manual page when pfh is NULL there is a case where we warn, but continue execution and call pidfile functions. This should simplify the code. If you do that (actually even if you don't), remember to either use warn(3) before pidfile_remove(3) and exit(3) after or preserve errno before calling pidfile_remove(3), as pidfile_remove(3) can modify it if unlink(2) is unsuccessful or pfh is NULL. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --0F1p//8PRICkK4MW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8vjtoACgkQForvXbEpPzRTWwCfUaxD+cpq07A2KXKLwmhUOe0L GaIAoI5fnVF3erG5aeJmPa8ROu46e464 =p6W1 -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 08:50:20 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2422E106566B; Mon, 6 Feb 2012 08:50:20 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 9F52B8FC15; Mon, 6 Feb 2012 08:50:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id q168oHVs004274; Mon, 6 Feb 2012 12:50:17 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Mon, 6 Feb 2012 12:50:17 +0400 (MSK) From: Maxim Konovalov To: Gleb Smirnoff In-Reply-To: <201202051653.q15Gr3AB092056@svn.freebsd.org> Message-ID: References: <201202051653.q15Gr3AB092056@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r231025 - in head: share/man/man4 sys/netinet sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 08:50:20 -0000 On Sun, 5 Feb 2012, 16:53-0000, Gleb Smirnoff wrote: > Author: glebius > Date: Sun Feb 5 16:53:02 2012 > New Revision: 231025 > URL: http://svn.freebsd.org/changeset/base/231025 > > Log: > Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and > TCP_KEEPCNT, that allow to control initial timeout, idle time, idle > re-send interval and idle send count on a per-socket basis. > > Reviewed by: andre, bz, lstewart > Great, thanks! -- Maxim Konovalov From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 10:14:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0EE0106564A; Mon, 6 Feb 2012 10:14:07 +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 8F17C8FC16; Mon, 6 Feb 2012 10:14: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 q16AE7D6030993; Mon, 6 Feb 2012 10:14:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AE7XQ030991; Mon, 6 Feb 2012 10:14:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061014.q16AE7XQ030991@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 10:14:07 +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: r231068 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:14:07 -0000 Author: kib Date: Mon Feb 6 10:14:07 2012 New Revision: 231068 URL: http://svn.freebsd.org/changeset/base/231068 Log: MFC r230785: A debugger which requested PT_FOLLOW_FORK should get the notification about new child not only when doing PT_TO_SCX, but also for PT_CONTINUE. If TDB_FORK flag is set, always issue a stop, the same as is done for TDB_EXEC. Modified: stable/9/sys/kern/subr_syscall.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_syscall.c ============================================================================== --- stable/9/sys/kern/subr_syscall.c Mon Feb 6 09:05:12 2012 (r231067) +++ stable/9/sys/kern/subr_syscall.c Mon Feb 6 10:14:07 2012 (r231068) @@ -212,7 +212,8 @@ syscallret(struct thread *td, int error, * executes. If debugger requested tracing of syscall * returns, do it now too. */ - if (traced && ((td->td_dbgflags & TDB_EXEC) != 0 || + if (traced && + ((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 || (p->p_stops & S_PT_SCX) != 0)) ptracestop(td, SIGTRAP); td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 10:19:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40465106566C; Mon, 6 Feb 2012 10:19:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E6388FC13; Mon, 6 Feb 2012 10:19:19 +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 q16AJJ4n031265; Mon, 6 Feb 2012 10:19:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AJImk031263; Mon, 6 Feb 2012 10:19:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202061019.q16AJImk031263@svn.freebsd.org> From: Michael Tuexen Date: Mon, 6 Feb 2012 10:19: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: r231069 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:19:19 -0000 Author: tuexen Date: Mon Feb 6 10:19:18 2012 New Revision: 231069 URL: http://svn.freebsd.org/changeset/base/231069 Log: MFC r227655: Cleanup comparison of interface names. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Mon Feb 6 10:14:07 2012 (r231068) +++ stable/9/sys/netinet/sctp_pcb.c Mon Feb 6 10:19:18 2012 (r231069) @@ -331,19 +331,9 @@ sctp_mark_ifa_addr_down(uint32_t vrf_id, goto out; } if (if_name) { - int len1, len2; - - len1 = strlen(if_name); - len2 = strlen(sctp_ifap->ifn_p->ifn_name); - if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", - len1, len2); - goto out; - } - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) { + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, - if_name); + sctp_ifap->ifn_p->ifn_name, if_name); goto out; } } else { @@ -384,19 +374,9 @@ sctp_mark_ifa_addr_up(uint32_t vrf_id, s goto out; } if (if_name) { - int len1, len2; - - len1 = strlen(if_name); - len2 = strlen(sctp_ifap->ifn_p->ifn_name); - if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", - len1, len2); - goto out; - } - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) { + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, - if_name); + sctp_ifap->ifn_p->ifn_name, if_name); goto out; } } else { From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 10:22:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 140A7106566C; Mon, 6 Feb 2012 10:22:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 011C18FC08; Mon, 6 Feb 2012 10:22:51 +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 q16AMoZ7031445; Mon, 6 Feb 2012 10:22:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AMohM031434; Mon, 6 Feb 2012 10:22:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202061022.q16AMohM031434@svn.freebsd.org> From: Michael Tuexen Date: Mon, 6 Feb 2012 10:22:50 +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: r231070 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:22:51 -0000 Author: tuexen Date: Mon Feb 6 10:22:50 2012 New Revision: 231070 URL: http://svn.freebsd.org/changeset/base/231070 Log: MFC r227755: Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option. Retire the the now unused sctp_udp_tunneling_for_client_enable sysctl variable. Modified: stable/9/sys/netinet/sctp.h stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_pcb.h stable/9/sys/netinet/sctp_structs.h stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h stable/9/sys/netinet/sctp_uio.h stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp.h ============================================================================== --- stable/9/sys/netinet/sctp.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp.h Mon Feb 6 10:22:50 2012 (r231070) @@ -120,6 +120,7 @@ struct sctp_paramhdr { #define SCTP_DEFAULT_SNDINFO 0x00000021 #define SCTP_DEFAULT_PRINFO 0x00000022 #define SCTP_PEER_ADDR_THLDS 0x00000023 +#define SCTP_REMOTE_UDP_ENCAPS_PORT 0x00000024 /* * read-only options Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_output.c Mon Feb 6 10:22:50 2012 (r231070) @@ -4054,6 +4054,12 @@ sctp_lowlevel_chunk_output(struct sctp_i } } if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_handle_no_route(stcb, net, so_locked); + SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); + sctp_m_freem(m); + return (EHOSTUNREACH); + } udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -4405,6 +4411,12 @@ sctp_lowlevel_chunk_output(struct sctp_i ip6h->ip6_src = lsa6->sin6_addr; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_handle_no_route(stcb, net, so_locked); + SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); + sctp_m_freem(m); + return (EHOSTUNREACH); + } udp = (struct udphdr *)((caddr_t)ip6h + sizeof(struct ip6_hdr)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -10949,6 +10961,10 @@ sctp_send_shutdown_complete2(struct mbuf return; } if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp = (struct udphdr *)comp_cp; udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -11909,6 +11925,10 @@ sctp_send_abort(struct mbuf *m, int iphl udp = (struct udphdr *)abm; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; /* set udp->uh_ulen later */ @@ -12170,6 +12190,10 @@ sctp_send_operr_to(struct mbuf *m, int i udp = (struct udphdr *)sh_out; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; /* set udp->uh_ulen later */ Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_pcb.c Mon Feb 6 10:22:50 2012 (r231070) @@ -2651,6 +2651,7 @@ sctp_inpcb_alloc(struct socket *so, uint #ifdef INET6 m->default_flowlabel = 0; #endif + m->port = 0; /* encapsulation disabled by default */ sctp_auth_set_default_chunks(m->local_auth_chunks); LIST_INIT(&m->shared_keys); /* add default NULL key as key id 0 */ @@ -3990,13 +3991,9 @@ sctp_add_remote_addr(struct sctp_tcb *st net->RTO = 0; net->RTO_measured = 0; stcb->asoc.numnets++; - *(&net->ref_count) = 1; + net->ref_count = 1; net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; - if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { - net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); - } else { - net->port = 0; - } + net->port = stcb->asoc.port; net->dscp = stcb->asoc.default_dscp; #ifdef INET6 net->flowlabel = stcb->asoc.default_flowlabel; Modified: stable/9/sys/netinet/sctp_pcb.h ============================================================================== --- stable/9/sys/netinet/sctp_pcb.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_pcb.h Mon Feb 6 10:22:50 2012 (r231070) @@ -328,6 +328,7 @@ struct sctp_pcb { uint8_t default_dscp; char current_secret_number; char last_secret_number; + uint16_t port; /* remote UDP encapsulation port */ }; #ifndef SCTP_ALIGNMENT Modified: stable/9/sys/netinet/sctp_structs.h ============================================================================== --- stable/9/sys/netinet/sctp_structs.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_structs.h Mon Feb 6 10:22:50 2012 (r231070) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used as a bit mask */ +/* The upper byte is used a a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { @@ -1213,6 +1213,7 @@ struct sctp_association { uint8_t sctp_cmt_pf; uint8_t use_precise_time; uint32_t sctp_features; + uint16_t port; /* remote UDP encapsulation port */ /* * The mapping array is used to track out of order sequences above * last_acked_seq. 0 indicates packet missing 1 indicates packet Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_sysctl.c Mon Feb 6 10:22:50 2012 (r231070) @@ -122,7 +122,6 @@ sctp_init_sysctls() #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif - SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable) = SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = SCTPCTL_UDP_TUNNELING_PORT_DEFAULT; SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) = SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; @@ -665,10 +664,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), SCTPCTL_RTTVAR_DCCCECN_MIN, SCTPCTL_RTTVAR_DCCCECN_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); -/* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ -#if !defined(__FreeBSD__) || defined(INET) - RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); @@ -1085,10 +1080,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT /* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ #if !defined(__FreeBSD__) || defined(INET) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), 0, sysctl_sctp_check, "IU", - SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_sysctl.h Mon Feb 6 10:22:50 2012 (r231070) @@ -109,7 +109,6 @@ struct sctp_sysctl { #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_log sctp_log; #endif - uint32_t sctp_udp_tunneling_for_client_enable; uint32_t sctp_udp_tunneling_port; uint32_t sctp_enable_sack_immediately; uint32_t sctp_vtag_time_wait; @@ -458,12 +457,6 @@ struct sctp_sysctl { #define SCTPCTL_MOBILITY_FASTHANDOFF_MAX 1 #define SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT SCTP_DEFAULT_MOBILITY_FASTHANDOFF -/* Enable SCTP/UDP tunneling for clients*/ -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC "Enable SCTP/UDP tunneling for client" -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN 0 -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX 1 -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN - /* Enable SCTP/UDP tunneling port */ #define SCTPCTL_UDP_TUNNELING_PORT_DESC "Set the SCTP/UDP tunneling port" #define SCTPCTL_UDP_TUNNELING_PORT_MIN 0 Modified: stable/9/sys/netinet/sctp_uio.h ============================================================================== --- stable/9/sys/netinet/sctp_uio.h Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_uio.h Mon Feb 6 10:22:50 2012 (r231070) @@ -671,6 +671,12 @@ struct sctp_timeouts { uint32_t stimo_shutdownack; }; +struct sctp_udpencaps { + sctp_assoc_t sue_assoc_id; + struct sockaddr_storage sue_address; + uint16_t sue_port; +}; + struct sctp_cwnd_args { struct sctp_nets *net; /* network to *//* FIXME: LP64 issue */ uint32_t cwnd_new_value;/* cwnd in k */ Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctp_usrreq.c Mon Feb 6 10:22:50 2012 (r231070) @@ -3204,6 +3204,92 @@ flags_out: } break; } + case SCTP_REMOTE_UDP_ENCAPS_PORT: + { + struct sctp_udpencaps *encaps; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, *optsize); + SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); + + if (stcb) { + net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + } else { + /* + * We increment here since + * sctp_findassociation_ep_addr() wil do a + * decrement if it finds the stcb as long as + * the locked tcb (last argument) is NOT a + * TCB.. aka NULL. + */ + net = NULL; + SCTP_INP_INCR_REF(inp); + stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + if (stcb == NULL) { + SCTP_INP_DECR_REF(inp); + } + } + if (stcb && (net == NULL)) { + struct sockaddr *sa; + + sa = (struct sockaddr *)&encaps->sue_address; +#ifdef INET + if (sa->sa_family == AF_INET) { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)sa; + if (sin->sin_addr.s_addr) { + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } else +#endif +#ifdef INET6 + if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } else +#endif + { + error = EAFNOSUPPORT; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } + if (stcb) { + if (net) { + encaps->sue_port = net->port; + } else { + encaps->sue_port = stcb->asoc.port; + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + encaps->sue_port = inp->sctp_ep.port; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_paddrparams); + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; @@ -4522,7 +4608,6 @@ sctp_setopt(struct socket *so, int optna break; } case SCTP_PEER_ADDR_PARAMS: - /* Applies to the specific association */ { struct sctp_paddrparams *paddrp; struct sctp_nets *net; @@ -5580,6 +5665,89 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_REMOTE_UDP_ENCAPS_PORT: + { + struct sctp_udpencaps *encaps; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, optsize); + SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); + if (stcb) { + net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + } else { + /* + * We increment here since + * sctp_findassociation_ep_addr() wil do a + * decrement if it finds the stcb as long as + * the locked tcb (last argument) is NOT a + * TCB.. aka NULL. + */ + net = NULL; + SCTP_INP_INCR_REF(inp); + stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + if (stcb == NULL) { + SCTP_INP_DECR_REF(inp); + } + } + if (stcb && (net == NULL)) { + struct sockaddr *sa; + + sa = (struct sockaddr *)&encaps->sue_address; +#ifdef INET + if (sa->sa_family == AF_INET) { + + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)sa; + if (sin->sin_addr.s_addr) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + SCTP_TCB_UNLOCK(stcb); + error = EINVAL; + break; + } + } else +#endif +#ifdef INET6 + if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + SCTP_TCB_UNLOCK(stcb); + error = EINVAL; + break; + } + } else +#endif + { + error = EAFNOSUPPORT; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } + if (stcb) { + if (net) { + net->port = encaps->sue_port; + } else { + stcb->asoc.port = encaps->sue_port; + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + inp->sctp_ep.port = encaps->sue_port; + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Mon Feb 6 10:19:18 2012 (r231069) +++ stable/9/sys/netinet/sctputil.c Mon Feb 6 10:22:50 2012 (r231070) @@ -1105,6 +1105,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->authinfo.recv_keyid = 0; LIST_INIT(&asoc->shared_keys); asoc->marked_retrans = 0; + asoc->port = m->sctp_ep.port; asoc->timoinit = 0; asoc->timodata = 0; asoc->timosack = 0; From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 10:23:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D986106564A; Mon, 6 Feb 2012 10:23:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B6D68FC18; Mon, 6 Feb 2012 10:23: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 q16ANBPE031501; Mon, 6 Feb 2012 10:23:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16ANBCW031498; Mon, 6 Feb 2012 10:23:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202061023.q16ANBCW031498@svn.freebsd.org> From: Ed Schouten Date: Mon, 6 Feb 2012 10:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231071 - head/tools/tools/fixwhite X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:23:12 -0000 Author: ed Date: Mon Feb 6 10:23:11 2012 New Revision: 231071 URL: http://svn.freebsd.org/changeset/base/231071 Log: Add fixwhite(1). This small utility can be used to `sanitize' the whitespace in source code. It does the following things: Global: - Remove empty lines at the beginning and the end of a file. - Merge successive empty lines into a single empty line. Per-line: - Remove trailing whitespace. - Merge spaces preceeding tabs into the tabs. It operated on stdin/stdout. This means that if you use vi(1), you can just run :%!fixwhite to reorganize the file. Added: head/tools/tools/fixwhite/ head/tools/tools/fixwhite/Makefile (contents, props changed) head/tools/tools/fixwhite/fixwhite.1 (contents, props changed) head/tools/tools/fixwhite/fixwhite.c (contents, props changed) Added: head/tools/tools/fixwhite/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/fixwhite/Makefile Mon Feb 6 10:23:11 2012 (r231071) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= fixwhite +BINDIR= /usr/bin +WARNS= 6 + +.include Added: head/tools/tools/fixwhite/fixwhite.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/fixwhite/fixwhite.1 Mon Feb 6 10:23:11 2012 (r231071) @@ -0,0 +1,46 @@ +.\" Copyright (c) 2012 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 6, 2012 +.Dt FIXWHITE 1 +.Os +.Sh NAME +.Nm fixwhite +.Nd remove unneeded whitespace from text files +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +The +.Nm +utility removes unneeded whitespace from text passed to standard input +and prints the result to standard output. +.Pp +It removes leading and trailing empty lines from the input, as well as +trailing whitespace characters from ever line of text. +Multiple successive empty lines are merged together. +Also, spaces preceeding tabs will be merged into the tab character. +.Sh AUTHORS +.An Ed Schouten Aq ed@FreeBSD.org Added: head/tools/tools/fixwhite/fixwhite.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/fixwhite/fixwhite.c Mon Feb 6 10:23:11 2012 (r231071) @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 2012 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +static char *queue = NULL; +static size_t queuelen = 0, queuesize = 0; +static off_t column = 0; + +static void +savebyte(char c) +{ + + if (queuelen >= queuesize) { + queuesize += 128; + queue = realloc(queue, queuesize); + if (queue == NULL) { + perror("malloc"); + exit(1); + } + } + queue[queuelen++] = c; + + switch (c) { + case '\n': + column = 0; + break; + case ' ': + column++; + break; + case '\t': + column = (column / 8 + 1) * 8; + break; + } +} + +static bool +peekbyte(size_t back, char c) +{ + + return (queuelen >= back && queue[queuelen - back] == c); +} + +static void +savewhite(char c, bool leading) +{ + off_t ncolumn; + + switch (c) { + case '\n': + if (leading) { + /* Remove empty lines before input. */ + queuelen = 0; + column = 0; + } else { + /* Remove trailing whitespace. */ + while (peekbyte(1, ' ') || peekbyte(1, '\t')) + queuelen--; + /* Remove redundant empty lines. */ + if (peekbyte(2, '\n') && peekbyte(1, '\n')) + return; + savebyte('\n'); + } + break; + case ' ': + savebyte(' '); + break; + case '\t': + /* Convert preceeding spaces to tabs. */ + ncolumn = (column / 8 + 1) * 8; + while (peekbyte(1, ' ')) { + queuelen--; + column--; + } + while (column < ncolumn) + savebyte('\t'); + break; + } +} + +static void +printwhite(void) +{ + + if (fwrite(queue, 1, queuelen, stdout) != queuelen) { + perror("write"); + exit(1); + } + queuelen = 0; +} + +static char +readchar(void) +{ + int c; + + c = getchar(); + if (c == EOF && ferror(stdin)) { + perror("read"); + exit(1); + } + return (c); +} + +static void +writechar(char c) +{ + + if (putchar(c) == EOF) { + perror("write"); + exit(1); + } + /* XXX: Multi-byte characters. */ + column++; +} + +int +main(void) +{ + int c; + bool leading = true; + + while ((c = readchar()) != EOF) { + if (isspace(c)) + /* Save whitespace. */ + savewhite(c, leading); + else { + /* Reprint whitespace and print regular character. */ + printwhite(); + writechar(c); + leading = false; + } + } + /* Terminate non-empty files with a newline. */ + if (!leading) + writechar('\n'); + return (0); +} From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 10:35:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681D610656D0; Mon, 6 Feb 2012 10:35:22 +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 565A68FC0A; Mon, 6 Feb 2012 10:35: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 q16AZMNS031938; Mon, 6 Feb 2012 10:35:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AZMVK031936; Mon, 6 Feb 2012 10:35:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061035.q16AZMVK031936@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 10:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231072 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:35:22 -0000 Author: kib Date: Mon Feb 6 10:35:21 2012 New Revision: 231072 URL: http://svn.freebsd.org/changeset/base/231072 Log: MFC r230785: A debugger which requested PT_FOLLOW_FORK should get the notification about new child not only when doing PT_TO_SCX, but also for PT_CONTINUE. If TDB_FORK flag is set, always issue a stop, the same as is done for TDB_EXEC. Modified: stable/8/sys/kern/subr_syscall.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/subr_syscall.c ============================================================================== --- stable/8/sys/kern/subr_syscall.c Mon Feb 6 10:23:11 2012 (r231071) +++ stable/8/sys/kern/subr_syscall.c Mon Feb 6 10:35:21 2012 (r231072) @@ -194,7 +194,8 @@ syscallret(struct thread *td, int error, * executes. If debugger requested tracing of syscall * returns, do it now too. */ - if (traced && ((td->td_dbgflags & TDB_EXEC) != 0 || + if (traced && + ((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 || (p->p_stops & S_PT_SCX) != 0)) ptracestop(td, SIGTRAP); td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 10:38:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C39106566B; Mon, 6 Feb 2012 10:38:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0FFE8FC17; Mon, 6 Feb 2012 10:38: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 q16AcKnK032075; Mon, 6 Feb 2012 10:38:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AcKqg032073; Mon, 6 Feb 2012 10:38:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202061038.q16AcKqg032073@svn.freebsd.org> From: Michael Tuexen Date: Mon, 6 Feb 2012 10:38:20 +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: r231073 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:38:21 -0000 Author: tuexen Date: Mon Feb 6 10:38:20 2012 New Revision: 231073 URL: http://svn.freebsd.org/changeset/base/231073 Log: MFC r227931: Move up the address to the top of the sctp_udencaps structure like in all other structures. This avoids alignment problems. Modified: stable/9/sys/netinet/sctp_uio.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_uio.h ============================================================================== --- stable/9/sys/netinet/sctp_uio.h Mon Feb 6 10:35:21 2012 (r231072) +++ stable/9/sys/netinet/sctp_uio.h Mon Feb 6 10:38:20 2012 (r231073) @@ -672,8 +672,8 @@ struct sctp_timeouts { }; struct sctp_udpencaps { - sctp_assoc_t sue_assoc_id; struct sockaddr_storage sue_address; + sctp_assoc_t sue_assoc_id; uint16_t sue_port; }; From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 10:47:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68D98106564A; Mon, 6 Feb 2012 10:47:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57CD68FC08; Mon, 6 Feb 2012 10:47:13 +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 q16AlDAb032399; Mon, 6 Feb 2012 10:47:13 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AlD3Z032397; Mon, 6 Feb 2012 10:47:13 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202061047.q16AlD3Z032397@svn.freebsd.org> From: Michael Tuexen Date: Mon, 6 Feb 2012 10:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231074 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:47:13 -0000 Author: tuexen Date: Mon Feb 6 10:47:12 2012 New Revision: 231074 URL: http://svn.freebsd.org/changeset/base/231074 Log: Fix a typo which was already fixed by eadler in r227489. We missed to integrate this fix in our code base, so it was removed in r227755. MFC after: 3 days. Modified: head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon Feb 6 10:38:20 2012 (r231073) +++ head/sys/netinet/sctp_structs.h Mon Feb 6 10:47:12 2012 (r231074) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used a a bit mask */ +/* The upper byte is used as a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 11:04:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D978B1065670; Mon, 6 Feb 2012 11:04:36 +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 BE6198FC0C; Mon, 6 Feb 2012 11:04:36 +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 q16B4aMX032963; Mon, 6 Feb 2012 11:04:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16B4aSp032953; Mon, 6 Feb 2012 11:04:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061104.q16B4aSp032953@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 11:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231075 - in head/sys: fs/ext2fs fs/nfsclient geom/journal kern nfsclient sys ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:04:36 -0000 Author: kib Date: Mon Feb 6 11:04:36 2012 New Revision: 231075 URL: http://svn.freebsd.org/changeset/base/231075 Log: Current implementations of sync(2) and syncer vnode fsync() VOP uses mnt_noasync counter to temporary remove MNTK_ASYNC mount option, which is needed to guarantee a synchronous completion of the initiated i/o before syscall or VOP return. Global removal of MNTK_ASYNC option is harmful because not only i/o started from corresponding thread becomes synchronous, but all i/o is synchronous on the filesystem which is initiated during sync(2) or syncer activity. Instead of removing MNTK_ASYNC from mnt_kern_flag, provide a local thread flag to disable async i/o for current thread only. Use the opportunity to move DOINGASYNC() macro into sys/vnode.h and consistently use it through places which tested for MNTK_ASYNC. Some testing demonstrated 60-70% improvements in run time for the metadata-intensive operations on async-mounted UFS volumes, but still with great deviation due to other reasons. Reviewed by: mckusick Tested by: scottl MFC after: 2 weeks Modified: head/sys/fs/ext2fs/inode.h head/sys/fs/nfsclient/nfs_clvnops.c head/sys/geom/journal/g_journal.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/nfsclient/nfs_vnops.c head/sys/sys/proc.h head/sys/sys/vnode.h head/sys/ufs/ufs/inode.h Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/fs/ext2fs/inode.h Mon Feb 6 11:04:36 2012 (r231075) @@ -158,9 +158,6 @@ struct indir { #define VTOI(vp) ((struct inode *)(vp)->v_data) #define ITOV(ip) ((ip)->i_vnode) -/* Check whether the MNTK_ASYNC flag has been set for a mount point */ -#define DOINGASYNC(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) - /* This overlays the fid structure (see mount.h). */ struct ufid { uint16_t ufid_len; /* Length of structure. */ Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 11:04:36 2012 (r231075) @@ -1376,7 +1376,7 @@ ncl_writerpc(struct vnode *vp, struct ui if (ret && !error) error = ret; } - if (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) + if (DOINGASYNC(vp)) *iomode = NFSWRITE_FILESYNC; if (error && NFS_ISV4(vp)) error = nfscl_maperr(uiop->uio_td, error, (uid_t)0, (gid_t)0); Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/geom/journal/g_journal.c Mon Feb 6 11:04:36 2012 (r231075) @@ -2870,7 +2870,7 @@ g_journal_do_switch(struct g_class *clas struct mount *mp; struct bintime bt; char *mountpoint; - int error, vfslocked; + int error, save, vfslocked; DROP_GIANT(); g_topology_lock(); @@ -2932,10 +2932,7 @@ g_journal_do_switch(struct g_class *clas goto next; } - MNT_ILOCK(mp); - mp->mnt_noasync++; - mp->mnt_kern_flag &= ~MNTK_ASYNC; - MNT_IUNLOCK(mp); + save = curthread_pflags_set(TDP_SYNCIO); GJ_TIMER_START(1, &bt); vfs_msync(mp, MNT_NOWAIT); @@ -2950,11 +2947,7 @@ g_journal_do_switch(struct g_class *clas mountpoint, error); } - MNT_ILOCK(mp); - mp->mnt_noasync--; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) - mp->mnt_kern_flag |= MNTK_ASYNC; - MNT_IUNLOCK(mp); + curthread_pflags_restore(save); vn_finished_write(mp); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/kern/vfs_subr.c Mon Feb 6 11:04:36 2012 (r231075) @@ -3521,7 +3521,7 @@ sync_fsync(struct vop_fsync_args *ap) { struct vnode *syncvp = ap->a_vp; struct mount *mp = syncvp->v_mount; - int error; + int error, save; struct bufobj *bo; /* @@ -3551,17 +3551,10 @@ sync_fsync(struct vop_fsync_args *ap) vfs_unbusy(mp); return (0); } - MNT_ILOCK(mp); - mp->mnt_noasync++; - mp->mnt_kern_flag &= ~MNTK_ASYNC; - MNT_IUNLOCK(mp); + save = curthread_pflags_set(TDP_SYNCIO); vfs_msync(mp, MNT_NOWAIT); error = VFS_SYNC(mp, MNT_LAZY); - MNT_ILOCK(mp); - mp->mnt_noasync--; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) - mp->mnt_kern_flag |= MNTK_ASYNC; - MNT_IUNLOCK(mp); + curthread_pflags_restore(save); vn_finished_write(mp); vfs_unbusy(mp); return (error); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/kern/vfs_syscalls.c Mon Feb 6 11:04:36 2012 (r231075) @@ -134,7 +134,7 @@ sys_sync(td, uap) struct sync_args *uap; { struct mount *mp, *nmp; - int vfslocked; + int save, vfslocked; mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { @@ -145,18 +145,10 @@ sys_sync(td, uap) vfslocked = VFS_LOCK_GIANT(mp); if ((mp->mnt_flag & MNT_RDONLY) == 0 && vn_start_write(NULL, &mp, V_NOWAIT) == 0) { - MNT_ILOCK(mp); - mp->mnt_noasync++; - mp->mnt_kern_flag &= ~MNTK_ASYNC; - MNT_IUNLOCK(mp); + save = curthread_pflags_set(TDP_SYNCIO); vfs_msync(mp, MNT_NOWAIT); VFS_SYNC(mp, MNT_NOWAIT); - MNT_ILOCK(mp); - mp->mnt_noasync--; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && - mp->mnt_noasync == 0) - mp->mnt_kern_flag |= MNTK_ASYNC; - MNT_IUNLOCK(mp); + curthread_pflags_restore(save); vn_finished_write(mp); } VFS_UNLOCK_GIANT(vfslocked); Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/nfsclient/nfs_vnops.c Mon Feb 6 11:04:36 2012 (r231075) @@ -1448,7 +1448,7 @@ nfs_writerpc(struct vnode *vp, struct ui tsiz -= len; } nfsmout: - if (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) + if (DOINGASYNC(vp)) committed = NFSV3WRITE_FILESYNC; *iomode = committed; if (error) Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/sys/proc.h Mon Feb 6 11:04:36 2012 (r231075) @@ -400,7 +400,7 @@ do { \ #define TDP_NOSLEEPING 0x00000100 /* Thread is not allowed to sleep on a sq. */ #define TDP_OWEUPC 0x00000200 /* Call addupc() at next AST. */ #define TDP_ITHREAD 0x00000400 /* Thread is an interrupt thread. */ -#define TDP_UNUSED800 0x00000800 /* available. */ +#define TDP_SYNCIO 0x00000800 /* Local override, disable async i/o. */ #define TDP_SCHED1 0x00001000 /* Reserved for scheduler private use */ #define TDP_SCHED2 0x00002000 /* Reserved for scheduler private use */ #define TDP_SCHED3 0x00004000 /* Reserved for scheduler private use */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/sys/vnode.h Mon Feb 6 11:04:36 2012 (r231075) @@ -538,6 +538,10 @@ void assert_vop_unlocked(struct vnode *v */ #define VCALL(c) ((c)->a_desc->vdesc_call(c)) +#define DOINGASYNC(vp) \ + (((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) != 0 && \ + ((curthread->td_pflags & TDP_SYNCIO) == 0)) + /* * VMIO support inline */ Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/ufs/ufs/inode.h Mon Feb 6 11:04:36 2012 (r231075) @@ -176,7 +176,6 @@ struct indir { /* Determine if soft dependencies are being done */ #define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) #define MOUNTEDSOFTDEP(mp) ((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) -#define DOINGASYNC(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) #define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) #define MOUNTEDSUJ(mp) ((mp)->mnt_flag & MNT_SUJ) From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 11:34:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 453101065672; Mon, 6 Feb 2012 11:34:48 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id D369B8FC12; Mon, 6 Feb 2012 11:34:47 +0000 (UTC) Received: by yhfs35 with SMTP id s35so2932210yhf.13 for ; Mon, 06 Feb 2012 03:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=fm/jCDf52hOCIrOsVkq+EENPcSa3z2kMDK/YJr0GxVY=; b=PLyQbh6PmYsvxZMbU3uS4ewrIEO/fiXoUC878QgkD3r5YfIuhrIelu0RV3L/ZT/NzM uca6/SpFOlr8z5BdoDNLZ+hDtZr9tRMEbPP6Pz0SbE0In4Y4B8ToVeZC+4qJT8kW7d0s YbhtD2sf2QWN+1tEem3WqAitUmMhN1KEapTsc= Received: by 10.236.110.110 with SMTP id t74mr22122055yhg.121.1328528087129; Mon, 06 Feb 2012 03:34:47 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.100.121.14 with HTTP; Mon, 6 Feb 2012 03:34:06 -0800 (PST) In-Reply-To: <201202041649.q14GnUnI043572@svn.freebsd.org> References: <201202041649.q14GnUnI043572@svn.freebsd.org> From: Ivan Voras Date: Mon, 6 Feb 2012 12:34:06 +0100 X-Google-Sender-Auth: 5OksnqpGFU87L49c6xU41Pm6dlU Message-ID: To: Ryan Stone Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230984 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:34:48 -0000 On 4 February 2012 17:49, Ryan Stone wrote: > Author: rstone > Date: Sat Feb =C2=A04 16:49:29 2012 > New Revision: 230984 > URL: http://svn.freebsd.org/changeset/base/230984 > > Log: > =C2=A0Whenever a new kernel thread is spawned, explicitly clear any CPU a= ffinity > =C2=A0set on the new thread. =C2=A0This prevents the thread from inadvert= ently > =C2=A0inheriting affinity from a random sibling. Shouldn't new threads inherit affinity from the threads which spawned them? From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 11:35:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2096106564A; Mon, 6 Feb 2012 11:35:30 +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 85ACE8FC08; Mon, 6 Feb 2012 11:35: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 q16BZUEq033927; Mon, 6 Feb 2012 11:35:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16BZUY6033922; Mon, 6 Feb 2012 11:35:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202061135.q16BZUY6033922@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 Feb 2012 11:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231076 - in head: sbin/ipfw sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:35:30 -0000 Author: glebius Date: Mon Feb 6 11:35:29 2012 New Revision: 231076 URL: http://svn.freebsd.org/changeset/base/231076 Log: Make the 'tcpwin' option of ipfw(8) accept ranges and lists. Submitted by: sem Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Feb 6 11:04:36 2012 (r231075) +++ head/sbin/ipfw/ipfw.8 Mon Feb 6 11:35:29 2012 (r231076) @@ -1652,10 +1652,12 @@ option for details on matching fragmente TCP packets only. Match if the TCP header sequence number field is set to .Ar seq . -.It Cm tcpwin Ar win -TCP packets only. -Match if the TCP header window field is set to -.Ar win . +.It Cm tcpwin Ar tcpwin-list +Matches TCP packets whose header window field is set to +.Ar tcpwin-list , +which is either a single value or a list of values or ranges +specified in the same way as +.Ar ports . .It Cm tcpoptions Ar spec TCP packets only. Match if the TCP header contains the comma separated list of Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Feb 6 11:04:36 2012 (r231075) +++ head/sbin/ipfw/ipfw2.c Mon Feb 6 11:35:29 2012 (r231076) @@ -512,6 +512,7 @@ static struct _s_x _port_name[] = { {"ipttl", O_IPTTL}, {"mac-type", O_MAC_TYPE}, {"tcpdatalen", O_TCPDATALEN}, + {"tcpwin", O_TCPWIN}, {"tagged", O_TAGGED}, {NULL, 0} }; @@ -1480,7 +1481,11 @@ show_ipfw(struct ip_fw *rule, int pcwidt break; case O_TCPWIN: - printf(" tcpwin %d", ntohs(cmd->arg1)); + if (F_LEN(cmd) == 1) + printf(" tcpwin %u", cmd->arg1); + else + print_newports((ipfw_insn_u16 *)cmd, 0, + O_TCPWIN); break; case O_TCPACK: @@ -3447,8 +3452,12 @@ read_options: case TOK_TCPWIN: NEED1("tcpwin requires length"); - fill_cmd(cmd, O_TCPWIN, 0, - htons(strtoul(*av, NULL, 0))); + if (strpbrk(*av, "-,")) { + if (!add_ports(cmd, *av, 0, O_TCPWIN)) + errx(EX_DATAERR, "invalid tcpwin len %s", *av); + } else + fill_cmd(cmd, O_TCPWIN, 0, + strtoul(*av, NULL, 0)); av++; break; Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Mon Feb 6 11:04:36 2012 (r231075) +++ head/sys/netinet/ipfw/ip_fw2.c Mon Feb 6 11:35:29 2012 (r231076) @@ -1650,8 +1650,22 @@ do { \ break; case O_TCPWIN: - match = (proto == IPPROTO_TCP && offset == 0 && - cmd->arg1 == TCP(ulp)->th_win); + if (proto == IPPROTO_TCP && offset == 0) { + uint16_t x; + uint16_t *p; + int i; + + x = ntohs(TCP(ulp)->th_win); + if (cmdlen == 1) { + match = (cmd->arg1 == x); + break; + } + /* Otherwise we have ranges. */ + p = ((ipfw_insn_u16 *)cmd)->ports; + i = cmdlen - 1; + for (; !match && i > 0; i--, p += 2) + match = (x >= p[0] && x <= p[1]); + } break; case O_ESTAB: Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Mon Feb 6 11:04:36 2012 (r231075) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Mon Feb 6 11:35:29 2012 (r231076) @@ -569,7 +569,6 @@ check_ipfw_struct(struct ip_fw *rule, in case O_IPPRECEDENCE: case O_IPVER: case O_SOCKARG: - case O_TCPWIN: case O_TCPFLAGS: case O_TCPOPTS: case O_ESTAB: @@ -679,6 +678,7 @@ check_ipfw_struct(struct ip_fw *rule, in case O_IPTTL: case O_IPLEN: case O_TCPDATALEN: + case O_TCPWIN: case O_TAGGED: if (cmdlen < 1 || cmdlen > 31) goto bad_size; From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 11:47:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC862106566C; Mon, 6 Feb 2012 11:47:24 +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 CBB678FC16; Mon, 6 Feb 2012 11:47: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 q16BlOQa034304; Mon, 6 Feb 2012 11:47:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16BlODi034302; Mon, 6 Feb 2012 11:47:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061147.q16BlODi034302@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 11:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231077 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:47:25 -0000 Author: kib Date: Mon Feb 6 11:47:24 2012 New Revision: 231077 URL: http://svn.freebsd.org/changeset/base/231077 Log: JNEWBLK dependency may legitimately appear on the buf dependency list. If softdep_sync_buf() discovers such dependency, it should do nothing, which is safe as it is only waiting on the parent buffer to be written, so it can be removed. Committed on behalf of: jeff MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 11:35:29 2012 (r231076) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 11:47:24 2012 (r231077) @@ -12112,6 +12112,7 @@ top: case D_FREEWORK: case D_FREEDEP: case D_JSEGDEP: + case D_JNEWBLK: continue; default: From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 11:51:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92A79106564A; Mon, 6 Feb 2012 11:51:05 +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 67C488FC0C; Mon, 6 Feb 2012 11:51: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 q16Bp5F5034465; Mon, 6 Feb 2012 11:51:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16Bp51j034462; Mon, 6 Feb 2012 11:51:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202061151.q16Bp51j034462@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 Feb 2012 11:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231078 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:51:05 -0000 Author: glebius Date: Mon Feb 6 11:51:04 2012 New Revision: 231078 URL: http://svn.freebsd.org/changeset/base/231078 Log: Bump .Dd for r231076. Submitted by: bz Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Feb 6 11:47:24 2012 (r231077) +++ head/sbin/ipfw/ipfw.8 Mon Feb 6 11:51:04 2012 (r231078) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2011 +.Dd February 6, 2012 .Dt IPFW 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 12:03:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99C921065710; Mon, 6 Feb 2012 12:03:21 +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 884C58FC12; Mon, 6 Feb 2012 12:03: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 q16C3L6p034873; Mon, 6 Feb 2012 12:03:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16C3LO3034869; Mon, 6 Feb 2012 12:03:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202061203.q16C3LO3034869@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 Feb 2012 12:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231079 - head/usr.bin/rpcgen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 12:03:22 -0000 Author: dim Date: Mon Feb 6 12:03:21 2012 New Revision: 231079 URL: http://svn.freebsd.org/changeset/base/231079 Log: Let rpcgen(1) support an environment variable RPCGEN_CPP to find the C preprocessor to run. Previously, it always ran /usr/bin/cpp, unless you used the -Y option, and even then you could not set the basename. It also attempted to run /usr/ccs/lib/cpp for SVR4 compatibility, but this is obsolete, and has been removed. Note that setting RPCGEN_CPP to a command with arguments is supported, though the command line parsing is simplistic. However, setting it to e.g. "gcc46 -E" or "clang -E" will lead to problems, because both gcc and clang in -E mode will consider files with unknown extensions (such as .x) as object files, and attempt to link them. This could be worked around by also adding "-x c", but it is much safer to set RPCGEN_CPP to e.g. "cpp46" or "clang-cpp" instead. MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c head/usr.bin/rpcgen/rpcgen.1 Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 11:51:04 2012 (r231078) +++ head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 12:03:21 2012 (r231079) @@ -75,13 +75,8 @@ static void s_output(int, const char **, #define EXTEND 1 /* alias for TRUE */ #define DONT_EXTEND 0 /* alias for FALSE */ -#define SVR4_CPP "/usr/ccs/lib/cpp" -#define SUNOS_CPP "/usr/bin/cpp" - -static int cppDefined = 0; /* explicit path for C preprocessor */ - static const char *svcclosetime = "120"; -static const char *CPP = SVR4_CPP; +static const char *CPP = NULL; static const char CPPFLAGS[] = "-C"; static char pathbuf[MAXPATHLEN + 1]; static const char *allv[] = { @@ -97,7 +92,7 @@ static int allnc = sizeof (allnv)/sizeof * machinations for handling expanding argument list */ static void addarg(const char *); /* add another argument to the list */ -static void putarg(int, const char *); /* put argument at specified location */ +static void insarg(int, const char *); /* insert arg at specified location */ static void clear_args(void); /* clear argument list */ static void checkfiles(const char *, const char *); /* check if out file already exists */ @@ -105,7 +100,7 @@ static void checkfiles(const char *, con #define ARGLISTLEN 20 -#define FIXEDARGS 2 +#define FIXEDARGS 0 static char *arglist[ARGLISTLEN]; static int argcount = FIXEDARGS; @@ -288,24 +283,35 @@ clear_args(void) argcount = FIXEDARGS; } -/* make sure that a CPP exists */ +/* prepend C-preprocessor and flags before arguments */ static void -find_cpp(void) +prepend_cpp(void) { + int idx = 1; + const char *var; + char *dupvar, *s, *t; struct stat buf; - if (stat(CPP, &buf) < 0) { /* SVR4 or explicit cpp does not exist */ - if (cppDefined) { - warnx("cannot find C preprocessor: %s", CPP); - crash(); - } else { /* try the other one */ - CPP = SUNOS_CPP; - if (stat(CPP, &buf) < 0) { /* can't find any cpp */ - warnx("cannot find C preprocessor: %s", CPP); - crash(); - } + if (CPP != NULL) + insarg(0, CPP); + else if ((var = getenv("RPCGEN_CPP")) == NULL) + insarg(0, "/usr/bin/cpp"); + else { + /* Parse command line in a rudimentary way */ + dupvar = xstrdup(var); + for (s = dupvar, idx = 0; (t = strsep(&s, " \t")) != NULL; ) { + if (t[0]) + insarg(idx++, t); } + free(dupvar); } + + if (stat(arglist[0], &buf) < 0) { + warnx("cannot find C preprocessor: %s", arglist[0]); + crash(); + } + + insarg(idx, CPPFLAGS); } /* @@ -320,9 +326,7 @@ open_input(const char *infile, const cha (void) pipe(pd); switch (childpid = fork()) { case 0: - find_cpp(); - putarg(0, CPP); - putarg(1, CPPFLAGS); + prepend_cpp(); addarg(define); if (infile) addarg(infile); @@ -934,18 +938,26 @@ addarg(const char *cp) } +/* + * Insert an argument at the specified location + */ static void -putarg(int place, const char *cp) +insarg(int place, const char *cp) { - if (place >= ARGLISTLEN) { - warnx("arglist coding error"); + int i; + + if (argcount >= ARGLISTLEN) { + warnx("too many defines"); crash(); /*NOTREACHED*/ } - if (cp != NULL) - arglist[place] = xstrdup(cp); - else - arglist[place] = NULL; + + /* Move up existing arguments */ + for (i = argcount - 1; i > place; i--) + arglist[i + 1] = arglist[i]; + + arglist[place] = xstrdup(cp); + argcount++; } /* @@ -1134,7 +1146,6 @@ parseargs(int argc, const char *argv[], return (0); } CPP = pathbuf; - cppDefined = 1; goto nextarg; Modified: head/usr.bin/rpcgen/rpcgen.1 ============================================================================== --- head/usr.bin/rpcgen/rpcgen.1 Mon Feb 6 11:51:04 2012 (r231078) +++ head/usr.bin/rpcgen/rpcgen.1 Mon Feb 6 12:03:21 2012 (r231079) @@ -490,6 +490,11 @@ Give the name of the directory where .Nm will start looking for the C-preprocessor. .El +.Sh ENVIRONMENT +If the +.Ev RPCGEN_CPP +environment variable is set, its value is used as the command line of the +C preprocessor to be run on the input file. .Sh EXAMPLES The following example: .Dl example% rpcgen -T prot.x From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 12:08:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04265106566C; Mon, 6 Feb 2012 12:08:42 +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 E780D8FC12; Mon, 6 Feb 2012 12:08:41 +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 q16C8fMJ035133; Mon, 6 Feb 2012 12:08:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16C8fnU035131; Mon, 6 Feb 2012 12:08:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202061208.q16C8fnU035131@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 Feb 2012 12:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231080 - head/usr.bin/rpcgen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 12:08:42 -0000 Author: dim Date: Mon Feb 6 12:08:41 2012 New Revision: 231080 URL: http://svn.freebsd.org/changeset/base/231080 Log: Amend r231079 by properly shifting up the existing arguments in rpc_main.c's insarg() function. I had forgotten to put this in my patch queue, sorry. Pointy hat to: me MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 12:03:21 2012 (r231079) +++ head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 12:08:41 2012 (r231080) @@ -953,7 +953,7 @@ insarg(int place, const char *cp) } /* Move up existing arguments */ - for (i = argcount - 1; i > place; i--) + for (i = argcount - 1; i >= place; i--) arglist[i + 1] = arglist[i]; arglist[place] = xstrdup(cp); From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 13:08:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D6D7106564A; Mon, 6 Feb 2012 13:08:30 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 084808FC1C; Mon, 6 Feb 2012 13:08:29 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id q16D8Hkw062672; Mon, 6 Feb 2012 22:08:20 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Mon, 06 Feb 2012 22:07:21 +0900 (JST) Message-Id: <20120206.220721.343708041459090867.nyan@FreeBSD.org> To: nwhitehorn@freebsd.org From: TAKAHASHI Yoshihiro In-Reply-To: <4F2EA4F7.9010204@freebsd.org> References: <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> <20120128.193030.322386357550021613.nyan@FreeBSD.org> <4F2EA4F7.9010204@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Feb__6_22_07_21_2012_754)--" Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:08:30 -0000 ----Next_Part(Mon_Feb__6_22_07_21_2012_754)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit In article <4F2EA4F7.9010204@freebsd.org> Nathan Whitehorn writes: >>>>> TERM=xterm >>>> This code is also used on pc98, right? I think on pc98 we still need >>>> to >>>> use TERM=cons25w, to support Japanese character sets and keyboard >>>> input. >> How about the attached patch? > > The top half looks OK. The bottom half (the menu) is relevant only for > serial consoles. I guess people could be viewing a remote serial > console on a PC-98 graphics console, but then it shouldn't be > conditionalized on PC98 machines. Ok. I update the patch. --- TAKAHASHI Yoshihiro ----Next_Part(Mon_Feb__6_22_07_21_2012_754)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="a.diff" Index: src/release/rc.local =================================================================== RCS file: /home/ncvs/src/release/rc.local,v retrieving revision 1.6 diff -u -r1.6 rc.local --- src/release/rc.local 23 Jan 2012 16:17:54 -0000 1.6 +++ src/release/rc.local 6 Feb 2012 13:04:37 -0000 @@ -8,10 +8,16 @@ : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} +MACHINE=`uname -m` + kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then # Syscons: use xterm, start interesting things on other VTYs - TERM=xterm + if [ ${MACHINE} = "pc98" ]; then + TERM=cons25w + else + TERM=xterm + fi if [ -z "$EXTERNAL_VTY_STARTED" ]; then # Init will clean these processes up if/when the system @@ -31,6 +37,7 @@ echo " ansi Standard ANSI terminal" echo " vt100 VT100 or compatible terminal" echo " xterm xterm terminal emulator (or compatible)" + echo " cons25w cons25w terminal" echo echo -n "Console type [vt100]: " read TERM ----Next_Part(Mon_Feb__6_22_07_21_2012_754)---- From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 13:12:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49805106566B; Mon, 6 Feb 2012 13:12:31 +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 2D7D78FC0A; Mon, 6 Feb 2012 13:12:31 +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 q16DCVMS037146; Mon, 6 Feb 2012 13:12:31 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DCUep037142; Mon, 6 Feb 2012 13:12:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202061312.q16DCUep037142@svn.freebsd.org> From: Christian Brueffer Date: Mon, 6 Feb 2012 13:12:30 +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: r231081 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:12:31 -0000 Author: brueffer Date: Mon Feb 6 13:12:30 2012 New Revision: 231081 URL: http://svn.freebsd.org/changeset/base/231081 Log: MFC: r230787 Manpages for the buf_ring and drbr interfaces. Added: stable/9/share/man/man9/buf_ring.9 - copied unchanged from r230787, head/share/man/man9/buf_ring.9 stable/9/share/man/man9/drbr.9 - copied unchanged from r230787, head/share/man/man9/drbr.9 Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Mon Feb 6 12:08:41 2012 (r231080) +++ stable/9/share/man/man9/Makefile Mon Feb 6 13:12:30 2012 (r231081) @@ -12,6 +12,7 @@ MAN= accept_filter.9 \ boot.9 \ bpf.9 \ buf.9 \ + buf_ring.9 \ BUF_ISLOCKED.9 \ BUF_LOCK.9 \ BUF_LOCKFREE.9 \ @@ -99,6 +100,7 @@ MAN= accept_filter.9 \ devtoname.9 \ disk.9 \ domain.9 \ + drbr.9 \ driver.9 \ DRIVER_MODULE.9 \ EVENTHANDLER.9 \ @@ -408,6 +410,16 @@ MLINKS+=bpf.9 bpfattach.9 \ bpf.9 bpf_tap.9 \ bpf.9 bpf_validate.9 MLINKS+=buf.9 bp.9 +MLINKS+=buf_ring.9 buf_ring_alloc.9 \ + buf_ring.9 buf_ring_free.9 \ + buf_ring.9 buf_ring_enqueue.9 \ + buf_ring.9 buf_ring_enqueue_bytes.9 \ + buf_ring.9 buf_ring_dequeue_mc.9 \ + buf_ring.9 buf_ring_dequeue_sc.9 \ + buf_ring.9 buf_ring_count.9 \ + buf_ring.9 buf_ring_empty.9 \ + buf_ring.9 buf_ring_full.9 \ + buf_ring.9 buf_ring_peek.9 MLINKS+=bus_activate_resource.9 bus_deactivate_resource.9 MLINKS+=bus_alloc_resource.9 bus_alloc_resource_any.9 MLINKS+=BUS_BIND_INTR.9 bus_bind_intr.9 @@ -606,6 +618,14 @@ MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 pfctlinput2.9 \ domain.9 pffindproto.9 \ domain.9 pffindtype.9 +MLINKS+=drbr.9 drbr_free.9 \ + drbr.9 drbr_enqueue.9 \ + drbr.9 drbr_dequeue.9 \ + drbr.9 drbr_dequeue_cond.9 \ + drbr.9 drbr_flush.9 \ + drbr.9 drbr_empty.9 \ + drbr.9 drbr_inuse.9 \ + drbr.9 drbr_stats_update.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ EVENTHANDLER.9 eventhandler_deregister.9 \ Copied: stable/9/share/man/man9/buf_ring.9 (from r230787, head/share/man/man9/buf_ring.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man9/buf_ring.9 Mon Feb 6 13:12:30 2012 (r231081, copy of r230787, head/share/man/man9/buf_ring.9) @@ -0,0 +1,144 @@ +.\" Copyright (c) 2009 Bitgravity Inc +.\" Written by: Kip Macy +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 30, 2012 +.Dt BUF_RING 9 +.Os +.Sh NAME +.Nm buf_ring , +.Nm buf_ring_alloc , +.Nm buf_ring_free , +.Nm buf_ring_enqueue , +.Nm buf_ring_enqueue_bytes , +.Nm buf_ring_dequeue_mc , +.Nm buf_ring_dequeue_sc , +.Nm buf_ring_count , +.Nm buf_ring_empty , +.Nm buf_ring_full , +.Nm buf_ring_peek , +.Nd multi-producer, {single, multi}-consumer lock-less ring buffer +.Sh SYNOPSIS +.In sys/param.h +.In sys/buf_ring.h +.Ft struct buf_ring * +.Fn buf_ring_alloc "int count" "struct malloc_type *type" "int flags" "struct mtx *sc_lock" +.Ft void +.Fn buf_ring_free "struct buf_ring *br" "struct malloc_type *type" +.Ft int +.Fn buf_ring_enqueue "struct buf_ring *br" "void *buf" +.Ft int +.Fn buf_ring_enqueue_bytes "struct buf_ring *br" "void *buf" "int bytes" +.Ft void * +.Fn buf_ring_dequeue_mc "struct buf_ring *br" +.Ft void * +.Fn buf_ring_dequeue_sc "struct buf_ring *br" +.Ft int +.Fn buf_ring_count "struct buf_ring *br" +.Ft int +.Fn buf_ring_empty "struct buf_ring *br" +.Ft int +.Fn buf_ring_full "struct buf_ring *br" +.Ft void * +.Fn buf_ring_peek "struct buf_ring *br" +.Sh DESCRIPTION +The +.Nm +functions provide a lock-less multi-producer and lock-less multi-consumer as +well as single-consumer ring buffer. +.Pp +The +.Fn buf_ring_alloc +function is used to allocate a buf_ring ring buffer with +.Fa count +slots using malloc_type +.Fa type +and memory flags +.Fa flags . +The single consumer interface is protected by +.Fa sc_lock . +.Pp +The +.Fn buf_ring_free +function is used to free a buf_ring. +The user is responsible for freeing any enqueued items. +.Pp +The +.Fn buf_ring_enqueue +function is used to enqueue a buffer to a buf_ring. +.Pp +The +.Fn buf_ring_enqueue_bytes +function is used to enqueue a buffer to a buf_ring and increment the +number of bytes enqueued by +.Fa bytes . +.Pp +The +.Fn buf_ring_dequeue_mc +function is a multi-consumer safe way of dequeueing elements from a buf_ring. +.Pp +The +.Fn buf_ring_dequeue_sc +function is a single-consumer interface to dequeue elements - requiring +the user to serialize accesses with a lock. +.Pp +The +.Fn buf_ring_count +function returns the number of elements in a buf_ring. +.Pp +The +.Fn buf_ring_empty +function returns +.Dv TRUE +if the buf_ring is empty, +.Dv FALSE +otherwise. +.Pp +The +.Fn buf_ring_full +function returns +.Dv TRUE +if no more items can be enqueued, +.Dv FALSE +otherwise. +.Pp +The +.Fn buf_ring_peek +function returns a pointer to the last element in the buf_ring if the +buf_ring is not empty, +.Dv NULL +otherwise. +.Sh RETURN VALUES +The +.Fn buf_ring_enqueue +and +.Fn buf_ring_enqueue_bytes +functions return +.Er ENOBUFS +if there are no available slots in the buf_ring. +.Sh HISTORY +These functions were introduced in +.Fx 8.0 . Copied: stable/9/share/man/man9/drbr.9 (from r230787, head/share/man/man9/drbr.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man9/drbr.9 Mon Feb 6 13:12:30 2012 (r231081, copy of r230787, head/share/man/man9/drbr.9) @@ -0,0 +1,147 @@ +.\" Copyright (c) 2009 Bitgravity Inc +.\" Written by: Kip Macy +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 30, 2012 +.Dt DRBR 9 +.Os +.Sh NAME +.Nm drbr , +.Nm drbr_free , +.Nm drbr_enqueue , +.Nm drbr_dequeue , +.Nm drbr_dequeue_cond , +.Nm drbr_flush , +.Nm drbr_empty , +.Nm drbr_inuse , +.Nm drbr_stats_update , +.Nd network driver interface to buf_ring +.Sh SYNOPSIS +.In sys/param.h +.In net/if.h +.In net/if_var.h +.Ft void +.Fn drbr_free "struct buf_ring *br" "struct malloc_type *type" +.Ft int +.Fn drbr_enqueue "struct ifnet *ifp" "struct buf_ring *br" "struct mbuf *m" +.Ft struct mbuf * +.Fn drbr_dequeue "struct ifnet *ifp" "struct buf_ring *br" +.Ft struct mbuf * +.Fn drbr_dequeue_cond "struct ifnet *ifp" "struct buf_ring *br" "int (*func) (struct mbuf *, void *)" "void *arg" +.Ft void +.Fn drbr_flush "struct ifnet *ifp" "struct buf_ring *br" +.Ft int +.Fn drbr_empty "struct ifnet *ifp" "struct buf_ring *br" +.Ft int +.Fn drbr_inuse "struct ifnet *ifp" "struct buf_ring *br" +.Ft void +.Fn drbr_stats_update "struct ifnet *ifp" "int len" "int mflags" +.Sh DESCRIPTION +The +.Nm +functions provide an API to network drivers for using +.Xr buf_ring 9 +for enqueueing and dequeueing packets. +This is meant as a replacement for the IFQ interface for packet queuing. +It allows a packet to be enqueued with a single atomic and packet +dequeue to be done without any per-packet atomics as it is protected +by the driver's tx queue lock. +If +.Dv INVARIANTS +is enabled, +.Fn drbr_dequeue +will assert that the tx queue lock is held when it is called. +.Pp +The +.Fn drbr_free +function frees all the enqueued mbufs and then frees the buf_ring. +.Pp +The +.Fn drbr_enqueue +function is used to enqueue an mbuf to a buf_ring, falling back to the +ifnet's IFQ if +.Xr ALTQ 4 +is enabled. +.Pp +The +.Fn drbr_dequeue +function is used to dequeue an mbuf from a buf_ring or, if +.Xr ALTQ 4 +is enabled, from the ifnet's IFQ. +.Pp +The +.Fn drbr_dequeue_cond +function is used to conditionally dequeue an mbuf from a buf_ring based +on whether +.Fa func +returns +.Dv TRUE +or +.Dv FALSE . +.Pp +The +.Fn drbr_flush +function frees all mbufs enqueued in the buf_ring and the ifnet's IFQ. +.Pp +The +.Fn drbr_empty +function returns +.Dv TRUE +if there are no mbufs enqueued, +.Dv FALSE +otherwise. +.Pp +The +.Fn drbr_inuse +function returns the number of mbufs enqueued. +Note to users that this is intrinsically racy as there is no guarantee that +there will not be more mbufs when +.Fn drbr_dequeue +is actually called. +Provided the tx queue lock is held there will not be less. +.Pp +The +.Fn drbr_stats_update +function updates the number of bytes and the number of multicast packets sent. +.Sh RETURN VALUES +The +.Fn drbr_enqueue +function returns +.Er ENOBUFS +if there are no slots available in the buf_ring and +.Dv 0 +on success. +.Pp +The +.Fn drbr_dequeue +and +.Fn drbr_dequeue_cond +functions return an mbuf on success and +.Dv NULL +if the buf_ring is empty. +.Sh HISTORY +These functions were introduced in +.Fx 8.0 . From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 13:14:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A3D5106566C; Mon, 6 Feb 2012 13:14:26 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 783F88FC15; Mon, 6 Feb 2012 13:14: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 q16DEQbv037233; Mon, 6 Feb 2012 13:14:26 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DEQgF037232; Mon, 6 Feb 2012 13:14:26 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201202061314.q16DEQgF037232@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 6 Feb 2012 13:14:26 +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: r231082 - stable/9/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:14:26 -0000 Author: dumbbell Date: Mon Feb 6 13:14:26 2012 New Revision: 231082 URL: http://svn.freebsd.org/changeset/base/231082 Log: MFC r230211: sh: Test EXIT trap with multiple statements in it Reviewed by: jilles Added: stable/9/tools/regression/bin/sh/builtins/trap9.0 - copied unchanged from r230211, head/tools/regression/bin/sh/builtins/trap9.0 Modified: Directory Properties: stable/9/tools/ (props changed) stable/9/tools/regression/bin/sh/ (props changed) Copied: stable/9/tools/regression/bin/sh/builtins/trap9.0 (from r230211, head/tools/regression/bin/sh/builtins/trap9.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/trap9.0 Mon Feb 6 13:14:26 2012 (r231082, copy of r230211, head/tools/regression/bin/sh/builtins/trap9.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +test "$(trap 'printf trap; echo ped' EXIT; f() { :; }; f)" = trapped || exit 1 From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 13:17:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A67691065670; Mon, 6 Feb 2012 13:17:57 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9429B8FC1B; Mon, 6 Feb 2012 13:17:57 +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 q16DHvIS037396; Mon, 6 Feb 2012 13:17:57 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DHvSL037395; Mon, 6 Feb 2012 13:17:57 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201202061317.q16DHvSL037395@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 6 Feb 2012 13:17:57 +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: r231083 - stable/8/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:17:57 -0000 Author: dumbbell Date: Mon Feb 6 13:17:57 2012 New Revision: 231083 URL: http://svn.freebsd.org/changeset/base/231083 Log: MFC r230211: sh: Test EXIT trap with multiple statements in it Reviewed by: jilles Added: stable/8/tools/regression/bin/sh/builtins/trap9.0 - copied unchanged from r230211, head/tools/regression/bin/sh/builtins/trap9.0 Modified: Directory Properties: stable/8/tools/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/tools/regression/bin/sh/builtins/trap9.0 (from r230211, head/tools/regression/bin/sh/builtins/trap9.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/trap9.0 Mon Feb 6 13:17:57 2012 (r231083, copy of r230211, head/tools/regression/bin/sh/builtins/trap9.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +test "$(trap 'printf trap; echo ped' EXIT; f() { :; }; f)" = trapped || exit 1 From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 13:26:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B406106575F; Mon, 6 Feb 2012 13:26:13 +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 5F7D78FC18; Mon, 6 Feb 2012 13:26:13 +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 q16DQD9f037725; Mon, 6 Feb 2012 13:26:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DQDZv037721; Mon, 6 Feb 2012 13:26:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202061326.q16DQDZv037721@svn.freebsd.org> From: Christian Brueffer Date: Mon, 6 Feb 2012 13:26:13 +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: r231084 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:26:13 -0000 Author: brueffer Date: Mon Feb 6 13:26:12 2012 New Revision: 231084 URL: http://svn.freebsd.org/changeset/base/231084 Log: MFC: r230787 Manpages for the buf_ring and drbr interfaces. Added: stable/8/share/man/man9/buf_ring.9 - copied unchanged from r230787, head/share/man/man9/buf_ring.9 stable/8/share/man/man9/drbr.9 - copied unchanged from r230787, head/share/man/man9/drbr.9 Modified: stable/8/share/man/man9/Makefile Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Feb 6 13:17:57 2012 (r231083) +++ stable/8/share/man/man9/Makefile Mon Feb 6 13:26:12 2012 (r231084) @@ -13,6 +13,7 @@ MAN= accept_filter.9 \ boot.9 \ bpf.9 \ buf.9 \ + buf_ring.9 \ BUF_ISLOCKED.9 \ BUF_LOCK.9 \ BUF_LOCKFREE.9 \ @@ -100,6 +101,7 @@ MAN= accept_filter.9 \ devtoname.9 \ disk.9 \ domain.9 \ + drbr.9 \ driver.9 \ DRIVER_MODULE.9 \ EVENTHANDLER.9 \ @@ -408,6 +410,16 @@ MLINKS+=bpf.9 bpf_filter.9 \ bpf.9 bpfattach2.9 \ bpf.9 bpfdetach.9 MLINKS+=buf.9 bp.9 +MLINKS+=buf_ring.9 buf_ring_alloc.9 \ + buf_ring.9 buf_ring_free.9 \ + buf_ring.9 buf_ring_enqueue.9 \ + buf_ring.9 buf_ring_enqueue_bytes.9 \ + buf_ring.9 buf_ring_dequeue_mc.9 \ + buf_ring.9 buf_ring_dequeue_sc.9 \ + buf_ring.9 buf_ring_count.9 \ + buf_ring.9 buf_ring_empty.9 \ + buf_ring.9 buf_ring_full.9 \ + buf_ring.9 buf_ring_peek.9 MLINKS+=bus_activate_resource.9 bus_deactivate_resource.9 MLINKS+=bus_alloc_resource.9 bus_alloc_resource_any.9 MLINKS+=BUS_BIND_INTR.9 bus_bind_intr.9 @@ -605,6 +617,14 @@ MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 pffindproto.9 \ domain.9 pffindtype.9 MLINKS+=DRIVER_MODULE.9 MULTI_DRIVER_MODULE.9 +MLINKS+=drbr.9 drbr_free.9 \ + drbr.9 drbr_enqueue.9 \ + drbr.9 drbr_dequeue.9 \ + drbr.9 drbr_dequeue_cond.9 \ + drbr.9 drbr_flush.9 \ + drbr.9 drbr_empty.9 \ + drbr.9 drbr_inuse.9 \ + drbr.9 drbr_stats_update.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ EVENTHANDLER.9 eventhandler_deregister.9 \ Copied: stable/8/share/man/man9/buf_ring.9 (from r230787, head/share/man/man9/buf_ring.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man9/buf_ring.9 Mon Feb 6 13:26:12 2012 (r231084, copy of r230787, head/share/man/man9/buf_ring.9) @@ -0,0 +1,144 @@ +.\" Copyright (c) 2009 Bitgravity Inc +.\" Written by: Kip Macy +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 30, 2012 +.Dt BUF_RING 9 +.Os +.Sh NAME +.Nm buf_ring , +.Nm buf_ring_alloc , +.Nm buf_ring_free , +.Nm buf_ring_enqueue , +.Nm buf_ring_enqueue_bytes , +.Nm buf_ring_dequeue_mc , +.Nm buf_ring_dequeue_sc , +.Nm buf_ring_count , +.Nm buf_ring_empty , +.Nm buf_ring_full , +.Nm buf_ring_peek , +.Nd multi-producer, {single, multi}-consumer lock-less ring buffer +.Sh SYNOPSIS +.In sys/param.h +.In sys/buf_ring.h +.Ft struct buf_ring * +.Fn buf_ring_alloc "int count" "struct malloc_type *type" "int flags" "struct mtx *sc_lock" +.Ft void +.Fn buf_ring_free "struct buf_ring *br" "struct malloc_type *type" +.Ft int +.Fn buf_ring_enqueue "struct buf_ring *br" "void *buf" +.Ft int +.Fn buf_ring_enqueue_bytes "struct buf_ring *br" "void *buf" "int bytes" +.Ft void * +.Fn buf_ring_dequeue_mc "struct buf_ring *br" +.Ft void * +.Fn buf_ring_dequeue_sc "struct buf_ring *br" +.Ft int +.Fn buf_ring_count "struct buf_ring *br" +.Ft int +.Fn buf_ring_empty "struct buf_ring *br" +.Ft int +.Fn buf_ring_full "struct buf_ring *br" +.Ft void * +.Fn buf_ring_peek "struct buf_ring *br" +.Sh DESCRIPTION +The +.Nm +functions provide a lock-less multi-producer and lock-less multi-consumer as +well as single-consumer ring buffer. +.Pp +The +.Fn buf_ring_alloc +function is used to allocate a buf_ring ring buffer with +.Fa count +slots using malloc_type +.Fa type +and memory flags +.Fa flags . +The single consumer interface is protected by +.Fa sc_lock . +.Pp +The +.Fn buf_ring_free +function is used to free a buf_ring. +The user is responsible for freeing any enqueued items. +.Pp +The +.Fn buf_ring_enqueue +function is used to enqueue a buffer to a buf_ring. +.Pp +The +.Fn buf_ring_enqueue_bytes +function is used to enqueue a buffer to a buf_ring and increment the +number of bytes enqueued by +.Fa bytes . +.Pp +The +.Fn buf_ring_dequeue_mc +function is a multi-consumer safe way of dequeueing elements from a buf_ring. +.Pp +The +.Fn buf_ring_dequeue_sc +function is a single-consumer interface to dequeue elements - requiring +the user to serialize accesses with a lock. +.Pp +The +.Fn buf_ring_count +function returns the number of elements in a buf_ring. +.Pp +The +.Fn buf_ring_empty +function returns +.Dv TRUE +if the buf_ring is empty, +.Dv FALSE +otherwise. +.Pp +The +.Fn buf_ring_full +function returns +.Dv TRUE +if no more items can be enqueued, +.Dv FALSE +otherwise. +.Pp +The +.Fn buf_ring_peek +function returns a pointer to the last element in the buf_ring if the +buf_ring is not empty, +.Dv NULL +otherwise. +.Sh RETURN VALUES +The +.Fn buf_ring_enqueue +and +.Fn buf_ring_enqueue_bytes +functions return +.Er ENOBUFS +if there are no available slots in the buf_ring. +.Sh HISTORY +These functions were introduced in +.Fx 8.0 . Copied: stable/8/share/man/man9/drbr.9 (from r230787, head/share/man/man9/drbr.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man9/drbr.9 Mon Feb 6 13:26:12 2012 (r231084, copy of r230787, head/share/man/man9/drbr.9) @@ -0,0 +1,147 @@ +.\" Copyright (c) 2009 Bitgravity Inc +.\" Written by: Kip Macy +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 30, 2012 +.Dt DRBR 9 +.Os +.Sh NAME +.Nm drbr , +.Nm drbr_free , +.Nm drbr_enqueue , +.Nm drbr_dequeue , +.Nm drbr_dequeue_cond , +.Nm drbr_flush , +.Nm drbr_empty , +.Nm drbr_inuse , +.Nm drbr_stats_update , +.Nd network driver interface to buf_ring +.Sh SYNOPSIS +.In sys/param.h +.In net/if.h +.In net/if_var.h +.Ft void +.Fn drbr_free "struct buf_ring *br" "struct malloc_type *type" +.Ft int +.Fn drbr_enqueue "struct ifnet *ifp" "struct buf_ring *br" "struct mbuf *m" +.Ft struct mbuf * +.Fn drbr_dequeue "struct ifnet *ifp" "struct buf_ring *br" +.Ft struct mbuf * +.Fn drbr_dequeue_cond "struct ifnet *ifp" "struct buf_ring *br" "int (*func) (struct mbuf *, void *)" "void *arg" +.Ft void +.Fn drbr_flush "struct ifnet *ifp" "struct buf_ring *br" +.Ft int +.Fn drbr_empty "struct ifnet *ifp" "struct buf_ring *br" +.Ft int +.Fn drbr_inuse "struct ifnet *ifp" "struct buf_ring *br" +.Ft void +.Fn drbr_stats_update "struct ifnet *ifp" "int len" "int mflags" +.Sh DESCRIPTION +The +.Nm +functions provide an API to network drivers for using +.Xr buf_ring 9 +for enqueueing and dequeueing packets. +This is meant as a replacement for the IFQ interface for packet queuing. +It allows a packet to be enqueued with a single atomic and packet +dequeue to be done without any per-packet atomics as it is protected +by the driver's tx queue lock. +If +.Dv INVARIANTS +is enabled, +.Fn drbr_dequeue +will assert that the tx queue lock is held when it is called. +.Pp +The +.Fn drbr_free +function frees all the enqueued mbufs and then frees the buf_ring. +.Pp +The +.Fn drbr_enqueue +function is used to enqueue an mbuf to a buf_ring, falling back to the +ifnet's IFQ if +.Xr ALTQ 4 +is enabled. +.Pp +The +.Fn drbr_dequeue +function is used to dequeue an mbuf from a buf_ring or, if +.Xr ALTQ 4 +is enabled, from the ifnet's IFQ. +.Pp +The +.Fn drbr_dequeue_cond +function is used to conditionally dequeue an mbuf from a buf_ring based +on whether +.Fa func +returns +.Dv TRUE +or +.Dv FALSE . +.Pp +The +.Fn drbr_flush +function frees all mbufs enqueued in the buf_ring and the ifnet's IFQ. +.Pp +The +.Fn drbr_empty +function returns +.Dv TRUE +if there are no mbufs enqueued, +.Dv FALSE +otherwise. +.Pp +The +.Fn drbr_inuse +function returns the number of mbufs enqueued. +Note to users that this is intrinsically racy as there is no guarantee that +there will not be more mbufs when +.Fn drbr_dequeue +is actually called. +Provided the tx queue lock is held there will not be less. +.Pp +The +.Fn drbr_stats_update +function updates the number of bytes and the number of multicast packets sent. +.Sh RETURN VALUES +The +.Fn drbr_enqueue +function returns +.Er ENOBUFS +if there are no slots available in the buf_ring and +.Dv 0 +on success. +.Pp +The +.Fn drbr_dequeue +and +.Fn drbr_dequeue_cond +functions return an mbuf on success and +.Dv NULL +if the buf_ring is empty. +.Sh HISTORY +These functions were introduced in +.Fx 8.0 . From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 13:29:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D0DE106566B; Mon, 6 Feb 2012 13:29:51 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69EF48FC17; Mon, 6 Feb 2012 13:29:51 +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 q16DTphZ037870; Mon, 6 Feb 2012 13:29:51 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16DTp3v037863; Mon, 6 Feb 2012 13:29:51 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201202061329.q16DTp3v037863@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 6 Feb 2012 13:29:51 +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: r231085 - in stable/9: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:29:51 -0000 Author: dumbbell Date: Mon Feb 6 13:29:50 2012 New Revision: 231085 URL: http://svn.freebsd.org/changeset/base/231085 Log: MFC r230212: sh: Fix execution of multiple statements in a trap when evalskip is set Before this fix, only the first statement of the trap was executed if evalskip was set. This is for example the case when: o "-e" is set for this shell o a trap is set on EXIT o a function returns 1 and causes the script to abort Reviewed by: jilles Sponsored by: Yakaz (http://www.yakaz.com) Added: stable/9/tools/regression/bin/sh/builtins/trap10.0 - copied unchanged from r230212, head/tools/regression/bin/sh/builtins/trap10.0 stable/9/tools/regression/bin/sh/builtins/trap11.0 - copied unchanged from r230212, head/tools/regression/bin/sh/builtins/trap11.0 Modified: stable/9/bin/sh/eval.c stable/9/bin/sh/eval.h stable/9/bin/sh/trap.c Directory Properties: stable/9/bin/sh/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/bin/sh/ (props changed) Modified: stable/9/bin/sh/eval.c ============================================================================== --- stable/9/bin/sh/eval.c Mon Feb 6 13:26:12 2012 (r231084) +++ stable/9/bin/sh/eval.c Mon Feb 6 13:29:50 2012 (r231085) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); int evalskip; /* set if we are skipping commands */ -static int skipcount; /* number of levels to skip */ +int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ static int builtin_flags; /* evalcommand flags for builtins */ Modified: stable/9/bin/sh/eval.h ============================================================================== --- stable/9/bin/sh/eval.h Mon Feb 6 13:26:12 2012 (r231084) +++ stable/9/bin/sh/eval.h Mon Feb 6 13:29:50 2012 (r231085) @@ -60,6 +60,7 @@ void evalbackcmd(union node *, struct ba #define in_function() funcnest extern int funcnest; extern int evalskip; +extern int skipcount; /* reasons for skipping commands (see comment on breakcmd routine) */ #define SKIPBREAK 1 Modified: stable/9/bin/sh/trap.c ============================================================================== --- stable/9/bin/sh/trap.c Mon Feb 6 13:26:12 2012 (r231084) +++ stable/9/bin/sh/trap.c Mon Feb 6 13:29:50 2012 (r231085) @@ -412,7 +412,7 @@ void dotrap(void) { int i; - int savestatus; + int savestatus, prev_evalskip, prev_skipcount; in_dotrap++; for (;;) { @@ -427,10 +427,36 @@ dotrap(void) */ if (i == SIGCHLD) ignore_sigchld++; + + /* + * Backup current evalskip + * state and reset it before + * executing a trap, so that the + * trap is not disturbed by an + * ongoing break/continue/return + * statement. + */ + prev_evalskip = evalskip; + prev_skipcount = skipcount; + evalskip = 0; + last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); exitstatus = savestatus; + + /* + * If such a command was not + * already in progress, allow a + * break/continue/return in the + * trap action to have an effect + * outside of it. + */ + if (prev_evalskip != 0) { + evalskip = prev_evalskip; + skipcount = prev_skipcount; + } + if (i == SIGCHLD) ignore_sigchld--; } @@ -501,6 +527,11 @@ exitshell_savedstatus(void) } handler = &loc1; if ((p = trap[0]) != NULL && *p != '\0') { + /* + * Reset evalskip, or the trap on EXIT could be + * interrupted if the last command was a "return". + */ + evalskip = 0; trap[0] = NULL; evalstring(p, 0); } Copied: stable/9/tools/regression/bin/sh/builtins/trap10.0 (from r230212, head/tools/regression/bin/sh/builtins/trap10.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/trap10.0 Mon Feb 6 13:29:50 2012 (r231085, copy of r230212, head/tools/regression/bin/sh/builtins/trap10.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +# Check that the return statement will not break the EXIT trap, ie. all +# trap commands are executed before the script exits. + +test "$(trap 'printf trap; echo ped' EXIT; f() { return; }; f)" = trapped || exit 1 Copied: stable/9/tools/regression/bin/sh/builtins/trap11.0 (from r230212, head/tools/regression/bin/sh/builtins/trap11.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/trap11.0 Mon Feb 6 13:29:50 2012 (r231085, copy of r230212, head/tools/regression/bin/sh/builtins/trap11.0) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +# Check that the return statement will not break the USR1 trap, ie. all +# trap commands are executed before the script resumes. + +result=$(${SH} -c 'trap "printf trap; echo ped" USR1; f() { return $(kill -USR1 $$); }; f') +test $? -eq 0 || exit 1 +test "$result" = trapped || exit 1 From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 13:36:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79184106564A; Mon, 6 Feb 2012 13:36:50 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 660ED8FC16; Mon, 6 Feb 2012 13:36:50 +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 q16DaonI038146; Mon, 6 Feb 2012 13:36:50 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16Dao8R038140; Mon, 6 Feb 2012 13:36:50 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201202061336.q16Dao8R038140@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 6 Feb 2012 13:36:50 +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: r231086 - in stable/8: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:36:50 -0000 Author: dumbbell Date: Mon Feb 6 13:36:49 2012 New Revision: 231086 URL: http://svn.freebsd.org/changeset/base/231086 Log: MFC r230212: sh: Fix execution of multiple statements in a trap when evalskip is set Before this fix, only the first statement of the trap was executed if evalskip was set. This is for example the case when: o "-e" is set for this shell o a trap is set on EXIT o a function returns 1 and causes the script to abort Reviewed by: jilles Sponsored by: Yakaz (http://www.yakaz.com) Added: stable/8/tools/regression/bin/sh/builtins/trap10.0 - copied unchanged from r230212, head/tools/regression/bin/sh/builtins/trap10.0 stable/8/tools/regression/bin/sh/builtins/trap11.0 - copied unchanged from r230212, head/tools/regression/bin/sh/builtins/trap11.0 Modified: stable/8/bin/sh/eval.c stable/8/bin/sh/eval.h stable/8/bin/sh/trap.c Directory Properties: stable/8/bin/sh/ (props changed) stable/8/tools/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) Modified: stable/8/bin/sh/eval.c ============================================================================== --- stable/8/bin/sh/eval.c Mon Feb 6 13:29:50 2012 (r231085) +++ stable/8/bin/sh/eval.c Mon Feb 6 13:36:49 2012 (r231086) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); int evalskip; /* set if we are skipping commands */ -static int skipcount; /* number of levels to skip */ +int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ static int builtin_flags; /* evalcommand flags for builtins */ Modified: stable/8/bin/sh/eval.h ============================================================================== --- stable/8/bin/sh/eval.h Mon Feb 6 13:29:50 2012 (r231085) +++ stable/8/bin/sh/eval.h Mon Feb 6 13:36:49 2012 (r231086) @@ -69,6 +69,7 @@ int commandcmd(int, char **); #define in_function() funcnest extern int funcnest; extern int evalskip; +extern int skipcount; /* reasons for skipping commands (see comment on breakcmd routine) */ #define SKIPBREAK 1 Modified: stable/8/bin/sh/trap.c ============================================================================== --- stable/8/bin/sh/trap.c Mon Feb 6 13:29:50 2012 (r231085) +++ stable/8/bin/sh/trap.c Mon Feb 6 13:36:49 2012 (r231086) @@ -415,7 +415,7 @@ void dotrap(void) { int i; - int savestatus; + int savestatus, prev_evalskip, prev_skipcount; in_dotrap++; for (;;) { @@ -430,9 +430,35 @@ dotrap(void) */ if (i == SIGCHLD) ignore_sigchld++; + + /* + * Backup current evalskip + * state and reset it before + * executing a trap, so that the + * trap is not disturbed by an + * ongoing break/continue/return + * statement. + */ + prev_evalskip = evalskip; + prev_skipcount = skipcount; + evalskip = 0; + savestatus = exitstatus; evalstring(trap[i], 0); exitstatus = savestatus; + + /* + * If such a command was not + * already in progress, allow a + * break/continue/return in the + * trap action to have an effect + * outside of it. + */ + if (prev_evalskip != 0) { + evalskip = prev_evalskip; + skipcount = prev_skipcount; + } + if (i == SIGCHLD) ignore_sigchld--; } @@ -485,6 +511,11 @@ exitshell(int status) } handler = &loc1; if ((p = trap[0]) != NULL && *p != '\0') { + /* + * Reset evalskip, or the trap on EXIT could be + * interrupted if the last command was a "return". + */ + evalskip = 0; trap[0] = NULL; evalstring(p, 0); } Copied: stable/8/tools/regression/bin/sh/builtins/trap10.0 (from r230212, head/tools/regression/bin/sh/builtins/trap10.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/trap10.0 Mon Feb 6 13:36:49 2012 (r231086, copy of r230212, head/tools/regression/bin/sh/builtins/trap10.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +# Check that the return statement will not break the EXIT trap, ie. all +# trap commands are executed before the script exits. + +test "$(trap 'printf trap; echo ped' EXIT; f() { return; }; f)" = trapped || exit 1 Copied: stable/8/tools/regression/bin/sh/builtins/trap11.0 (from r230212, head/tools/regression/bin/sh/builtins/trap11.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/trap11.0 Mon Feb 6 13:36:49 2012 (r231086, copy of r230212, head/tools/regression/bin/sh/builtins/trap11.0) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +# Check that the return statement will not break the USR1 trap, ie. all +# trap commands are executed before the script resumes. + +result=$(${SH} -c 'trap "printf trap; echo ped" USR1; f() { return $(kill -USR1 $$); }; f') +test $? -eq 0 || exit 1 +test "$result" = trapped || exit 1 From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 14:11:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F9D6106566B; Mon, 6 Feb 2012 14:11:24 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E89C8FC08; Mon, 6 Feb 2012 14:11: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 q16EBOx7039271; Mon, 6 Feb 2012 14:11:24 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16EBOwt039268; Mon, 6 Feb 2012 14:11:24 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201202061411.q16EBOwt039268@svn.freebsd.org> From: Guy Helmer Date: Mon, 6 Feb 2012 14:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231087 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:11:24 -0000 Author: ghelmer Date: Mon Feb 6 14:11:24 2012 New Revision: 231087 URL: http://svn.freebsd.org/changeset/base/231087 Log: Using the O_CLOEXEC flag on open(2) caused the pidfile lock to be lost when the child process execs daemon's target program thanks to flock(2) semantics. So, we apparently have to leak the open pidfile's file descriptor to keep the lock for the pidfile(3) functions to work properly. Test case demonstrated by trociny: ref8-amd64:/home/trociny% uname -r 8.2-STABLE ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 daemon: process already running, pid: 19799 kopusha:~% uname -r 10.0-CURRENT kopusha:~% daemon -p /tmp/sleep.pid sleep 10 kopusha:~% daemon -p /tmp/sleep.pid sleep 10 kopusha:~% Modified: head/lib/libutil/pidfile.c Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Mon Feb 6 13:36:49 2012 (r231086) +++ head/lib/libutil/pidfile.c Mon Feb 6 14:11:24 2012 (r231087) @@ -124,7 +124,7 @@ pidfile_open(const char *path, mode_t mo * pidfile_write() can be called multiple times. */ fd = flopen(pfh->pf_path, - O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NONBLOCK, mode); + O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, mode); if (fd == -1) { if (errno == EWOULDBLOCK && pidptr != NULL) { count = 20; From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 14:25:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 576901065672; Mon, 6 Feb 2012 14:25:17 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 07EDC8FC08; Mon, 6 Feb 2012 14:25:15 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id C2541A2D; Mon, 6 Feb 2012 15:25:14 +0100 (CET) Date: Mon, 6 Feb 2012 15:24:02 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120206142402.GG1324@garage.freebsd.pl> References: <201202061411.q16EBOwt039268@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UTZ8bGhNySVQ9LYl" Content-Disposition: inline In-Reply-To: <201202061411.q16EBOwt039268@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231087 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:25:17 -0000 --UTZ8bGhNySVQ9LYl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 02:11:24PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Mon Feb 6 14:11:24 2012 > New Revision: 231087 > URL: http://svn.freebsd.org/changeset/base/231087 >=20 > Log: > Using the O_CLOEXEC flag on open(2) caused the pidfile lock to be lost > when the child process execs daemon's target program thanks to flock(2) > semantics. So, we apparently have to leak the open pidfile's file > descriptor to keep the lock for the pidfile(3) functions to work proper= ly. > > Test case demonstrated by trociny: > =20 > ref8-amd64:/home/trociny% uname -r > 8.2-STABLE > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > daemon: process already running, pid: 19799 > =20 > kopusha:~% uname -r > 10.0-CURRENT > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~% Not sure if you saw the following discussion, but O_CLOEXEC is ok here. Mikolaj is working on improving daemon to handle it properly. What we had in 8.2-STABLE is also incorrect, but for other reasons. All in all, O_CLOEXEC should stay. What Mikolaj presented is a problem in daemon(8) and not pidfile(3). --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --UTZ8bGhNySVQ9LYl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8v4oIACgkQForvXbEpPzSRMQCfc5oRcV8KhB8d2JJLul7mbJoG Zq8AoJ39wwZRPVWUydlDyiA1QC4QrBVX =No2B -----END PGP SIGNATURE----- --UTZ8bGhNySVQ9LYl-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 14:32:24 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 439D6106566C; Mon, 6 Feb 2012 14:32:24 +0000 (UTC) (envelope-from ghelmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id C9F858FC1A; Mon, 6 Feb 2012 14:32:22 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q16EVvsO019560; Mon, 6 Feb 2012 08:32:04 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q16EVjIh074179 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 6 Feb 2012 08:31:45 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q16EVjIh074179 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1328538709; bh=5NUXxddw6KTLF7+CbMvI8/MHMcl9Hbna68P4/jL3n/g=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=iICw2fDoVVzgV4E/mrX7m/qwwpJxSiTfxdBYjBFJyL3XO0c2XGvue/o1KGe08Gw88 d3yZ6vtjQpQ3/ZcVGF2npKA1lmZxWnSqdQto1UhA4EBtEh3e/pXFR/80tjPLHprGMx iBUBOL+L6t9e5b3Ko5kR9ZNtxLfp/F0Ti8tFaJ7w= Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120205093938.GC30033@garage.freebsd.pl> Date: Mon, 6 Feb 2012 08:31:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1257) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Mon, 06 Feb 2012 08:31:49 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q16EVjIh074179 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.406, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.49) X-Palisade-MailScanner-From: ghelmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: Mikolaj Golub , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:32:24 -0000 On Feb 5, 2012, at 3:39 AM, Pawel Jakub Dawidek wrote: > On Sat, Feb 04, 2012 at 08:16:42PM +0200, Mikolaj Golub wrote: >> ref8-amd64:/home/trociny% uname -r >> 8.2-STABLE >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> daemon: process already running, pid: 19799 >>=20 >> kopusha:~% uname -r =20 >> 10.0-CURRENT >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~%=20 >=20 > Mikolaj, eventhough what we had in 8.2-STABLE looks correct, it also > isn't correct. >=20 > Passing open descriptor to a process that doesn't expect that is bad > behaviour. If you pass, eg. open descriptor to a directory and the > process is using chroot(2) or jail(2) to sandbox itself it will be = able > to escape from that sandbox. Passing descriptor to a file has smaller > security implication, but it is still wrong. For example hastd, as you > probably know, asserts, before sandboxing, that he knows about all = open > descriptors - if there are some unknown descriptors open it won't run. >=20 > Also, daemon was passing open descriptor to a pidfile that the child > process cannot clean up, because he doesn't know its name. This leaves > pidfile with stale PID in it once the process exits, which is also = bad. >=20 > In my opinion, to make daemon(8) work with pidfiles, it cannot exit > after executing the given command. It should stay around with pidfile > open and just wait for the child to exit. Once the child exits, it > should remove the pidfile and also exit. If my understanding of flock(2) semantics is correct, with open(2) = O_CLOEXEC or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the = pidfile file descriptor during an exec will result in loss of the lock = on the pidfile regardless of whether daemon(8) hangs around to wait for = the child exit. Guy -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 14:44:52 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F175A1065672; Mon, 6 Feb 2012 14:44:52 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9DDB78FC14; Mon, 6 Feb 2012 14:44:52 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 0ECF2A57; Mon, 6 Feb 2012 15:44:51 +0100 (CET) Date: Mon, 6 Feb 2012 15:43:39 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120206144337.GH1324@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2xzXx3ruJf7hsAzo" Content-Disposition: inline In-Reply-To: <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Mikolaj Golub , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:44:53 -0000 --2xzXx3ruJf7hsAzo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 08:31:47AM -0600, Guy Helmer wrote: > If my understanding of flock(2) semantics is correct, with open(2) O_CLOE= XEC or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the pidfile f= ile descriptor during an exec will result in loss of the lock on the pidfil= e regardless of whether daemon(8) hangs around to wait for the child exit. My expectation is that as long as parent process holds pidfile descriptor open and locked, the pidfile should remain locked even after fork(2)/execve(2). Worth checking, though. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --2xzXx3ruJf7hsAzo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8v5xkACgkQForvXbEpPzTI5wCgyTkHOoWHzU4WHjxsGjRJnkZ0 Vg8AoOBW/FOz8tg77nzE85rF3N2ZcISl =SJOw -----END PGP SIGNATURE----- --2xzXx3ruJf7hsAzo-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 15:21:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECD67106564A; Mon, 6 Feb 2012 15:21:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C3F148FC1B; Mon, 6 Feb 2012 15:21:55 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 7BA1D46B17; Mon, 6 Feb 2012 10:21:55 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0B7DEB95C; Mon, 6 Feb 2012 10:21:55 -0500 (EST) From: John Baldwin To: Nathan Whitehorn Date: Mon, 6 Feb 2012 07:53:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202051654.q15GsQcc092137@svn.freebsd.org> In-Reply-To: <201202051654.q15GsQcc092137@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201202060753.43627.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 10:21:55 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:21:56 -0000 On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun Feb 5 16:54:26 2012 > New Revision: 231026 > URL: http://svn.freebsd.org/changeset/base/231026 > > Log: > Make sure to remap adjusted resources. Hmm, I had considered remapping adjusted resources an invalid operation (i.e. should fail with EINVAL). I believe that the NEW_PCIB code should only apply this API to resources backing the resource windows in PCI-PCI bridges and that those resources should never have RF_ACTIVE set. Are you seeing calls of it for active resources? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 15:21:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 530D21065670; Mon, 6 Feb 2012 15:21:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 285B68FC1C; Mon, 6 Feb 2012 15:21:59 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D59ED46B2A; Mon, 6 Feb 2012 10:21:58 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 45F7CB960; Mon, 6 Feb 2012 10:21:56 -0500 (EST) From: John Baldwin To: Ivan Voras Date: Mon, 6 Feb 2012 09:30:31 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202041649.q14GnUnI043572@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201202060930.31511.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 10:21:58 -0500 (EST) Cc: svn-src-head@freebsd.org, Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230984 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:21:59 -0000 On Monday, February 06, 2012 6:34:06 am Ivan Voras wrote: > On 4 February 2012 17:49, Ryan Stone wrote: > > Author: rstone > > Date: Sat Feb 4 16:49:29 2012 > > New Revision: 230984 > > URL: http://svn.freebsd.org/changeset/base/230984 > > > > Log: > > Whenever a new kernel thread is spawned, explicitly clear any CPU affinity > > set on the new thread. This prevents the thread from inadvertently > > inheriting affinity from a random sibling. > > Shouldn't new threads inherit affinity from the threads which spawned them? User threads still do, but kernel threads are a bit tricky since most of them get created during boot when everything is running on the BSP, so the affinity they would inherit is rather bogus. Even post-boot many of the cases I can think of when you would create kthreads (e.g. expanding a thread pool), you don't really want to inherit affinity. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 15:39:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542781065675; Mon, 6 Feb 2012 15:39:59 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 229E68FC1B; Mon, 6 Feb 2012 15:39:58 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYZ00C06A6HYT00@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:39:53 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYZ00CB9A6B6Y00@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:39:48 -0600 (CST) Date: Mon, 06 Feb 2012 09:39:46 -0600 From: Nathan Whitehorn In-reply-to: <20120206.220721.343708041459090867.nyan@FreeBSD.org> To: TAKAHASHI Yoshihiro Message-id: <4F2FF442.2090102@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.68.223 X-Spam-PmxInfo: Server=avs-15, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.6.153022, SenderIP=76.208.68.223 References: <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> <20120128.193030.322386357550021613.nyan@FreeBSD.org> <4F2EA4F7.9010204@freebsd.org> <20120206.220721.343708041459090867.nyan@FreeBSD.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120107 Thunderbird/9.0 Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:39:59 -0000 On 02/06/12 07:07, TAKAHASHI Yoshihiro wrote: > In article<4F2EA4F7.9010204@freebsd.org> > Nathan Whitehorn writes: > >>>>>> TERM=xterm >>>>> This code is also used on pc98, right? I think on pc98 we still need >>>>> to >>>>> use TERM=cons25w, to support Japanese character sets and keyboard >>>>> input. >>> How about the attached patch? >> The top half looks OK. The bottom half (the menu) is relevant only for >> serial consoles. I guess people could be viewing a remote serial >> console on a PC-98 graphics console, but then it shouldn't be >> conditionalized on PC98 machines. > Ok. I update the patch. > > --- > TAKAHASHI Yoshihiro Looks good to me. -Nathan From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 15:40:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E22A41065676; Mon, 6 Feb 2012 15:40:56 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id B357E8FC1C; Mon, 6 Feb 2012 15:40:56 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYZ00800A889Y00@smtpauth2.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:40:56 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYZ007C7A862J00@smtpauth2.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:40:55 -0600 (CST) Date: Mon, 06 Feb 2012 09:40:54 -0600 From: Nathan Whitehorn In-reply-to: <201202060753.43627.jhb@freebsd.org> To: John Baldwin Message-id: <4F2FF486.5090507@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.68.223 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.6.153022, SenderIP=76.208.68.223 References: <201202051654.q15GsQcc092137@svn.freebsd.org> <201202060753.43627.jhb@freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120107 Thunderbird/9.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:40:57 -0000 On 02/06/12 06:53, John Baldwin wrote: > On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sun Feb 5 16:54:26 2012 >> New Revision: 231026 >> URL: http://svn.freebsd.org/changeset/base/231026 >> >> Log: >> Make sure to remap adjusted resources. > Hmm, I had considered remapping adjusted resources an invalid operation (i.e. > should fail with EINVAL). I believe that the NEW_PCIB code should only apply > this API to resources backing the resource windows in PCI-PCI bridges and that > those resources should never have RF_ACTIVE set. Are you seeing calls of it > for active resources? > No, I was just trying to be safe here, since it wasn't clear that that was invalid. I'm happy to replace the contents of the if with return EINVAL or something. -Nathan From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 15:59:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 595BD106564A; Mon, 6 Feb 2012 15:59:58 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3B38FC0A; Mon, 6 Feb 2012 15:59:57 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so6877447wib.13 for ; Mon, 06 Feb 2012 07:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sYU984wzktceO0eiD2yXGUPrgLkTvqE5a4jDvJXX6UU=; b=Wy8/fujzZ/hwaMyqDzVPa37kPPrlJ1p/rVTDi6cH7C6mJd9vElKBxDZmtlm2akMAMj pL8R6ThR7EIF11QTjDseNj9yTI1eEkPw4fOTF9OvqJX661Pp4M/cSubR48J2KZd/tKFe Ff2Y0lysFKFnq0szB6COtU7P6YTfdmnfKDNQU= MIME-Version: 1.0 Received: by 10.180.105.129 with SMTP id gm1mr15915045wib.1.1328542502025; Mon, 06 Feb 2012 07:35:02 -0800 (PST) Received: by 10.180.106.129 with HTTP; Mon, 6 Feb 2012 07:35:02 -0800 (PST) In-Reply-To: References: <201202041649.q14GnUnI043572@svn.freebsd.org> Date: Mon, 6 Feb 2012 10:35:02 -0500 Message-ID: From: Ryan Stone To: Ivan Voras Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230984 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:59:58 -0000 On Mon, Feb 6, 2012 at 6:34 AM, Ivan Voras wrote: > Shouldn't new threads inherit affinity from the threads which spawned them? Kernel threads were not inheriting affinity from the thread that spawned them. They were inheriting affinity from an arbitrary sibling thread in the same kernel process. For example, if you set net.isr.bindthreads=1, all threads in the intr process that don't set affinity(which is most of them) would end up bound to CPU 0, including every single softclock thread. From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 16:09:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE5F9106564A; Mon, 6 Feb 2012 16:09:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 91FAF8FC19; Mon, 6 Feb 2012 16:09:10 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 4938446B0C; Mon, 6 Feb 2012 11:09:10 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D091EB91E; Mon, 6 Feb 2012 11:09:09 -0500 (EST) From: John Baldwin To: Pawel Jakub Dawidek Date: Mon, 6 Feb 2012 10:25:42 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> <20120206144337.GH1324@garage.freebsd.pl> In-Reply-To: <20120206144337.GH1324@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201202061025.42239.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 11:09:09 -0500 (EST) Cc: src-committers@freebsd.org, Guy Helmer , svn-src-all@freebsd.org, Andrey Zonov , Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 16:09:10 -0000 On Monday, February 06, 2012 9:43:39 am Pawel Jakub Dawidek wrote: > On Mon, Feb 06, 2012 at 08:31:47AM -0600, Guy Helmer wrote: > > If my understanding of flock(2) semantics is correct, with open(2) O_CLOEXEC or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the pidfile file descriptor during an exec will result in loss of the lock on the pidfile regardless of whether daemon(8) hangs around to wait for the child exit. > > My expectation is that as long as parent process holds pidfile > descriptor open and locked, the pidfile should remain locked even after > fork(2)/execve(2). Worth checking, though. Yes, if the daemon process hung around that would work. Note that I think you would need to do a double-fork for that to work though since users expect daemon to return instantly and not need to be put in the background. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 16:09:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D555F1065672; Mon, 6 Feb 2012 16:09:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AB6268FC12; Mon, 6 Feb 2012 16:09:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 6592646B23; Mon, 6 Feb 2012 11:09:11 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CBD2FB925; Mon, 6 Feb 2012 11:09:10 -0500 (EST) From: John Baldwin To: Nathan Whitehorn Date: Mon, 6 Feb 2012 11:06:59 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202051654.q15GsQcc092137@svn.freebsd.org> <201202060753.43627.jhb@freebsd.org> <4F2FF486.5090507@freebsd.org> In-Reply-To: <4F2FF486.5090507@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201202061106.59098.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 11:09:10 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 16:09:11 -0000 On Monday, February 06, 2012 10:40:54 am Nathan Whitehorn wrote: > On 02/06/12 06:53, John Baldwin wrote: > > On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: > >> Author: nwhitehorn > >> Date: Sun Feb 5 16:54:26 2012 > >> New Revision: 231026 > >> URL: http://svn.freebsd.org/changeset/base/231026 > >> > >> Log: > >> Make sure to remap adjusted resources. > > Hmm, I had considered remapping adjusted resources an invalid operation (i.e. > > should fail with EINVAL). I believe that the NEW_PCIB code should only apply > > this API to resources backing the resource windows in PCI-PCI bridges and that > > those resources should never have RF_ACTIVE set. Are you seeing calls of it > > for active resources? > > > No, I was just trying to be safe here, since it wasn't clear that that > was invalid. I'm happy to replace the contents of the if with return > EINVAL or something. Yeah, I would do that, perhaps with a KASSERT() as well so it panics in HEAD. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 17:00:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A433D106566C; Mon, 6 Feb 2012 17:00:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91A528FC0C; Mon, 6 Feb 2012 17:00:29 +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 q16H0TMX044919; Mon, 6 Feb 2012 17:00:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16H0Tsc044911; Mon, 6 Feb 2012 17:00:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202061700.q16H0Tsc044911@svn.freebsd.org> From: John Baldwin Date: Mon, 6 Feb 2012 17:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231088 - in head/sys: fs/nfsclient fs/nwfs fs/smbfs kern nfsclient sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:00:29 -0000 Author: jhb Date: Mon Feb 6 17:00:28 2012 New Revision: 231088 URL: http://svn.freebsd.org/changeset/base/231088 Log: Rename cache_lookup_times() to cache_lookup() and retire the old API and ABI stub for cache_lookup(). Modified: head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nwfs/nwfs_vnops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/kern/vfs_cache.c head/sys/nfsclient/nfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 17:00:28 2012 (r231088) @@ -1042,7 +1042,7 @@ nfs_lookup(struct vop_lookup_args *ap) if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) return (error); - error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); + error = cache_lookup(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { Modified: head/sys/fs/nwfs/nwfs_vnops.c ============================================================================== --- head/sys/fs/nwfs/nwfs_vnops.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/fs/nwfs/nwfs_vnops.c Mon Feb 6 17:00:28 2012 (r231088) @@ -853,7 +853,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)d if (error) return ENOENT; - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup(dvp, vpp, cnp, NULL, NULL); NCPVNDEBUG("cache_lookup returned %d\n", error); if (error > 0) return error; Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/fs/smbfs/smbfs_vnops.c Mon Feb 6 17:00:28 2012 (r231088) @@ -1131,7 +1131,7 @@ smbfs_lookup(ap) if (error) return ENOENT; - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup(dvp, vpp, cnp, NULL, NULL); SMBVDEBUG("cache_lookup returned %d\n", error); if (error > 0) return error; Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/kern/vfs_cache.c Mon Feb 6 17:00:28 2012 (r231088) @@ -456,7 +456,7 @@ cache_zap(ncp) */ int -cache_lookup_times(dvp, vpp, cnp, tsp, ticksp) +cache_lookup(dvp, vpp, cnp, tsp, ticksp) struct vnode *dvp; struct vnode **vpp; struct componentname *cnp; @@ -994,7 +994,7 @@ vfs_cache_lookup(ap) if (error) return (error); - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup(dvp, vpp, cnp, NULL, NULL); if (error == 0) return (VOP_CACHEDLOOKUP(dvp, vpp, cnp)); if (error == -1) @@ -1374,12 +1374,9 @@ vn_commname(struct vnode *vp, char *buf, /* ABI compat shims for old kernel modules. */ #undef cache_enter -#undef cache_lookup void cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp); -int cache_lookup(struct vnode *dvp, struct vnode **vpp, - struct componentname *cnp); void cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) @@ -1388,13 +1385,6 @@ cache_enter(struct vnode *dvp, struct vn cache_enter_time(dvp, vp, cnp, NULL); } -int -cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) -{ - - return (cache_lookup_times(dvp, vpp, cnp, NULL, NULL)); -} - /* * This function updates path string to vnode's full global path * and checks the size of the new path string against the pathlen argument. Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/nfsclient/nfs_vnops.c Mon Feb 6 17:00:28 2012 (r231088) @@ -938,7 +938,7 @@ nfs_lookup(struct vop_lookup_args *ap) *vpp = NULLVP; return (error); } - error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); + error = cache_lookup(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/sys/vnode.h Mon Feb 6 17:00:28 2012 (r231088) @@ -586,9 +586,7 @@ struct vnode; cache_enter_time(dvp, vp, cnp, NULL) void cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, struct timespec *tsp); -#define cache_lookup(dvp, vpp, cnp) \ - cache_lookup_times(dvp, vpp, cnp, NULL, NULL) -int cache_lookup_times(struct vnode *dvp, struct vnode **vpp, +int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp); void cache_purge(struct vnode *vp); void cache_purge_negative(struct vnode *vp); From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 17:07:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C646E1065672; Mon, 6 Feb 2012 17:07:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 946638FC08; Mon, 6 Feb 2012 17:07:24 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYZ0021SE8BI100@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 11:07:24 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYZ00C08E866Y30@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 11:07:19 -0600 (CST) Date: Mon, 06 Feb 2012 11:07:17 -0600 From: Nathan Whitehorn In-reply-to: <201202061106.59098.jhb@freebsd.org> To: John Baldwin Message-id: <4F3008C5.8020104@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.68.223 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.6.170027, SenderIP=76.208.68.223 References: <201202051654.q15GsQcc092137@svn.freebsd.org> <201202060753.43627.jhb@freebsd.org> <4F2FF486.5090507@freebsd.org> <201202061106.59098.jhb@freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120107 Thunderbird/9.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:07:25 -0000 On 02/06/12 10:06, John Baldwin wrote: > On Monday, February 06, 2012 10:40:54 am Nathan Whitehorn wrote: >> On 02/06/12 06:53, John Baldwin wrote: >>> On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: >>>> Author: nwhitehorn >>>> Date: Sun Feb 5 16:54:26 2012 >>>> New Revision: 231026 >>>> URL: http://svn.freebsd.org/changeset/base/231026 >>>> >>>> Log: >>>> Make sure to remap adjusted resources. >>> Hmm, I had considered remapping adjusted resources an invalid operation (i.e. >>> should fail with EINVAL). I believe that the NEW_PCIB code should only apply >>> this API to resources backing the resource windows in PCI-PCI bridges and that >>> those resources should never have RF_ACTIVE set. Are you seeing calls of it >>> for active resources? >>> >> No, I was just trying to be safe here, since it wasn't clear that that >> was invalid. I'm happy to replace the contents of the if with return >> EINVAL or something. > Yeah, I would do that, perhaps with a KASSERT() as well so it panics in HEAD. > How does this look? I've kept both the EINVAL and the KASSERT. -Nathan Index: ofw_pci.c =================================================================== --- ofw_pci.c (revision 231026) +++ ofw_pci.c (working copy) @@ -431,8 +431,12 @@ { struct rman *rm = NULL; struct ofw_pci_softc *sc = device_get_softc(bus); - int error; + KASSERT(!(rman_get_flags(res) & RF_ACTIVE), + ("active resources cannot be adjusted")); + if (rman_get_flags(res) & RF_ACTIVE) + return (EINVAL); + switch (type) { case SYS_RES_MEMORY: rm = &sc->sc_mem_rman; @@ -447,21 +451,7 @@ if (!rman_is_region_manager(res, rm)) return (EINVAL); - error = rman_adjust_resource(res, start, end); - if (error) - return (error); - - if (rman_get_flags(res) & RF_ACTIVE) { - /* Remap memory resources */ - error = ofw_pci_deactivate_resource(bus, child, type, - rman_get_rid(res), res); - if (error) - return (error); - error = ofw_pci_activate_resource(bus, child, type, - rman_get_rid(res), res); - } - - return (error); + return (rman_adjust_resource(res, start, end)); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 17:28:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EB72106566B; Mon, 6 Feb 2012 17:28:56 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0EF78FC0A; Mon, 6 Feb 2012 17:28:55 +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 q16HStwS046078; Mon, 6 Feb 2012 17:28:55 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16HStdM046076; Mon, 6 Feb 2012 17:28:55 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201202061728.q16HStdM046076@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 6 Feb 2012 17:28:55 +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: r231089 - stable/8/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:28:56 -0000 Author: jh Date: Mon Feb 6 17:28:55 2012 New Revision: 231089 URL: http://svn.freebsd.org/changeset/base/231089 Log: MFC r229692: Check the return value of sbuf_finish() in pfs_readlink() and return ENAMETOOLONG if the buffer overflowed. Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.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/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/8/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 6 17:00:28 2012 (r231088) +++ stable/8/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 6 17:28:55 2012 (r231089) @@ -892,7 +892,11 @@ pfs_readlink(struct vop_readlink_args *v PFS_RETURN (error); } - sbuf_finish(&sb); + if (sbuf_finish(&sb) != 0) { + sbuf_delete(&sb); + PFS_RETURN (ENAMETOOLONG); + } + error = uiomove_frombuf(sbuf_data(&sb), sbuf_len(&sb), uio); sbuf_delete(&sb); PFS_RETURN (error); From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 17:31:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D255E106566B; Mon, 6 Feb 2012 17:31:13 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C088D8FC0C; Mon, 6 Feb 2012 17:31:13 +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 q16HVDQw046202; Mon, 6 Feb 2012 17:31:13 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16HVDL1046200; Mon, 6 Feb 2012 17:31:13 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201202061731.q16HVDL1046200@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 6 Feb 2012 17:31:13 +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: r231090 - stable/7/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:31:13 -0000 Author: jh Date: Mon Feb 6 17:31:13 2012 New Revision: 231090 URL: http://svn.freebsd.org/changeset/base/231090 Log: MFC r229692: Check the return value of sbuf_finish() in pfs_readlink() and return ENAMETOOLONG if the buffer overflowed. Modified: stable/7/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/7/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 6 17:28:55 2012 (r231089) +++ stable/7/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 6 17:31:13 2012 (r231090) @@ -805,7 +805,11 @@ pfs_readlink(struct vop_readlink_args *v PFS_RETURN (error); } - sbuf_finish(&sb); + if (sbuf_finish(&sb) != 0) { + sbuf_delete(&sb); + PFS_RETURN (ENAMETOOLONG); + } + error = uiomove_frombuf(sbuf_data(&sb), sbuf_len(&sb), uio); sbuf_delete(&sb); PFS_RETURN (error); From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 17:48:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 6F5FA106564A; Mon, 6 Feb 2012 17:48:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 6 Feb 2012 12:48:37 -0500 User-Agent: KMail/1.6.2 References: <201202040054.q140siBP012241@svn.freebsd.org> In-Reply-To: <201202040054.q140siBP012241@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201202061248.43744.jkim@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Robert Millan Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:48:57 -0000 On Friday 03 February 2012 07:54 pm, Robert Millan wrote: > +nodevice ti Tigon 1 and 2 had open-sourced firmware. In fact, I believe wpaul developed custom firmware for FreeBSD and the (early?) sources are still available here: http://people.freebsd.org/~wpaul/Alteon/ Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 17:59:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B6D0106566B; Mon, 6 Feb 2012 17:59:15 +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 6A6B88FC0A; Mon, 6 Feb 2012 17:59: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 q16HxF6d047086; Mon, 6 Feb 2012 17:59:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16HxFKk047084; Mon, 6 Feb 2012 17:59:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061759.q16HxFKk047084@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 17:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231091 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:59:15 -0000 Author: kib Date: Mon Feb 6 17:59:14 2012 New Revision: 231091 URL: http://svn.freebsd.org/changeset/base/231091 Log: Add missing opt_quota.h include to activate #ifdef QUOTA blocks, apparently a step in unbreaking QUOTA support. Reported and tested by: Adam Strohl MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 17:31:13 2012 (r231090) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 17:59:14 2012 (r231091) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ffs.h" +#include "opt_quota.h" #include "opt_ddb.h" /* @@ -6428,7 +6429,7 @@ softdep_setup_freeblocks(ip, length, fla } #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ - quotaref(vp, freeblks->fb_quota); + quotaref(ITOV(ip), freeblks->fb_quota); (void) chkdq(ip, -datablocks, NOCRED, 0); #endif freeblks->fb_chkcnt = -datablocks; From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 18:11:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4FE61065673; Mon, 6 Feb 2012 18:11:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38168FC1B; Mon, 6 Feb 2012 18:11:00 +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 q16IB0RS047525; Mon, 6 Feb 2012 18:11:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IB0VF047522; Mon, 6 Feb 2012 18:11:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202061811.q16IB0VF047522@svn.freebsd.org> From: Ed Maste Date: Mon, 6 Feb 2012 18:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231092 - head/sys/cam/ctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:11:00 -0000 Author: emaste Date: Mon Feb 6 18:11:00 2012 New Revision: 231092 URL: http://svn.freebsd.org/changeset/base/231092 Log: Avoid panic from unlocking a not locked mutex (in some error cases). Reviewed by: ken@ Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Feb 6 17:59:14 2012 (r231091) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Feb 6 18:11:00 2012 (r231092) @@ -221,6 +221,7 @@ cfcs_init(void) mtx_lock(&softc->lock); if (xpt_bus_register(softc->sim, NULL, 0) != CAM_SUCCESS) { + mtx_unlock(&softc->lock); printf("%s: error registering SIM\n", __func__); retval = ENOMEM; goto bailout; @@ -230,6 +231,7 @@ cfcs_init(void) cam_sim_path(softc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + mtx_unlock(&softc->lock); printf("%s: error creating path\n", __func__); xpt_bus_deregister(cam_sim_path(softc->sim)); retval = 1; @@ -253,8 +255,6 @@ bailout: else if (softc->devq) cam_simq_free(softc->devq); - mtx_unlock(&softc->lock); - return (retval); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 18:11:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8346C1065674; Mon, 6 Feb 2012 18:11:01 +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 6D7FE8FC1A; Mon, 6 Feb 2012 18:11: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 q16IB1x4047548; Mon, 6 Feb 2012 18:11:01 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IB14c047541; Mon, 6 Feb 2012 18:11:01 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202061811.q16IB14c047541@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 6 Feb 2012 18:11: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: r231093 - in stable/9: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware sys/modules/cxgbe sys/modules/cxgbe/firmware tools/tools/cxgbetool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:11:01 -0000 Author: np Date: Mon Feb 6 18:11:01 2012 New Revision: 231093 URL: http://svn.freebsd.org/changeset/base/231093 Log: MFC r228491, r228561, r228594. r228491: Do not clobber the ingress queue's congestion setting. r228561: Many updates to cxgbe(4) - Device configuration via plain text config file. Also able to operate when not attached to the chip as the master driver. - Generic "work request" queue that serves as the base for both ctrl and ofld tx queues. - Generic interrupt handler routine that can process any event on any kind of ingress queue (via a dispatch table). - A couple of new driver ioctls. cxgbetool can now install a firmware to the card ("loadfw" command) and can read the card's memory ("memdump" and "tcb" commands). - Lots of assorted information within dev.t4nex.X.misc.* This is primarily for debugging and won't show up in sysctl -a. - Code to manage the L2 tables on the chip. - Updates to cxgbe(4) man page to go with the tunables that have changed. - Updates to the shared code in common/ - Updates to the driver-firmware interface (now at fw 1.4.16.0) r228594: Catch up with new driver ioctls in cxgbe. Added: stable/9/sys/dev/cxgbe/firmware/ - copied from r228561, head/sys/dev/cxgbe/firmware/ stable/9/sys/modules/cxgbe/firmware/ - copied from r228561, head/sys/modules/cxgbe/firmware/ Deleted: stable/9/sys/dev/cxgbe/common/t4fw_interface.h Modified: stable/9/share/man/man4/cxgbe.4 stable/9/sys/dev/cxgbe/adapter.h stable/9/sys/dev/cxgbe/common/common.h stable/9/sys/dev/cxgbe/common/t4_hw.c stable/9/sys/dev/cxgbe/common/t4_hw.h stable/9/sys/dev/cxgbe/offload.h stable/9/sys/dev/cxgbe/osdep.h stable/9/sys/dev/cxgbe/t4_ioctl.h stable/9/sys/dev/cxgbe/t4_l2t.c stable/9/sys/dev/cxgbe/t4_l2t.h stable/9/sys/dev/cxgbe/t4_main.c stable/9/sys/dev/cxgbe/t4_sge.c stable/9/sys/modules/cxgbe/Makefile stable/9/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/tools/tools/ (props changed) Modified: stable/9/share/man/man4/cxgbe.4 ============================================================================== --- stable/9/share/man/man4/cxgbe.4 Mon Feb 6 18:11:00 2012 (r231092) +++ stable/9/share/man/man4/cxgbe.4 Mon Feb 6 18:11:01 2012 (r231093) @@ -99,18 +99,29 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.cxgbe.max_ntxq_10G_port -The maximum number of tx queues to use for a 10Gb port. -The default value is 8. -.It Va hw.cxgbe.max_nrxq_10G_port -The maximum number of rx queues to use for a 10Gb port. -The default value is 8. -.It Va hw.cxgbe.max_ntxq_1G_port -The maximum number of tx queues to use for a 1Gb port. -The default value is 2. -.It Va hw.cxgbe.max_nrxq_1G_port -The maximum number of rx queues to use for a 1Gb port. -The default value is 2. +.It Va hw.cxgbe.ntxq10g +The number of tx queues to use for a 10Gb port. The default is 16 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq10g +The number of rx queues to use for a 10Gb port. The default is 8 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.ntxq1g +The number of tx queues to use for a 1Gb port. The default is 4 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq1g +The number of rx queues to use for a 1Gb port. The default is 2 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldtxq10g +The number of TOE tx queues to use for a 10Gb port. The default is 8 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldrxq10g +The number of TOE rx queues to use for a 10Gb port. The default is 2 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldtxq1g +The number of TOE tx queues to use for a 1Gb port. The default is 2 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldrxq1g +The number of TOE rx queues to use for a 1Gb port. The default is 1. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G The timer index value to use to delay interrupts. @@ -119,6 +130,8 @@ by default (all values are in microsecon value from this list. The default value is 1 for both 10Gb and 1Gb ports, which means the timer value is 5us. +Different cxgbe interfaces can be assigned different values at any time via the +dev.cxgbe.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -127,6 +140,11 @@ and the index selects a value from this The default value is 2 for both 10Gb and 1Gb ports, which means 16 packets (or the holdoff timer going off) before an interrupt is generated. +-1 disables packet counting. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.holdoff_pktc_idx sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). .It Va hw.cxgbe.qsize_txq The size, in number of entries, of the descriptor ring used for a tx queue. @@ -134,10 +152,46 @@ A buf_ring of the same size is also allo software queuing. See .Xr ifnet 9 . The default value is 1024. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.qsize_txq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). .It Va hw.cxgbe.qsize_rxq The size, in number of entries, of the descriptor ring used for an rx queue. The default value is 1024. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.qsize_rxq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). +.It Va hw.cxgbe.interrupt_types +The interrupt types that the driver is allowed to use. +Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. +The default is 7 (all allowed). +The driver will select the best possible type out of the allowed types by +itself. +.It Va hw.cxgbe.config_file +Select a pre-packaged device configuration file. +A configuration file contains a recipe for partitioning and configuring the +hardware resources on the card. +This tunable is for specialized applications only and should not be used in +normal operation. +The configuration profile currently in use is available in the dev.t4nex.X.cf +and dev.t4nex.X.cfcsum sysctls. +.It Va hw.cxgbe.linkcaps_allowed +.It Va hw.cxgbe.niccaps_allowed +.It Va hw.cxgbe.toecaps_allowed +.It Va hw.cxgbe.rdmacaps_allowed +.It Va hw.cxgbe.iscsicaps_allowed +.It Va hw.cxgbe.fcoecaps_allowed +Disallowing capabilities provides a hint to the driver and firmware to not +reserve hardware resources for that feature. +Each of these is a bit field with a bit for each sub-capability within the +capability. +This tunable is for specialized applications only and should not be used in +normal operation. +The capabilities for which hardware resources have been reserved are listed in +dev.t4nex.X.*caps sysctls. .El .Sh SUPPORT For general information and support, Modified: stable/9/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/9/sys/dev/cxgbe/adapter.h Mon Feb 6 18:11:00 2012 (r231092) +++ stable/9/sys/dev/cxgbe/adapter.h Mon Feb 6 18:11:01 2012 (r231093) @@ -31,6 +31,7 @@ #ifndef __T4_ADAPTER_H__ #define __T4_ADAPTER_H__ +#include #include #include #include @@ -46,8 +47,9 @@ #include #include "offload.h" -#include "common/t4fw_interface.h" +#include "firmware/t4fw_interface.h" +#define T4_CFGNAME "t4fw_cfg" #define T4_FWNAME "t4fw" MALLOC_DECLARE(M_CXGBE); @@ -110,25 +112,21 @@ enum { FW_IQ_QSIZE = 256, FW_IQ_ESIZE = 64, /* At least 64 mandated by the firmware spec */ - INTR_IQ_QSIZE = 64, - INTR_IQ_ESIZE = 64, /* Handles some CPLs too, do not reduce */ - - CTRL_EQ_QSIZE = 128, - CTRL_EQ_ESIZE = 64, - RX_IQ_QSIZE = 1024, RX_IQ_ESIZE = 64, /* At least 64 so CPL_RX_PKT will fit */ - RX_FL_ESIZE = 64, /* 8 64bit addresses */ + EQ_ESIZE = 64, /* All egress queues use this entry size */ + RX_FL_ESIZE = EQ_ESIZE, /* 8 64bit addresses */ #if MJUMPAGESIZE != MCLBYTES FL_BUF_SIZES = 4, /* cluster, jumbop, jumbo9k, jumbo16k */ #else FL_BUF_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif + CTRL_EQ_QSIZE = 128, + TX_EQ_QSIZE = 1024, - TX_EQ_ESIZE = 64, TX_SGL_SEGS = 36, TX_WR_FLITS = SGE_MAX_WR_LEN / 8 }; @@ -144,13 +142,16 @@ enum { /* adapter flags */ FULL_INIT_DONE = (1 << 0), FW_OK = (1 << 1), - INTR_SHARED = (1 << 2), /* one set of intrq's for all ports */ + INTR_DIRECT = (1 << 2), /* direct interrupts for everything */ + MASTER_PF = (1 << 3), + ADAP_SYSCTL_CTX = (1 << 4), CXGBE_BUSY = (1 << 9), /* port flags */ DOOMED = (1 << 0), - VI_ENABLED = (1 << 1), + PORT_INIT_DONE = (1 << 1), + PORT_SYSCTL_CTX = (1 << 2), }; #define IS_DOOMED(pi) (pi->flags & DOOMED) @@ -186,6 +187,12 @@ struct port_info { int first_txq; /* index of first tx queue */ int nrxq; /* # of rx queues */ int first_rxq; /* index of first rx queue */ +#ifndef TCP_OFFLOAD_DISABLE + int nofldtxq; /* # of offload tx queues */ + int first_ofld_txq; /* index of first offload tx queue */ + int nofldrxq; /* # of offload rx queues */ + int first_ofld_rxq; /* index of first offload rx queue */ +#endif int tmr_idx; int pktc_idx; int qsize_rxq; @@ -194,11 +201,8 @@ struct port_info { struct link_config link_cfg; struct port_stats stats; - struct taskqueue *tq; struct callout tick; - struct sysctl_ctx_list ctx; /* lives from ifconfig up to down */ - struct sysctl_oid *oid_rxq; - struct sysctl_oid *oid_txq; + struct sysctl_ctx_list ctx; /* from ifconfig up to driver detach */ uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */ }; @@ -222,17 +226,26 @@ struct tx_map { bus_dmamap_t map; }; +/* DMA maps used for tx */ +struct tx_maps { + struct tx_map *maps; + uint32_t map_total; /* # of DMA maps */ + uint32_t map_pidx; /* next map to be used */ + uint32_t map_cidx; /* reclaimed up to this index */ + uint32_t map_avail; /* # of available maps */ +}; + struct tx_sdesc { uint8_t desc_used; /* # of hardware descriptors used by the WR */ uint8_t credits; /* NIC txq: # of frames sent out in the WR */ }; -typedef void (iq_intr_handler_t)(void *); - enum { /* iq flags */ - IQ_ALLOCATED = (1 << 1), /* firmware resources allocated */ - IQ_STARTED = (1 << 2), /* started */ + IQ_ALLOCATED = (1 << 0), /* firmware resources allocated */ + IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ + IQ_INTR = (1 << 2), /* iq takes direct interrupt */ + IQ_LRO_ENABLED = (1 << 3), /* iq is an eth rxq with LRO enabled */ /* iq state */ IQS_DISABLED = 0, @@ -252,26 +265,35 @@ struct sge_iq { uint16_t abs_id; /* absolute SGE id for the iq */ int8_t intr_pktc_idx; /* packet count threshold index */ int8_t pad0; - iq_intr_handler_t *handler; __be64 *desc; /* KVA of descriptor ring */ - volatile uint32_t state; + volatile int state; struct adapter *adapter; const __be64 *cdesc; /* current descriptor */ uint8_t gen; /* generation bit */ uint8_t intr_params; /* interrupt holdoff parameters */ - uint8_t intr_next; /* holdoff for next interrupt */ + uint8_t intr_next; /* XXX: holdoff for next interrupt */ uint8_t esize; /* size (bytes) of each entry in the queue */ uint16_t qsize; /* size (# of entries) of the queue */ uint16_t cidx; /* consumer index */ - uint16_t cntxt_id; /* SGE context id for the iq */ + uint16_t cntxt_id; /* SGE context id for the iq */ + + STAILQ_ENTRY(sge_iq) link; }; enum { + EQ_CTRL = 1, + EQ_ETH = 2, +#ifndef TCP_OFFLOAD_DISABLE + EQ_OFLD = 3, +#endif + /* eq flags */ - EQ_ALLOCATED = (1 << 1), /* firmware resources allocated */ - EQ_STARTED = (1 << 2), /* started */ - EQ_CRFLUSHED = (1 << 3), /* expecting an update from SGE */ + EQ_TYPEMASK = 7, /* 3 lsbits hold the type */ + EQ_ALLOCATED = (1 << 3), /* firmware resources allocated */ + EQ_DOOMED = (1 << 4), /* about to be destroyed */ + EQ_CRFLUSHED = (1 << 5), /* expecting an update from SGE */ + EQ_STALLED = (1 << 6), /* out of hw descriptors or dmamaps */ }; /* @@ -281,10 +303,11 @@ enum { * consumes them) but it's special enough to have its own struct (see sge_fl). */ struct sge_eq { + unsigned int flags; /* MUST be first */ + unsigned int cntxt_id; /* SGE context id for the eq */ bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; char lockname[16]; - unsigned int flags; struct mtx eq_lock; struct tx_desc *desc; /* KVA of descriptor ring */ @@ -297,9 +320,24 @@ struct sge_eq { uint16_t pidx; /* producer idx (desc idx) */ uint16_t pending; /* # of descriptors used since last doorbell */ uint16_t iqid; /* iq that gets egr_update for the eq */ - unsigned int cntxt_id; /* SGE context id for the eq */ + uint8_t tx_chan; /* tx channel used by the eq */ + struct task tx_task; + struct callout tx_callout; + + /* stats */ + + uint32_t egr_update; /* # of SGE_EGR_UPDATE notifications for eq */ + uint32_t unstalled; /* recovered from stall */ +}; + +enum { + FL_STARVING = (1 << 0), /* on the adapter's list of starving fl's */ + FL_DOOMED = (1 << 1), /* about to be destroyed */ }; +#define FL_RUNNING_LOW(fl) (fl->cap - fl->needed <= fl->lowat) +#define FL_NOT_RUNNING_LOW(fl) (fl->cap - fl->needed >= 2 * fl->lowat) + struct sge_fl { bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; @@ -307,6 +345,7 @@ struct sge_fl { uint8_t tag_idx; struct mtx fl_lock; char lockname[16]; + int flags; __be64 *desc; /* KVA of descriptor ring, ptr to addresses */ bus_addr_t ba; /* bus address of descriptor ring */ @@ -317,8 +356,10 @@ struct sge_fl { uint32_t cidx; /* consumer idx (buffer idx, NOT hw desc idx) */ uint32_t pidx; /* producer idx (buffer idx, NOT hw desc idx) */ uint32_t needed; /* # of buffers needed to fill up fl. */ + uint32_t lowat; /* # of buffers <= this means fl needs help */ uint32_t pending; /* # of bufs allocated since last doorbell */ unsigned int dmamap_failed; + TAILQ_ENTRY(sge_fl) link; /* All starving freelists */ }; /* txq: SGE egress queue + what's needed for Ethernet NIC */ @@ -330,14 +371,8 @@ struct sge_txq { struct buf_ring *br; /* tx buffer ring */ struct tx_sdesc *sdesc; /* KVA of software descriptor ring */ struct mbuf *m; /* held up due to temporary resource shortage */ - struct task resume_tx; - /* DMA maps used for tx */ - struct tx_map *maps; - uint32_t map_total; /* # of DMA maps */ - uint32_t map_pidx; /* next map to be used */ - uint32_t map_cidx; /* reclaimed up to this index */ - uint32_t map_avail; /* # of available maps */ + struct tx_maps txmaps; /* stats for common events first */ @@ -354,20 +389,14 @@ struct sge_txq { uint32_t no_dmamap; /* no DMA map to load the mbuf */ uint32_t no_desc; /* out of hardware descriptors */ - uint32_t egr_update; /* # of SGE_EGR_UPDATE notifications for txq */ } __aligned(CACHE_LINE_SIZE); -enum { - RXQ_LRO_ENABLED = (1 << 0) -}; - /* rxq: SGE ingress queue + SGE free list + miscellaneous items */ struct sge_rxq { struct sge_iq iq; /* MUST be first */ - struct sge_fl fl; + struct sge_fl fl; /* MUST follow iq */ struct ifnet *ifp; /* the interface this rxq belongs to */ - unsigned int flags; #ifdef INET struct lro_ctrl lro; /* LRO state */ #endif @@ -381,12 +410,28 @@ struct sge_rxq { } __aligned(CACHE_LINE_SIZE); -/* ctrlq: SGE egress queue + stats for control queue */ -struct sge_ctrlq { +#ifndef TCP_OFFLOAD_DISABLE +/* ofld_rxq: SGE ingress queue + SGE free list + miscellaneous items */ +struct sge_ofld_rxq { + struct sge_iq iq; /* MUST be first */ + struct sge_fl fl; /* MUST follow iq */ +} __aligned(CACHE_LINE_SIZE); +#endif + +/* + * wrq: SGE egress queue that is given prebuilt work requests. Both the control + * and offload tx queues are of this type. + */ +struct sge_wrq { struct sge_eq eq; /* MUST be first */ + struct adapter *adapter; + struct mbuf *head; /* held up due to lack of descriptors */ + struct mbuf *tail; /* valid only if head is valid */ + /* stats for common events first */ + uint64_t tx_wrs; /* # of tx work requests */ /* stats for not-that-common events */ @@ -394,20 +439,28 @@ struct sge_ctrlq { } __aligned(CACHE_LINE_SIZE); struct sge { - uint16_t timer_val[SGE_NTIMERS]; - uint8_t counter_val[SGE_NCOUNTERS]; + int timer_val[SGE_NTIMERS]; + int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; - int nrxq; /* total rx queues (all ports and the rest) */ - int ntxq; /* total tx queues (all ports and the rest) */ - int niq; /* total ingress queues */ - int neq; /* total egress queues */ + int nrxq; /* total # of Ethernet rx queues */ + int ntxq; /* total # of Ethernet tx tx queues */ +#ifndef TCP_OFFLOAD_DISABLE + int nofldrxq; /* total # of TOE rx queues */ + int nofldtxq; /* total # of TOE tx queues */ +#endif + int niq; /* total # of ingress queues */ + int neq; /* total # of egress queues */ struct sge_iq fwq; /* Firmware event queue */ - struct sge_ctrlq *ctrlq;/* Control queues */ - struct sge_iq *intrq; /* Interrupt queues */ + struct sge_wrq mgmtq; /* Management queue (control queue) */ + struct sge_wrq *ctrlq; /* Control queues */ struct sge_txq *txq; /* NIC tx queues */ struct sge_rxq *rxq; /* NIC rx queues */ +#ifndef TCP_OFFLOAD_DISABLE + struct sge_wrq *ofld_txq; /* TOE tx queues */ + struct sge_ofld_rxq *ofld_rxq; /* TOE rx queues */ +#endif uint16_t iq_start; int eq_start; @@ -415,7 +468,12 @@ struct sge { struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ }; +struct rss_header; +typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *, + struct mbuf *); + struct adapter { + SLIST_ENTRY(adapter) link; device_t dev; struct cdev *cdev; @@ -444,27 +502,47 @@ struct adapter { struct sge sge; + struct taskqueue *tq[NCHAN]; /* taskqueues that flush data out */ struct port_info *port[MAX_NPORTS]; uint8_t chan_map[NCHAN]; + uint32_t filter_mode; +#ifndef TCP_OFFLOAD_DISABLE + struct uld_softc tom; + struct tom_tunables tt; +#endif struct l2t_data *l2t; /* L2 table */ struct tid_info tids; - int registered_device_map; int open_device_map; +#ifndef TCP_OFFLOAD_DISABLE + int offload_map; +#endif int flags; char fw_version[32]; + unsigned int cfcsum; struct adapter_params params; struct t4_virt_res vres; - struct sysctl_ctx_list ctx; /* from first_port_up to last_port_down */ - struct sysctl_oid *oid_fwq; - struct sysctl_oid *oid_ctrlq; - struct sysctl_oid *oid_intrq; + uint16_t linkcaps; + uint16_t niccaps; + uint16_t toecaps; + uint16_t rdmacaps; + uint16_t iscsicaps; + uint16_t fcoecaps; + + struct sysctl_ctx_list ctx; /* from adapter_full_init to full_uninit */ struct mtx sc_lock; char lockname[16]; + + /* Starving free lists */ + struct mtx sfl_lock; /* same cache-line as sc_lock? but that's ok */ + TAILQ_HEAD(, sge_fl) sfl; + struct callout sfl_callout; + + cpl_handler_t cpl_handler[256] __aligned(CACHE_LINE_SIZE); }; #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) @@ -506,11 +584,15 @@ struct adapter { #define for_each_rxq(pi, iter, rxq) \ rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \ for (iter = 0; iter < pi->nrxq; ++iter, ++rxq) +#define for_each_ofld_txq(pi, iter, ofld_txq) \ + ofld_txq = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \ + for (iter = 0; iter < pi->nofldtxq; ++iter, ++ofld_txq) +#define for_each_ofld_rxq(pi, iter, ofld_rxq) \ + ofld_rxq = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \ + for (iter = 0; iter < pi->nofldrxq; ++iter, ++ofld_rxq) /* One for errors, one for firmware events */ #define T4_EXTRA_INTR 2 -#define NINTRQ(sc) ((sc)->intr_count > T4_EXTRA_INTR ? \ - (sc)->intr_count - T4_EXTRA_INTR : 1) static inline uint32_t t4_read_reg(struct adapter *sc, uint32_t reg) @@ -589,29 +671,52 @@ static inline bool is_10G_port(const str return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); } +static inline int tx_resume_threshold(struct sge_eq *eq) +{ + return (eq->qsize / 4); +} + /* t4_main.c */ -void cxgbe_txq_start(void *, int); +void t4_tx_task(void *, int); +void t4_tx_callout(void *); int t4_os_find_pci_capability(struct adapter *, int); int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); void t4_os_portmod_changed(const struct adapter *, int); void t4_os_link_changed(struct adapter *, int, int); +void t4_iterate(void (*)(struct adapter *, void *), void *); +int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t); /* t4_sge.c */ void t4_sge_modload(void); -void t4_sge_init(struct adapter *); +int t4_sge_init(struct adapter *); int t4_create_dma_tag(struct adapter *); int t4_destroy_dma_tag(struct adapter *); int t4_setup_adapter_queues(struct adapter *); int t4_teardown_adapter_queues(struct adapter *); -int t4_setup_eth_queues(struct port_info *); -int t4_teardown_eth_queues(struct port_info *); +int t4_setup_port_queues(struct port_info *); +int t4_teardown_port_queues(struct port_info *); +int t4_alloc_tx_maps(struct tx_maps *, bus_dma_tag_t, int, int); +void t4_free_tx_maps(struct tx_maps *, bus_dma_tag_t); void t4_intr_all(void *); void t4_intr(void *); void t4_intr_err(void *); void t4_intr_evt(void *); int t4_mgmt_tx(struct adapter *, struct mbuf *); +int t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct mbuf *); int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); void t4_update_fl_bufsize(struct ifnet *); +int can_resume_tx(struct sge_eq *); + +static inline int t4_wrq_tx(struct adapter *sc, struct sge_wrq *wrq, struct mbuf *m) +{ + int rc; + + TXQ_LOCK(wrq); + rc = t4_wrq_tx_locked(sc, wrq, m); + TXQ_UNLOCK(wrq); + return (rc); +} + #endif Modified: stable/9/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/common.h Mon Feb 6 18:11:00 2012 (r231092) +++ stable/9/sys/dev/cxgbe/common/common.h Mon Feb 6 18:11:01 2012 (r231093) @@ -42,6 +42,15 @@ enum { enum { MEM_EDC0, MEM_EDC1, MEM_MC }; +enum { + MEMWIN0_APERTURE = 2048, + MEMWIN0_BASE = 0x1b800, + MEMWIN1_APERTURE = 32768, + MEMWIN1_BASE = 0x28000, + MEMWIN2_APERTURE = 65536, + MEMWIN2_BASE = 0x30000, +}; + enum dev_master { MASTER_CANT, MASTER_MAY, MASTER_MUST }; enum dev_state { DEV_STATE_UNINIT, DEV_STATE_INIT, DEV_STATE_ERR }; @@ -53,8 +62,8 @@ enum { }; #define FW_VERSION_MAJOR 1 -#define FW_VERSION_MINOR 3 -#define FW_VERSION_MICRO 10 +#define FW_VERSION_MINOR 4 +#define FW_VERSION_MICRO 16 struct port_stats { u64 tx_octets; /* total # of octets in good frames */ @@ -190,7 +199,6 @@ struct tp_proxy_stats { struct tp_cpl_stats { u32 req[4]; u32 rsp[4]; - u32 tx_err[4]; }; struct tp_rdma_stats { @@ -214,9 +222,9 @@ struct vpd_params { }; struct pci_params { - unsigned int vpd_cap_addr; - unsigned char speed; - unsigned char width; + unsigned int vpd_cap_addr; + unsigned short speed; + unsigned short width; }; /* @@ -239,20 +247,20 @@ struct adapter_params { unsigned int fw_vers; unsigned int tp_vers; - u8 api_vers[7]; unsigned short mtus[NMTUS]; unsigned short a_wnd[NCCTRL_WIN]; unsigned short b_wnd[NCCTRL_WIN]; - unsigned int mc_size; /* MC memory size */ - unsigned int nfilters; /* size of filter region */ + unsigned int mc_size; /* MC memory size */ + unsigned int nfilters; /* size of filter region */ unsigned int cim_la_size; - unsigned int nports; /* # of ethernet ports */ + /* Used as int in sysctls, do not reduce size */ + unsigned int nports; /* # of ethernet ports */ unsigned int portvec; - unsigned int rev; /* chip revision */ + unsigned int rev; /* chip revision */ unsigned int offload; unsigned int ofldq_wr_cred; @@ -366,6 +374,9 @@ int t4_seeprom_wp(struct adapter *adapte int t4_read_flash(struct adapter *adapter, unsigned int addr, unsigned int nwords, u32 *data, int byte_oriented); int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); +int t4_load_boot(struct adapter *adap, const u8 *boot_data, + unsigned int boot_addr, unsigned int size); +unsigned int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); @@ -460,8 +471,8 @@ int t4_wol_pat_enable(struct adapter *ad int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, enum dev_master master, enum dev_state *state); int t4_fw_bye(struct adapter *adap, unsigned int mbox); -int t4_early_init(struct adapter *adap, unsigned int mbox); int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset); +int t4_fw_initialize(struct adapter *adap, unsigned int mbox); int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, u32 *val); Modified: stable/9/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_hw.c Mon Feb 6 18:11:00 2012 (r231092) +++ stable/9/sys/dev/cxgbe/common/t4_hw.c Mon Feb 6 18:11:01 2012 (r231093) @@ -30,10 +30,10 @@ __FBSDID("$FreeBSD$"); #include "common.h" #include "t4_regs.h" #include "t4_regs_values.h" -#include "t4fw_interface.h" +#include "firmware/t4fw_interface.h" #undef msleep -#define msleep(x) DELAY((x) * 1000) +#define msleep(x) pause("t4hw", (x) * hz / 1000) /** * t4_wait_op_done_val - wait until an operation is completed @@ -187,7 +187,7 @@ int t4_wr_mbox_meat(struct adapter *adap * off to larger delays to a maximum retry delay. */ static const int delay[] = { - 1, 1, 3, 5, 10, 10, 20, 50, 100, 200 + 1, 1, 3, 5, 10, 10, 20, 50, 100 }; u32 v; @@ -625,17 +625,6 @@ enum { SF_RD_DATA_FAST = 0xb, /* read flash */ SF_RD_ID = 0x9f, /* read ID */ SF_ERASE_SECTOR = 0xd8, /* erase sector */ - - FW_START_SEC = 8, /* first flash sector for FW */ - FW_END_SEC = 15, /* last flash sector for FW */ - FW_IMG_START = FW_START_SEC * SF_SEC_SIZE, - FW_MAX_SIZE = (FW_END_SEC - FW_START_SEC + 1) * SF_SEC_SIZE, - - FLASH_CFG_MAX_SIZE = 0x10000 , /* max size of the flash config file */ - FLASH_CFG_OFFSET = 0x1f0000, - FLASH_CFG_START_SEC = FLASH_CFG_OFFSET / SF_SEC_SIZE, - FPGA_FLASH_CFG_OFFSET = 0xf0000 , /* if FPGA mode, then cfg file is at 1MB - 64KB */ - FPGA_FLASH_CFG_START_SEC = FPGA_FLASH_CFG_OFFSET / SF_SEC_SIZE, }; /** @@ -763,12 +752,15 @@ int t4_read_flash(struct adapter *adapte * @addr: the start address to write * @n: length of data to write in bytes * @data: the data to write + * @byte_oriented: whether to store data as bytes or as words * * Writes up to a page of data (256 bytes) to the serial flash starting * at the given address. All the data must be written to the same page. + * If @byte_oriented is set the write data is stored as byte stream + * (i.e. matches what on disk), otherwise in big-endian. */ static int t4_write_flash(struct adapter *adapter, unsigned int addr, - unsigned int n, const u8 *data) + unsigned int n, const u8 *data, int byte_oriented) { int ret; u32 buf[SF_PAGE_SIZE / 4]; @@ -788,6 +780,9 @@ static int t4_write_flash(struct adapter for (val = 0, i = 0; i < c; ++i) val = (val << 8) + *data++; + if (!byte_oriented) + val = htonl(val); + ret = sf1_write(adapter, c, c != left, 1, val); if (ret) goto unlock; @@ -799,7 +794,8 @@ static int t4_write_flash(struct adapter t4_write_reg(adapter, A_SF_OP, 0); /* unlock SF */ /* Read the page to verify the write succeeded */ - ret = t4_read_flash(adapter, addr & ~0xff, ARRAY_SIZE(buf), buf, 1); + ret = t4_read_flash(adapter, addr & ~0xff, ARRAY_SIZE(buf), buf, + byte_oriented); if (ret) return ret; @@ -825,7 +821,7 @@ unlock: int t4_get_fw_version(struct adapter *adapter, u32 *vers) { return t4_read_flash(adapter, - FW_IMG_START + offsetof(struct fw_hdr, fw_ver), 1, + FLASH_FW_START + offsetof(struct fw_hdr, fw_ver), 1, vers, 0); } @@ -838,7 +834,7 @@ int t4_get_fw_version(struct adapter *ad */ int t4_get_tp_version(struct adapter *adapter, u32 *vers) { - return t4_read_flash(adapter, FW_IMG_START + offsetof(struct fw_hdr, + return t4_read_flash(adapter, FLASH_FW_START + offsetof(struct fw_hdr, tp_microcode_ver), 1, vers, 0); } @@ -854,24 +850,17 @@ int t4_get_tp_version(struct adapter *ad */ int t4_check_fw_version(struct adapter *adapter) { - u32 api_vers[2]; int ret, major, minor, micro; ret = t4_get_fw_version(adapter, &adapter->params.fw_vers); if (!ret) ret = t4_get_tp_version(adapter, &adapter->params.tp_vers); - if (!ret) - ret = t4_read_flash(adapter, - FW_IMG_START + offsetof(struct fw_hdr, intfver_nic), - 2, api_vers, 1); if (ret) return ret; major = G_FW_HDR_FW_VER_MAJOR(adapter->params.fw_vers); minor = G_FW_HDR_FW_VER_MINOR(adapter->params.fw_vers); micro = G_FW_HDR_FW_VER_MICRO(adapter->params.fw_vers); - memcpy(adapter->params.api_vers, api_vers, - sizeof(adapter->params.api_vers)); if (major != FW_VERSION_MAJOR) { /* major mismatch - fail */ CH_ERR(adapter, "card FW has major version %u, driver wants " @@ -914,6 +903,21 @@ static int t4_flash_erase_sectors(struct } /** + * t4_flash_cfg_addr - return the address of the flash configuration file + * @adapter: the adapter + * + * Return the address within the flash where the Firmware Configuration + * File is stored. + */ +unsigned int t4_flash_cfg_addr(struct adapter *adapter) +{ + if (adapter->params.sf_size == 0x100000) + return FLASH_FPGA_CFG_START; + else + return FLASH_CFG_START; +} + +/** * t4_load_cfg - download config file * @adap: the adapter * @cfg_data: the cfg text file to write @@ -928,17 +932,8 @@ int t4_load_cfg(struct adapter *adap, co unsigned int flash_cfg_start_sec; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - if (adap->params.sf_size == 0x100000) { - addr = FPGA_FLASH_CFG_OFFSET; - flash_cfg_start_sec = FPGA_FLASH_CFG_START_SEC; - } else { - addr = FLASH_CFG_OFFSET; - flash_cfg_start_sec = FLASH_CFG_START_SEC; - } - if (!size) { - CH_ERR(adap, "cfg file has no data\n"); - return -EINVAL; - } + addr = t4_flash_cfg_addr(adap); + flash_cfg_start_sec = addr / SF_SEC_SIZE; if (size > FLASH_CFG_MAX_SIZE) { CH_ERR(adap, "cfg file too large, max is %u bytes\n", @@ -950,7 +945,11 @@ int t4_load_cfg(struct adapter *adap, co sf_sec_size); ret = t4_flash_erase_sectors(adap, flash_cfg_start_sec, flash_cfg_start_sec + i - 1); - if (ret) + /* + * If size == 0 then we're simply erasing the FLASH sectors associated + * with the on-adapter Firmware Configuration File. + */ + if (ret || size == 0) goto out; /* this will write to the flash up to SF_PAGE_SIZE at a time */ @@ -959,7 +958,7 @@ int t4_load_cfg(struct adapter *adap, co n = size - i; else n = SF_PAGE_SIZE; - ret = t4_write_flash(adap, addr, n, cfg_data); + ret = t4_write_flash(adap, addr, n, cfg_data, 1); if (ret) goto out; @@ -969,7 +968,8 @@ int t4_load_cfg(struct adapter *adap, co out: if (ret) - CH_ERR(adap, "config file download failed %d\n", ret); + CH_ERR(adap, "config file %s failed %d\n", + (size == 0 ? "clear" : "download"), ret); return ret; } @@ -1004,9 +1004,9 @@ int t4_load_fw(struct adapter *adap, con CH_ERR(adap, "FW image size differs from size in FW header\n"); return -EINVAL; } - if (size > FW_MAX_SIZE) { + if (size > FLASH_FW_MAX_SIZE) { CH_ERR(adap, "FW image too large, max is %u bytes\n", - FW_MAX_SIZE); + FLASH_FW_MAX_SIZE); return -EFBIG; } @@ -1020,7 +1020,8 @@ int t4_load_fw(struct adapter *adap, con } i = DIV_ROUND_UP(size, sf_sec_size); /* # of sectors spanned */ - ret = t4_flash_erase_sectors(adap, FW_START_SEC, FW_START_SEC + i - 1); + ret = t4_flash_erase_sectors(adap, FLASH_FW_START_SEC, + FLASH_FW_START_SEC + i - 1); if (ret) goto out; @@ -1031,28 +1032,110 @@ int t4_load_fw(struct adapter *adap, con */ memcpy(first_page, fw_data, SF_PAGE_SIZE); ((struct fw_hdr *)first_page)->fw_ver = htonl(0xffffffff); - ret = t4_write_flash(adap, FW_IMG_START, SF_PAGE_SIZE, first_page); + ret = t4_write_flash(adap, FLASH_FW_START, SF_PAGE_SIZE, first_page, 1); if (ret) goto out; - addr = FW_IMG_START; + addr = FLASH_FW_START; for (size -= SF_PAGE_SIZE; size; size -= SF_PAGE_SIZE) { addr += SF_PAGE_SIZE; fw_data += SF_PAGE_SIZE; - ret = t4_write_flash(adap, addr, SF_PAGE_SIZE, fw_data); + ret = t4_write_flash(adap, addr, SF_PAGE_SIZE, fw_data, 1); if (ret) goto out; } ret = t4_write_flash(adap, - FW_IMG_START + offsetof(struct fw_hdr, fw_ver), - sizeof(hdr->fw_ver), (const u8 *)&hdr->fw_ver); + FLASH_FW_START + offsetof(struct fw_hdr, fw_ver), + sizeof(hdr->fw_ver), (const u8 *)&hdr->fw_ver, 1); out: if (ret) CH_ERR(adap, "firmware download failed, error %d\n", ret); return ret; } +/* BIOS boot header */ +typedef struct boot_header_s { + u8 signature[2]; /* signature */ + u8 length; /* image length (include header) */ + u8 offset[4]; /* initialization vector */ + u8 reserved[19]; /* reserved */ + u8 exheader[2]; /* offset to expansion header */ +} boot_header_t; + +enum { + BOOT_FLASH_BOOT_ADDR = 0x0,/* start address of boot image in flash */ + BOOT_SIGNATURE = 0xaa55, /* signature of BIOS boot ROM */ + BOOT_SIZE_INC = 512, /* image size measured in 512B chunks */ + BOOT_MIN_SIZE = sizeof(boot_header_t), /* at least basic header */ + BOOT_MAX_SIZE = 1024*BOOT_SIZE_INC /* 1 byte * length increment */ +}; + +/* + * t4_load_boot - download boot flash + * @adapter: the adapter + * @boot_data: the boot image to write + * @size: image size + * + * Write the supplied boot image to the card's serial flash. + * The boot image has the following sections: a 28-byte header and the + * boot image. + */ +int t4_load_boot(struct adapter *adap, const u8 *boot_data, + unsigned int boot_addr, unsigned int size) +{ + int ret, addr; + unsigned int i; + unsigned int boot_sector = boot_addr * 1024; + unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; + + /* + * Perform some primitive sanity testing to avoid accidentally + * writing garbage over the boot sectors. We ought to check for + * more but it's not worth it for now ... + */ + if (size < BOOT_MIN_SIZE || size > BOOT_MAX_SIZE) { + CH_ERR(adap, "boot image too small/large\n"); + return -EFBIG; + } + + /* + * Make sure the boot image does not encroach on the firmware region + */ + if ((boot_sector + size) >> 16 > FLASH_FW_START_SEC) { + CH_ERR(adap, "boot image encroaching on firmware region\n"); + return -EFBIG; + } + + i = DIV_ROUND_UP(size, sf_sec_size); /* # of sectors spanned */ + ret = t4_flash_erase_sectors(adap, boot_sector >> 16, + (boot_sector >> 16) + i - 1); + if (ret) + goto out; + + /* + * Skip over the first SF_PAGE_SIZE worth of data and write it after + * we finish copying the rest of the boot image. This will ensure + * that the BIOS boot header will only be written if the boot image + * was written in full. + */ + addr = boot_sector; + for (size -= SF_PAGE_SIZE; size; size -= SF_PAGE_SIZE) { + addr += SF_PAGE_SIZE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 18:15:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D46E61065672; Mon, 6 Feb 2012 18:15:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7FD38FC0C; Mon, 6 Feb 2012 18:15:46 +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 q16IFkuZ047802; Mon, 6 Feb 2012 18:15:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IFkd4047796; Mon, 6 Feb 2012 18:15:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202061815.q16IFkd4047796@svn.freebsd.org> From: Ed Schouten Date: Mon, 6 Feb 2012 18:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231095 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:15:47 -0000 Author: ed Date: Mon Feb 6 18:15:46 2012 New Revision: 231095 URL: http://svn.freebsd.org/changeset/base/231095 Log: Fix whitespace inconsistencies in TTY code. Modified: head/sys/kern/tty.c head/sys/kern/tty_info.c head/sys/kern/tty_ttydisc.c head/sys/sys/ttycom.h head/sys/sys/ttydefaults.h Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/kern/tty.c Mon Feb 6 18:15:46 2012 (r231095) @@ -1229,7 +1229,7 @@ tty_makedev(struct tty *tp, struct ucred /* Slave call-out devices. */ if (tp->t_flags & TF_INITLOCK) { - dev = make_dev_cred(&ttyil_cdevsw, + dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_CALLOUT | TTYUNIT_INIT, cred, UID_UUCP, GID_DIALER, 0660, "cua%s.init", name); dev_depends(tp->t_dev, dev); Modified: head/sys/kern/tty_info.c ============================================================================== --- head/sys/kern/tty_info.c Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/kern/tty_info.c Mon Feb 6 18:15:46 2012 (r231095) @@ -109,7 +109,7 @@ thread_compare(struct thread *td, struct /* * Fetch running stats, pctcpu usage, and interruptable flag. - */ + */ thread_lock(td); runa = TD_IS_RUNNING(td) | TD_ON_RUNQ(td); slpa = td->td_flags & TDF_SINTR; @@ -173,7 +173,7 @@ proc_compare(struct proc *p1, struct pro PROC_LOCK(p2); runb = proc_sum(p2, &estb); PROC_UNLOCK(p2); - + /* * see if at least one of them is runnable */ Modified: head/sys/kern/tty_ttydisc.c ============================================================================== --- head/sys/kern/tty_ttydisc.c Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/kern/tty_ttydisc.c Mon Feb 6 18:15:46 2012 (r231095) @@ -661,7 +661,6 @@ ttydisc_echo(struct tty *tp, char c, int return ttydisc_echo_force(tp, c, quote); } - static void ttydisc_reprint_char(void *d, char c, int quote) { Modified: head/sys/sys/ttycom.h ============================================================================== --- head/sys/sys/ttycom.h Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/sys/ttycom.h Mon Feb 6 18:15:46 2012 (r231095) @@ -105,7 +105,7 @@ struct winsize { #define TIOCM_SR 0020 /* secondary receive */ #define TIOCM_CTS 0040 /* clear to send */ #define TIOCM_DCD 0100 /* data carrier detect */ -#define TIOCM_RI 0200 /* ring indicate */ +#define TIOCM_RI 0200 /* ring indicate */ #define TIOCM_DSR 0400 /* data set ready */ #define TIOCM_CD TIOCM_DCD #define TIOCM_CAR TIOCM_DCD Modified: head/sys/sys/ttydefaults.h ============================================================================== --- head/sys/sys/ttydefaults.h Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/sys/ttydefaults.h Mon Feb 6 18:15:46 2012 (r231095) @@ -79,9 +79,9 @@ #define CSTART CTRL('Q') #define CSTOP CTRL('S') #define CLNEXT CTRL('V') -#define CDISCARD CTRL('O') -#define CWERASE CTRL('W') -#define CREPRINT CTRL('R') +#define CDISCARD CTRL('O') +#define CWERASE CTRL('W') +#define CREPRINT CTRL('R') #define CEOT CEOF /* compat */ #define CBRK CEOL From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 18:44:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A54A106566C; Mon, 6 Feb 2012 18:44:27 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6D15A8FC13; Mon, 6 Feb 2012 18:44:25 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so6808145bkb.13 for ; Mon, 06 Feb 2012 10:44:25 -0800 (PST) Received: by 10.204.156.23 with SMTP id u23mr9074765bkw.18.1328553864896; Mon, 06 Feb 2012 10:44:24 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-139-144.pppoe.spdop.ru. [95.165.139.144]) by mx.google.com with ESMTPS id cz3sm48085090bkb.3.2012.02.06.10.44.23 (version=SSLv3 cipher=OTHER); Mon, 06 Feb 2012 10:44:24 -0800 (PST) Message-ID: <4F301F86.8070003@zonov.org> Date: Mon, 06 Feb 2012 22:44:22 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Gleb Smirnoff References: <201202051653.q15Gr3AB092056@svn.freebsd.org> In-Reply-To: <201202051653.q15Gr3AB092056@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231025 - in head: share/man/man4 sys/netinet sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:44:27 -0000 On 05.02.2012 20:53, Gleb Smirnoff wrote: > Author: glebius > Date: Sun Feb 5 16:53:02 2012 > New Revision: 231025 > URL: http://svn.freebsd.org/changeset/base/231025 > > Log: > Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and > TCP_KEEPCNT, that allow to control initial timeout, idle time, idle > re-send interval and idle send count on a per-socket basis. > > Reviewed by: andre, bz, lstewart > Hi Gleb, Maybe while you're here you can find solution for PR14400? -- Andrey Zonov From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 18:46:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0E821065674; Mon, 6 Feb 2012 18:46:50 +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 AF29C8FC1A; Mon, 6 Feb 2012 18:46:50 +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 q16IkoWI048865; Mon, 6 Feb 2012 18:46:50 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IkoQY048863; Mon, 6 Feb 2012 18:46:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202061846.q16IkoQY048863@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 6 Feb 2012 18:46:50 +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: r231096 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:46:50 -0000 Author: np Date: Mon Feb 6 18:46:49 2012 New Revision: 231096 URL: http://svn.freebsd.org/changeset/base/231096 Log: MFC r229714 Always release the inp lock before returning from tcp_detach. Modified: stable/9/sys/netinet/tcp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/9/sys/netinet/tcp_usrreq.c Mon Feb 6 18:15:46 2012 (r231095) +++ stable/9/sys/netinet/tcp_usrreq.c Mon Feb 6 18:46:49 2012 (r231096) @@ -204,8 +204,10 @@ tcp_detach(struct socket *so, struct inp tcp_discardcb(tp); in_pcbdetach(inp); in_pcbfree(inp); - } else + } else { in_pcbdetach(inp); + INP_WUNLOCK(inp); + } } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 18:47:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85771106567B; Mon, 6 Feb 2012 18:47:08 +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 73C7D8FC19; Mon, 6 Feb 2012 18:47:08 +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 q16Il8w7048913; Mon, 6 Feb 2012 18:47:08 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16Il8Gw048911; Mon, 6 Feb 2012 18:47:08 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202061847.q16Il8Gw048911@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 6 Feb 2012 18:47:08 +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: r231097 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:47:08 -0000 Author: np Date: Mon Feb 6 18:47:07 2012 New Revision: 231097 URL: http://svn.freebsd.org/changeset/base/231097 Log: MFC r229714 Always release the inp lock before returning from tcp_detach. Modified: stable/8/sys/netinet/tcp_usrreq.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/8/sys/netinet/tcp_usrreq.c Mon Feb 6 18:46:49 2012 (r231096) +++ stable/8/sys/netinet/tcp_usrreq.c Mon Feb 6 18:47:07 2012 (r231097) @@ -202,8 +202,10 @@ tcp_detach(struct socket *so, struct inp tcp_discardcb(tp); in_pcbdetach(inp); in_pcbfree(inp); - } else + } else { in_pcbdetach(inp); + INP_WUNLOCK(inp); + } } } From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 18:52:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26951106566C; Mon, 6 Feb 2012 18:52:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 157C68FC16; Mon, 6 Feb 2012 18:52:41 +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 q16IqeJ3049113; Mon, 6 Feb 2012 18:52:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IqeIx049110; Mon, 6 Feb 2012 18:52:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202061852.q16IqeIx049110@svn.freebsd.org> From: Ed Schouten Date: Mon, 6 Feb 2012 18:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231098 - head/tools/tools/fixwhite X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:52:41 -0000 Author: ed Date: Mon Feb 6 18:52:40 2012 New Revision: 231098 URL: http://svn.freebsd.org/changeset/base/231098 Log: Add a `fix' for another whitespace bug. If the sentence starts with a multiple of eight spaces, the sentence should in almost all practical cases have started with tabs instead. Replace these spaces by tabs. Modified: head/tools/tools/fixwhite/fixwhite.1 head/tools/tools/fixwhite/fixwhite.c Modified: head/tools/tools/fixwhite/fixwhite.1 ============================================================================== --- head/tools/tools/fixwhite/fixwhite.1 Mon Feb 6 18:47:07 2012 (r231097) +++ head/tools/tools/fixwhite/fixwhite.1 Mon Feb 6 18:52:40 2012 (r231098) @@ -41,6 +41,8 @@ and prints the result to standard output It removes leading and trailing empty lines from the input, as well as trailing whitespace characters from ever line of text. Multiple successive empty lines are merged together. +If the whitespace at the beginning of a sentence is exactly a multiple +of eight spaces, the whitespace is replaced by tabs. Also, spaces preceeding tabs will be merged into the tab character. .Sh AUTHORS .An Ed Schouten Aq ed@FreeBSD.org Modified: head/tools/tools/fixwhite/fixwhite.c ============================================================================== --- head/tools/tools/fixwhite/fixwhite.c Mon Feb 6 18:47:07 2012 (r231097) +++ head/tools/tools/fixwhite/fixwhite.c Mon Feb 6 18:52:40 2012 (r231098) @@ -110,6 +110,19 @@ savewhite(char c, bool leading) static void printwhite(void) { + off_t i; + + /* Merge spaces at the start of a sentence to tabs if possible. */ + if ((column % 8) == 0) { + for (i = 0; i < column; i++) + if (!peekbyte(i + 1, ' ')) + break; + if (i == column) { + queuelen -= column; + for (i = 0; i < column; i += 8) + queue[queuelen++] = '\t'; + } + } if (fwrite(queue, 1, queuelen, stdout) != queuelen) { perror("write"); From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 19:18:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6A3106564A; Mon, 6 Feb 2012 19:18:54 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 659B18FC17; Mon, 6 Feb 2012 19:18:52 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so6840261bkb.13 for ; Mon, 06 Feb 2012 11:18:52 -0800 (PST) Received: by 10.205.137.14 with SMTP id im14mr8738883bkc.133.1328555931855; Mon, 06 Feb 2012 11:18:51 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-139-144.pppoe.spdop.ru. [95.165.139.144]) by mx.google.com with ESMTPS id w15sm7348006bku.0.2012.02.06.11.18.50 (version=SSLv3 cipher=OTHER); Mon, 06 Feb 2012 11:18:51 -0800 (PST) Message-ID: <4F30279A.4010307@zonov.org> Date: Mon, 06 Feb 2012 23:18:50 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: John Baldwin References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> <20120206144337.GH1324@garage.freebsd.pl> <201202061025.42239.jhb@freebsd.org> In-Reply-To: <201202061025.42239.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Guy Helmer , svn-src-all@freebsd.org, Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 19:18:54 -0000 On 06.02.2012 19:25, John Baldwin wrote: >> >> My expectation is that as long as parent process holds pidfile >> descriptor open and locked, the pidfile should remain locked even after >> fork(2)/execve(2). Worth checking, though. > > Yes, if the daemon process hung around that would work. Note that I think > you would need to do a double-fork for that to work though since users > expect daemon to return instantly and not need to be put in the background. > It would be also nice to have an option for automatically respawn the child. This option has GNU version of daemon. What do you think? -- Andrey Zonov From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 20:23:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0A151065672; Mon, 6 Feb 2012 20:23:21 +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 CF1B38FC12; Mon, 6 Feb 2012 20: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 q16KNLjO051999; Mon, 6 Feb 2012 20:23:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16KNLnI051997; Mon, 6 Feb 2012 20:23:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202062023.q16KNLnI051997@svn.freebsd.org> From: Adrian Chadd Date: Mon, 6 Feb 2012 20:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231099 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 20:23:22 -0000 Author: adrian Date: Mon Feb 6 20:23:21 2012 New Revision: 231099 URL: http://svn.freebsd.org/changeset/base/231099 Log: Contribute some example code which demonstrates how to initialise the radar parameters for the AR5416 and later NICs. These parameters have been tested on the following NICs: * AR5416 * AR9160 * AR9220 * AR9280 And yes, these will return radar pulse parameters and (for AR9160 and later) radar FFT information as PHY errors. This is again not enough to do radar detection, it's just here to faciliate development and validation of radar detection algorithms. The (pulse, not FFT) decoding code for AR5212, AR5416 and later NICs exist in the HAL. This code is disabled for now as generating radar PHY errors can quickly cause issues in busy environment.s Some further debugging of the RX path is needed. Finally, these parameters are likely not useful for the AR5212 era NICs. The madwifi-dfs branch should have suitable example parameters for the 11a era NICs. Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon Feb 6 18:52:40 2012 (r231098) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon Feb 6 20:23:21 2012 (r231099) @@ -71,6 +71,28 @@ __FBSDID("$FreeBSD$"); #include /* + * These are default parameters for the AR5416 and + * later 802.11n NICs. They simply enable some + * radar pulse event generation. + * + * These are very likely not valid for the AR5212 era + * NICs. + * + * Since these define signal sizing and threshold + * parameters, they may need changing based on the + * specific antenna and receive amplifier + * configuration. + */ +#define AR5416_DFS_FIRPWR -33 +#define AR5416_DFS_RRSSI 20 +#define AR5416_DFS_HEIGHT 10 +#define AR5416_DFS_PRSSI 15 +#define AR5416_DFS_INBAND 15 +#define AR5416_DFS_RELPWR 8 +#define AR5416_DFS_RELSTEP 12 +#define AR5416_DFS_MAXLEN 255 + +/* * Methods which are required */ @@ -98,16 +120,45 @@ ath_dfs_detach(struct ath_softc *sc) int ath_dfs_radar_enable(struct ath_softc *sc, struct ieee80211_channel *chan) { +#if 0 + HAL_PHYERR_PARAM pe; + /* Check if the current channel is radar-enabled */ if (! IEEE80211_IS_CHAN_DFS(chan)) return (0); + /* Enable radar PHY error reporting */ + sc->sc_dodfs = 1; + /* - * Enabling the radar parameters and setting sc->sc_dodfs = 1 - * would occur here. + * These are general examples of the parameter values + * to use when configuring radar pulse detection for + * the AR5416, AR91xx, AR92xx NICs. They are only + * for testing and do require tuning depending upon the + * hardware and deployment specifics. */ + pe.pe_firpwr = AR5416_DFS_FIRPWR; + pe.pe_rrssi = AR5416_DFS_RRSSI; + pe.pe_height = AR5416_DFS_HEIGHT; + pe.pe_prssi = AR5416_DFS_PRSSI; + pe.pe_inband = AR5416_DFS_INBAND; + pe.pe_relpwr = AR5416_DFS_RELPWR; + pe.pe_relstep = AR5416_DFS_RELSTEP; + pe.pe_maxlen = AR5416_DFS_MAXLEN; + pe.pe_enabled = 1; + + /* Flip on extension channel events only if doing HT40 */ + if (IEEE80211_IS_CHAN_HT40(chan)) + pe.pe_extchannel = 1; + else + pe.pe_extchannel = 0; + + ath_hal_enabledfs(sc->sc_ah, &pe); return (1); +#else + return (0); +#endif } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 21:23:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CB3B106566C; Mon, 6 Feb 2012 21:23:13 +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 09AE78FC12; Mon, 6 Feb 2012 21:23:13 +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 q16LNCmm054165; Mon, 6 Feb 2012 21:23:12 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16LNCRQ054163; Mon, 6 Feb 2012 21:23:12 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202062123.q16LNCRQ054163@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 6 Feb 2012 21:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231100 - in stable/8: tools/tools tools/tools/cxgbetool tools/tools/cxgbtool usr.sbin/cxgbtool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:23:13 -0000 Author: np Date: Mon Feb 6 21:23:12 2012 New Revision: 231100 URL: http://svn.freebsd.org/changeset/base/231100 Log: MFC r222900 and r224768 r222900: cxgbetool: a tool for the cxgbe(4) driver. r224768: Move cxgbtool from usr.sbin to tools/tools. Added: stable/8/tools/tools/cxgbetool/ - copied from r222900, head/tools/tools/cxgbetool/ stable/8/tools/tools/cxgbtool/ - copied from r224768, head/tools/tools/cxgbtool/ Deleted: stable/8/usr.sbin/cxgbtool/ Modified: stable/8/tools/tools/README Directory Properties: stable/8/tools/tools/ (props changed) Modified: stable/8/tools/tools/README ============================================================================== --- stable/8/tools/tools/README Mon Feb 6 20:23:21 2012 (r231099) +++ stable/8/tools/tools/README Mon Feb 6 21:23:12 2012 (r231100) @@ -16,6 +16,8 @@ cfi Common Flash Interface (CFI) tool commitsdb A tool for reconstructing commit history using md5 checksums of the commit logs. crypto Test and exercise tools related to the crypto framework +cxgbetool A tool for the cxgbe(4) driver. +cxgbtool A tool for the cxgb(4) driver. diffburst OBSOLETE: equivalent functionality is available via split -p. For example: "split -p ^diff < patchfile". See split(1). editing Editor modes and the like to help editing FreeBSD code. From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 21:35:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC97B1065673; Mon, 6 Feb 2012 21:35:11 +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 9B4048FC23; Mon, 6 Feb 2012 21:35: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 q16LZBe3054645; Mon, 6 Feb 2012 21:35:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16LZBhS054643; Mon, 6 Feb 2012 21:35:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202062135.q16LZBhS054643@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 Feb 2012 21:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231101 - head/usr.bin/rpcgen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:35:11 -0000 Author: dim Date: Mon Feb 6 21:35:11 2012 New Revision: 231101 URL: http://svn.freebsd.org/changeset/base/231101 Log: In usr.bin/rpcgen/rpc_main.c, use execvp(3) instead of execv(3), so rpcgen will search the current PATH for the preprocessor. This makes it possible to run a preprocessor built during the cross-tools stage of buildworld. MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 21:23:12 2012 (r231100) +++ head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 21:35:11 2012 (r231101) @@ -290,7 +290,6 @@ prepend_cpp(void) int idx = 1; const char *var; char *dupvar, *s, *t; - struct stat buf; if (CPP != NULL) insarg(0, CPP); @@ -306,11 +305,6 @@ prepend_cpp(void) free(dupvar); } - if (stat(arglist[0], &buf) < 0) { - warnx("cannot find C preprocessor: %s", arglist[0]); - crash(); - } - insarg(idx, CPPFLAGS); } @@ -334,8 +328,8 @@ open_input(const char *infile, const cha (void) close(1); (void) dup2(pd[1], 1); (void) close(pd[0]); - execv(arglist[0], arglist); - err(1, "execv"); + execvp(arglist[0], arglist); + err(1, "execvp %s", arglist[0]); case -1: err(1, "fork"); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 21:46:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAACC106564A; Mon, 6 Feb 2012 21:46:30 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2528FC08; Mon, 6 Feb 2012 21:46:29 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so6972502bkb.13 for ; Mon, 06 Feb 2012 13:46:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=/dzajcqNUoDpCICZErPnX9IbH1VrVyDp4My+97pQ+qM=; b=q7rDN8IlKZey5E+/AdNDlIbpdW2Tpy2Hx4UXZUYD9oW/kw4T+TPEOwgRqWmWB9afMr +Xx8ZRpz5yKNar/D/Yb74dc8rOCIZT11KLTKrZLnIBGKuR7AFaC1G9D/FkfWOi2yzdlU aPwa4AsUqWf66fSNHSWtl9rLYEqTfnfBJ7zyE= Received: by 10.204.154.86 with SMTP id n22mr8978731bkw.85.1328564788645; Mon, 06 Feb 2012 13:46:28 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id cg2sm49215788bkb.12.2012.02.06.13.46.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Feb 2012 13:46:27 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> X-Comment-To: Pawel Jakub Dawidek Sender: Mikolaj Golub Date: Mon, 06 Feb 2012 23:46:24 +0200 In-Reply-To: <20120206082706.GA1324@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Mon, 6 Feb 2012 09:27:06 +0100") Message-ID: <86wr7zmy8f.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:46:30 -0000 --=-=-= On Mon, 6 Feb 2012 09:27:06 +0100 Pawel Jakub Dawidek wrote: PJD> For the patch itself. PJD> You don't have to have two separate cases depending on request for PJD> pidfile. You can specify NULL pfh to the pidfile functions. PJD> Even in example from the manual page when pfh is NULL there is a case PJD> where we warn, but continue execution and call pidfile functions. PJD> This should simplify the code. PJD> If you do that (actually even if you don't), remember to either use PJD> warn(3) before pidfile_remove(3) and exit(3) after or preserve errno PJD> before calling pidfile_remove(3), as pidfile_remove(3) can modify it if PJD> unlink(2) is unsuccessful or pfh is NULL. Thanks. The updated version is attached. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=daemon.c.2.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231014) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -43,15 +44,16 @@ __FBSDID("$FreeBSD$"); #include static void restrict_process(const char *); +static void wait_child(pid_t pid); static void usage(void); int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + int ch, nochdir, noclose; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; pidfile = user = NULL; @@ -79,9 +81,7 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - if (user != NULL) - restrict_process(user); - + pfh = NULL; /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently @@ -100,22 +100,36 @@ main(int argc, char *argv[]) if (daemon(nochdir, noclose) == -1) err(1, NULL); - /* Now that we are the child, write out the pid */ - if (pidfile) + pid = 0; + if (pidfile) { + /* + * Spawn a child to exec the command, so in the parent + * we could wait for it to exit and remove pidfile. + */ + pid = fork(); + if (pid == -1) { + pidfile_remove(pfh); + err(1, "fork"); + } + } + if (pid == 0) { + /* Now that we are the child, write out the pid. */ pidfile_write(pfh); - execvp(argv[0], argv); + if (user != NULL) + restrict_process(user); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error - */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) - pidfile_remove(pfh); + execvp(argv[0], argv); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + wait_child(pid); + pidfile_remove(pfh); + exit(0); /* Exit status does not metter. */ } static void @@ -132,6 +146,19 @@ restrict_process(const char *user) } static void +wait_child(pid_t pid) +{ + int status; + + while (waitpid(pid, &status, 0) == -1) { + if (errno != EINTR) { + warn("waitpid"); + break; + } + } +} + +static void usage(void) { (void)fprintf(stderr, --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 21:50:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0692B106564A; Mon, 6 Feb 2012 21:50:13 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5D348FC0A; Mon, 6 Feb 2012 21:50: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 q16LoCuU055115; Mon, 6 Feb 2012 21:50:12 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16LoCJd055113; Mon, 6 Feb 2012 21:50:12 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201202062150.q16LoCJd055113@svn.freebsd.org> From: Don Lewis Date: Mon, 6 Feb 2012 21:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231102 - head/sbin/fsdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:50:13 -0000 Author: truckman Date: Mon Feb 6 21:50:11 2012 New Revision: 231102 URL: http://svn.freebsd.org/changeset/base/231102 Log: Improve sparse file handling when printing the block list for an inode by not bailing out early when a hole is encountered in the direct block list. Print NULL block pointers in the direct block list. Simplify the code that prints the fragment count. Match the style of the existing code. Reviewed by: mckusick MFC after: 1 week Modified: head/sbin/fsdb/fsdbutil.c Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Mon Feb 6 21:35:11 2012 (r231101) +++ head/sbin/fsdb/fsdbutil.c Mon Feb 6 21:50:11 2012 (r231102) @@ -293,22 +293,21 @@ printblocks(ino_t inum, union dinode *dp printf("Blocks for inode %d:\n", inum); printf("Direct blocks:\n"); ndb = howmany(DIP(dp, di_size), sblock.fs_bsize); - for (i = 0; i < NDADDR; i++) { - if (DIP(dp, di_db[i]) == 0) { - putchar('\n'); - return; - } + for (i = 0; i < NDADDR && i < ndb; i++) { if (i > 0) printf(", "); blkno = DIP(dp, di_db[i]); printf("%jd", (intmax_t)blkno); - if (--ndb == 0 && (offset = blkoff(&sblock, DIP(dp, di_size))) != 0) { + } + if (ndb <= NDADDR) { + offset = blkoff(&sblock, DIP(dp, di_size)); + if (offset != 0) { nfrags = numfrags(&sblock, fragroundup(&sblock, offset)); printf(" (%d frag%s)", nfrags, nfrags > 1? "s": ""); } } putchar('\n'); - if (ndb == 0) + if (ndb <= NDADDR) return; bufp = malloc((unsigned int)sblock.fs_bsize); From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 21:57:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E823B106564A; Mon, 6 Feb 2012 21:57:34 +0000 (UTC) (envelope-from ghelmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 564D38FC0C; Mon, 6 Feb 2012 21:57:34 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q16LvFZJ038565; Mon, 6 Feb 2012 15:57:16 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) Received: from [192.168.221.90] ([192.168.221.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q16Lv0Uv087096 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 6 Feb 2012 15:57:03 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q16Lv0Uv087096 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1328565425; bh=2++lRsVqfKz9BBtMLY1lIDdQrLR7kn9EpbzGL/TpGDA=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=FrhSpdfxhsrBGMcoxfBi5Y0tj1R8kgfT9RKEIPVyMInXUHn8hnIDrpVDlWMKh9AvV eo8R2dZyOmkf05rXKbEf07WKlw9yDBsa9XYHZF60IreIzZsCZUqNRzlPbEB8eC7nje NE0p0sJijnpUkskyJu/oY+X0qYe3WgwgRezx3Dp8= Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <86wr7zmy8f.fsf@kopusha.home.net> Date: Mon, 6 Feb 2012 15:56:59 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> To: Mikolaj Golub X-Mailer: Apple Mail (2.1257) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Mon, 06 Feb 2012 15:57:05 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q16Lv0Uv087096 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam, SpamAssassin (score=-0.806, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, J_CHICKENPOX_43 0.60, RP_8BIT 1.49) X-Palisade-MailScanner-From: ghelmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Andrey Zonov , Pawel Jakub Dawidek , src-committers@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:57:35 -0000 On Feb 6, 2012, at 3:46 PM, Mikolaj Golub wrote: >=20 > On Mon, 6 Feb 2012 09:27:06 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> For the patch itself. >=20 > PJD> You don't have to have two separate cases depending on request = for > PJD> pidfile. You can specify NULL pfh to the pidfile functions. > PJD> Even in example from the manual page when pfh is NULL there is a = case > PJD> where we warn, but continue execution and call pidfile functions. > PJD> This should simplify the code. >=20 > PJD> If you do that (actually even if you don't), remember to either = use > PJD> warn(3) before pidfile_remove(3) and exit(3) after or preserve = errno > PJD> before calling pidfile_remove(3), as pidfile_remove(3) can modify = it if > PJD> unlink(2) is unsuccessful or pfh is NULL. >=20 > Thanks. The updated version is attached. >=20 > --=20 > Mikolaj Golub >=20 > Index: usr.sbin/daemon/daemon.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 > --- usr.sbin/daemon/daemon.c (revision 231014) > +++ usr.sbin/daemon/daemon.c (working copy) > @@ -32,6 +32,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > +#include >=20 > #include > #include > @@ -43,15 +44,16 @@ __FBSDID("$FreeBSD$"); > #include >=20 > static void restrict_process(const char *); > +static void wait_child(pid_t pid); > static void usage(void); >=20 > int > main(int argc, char *argv[]) > { > struct pidfh *pfh =3D NULL; > - int ch, nochdir, noclose, errcode; > + int ch, nochdir, noclose; > const char *pidfile, *user; > - pid_t otherpid; > + pid_t otherpid, pid; >=20 > nochdir =3D noclose =3D 1; > pidfile =3D user =3D NULL; > @@ -79,9 +81,7 @@ main(int argc, char *argv[]) > if (argc =3D=3D 0) > usage(); >=20 > - if (user !=3D NULL) > - restrict_process(user); > - > + pfh =3D NULL; > /* > * Try to open the pidfile before calling daemon(3), > * to be able to report the error intelligently > @@ -100,22 +100,36 @@ main(int argc, char *argv[]) > if (daemon(nochdir, noclose) =3D=3D -1) > err(1, NULL); >=20 > - /* Now that we are the child, write out the pid */ > - if (pidfile) > + pid =3D 0; > + if (pidfile) { > + /* > + * Spawn a child to exec the command, so in the parent > + * we could wait for it to exit and remove pidfile. > + */ > + pid =3D fork(); > + if (pid =3D=3D -1) { > + pidfile_remove(pfh); > + err(1, "fork"); > + } > + } > + if (pid =3D=3D 0) { > + /* Now that we are the child, write out the pid. */ > pidfile_write(pfh); >=20 > - execvp(argv[0], argv); > + if (user !=3D NULL) > + restrict_process(user); >=20 > - /* > - * execvp() failed -- unlink pidfile if any, and > - * report the error > - */ > - errcode =3D errno; /* Preserve errcode -- unlink may reset it */ > - if (pidfile) > - pidfile_remove(pfh); > + execvp(argv[0], argv); >=20 > - /* The child is now running, so the exit status doesn't matter. = */ > - errc(1, errcode, "%s", argv[0]); > + /* > + * execvp() failed -- report the error. The child is > + * now running, so the exit status doesn't matter. > + */ > + err(1, "%s", argv[0]); > + } > + wait_child(pid); > + pidfile_remove(pfh); > + exit(0); /* Exit status does not metter. */ > } >=20 > static void > @@ -132,6 +146,19 @@ restrict_process(const char *user) > } >=20 > static void > +wait_child(pid_t pid) > +{ > + int status; > + > + while (waitpid(pid, &status, 0) =3D=3D -1) { > + if (errno !=3D EINTR) { > + warn("waitpid"); > + break; > + } > + } > +} > + > +static void > usage(void) > { > (void)fprintf(stderr, Generally looks good to me -- I had patches to do a similar change but = yours looks better. When I get a chance, I will test your change with = the O_CLOEXEC flag added back to the open() call in pidfile_open() -- = I'm not sure how soon I will be able to do that, though. Guy= -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 22:19:00 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0979A106566B; Mon, 6 Feb 2012 22:19:00 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 3F10F8FC1B; Mon, 6 Feb 2012 22:18:58 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 06FF9C04; Mon, 6 Feb 2012 23:18:56 +0100 (CET) Date: Mon, 6 Feb 2012 23:17:43 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120206221742.GA1336@garage.freebsd.pl> References: <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <86wr7zmy8f.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 22:19:00 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote: >=20 > On Mon, 6 Feb 2012 09:27:06 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> For the patch itself. >=20 > PJD> You don't have to have two separate cases depending on request for > PJD> pidfile. You can specify NULL pfh to the pidfile functions. > PJD> Even in example from the manual page when pfh is NULL there is a ca= se > PJD> where we warn, but continue execution and call pidfile functions. > PJD> This should simplify the code. >=20 > PJD> If you do that (actually even if you don't), remember to either use > PJD> warn(3) before pidfile_remove(3) and exit(3) after or preserve errno > PJD> before calling pidfile_remove(3), as pidfile_remove(3) can modify i= t if > PJD> unlink(2) is unsuccessful or pfh is NULL. >=20 > Thanks. The updated version is attached. Looks good to me. > Index: usr.sbin/daemon/daemon.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 > --- usr.sbin/daemon/daemon.c (revision 231014) > +++ usr.sbin/daemon/daemon.c (working copy) > @@ -32,6 +32,7 @@ > __FBSDID("$FreeBSD$"); > =20 > #include > +#include > =20 > #include > #include > @@ -43,15 +44,16 @@ __FBSDID("$FreeBSD$"); > #include > =20 > static void restrict_process(const char *); > +static void wait_child(pid_t pid); > static void usage(void); > =20 > int > main(int argc, char *argv[]) > { > struct pidfh *pfh =3D NULL; > - int ch, nochdir, noclose, errcode; > + int ch, nochdir, noclose; > const char *pidfile, *user; > - pid_t otherpid; > + pid_t otherpid, pid; > =20 > nochdir =3D noclose =3D 1; > pidfile =3D user =3D NULL; > @@ -79,9 +81,7 @@ main(int argc, char *argv[]) > if (argc =3D=3D 0) > usage(); > =20 > - if (user !=3D NULL) > - restrict_process(user); > - > + pfh =3D NULL; > /* > * Try to open the pidfile before calling daemon(3), > * to be able to report the error intelligently > @@ -100,22 +100,36 @@ main(int argc, char *argv[]) > if (daemon(nochdir, noclose) =3D=3D -1) > err(1, NULL); > =20 > - /* Now that we are the child, write out the pid */ > - if (pidfile) > + pid =3D 0; > + if (pidfile) { > + /* > + * Spawn a child to exec the command, so in the parent > + * we could wait for it to exit and remove pidfile. > + */ > + pid =3D fork(); > + if (pid =3D=3D -1) { > + pidfile_remove(pfh); > + err(1, "fork"); > + } > + } > + if (pid =3D=3D 0) { > + /* Now that we are the child, write out the pid. */ > pidfile_write(pfh); > =20 > - execvp(argv[0], argv); > + if (user !=3D NULL) > + restrict_process(user); > =20 > - /* > - * execvp() failed -- unlink pidfile if any, and > - * report the error > - */ > - errcode =3D errno; /* Preserve errcode -- unlink may reset it */ > - if (pidfile) > - pidfile_remove(pfh); > + execvp(argv[0], argv); > =20 > - /* The child is now running, so the exit status doesn't matter. */ > - errc(1, errcode, "%s", argv[0]); > + /* > + * execvp() failed -- report the error. The child is > + * now running, so the exit status doesn't matter. > + */ > + err(1, "%s", argv[0]); > + } > + wait_child(pid); > + pidfile_remove(pfh); > + exit(0); /* Exit status does not metter. */ > } > =20 > static void > @@ -132,6 +146,19 @@ restrict_process(const char *user) > } > =20 > static void > +wait_child(pid_t pid) > +{ > + int status; > + > + while (waitpid(pid, &status, 0) =3D=3D -1) { > + if (errno !=3D EINTR) { > + warn("waitpid"); > + break; > + } > + } > +} > + > +static void > usage(void) > { > (void)fprintf(stderr, --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8wUYYACgkQForvXbEpPzRWFACeLMppI61xkOQjJ2nLUfGW5lYq OvgAn1WBq/gfLvymZ3dfAehtk7OVhFjX =ffH+ -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 23:37:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1205) id 34D491065670; Mon, 6 Feb 2012 23:37:59 +0000 (UTC) Date: Mon, 6 Feb 2012 23:37:59 +0000 From: Navdeep Parhar To: Jason Hellenthal Message-ID: <20120206233759.GA63556@hub.freebsd.org> Mail-Followup-To: Jason Hellenthal , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org References: <201202062123.q16LNCRQ054163@svn.freebsd.org> <20120206233104.GA26403@DataIX.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120206233104.GA26403@DataIX.net> User-Agent: Mutt/1.4.2.1i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231100 - in stable/8: tools/tools tools/tools/cxgbetool tools/tools/cxgbtool usr.sbin/cxgbtool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 23:37:59 -0000 On Mon, Feb 06, 2012 at 06:31:05PM -0500, Jason Hellenthal wrote: > > Was this intentional ? cxgbtool to -> cxgbetool ? This could cause quite > the confusion. Two drivers, two tools: cxgbtool for cxgb(4), cxgbetool for cxgbe(4). This has always been the case. I just MFC'd the newer tool to 8 and moved the older tool to tools/tools too. Regards, Navdeep > > On Mon, Feb 06, 2012 at 09:23:12PM +0000, Navdeep Parhar wrote: > > Author: np > > Date: Mon Feb 6 21:23:12 2012 > > New Revision: 231100 > > URL: http://svn.freebsd.org/changeset/base/231100 > > > > Log: > > MFC r222900 and r224768 > > > > r222900: > > cxgbetool: a tool for the cxgbe(4) driver. > > > > r224768: > > Move cxgbtool from usr.sbin to tools/tools. > > > > Added: > > stable/8/tools/tools/cxgbetool/ > > - copied from r222900, head/tools/tools/cxgbetool/ > > stable/8/tools/tools/cxgbtool/ > > - copied from r224768, head/tools/tools/cxgbtool/ > > Deleted: > > stable/8/usr.sbin/cxgbtool/ > > Modified: > > stable/8/tools/tools/README > > Directory Properties: > > stable/8/tools/tools/ (props changed) > > > > Modified: stable/8/tools/tools/README > > ============================================================================== > > --- stable/8/tools/tools/README Mon Feb 6 20:23:21 2012 (r231099) > > +++ stable/8/tools/tools/README Mon Feb 6 21:23:12 2012 (r231100) > > @@ -16,6 +16,8 @@ cfi Common Flash Interface (CFI) tool > > commitsdb A tool for reconstructing commit history using md5 > > checksums of the commit logs. > > crypto Test and exercise tools related to the crypto framework > > +cxgbetool A tool for the cxgbe(4) driver. > > +cxgbtool A tool for the cxgb(4) driver. > > diffburst OBSOLETE: equivalent functionality is available via split -p. > > For example: "split -p ^diff < patchfile". See split(1). > > editing Editor modes and the like to help editing FreeBSD code. > > _______________________________________________ > > svn-src-stable-8@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" > > -- > ;s =; From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 23:57:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C64F71065673; Mon, 6 Feb 2012 23:57:03 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 59BF78FC18; Mon, 6 Feb 2012 23:57:03 +0000 (UTC) Received: by iaeo4 with SMTP id o4so13756963iae.13 for ; Mon, 06 Feb 2012 15:57:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=y1FPBIyRIhLf4JppPPXkEjRVaAzdUj9wjMWA6bv58/o=; b=o1Jjtl7gzlxzaJSsXz5jV8bEu1Z2SKb0S1HfQCqeydy4d5eFKSKxLixVYGzdpN5A0R 4BZpguqUaRiOrPrgaPTf8hGfodNMYMtBCGufpK0quum0vXruzIaMVbfCGjvFUIkbdGHB Wt00oGR//8mrUhvZ1cLDg0amulD4E1Vy0xeSY= Received: by 10.42.28.131 with SMTP id n3mr7124601icc.38.1328571070910; Mon, 06 Feb 2012 15:31:10 -0800 (PST) Received: from DataIX.net (adsl-99-181-135-57.dsl.klmzmi.sbcglobal.net. [99.181.135.57]) by mx.google.com with ESMTPS id wn7sm1657302igc.0.2012.02.06.15.31.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Feb 2012 15:31:09 -0800 (PST) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q16NV5Fl089054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Feb 2012 18:31:06 -0500 (EST) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q16NV5si087536; Mon, 6 Feb 2012 18:31:05 -0500 (EST) (envelope-from jhell@DataIX.net) Date: Mon, 6 Feb 2012 18:31:05 -0500 From: Jason Hellenthal To: Navdeep Parhar Message-ID: <20120206233104.GA26403@DataIX.net> References: <201202062123.q16LNCRQ054163@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202062123.q16LNCRQ054163@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231100 - in stable/8: tools/tools tools/tools/cxgbetool tools/tools/cxgbtool usr.sbin/cxgbtool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 23:57:04 -0000 Was this intentional ? cxgbtool to -> cxgbetool ? This could cause quite the confusion. On Mon, Feb 06, 2012 at 09:23:12PM +0000, Navdeep Parhar wrote: > Author: np > Date: Mon Feb 6 21:23:12 2012 > New Revision: 231100 > URL: http://svn.freebsd.org/changeset/base/231100 > > Log: > MFC r222900 and r224768 > > r222900: > cxgbetool: a tool for the cxgbe(4) driver. > > r224768: > Move cxgbtool from usr.sbin to tools/tools. > > Added: > stable/8/tools/tools/cxgbetool/ > - copied from r222900, head/tools/tools/cxgbetool/ > stable/8/tools/tools/cxgbtool/ > - copied from r224768, head/tools/tools/cxgbtool/ > Deleted: > stable/8/usr.sbin/cxgbtool/ > Modified: > stable/8/tools/tools/README > Directory Properties: > stable/8/tools/tools/ (props changed) > > Modified: stable/8/tools/tools/README > ============================================================================== > --- stable/8/tools/tools/README Mon Feb 6 20:23:21 2012 (r231099) > +++ stable/8/tools/tools/README Mon Feb 6 21:23:12 2012 (r231100) > @@ -16,6 +16,8 @@ cfi Common Flash Interface (CFI) tool > commitsdb A tool for reconstructing commit history using md5 > checksums of the commit logs. > crypto Test and exercise tools related to the crypto framework > +cxgbetool A tool for the cxgbe(4) driver. > +cxgbtool A tool for the cxgb(4) driver. > diffburst OBSOLETE: equivalent functionality is available via split -p. > For example: "split -p ^diff < patchfile". See split(1). > editing Editor modes and the like to help editing FreeBSD code. > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" -- ;s =; From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 01:26:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 084FE106566B; Tue, 7 Feb 2012 01:26:30 +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 E352A8FC0C; Tue, 7 Feb 2012 01:26:29 +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 q171QTCG062359; Tue, 7 Feb 2012 01:26:29 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q171QT7C062353; Tue, 7 Feb 2012 01:26:29 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070126.q171QT7C062353@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 01:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231103 - in stable/8: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware sys/modules/cxgbe sys/modules/cxgbe/firmware tools/tools/cxgbetool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 01:26:30 -0000 Author: np Date: Tue Feb 7 01:26:29 2012 New Revision: 231103 URL: http://svn.freebsd.org/changeset/base/231103 Log: MFC r228491, r228561, r228594. r228491: Do not clobber the ingress queue's congestion setting. r228561: Many updates to cxgbe(4) - Device configuration via plain text config file. Also able to operate when not attached to the chip as the master driver. - Generic "work request" queue that serves as the base for both ctrl and ofld tx queues. - Generic interrupt handler routine that can process any event on any kind of ingress queue (via a dispatch table). - A couple of new driver ioctls. cxgbetool can now install a firmware to the card ("loadfw" command) and can read the card's memory ("memdump" and "tcb" commands). - Lots of assorted information within dev.t4nex.X.misc.* This is primarily for debugging and won't show up in sysctl -a. - Code to manage the L2 tables on the chip. - Updates to cxgbe(4) man page to go with the tunables that have changed. - Updates to the shared code in common/ - Updates to the driver-firmware interface (now at fw 1.4.16.0) r228594: Catch up with new driver ioctls in cxgbe. Added: stable/8/sys/dev/cxgbe/firmware/ - copied from r228561, head/sys/dev/cxgbe/firmware/ stable/8/sys/modules/cxgbe/firmware/ - copied from r228561, head/sys/modules/cxgbe/firmware/ Deleted: stable/8/sys/dev/cxgbe/common/t4fw_interface.h Modified: stable/8/share/man/man4/cxgbe.4 stable/8/sys/dev/cxgbe/adapter.h stable/8/sys/dev/cxgbe/common/common.h stable/8/sys/dev/cxgbe/common/t4_hw.c stable/8/sys/dev/cxgbe/common/t4_hw.h stable/8/sys/dev/cxgbe/offload.h stable/8/sys/dev/cxgbe/osdep.h stable/8/sys/dev/cxgbe/t4_ioctl.h stable/8/sys/dev/cxgbe/t4_l2t.c stable/8/sys/dev/cxgbe/t4_l2t.h stable/8/sys/dev/cxgbe/t4_main.c stable/8/sys/dev/cxgbe/t4_sge.c stable/8/sys/modules/cxgbe/Makefile stable/8/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/tools/tools/ (props changed) Modified: stable/8/share/man/man4/cxgbe.4 ============================================================================== --- stable/8/share/man/man4/cxgbe.4 Mon Feb 6 21:50:11 2012 (r231102) +++ stable/8/share/man/man4/cxgbe.4 Tue Feb 7 01:26:29 2012 (r231103) @@ -99,18 +99,29 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.cxgbe.max_ntxq_10G_port -The maximum number of tx queues to use for a 10Gb port. -The default value is 8. -.It Va hw.cxgbe.max_nrxq_10G_port -The maximum number of rx queues to use for a 10Gb port. -The default value is 8. -.It Va hw.cxgbe.max_ntxq_1G_port -The maximum number of tx queues to use for a 1Gb port. -The default value is 2. -.It Va hw.cxgbe.max_nrxq_1G_port -The maximum number of rx queues to use for a 1Gb port. -The default value is 2. +.It Va hw.cxgbe.ntxq10g +The number of tx queues to use for a 10Gb port. The default is 16 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq10g +The number of rx queues to use for a 10Gb port. The default is 8 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.ntxq1g +The number of tx queues to use for a 1Gb port. The default is 4 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq1g +The number of rx queues to use for a 1Gb port. The default is 2 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldtxq10g +The number of TOE tx queues to use for a 10Gb port. The default is 8 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldrxq10g +The number of TOE rx queues to use for a 10Gb port. The default is 2 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldtxq1g +The number of TOE tx queues to use for a 1Gb port. The default is 2 or the +number of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nofldrxq1g +The number of TOE rx queues to use for a 1Gb port. The default is 1. .It Va hw.cxgbe.holdoff_timer_idx_10G .It Va hw.cxgbe.holdoff_timer_idx_1G The timer index value to use to delay interrupts. @@ -119,6 +130,8 @@ by default (all values are in microsecon value from this list. The default value is 1 for both 10Gb and 1Gb ports, which means the timer value is 5us. +Different cxgbe interfaces can be assigned different values at any time via the +dev.cxgbe.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G .It Va hw.cxgbe.holdoff_pktc_idx_1G The packet-count index value to use to delay interrupts. @@ -127,6 +140,11 @@ and the index selects a value from this The default value is 2 for both 10Gb and 1Gb ports, which means 16 packets (or the holdoff timer going off) before an interrupt is generated. +-1 disables packet counting. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.holdoff_pktc_idx sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). .It Va hw.cxgbe.qsize_txq The size, in number of entries, of the descriptor ring used for a tx queue. @@ -134,10 +152,46 @@ A buf_ring of the same size is also allo software queuing. See .Xr ifnet 9 . The default value is 1024. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.qsize_txq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). .It Va hw.cxgbe.qsize_rxq The size, in number of entries, of the descriptor ring used for an rx queue. The default value is 1024. +Different cxgbe interfaces can be assigned different values via the +dev.cxgbe.X.qsize_rxq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). +.It Va hw.cxgbe.interrupt_types +The interrupt types that the driver is allowed to use. +Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. +The default is 7 (all allowed). +The driver will select the best possible type out of the allowed types by +itself. +.It Va hw.cxgbe.config_file +Select a pre-packaged device configuration file. +A configuration file contains a recipe for partitioning and configuring the +hardware resources on the card. +This tunable is for specialized applications only and should not be used in +normal operation. +The configuration profile currently in use is available in the dev.t4nex.X.cf +and dev.t4nex.X.cfcsum sysctls. +.It Va hw.cxgbe.linkcaps_allowed +.It Va hw.cxgbe.niccaps_allowed +.It Va hw.cxgbe.toecaps_allowed +.It Va hw.cxgbe.rdmacaps_allowed +.It Va hw.cxgbe.iscsicaps_allowed +.It Va hw.cxgbe.fcoecaps_allowed +Disallowing capabilities provides a hint to the driver and firmware to not +reserve hardware resources for that feature. +Each of these is a bit field with a bit for each sub-capability within the +capability. +This tunable is for specialized applications only and should not be used in +normal operation. +The capabilities for which hardware resources have been reserved are listed in +dev.t4nex.X.*caps sysctls. .El .Sh SUPPORT For general information and support, Modified: stable/8/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/8/sys/dev/cxgbe/adapter.h Mon Feb 6 21:50:11 2012 (r231102) +++ stable/8/sys/dev/cxgbe/adapter.h Tue Feb 7 01:26:29 2012 (r231103) @@ -31,6 +31,7 @@ #ifndef __T4_ADAPTER_H__ #define __T4_ADAPTER_H__ +#include #include #include #include @@ -46,8 +47,9 @@ #include #include "offload.h" -#include "common/t4fw_interface.h" +#include "firmware/t4fw_interface.h" +#define T4_CFGNAME "t4fw_cfg" #define T4_FWNAME "t4fw" MALLOC_DECLARE(M_CXGBE); @@ -70,8 +72,9 @@ prefetch(void *x) #define CTLTYPE_U64 CTLTYPE_QUAD #endif -#if __FreeBSD_version >= 802507 -#define T4_DEVLOG 1 +#if (__FreeBSD_version >= 900030) || \ + ((__FreeBSD_version >= 802507) && (__FreeBSD_version < 900000)) +#define SBUF_DRAIN 1 #endif #ifdef __amd64__ @@ -120,25 +123,21 @@ enum { FW_IQ_QSIZE = 256, FW_IQ_ESIZE = 64, /* At least 64 mandated by the firmware spec */ - INTR_IQ_QSIZE = 64, - INTR_IQ_ESIZE = 64, /* Handles some CPLs too, do not reduce */ - - CTRL_EQ_QSIZE = 128, - CTRL_EQ_ESIZE = 64, - RX_IQ_QSIZE = 1024, RX_IQ_ESIZE = 64, /* At least 64 so CPL_RX_PKT will fit */ - RX_FL_ESIZE = 64, /* 8 64bit addresses */ + EQ_ESIZE = 64, /* All egress queues use this entry size */ + RX_FL_ESIZE = EQ_ESIZE, /* 8 64bit addresses */ #if MJUMPAGESIZE != MCLBYTES FL_BUF_SIZES = 4, /* cluster, jumbop, jumbo9k, jumbo16k */ #else FL_BUF_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif + CTRL_EQ_QSIZE = 128, + TX_EQ_QSIZE = 1024, - TX_EQ_ESIZE = 64, TX_SGL_SEGS = 36, TX_WR_FLITS = SGE_MAX_WR_LEN / 8 }; @@ -154,13 +153,16 @@ enum { /* adapter flags */ FULL_INIT_DONE = (1 << 0), FW_OK = (1 << 1), - INTR_SHARED = (1 << 2), /* one set of intrq's for all ports */ + INTR_DIRECT = (1 << 2), /* direct interrupts for everything */ + MASTER_PF = (1 << 3), + ADAP_SYSCTL_CTX = (1 << 4), CXGBE_BUSY = (1 << 9), /* port flags */ DOOMED = (1 << 0), - VI_ENABLED = (1 << 1), + PORT_INIT_DONE = (1 << 1), + PORT_SYSCTL_CTX = (1 << 2), }; #define IS_DOOMED(pi) (pi->flags & DOOMED) @@ -196,6 +198,12 @@ struct port_info { int first_txq; /* index of first tx queue */ int nrxq; /* # of rx queues */ int first_rxq; /* index of first rx queue */ +#ifndef TCP_OFFLOAD_DISABLE + int nofldtxq; /* # of offload tx queues */ + int first_ofld_txq; /* index of first offload tx queue */ + int nofldrxq; /* # of offload rx queues */ + int first_ofld_rxq; /* index of first offload rx queue */ +#endif int tmr_idx; int pktc_idx; int qsize_rxq; @@ -204,11 +212,8 @@ struct port_info { struct link_config link_cfg; struct port_stats stats; - struct taskqueue *tq; struct callout tick; - struct sysctl_ctx_list ctx; /* lives from ifconfig up to down */ - struct sysctl_oid *oid_rxq; - struct sysctl_oid *oid_txq; + struct sysctl_ctx_list ctx; /* from ifconfig up to driver detach */ uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */ }; @@ -232,17 +237,26 @@ struct tx_map { bus_dmamap_t map; }; +/* DMA maps used for tx */ +struct tx_maps { + struct tx_map *maps; + uint32_t map_total; /* # of DMA maps */ + uint32_t map_pidx; /* next map to be used */ + uint32_t map_cidx; /* reclaimed up to this index */ + uint32_t map_avail; /* # of available maps */ +}; + struct tx_sdesc { uint8_t desc_used; /* # of hardware descriptors used by the WR */ uint8_t credits; /* NIC txq: # of frames sent out in the WR */ }; -typedef void (iq_intr_handler_t)(void *); - enum { /* iq flags */ - IQ_ALLOCATED = (1 << 1), /* firmware resources allocated */ - IQ_STARTED = (1 << 2), /* started */ + IQ_ALLOCATED = (1 << 0), /* firmware resources allocated */ + IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ + IQ_INTR = (1 << 2), /* iq takes direct interrupt */ + IQ_LRO_ENABLED = (1 << 3), /* iq is an eth rxq with LRO enabled */ /* iq state */ IQS_DISABLED = 0, @@ -262,26 +276,35 @@ struct sge_iq { uint16_t abs_id; /* absolute SGE id for the iq */ int8_t intr_pktc_idx; /* packet count threshold index */ int8_t pad0; - iq_intr_handler_t *handler; __be64 *desc; /* KVA of descriptor ring */ - volatile uint32_t state; + volatile int state; struct adapter *adapter; const __be64 *cdesc; /* current descriptor */ uint8_t gen; /* generation bit */ uint8_t intr_params; /* interrupt holdoff parameters */ - uint8_t intr_next; /* holdoff for next interrupt */ + uint8_t intr_next; /* XXX: holdoff for next interrupt */ uint8_t esize; /* size (bytes) of each entry in the queue */ uint16_t qsize; /* size (# of entries) of the queue */ uint16_t cidx; /* consumer index */ - uint16_t cntxt_id; /* SGE context id for the iq */ + uint16_t cntxt_id; /* SGE context id for the iq */ + + STAILQ_ENTRY(sge_iq) link; }; enum { + EQ_CTRL = 1, + EQ_ETH = 2, +#ifndef TCP_OFFLOAD_DISABLE + EQ_OFLD = 3, +#endif + /* eq flags */ - EQ_ALLOCATED = (1 << 1), /* firmware resources allocated */ - EQ_STARTED = (1 << 2), /* started */ - EQ_CRFLUSHED = (1 << 3), /* expecting an update from SGE */ + EQ_TYPEMASK = 7, /* 3 lsbits hold the type */ + EQ_ALLOCATED = (1 << 3), /* firmware resources allocated */ + EQ_DOOMED = (1 << 4), /* about to be destroyed */ + EQ_CRFLUSHED = (1 << 5), /* expecting an update from SGE */ + EQ_STALLED = (1 << 6), /* out of hw descriptors or dmamaps */ }; /* @@ -291,10 +314,11 @@ enum { * consumes them) but it's special enough to have its own struct (see sge_fl). */ struct sge_eq { + unsigned int flags; /* MUST be first */ + unsigned int cntxt_id; /* SGE context id for the eq */ bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; char lockname[16]; - unsigned int flags; struct mtx eq_lock; struct tx_desc *desc; /* KVA of descriptor ring */ @@ -307,9 +331,24 @@ struct sge_eq { uint16_t pidx; /* producer idx (desc idx) */ uint16_t pending; /* # of descriptors used since last doorbell */ uint16_t iqid; /* iq that gets egr_update for the eq */ - unsigned int cntxt_id; /* SGE context id for the eq */ + uint8_t tx_chan; /* tx channel used by the eq */ + struct task tx_task; + struct callout tx_callout; + + /* stats */ + + uint32_t egr_update; /* # of SGE_EGR_UPDATE notifications for eq */ + uint32_t unstalled; /* recovered from stall */ +}; + +enum { + FL_STARVING = (1 << 0), /* on the adapter's list of starving fl's */ + FL_DOOMED = (1 << 1), /* about to be destroyed */ }; +#define FL_RUNNING_LOW(fl) (fl->cap - fl->needed <= fl->lowat) +#define FL_NOT_RUNNING_LOW(fl) (fl->cap - fl->needed >= 2 * fl->lowat) + struct sge_fl { bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; @@ -317,6 +356,7 @@ struct sge_fl { uint8_t tag_idx; struct mtx fl_lock; char lockname[16]; + int flags; __be64 *desc; /* KVA of descriptor ring, ptr to addresses */ bus_addr_t ba; /* bus address of descriptor ring */ @@ -327,8 +367,10 @@ struct sge_fl { uint32_t cidx; /* consumer idx (buffer idx, NOT hw desc idx) */ uint32_t pidx; /* producer idx (buffer idx, NOT hw desc idx) */ uint32_t needed; /* # of buffers needed to fill up fl. */ + uint32_t lowat; /* # of buffers <= this means fl needs help */ uint32_t pending; /* # of bufs allocated since last doorbell */ unsigned int dmamap_failed; + TAILQ_ENTRY(sge_fl) link; /* All starving freelists */ }; /* txq: SGE egress queue + what's needed for Ethernet NIC */ @@ -340,14 +382,8 @@ struct sge_txq { struct buf_ring *br; /* tx buffer ring */ struct tx_sdesc *sdesc; /* KVA of software descriptor ring */ struct mbuf *m; /* held up due to temporary resource shortage */ - struct task resume_tx; - /* DMA maps used for tx */ - struct tx_map *maps; - uint32_t map_total; /* # of DMA maps */ - uint32_t map_pidx; /* next map to be used */ - uint32_t map_cidx; /* reclaimed up to this index */ - uint32_t map_avail; /* # of available maps */ + struct tx_maps txmaps; /* stats for common events first */ @@ -364,20 +400,14 @@ struct sge_txq { uint32_t no_dmamap; /* no DMA map to load the mbuf */ uint32_t no_desc; /* out of hardware descriptors */ - uint32_t egr_update; /* # of SGE_EGR_UPDATE notifications for txq */ } __aligned(CACHE_LINE_SIZE); -enum { - RXQ_LRO_ENABLED = (1 << 0) -}; - /* rxq: SGE ingress queue + SGE free list + miscellaneous items */ struct sge_rxq { struct sge_iq iq; /* MUST be first */ - struct sge_fl fl; + struct sge_fl fl; /* MUST follow iq */ struct ifnet *ifp; /* the interface this rxq belongs to */ - unsigned int flags; #ifdef INET struct lro_ctrl lro; /* LRO state */ #endif @@ -391,12 +421,28 @@ struct sge_rxq { } __aligned(CACHE_LINE_SIZE); -/* ctrlq: SGE egress queue + stats for control queue */ -struct sge_ctrlq { +#ifndef TCP_OFFLOAD_DISABLE +/* ofld_rxq: SGE ingress queue + SGE free list + miscellaneous items */ +struct sge_ofld_rxq { + struct sge_iq iq; /* MUST be first */ + struct sge_fl fl; /* MUST follow iq */ +} __aligned(CACHE_LINE_SIZE); +#endif + +/* + * wrq: SGE egress queue that is given prebuilt work requests. Both the control + * and offload tx queues are of this type. + */ +struct sge_wrq { struct sge_eq eq; /* MUST be first */ + struct adapter *adapter; + struct mbuf *head; /* held up due to lack of descriptors */ + struct mbuf *tail; /* valid only if head is valid */ + /* stats for common events first */ + uint64_t tx_wrs; /* # of tx work requests */ /* stats for not-that-common events */ @@ -404,20 +450,28 @@ struct sge_ctrlq { } __aligned(CACHE_LINE_SIZE); struct sge { - uint16_t timer_val[SGE_NTIMERS]; - uint8_t counter_val[SGE_NCOUNTERS]; + int timer_val[SGE_NTIMERS]; + int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; - int nrxq; /* total rx queues (all ports and the rest) */ - int ntxq; /* total tx queues (all ports and the rest) */ - int niq; /* total ingress queues */ - int neq; /* total egress queues */ + int nrxq; /* total # of Ethernet rx queues */ + int ntxq; /* total # of Ethernet tx tx queues */ +#ifndef TCP_OFFLOAD_DISABLE + int nofldrxq; /* total # of TOE rx queues */ + int nofldtxq; /* total # of TOE tx queues */ +#endif + int niq; /* total # of ingress queues */ + int neq; /* total # of egress queues */ struct sge_iq fwq; /* Firmware event queue */ - struct sge_ctrlq *ctrlq;/* Control queues */ - struct sge_iq *intrq; /* Interrupt queues */ + struct sge_wrq mgmtq; /* Management queue (control queue) */ + struct sge_wrq *ctrlq; /* Control queues */ struct sge_txq *txq; /* NIC tx queues */ struct sge_rxq *rxq; /* NIC rx queues */ +#ifndef TCP_OFFLOAD_DISABLE + struct sge_wrq *ofld_txq; /* TOE tx queues */ + struct sge_ofld_rxq *ofld_rxq; /* TOE rx queues */ +#endif uint16_t iq_start; int eq_start; @@ -425,7 +479,12 @@ struct sge { struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ }; +struct rss_header; +typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *, + struct mbuf *); + struct adapter { + SLIST_ENTRY(adapter) link; device_t dev; struct cdev *cdev; @@ -454,27 +513,47 @@ struct adapter { struct sge sge; + struct taskqueue *tq[NCHAN]; /* taskqueues that flush data out */ struct port_info *port[MAX_NPORTS]; uint8_t chan_map[NCHAN]; + uint32_t filter_mode; +#ifndef TCP_OFFLOAD_DISABLE + struct uld_softc tom; + struct tom_tunables tt; +#endif struct l2t_data *l2t; /* L2 table */ struct tid_info tids; - int registered_device_map; int open_device_map; +#ifndef TCP_OFFLOAD_DISABLE + int offload_map; +#endif int flags; char fw_version[32]; + unsigned int cfcsum; struct adapter_params params; struct t4_virt_res vres; - struct sysctl_ctx_list ctx; /* from first_port_up to last_port_down */ - struct sysctl_oid *oid_fwq; - struct sysctl_oid *oid_ctrlq; - struct sysctl_oid *oid_intrq; + uint16_t linkcaps; + uint16_t niccaps; + uint16_t toecaps; + uint16_t rdmacaps; + uint16_t iscsicaps; + uint16_t fcoecaps; + + struct sysctl_ctx_list ctx; /* from adapter_full_init to full_uninit */ struct mtx sc_lock; char lockname[16]; + + /* Starving free lists */ + struct mtx sfl_lock; /* same cache-line as sc_lock? but that's ok */ + TAILQ_HEAD(, sge_fl) sfl; + struct callout sfl_callout; + + cpl_handler_t cpl_handler[256] __aligned(CACHE_LINE_SIZE); }; #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) @@ -516,11 +595,15 @@ struct adapter { #define for_each_rxq(pi, iter, rxq) \ rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \ for (iter = 0; iter < pi->nrxq; ++iter, ++rxq) +#define for_each_ofld_txq(pi, iter, ofld_txq) \ + ofld_txq = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \ + for (iter = 0; iter < pi->nofldtxq; ++iter, ++ofld_txq) +#define for_each_ofld_rxq(pi, iter, ofld_rxq) \ + ofld_rxq = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \ + for (iter = 0; iter < pi->nofldrxq; ++iter, ++ofld_rxq) /* One for errors, one for firmware events */ #define T4_EXTRA_INTR 2 -#define NINTRQ(sc) ((sc)->intr_count > T4_EXTRA_INTR ? \ - (sc)->intr_count - T4_EXTRA_INTR : 1) static inline uint32_t t4_read_reg(struct adapter *sc, uint32_t reg) @@ -599,29 +682,52 @@ static inline bool is_10G_port(const str return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); } +static inline int tx_resume_threshold(struct sge_eq *eq) +{ + return (eq->qsize / 4); +} + /* t4_main.c */ -void cxgbe_txq_start(void *, int); +void t4_tx_task(void *, int); +void t4_tx_callout(void *); int t4_os_find_pci_capability(struct adapter *, int); int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); void t4_os_portmod_changed(const struct adapter *, int); void t4_os_link_changed(struct adapter *, int, int); +void t4_iterate(void (*)(struct adapter *, void *), void *); +int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t); /* t4_sge.c */ void t4_sge_modload(void); -void t4_sge_init(struct adapter *); +int t4_sge_init(struct adapter *); int t4_create_dma_tag(struct adapter *); int t4_destroy_dma_tag(struct adapter *); int t4_setup_adapter_queues(struct adapter *); int t4_teardown_adapter_queues(struct adapter *); -int t4_setup_eth_queues(struct port_info *); -int t4_teardown_eth_queues(struct port_info *); +int t4_setup_port_queues(struct port_info *); +int t4_teardown_port_queues(struct port_info *); +int t4_alloc_tx_maps(struct tx_maps *, bus_dma_tag_t, int, int); +void t4_free_tx_maps(struct tx_maps *, bus_dma_tag_t); void t4_intr_all(void *); void t4_intr(void *); void t4_intr_err(void *); void t4_intr_evt(void *); int t4_mgmt_tx(struct adapter *, struct mbuf *); +int t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct mbuf *); int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *); void t4_update_fl_bufsize(struct ifnet *); +int can_resume_tx(struct sge_eq *); + +static inline int t4_wrq_tx(struct adapter *sc, struct sge_wrq *wrq, struct mbuf *m) +{ + int rc; + + TXQ_LOCK(wrq); + rc = t4_wrq_tx_locked(sc, wrq, m); + TXQ_UNLOCK(wrq); + return (rc); +} + #endif Modified: stable/8/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/8/sys/dev/cxgbe/common/common.h Mon Feb 6 21:50:11 2012 (r231102) +++ stable/8/sys/dev/cxgbe/common/common.h Tue Feb 7 01:26:29 2012 (r231103) @@ -42,6 +42,15 @@ enum { enum { MEM_EDC0, MEM_EDC1, MEM_MC }; +enum { + MEMWIN0_APERTURE = 2048, + MEMWIN0_BASE = 0x1b800, + MEMWIN1_APERTURE = 32768, + MEMWIN1_BASE = 0x28000, + MEMWIN2_APERTURE = 65536, + MEMWIN2_BASE = 0x30000, +}; + enum dev_master { MASTER_CANT, MASTER_MAY, MASTER_MUST }; enum dev_state { DEV_STATE_UNINIT, DEV_STATE_INIT, DEV_STATE_ERR }; @@ -53,8 +62,8 @@ enum { }; #define FW_VERSION_MAJOR 1 -#define FW_VERSION_MINOR 3 -#define FW_VERSION_MICRO 10 +#define FW_VERSION_MINOR 4 +#define FW_VERSION_MICRO 16 struct port_stats { u64 tx_octets; /* total # of octets in good frames */ @@ -190,7 +199,6 @@ struct tp_proxy_stats { struct tp_cpl_stats { u32 req[4]; u32 rsp[4]; - u32 tx_err[4]; }; struct tp_rdma_stats { @@ -214,9 +222,9 @@ struct vpd_params { }; struct pci_params { - unsigned int vpd_cap_addr; - unsigned char speed; - unsigned char width; + unsigned int vpd_cap_addr; + unsigned short speed; + unsigned short width; }; /* @@ -239,20 +247,20 @@ struct adapter_params { unsigned int fw_vers; unsigned int tp_vers; - u8 api_vers[7]; unsigned short mtus[NMTUS]; unsigned short a_wnd[NCCTRL_WIN]; unsigned short b_wnd[NCCTRL_WIN]; - unsigned int mc_size; /* MC memory size */ - unsigned int nfilters; /* size of filter region */ + unsigned int mc_size; /* MC memory size */ + unsigned int nfilters; /* size of filter region */ unsigned int cim_la_size; - unsigned int nports; /* # of ethernet ports */ + /* Used as int in sysctls, do not reduce size */ + unsigned int nports; /* # of ethernet ports */ unsigned int portvec; - unsigned int rev; /* chip revision */ + unsigned int rev; /* chip revision */ unsigned int offload; unsigned int ofldq_wr_cred; @@ -366,6 +374,9 @@ int t4_seeprom_wp(struct adapter *adapte int t4_read_flash(struct adapter *adapter, unsigned int addr, unsigned int nwords, u32 *data, int byte_oriented); int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); +int t4_load_boot(struct adapter *adap, const u8 *boot_data, + unsigned int boot_addr, unsigned int size); +unsigned int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); @@ -460,8 +471,8 @@ int t4_wol_pat_enable(struct adapter *ad int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, enum dev_master master, enum dev_state *state); int t4_fw_bye(struct adapter *adap, unsigned int mbox); -int t4_early_init(struct adapter *adap, unsigned int mbox); int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset); +int t4_fw_initialize(struct adapter *adap, unsigned int mbox); int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, u32 *val); Modified: stable/8/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/8/sys/dev/cxgbe/common/t4_hw.c Mon Feb 6 21:50:11 2012 (r231102) +++ stable/8/sys/dev/cxgbe/common/t4_hw.c Tue Feb 7 01:26:29 2012 (r231103) @@ -30,10 +30,10 @@ __FBSDID("$FreeBSD$"); #include "common.h" #include "t4_regs.h" #include "t4_regs_values.h" -#include "t4fw_interface.h" +#include "firmware/t4fw_interface.h" #undef msleep -#define msleep(x) DELAY((x) * 1000) +#define msleep(x) pause("t4hw", (x) * hz / 1000) /** * t4_wait_op_done_val - wait until an operation is completed @@ -187,7 +187,7 @@ int t4_wr_mbox_meat(struct adapter *adap * off to larger delays to a maximum retry delay. */ static const int delay[] = { - 1, 1, 3, 5, 10, 10, 20, 50, 100, 200 + 1, 1, 3, 5, 10, 10, 20, 50, 100 }; u32 v; @@ -625,17 +625,6 @@ enum { SF_RD_DATA_FAST = 0xb, /* read flash */ SF_RD_ID = 0x9f, /* read ID */ SF_ERASE_SECTOR = 0xd8, /* erase sector */ - - FW_START_SEC = 8, /* first flash sector for FW */ - FW_END_SEC = 15, /* last flash sector for FW */ - FW_IMG_START = FW_START_SEC * SF_SEC_SIZE, - FW_MAX_SIZE = (FW_END_SEC - FW_START_SEC + 1) * SF_SEC_SIZE, - - FLASH_CFG_MAX_SIZE = 0x10000 , /* max size of the flash config file */ - FLASH_CFG_OFFSET = 0x1f0000, - FLASH_CFG_START_SEC = FLASH_CFG_OFFSET / SF_SEC_SIZE, - FPGA_FLASH_CFG_OFFSET = 0xf0000 , /* if FPGA mode, then cfg file is at 1MB - 64KB */ - FPGA_FLASH_CFG_START_SEC = FPGA_FLASH_CFG_OFFSET / SF_SEC_SIZE, }; /** @@ -763,12 +752,15 @@ int t4_read_flash(struct adapter *adapte * @addr: the start address to write * @n: length of data to write in bytes * @data: the data to write + * @byte_oriented: whether to store data as bytes or as words * * Writes up to a page of data (256 bytes) to the serial flash starting * at the given address. All the data must be written to the same page. + * If @byte_oriented is set the write data is stored as byte stream + * (i.e. matches what on disk), otherwise in big-endian. */ static int t4_write_flash(struct adapter *adapter, unsigned int addr, - unsigned int n, const u8 *data) + unsigned int n, const u8 *data, int byte_oriented) { int ret; u32 buf[SF_PAGE_SIZE / 4]; @@ -788,6 +780,9 @@ static int t4_write_flash(struct adapter for (val = 0, i = 0; i < c; ++i) val = (val << 8) + *data++; + if (!byte_oriented) + val = htonl(val); + ret = sf1_write(adapter, c, c != left, 1, val); if (ret) goto unlock; @@ -799,7 +794,8 @@ static int t4_write_flash(struct adapter t4_write_reg(adapter, A_SF_OP, 0); /* unlock SF */ /* Read the page to verify the write succeeded */ - ret = t4_read_flash(adapter, addr & ~0xff, ARRAY_SIZE(buf), buf, 1); + ret = t4_read_flash(adapter, addr & ~0xff, ARRAY_SIZE(buf), buf, + byte_oriented); if (ret) return ret; @@ -825,7 +821,7 @@ unlock: int t4_get_fw_version(struct adapter *adapter, u32 *vers) { return t4_read_flash(adapter, - FW_IMG_START + offsetof(struct fw_hdr, fw_ver), 1, + FLASH_FW_START + offsetof(struct fw_hdr, fw_ver), 1, vers, 0); } @@ -838,7 +834,7 @@ int t4_get_fw_version(struct adapter *ad */ int t4_get_tp_version(struct adapter *adapter, u32 *vers) { - return t4_read_flash(adapter, FW_IMG_START + offsetof(struct fw_hdr, + return t4_read_flash(adapter, FLASH_FW_START + offsetof(struct fw_hdr, tp_microcode_ver), 1, vers, 0); } @@ -854,24 +850,17 @@ int t4_get_tp_version(struct adapter *ad */ int t4_check_fw_version(struct adapter *adapter) { - u32 api_vers[2]; int ret, major, minor, micro; ret = t4_get_fw_version(adapter, &adapter->params.fw_vers); if (!ret) ret = t4_get_tp_version(adapter, &adapter->params.tp_vers); - if (!ret) - ret = t4_read_flash(adapter, - FW_IMG_START + offsetof(struct fw_hdr, intfver_nic), - 2, api_vers, 1); if (ret) return ret; major = G_FW_HDR_FW_VER_MAJOR(adapter->params.fw_vers); minor = G_FW_HDR_FW_VER_MINOR(adapter->params.fw_vers); micro = G_FW_HDR_FW_VER_MICRO(adapter->params.fw_vers); - memcpy(adapter->params.api_vers, api_vers, - sizeof(adapter->params.api_vers)); if (major != FW_VERSION_MAJOR) { /* major mismatch - fail */ CH_ERR(adapter, "card FW has major version %u, driver wants " @@ -914,6 +903,21 @@ static int t4_flash_erase_sectors(struct } /** + * t4_flash_cfg_addr - return the address of the flash configuration file + * @adapter: the adapter + * + * Return the address within the flash where the Firmware Configuration + * File is stored. + */ +unsigned int t4_flash_cfg_addr(struct adapter *adapter) +{ + if (adapter->params.sf_size == 0x100000) + return FLASH_FPGA_CFG_START; + else + return FLASH_CFG_START; +} + +/** * t4_load_cfg - download config file * @adap: the adapter * @cfg_data: the cfg text file to write @@ -928,17 +932,8 @@ int t4_load_cfg(struct adapter *adap, co unsigned int flash_cfg_start_sec; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - if (adap->params.sf_size == 0x100000) { - addr = FPGA_FLASH_CFG_OFFSET; - flash_cfg_start_sec = FPGA_FLASH_CFG_START_SEC; - } else { - addr = FLASH_CFG_OFFSET; - flash_cfg_start_sec = FLASH_CFG_START_SEC; - } - if (!size) { - CH_ERR(adap, "cfg file has no data\n"); - return -EINVAL; - } + addr = t4_flash_cfg_addr(adap); + flash_cfg_start_sec = addr / SF_SEC_SIZE; if (size > FLASH_CFG_MAX_SIZE) { CH_ERR(adap, "cfg file too large, max is %u bytes\n", @@ -950,7 +945,11 @@ int t4_load_cfg(struct adapter *adap, co sf_sec_size); ret = t4_flash_erase_sectors(adap, flash_cfg_start_sec, flash_cfg_start_sec + i - 1); - if (ret) + /* + * If size == 0 then we're simply erasing the FLASH sectors associated + * with the on-adapter Firmware Configuration File. + */ + if (ret || size == 0) goto out; /* this will write to the flash up to SF_PAGE_SIZE at a time */ @@ -959,7 +958,7 @@ int t4_load_cfg(struct adapter *adap, co n = size - i; else n = SF_PAGE_SIZE; - ret = t4_write_flash(adap, addr, n, cfg_data); + ret = t4_write_flash(adap, addr, n, cfg_data, 1); if (ret) goto out; @@ -969,7 +968,8 @@ int t4_load_cfg(struct adapter *adap, co out: if (ret) - CH_ERR(adap, "config file download failed %d\n", ret); + CH_ERR(adap, "config file %s failed %d\n", + (size == 0 ? "clear" : "download"), ret); return ret; } @@ -1004,9 +1004,9 @@ int t4_load_fw(struct adapter *adap, con CH_ERR(adap, "FW image size differs from size in FW header\n"); return -EINVAL; } - if (size > FW_MAX_SIZE) { + if (size > FLASH_FW_MAX_SIZE) { CH_ERR(adap, "FW image too large, max is %u bytes\n", - FW_MAX_SIZE); + FLASH_FW_MAX_SIZE); return -EFBIG; } @@ -1020,7 +1020,8 @@ int t4_load_fw(struct adapter *adap, con } i = DIV_ROUND_UP(size, sf_sec_size); /* # of sectors spanned */ - ret = t4_flash_erase_sectors(adap, FW_START_SEC, FW_START_SEC + i - 1); + ret = t4_flash_erase_sectors(adap, FLASH_FW_START_SEC, + FLASH_FW_START_SEC + i - 1); if (ret) goto out; @@ -1031,28 +1032,110 @@ int t4_load_fw(struct adapter *adap, con */ memcpy(first_page, fw_data, SF_PAGE_SIZE); ((struct fw_hdr *)first_page)->fw_ver = htonl(0xffffffff); - ret = t4_write_flash(adap, FW_IMG_START, SF_PAGE_SIZE, first_page); + ret = t4_write_flash(adap, FLASH_FW_START, SF_PAGE_SIZE, first_page, 1); if (ret) goto out; - addr = FW_IMG_START; + addr = FLASH_FW_START; for (size -= SF_PAGE_SIZE; size; size -= SF_PAGE_SIZE) { addr += SF_PAGE_SIZE; fw_data += SF_PAGE_SIZE; - ret = t4_write_flash(adap, addr, SF_PAGE_SIZE, fw_data); + ret = t4_write_flash(adap, addr, SF_PAGE_SIZE, fw_data, 1); if (ret) goto out; } ret = t4_write_flash(adap, - FW_IMG_START + offsetof(struct fw_hdr, fw_ver), - sizeof(hdr->fw_ver), (const u8 *)&hdr->fw_ver); + FLASH_FW_START + offsetof(struct fw_hdr, fw_ver), + sizeof(hdr->fw_ver), (const u8 *)&hdr->fw_ver, 1); out: if (ret) CH_ERR(adap, "firmware download failed, error %d\n", ret); return ret; } +/* BIOS boot header */ +typedef struct boot_header_s { + u8 signature[2]; /* signature */ + u8 length; /* image length (include header) */ + u8 offset[4]; /* initialization vector */ + u8 reserved[19]; /* reserved */ + u8 exheader[2]; /* offset to expansion header */ +} boot_header_t; + +enum { + BOOT_FLASH_BOOT_ADDR = 0x0,/* start address of boot image in flash */ + BOOT_SIGNATURE = 0xaa55, /* signature of BIOS boot ROM */ + BOOT_SIZE_INC = 512, /* image size measured in 512B chunks */ + BOOT_MIN_SIZE = sizeof(boot_header_t), /* at least basic header */ + BOOT_MAX_SIZE = 1024*BOOT_SIZE_INC /* 1 byte * length increment */ +}; + +/* + * t4_load_boot - download boot flash + * @adapter: the adapter + * @boot_data: the boot image to write + * @size: image size + * + * Write the supplied boot image to the card's serial flash. + * The boot image has the following sections: a 28-byte header and the + * boot image. + */ +int t4_load_boot(struct adapter *adap, const u8 *boot_data, + unsigned int boot_addr, unsigned int size) +{ + int ret, addr; + unsigned int i; + unsigned int boot_sector = boot_addr * 1024; + unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; + + /* + * Perform some primitive sanity testing to avoid accidentally + * writing garbage over the boot sectors. We ought to check for + * more but it's not worth it for now ... + */ + if (size < BOOT_MIN_SIZE || size > BOOT_MAX_SIZE) { + CH_ERR(adap, "boot image too small/large\n"); + return -EFBIG; + } + + /* + * Make sure the boot image does not encroach on the firmware region + */ + if ((boot_sector + size) >> 16 > FLASH_FW_START_SEC) { + CH_ERR(adap, "boot image encroaching on firmware region\n"); + return -EFBIG; + } + + i = DIV_ROUND_UP(size, sf_sec_size); /* # of sectors spanned */ + ret = t4_flash_erase_sectors(adap, boot_sector >> 16, + (boot_sector >> 16) + i - 1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 02:21:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A25106564A; Tue, 7 Feb 2012 02:21:17 +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 A43688FC16; Tue, 7 Feb 2012 02:21: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 q172LHTN064048; Tue, 7 Feb 2012 02:21:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q172LHAY064046; Tue, 7 Feb 2012 02:21:17 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070221.q172LHAY064046@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 02:21:17 +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: r231104 - stable/9/sys/dev/cxgb/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 02:21:17 -0000 Author: np Date: Tue Feb 7 02:21:17 2012 New Revision: 231104 URL: http://svn.freebsd.org/changeset/base/231104 Log: MFC r228825: Fix return value of function. Modified: stable/9/sys/dev/cxgb/common/cxgb_aq100x.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/cxgb/common/cxgb_aq100x.c ============================================================================== --- stable/9/sys/dev/cxgb/common/cxgb_aq100x.c Tue Feb 7 01:26:29 2012 (r231103) +++ stable/9/sys/dev/cxgb/common/cxgb_aq100x.c Tue Feb 7 02:21:17 2012 (r231104) @@ -232,7 +232,7 @@ aq100x_power_down(struct cphy *phy, int err = t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, BMCR_PDOWN, off ? BMCR_PDOWN : 0); if (err || off) - return (v); + return (err); msleep(300); do { From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 02:21:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D39D106567A; Tue, 7 Feb 2012 02:21:47 +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 37F6F8FC1E; Tue, 7 Feb 2012 02:21:47 +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 q172Ll78064098; Tue, 7 Feb 2012 02:21:47 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q172Llqu064096; Tue, 7 Feb 2012 02:21:47 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070221.q172Llqu064096@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 02:21:47 +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: r231105 - stable/8/sys/dev/cxgb/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 02:21:47 -0000 Author: np Date: Tue Feb 7 02:21:46 2012 New Revision: 231105 URL: http://svn.freebsd.org/changeset/base/231105 Log: MFC r228825: Fix return value of function. Modified: stable/8/sys/dev/cxgb/common/cxgb_aq100x.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/cxgb/common/cxgb_aq100x.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_aq100x.c Tue Feb 7 02:21:17 2012 (r231104) +++ stable/8/sys/dev/cxgb/common/cxgb_aq100x.c Tue Feb 7 02:21:46 2012 (r231105) @@ -232,7 +232,7 @@ aq100x_power_down(struct cphy *phy, int err = t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, BMCR_PDOWN, off ? BMCR_PDOWN : 0); if (err || off) - return (v); + return (err); msleep(300); do { From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 02:57:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3148106564A; Tue, 7 Feb 2012 02:57:36 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B598FC17; Tue, 7 Feb 2012 02:57:36 +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 q172vaKg065275; Tue, 7 Feb 2012 02:57:36 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q172vasA065272; Tue, 7 Feb 2012 02:57:36 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202070257.q172vasA065272@svn.freebsd.org> From: David Xu Date: Tue, 7 Feb 2012 02:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231106 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 02:57:36 -0000 Author: davidxu Date: Tue Feb 7 02:57:36 2012 New Revision: 231106 URL: http://svn.freebsd.org/changeset/base/231106 Log: Plug a memory leak. When a cached thread is reused, don't clear sleep queue pointers, just reuse it. PR: 164828 MFC after: 1 week Modified: head/lib/libthr/thread/thr_list.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_list.c ============================================================================== --- head/lib/libthr/thread/thr_list.c Tue Feb 7 02:21:46 2012 (r231105) +++ head/lib/libthr/thread/thr_list.c Tue Feb 7 02:57:36 2012 (r231106) @@ -149,11 +149,16 @@ _thr_alloc(struct pthread *curthread) if (total_threads > MAX_THREADS) return (NULL); atomic_fetchadd_int(&total_threads, 1); - thread = malloc(sizeof(struct pthread)); + thread = calloc(1, sizeof(struct pthread)); if (thread == NULL) { atomic_fetchadd_int(&total_threads, -1); return (NULL); } + thread->sleepqueue = _sleepq_alloc(); + thread->wake_addr = _thr_alloc_wake_addr(); + } else { + bzero(&thread->_pthread_startzero, + __rangeof(struct pthread, _pthread_startzero, _pthread_endzero)); } if (curthread != NULL) { THR_LOCK_ACQUIRE(curthread, &tcb_lock); @@ -163,10 +168,7 @@ _thr_alloc(struct pthread *curthread) tcb = _tcb_ctor(thread, 1 /* initial tls */); } if (tcb != NULL) { - memset(thread, 0, sizeof(*thread)); thread->tcb = tcb; - thread->sleepqueue = _sleepq_alloc(); - thread->wake_addr = _thr_alloc_wake_addr(); } else { thr_destroy(curthread, thread); atomic_fetchadd_int(&total_threads, -1); @@ -194,8 +196,6 @@ _thr_free(struct pthread *curthread, str } thread->tcb = NULL; if ((curthread == NULL) || (free_thread_count >= MAX_CACHED_THREADS)) { - _sleepq_free(thread->sleepqueue); - _thr_release_wake_addr(thread->wake_addr); thr_destroy(curthread, thread); atomic_fetchadd_int(&total_threads, -1); } else { @@ -213,6 +213,10 @@ _thr_free(struct pthread *curthread, str static void thr_destroy(struct pthread *curthread __unused, struct pthread *thread) { + if (thread->sleepqueue != NULL) + _sleepq_free(thread->sleepqueue); + if (thread->wake_addr != NULL) + _thr_release_wake_addr(thread->wake_addr); free(thread); } Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Tue Feb 7 02:21:46 2012 (r231105) +++ head/lib/libthr/thread/thr_private.h Tue Feb 7 02:57:36 2012 (r231106) @@ -343,6 +343,7 @@ struct pthread_key { * Thread structure. */ struct pthread { +#define _pthread_startzero tid /* Kernel thread id. */ long tid; #define TID_TERMINATED 1 @@ -506,12 +507,6 @@ struct pthread { /* Event */ td_event_msg_t event_buf; - struct wake_addr *wake_addr; -#define WAKE_ADDR(td) ((td)->wake_addr) - - /* Sleep queue */ - struct sleepqueue *sleepqueue; - /* Wait channel */ void *wchan; @@ -526,6 +521,14 @@ struct pthread { /* Deferred threads from pthread_cond_signal. */ unsigned int *defer_waiters[MAX_DEFER_WAITERS]; +#define _pthread_endzero wake_addr + + struct wake_addr *wake_addr; +#define WAKE_ADDR(td) ((td)->wake_addr) + + /* Sleep queue */ + struct sleepqueue *sleepqueue; + }; #define THR_SHOULD_GC(thrd) \ From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 03:15:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 918D91065673; Tue, 7 Feb 2012 03:15:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C10C8FC0C; Tue, 7 Feb 2012 03:15: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 q173FCZl066133; Tue, 7 Feb 2012 03:15:12 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q173FCSv066131; Tue, 7 Feb 2012 03:15:12 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070315.q173FCSv066131@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 03:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231107 - stable/8/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 03:15:12 -0000 Author: emaste Date: Tue Feb 7 03:15:12 2012 New Revision: 231107 URL: http://svn.freebsd.org/changeset/base/231107 Log: MFC r219708: Reemove uptime validity check that hasn't been necessary since r151417 switched to clock_gettime. vmstat will now not exit with an error if run on a system with 10 years of uptime. Modified: stable/8/usr.bin/vmstat/vmstat.c Directory Properties: stable/8/usr.bin/vmstat/ (props changed) Modified: stable/8/usr.bin/vmstat/vmstat.c ============================================================================== --- stable/8/usr.bin/vmstat/vmstat.c Tue Feb 7 02:57:36 2012 (r231106) +++ stable/8/usr.bin/vmstat/vmstat.c Tue Feb 7 03:15:12 2012 (r231107) @@ -408,14 +408,10 @@ static long getuptime(void) { struct timespec sp; - time_t uptime; (void)clock_gettime(CLOCK_MONOTONIC, &sp); - uptime = sp.tv_sec; - if (uptime <= 0 || uptime > 60*60*24*365*10) - errx(1, "time makes no sense; namelist must be wrong"); - return(uptime); + return(sp.tv_sec); } static void From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 03:34:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9F09106564A; Tue, 7 Feb 2012 03:34:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3338FC14; Tue, 7 Feb 2012 03:34:57 +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 q173Yvaw066772; Tue, 7 Feb 2012 03:34:57 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q173YvQG066770; Tue, 7 Feb 2012 03:34:57 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070334.q173YvQG066770@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 03:34:57 +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: r231108 - stable/9/usr.sbin/pkg_install/info X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 03:34:57 -0000 Author: emaste Date: Tue Feb 7 03:34:57 2012 New Revision: 231108 URL: http://svn.freebsd.org/changeset/base/231108 Log: MFC r226697 and r226708: Avoid printing // for packages that install to / I have some packages that install to / (for whatever reason). Right now we print entries of the form //path/to/file when listing files (pkg_info -L, pkg_info -g etc.) This change avoids printing the redundant / . Staticify elide_root() for now to fix build. Modified: stable/9/usr.sbin/pkg_install/info/show.c Directory Properties: stable/9/usr.sbin/pkg_install/info/ (props changed) Modified: stable/9/usr.sbin/pkg_install/info/show.c ============================================================================== --- stable/9/usr.sbin/pkg_install/info/show.c Tue Feb 7 03:15:12 2012 (r231107) +++ stable/9/usr.sbin/pkg_install/info/show.c Tue Feb 7 03:34:57 2012 (r231108) @@ -207,6 +207,14 @@ show_plist(const char *title, Package *p } } +static const char * +elide_root(const char *dir) +{ + if (strcmp(dir, "/") == 0) + return ""; + return dir; +} + /* Show all files in the packing list (except ignored ones) */ void show_files(const char *title, Package *plist) @@ -223,7 +231,7 @@ show_files(const char *title, Package *p switch(p->type) { case PLIST_FILE: if (!ign) - printf("%s/%s\n", dir, p->name); + printf("%s/%s\n", elide_root(dir), p->name); ign = FALSE; break; @@ -270,7 +278,7 @@ show_size(const char *title, Package *pl switch (p->type) { case PLIST_FILE: if (!ign) { - snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name); + snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); if (!lstat(tmp, &sb)) { size += sb.st_size; if (Verbose) @@ -328,7 +336,7 @@ show_cksum(const char *title, Package *p else dir = p->name; } else if (p->type == PLIST_FILE) { - snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name); + snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); if (!fexists(tmp)) warnx("%s doesn't exist", tmp); else if (p->next && p->next->type == PLIST_COMMENT && From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 03:37:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B22D106567D; Tue, 7 Feb 2012 03:37:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4E48FC0A; Tue, 7 Feb 2012 03:37:29 +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 q173bTRl066896; Tue, 7 Feb 2012 03:37:29 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q173bTTD066894; Tue, 7 Feb 2012 03:37:29 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070337.q173bTTD066894@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 03:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231109 - stable/8/usr.sbin/pkg_install/info X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 03:37:29 -0000 Author: emaste Date: Tue Feb 7 03:37:29 2012 New Revision: 231109 URL: http://svn.freebsd.org/changeset/base/231109 Log: MFC r226697 and r226708: Avoid printing // for packages that install to / I have some packages that install to / (for whatever reason). Right now we print entries of the form //path/to/file when listing files (pkg_info -L, pkg_info -g etc.) This change avoids printing the redundant / . Staticify elide_root() for now to fix build. Modified: stable/8/usr.sbin/pkg_install/info/show.c Directory Properties: stable/8/usr.sbin/pkg_install/info/ (props changed) Modified: stable/8/usr.sbin/pkg_install/info/show.c ============================================================================== --- stable/8/usr.sbin/pkg_install/info/show.c Tue Feb 7 03:34:57 2012 (r231108) +++ stable/8/usr.sbin/pkg_install/info/show.c Tue Feb 7 03:37:29 2012 (r231109) @@ -207,6 +207,14 @@ show_plist(const char *title, Package *p } } +static const char * +elide_root(const char *dir) +{ + if (strcmp(dir, "/") == 0) + return ""; + return dir; +} + /* Show all files in the packing list (except ignored ones) */ void show_files(const char *title, Package *plist) @@ -223,7 +231,7 @@ show_files(const char *title, Package *p switch(p->type) { case PLIST_FILE: if (!ign) - printf("%s/%s\n", dir, p->name); + printf("%s/%s\n", elide_root(dir), p->name); ign = FALSE; break; @@ -270,7 +278,7 @@ show_size(const char *title, Package *pl switch (p->type) { case PLIST_FILE: if (!ign) { - snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name); + snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); if (!lstat(tmp, &sb)) { size += sb.st_size; if (Verbose) @@ -328,7 +336,7 @@ show_cksum(const char *title, Package *p else dir = p->name; } else if (p->type == PLIST_FILE) { - snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name); + snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); if (!fexists(tmp)) warnx("%s doesn't exist", tmp); else if (p->next && p->next->type == PLIST_COMMENT && From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 04:00:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C48351065670; Tue, 7 Feb 2012 04:00:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0E4A8FC0A; Tue, 7 Feb 2012 04:00:57 +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 q1740v0m067737; Tue, 7 Feb 2012 04:00:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1740vaO067735; Tue, 7 Feb 2012 04:00:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202070400.q1740vaO067735@svn.freebsd.org> From: Eitan Adler Date: Tue, 7 Feb 2012 04:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231111 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 04:00:58 -0000 Author: eadler Date: Tue Feb 7 04:00:57 2012 New Revision: 231111 URL: http://svn.freebsd.org/changeset/base/231111 Log: ports(7) currently makes no mention of LOCALBASE: fix that PR: docs/159551 Submitted by: Matthew Seaman Approved by: gjb MFC after: 3 days Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Tue Feb 7 03:41:08 2012 (r231110) +++ head/share/man/man7/ports.7 Tue Feb 7 04:00:57 2012 (r231111) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2011 +.Dd Feb 06, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -408,10 +408,13 @@ Directory to put the package in. .It Va PKGFILE The full path to the package. .El -.It Va PREFIX -Where to install things in general -(usually +.It Va LOCALBASE +Where existing things are installed and where to search for files when +resolving dependencies (usually .Pa /usr/local ) . +.It Va PREFIX +Where to install this port (usually set to the same as +.Va LOCALBASE ) . .It Va MASTER_SITES Primary sites for distribution files if not found locally. .It Va PATCH_SITES From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 04:03:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DFAD106566B; Tue, 7 Feb 2012 04:03:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 190E68FC0C; Tue, 7 Feb 2012 04:03: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 q1743dW7067855; Tue, 7 Feb 2012 04:03:39 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1743dux067853; Tue, 7 Feb 2012 04:03:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070403.q1743dux067853@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 04:03:39 +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: r231112 - stable/9/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 04:03:40 -0000 Author: emaste Date: Tue Feb 7 04:03:39 2012 New Revision: 231112 URL: http://svn.freebsd.org/changeset/base/231112 Log: MFC r227893 and r228119: Avoid double free creating a new RAID with invalid command line arguments. In build_volume(), check if arrays is allocated before traversing its items. While parsing the arrays input, it's possible that we reach the error path before initializing the 'arrays' pointer, which in turn leads to a NULL deference. Modified: stable/9/usr.sbin/mfiutil/mfi_config.c Directory Properties: stable/9/usr.sbin/mfiutil/ (props changed) Modified: stable/9/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_config.c Tue Feb 7 04:00:57 2012 (r231111) +++ stable/9/usr.sbin/mfiutil/mfi_config.c Tue Feb 7 04:03:39 2012 (r231112) @@ -348,6 +348,7 @@ parse_array(int fd, int raid_type, char error = mfi_lookup_drive(fd, cp, &device_id); if (error) { free(info->drives); + info->drives = NULL; return (error); } @@ -355,12 +356,14 @@ parse_array(int fd, int raid_type, char error = errno; warn("Failed to fetch drive info for drive %s", cp); free(info->drives); + info->drives = NULL; return (error); } if (pinfo->fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) { warnx("Drive %u is not available", device_id); free(info->drives); + info->drives = NULL; return (EINVAL); } } @@ -817,9 +820,11 @@ error: free(config); free(state.volumes); free(state.arrays); - for (i = 0; i < narrays; i++) - free(arrays[i].drives); - free(arrays); + if (arrays != NULL) { + for (i = 0; i < narrays; i++) + free(arrays[i].drives); + free(arrays); + } close(fd); return (error); From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 04:06:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84B50106566C; Tue, 7 Feb 2012 04:06:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701EC8FC12; Tue, 7 Feb 2012 04:06: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 q1746Lrn067983; Tue, 7 Feb 2012 04:06:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1746Lm3067981; Tue, 7 Feb 2012 04:06:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202070406.q1746Lm3067981@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 04:06: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: r231113 - stable/8/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 04:06:21 -0000 Author: emaste Date: Tue Feb 7 04:06:21 2012 New Revision: 231113 URL: http://svn.freebsd.org/changeset/base/231113 Log: MFC r227893 and r228119: Avoid double free creating a new RAID with invalid command line arguments. In build_volume(), check if arrays is allocated before traversing its items. While parsing the arrays input, it's possible that we reach the error path before initializing the 'arrays' pointer, which in turn leads to a NULL deference. Modified: stable/8/usr.sbin/mfiutil/mfi_config.c Directory Properties: stable/8/usr.sbin/mfiutil/ (props changed) Modified: stable/8/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_config.c Tue Feb 7 04:03:39 2012 (r231112) +++ stable/8/usr.sbin/mfiutil/mfi_config.c Tue Feb 7 04:06:21 2012 (r231113) @@ -348,6 +348,7 @@ parse_array(int fd, int raid_type, char error = mfi_lookup_drive(fd, cp, &device_id); if (error) { free(info->drives); + info->drives = NULL; return (error); } @@ -355,12 +356,14 @@ parse_array(int fd, int raid_type, char error = errno; warn("Failed to fetch drive info for drive %s", cp); free(info->drives); + info->drives = NULL; return (error); } if (pinfo->fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) { warnx("Drive %u is not available", device_id); free(info->drives); + info->drives = NULL; return (EINVAL); } } @@ -817,9 +820,11 @@ error: free(config); free(state.volumes); free(state.arrays); - for (i = 0; i < narrays; i++) - free(arrays[i].drives); - free(arrays); + if (arrays != NULL) { + for (i = 0; i < narrays; i++) + free(arrays[i].drives); + free(arrays); + } close(fd); return (error); From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 06:22:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06DD5106564A; Tue, 7 Feb 2012 06:22:00 +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 DB7A88FC12; Tue, 7 Feb 2012 06:21:59 +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 q176LxLP072248; Tue, 7 Feb 2012 06:21:59 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q176LxSh072243; Tue, 7 Feb 2012 06:21:59 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070621.q176LxSh072243@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 06:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231115 - head/sys/dev/cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 06:22:00 -0000 Author: np Date: Tue Feb 7 06:21:59 2012 New Revision: 231115 URL: http://svn.freebsd.org/changeset/base/231115 Log: cxgbe: reduce diffs with other branches. Will help future MFCs from HEAD. MFC after: 3 days Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_l2t.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Feb 7 04:38:43 2012 (r231114) +++ head/sys/dev/cxgbe/adapter.h Tue Feb 7 06:21:59 2012 (r231115) @@ -66,6 +66,17 @@ prefetch(void *x) #define prefetch(x) #endif +#ifndef SYSCTL_ADD_UQUAD +#define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD +#define sysctl_handle_64 sysctl_handle_quad +#define CTLTYPE_U64 CTLTYPE_QUAD +#endif + +#if (__FreeBSD_version >= 900030) || \ + ((__FreeBSD_version >= 802507) && (__FreeBSD_version < 900000)) +#define SBUF_DRAIN 1 +#endif + #ifdef __amd64__ /* XXX: need systemwide bus_space_read_8/bus_space_write_8 */ static __inline uint64_t Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Tue Feb 7 04:38:43 2012 (r231114) +++ head/sys/dev/cxgbe/t4_l2t.c Tue Feb 7 06:21:59 2012 (r231115) @@ -259,6 +259,7 @@ t4_free_l2t(struct l2t_data *d) return (0); } +#ifdef SBUF_DRAIN static inline unsigned int vlan_prio(const struct l2t_entry *e) { @@ -333,6 +334,7 @@ skip: return (rc); } +#endif #ifndef TCP_OFFLOAD_DISABLE static inline void @@ -652,6 +654,11 @@ t4_l2t_get(struct port_info *pi, struct } else return (NULL); +#ifndef VLAN_TAG + if (ifp->if_type == IFT_L2VLAN) + return (NULL); +#endif + hash = addr_hash(addr, addr_len, ifp->if_index); rw_wlock(&d->lock); @@ -678,10 +685,12 @@ t4_l2t_get(struct port_info *pi, struct e->v6 = (addr_len == 16); e->lle = NULL; atomic_store_rel_int(&e->refcnt, 1); +#ifdef VLAN_TAG if (ifp->if_type == IFT_L2VLAN) VLAN_TAG(ifp, &e->vlan); else e->vlan = VLAN_NONE; +#endif e->next = d->l2tab[hash].first; d->l2tab[hash].first = e; mtx_unlock(&e->lock); Modified: head/sys/dev/cxgbe/t4_l2t.h ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.h Tue Feb 7 04:38:43 2012 (r231114) +++ head/sys/dev/cxgbe/t4_l2t.h Tue Feb 7 06:21:59 2012 (r231115) @@ -67,7 +67,9 @@ struct l2t_entry *t4_l2t_alloc_switching int t4_l2t_set_switching(struct adapter *, struct l2t_entry *, uint16_t, uint8_t, uint8_t *); void t4_l2t_release(struct l2t_entry *); +#ifdef SBUF_DRAIN int sysctl_l2t(SYSCTL_HANDLER_ARGS); +#endif #ifndef TCP_OFFLOAD_DISABLE struct l2t_entry *t4_l2t_get(struct port_info *, struct ifnet *, Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 7 04:38:43 2012 (r231114) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 7 06:21:59 2012 (r231115) @@ -309,6 +309,7 @@ static int sysctl_holdoff_pktc_idx(SYSCT static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); +#ifdef SBUF_DRAIN static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS); static int sysctl_ddp_stats(SYSCTL_HANDLER_ARGS); @@ -324,6 +325,7 @@ static int sysctl_tcp_stats(SYSCTL_HANDL static int sysctl_tids(SYSCTL_HANDLER_ARGS); static int sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); +#endif static inline void txq_start(struct ifnet *, struct sge_txq *); static uint32_t fconf_to_mode(uint32_t); static uint32_t mode_to_fconf(uint32_t); @@ -2980,6 +2982,7 @@ t4_sysctls(struct adapter *sc) sizeof(sc->sge.counter_val), sysctl_int_array, "A", "interrupt holdoff packet counter values"); +#ifdef SBUF_DRAIN /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. */ @@ -3051,6 +3054,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_rate", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tx_rate, "A", "Tx rate"); +#endif #ifndef TCP_OFFLOAD_DISABLE if (is_offload(sc)) { @@ -3465,6 +3469,7 @@ sysctl_handle_t4_reg64(SYSCTL_HANDLER_AR return (sysctl_handle_64(oidp, &val, 0, req)); } +#ifdef SBUF_DRAIN static int sysctl_cctrl(SYSCTL_HANDLER_ARGS) { @@ -4297,6 +4302,7 @@ sysctl_tx_rate(SYSCTL_HANDLER_ARGS) return (rc); } +#endif static inline void txq_start(struct ifnet *ifp, struct sge_txq *txq) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 07:32:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D4F61065670; Tue, 7 Feb 2012 07:32:40 +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 E07848FC13; Tue, 7 Feb 2012 07:32:39 +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 q177Wdcm074521; Tue, 7 Feb 2012 07:32:39 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q177Wdir074516; Tue, 7 Feb 2012 07:32:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070732.q177Wdir074516@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 07:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231116 - in head/sys/dev: cxgb cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 07:32:40 -0000 Author: np Date: Tue Feb 7 07:32:39 2012 New Revision: 231116 URL: http://svn.freebsd.org/changeset/base/231116 Log: Remove if_start from cxgb and cxgbe. Submitted by: jhb MFC after: 3 days Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Tue Feb 7 06:21:59 2012 (r231115) +++ head/sys/dev/cxgb/cxgb_adapter.h Tue Feb 7 07:32:39 2012 (r231116) @@ -572,5 +572,4 @@ static inline int offload_running(adapte void cxgb_tx_watchdog(void *arg); int cxgb_transmit(struct ifnet *ifp, struct mbuf *m); void cxgb_qflush(struct ifnet *ifp); -void cxgb_start(struct ifnet *ifp); #endif Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Tue Feb 7 06:21:59 2012 (r231115) +++ head/sys/dev/cxgb/cxgb_main.c Tue Feb 7 07:32:39 2012 (r231116) @@ -227,14 +227,6 @@ TUNABLE_INT("hw.cxgb.use_16k_clusters", SYSCTL_INT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN, &cxgb_use_16k_clusters, 0, "use 16kB clusters for the jumbo queue "); -/* - * Tune the size of the output queue. - */ -int cxgb_snd_queue_len = IFQ_MAXLEN; -TUNABLE_INT("hw.cxgb.snd_queue_len", &cxgb_snd_queue_len); -SYSCTL_INT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN, - &cxgb_snd_queue_len, 0, "send queue size "); - static int nfilters = -1; TUNABLE_INT("hw.cxgb.nfilters", &nfilters); SYSCTL_INT(_hw_cxgb, OID_AUTO, nfilters, CTLFLAG_RDTUN, @@ -1019,11 +1011,8 @@ cxgb_port_attach(device_t dev) ifp->if_softc = p; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = cxgb_ioctl; - ifp->if_start = cxgb_start; - - ifp->if_snd.ifq_drv_maxlen = max(cxgb_snd_queue_len, ifqmaxlen); - IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); - IFQ_SET_READY(&ifp->if_snd); + ifp->if_transmit = cxgb_transmit; + ifp->if_qflush = cxgb_qflush; ifp->if_capabilities = CXGB_CAP; ifp->if_capenable = CXGB_CAP_ENABLE; @@ -1039,8 +1028,6 @@ cxgb_port_attach(device_t dev) } ether_ifattach(ifp, p->hw_addr); - ifp->if_transmit = cxgb_transmit; - ifp->if_qflush = cxgb_qflush; #ifdef DEFAULT_JUMBO if (sc->params.nports <= 2) Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Tue Feb 7 06:21:59 2012 (r231115) +++ head/sys/dev/cxgb/cxgb_sge.c Tue Feb 7 07:32:39 2012 (r231116) @@ -1767,19 +1767,6 @@ cxgb_transmit(struct ifnet *ifp, struct error = drbr_enqueue(ifp, qs->txq[TXQ_ETH].txq_mr, m); return (error); } -void -cxgb_start(struct ifnet *ifp) -{ - struct port_info *pi = ifp->if_softc; - struct sge_qset *qs = &pi->adapter->sge.qs[pi->first_qset]; - - if (!pi->link_config.link_ok) - return; - - TXQ_LOCK(qs); - cxgb_start_locked(qs); - TXQ_UNLOCK(qs); -} void cxgb_qflush(struct ifnet *ifp) Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 7 06:21:59 2012 (r231115) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 7 07:32:39 2012 (r231116) @@ -112,7 +112,6 @@ static struct cdevsw t4_cdevsw = { /* ifnet + media interface */ static void cxgbe_init(void *); static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t); -static void cxgbe_start(struct ifnet *); static int cxgbe_transmit(struct ifnet *, struct mbuf *); static void cxgbe_qflush(struct ifnet *); static int cxgbe_media_change(struct ifnet *); @@ -829,14 +828,9 @@ cxgbe_attach(device_t dev) ifp->if_init = cxgbe_init; ifp->if_ioctl = cxgbe_ioctl; - ifp->if_start = cxgbe_start; ifp->if_transmit = cxgbe_transmit; ifp->if_qflush = cxgbe_qflush; - ifp->if_snd.ifq_drv_maxlen = 1024; - IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); - IFQ_SET_READY(&ifp->if_snd); - ifp->if_capabilities = T4_CAP; #ifndef TCP_OFFLOAD_DISABLE if (is_offload(pi->adapter)) @@ -1095,21 +1089,6 @@ fail: return (rc); } -static void -cxgbe_start(struct ifnet *ifp) -{ - struct port_info *pi = ifp->if_softc; - struct sge_txq *txq; - int i; - - for_each_txq(pi, i, txq) { - if (TXQ_TRYLOCK(txq)) { - txq_start(ifp, txq); - TXQ_UNLOCK(txq); - } - } -} - static int cxgbe_transmit(struct ifnet *ifp, struct mbuf *m) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 07:56:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 293B01065670; Tue, 7 Feb 2012 07:56:01 +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 114E88FC0A; Tue, 7 Feb 2012 07:56: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 q177u06v075351; Tue, 7 Feb 2012 07:56:00 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q177u0LJ075349; Tue, 7 Feb 2012 07:56:00 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070756.q177u0LJ075349@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 07:56:00 +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: r231117 - stable/8/tools/tools/cxgbetool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 07:56:01 -0000 Author: np Date: Tue Feb 7 07:56:00 2012 New Revision: 231117 URL: http://svn.freebsd.org/changeset/base/231117 Log: MFC r222974: Add "context" subcommand to fetch and display SGE context. Modified: stable/8/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/8/tools/tools/ (props changed) Modified: stable/8/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- stable/8/tools/tools/cxgbetool/cxgbetool.c Tue Feb 7 07:32:39 2012 (r231116) +++ stable/8/tools/tools/cxgbetool/cxgbetool.c Tue Feb 7 07:56:00 2012 (r231117) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +#define max(x, y) ((x) > (y) ? (x) : (y)) + static const char *progname, *nexus; struct reg_info { @@ -62,6 +64,15 @@ struct mod_regs { const struct reg_info *ri; }; +struct field_desc { + const char *name; /* Field name */ + unsigned short start; /* Start bit position */ + unsigned short end; /* End bit position */ + unsigned char shift; /* # of low order bits omitted and implicitly 0 */ + unsigned char hex; /* Print field in hex instead of decimal */ + unsigned char islog2; /* Field contains the base-2 log of the value */ +}; + #include "reg_defs_t4.c" #include "reg_defs_t4vf.c" @@ -70,6 +81,7 @@ usage(FILE *fp) { fprintf(fp, "Usage: %s [operation]\n", progname); fprintf(fp, + "\tcontext show an SGE context\n" "\tfilter [ ] ... set a filter\n" "\tfilter delete|clear delete a filter\n" "\tfilter list list all filters\n" @@ -1125,6 +1137,227 @@ filter_cmd(int argc, const char *argv[]) return set_filter(idx, argc - 1, argv + 1); } +/* + * Shows the fields of a multi-word structure. The structure is considered to + * consist of @nwords 32-bit words (i.e, it's an (@nwords * 32)-bit structure) + * whose fields are described by @fd. The 32-bit words are given in @words + * starting with the least significant 32-bit word. + */ +static void +show_struct(const uint32_t *words, int nwords, const struct field_desc *fd) +{ + unsigned int w = 0; + const struct field_desc *p; + + for (p = fd; p->name; p++) + w = max(w, strlen(p->name)); + + while (fd->name) { + unsigned long long data; + int first_word = fd->start / 32; + int shift = fd->start % 32; + int width = fd->end - fd->start + 1; + unsigned long long mask = (1ULL << width) - 1; + + data = (words[first_word] >> shift) | + ((uint64_t)words[first_word + 1] << (32 - shift)); + if (shift) + data |= ((uint64_t)words[first_word + 2] << (64 - shift)); + data &= mask; + if (fd->islog2) + data = 1 << data; + printf("%-*s ", w, fd->name); + printf(fd->hex ? "%#llx\n" : "%llu\n", data << fd->shift); + fd++; + } +} + +#define FIELD(name, start, end) { name, start, end, 0, 0, 0 } +#define FIELD1(name, start) FIELD(name, start, start) + +static void +show_sge_context(const struct t4_sge_context *p) +{ + static struct field_desc egress[] = { + FIELD1("StatusPgNS:", 180), + FIELD1("StatusPgRO:", 179), + FIELD1("FetchNS:", 178), + FIELD1("FetchRO:", 177), + FIELD1("Valid:", 176), + FIELD("PCIeDataChannel:", 174, 175), + FIELD1("DCAEgrQEn:", 173), + FIELD("DCACPUID:", 168, 172), + FIELD1("FCThreshOverride:", 167), + FIELD("WRLength:", 162, 166), + FIELD1("WRLengthKnown:", 161), + FIELD1("ReschedulePending:", 160), + FIELD1("OnChipQueue:", 159), + FIELD1("FetchSizeMode", 158), + { "FetchBurstMin:", 156, 157, 4, 0, 1 }, + { "FetchBurstMax:", 153, 154, 6, 0, 1 }, + FIELD("uPToken:", 133, 152), + FIELD1("uPTokenEn:", 132), + FIELD1("UserModeIO:", 131), + FIELD("uPFLCredits:", 123, 130), + FIELD1("uPFLCreditEn:", 122), + FIELD("FID:", 111, 121), + FIELD("HostFCMode:", 109, 110), + FIELD1("HostFCOwner:", 108), + { "CIDXFlushThresh:", 105, 107, 0, 0, 1 }, + FIELD("CIDX:", 89, 104), + FIELD("PIDX:", 73, 88), + { "BaseAddress:", 18, 72, 9, 1 }, + FIELD("QueueSize:", 2, 17), + FIELD1("QueueType:", 1), + FIELD1("CachePriority:", 0), + { NULL } + }; + static struct field_desc fl[] = { + FIELD1("StatusPgNS:", 180), + FIELD1("StatusPgRO:", 179), + FIELD1("FetchNS:", 178), + FIELD1("FetchRO:", 177), + FIELD1("Valid:", 176), + FIELD("PCIeDataChannel:", 174, 175), + FIELD1("DCAEgrQEn:", 173), + FIELD("DCACPUID:", 168, 172), + FIELD1("FCThreshOverride:", 167), + FIELD("WRLength:", 162, 166), + FIELD1("WRLengthKnown:", 161), + FIELD1("ReschedulePending:", 160), + FIELD1("OnChipQueue:", 159), + FIELD1("FetchSizeMode", 158), + { "FetchBurstMin:", 156, 157, 4, 0, 1 }, + { "FetchBurstMax:", 153, 154, 6, 0, 1 }, + FIELD1("FLMcongMode:", 152), + FIELD("MaxuPFLCredits:", 144, 151), + FIELD("FLMcontextID:", 133, 143), + FIELD1("uPTokenEn:", 132), + FIELD1("UserModeIO:", 131), + FIELD("uPFLCredits:", 123, 130), + FIELD1("uPFLCreditEn:", 122), + FIELD("FID:", 111, 121), + FIELD("HostFCMode:", 109, 110), + FIELD1("HostFCOwner:", 108), + { "CIDXFlushThresh:", 105, 107, 0, 0, 1 }, + FIELD("CIDX:", 89, 104), + FIELD("PIDX:", 73, 88), + { "BaseAddress:", 18, 72, 9, 1 }, + FIELD("QueueSize:", 2, 17), + FIELD1("QueueType:", 1), + FIELD1("CachePriority:", 0), + { NULL } + }; + static struct field_desc ingress[] = { + FIELD1("NoSnoop:", 145), + FIELD1("RelaxedOrdering:", 144), + FIELD1("GTSmode:", 143), + FIELD1("ISCSICoalescing:", 142), + FIELD1("Valid:", 141), + FIELD1("TimerPending:", 140), + FIELD1("DropRSS:", 139), + FIELD("PCIeChannel:", 137, 138), + FIELD1("SEInterruptArmed:", 136), + FIELD1("CongestionMgtEnable:", 135), + FIELD1("DCAIngQEnable:", 134), + FIELD("DCACPUID:", 129, 133), + FIELD1("UpdateScheduling:", 128), + FIELD("UpdateDelivery:", 126, 127), + FIELD1("InterruptSent:", 125), + FIELD("InterruptIDX:", 114, 124), + FIELD1("InterruptDestination:", 113), + FIELD1("InterruptArmed:", 112), + FIELD("RxIntCounter:", 106, 111), + FIELD("RxIntCounterThreshold:", 104, 105), + FIELD1("Generation:", 103), + { "BaseAddress:", 48, 102, 9, 1 }, + FIELD("PIDX:", 32, 47), + FIELD("CIDX:", 16, 31), + { "QueueSize:", 4, 15, 4, 0 }, + { "QueueEntrySize:", 2, 3, 4, 0, 1 }, + FIELD1("QueueEntryOverride:", 1), + FIELD1("CachePriority:", 0), + { NULL } + }; + static struct field_desc flm[] = { + FIELD1("NoSnoop:", 79), + FIELD1("RelaxedOrdering:", 78), + FIELD1("Valid:", 77), + FIELD("DCACPUID:", 72, 76), + FIELD1("DCAFLEn:", 71), + FIELD("EQid:", 54, 70), + FIELD("SplitEn:", 52, 53), + FIELD1("PadEn:", 51), + FIELD1("PackEn:", 50), + FIELD1("DBpriority:", 48), + FIELD("PackOffset:", 16, 47), + FIELD("CIDX:", 8, 15), + FIELD("PIDX:", 0, 7), + { NULL } + }; + static struct field_desc conm[] = { + FIELD1("CngDBPHdr:", 6), + FIELD1("CngDBPData:", 5), + FIELD1("CngIMSG:", 4), + FIELD("CngChMap:", 0, 3), + { NULL } + }; + + if (p->mem_id == SGE_CONTEXT_EGRESS) + show_struct(p->data, 6, (p->data[0] & 2) ? fl : egress); + else if (p->mem_id == SGE_CONTEXT_FLM) + show_struct(p->data, 3, flm); + else if (p->mem_id == SGE_CONTEXT_INGRESS) + show_struct(p->data, 5, ingress); + else if (p->mem_id == SGE_CONTEXT_CNM) + show_struct(p->data, 1, conm); +} + +#undef FIELD +#undef FIELD1 + +static int +get_sge_context(int argc, const char *argv[]) +{ + int rc; + char *p; + long cid; + struct t4_sge_context cntxt = {0}; + + if (argc != 2) { + warnx("sge_context: incorrect number of arguments."); + return (EINVAL); + } + + if (!strcmp(argv[0], "egress")) + cntxt.mem_id = SGE_CONTEXT_EGRESS; + else if (!strcmp(argv[0], "ingress")) + cntxt.mem_id = SGE_CONTEXT_INGRESS; + else if (!strcmp(argv[0], "fl")) + cntxt.mem_id = SGE_CONTEXT_FLM; + else if (!strcmp(argv[0], "cong")) + cntxt.mem_id = SGE_CONTEXT_CNM; + else { + warnx("unknown context type \"%s\"; known types are egress, " + "ingress, fl, and cong.", argv[0]); + return (EINVAL); + } + + p = str_to_number(argv[1], &cid, NULL); + if (*p) { + warnx("invalid context id \"%s\"", argv[1]); + return (EINVAL); + } + cntxt.cid = cid; + + rc = doit(CHELSIO_T4_GET_SGE_CONTEXT, &cntxt); + if (rc != 0) + return (rc); + + show_sge_context(&cntxt); + return (0); +} + static int loadfw(int argc, const char *argv[]) { @@ -1306,6 +1539,8 @@ run_cmd(int argc, const char *argv[]) rc = dump_regs(argc, argv); else if (!strcmp(cmd, "filter")) rc = filter_cmd(argc, argv); + else if (!strcmp(cmd, "context")) + rc = get_sge_context(argc, argv); else if (!strcmp(cmd, "loadfw")) rc = loadfw(argc, argv); else if (!strcmp(cmd, "memdump")) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 09:27:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D93991065687; Tue, 7 Feb 2012 09:27:08 +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 BFD348FC15; Tue, 7 Feb 2012 09:27:08 +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 q179R85j078242; Tue, 7 Feb 2012 09:27:08 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179R81a078218; Tue, 7 Feb 2012 09:27:08 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202070927.q179R81a078218@svn.freebsd.org> From: Dimitry Andric Date: Tue, 7 Feb 2012 09:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231118 - in head: include/rpc include/rpcsvc lib/libc/rpc lib/libc/yp lib/librpcsvc lib/libypclnt libexec/ypxfr release/picobsd/tinyware/passwd sys/conf sys/modules/kgssapi sys/modules... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:27:09 -0000 Author: dim Date: Tue Feb 7 09:27:07 2012 New Revision: 231118 URL: http://svn.freebsd.org/changeset/base/231118 Log: Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp. MFC after: 1 week Modified: head/include/rpc/Makefile head/include/rpcsvc/Makefile head/lib/libc/rpc/Makefile.inc head/lib/libc/yp/Makefile.inc head/lib/librpcsvc/Makefile head/lib/libypclnt/Makefile head/libexec/ypxfr/Makefile head/release/picobsd/tinyware/passwd/Makefile head/sys/conf/files head/sys/modules/kgssapi/Makefile head/sys/modules/kgssapi_krb5/Makefile head/usr.sbin/amd/Makefile.inc head/usr.sbin/bootparamd/bootparamd/Makefile head/usr.sbin/bootparamd/callbootd/Makefile head/usr.sbin/gssd/Makefile head/usr.sbin/keyserv/Makefile head/usr.sbin/rpc.lockd/Makefile head/usr.sbin/rpc.statd/Makefile head/usr.sbin/rpc.yppasswdd/Makefile head/usr.sbin/rpc.ypupdated/Makefile head/usr.sbin/rpc.ypxfrd/Makefile head/usr.sbin/yppush/Makefile head/usr.sbin/ypserv/Makefile Modified: head/include/rpc/Makefile ============================================================================== --- head/include/rpc/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/include/rpc/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -3,7 +3,7 @@ .SUFFIXES: .x -RPCCOM = rpcgen -C +RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C HDRS= rpcb_prot.h Modified: head/include/rpcsvc/Makefile ============================================================================== --- head/include/rpcsvc/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/include/rpcsvc/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -3,7 +3,7 @@ .SUFFIXES: .x -RPCCOM = rpcgen -C +RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C HDRS= key_prot.h klm_prot.h mount.h nfs_prot.h nlm_prot.h rex.h rnusers.h \ rquota.h rstat.h rwall.h sm_inter.h spray.h yppasswd.h yp.h \ Modified: head/lib/libc/rpc/Makefile.inc ============================================================================== --- head/lib/libc/rpc/Makefile.inc Tue Feb 7 07:56:00 2012 (r231117) +++ head/lib/libc/rpc/Makefile.inc Tue Feb 7 09:27:07 2012 (r231118) @@ -34,7 +34,7 @@ CFLAGS+= -I${.CURDIR}/rpc CLEANFILES+= crypt_clnt.c crypt_xdr.c crypt.h RPCDIR= ${DESTDIR}/usr/include/rpcsvc -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C crypt_clnt.c: ${RPCDIR}/crypt.x crypt.h ${RPCGEN} -l -o ${.TARGET} ${RPCDIR}/crypt.x Modified: head/lib/libc/yp/Makefile.inc ============================================================================== --- head/lib/libc/yp/Makefile.inc Tue Feb 7 07:56:00 2012 (r231117) +++ head/lib/libc/yp/Makefile.inc Tue Feb 7 09:27:07 2012 (r231118) @@ -10,7 +10,7 @@ CLEANFILES+= yp.h yp_xdr.c SYM_MAPS+= ${.CURDIR}/yp/Symbol.map RPCSRC= ${DESTDIR}/usr/include/rpcsvc/yp.x -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C yp_xdr.c: ${RPCSRC} ${RPCGEN} -c -o ${.TARGET} ${RPCSRC} Modified: head/lib/librpcsvc/Makefile ============================================================================== --- head/lib/librpcsvc/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/lib/librpcsvc/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -18,7 +18,7 @@ SECRPCSRCS= secretkey.c xcrypt.c OTHERSRCS+= yp_passwd.c yp_update.c .endif -RPCCOM = rpcgen -C +RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C INCDIRS= -I${DESTDIR}/usr/include/rpcsvc Modified: head/lib/libypclnt/Makefile ============================================================================== --- head/lib/libypclnt/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/lib/libypclnt/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -22,7 +22,7 @@ GENSRCS=yp.h \ yppasswd_private_clnt.c \ yppasswd_private_xdr.c -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C RPCSRC= ${.CURDIR}/../../include/rpcsvc/yp.x RPCSRC_PW= ${.CURDIR}/../../include/rpcsvc/yppasswd.x RPCSRC_PRIV= ${.CURDIR}/../../usr.sbin/rpc.yppasswdd/yppasswd_private.x Modified: head/libexec/ypxfr/Makefile ============================================================================== --- head/libexec/ypxfr/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/libexec/ypxfr/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -22,7 +22,7 @@ LDADD= -lrpcsvc CLEANFILES= ${GENSRCS} RPCDIR= ${.CURDIR}/../../include/rpcsvc -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C ypxfr_clnt.c: ${RPCDIR}/yp.x rm -f ${.TARGET} Modified: head/release/picobsd/tinyware/passwd/Makefile ============================================================================== --- head/release/picobsd/tinyware/passwd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/release/picobsd/tinyware/passwd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -26,7 +26,7 @@ CFLAGS+= -DLOGIN_CAP -DCRYPT -I. -I${.CU CLEANFILES= ${GENSRCS} -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C RPCSRC= ${DESTDIR}/usr/include/rpcsvc/yp.x RPCSRC_PW= ${DESTDIR}/usr/include/rpcsvc/yppasswd.x RPCSRC_PRIV= ${.CURDIR}/../../usr.sbin/rpc.yppasswdd/yppasswd_private.x Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 7 07:56:00 2012 (r231117) +++ head/sys/conf/files Tue Feb 7 09:27:07 2012 (r231118) @@ -2499,17 +2499,17 @@ kern/vfs_vnops.c standard # gssd.h optional kgssapi \ dependency "$S/kgssapi/gssd.x" \ - compile-with "rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h" \ no-obj no-implicit-rule before-depend local \ clean "gssd.h" gssd_xdr.c optional kgssapi \ dependency "$S/kgssapi/gssd.x gssd.h" \ - compile-with "rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c" \ no-implicit-rule before-depend local \ clean "gssd_xdr.c" gssd_clnt.c optional kgssapi \ dependency "$S/kgssapi/gssd.x gssd.h" \ - compile-with "rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c" \ no-implicit-rule before-depend local \ clean "gssd_clnt.c" kgssapi/gss_accept_sec_context.c optional kgssapi Modified: head/sys/modules/kgssapi/Makefile ============================================================================== --- head/sys/modules/kgssapi/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/sys/modules/kgssapi/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -44,12 +44,12 @@ CLEANFILES= gssd.h gssd_xdr.c gssd_clnt. S= ${.CURDIR}/../.. gssd.h: $S/kgssapi/gssd.x - rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h + RPCGEN_CPP=${CPP:Q} rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h gssd_xdr.c: $S/kgssapi/gssd.x - rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c + RPCGEN_CPP=${CPP:Q} rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c gssd_clnt.c: $S/kgssapi/gssd.x - rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c + RPCGEN_CPP=${CPP:Q} rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c .include Modified: head/sys/modules/kgssapi_krb5/Makefile ============================================================================== --- head/sys/modules/kgssapi_krb5/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/sys/modules/kgssapi_krb5/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -18,6 +18,6 @@ CLEANFILES= gssd.h S= ${.CURDIR}/../.. gssd.h: $S/kgssapi/gssd.x - rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h + RPCGEN_CPP=${CPP:Q} rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h .include Modified: head/usr.sbin/amd/Makefile.inc ============================================================================== --- head/usr.sbin/amd/Makefile.inc Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/amd/Makefile.inc Tue Feb 7 09:27:07 2012 (r231118) @@ -36,7 +36,7 @@ LIBAMUDIR= ${.CURDIR}/../libamu .endif LIBAMU= ${LIBAMUDIR}/libamu.a -RPCCOM= rpcgen +RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen MOUNT_X= ${DESTDIR}/usr/include/rpcsvc/mount.x NFS_PROT_X= ${DESTDIR}/usr/include/rpcsvc/nfs_prot.x Modified: head/usr.sbin/bootparamd/bootparamd/Makefile ============================================================================== --- head/usr.sbin/bootparamd/bootparamd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/bootparamd/bootparamd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -18,12 +18,12 @@ CLEANFILES= ${GENSRCS} RPCSRC= ${DESTDIR}/usr/include/rpcsvc/bootparam_prot.x bootparam_prot_svc.c: ${RPCSRC} - rpcgen -C -m -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -m -o ${.TARGET} ${RPCSRC} bootparam_prot_xdr.c: ${RPCSRC} - rpcgen -C -c -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -c -o ${.TARGET} ${RPCSRC} bootparam_prot.h: ${RPCSRC} - rpcgen -C -h -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -h -o ${.TARGET} ${RPCSRC} .include Modified: head/usr.sbin/bootparamd/callbootd/Makefile ============================================================================== --- head/usr.sbin/bootparamd/callbootd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/bootparamd/callbootd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -13,12 +13,12 @@ CLEANFILES= ${GENSRCS} RPCSRC= ${DESTDIR}/usr/include/rpcsvc/bootparam_prot.x bootparam_prot_clnt.c: ${RPCSRC} - rpcgen -C -l -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -l -o ${.TARGET} ${RPCSRC} bootparam_prot_xdr.c: ${RPCSRC} - rpcgen -C -c -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -c -o ${.TARGET} ${RPCSRC} bootparam_prot.h: ${RPCSRC} - rpcgen -C -h -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -h -o ${.TARGET} ${RPCSRC} .include Modified: head/usr.sbin/gssd/Makefile ============================================================================== --- head/usr.sbin/gssd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/gssd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -13,7 +13,7 @@ LDADD= -lgssapi CLEANFILES= gssd_svc.c gssd.h RPCSRC= ${.CURDIR}/../../sys/kgssapi/gssd.x -RPCGEN= rpcgen -L -C -M +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C -M gssd_svc.c: ${RPCSRC} gssd.h ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} Modified: head/usr.sbin/keyserv/Makefile ============================================================================== --- head/usr.sbin/keyserv/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/keyserv/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -15,7 +15,7 @@ RPCDIR= ${DESTDIR}/usr/include/rpcsvc CLEANFILES= crypt_svc.c crypt.h -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C crypt_svc.c: ${RPCDIR}/crypt.x ${RPCGEN} -m -o ${.TARGET} ${RPCDIR}/crypt.x Modified: head/usr.sbin/rpc.lockd/Makefile ============================================================================== --- head/usr.sbin/rpc.lockd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.lockd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -15,7 +15,7 @@ LDADD= -lrpcsvc -lutil CLEANFILES= nlm_prot_svc.c nlm_prot.h test RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x -RPCGEN= rpcgen -L -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C nlm_prot_svc.c: ${RPCSRC} ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} Modified: head/usr.sbin/rpc.statd/Makefile ============================================================================== --- head/usr.sbin/rpc.statd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.statd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -13,7 +13,7 @@ LDADD= -lrpcsvc CLEANFILES= sm_inter_svc.c sm_inter.h RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x -RPCGEN= rpcgen -L -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C sm_inter_svc.c: ${RPCSRC} ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} Modified: head/usr.sbin/rpc.yppasswdd/Makefile ============================================================================== --- head/usr.sbin/rpc.yppasswdd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.yppasswdd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -25,7 +25,7 @@ LDADD= -lrpcsvc -lcrypt -lutil CLEANFILES= ${GENSRCS} -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C # We need to remove the 'static' keyword from _rpcsvcstate so that # yppasswdd_main.c can see it. Modified: head/usr.sbin/rpc.ypupdated/Makefile ============================================================================== --- head/usr.sbin/rpc.ypupdated/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.ypupdated/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -19,7 +19,7 @@ LDADD= -lrpcsvc CLEANFILES= ypupdate_prot_svc.c ypupdate_prot.h RPCDIR= ${DESTDIR}/usr/include/rpcsvc -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C # We need to remove the 'static' keyword from _rpcsvcstate so that # ypupdated_main.c can see it. Modified: head/usr.sbin/rpc.ypxfrd/Makefile ============================================================================== --- head/usr.sbin/rpc.ypxfrd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.ypxfrd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -17,7 +17,7 @@ LDADD= -lrpcsvc CLEANFILES= ypxfrd_svc.c ypxfrd.h RPCDIR= ${.CURDIR}/../../include/rpcsvc -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C # We need to remove the 'static' keyword from _rpcsvcstate so that # ypxfrd_main.c can see it. Modified: head/usr.sbin/yppush/Makefile ============================================================================== --- head/usr.sbin/yppush/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/yppush/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -14,7 +14,7 @@ CFLAGS+= -I. -I${.CURDIR}/../../libexec/ WARNS?= 2 -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C CLEANFILES= ${GENSRCS} Modified: head/usr.sbin/ypserv/Makefile ============================================================================== --- head/usr.sbin/ypserv/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/ypserv/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -17,7 +17,7 @@ LDADD= -lwrap CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C # We need to remove the 'static' keyword from _rpcsvcstate so that # yp_main.c can see it. From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 09:37:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0BD21065674; Tue, 7 Feb 2012 09:37:30 +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 DAC058FC0C; Tue, 7 Feb 2012 09:37: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 q179bUpc078603; Tue, 7 Feb 2012 09:37:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179bUGm078601; Tue, 7 Feb 2012 09:37:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202070937.q179bUGm078601@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 Feb 2012 09:37:30 +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: r231119 - stable/9/usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:37:31 -0000 Author: kib Date: Tue Feb 7 09:37:30 2012 New Revision: 231119 URL: http://svn.freebsd.org/changeset/base/231119 Log: MFC r230978: Be as explicit as possible when describing relation between the -m mask argument and slices. Adjust example for the same reason. Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 Directory Properties: stable/9/usr.sbin/boot0cfg/ (props changed) Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/9/usr.sbin/boot0cfg/boot0cfg.8 Tue Feb 7 09:27:07 2012 (r231118) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.8 Tue Feb 7 09:37:30 2012 (r231119) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2011 +.Dd February 4, 2012 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -114,6 +114,9 @@ Specify slices to be enabled/disabled, w .Ar mask is an integer between 0 (no slices enabled) and 0xf (all four slices enabled). +Each mask bit enables corresponding slice if set to 1. +The least significant bit of the mask corresponds to slice 1, +the most significant bit of the mask corresponds to slice 4. .It Fl o Ar options A comma-separated string of any of the following options may be specified (with @@ -172,9 +175,9 @@ To boot slice 2 on the next boot: .Pp .Dl "boot0cfg -s 2 ad0" .Pp -To enable just slices 1 and 2 in the menu: +To enable just slices 1 and 3 in the menu: .Pp -.Dl "boot0cfg -m 0x3 ad0" +.Dl "boot0cfg -m 0x5 ad0" .Pp To go back to non-interactive booting, use .Xr fdisk 8 From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 09:39:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8B04106566B; Tue, 7 Feb 2012 09:39:46 +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 B29408FC18; Tue, 7 Feb 2012 09:39:46 +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 q179dkxS078719; Tue, 7 Feb 2012 09:39:46 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179dkNk078717; Tue, 7 Feb 2012 09:39:46 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070939.q179dkNk078717@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 09:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231120 - head/sys/dev/cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:39:47 -0000 Author: np Date: Tue Feb 7 09:39:46 2012 New Revision: 231120 URL: http://svn.freebsd.org/changeset/base/231120 Log: Acquire the adapter lock before updating fields of the filter structure. Submitted by: gnn (different version) MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 7 09:37:30 2012 (r231119) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 7 09:39:46 2012 (r231120) @@ -4839,22 +4839,22 @@ filter_rpl(struct sge_iq *iq, const stru unsigned int rc = G_COOKIE(rpl->cookie); struct filter_entry *f = &sc->tids.ftid_tab[idx]; + ADAPTER_LOCK(sc); if (rc == FW_FILTER_WR_FLT_ADDED) { f->smtidx = (be64toh(rpl->oldval) >> 24) & 0xff; f->pending = 0; /* asynchronous setup completed */ f->valid = 1; - return (0); - } + } else { + if (rc != FW_FILTER_WR_FLT_DELETED) { + /* Add or delete failed, display an error */ + log(LOG_ERR, + "filter %u setup failed with error %u\n", + idx, rc); + } - if (rc != FW_FILTER_WR_FLT_DELETED) { - /* Add or delete failed, need to display an error */ - device_printf(sc->dev, - "filter %u setup failed with error %u\n", idx, rc); + clear_filter(f); + sc->tids.ftids_in_use--; } - - clear_filter(f); - ADAPTER_LOCK(sc); - sc->tids.ftids_in_use--; ADAPTER_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 09:40:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 911981065676; Tue, 7 Feb 2012 09:40:23 +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 7AF0E8FC12; Tue, 7 Feb 2012 09:40: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 q179eNXD078783; Tue, 7 Feb 2012 09:40:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179eNcF078781; Tue, 7 Feb 2012 09:40:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202070940.q179eNcF078781@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 Feb 2012 09:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231121 - stable/8/usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:40:23 -0000 Author: kib Date: Tue Feb 7 09:40:22 2012 New Revision: 231121 URL: http://svn.freebsd.org/changeset/base/231121 Log: MFC r230978: Be as explicit as possible when describing relation between the -m mask argument and slices. Adjust example for the same reason. Modified: stable/8/usr.sbin/boot0cfg/boot0cfg.8 Directory Properties: stable/8/usr.sbin/boot0cfg/ (props changed) Modified: stable/8/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/8/usr.sbin/boot0cfg/boot0cfg.8 Tue Feb 7 09:39:46 2012 (r231120) +++ stable/8/usr.sbin/boot0cfg/boot0cfg.8 Tue Feb 7 09:40:22 2012 (r231121) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 13, 2009 +.Dd February 4, 2012 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -114,6 +114,9 @@ Specify slices to be enabled/disabled, w .Ar mask is an integer between 0 (no slices enabled) and 0xf (all four slices enabled). +Each mask bit enables corresponding slice if set to 1. +The least significant bit of the mask corresponds to slice 1, +the most significant bit of the mask corresponds to slice 4. .It Fl o Ar options A comma-separated string of any of the following options may be specified (with @@ -187,9 +190,9 @@ To boot slice 2 on the next boot: .Pp .Dl "boot0cfg -s 2 ad0" .Pp -To enable just slices 1 and 2 in the menu: +To enable just slices 1 and 3 in the menu: .Pp -.Dl "boot0cfg -m 0x3 ad0" +.Dl "boot0cfg -m 0x5 ad0" .Pp To go back to non-interactive booting, use .Xr fdisk 8 From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 09:51:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDA18106564A; Tue, 7 Feb 2012 09:51:41 +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 9E3408FC08; Tue, 7 Feb 2012 09:51:41 +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 q179pfog079150; Tue, 7 Feb 2012 09:51:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179pfM6079147; Tue, 7 Feb 2012 09:51:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202070951.q179pfM6079147@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 Feb 2012 09:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231122 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:51:41 -0000 Author: kib Date: Tue Feb 7 09:51:41 2012 New Revision: 231122 URL: http://svn.freebsd.org/changeset/base/231122 Log: Sprinkle missed calls to asynchronous UFS_UPDATE() in attempt to guarantee that all UFS inode metadata changes results in the dirtiness of the inodeblock. Due to missed inodeblock updates, syncer was required to fsync each mount point' vnode to guarantee periodic metadata flush. Reviewed by: mckusick Tested by: scottl MFC after: 2 weeks Modified: head/sys/ufs/ufs/ufs_acl.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_acl.c ============================================================================== --- head/sys/ufs/ufs/ufs_acl.c Tue Feb 7 09:40:22 2012 (r231121) +++ head/sys/ufs/ufs/ufs_acl.c Tue Feb 7 09:51:41 2012 (r231122) @@ -422,7 +422,8 @@ ufs_setacl_nfs4_internal(struct vnode *v VN_KNOTE_UNLOCKED(vp, NOTE_ATTRIB); - return (0); + error = UFS_UPDATE(vp, 0); + return (error); } static int @@ -591,10 +592,11 @@ ufs_setacl_posix1e(struct vop_setacl_arg */ ufs_sync_inode_from_acl(ap->a_aclp, ip); ip->i_flag |= IN_CHANGE; + error = UFS_UPDATE(ap->a_vp, 0); } VN_KNOTE_UNLOCKED(ap->a_vp, NOTE_ATTRIB); - return (0); + return (error); } int Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Feb 7 09:40:22 2012 (r231121) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Feb 7 09:51:41 2012 (r231122) @@ -571,8 +571,9 @@ ufs_setattr(ap) DIP_SET(ip, i_flags, ip->i_flags); } ip->i_flag |= IN_CHANGE; + error = UFS_UPDATE(vp, 0); if (vap->va_flags & (IMMUTABLE | APPEND)) - return (0); + return (error); } if (ip->i_flags & (IMMUTABLE | APPEND)) return (EPERM); @@ -738,6 +739,9 @@ ufs_markatime(ap) VI_LOCK(vp); ip->i_flag |= IN_ACCESS; VI_UNLOCK(vp); + /* + * XXXKIB No UFS_UPDATE(ap->a_vp, 0) there. + */ return (0); } @@ -794,6 +798,9 @@ ufs_chmod(vp, mode, cred, td) if ((vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0) error = ufs_update_nfs4_acl_after_mode_change(vp, mode, ip->i_uid, cred, td); #endif + if (error == 0 && (ip->i_flag & IN_CHANGE) != 0) + error = UFS_UPDATE(vp, 0); + return (error); } @@ -912,7 +919,8 @@ good: DIP_SET(ip, i_mode, ip->i_mode); } } - return (0); + error = UFS_UPDATE(vp, 0); + return (error); } static int @@ -2079,6 +2087,7 @@ ufs_rmdir(ap) dp->i_nlink--; DIP_SET(dp, i_nlink, dp->i_nlink); dp->i_flag |= IN_CHANGE; + error = UFS_UPDATE(dvp, 0); ip->i_nlink--; DIP_SET(ip, i_nlink, ip->i_nlink); ip->i_flag |= IN_CHANGE; @@ -2122,6 +2131,7 @@ ufs_symlink(ap) ip->i_size = len; DIP_SET(ip, i_size, len); ip->i_flag |= IN_CHANGE | IN_UPDATE; + error = UFS_UPDATE(vp, 0); } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 10:59:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F70C1065688; Tue, 7 Feb 2012 10:59:20 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E85B8FC0C; Tue, 7 Feb 2012 10:59: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 q17AxJTn086313; Tue, 7 Feb 2012 10:59:19 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17AxJNS086311; Tue, 7 Feb 2012 10:59:19 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201202071059.q17AxJNS086311@svn.freebsd.org> From: Takahashi Yoshihiro Date: Tue, 7 Feb 2012 10:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231123 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 10:59:20 -0000 Author: nyan Date: Tue Feb 7 10:59:19 2012 New Revision: 231123 URL: http://svn.freebsd.org/changeset/base/231123 Log: - Set TERM to cons25w on pc98 because we still use old cons25w terminal to show Japanese. - Add cons25w to terminal lists. Reviewed by: nwhitehorn MFC after: 1 week Modified: head/release/rc.local Modified: head/release/rc.local ============================================================================== --- head/release/rc.local Tue Feb 7 09:51:41 2012 (r231122) +++ head/release/rc.local Tue Feb 7 10:59:19 2012 (r231123) @@ -8,10 +8,16 @@ : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} +MACHINE=`uname -m` + kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then # Syscons: use xterm, start interesting things on other VTYs - TERM=xterm + if [ ${MACHINE} = "pc98" ]; then + TERM=cons25w + else + TERM=xterm + fi if [ -z "$EXTERNAL_VTY_STARTED" ]; then # Init will clean these processes up if/when the system @@ -31,6 +37,7 @@ else echo " ansi Standard ANSI terminal" echo " vt100 VT100 or compatible terminal" echo " xterm xterm terminal emulator (or compatible)" + echo " cons25w cons25w terminal" echo echo -n "Console type [vt100]: " read TERM From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 11:11:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C300106568A; Tue, 7 Feb 2012 11:11:33 +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 DED0A8FC12; Tue, 7 Feb 2012 11:11:32 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q17B7T1K069510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Feb 2012 13:07:29 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q17B7TDG004337; Tue, 7 Feb 2012 13:07:29 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q17B7TPd004336; Tue, 7 Feb 2012 13:07:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 Feb 2012 13:07:29 +0200 From: Konstantin Belousov To: Dimitry Andric Message-ID: <20120207110729.GB3283@deviant.kiev.zoral.com.ua> References: <201202070927.q179R81a078218@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lJ4sC/874/3I/gBU" Content-Disposition: inline In-Reply-To: <201202070927.q179R81a078218@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 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231118 - in head: include/rpc include/rpcsvc lib/libc/rpc lib/libc/yp lib/librpcsvc lib/libypclnt libexec/ypxfr release/picobsd/tinyware/passwd sys/conf sys/modules/kgssapi sys/modules... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 11:11:33 -0000 --lJ4sC/874/3I/gBU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 07, 2012 at 09:27:08AM +0000, Dimitry Andric wrote: > Author: dim > Date: Tue Feb 7 09:27:07 2012 > New Revision: 231118 > URL: http://svn.freebsd.org/changeset/base/231118 >=20 > Log: > Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor > set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp. > =20 > MFC after: 1 week Shouldn't RPCGEN move to share/mk ? --lJ4sC/874/3I/gBU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk8xBfEACgkQC3+MBN1Mb4iRHgCeKiq+CAn8fXQ2Pu/jtGjWIOGJ CncAoNYwyvy3AJYkkP+MQj3M8uI71bNE =Lge7 -----END PGP SIGNATURE----- --lJ4sC/874/3I/gBU-- From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 11:53:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEC31065675; Tue, 7 Feb 2012 11:53:08 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2658FC0A; Tue, 7 Feb 2012 11:53:08 +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 q17Br8mS088181; Tue, 7 Feb 2012 11:53:08 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Br8tW088179; Tue, 7 Feb 2012 11:53:08 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201202071153.q17Br8tW088179@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 7 Feb 2012 11:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231128 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 11:53:08 -0000 Author: uqs Date: Tue Feb 7 11:53:08 2012 New Revision: 231128 URL: http://svn.freebsd.org/changeset/base/231128 Log: Record my ports mentor relationship. Approved by: beat (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Feb 7 11:40:38 2012 (r231127) +++ head/share/misc/committers-ports.dot Tue Feb 7 11:53:08 2012 (r231128) @@ -184,6 +184,7 @@ trasz [label="Edward Tomasz Napierala\nt trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2004/07/06"] thierry [label="Thierry Thomas\nthierry@FreeBSD.org\n2004/03/15"] tmclaugh [label="Tom McLaughlin\ntmclaugh@FreeBSD.org\n2005/09/15"] +uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2012/01/19"] vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"] wen [label="Wen Heping\nwen@FreeBSD.org\n2010/12/13"] wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"] @@ -220,6 +221,7 @@ bapt -> eadler bapt -> jlaffaye beat -> decke +beat -> uqs beech -> glarkin beech -> mva From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 14:06:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2B271065696; Tue, 7 Feb 2012 14:06:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91F058FC0C; Tue, 7 Feb 2012 14:06: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 q17E6UEl092327; Tue, 7 Feb 2012 14:06:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17E6U8X092325; Tue, 7 Feb 2012 14:06:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202071406.q17E6U8X092325@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 14:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231129 - head/sbin/reboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 14:06:30 -0000 Author: emaste Date: Tue Feb 7 14:06:30 2012 New Revision: 231129 URL: http://svn.freebsd.org/changeset/base/231129 Log: Add BSD copyright notice. Approved by: gordon@ Modified: head/sbin/reboot/nextboot.sh Modified: head/sbin/reboot/nextboot.sh ============================================================================== --- head/sbin/reboot/nextboot.sh Tue Feb 7 11:53:08 2012 (r231128) +++ head/sbin/reboot/nextboot.sh Tue Feb 7 14:06:30 2012 (r231129) @@ -1,9 +1,29 @@ #! /bin/sh # -# Copyright 2002. Gordon Tetlow. -# gordon@FreeBSD.org +# Copyright (c) 2002 Gordon Tetlow. All rights reserved. # Copyright (c) 2012 Sandvine Incorporated. All rights reserved. # +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# # $FreeBSD$ delete="NO" From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 14:50:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 477501065674; Tue, 7 Feb 2012 14:50:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C4C08FC08; Tue, 7 Feb 2012 14:50:34 +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 q17EoXom093756; Tue, 7 Feb 2012 14:50:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17EoXQm093754; Tue, 7 Feb 2012 14:50:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202071450.q17EoXQm093754@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 7 Feb 2012 14:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231130 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 14:50:34 -0000 Author: pjd Date: Tue Feb 7 14:50:33 2012 New Revision: 231130 URL: http://svn.freebsd.org/changeset/base/231130 Log: Allow to set if_bridge(4) sysctls from /boot/loader.conf. MFC after: 3 days Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Feb 7 14:06:30 2012 (r231129) +++ head/sys/net/if_bridge.c Tue Feb 7 14:50:33 2012 (r231130) @@ -355,19 +355,26 @@ static int pfil_local_phys = 0; /* run p locally destined packets */ static int log_stp = 0; /* log STP state changes */ static int bridge_inherit_mac = 0; /* share MAC with first bridge member */ +TUNABLE_INT("net.link.bridge.pfil_onlyip", &pfil_onlyip); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RW, &pfil_onlyip, 0, "Only pass IP packets when pfil is enabled"); +TUNABLE_INT("net.link.bridge.ipfw_arp", &pfil_ipfw_arp); SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RW, &pfil_ipfw_arp, 0, "Filter ARP packets through IPFW layer2"); +TUNABLE_INT("net.link.bridge.pfil_bridge", &pfil_bridge); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RW, &pfil_bridge, 0, "Packet filter on the bridge interface"); +TUNABLE_INT("net.link.bridge.pfil_member", &pfil_member); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RW, &pfil_member, 0, "Packet filter on the member interface"); +TUNABLE_INT("net.link.bridge.pfil_local_phys", &pfil_local_phys); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RW, &pfil_local_phys, 0, "Packet filter on the physical interface for locally destined packets"); +TUNABLE_INT("net.link.bridge.log_stp", &log_stp); SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RW, &log_stp, 0, "Log STP state changes"); +TUNABLE_INT("net.link.bridge.inherit_mac", &bridge_inherit_mac); SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW, &bridge_inherit_mac, 0, "Inherit MAC address from the first bridge member"); From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 15:19:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7208106564A; Tue, 7 Feb 2012 15:19:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A1DA48FC14; Tue, 7 Feb 2012 15:19:25 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:a118:e66e:30ea:69c6] (unknown [IPv6:2001:7b8:3a7:0:a118:e66e:30ea:69c6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E224B5C59; Tue, 7 Feb 2012 16:19:23 +0100 (CET) Message-ID: <4F3140FA.6070702@FreeBSD.org> Date: Tue, 07 Feb 2012 16:19:22 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201202070927.q179R81a078218@svn.freebsd.org> <20120207110729.GB3283@deviant.kiev.zoral.com.ua> In-Reply-To: <20120207110729.GB3283@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231118 - in head: include/rpc include/rpcsvc lib/libc/rpc lib/libc/yp lib/librpcsvc lib/libypclnt libexec/ypxfr release/picobsd/tinyware/passwd sys/conf sys/modules/kgssapi sys/modules... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 15:19:26 -0000 On 2012-02-07 12:07, Konstantin Belousov wrote: > On Tue, Feb 07, 2012 at 09:27:08AM +0000, Dimitry Andric wrote: >> Author: dim >> Date: Tue Feb 7 09:27:07 2012 >> New Revision: 231118 >> URL: http://svn.freebsd.org/changeset/base/231118 >> >> Log: >> Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor >> set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp. >> >> MFC after: 1 week > Shouldn't RPCGEN move to share/mk ? Yes, it should probably go in bsd.own.mk, similar to what NetBSD does. The only question is in which section, because unlike NetBSD, we do not really have a separate area for general build tools. I suggest that we put it between the COMPRESS_CMD?= and .if !defined(_WITHOUT_SRCCONF) lines. From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 15:50:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45ADD1065670; Tue, 7 Feb 2012 15:50:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32B918FC15; Tue, 7 Feb 2012 15:50: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 q17FoF0i096004; Tue, 7 Feb 2012 15:50:15 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17FoE4r096000; Tue, 7 Feb 2012 15:50:14 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201202071550.q17FoE4r096000@svn.freebsd.org> From: Olivier Houchard Date: Tue, 7 Feb 2012 15:50: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: r231131 - in stable/8/sys/arm: arm include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 15:50:15 -0000 Author: cognet Date: Tue Feb 7 15:50:14 2012 New Revision: 231131 URL: http://svn.freebsd.org/changeset/base/231131 Log: MFC r226441 and r226443 r226441: Explicitely set ARM_RAS_START and ARM_RAS_END once the cacheline or the page has been allocated, or we could end up using random values, and bad things could happen. PR: arm/161492 Submitted by: Ian Lepore r226443: Fix 2 bugs : - A race condition could happen if two threads were using RAS at the same time as the code didn't reset RAS_END, the RAS code could believe we were not in a RAS, when we were in fact. - Using signed value logic to compare addresses wasn't such a good idea. Many thanks to Ian to investigate on these issues. Pointy hat to: cognet PR: arm/161498 Submitted by: Ian Lepore Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DC871065673; Tue, 7 Feb 2012 15:59:52 +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 E9A0F8FC13; Tue, 7 Feb 2012 15:59:51 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q17FxipM038424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Feb 2012 17:59:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q17Fxijn041325; Tue, 7 Feb 2012 17:59:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q17Fxio3041324; Tue, 7 Feb 2012 17:59:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 Feb 2012 17:59:44 +0200 From: Konstantin Belousov To: Dimitry Andric Message-ID: <20120207155944.GE3283@deviant.kiev.zoral.com.ua> References: <201202070927.q179R81a078218@svn.freebsd.org> <20120207110729.GB3283@deviant.kiev.zoral.com.ua> <4F3140FA.6070702@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+1XiaZWzQ61FkPh" Content-Disposition: inline In-Reply-To: <4F3140FA.6070702@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.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231118 - in head: include/rpc include/rpcsvc lib/libc/rpc lib/libc/yp lib/librpcsvc lib/libypclnt libexec/ypxfr release/picobsd/tinyware/passwd sys/conf sys/modules/kgssapi sys/modules... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 15:59:52 -0000 --k+1XiaZWzQ61FkPh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 07, 2012 at 04:19:22PM +0100, Dimitry Andric wrote: > On 2012-02-07 12:07, Konstantin Belousov wrote: > > On Tue, Feb 07, 2012 at 09:27:08AM +0000, Dimitry Andric wrote: > >> Author: dim > >> Date: Tue Feb 7 09:27:07 2012 > >> New Revision: 231118 > >> URL: http://svn.freebsd.org/changeset/base/231118 > >> > >> Log: > >> Consistently set RPCGEN_CPP when running rpcgen, so the C preprocess= or > >> set via ${CPP} is used, instead of always using hardcoded /usr/bin/c= pp. > >> =20 > >> MFC after: 1 week > > Shouldn't RPCGEN move to share/mk ? >=20 > Yes, it should probably go in bsd.own.mk, similar to what NetBSD does. > The only question is in which section, because unlike NetBSD, we do not > really have a separate area for general build tools. I suggest that we > put it between the COMPRESS_CMD?=3D and .if !defined(_WITHOUT_SRCCONF) > lines. I cannot answer your question. Does sys.mk has some restrictions on what should be put there ? --k+1XiaZWzQ61FkPh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk8xSm8ACgkQC3+MBN1Mb4iXCwCeII3L0ffRcwYSLuu+T4lDPE+n oB4AoJmeaBL93iPBxldL4n5hBxNxp9ax =Jo6j -----END PGP SIGNATURE----- --k+1XiaZWzQ61FkPh-- From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 16:07:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6BF3106566B; Tue, 7 Feb 2012 16:07:29 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9BD98FC08; Tue, 7 Feb 2012 16:07:29 +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 q17G7TiA096639; Tue, 7 Feb 2012 16:07:29 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17G7TW0096635; Tue, 7 Feb 2012 16:07:29 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201202071607.q17G7TW0096635@svn.freebsd.org> From: Olivier Houchard Date: Tue, 7 Feb 2012 16:07:29 +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: r231132 - in stable/9/sys/arm: arm include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 16:07:29 -0000 Author: cognet Date: Tue Feb 7 16:07:29 2012 New Revision: 231132 URL: http://svn.freebsd.org/changeset/base/231132 Log: MFC r226441 and r226443 r226441: Explicitely set ARM_RAS_START and ARM_RAS_END once the cacheline or the page has been allocated, or we could end up using random values, and bad things could happen. PR: arm/161492 Submitted by: Ian Lepore r226443: Fix 2 bugs : - A race condition could happen if two threads were using RAS at the same time as the code didn't reset RAS_END, the RAS code could believe we were not in a RAS, when we were in fact. - Using signed value logic to compare addresses wasn't such a good idea. Many thanks to Ian to investigate on these issues. Pointy hat to: cognet PR: arm/161498 Submitted by: Ian Lepore Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1FEF1065686; Tue, 7 Feb 2012 16:32:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E07CE8FC1D; Tue, 7 Feb 2012 16:32: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 q17GWhhm097456; Tue, 7 Feb 2012 16:32:43 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17GWhZW097454; Tue, 7 Feb 2012 16:32:43 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202071632.q17GWhZW097454@svn.freebsd.org> From: Rick Macklem Date: Tue, 7 Feb 2012 16:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231133 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 16:32:44 -0000 Author: rmacklem Date: Tue Feb 7 16:32:43 2012 New Revision: 231133 URL: http://svn.freebsd.org/changeset/base/231133 Log: r228827 fixed a problem where copying of NFSv4 open credentials into a credential structure would corrupt it. This happened when the p argument was != NULL. However, I now realize that the copying of open credentials should only happen for p == NULL, since that indicates that it is a read-ahead or write-behind. This patch fixes this. After this commit, r228827 could be reverted, but I think the code is clearer and safer with the patch, so I am going to leave it in. Without this patch, it was possible that a NFSv4 VOP_SETATTR() could have changed the credentials of the caller. This would have happened if the process doing the VOP_SETATTR() did not have the file open, but some other process running as a different uid had the file open for writing at the same time. MFC after: 5 days Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 7 16:07:29 2012 (r231132) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 7 16:32:43 2012 (r231133) @@ -559,8 +559,12 @@ nfscl_getstateid(vnode_t vp, u_int8_t *n NFSUNLOCKCLSTATE(); return (ENOENT); } - /* for read aheads or write behinds, use the open cred */ - newnfs_copycred(&op->nfso_cred, cred); + /* + * For read aheads or write behinds, use the open cred. + * A read ahead or write behind is indicated by p == NULL. + */ + if (p == NULL) + newnfs_copycred(&op->nfso_cred, cred); } /* From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 17:21:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB5EE1065670; Tue, 7 Feb 2012 17:21:54 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7BD18FC17; Tue, 7 Feb 2012 17:21:54 +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 q17HLs7I099032; Tue, 7 Feb 2012 17:21:54 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HLshm099031; Tue, 7 Feb 2012 17:21:54 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201202071721.q17HLshm099031@svn.freebsd.org> From: Jim Harris Date: Tue, 7 Feb 2012 17:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231134 - in head/sys: dev/isci dev/isci/scil modules/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:21:55 -0000 Author: jimharris Date: Tue Feb 7 17:21:54 2012 New Revision: 231134 URL: http://svn.freebsd.org/changeset/base/231134 Log: Add svn:keywords for isci driver files. Sponsored by: Intel Approved by: scottl Modified: Directory Properties: head/sys/dev/isci/README (props changed) head/sys/dev/isci/environment.h (props changed) head/sys/dev/isci/isci.c (props changed) head/sys/dev/isci/isci.h (props changed) head/sys/dev/isci/isci_controller.c (props changed) head/sys/dev/isci/isci_domain.c (props changed) head/sys/dev/isci/isci_interrupt.c (props changed) head/sys/dev/isci/isci_io_request.c (props changed) head/sys/dev/isci/isci_logger.c (props changed) head/sys/dev/isci/isci_oem_parameters.c (props changed) head/sys/dev/isci/isci_remote_device.c (props changed) head/sys/dev/isci/isci_sysctl.c (props changed) head/sys/dev/isci/isci_task_request.c (props changed) head/sys/dev/isci/isci_timer.c (props changed) head/sys/dev/isci/sci_environment.h (props changed) head/sys/dev/isci/scil/intel_ata.h (props changed) head/sys/dev/isci/scil/intel_pci.h (props changed) head/sys/dev/isci/scil/intel_sas.h (props changed) head/sys/dev/isci/scil/intel_sat.h (props changed) head/sys/dev/isci/scil/intel_sata.h (props changed) head/sys/dev/isci/scil/intel_scsi.h (props changed) head/sys/dev/isci/scil/sati.c (props changed) head/sys/dev/isci/scil/sati.h (props changed) head/sys/dev/isci/scil/sati_abort_task_set.c (props changed) head/sys/dev/isci/scil/sati_abort_task_set.h (props changed) head/sys/dev/isci/scil/sati_atapi.c (props changed) head/sys/dev/isci/scil/sati_atapi.h (props changed) head/sys/dev/isci/scil/sati_callbacks.h (props changed) head/sys/dev/isci/scil/sati_design.h (props changed) head/sys/dev/isci/scil/sati_device.c (props changed) head/sys/dev/isci/scil/sati_device.h (props changed) head/sys/dev/isci/scil/sati_inquiry.c (props changed) head/sys/dev/isci/scil/sati_inquiry.h (props changed) head/sys/dev/isci/scil/sati_log_sense.c (props changed) head/sys/dev/isci/scil/sati_log_sense.h (props changed) head/sys/dev/isci/scil/sati_lun_reset.c (props changed) head/sys/dev/isci/scil/sati_lun_reset.h (props changed) head/sys/dev/isci/scil/sati_mode_pages.c (props changed) head/sys/dev/isci/scil/sati_mode_pages.h (props changed) head/sys/dev/isci/scil/sati_mode_select.c (props changed) head/sys/dev/isci/scil/sati_mode_select.h (props changed) head/sys/dev/isci/scil/sati_mode_sense.c (props changed) head/sys/dev/isci/scil/sati_mode_sense.h (props changed) head/sys/dev/isci/scil/sati_mode_sense_10.c (props changed) head/sys/dev/isci/scil/sati_mode_sense_10.h (props changed) head/sys/dev/isci/scil/sati_mode_sense_6.c (props changed) head/sys/dev/isci/scil/sati_mode_sense_6.h (props changed) head/sys/dev/isci/scil/sati_move.c (props changed) head/sys/dev/isci/scil/sati_move.h (props changed) head/sys/dev/isci/scil/sati_passthrough.c (props changed) head/sys/dev/isci/scil/sati_passthrough.h (props changed) head/sys/dev/isci/scil/sati_read.c (props changed) head/sys/dev/isci/scil/sati_read.h (props changed) head/sys/dev/isci/scil/sati_read_buffer.c (props changed) head/sys/dev/isci/scil/sati_read_buffer.h (props changed) head/sys/dev/isci/scil/sati_read_capacity.c (props changed) head/sys/dev/isci/scil/sati_read_capacity.h (props changed) head/sys/dev/isci/scil/sati_reassign_blocks.c (props changed) head/sys/dev/isci/scil/sati_reassign_blocks.h (props changed) head/sys/dev/isci/scil/sati_report_luns.c (props changed) head/sys/dev/isci/scil/sati_report_luns.h (props changed) head/sys/dev/isci/scil/sati_request_sense.c (props changed) head/sys/dev/isci/scil/sati_request_sense.h (props changed) head/sys/dev/isci/scil/sati_start_stop_unit.c (props changed) head/sys/dev/isci/scil/sati_start_stop_unit.h (props changed) head/sys/dev/isci/scil/sati_synchronize_cache.c (props changed) head/sys/dev/isci/scil/sati_synchronize_cache.h (props changed) head/sys/dev/isci/scil/sati_test_unit_ready.c (props changed) head/sys/dev/isci/scil/sati_test_unit_ready.h (props changed) head/sys/dev/isci/scil/sati_translator_sequence.h (props changed) head/sys/dev/isci/scil/sati_types.h (props changed) head/sys/dev/isci/scil/sati_unmap.c (props changed) head/sys/dev/isci/scil/sati_unmap.h (props changed) head/sys/dev/isci/scil/sati_util.c (props changed) head/sys/dev/isci/scil/sati_util.h (props changed) head/sys/dev/isci/scil/sati_verify.c (props changed) head/sys/dev/isci/scil/sati_verify.h (props changed) head/sys/dev/isci/scil/sati_write.c (props changed) head/sys/dev/isci/scil/sati_write.h (props changed) head/sys/dev/isci/scil/sati_write_and_verify.c (props changed) head/sys/dev/isci/scil/sati_write_and_verify.h (props changed) head/sys/dev/isci/scil/sati_write_buffer.c (props changed) head/sys/dev/isci/scil/sati_write_buffer.h (props changed) head/sys/dev/isci/scil/sati_write_long.c (props changed) head/sys/dev/isci/scil/sati_write_long.h (props changed) head/sys/dev/isci/scil/sci_abstract_list.c (props changed) head/sys/dev/isci/scil/sci_abstract_list.h (props changed) head/sys/dev/isci/scil/sci_base_controller.c (props changed) head/sys/dev/isci/scil/sci_base_controller.h (props changed) head/sys/dev/isci/scil/sci_base_domain.c (props changed) head/sys/dev/isci/scil/sci_base_domain.h (props changed) head/sys/dev/isci/scil/sci_base_iterator.c (props changed) head/sys/dev/isci/scil/sci_base_iterator.h (props changed) head/sys/dev/isci/scil/sci_base_library.c (props changed) head/sys/dev/isci/scil/sci_base_library.h (props changed) head/sys/dev/isci/scil/sci_base_logger.c (props changed) head/sys/dev/isci/scil/sci_base_logger.h (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list.c (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list.h (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list_decorator.c (props changed) head/sys/dev/isci/scil/sci_base_object.c (props changed) head/sys/dev/isci/scil/sci_base_object.h (props changed) head/sys/dev/isci/scil/sci_base_observer.c (props changed) head/sys/dev/isci/scil/sci_base_observer.h (props changed) head/sys/dev/isci/scil/sci_base_phy.c (props changed) head/sys/dev/isci/scil/sci_base_phy.h (props changed) head/sys/dev/isci/scil/sci_base_port.c (props changed) head/sys/dev/isci/scil/sci_base_port.h (props changed) head/sys/dev/isci/scil/sci_base_remote_device.c (props changed) head/sys/dev/isci/scil/sci_base_remote_device.h (props changed) head/sys/dev/isci/scil/sci_base_request.c (props changed) head/sys/dev/isci/scil/sci_base_request.h (props changed) head/sys/dev/isci/scil/sci_base_state.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine_logger.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine_logger.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine_observer.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine_observer.h (props changed) head/sys/dev/isci/scil/sci_base_subject.c (props changed) head/sys/dev/isci/scil/sci_base_subject.h (props changed) head/sys/dev/isci/scil/sci_controller.h (props changed) head/sys/dev/isci/scil/sci_controller_constants.h (props changed) head/sys/dev/isci/scil/sci_fast_list.h (props changed) head/sys/dev/isci/scil/sci_iterator.h (props changed) head/sys/dev/isci/scil/sci_library.h (props changed) head/sys/dev/isci/scil/sci_logger.h (props changed) head/sys/dev/isci/scil/sci_memory_descriptor_list.h (props changed) head/sys/dev/isci/scil/sci_memory_descriptor_list_decorator.h (props changed) head/sys/dev/isci/scil/sci_object.h (props changed) head/sys/dev/isci/scil/sci_overview.h (props changed) head/sys/dev/isci/scil/sci_pool.h (props changed) head/sys/dev/isci/scil/sci_simple_list.h (props changed) head/sys/dev/isci/scil/sci_status.h (props changed) head/sys/dev/isci/scil/sci_types.h (props changed) head/sys/dev/isci/scil/sci_util.c (props changed) head/sys/dev/isci/scil/sci_util.h (props changed) head/sys/dev/isci/scil/scic_config_parameters.h (props changed) head/sys/dev/isci/scil/scic_controller.h (props changed) head/sys/dev/isci/scil/scic_io_request.h (props changed) head/sys/dev/isci/scil/scic_library.h (props changed) head/sys/dev/isci/scil/scic_logger.h (props changed) head/sys/dev/isci/scil/scic_overview.h (props changed) head/sys/dev/isci/scil/scic_phy.h (props changed) head/sys/dev/isci/scil/scic_port.h (props changed) head/sys/dev/isci/scil/scic_remote_device.h (props changed) head/sys/dev/isci/scil/scic_sds_controller.c (props changed) head/sys/dev/isci/scil/scic_sds_controller.h (props changed) head/sys/dev/isci/scil/scic_sds_controller_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_library.c (props changed) head/sys/dev/isci/scil/scic_sds_library.h (props changed) head/sys/dev/isci/scil/scic_sds_logger.h (props changed) head/sys/dev/isci/scil/scic_sds_pci.c (props changed) head/sys/dev/isci/scil/scic_sds_pci.h (props changed) head/sys/dev/isci/scil/scic_sds_phy.c (props changed) head/sys/dev/isci/scil/scic_sds_phy.h (props changed) head/sys/dev/isci/scil/scic_sds_phy_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_port.c (props changed) head/sys/dev/isci/scil/scic_sds_port.h (props changed) head/sys/dev/isci/scil/scic_sds_port_configuration_agent.c (props changed) head/sys/dev/isci/scil/scic_sds_port_configuration_agent.h (props changed) head/sys/dev/isci/scil/scic_sds_port_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_device.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_context.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_context.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_table.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_table.h (props changed) head/sys/dev/isci/scil/scic_sds_request.c (props changed) head/sys/dev/isci/scil/scic_sds_request.h (props changed) head/sys/dev/isci/scil/scic_sds_sgpio.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_request.h (props changed) head/sys/dev/isci/scil/scic_sds_ssp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_packet_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_packet_request.h (props changed) head/sys/dev/isci/scil/scic_sds_stp_pio_request.h (props changed) head/sys/dev/isci/scil/scic_sds_stp_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_request.h (props changed) head/sys/dev/isci/scil/scic_sds_unsolicited_frame_control.c (props changed) head/sys/dev/isci/scil/scic_sds_unsolicited_frame_control.h (props changed) head/sys/dev/isci/scil/scic_sgpio.h (props changed) head/sys/dev/isci/scil/scic_task_request.h (props changed) head/sys/dev/isci/scil/scic_user_callback.h (props changed) head/sys/dev/isci/scil/scif_config_parameters.h (props changed) head/sys/dev/isci/scil/scif_controller.h (props changed) head/sys/dev/isci/scil/scif_domain.h (props changed) head/sys/dev/isci/scil/scif_io_request.h (props changed) head/sys/dev/isci/scil/scif_library.h (props changed) head/sys/dev/isci/scil/scif_logger.h (props changed) head/sys/dev/isci/scil/scif_overview.h (props changed) head/sys/dev/isci/scil/scif_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_constants.h (props changed) head/sys/dev/isci/scil/scif_sas_controller.c (props changed) head/sys/dev/isci/scil/scif_sas_controller.h (props changed) head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_controller_states.c (props changed) head/sys/dev/isci/scil/scif_sas_design.h (props changed) head/sys/dev/isci/scil/scif_sas_domain.c (props changed) head/sys/dev/isci/scil/scif_sas_domain.h (props changed) head/sys/dev/isci/scil/scif_sas_domain_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_domain_states.c (props changed) head/sys/dev/isci/scil/scif_sas_high_priority_request_queue.c (props changed) head/sys/dev/isci/scil/scif_sas_high_priority_request_queue.h (props changed) head/sys/dev/isci/scil/scif_sas_internal_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_internal_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_io_request_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_io_request_states.c (props changed) head/sys/dev/isci/scil/scif_sas_library.c (props changed) head/sys/dev/isci/scil/scif_sas_library.h (props changed) head/sys/dev/isci/scil/scif_sas_logger.h (props changed) head/sys/dev/isci/scil/scif_sas_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_ready_substate_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_starting_substate_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_starting_substates.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_states.c (props changed) head/sys/dev/isci/scil/scif_sas_request.c (props changed) head/sys/dev/isci/scil/scif_sas_request.h (props changed) head/sys/dev/isci/scil/scif_sas_sati_binding.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_activity_clear_affiliation.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_phy.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_phy.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_task_request.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_task_request.h (props changed) head/sys/dev/isci/scil/scif_sas_task_request.c (props changed) head/sys/dev/isci/scil/scif_sas_task_request.h (props changed) head/sys/dev/isci/scil/scif_sas_task_request_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_task_request_states.c (props changed) head/sys/dev/isci/scil/scif_sas_timer.c (props changed) head/sys/dev/isci/scil/scif_task_request.h (props changed) head/sys/dev/isci/scil/scif_user_callback.h (props changed) head/sys/dev/isci/scil/scu_bios_definitions.h (props changed) head/sys/dev/isci/scil/scu_completion_codes.h (props changed) head/sys/dev/isci/scil/scu_constants.h (props changed) head/sys/dev/isci/scil/scu_event_codes.h (props changed) head/sys/dev/isci/scil/scu_registers.h (props changed) head/sys/dev/isci/scil/scu_remote_node_context.h (props changed) head/sys/dev/isci/scil/scu_task_context.h (props changed) head/sys/dev/isci/scil/scu_unsolicited_frame.h (props changed) head/sys/dev/isci/scil/scu_viit_data.h (props changed) head/sys/dev/isci/types.h (props changed) head/sys/modules/isci/Makefile (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 17:42:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45907106566C; Tue, 7 Feb 2012 17:42: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 334A78FC08; Tue, 7 Feb 2012 17:42: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 q17HgB09099747; Tue, 7 Feb 2012 17:42:11 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HgBg5099745; Tue, 7 Feb 2012 17:42:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202071742.q17HgBg5099745@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 7 Feb 2012 17:42:10 +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: r231135 - stable/9/usr.bin/grep X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:42:11 -0000 Author: gabor Date: Tue Feb 7 17:42:10 2012 New Revision: 231135 URL: http://svn.freebsd.org/changeset/base/231135 Log: MFC r230141 (eadler): - Remove duplicate line from usage() Modified: stable/9/usr.bin/grep/grep.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/grep.c ============================================================================== --- stable/9/usr.bin/grep/grep.c Tue Feb 7 17:21:54 2012 (r231134) +++ stable/9/usr.bin/grep/grep.c Tue Feb 7 17:42:10 2012 (r231135) @@ -158,7 +158,6 @@ usage(void) { fprintf(stderr, getstr(4), getprogname()); fprintf(stderr, "%s", getstr(5)); - fprintf(stderr, "%s", getstr(5)); fprintf(stderr, "%s", getstr(6)); fprintf(stderr, "%s", getstr(7)); exit(2); From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 17:43:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AEAC106564A; Tue, 7 Feb 2012 17:43:59 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 272BF8FC1B; Tue, 7 Feb 2012 17:43:59 +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 q17HhxnG099869; Tue, 7 Feb 2012 17:43:59 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HhxZF099866; Tue, 7 Feb 2012 17:43:59 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201202071743.q17HhxZF099866@svn.freebsd.org> From: Jim Harris Date: Tue, 7 Feb 2012 17:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231136 - in head/sys: dev/isci dev/isci/scil modules/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:43:59 -0000 Author: jimharris Date: Tue Feb 7 17:43:58 2012 New Revision: 231136 URL: http://svn.freebsd.org/changeset/base/231136 Log: Fix r231134. svn:keywords needs to be 'FreeBSD=%H', not 'FreeBSD:%H'. Approved by: scottl Modified: Directory Properties: head/sys/dev/isci/README (props changed) head/sys/dev/isci/environment.h (props changed) head/sys/dev/isci/isci.c (props changed) head/sys/dev/isci/isci.h (props changed) head/sys/dev/isci/isci_controller.c (props changed) head/sys/dev/isci/isci_domain.c (props changed) head/sys/dev/isci/isci_interrupt.c (props changed) head/sys/dev/isci/isci_io_request.c (props changed) head/sys/dev/isci/isci_logger.c (props changed) head/sys/dev/isci/isci_oem_parameters.c (props changed) head/sys/dev/isci/isci_remote_device.c (props changed) head/sys/dev/isci/isci_sysctl.c (props changed) head/sys/dev/isci/isci_task_request.c (props changed) head/sys/dev/isci/isci_timer.c (props changed) head/sys/dev/isci/sci_environment.h (props changed) head/sys/dev/isci/scil/intel_ata.h (props changed) head/sys/dev/isci/scil/intel_pci.h (props changed) head/sys/dev/isci/scil/intel_sas.h (props changed) head/sys/dev/isci/scil/intel_sat.h (props changed) head/sys/dev/isci/scil/intel_sata.h (props changed) head/sys/dev/isci/scil/intel_scsi.h (props changed) head/sys/dev/isci/scil/sati.c (props changed) head/sys/dev/isci/scil/sati.h (props changed) head/sys/dev/isci/scil/sati_abort_task_set.c (props changed) head/sys/dev/isci/scil/sati_abort_task_set.h (props changed) head/sys/dev/isci/scil/sati_atapi.c (props changed) head/sys/dev/isci/scil/sati_atapi.h (props changed) head/sys/dev/isci/scil/sati_callbacks.h (props changed) head/sys/dev/isci/scil/sati_design.h (props changed) head/sys/dev/isci/scil/sati_device.c (props changed) head/sys/dev/isci/scil/sati_device.h (props changed) head/sys/dev/isci/scil/sati_inquiry.c (props changed) head/sys/dev/isci/scil/sati_inquiry.h (props changed) head/sys/dev/isci/scil/sati_log_sense.c (props changed) head/sys/dev/isci/scil/sati_log_sense.h (props changed) head/sys/dev/isci/scil/sati_lun_reset.c (props changed) head/sys/dev/isci/scil/sati_lun_reset.h (props changed) head/sys/dev/isci/scil/sati_mode_pages.c (props changed) head/sys/dev/isci/scil/sati_mode_pages.h (props changed) head/sys/dev/isci/scil/sati_mode_select.c (props changed) head/sys/dev/isci/scil/sati_mode_select.h (props changed) head/sys/dev/isci/scil/sati_mode_sense.c (props changed) head/sys/dev/isci/scil/sati_mode_sense.h (props changed) head/sys/dev/isci/scil/sati_mode_sense_10.c (props changed) head/sys/dev/isci/scil/sati_mode_sense_10.h (props changed) head/sys/dev/isci/scil/sati_mode_sense_6.c (props changed) head/sys/dev/isci/scil/sati_mode_sense_6.h (props changed) head/sys/dev/isci/scil/sati_move.c (props changed) head/sys/dev/isci/scil/sati_move.h (props changed) head/sys/dev/isci/scil/sati_passthrough.c (props changed) head/sys/dev/isci/scil/sati_passthrough.h (props changed) head/sys/dev/isci/scil/sati_read.c (props changed) head/sys/dev/isci/scil/sati_read.h (props changed) head/sys/dev/isci/scil/sati_read_buffer.c (props changed) head/sys/dev/isci/scil/sati_read_buffer.h (props changed) head/sys/dev/isci/scil/sati_read_capacity.c (props changed) head/sys/dev/isci/scil/sati_read_capacity.h (props changed) head/sys/dev/isci/scil/sati_reassign_blocks.c (props changed) head/sys/dev/isci/scil/sati_reassign_blocks.h (props changed) head/sys/dev/isci/scil/sati_report_luns.c (props changed) head/sys/dev/isci/scil/sati_report_luns.h (props changed) head/sys/dev/isci/scil/sati_request_sense.c (props changed) head/sys/dev/isci/scil/sati_request_sense.h (props changed) head/sys/dev/isci/scil/sati_start_stop_unit.c (props changed) head/sys/dev/isci/scil/sati_start_stop_unit.h (props changed) head/sys/dev/isci/scil/sati_synchronize_cache.c (props changed) head/sys/dev/isci/scil/sati_synchronize_cache.h (props changed) head/sys/dev/isci/scil/sati_test_unit_ready.c (props changed) head/sys/dev/isci/scil/sati_test_unit_ready.h (props changed) head/sys/dev/isci/scil/sati_translator_sequence.h (props changed) head/sys/dev/isci/scil/sati_types.h (props changed) head/sys/dev/isci/scil/sati_unmap.c (props changed) head/sys/dev/isci/scil/sati_unmap.h (props changed) head/sys/dev/isci/scil/sati_util.c (props changed) head/sys/dev/isci/scil/sati_util.h (props changed) head/sys/dev/isci/scil/sati_verify.c (props changed) head/sys/dev/isci/scil/sati_verify.h (props changed) head/sys/dev/isci/scil/sati_write.c (props changed) head/sys/dev/isci/scil/sati_write.h (props changed) head/sys/dev/isci/scil/sati_write_and_verify.c (props changed) head/sys/dev/isci/scil/sati_write_and_verify.h (props changed) head/sys/dev/isci/scil/sati_write_buffer.c (props changed) head/sys/dev/isci/scil/sati_write_buffer.h (props changed) head/sys/dev/isci/scil/sati_write_long.c (props changed) head/sys/dev/isci/scil/sati_write_long.h (props changed) head/sys/dev/isci/scil/sci_abstract_list.c (props changed) head/sys/dev/isci/scil/sci_abstract_list.h (props changed) head/sys/dev/isci/scil/sci_base_controller.c (props changed) head/sys/dev/isci/scil/sci_base_controller.h (props changed) head/sys/dev/isci/scil/sci_base_domain.c (props changed) head/sys/dev/isci/scil/sci_base_domain.h (props changed) head/sys/dev/isci/scil/sci_base_iterator.c (props changed) head/sys/dev/isci/scil/sci_base_iterator.h (props changed) head/sys/dev/isci/scil/sci_base_library.c (props changed) head/sys/dev/isci/scil/sci_base_library.h (props changed) head/sys/dev/isci/scil/sci_base_logger.c (props changed) head/sys/dev/isci/scil/sci_base_logger.h (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list.c (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list.h (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list_decorator.c (props changed) head/sys/dev/isci/scil/sci_base_object.c (props changed) head/sys/dev/isci/scil/sci_base_object.h (props changed) head/sys/dev/isci/scil/sci_base_observer.c (props changed) head/sys/dev/isci/scil/sci_base_observer.h (props changed) head/sys/dev/isci/scil/sci_base_phy.c (props changed) head/sys/dev/isci/scil/sci_base_phy.h (props changed) head/sys/dev/isci/scil/sci_base_port.c (props changed) head/sys/dev/isci/scil/sci_base_port.h (props changed) head/sys/dev/isci/scil/sci_base_remote_device.c (props changed) head/sys/dev/isci/scil/sci_base_remote_device.h (props changed) head/sys/dev/isci/scil/sci_base_request.c (props changed) head/sys/dev/isci/scil/sci_base_request.h (props changed) head/sys/dev/isci/scil/sci_base_state.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine_logger.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine_logger.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine_observer.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine_observer.h (props changed) head/sys/dev/isci/scil/sci_base_subject.c (props changed) head/sys/dev/isci/scil/sci_base_subject.h (props changed) head/sys/dev/isci/scil/sci_controller.h (props changed) head/sys/dev/isci/scil/sci_controller_constants.h (props changed) head/sys/dev/isci/scil/sci_fast_list.h (props changed) head/sys/dev/isci/scil/sci_iterator.h (props changed) head/sys/dev/isci/scil/sci_library.h (props changed) head/sys/dev/isci/scil/sci_logger.h (props changed) head/sys/dev/isci/scil/sci_memory_descriptor_list.h (props changed) head/sys/dev/isci/scil/sci_memory_descriptor_list_decorator.h (props changed) head/sys/dev/isci/scil/sci_object.h (props changed) head/sys/dev/isci/scil/sci_overview.h (props changed) head/sys/dev/isci/scil/sci_pool.h (props changed) head/sys/dev/isci/scil/sci_simple_list.h (props changed) head/sys/dev/isci/scil/sci_status.h (props changed) head/sys/dev/isci/scil/sci_types.h (props changed) head/sys/dev/isci/scil/sci_util.c (props changed) head/sys/dev/isci/scil/sci_util.h (props changed) head/sys/dev/isci/scil/scic_config_parameters.h (props changed) head/sys/dev/isci/scil/scic_controller.h (props changed) head/sys/dev/isci/scil/scic_io_request.h (props changed) head/sys/dev/isci/scil/scic_library.h (props changed) head/sys/dev/isci/scil/scic_logger.h (props changed) head/sys/dev/isci/scil/scic_overview.h (props changed) head/sys/dev/isci/scil/scic_phy.h (props changed) head/sys/dev/isci/scil/scic_port.h (props changed) head/sys/dev/isci/scil/scic_remote_device.h (props changed) head/sys/dev/isci/scil/scic_sds_controller.c (props changed) head/sys/dev/isci/scil/scic_sds_controller.h (props changed) head/sys/dev/isci/scil/scic_sds_controller_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_library.c (props changed) head/sys/dev/isci/scil/scic_sds_library.h (props changed) head/sys/dev/isci/scil/scic_sds_logger.h (props changed) head/sys/dev/isci/scil/scic_sds_pci.c (props changed) head/sys/dev/isci/scil/scic_sds_pci.h (props changed) head/sys/dev/isci/scil/scic_sds_phy.c (props changed) head/sys/dev/isci/scil/scic_sds_phy.h (props changed) head/sys/dev/isci/scil/scic_sds_phy_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_port.c (props changed) head/sys/dev/isci/scil/scic_sds_port.h (props changed) head/sys/dev/isci/scil/scic_sds_port_configuration_agent.c (props changed) head/sys/dev/isci/scil/scic_sds_port_configuration_agent.h (props changed) head/sys/dev/isci/scil/scic_sds_port_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_device.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_context.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_context.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_table.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_table.h (props changed) head/sys/dev/isci/scil/scic_sds_request.c (props changed) head/sys/dev/isci/scil/scic_sds_request.h (props changed) head/sys/dev/isci/scil/scic_sds_sgpio.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_request.h (props changed) head/sys/dev/isci/scil/scic_sds_ssp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_packet_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_packet_request.h (props changed) head/sys/dev/isci/scil/scic_sds_stp_pio_request.h (props changed) head/sys/dev/isci/scil/scic_sds_stp_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_request.h (props changed) head/sys/dev/isci/scil/scic_sds_unsolicited_frame_control.c (props changed) head/sys/dev/isci/scil/scic_sds_unsolicited_frame_control.h (props changed) head/sys/dev/isci/scil/scic_sgpio.h (props changed) head/sys/dev/isci/scil/scic_task_request.h (props changed) head/sys/dev/isci/scil/scic_user_callback.h (props changed) head/sys/dev/isci/scil/scif_config_parameters.h (props changed) head/sys/dev/isci/scil/scif_controller.h (props changed) head/sys/dev/isci/scil/scif_domain.h (props changed) head/sys/dev/isci/scil/scif_io_request.h (props changed) head/sys/dev/isci/scil/scif_library.h (props changed) head/sys/dev/isci/scil/scif_logger.h (props changed) head/sys/dev/isci/scil/scif_overview.h (props changed) head/sys/dev/isci/scil/scif_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_constants.h (props changed) head/sys/dev/isci/scil/scif_sas_controller.c (props changed) head/sys/dev/isci/scil/scif_sas_controller.h (props changed) head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_controller_states.c (props changed) head/sys/dev/isci/scil/scif_sas_design.h (props changed) head/sys/dev/isci/scil/scif_sas_domain.c (props changed) head/sys/dev/isci/scil/scif_sas_domain.h (props changed) head/sys/dev/isci/scil/scif_sas_domain_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_domain_states.c (props changed) head/sys/dev/isci/scil/scif_sas_high_priority_request_queue.c (props changed) head/sys/dev/isci/scil/scif_sas_high_priority_request_queue.h (props changed) head/sys/dev/isci/scil/scif_sas_internal_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_internal_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_io_request_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_io_request_states.c (props changed) head/sys/dev/isci/scil/scif_sas_library.c (props changed) head/sys/dev/isci/scil/scif_sas_library.h (props changed) head/sys/dev/isci/scil/scif_sas_logger.h (props changed) head/sys/dev/isci/scil/scif_sas_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_ready_substate_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_starting_substate_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_starting_substates.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_states.c (props changed) head/sys/dev/isci/scil/scif_sas_request.c (props changed) head/sys/dev/isci/scil/scif_sas_request.h (props changed) head/sys/dev/isci/scil/scif_sas_sati_binding.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_activity_clear_affiliation.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_phy.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_phy.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_task_request.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_task_request.h (props changed) head/sys/dev/isci/scil/scif_sas_task_request.c (props changed) head/sys/dev/isci/scil/scif_sas_task_request.h (props changed) head/sys/dev/isci/scil/scif_sas_task_request_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_task_request_states.c (props changed) head/sys/dev/isci/scil/scif_sas_timer.c (props changed) head/sys/dev/isci/scil/scif_task_request.h (props changed) head/sys/dev/isci/scil/scif_user_callback.h (props changed) head/sys/dev/isci/scil/scu_bios_definitions.h (props changed) head/sys/dev/isci/scil/scu_completion_codes.h (props changed) head/sys/dev/isci/scil/scu_constants.h (props changed) head/sys/dev/isci/scil/scu_event_codes.h (props changed) head/sys/dev/isci/scil/scu_registers.h (props changed) head/sys/dev/isci/scil/scu_remote_node_context.h (props changed) head/sys/dev/isci/scil/scu_task_context.h (props changed) head/sys/dev/isci/scil/scu_unsolicited_frame.h (props changed) head/sys/dev/isci/scil/scu_viit_data.h (props changed) head/sys/dev/isci/types.h (props changed) head/sys/modules/isci/Makefile (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 17:45:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CF3B106564A; Tue, 7 Feb 2012 17:45:12 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD448FC0A; Tue, 7 Feb 2012 17:45: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 q17HjBh6099976; Tue, 7 Feb 2012 17:45:11 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HjB3s099969; Tue, 7 Feb 2012 17:45:11 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201202071745.q17HjB3s099969@svn.freebsd.org> From: Jim Harris Date: Tue, 7 Feb 2012 17:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231137 - head/sys/dev/isci/scil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:45:12 -0000 Author: jimharris Date: Tue Feb 7 17:45:11 2012 New Revision: 231137 URL: http://svn.freebsd.org/changeset/base/231137 Log: Fix Coverity defects in isci(4) driver. Sponsored by: Intel Approved by: scottl Modified: head/sys/dev/isci/scil/scic_sds_stp_request.c head/sys/dev/isci/scil/scif_sas_controller.c head/sys/dev/isci/scil/scif_sas_domain.c head/sys/dev/isci/scil/scif_sas_remote_device.c head/sys/dev/isci/scil/scif_sas_smp_io_request.c head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Modified: head/sys/dev/isci/scil/scic_sds_stp_request.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_stp_request.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scic_sds_stp_request.c Tue Feb 7 17:45:11 2012 (r231137) @@ -1124,9 +1124,6 @@ SCI_STATUS scic_sds_stp_request_pio_data if (status == SCI_SUCCESS) { this_sds_stp_request->type.pio.pio_transfer_bytes -= remaining_bytes_in_current_sgl; - - //update the current sgl, sgl_offset and save for future - current_sgl = scic_sds_stp_request_pio_get_next_sgl(this_sds_stp_request); sgl_offset = 0; } } Modified: head/sys/dev/isci/scil/scif_sas_controller.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_controller.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_controller.c Tue Feb 7 17:45:11 2012 (r231137) @@ -87,6 +87,10 @@ SCI_STATUS scif_controller_construct( SCIF_SAS_LIBRARY_T * fw_library = (SCIF_SAS_LIBRARY_T*) library; SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if ((library == SCI_INVALID_HANDLE) || (controller == SCI_INVALID_HANDLE)) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(library), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_INITIALIZATION, @@ -94,10 +98,6 @@ SCI_STATUS scif_controller_construct( library, controller )); - // Validate the user supplied parameters. - if ((library == SCI_INVALID_HANDLE) || (controller == SCI_INVALID_HANDLE)) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - // Construct the base controller. As part of constructing the base // controller we ask it to also manage the MDL iteration for the Core. sci_base_controller_construct( @@ -144,6 +144,10 @@ SCI_STATUS scif_controller_initialize( { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if (controller == SCI_INVALID_HANDLE) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_INITIALIZATION, @@ -151,10 +155,6 @@ SCI_STATUS scif_controller_initialize( controller )); - // Validate the user supplied parameters. - if (controller == SCI_INVALID_HANDLE) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - return fw_controller->state_handlers->initialize_handler( &fw_controller->parent ); @@ -187,6 +187,10 @@ SCI_STATUS scif_controller_start( { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if (controller == SCI_INVALID_HANDLE) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_INITIALIZATION, @@ -194,10 +198,6 @@ SCI_STATUS scif_controller_start( controller, timeout )); - // Validate the user supplied parameters. - if (controller == SCI_INVALID_HANDLE) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - return fw_controller->state_handlers-> start_handler(&fw_controller->parent, timeout); } @@ -211,6 +211,10 @@ SCI_STATUS scif_controller_stop( { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if (controller == SCI_INVALID_HANDLE) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_SHUTDOWN, @@ -218,10 +222,6 @@ SCI_STATUS scif_controller_stop( controller, timeout )); - // Validate the user supplied parameters. - if (controller == SCI_INVALID_HANDLE) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - return fw_controller->state_handlers-> stop_handler(&fw_controller->parent, timeout); @@ -235,6 +235,10 @@ SCI_STATUS scif_controller_reset( { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if (controller == SCI_INVALID_HANDLE) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_CONTROLLER_RESET, @@ -242,10 +246,6 @@ SCI_STATUS scif_controller_reset( controller )); - // Validate the user supplied parameters. - if (controller == SCI_INVALID_HANDLE) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - return fw_controller->state_handlers-> reset_handler(&fw_controller->parent); } @@ -306,13 +306,6 @@ SCI_TASK_STATUS scif_controller_start_ta { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; - SCIF_LOG_TRACE(( - sci_base_object_get_logger(controller), - SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT, - "scif_controller_start_task(0x%x, 0x%x, 0x%x, 0x%x) enter\n", - controller, remote_device, task_request, io_tag - )); - // Validate the user supplied parameters. if ( (controller == SCI_INVALID_HANDLE) || (remote_device == SCI_INVALID_HANDLE) @@ -321,6 +314,13 @@ SCI_TASK_STATUS scif_controller_start_ta return SCI_FAILURE_INVALID_PARAMETER_VALUE; } + SCIF_LOG_TRACE(( + sci_base_object_get_logger(controller), + SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT, + "scif_controller_start_task(0x%x, 0x%x, 0x%x, 0x%x) enter\n", + controller, remote_device, task_request, io_tag + )); + if (scif_sas_controller_sufficient_resource(controller)) { return fw_controller->state_handlers->start_task_handler( @@ -368,13 +368,6 @@ SCI_STATUS scif_controller_complete_task { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; - SCIF_LOG_TRACE(( - sci_base_object_get_logger(controller), - SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT, - "scif_controller_complete_task(0x%x, 0x%x, 0x%x) enter\n", - controller, remote_device, task_request - )); - // Validate the user supplied parameters. if ( (controller == SCI_INVALID_HANDLE) || (remote_device == SCI_INVALID_HANDLE) @@ -383,6 +376,13 @@ SCI_STATUS scif_controller_complete_task return SCI_FAILURE_INVALID_PARAMETER_VALUE; } + SCIF_LOG_TRACE(( + sci_base_object_get_logger(controller), + SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT, + "scif_controller_complete_task(0x%x, 0x%x, 0x%x) enter\n", + controller, remote_device, task_request + )); + return fw_controller->state_handlers->complete_task_handler( (SCI_BASE_CONTROLLER_T*) controller, (SCI_BASE_REMOTE_DEVICE_T*) remote_device, Modified: head/sys/dev/isci/scil/scif_sas_domain.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_domain.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_domain.c Tue Feb 7 17:45:11 2012 (r231137) @@ -142,8 +142,8 @@ SCI_PORT_HANDLE_T scif_domain_get_scic_p { SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T*) domain; - if ( (fw_domain != NULL) && (fw_domain->core_object != SCI_INVALID_HANDLE) ) - return fw_domain->core_object; + if ( (fw_domain == NULL) || (fw_domain->core_object == SCI_INVALID_HANDLE) ) + return SCI_INVALID_HANDLE; SCIF_LOG_WARNING(( sci_base_object_get_logger(fw_domain), @@ -152,7 +152,7 @@ SCI_PORT_HANDLE_T scif_domain_get_scic_p fw_domain )); - return SCI_INVALID_HANDLE; + return fw_domain->core_object; } // --------------------------------------------------------------------------- Modified: head/sys/dev/isci/scil/scif_sas_remote_device.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_remote_device.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_remote_device.c Tue Feb 7 17:45:11 2012 (r231137) @@ -362,8 +362,8 @@ SCI_REMOTE_DEVICE_HANDLE_T scif_remote_d SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*) scif_remote_device; - if ( (fw_device != NULL) && (fw_device->core_object != SCI_INVALID_HANDLE) ) - return fw_device->core_object; + if ( (fw_device == NULL) || (fw_device->core_object == SCI_INVALID_HANDLE) ) + return SCI_INVALID_HANDLE; SCIF_LOG_WARNING(( sci_base_object_get_logger(fw_device), @@ -372,7 +372,7 @@ SCI_REMOTE_DEVICE_HANDLE_T scif_remote_d fw_device )); - return SCI_INVALID_HANDLE; + return fw_device->core_object; } // --------------------------------------------------------------------------- Modified: head/sys/dev/isci/scil/scif_sas_smp_io_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_smp_io_request.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_smp_io_request.c Tue Feb 7 17:45:11 2012 (r231137) @@ -580,7 +580,7 @@ SCI_STATUS scif_sas_smp_external_request default: //unsupported case, TBD - break; + return SCI_FAILURE; } //end of switch //set the retry count to new built smp request. Modified: head/sys/dev/isci/scil/scif_sas_smp_remote_device.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Tue Feb 7 17:45:11 2012 (r231137) @@ -748,7 +748,6 @@ SCI_STATUS scif_sas_smp_remote_device_de { SCIF_SAS_DOMAIN_T * fw_domain; SCI_SAS_ADDRESS_T attached_device_address; - SCIF_SAS_REMOTE_DEVICE_T * attached_remote_device; SMP_RESPONSE_DISCOVER_T * discover_response = &smp_response->response.discover; @@ -782,13 +781,11 @@ SCI_STATUS scif_sas_smp_remote_device_de fw_domain = fw_device->domain; attached_device_address = discover_response->attached_sas_address; - attached_remote_device = (SCIF_SAS_REMOTE_DEVICE_T *) - scif_domain_get_device_by_sas_address( - fw_domain, &attached_device_address - ); - // the device should have already existed in the domian. - ASSERT (attached_remote_device != SCI_INVALID_HANDLE); + ASSERT(scif_domain_get_device_by_sas_address( + fw_domain, + &attached_device_address + ) != SCI_INVALID_HANDLE); return SCI_SUCCESS; } else @@ -1774,6 +1771,8 @@ SCIF_SAS_SMP_PHY_T * scif_sas_smp_remote SCI_FAST_LIST_ELEMENT_T * element = smp_remote_device->smp_phy_list.list_head; SCIF_SAS_SMP_PHY_T * curr_smp_phy = NULL; + ASSERT(phy_identifier < smp_remote_device->smp_phy_list.number_of_phys); + while (element != NULL) { curr_smp_phy = (SCIF_SAS_SMP_PHY_T*) sci_fast_list_get_object(element); @@ -1934,11 +1933,8 @@ SCI_STATUS scif_sas_smp_remote_device_sa scif_domain_get_device_by_sas_address( fw_device->domain, &discover_response->attached_sas_address); - if (smp_phy != NULL) - { - scif_sas_smp_phy_save_information( - smp_phy, attached_device, discover_response); - } + scif_sas_smp_phy_save_information( + smp_phy, attached_device, discover_response); //handle the special case of smp phys between expanders. if ( discover_response->protocols.u.bits.attached_smp_target ) @@ -2372,11 +2368,7 @@ void scif_sas_smp_remote_device_clean_ro SCIF_SAS_REMOTE_DEVICE_T * fw_device ) { - SCIF_SAS_SMP_PHY_T * smp_phy_being_config = - scif_sas_smp_remote_device_find_smp_phy_by_id( - fw_device->protocol_device.smp_device.current_activity_phy_index, - &(fw_device->protocol_device.smp_device) - ); + SCIF_SAS_SMP_PHY_T * smp_phy_being_config; SCIF_LOG_TRACE(( sci_base_object_get_logger(fw_device), From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 17:46:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9426E106566C; Tue, 7 Feb 2012 17:46:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 826198FC16; Tue, 7 Feb 2012 17:46: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 q17Hk2b8000144; Tue, 7 Feb 2012 17:46:02 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Hk2Hb000142; Tue, 7 Feb 2012 17:46:02 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071746.q17Hk2Hb000142@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 17:46:02 +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: r231138 - stable/9/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:46:02 -0000 Author: mm Date: Tue Feb 7 17:46:02 2012 New Revision: 231138 URL: http://svn.freebsd.org/changeset/base/231138 Log: MFC r230495: Try resolving jail path with realpath(3). jail(8) does a chdir(2) to the given path argument. Kernel evaluates the jail path from the new cwd and not from the original cwd, which leads to undesired behavior if given a relative path. Reviewed by: jamie Modified: stable/9/usr.sbin/jail/jail.c Directory Properties: stable/9/usr.sbin/jail/ (props changed) Modified: stable/9/usr.sbin/jail/jail.c ============================================================================== --- stable/9/usr.sbin/jail/jail.c Tue Feb 7 17:45:11 2012 (r231137) +++ stable/9/usr.sbin/jail/jail.c Tue Feb 7 17:46:02 2012 (r231138) @@ -508,6 +508,7 @@ static void set_param(const char *name, char *value) { struct jailparam *param; + char path[PATH_MAX]; int i; static int paramlistsize; @@ -520,8 +521,13 @@ set_param(const char *name, char *value) } /* jail_set won't chdir along with its chroot, so do it here. */ - if (!strcmp(name, "path") && chdir(value) < 0) - err(1, "chdir: %s", value); + if (!strcmp(name, "path")) { + /* resolve the path with realpath(3) */ + if (realpath(value, path) != NULL) + value = path; + if (chdir(value) < 0) + err(1, "chdir: %s", value); + } /* Check for repeat parameters */ for (i = 0; i < nparams; i++) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 17:47:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF50106564A; Tue, 7 Feb 2012 17:47:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DF778FC16; Tue, 7 Feb 2012 17:47:04 +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 q17Hl4H3000213; Tue, 7 Feb 2012 17:47:04 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Hl4qK000211; Tue, 7 Feb 2012 17:47:04 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071747.q17Hl4qK000211@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 17:47:04 +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: r231139 - stable/8/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:47:04 -0000 Author: mm Date: Tue Feb 7 17:47:04 2012 New Revision: 231139 URL: http://svn.freebsd.org/changeset/base/231139 Log: MFC r230495: Try resolving jail path with realpath(3). jail(8) does a chdir(2) to the given path argument. Kernel evaluates the jail path from the new cwd and not from the original cwd, which leads to undesired behavior if given a relative path. Reviewed by: jamie Modified: stable/8/usr.sbin/jail/jail.c Directory Properties: stable/8/usr.sbin/jail/ (props changed) Modified: stable/8/usr.sbin/jail/jail.c ============================================================================== --- stable/8/usr.sbin/jail/jail.c Tue Feb 7 17:46:02 2012 (r231138) +++ stable/8/usr.sbin/jail/jail.c Tue Feb 7 17:47:04 2012 (r231139) @@ -500,6 +500,7 @@ static void set_param(const char *name, char *value) { struct jailparam *param; + char path[PATH_MAX]; int i; static int paramlistsize; @@ -512,8 +513,13 @@ set_param(const char *name, char *value) } /* jail_set won't chdir along with its chroot, so do it here. */ - if (!strcmp(name, "path") && chdir(value) < 0) - err(1, "chdir: %s", value); + if (!strcmp(name, "path")) { + /* resolve the path with realpath(3) */ + if (realpath(value, path) != NULL) + value = path; + if (chdir(value) < 0) + err(1, "chdir: %s", value); + } /* Check for repeat parameters */ for (i = 0; i < nparams; i++) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 17:52:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14E40106566C; Tue, 7 Feb 2012 17:52:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0320A8FC0C; Tue, 7 Feb 2012 17:52:33 +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 q17HqWD5000477; Tue, 7 Feb 2012 17:52:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HqWTB000475; Tue, 7 Feb 2012 17:52:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202071752.q17HqWTB000475@svn.freebsd.org> From: Michael Tuexen Date: Tue, 7 Feb 2012 17:52: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: r231140 - stable/9/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:52:33 -0000 Author: tuexen Date: Tue Feb 7 17:52:32 2012 New Revision: 231140 URL: http://svn.freebsd.org/changeset/base/231140 Log: MFC r227755: Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option. Retire the the now unused sctp_udp_tunneling_for_client_enable sysctl variable. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Tue Feb 7 17:47:04 2012 (r231139) +++ stable/9/lib/libc/net/sctp_sys_calls.c Tue Feb 7 17:52:32 2012 (r231140) @@ -412,6 +412,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PEER_ADDR_THLDS: ((struct sctp_paddrthlds *)arg)->spt_assoc_id = id; break; + case SCTP_REMOTE_UDP_ENCAPS_PORT: + ((struct sctp_udpencaps *)arg)->sue_assoc_id = id; + break; case SCTP_MAX_BURST: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 17:57:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 716271065670; Tue, 7 Feb 2012 17:57:34 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C1478FC08; Tue, 7 Feb 2012 17:57:34 +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 q17HvYbu000687; Tue, 7 Feb 2012 17:57:34 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HvYul000678; Tue, 7 Feb 2012 17:57:34 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071757.q17HvYul000678@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 17:57:34 +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: r231141 - in stable/9: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:57:34 -0000 Author: mm Date: Tue Feb 7 17:57:33 2012 New Revision: 231141 URL: http://svn.freebsd.org/changeset/base/231141 Log: MFC r230514: Merge illumos revisions 13572, 13573, 13574: Rev. 13572: disk sync write perf regression when slog is used post oi_148 [1] Rev. 13573: crash during reguid causes stale config [2] allow and unallow missing from zpool history since removal of pyzfs [5] Rev. 13574: leaking a vdev when removing an l2cache device [3] memory leak when adding a file-based l2arc device [4] leak in ZFS from metaslab_group_create and zfs_ereport_checksum [6] References: https://www.illumos.org/issues/1909 [1] https://www.illumos.org/issues/1949 [2] https://www.illumos.org/issues/1951 [3] https://www.illumos.org/issues/1952 [4] https://www.illumos.org/issues/1953 [5] https://www.illumos.org/issues/1954 [6] Obtained from: illumos (issues #1909, #1949, #1951, #1952, #1953, #1954) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 7 17:57:33 2012 (r231141) @@ -4197,7 +4197,7 @@ tryagain: (void) strlcpy(zc.zc_name, zhp->zfs_name, ZFS_MAXNAMELEN); - if (zfs_ioctl(hdl, ZFS_IOC_GET_FSACL, &zc) != 0) { + if (ioctl(hdl->libzfs_fd, ZFS_IOC_GET_FSACL, &zc) != 0) { (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot get permissions on '%s'"), zc.zc_name); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Feb 7 17:57:33 2012 (r231141) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -36,7 +36,7 @@ * avoid having to load lots of space_maps in a given txg. There are, * however, some cases where we want to avoid "fast" ganging and instead * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang or dump device related allocations + * Currently we don't allow any gang, zil, or dump device related allocations * to "fast" gang. */ #define CAN_FASTGANG(flags) \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Feb 7 17:57:33 2012 (r231141) @@ -1073,8 +1073,10 @@ spa_unload(spa_t *spa) } spa->spa_spares.sav_count = 0; - for (i = 0; i < spa->spa_l2cache.sav_count; i++) + for (i = 0; i < spa->spa_l2cache.sav_count; i++) { + vdev_clear_stats(spa->spa_l2cache.sav_vdevs[i]); vdev_free(spa->spa_l2cache.sav_vdevs[i]); + } if (spa->spa_l2cache.sav_vdevs) { kmem_free(spa->spa_l2cache.sav_vdevs, spa->spa_l2cache.sav_count * sizeof (void *)); @@ -1302,11 +1304,13 @@ spa_load_l2cache(spa_t *spa) vd = oldvdevs[i]; if (vd != NULL) { + ASSERT(vd->vdev_isl2cache); + if (spa_l2cache_exists(vd->vdev_guid, &pool) && pool != 0ULL && l2arc_vdev_present(vd)) l2arc_remove_vdev(vd); - (void) vdev_close(vd); - spa_l2cache_remove(vd); + vdev_clear_stats(vd); + vdev_free(vd); } } @@ -1949,7 +1953,7 @@ spa_load_impl(spa_t *spa, uint64_t pool_ */ if (type != SPA_IMPORT_ASSEMBLE) { spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); - error = vdev_validate(rvd); + error = vdev_validate(rvd, mosconfig); spa_config_exit(spa, SCL_ALL, FTAG); if (error != 0) @@ -2818,6 +2822,7 @@ spa_validate_aux_devs(spa_t *spa, nvlist if ((strcmp(config, ZPOOL_CONFIG_L2CACHE) == 0) && strcmp(vd->vdev_ops->vdev_op_type, VDEV_TYPE_DISK) != 0) { error = ENOTBLK; + vdev_free(vd); goto out; } #endif @@ -2927,10 +2932,6 @@ spa_l2cache_drop(spa_t *spa) if (spa_l2cache_exists(vd->vdev_guid, &pool) && pool != 0ULL && l2arc_vdev_present(vd)) l2arc_remove_vdev(vd); - if (vd->vdev_isl2cache) - spa_l2cache_remove(vd); - vdev_clear_stats(vd); - (void) vdev_close(vd); } } @@ -3929,7 +3930,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui pvd = oldvd->vdev_parent; if ((error = spa_config_parse(spa, &newrootvd, nvroot, NULL, 0, - VDEV_ALLOC_ADD)) != 0) + VDEV_ALLOC_ATTACH)) != 0) return (spa_vdev_exit(spa, NULL, txg, EINVAL)); if (newrootvd->vdev_children != 1) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Feb 7 17:57:33 2012 (r231141) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_VDEV_H @@ -48,7 +49,7 @@ extern boolean_t zfs_nocacheflush; extern int vdev_open(vdev_t *); extern void vdev_open_children(vdev_t *); extern boolean_t vdev_uses_zvols(vdev_t *); -extern int vdev_validate(vdev_t *); +extern int vdev_validate(vdev_t *, boolean_t); extern void vdev_close(vdev_t *); extern int vdev_create(vdev_t *, uint64_t txg, boolean_t isreplace); extern void vdev_reopen(vdev_t *); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Feb 7 17:57:33 2012 (r231141) @@ -261,6 +261,7 @@ typedef struct vdev_label { #define VDEV_ALLOC_L2CACHE 3 #define VDEV_ALLOC_ROOTPOOL 4 #define VDEV_ALLOC_SPLIT 5 +#define VDEV_ALLOC_ATTACH 6 /* * Allocate or free a vdev Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 7 17:57:33 2012 (r231141) @@ -499,7 +499,7 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl &vd->vdev_removing); } - if (parent && !parent->vdev_parent) { + if (parent && !parent->vdev_parent && alloctype != VDEV_ALLOC_ATTACH) { ASSERT(alloctype == VDEV_ALLOC_LOAD || alloctype == VDEV_ALLOC_ADD || alloctype == VDEV_ALLOC_SPLIT || @@ -675,6 +675,8 @@ vdev_top_transfer(vdev_t *svd, vdev_t *t svd->vdev_ms_shift = 0; svd->vdev_ms_count = 0; + if (tvd->vdev_mg) + ASSERT3P(tvd->vdev_mg, ==, svd->vdev_mg); tvd->vdev_mg = svd->vdev_mg; tvd->vdev_ms = svd->vdev_ms; @@ -1294,13 +1296,18 @@ vdev_open(vdev_t *vd) * contents. This needs to be done before vdev_load() so that we don't * inadvertently do repair I/Os to the wrong device. * + * If 'strict' is false ignore the spa guid check. This is necessary because + * if the machine crashed during a re-guid the new guid might have been written + * to all of the vdev labels, but not the cached config. The strict check + * will be performed when the pool is opened again using the mos config. + * * This function will only return failure if one of the vdevs indicates that it * has since been destroyed or exported. This is only possible if * /etc/zfs/zpool.cache was readonly at the time. Otherwise, the vdev state * will be updated but the function will return 0. */ int -vdev_validate(vdev_t *vd) +vdev_validate(vdev_t *vd, boolean_t strict) { spa_t *spa = vd->vdev_spa; nvlist_t *label; @@ -1308,7 +1315,7 @@ vdev_validate(vdev_t *vd) uint64_t state; for (int c = 0; c < vd->vdev_children; c++) - if (vdev_validate(vd->vdev_child[c]) != 0) + if (vdev_validate(vd->vdev_child[c], strict) != 0) return (EBADF); /* @@ -1338,8 +1345,9 @@ vdev_validate(vdev_t *vd) return (0); } - if (nvlist_lookup_uint64(label, ZPOOL_CONFIG_POOL_GUID, - &guid) != 0 || guid != spa_guid(spa)) { + if (strict && (nvlist_lookup_uint64(label, + ZPOOL_CONFIG_POOL_GUID, &guid) != 0 || + guid != spa_guid(spa))) { vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN, VDEV_AUX_CORRUPT_DATA); nvlist_free(label); @@ -1501,7 +1509,7 @@ vdev_reopen(vdev_t *vd) !l2arc_vdev_present(vd)) l2arc_add_vdev(spa, vd); } else { - (void) vdev_validate(vd); + (void) vdev_validate(vd, B_TRUE); } /* Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Feb 7 17:57:33 2012 (r231141) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include #include #include @@ -709,6 +713,10 @@ zfs_ereport_start_checksum(spa_t *spa, v if (report->zcr_ereport == NULL) { report->zcr_free(report->zcr_cbdata, report->zcr_cbinfo); + if (report->zcr_ckinfo != NULL) { + kmem_free(report->zcr_ckinfo, + sizeof (*report->zcr_ckinfo)); + } kmem_free(report, sizeof (*report)); return; } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 7 17:52:32 2012 (r231140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 7 17:57:33 2012 (r231141) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -2235,13 +2235,22 @@ zio_alloc_zil(spa_t *spa, uint64_t txg, ASSERT(txg > spa_syncing_txg(spa)); - if (use_slog) + /* + * ZIL blocks are always contiguous (i.e. not gang blocks) so we + * set the METASLAB_GANG_AVOID flag so that they don't "fast gang" + * when allocating them. + */ + if (use_slog) { error = metaslab_alloc(spa, spa_log_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } - if (error) + if (error) { error = metaslab_alloc(spa, spa_normal_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } if (error == 0) { BP_SET_LSIZE(new_bp, size); From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 17:58:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64208106566C; Tue, 7 Feb 2012 17:58:00 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EC698FC08; Tue, 7 Feb 2012 17:58:00 +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 q17Hw0nA000743; Tue, 7 Feb 2012 17:58:00 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Hw0bJ000733; Tue, 7 Feb 2012 17:58:00 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071758.q17Hw0bJ000733@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 17:58:00 +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: r231142 - in stable/8: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:58:00 -0000 Author: mm Date: Tue Feb 7 17:57:59 2012 New Revision: 231142 URL: http://svn.freebsd.org/changeset/base/231142 Log: MFC r230514: Merge illumos revisions 13572, 13573, 13574: Rev. 13572: disk sync write perf regression when slog is used post oi_148 [1] Rev. 13573: crash during reguid causes stale config [2] allow and unallow missing from zpool history since removal of pyzfs [5] Rev. 13574: leaking a vdev when removing an l2cache device [3] memory leak when adding a file-based l2arc device [4] leak in ZFS from metaslab_group_create and zfs_ereport_checksum [6] References: https://www.illumos.org/issues/1909 [1] https://www.illumos.org/issues/1949 [2] https://www.illumos.org/issues/1951 [3] https://www.illumos.org/issues/1952 [4] https://www.illumos.org/issues/1953 [5] https://www.illumos.org/issues/1954 [6] Obtained from: illumos (issues #1909, #1949, #1951, #1952, #1953, #1954) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 7 17:57:59 2012 (r231142) @@ -4197,7 +4197,7 @@ tryagain: (void) strlcpy(zc.zc_name, zhp->zfs_name, ZFS_MAXNAMELEN); - if (zfs_ioctl(hdl, ZFS_IOC_GET_FSACL, &zc) != 0) { + if (ioctl(hdl->libzfs_fd, ZFS_IOC_GET_FSACL, &zc) != 0) { (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot get permissions on '%s'"), zc.zc_name); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Feb 7 17:57:59 2012 (r231142) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -36,7 +36,7 @@ * avoid having to load lots of space_maps in a given txg. There are, * however, some cases where we want to avoid "fast" ganging and instead * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang or dump device related allocations + * Currently we don't allow any gang, zil, or dump device related allocations * to "fast" gang. */ #define CAN_FASTGANG(flags) \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Feb 7 17:57:59 2012 (r231142) @@ -1073,8 +1073,10 @@ spa_unload(spa_t *spa) } spa->spa_spares.sav_count = 0; - for (i = 0; i < spa->spa_l2cache.sav_count; i++) + for (i = 0; i < spa->spa_l2cache.sav_count; i++) { + vdev_clear_stats(spa->spa_l2cache.sav_vdevs[i]); vdev_free(spa->spa_l2cache.sav_vdevs[i]); + } if (spa->spa_l2cache.sav_vdevs) { kmem_free(spa->spa_l2cache.sav_vdevs, spa->spa_l2cache.sav_count * sizeof (void *)); @@ -1302,11 +1304,13 @@ spa_load_l2cache(spa_t *spa) vd = oldvdevs[i]; if (vd != NULL) { + ASSERT(vd->vdev_isl2cache); + if (spa_l2cache_exists(vd->vdev_guid, &pool) && pool != 0ULL && l2arc_vdev_present(vd)) l2arc_remove_vdev(vd); - (void) vdev_close(vd); - spa_l2cache_remove(vd); + vdev_clear_stats(vd); + vdev_free(vd); } } @@ -1949,7 +1953,7 @@ spa_load_impl(spa_t *spa, uint64_t pool_ */ if (type != SPA_IMPORT_ASSEMBLE) { spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); - error = vdev_validate(rvd); + error = vdev_validate(rvd, mosconfig); spa_config_exit(spa, SCL_ALL, FTAG); if (error != 0) @@ -2818,6 +2822,7 @@ spa_validate_aux_devs(spa_t *spa, nvlist if ((strcmp(config, ZPOOL_CONFIG_L2CACHE) == 0) && strcmp(vd->vdev_ops->vdev_op_type, VDEV_TYPE_DISK) != 0) { error = ENOTBLK; + vdev_free(vd); goto out; } #endif @@ -2927,10 +2932,6 @@ spa_l2cache_drop(spa_t *spa) if (spa_l2cache_exists(vd->vdev_guid, &pool) && pool != 0ULL && l2arc_vdev_present(vd)) l2arc_remove_vdev(vd); - if (vd->vdev_isl2cache) - spa_l2cache_remove(vd); - vdev_clear_stats(vd); - (void) vdev_close(vd); } } @@ -3929,7 +3930,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui pvd = oldvd->vdev_parent; if ((error = spa_config_parse(spa, &newrootvd, nvroot, NULL, 0, - VDEV_ALLOC_ADD)) != 0) + VDEV_ALLOC_ATTACH)) != 0) return (spa_vdev_exit(spa, NULL, txg, EINVAL)); if (newrootvd->vdev_children != 1) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Feb 7 17:57:59 2012 (r231142) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_VDEV_H @@ -48,7 +49,7 @@ extern boolean_t zfs_nocacheflush; extern int vdev_open(vdev_t *); extern void vdev_open_children(vdev_t *); extern boolean_t vdev_uses_zvols(vdev_t *); -extern int vdev_validate(vdev_t *); +extern int vdev_validate(vdev_t *, boolean_t); extern void vdev_close(vdev_t *); extern int vdev_create(vdev_t *, uint64_t txg, boolean_t isreplace); extern void vdev_reopen(vdev_t *); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Feb 7 17:57:59 2012 (r231142) @@ -261,6 +261,7 @@ typedef struct vdev_label { #define VDEV_ALLOC_L2CACHE 3 #define VDEV_ALLOC_ROOTPOOL 4 #define VDEV_ALLOC_SPLIT 5 +#define VDEV_ALLOC_ATTACH 6 /* * Allocate or free a vdev Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 7 17:57:59 2012 (r231142) @@ -499,7 +499,7 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl &vd->vdev_removing); } - if (parent && !parent->vdev_parent) { + if (parent && !parent->vdev_parent && alloctype != VDEV_ALLOC_ATTACH) { ASSERT(alloctype == VDEV_ALLOC_LOAD || alloctype == VDEV_ALLOC_ADD || alloctype == VDEV_ALLOC_SPLIT || @@ -675,6 +675,8 @@ vdev_top_transfer(vdev_t *svd, vdev_t *t svd->vdev_ms_shift = 0; svd->vdev_ms_count = 0; + if (tvd->vdev_mg) + ASSERT3P(tvd->vdev_mg, ==, svd->vdev_mg); tvd->vdev_mg = svd->vdev_mg; tvd->vdev_ms = svd->vdev_ms; @@ -1294,13 +1296,18 @@ vdev_open(vdev_t *vd) * contents. This needs to be done before vdev_load() so that we don't * inadvertently do repair I/Os to the wrong device. * + * If 'strict' is false ignore the spa guid check. This is necessary because + * if the machine crashed during a re-guid the new guid might have been written + * to all of the vdev labels, but not the cached config. The strict check + * will be performed when the pool is opened again using the mos config. + * * This function will only return failure if one of the vdevs indicates that it * has since been destroyed or exported. This is only possible if * /etc/zfs/zpool.cache was readonly at the time. Otherwise, the vdev state * will be updated but the function will return 0. */ int -vdev_validate(vdev_t *vd) +vdev_validate(vdev_t *vd, boolean_t strict) { spa_t *spa = vd->vdev_spa; nvlist_t *label; @@ -1308,7 +1315,7 @@ vdev_validate(vdev_t *vd) uint64_t state; for (int c = 0; c < vd->vdev_children; c++) - if (vdev_validate(vd->vdev_child[c]) != 0) + if (vdev_validate(vd->vdev_child[c], strict) != 0) return (EBADF); /* @@ -1338,8 +1345,9 @@ vdev_validate(vdev_t *vd) return (0); } - if (nvlist_lookup_uint64(label, ZPOOL_CONFIG_POOL_GUID, - &guid) != 0 || guid != spa_guid(spa)) { + if (strict && (nvlist_lookup_uint64(label, + ZPOOL_CONFIG_POOL_GUID, &guid) != 0 || + guid != spa_guid(spa))) { vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN, VDEV_AUX_CORRUPT_DATA); nvlist_free(label); @@ -1501,7 +1509,7 @@ vdev_reopen(vdev_t *vd) !l2arc_vdev_present(vd)) l2arc_add_vdev(spa, vd); } else { - (void) vdev_validate(vd); + (void) vdev_validate(vd, B_TRUE); } /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Feb 7 17:57:59 2012 (r231142) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include #include #include @@ -709,6 +713,10 @@ zfs_ereport_start_checksum(spa_t *spa, v if (report->zcr_ereport == NULL) { report->zcr_free(report->zcr_cbdata, report->zcr_cbinfo); + if (report->zcr_ckinfo != NULL) { + kmem_free(report->zcr_ckinfo, + sizeof (*report->zcr_ckinfo)); + } kmem_free(report, sizeof (*report)); return; } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 7 17:57:33 2012 (r231141) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 7 17:57:59 2012 (r231142) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -2235,13 +2235,22 @@ zio_alloc_zil(spa_t *spa, uint64_t txg, ASSERT(txg > spa_syncing_txg(spa)); - if (use_slog) + /* + * ZIL blocks are always contiguous (i.e. not gang blocks) so we + * set the METASLAB_GANG_AVOID flag so that they don't "fast gang" + * when allocating them. + */ + if (use_slog) { error = metaslab_alloc(spa, spa_log_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } - if (error) + if (error) { error = metaslab_alloc(spa, spa_normal_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } if (error == 0) { BP_SET_LSIZE(new_bp, size); From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 18:05:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BD171065672; Tue, 7 Feb 2012 18:05:11 +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 395F28FC16; Tue, 7 Feb 2012 18:05: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 q17I5Bqk001032; Tue, 7 Feb 2012 18:05:11 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17I5Btw001030; Tue, 7 Feb 2012 18:05:11 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201202071805.q17I5Btw001030@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 7 Feb 2012 18:05: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: r231143 - stable/9/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 18:05:11 -0000 Author: bschmidt Date: Tue Feb 7 18:05:10 2012 New Revision: 231143 URL: http://svn.freebsd.org/changeset/base/231143 Log: MFC r230620: On state changes from RUN to anything else the AGGR sessions are cleared/dropped leading to qid2tap[n] being NULL as there no longer is a tap. Now, if there have been lots of frames queued the firmware processes and returns those after the tap is gone. 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 Tue Feb 7 17:57:59 2012 (r231142) +++ stable/9/sys/dev/iwn/if_iwn.c Tue Feb 7 18:05:10 2012 (r231143) @@ -2813,11 +2813,13 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, bitmap |= 1ULL << bit; } tap = sc->qid2tap[qid]; - tid = WME_AC_TO_TID(tap->txa_ac); - wn = (void *)tap->txa_ni; - wn->agg[tid].bitmap = bitmap; - wn->agg[tid].startidx = start; - wn->agg[tid].nframes = nframes; + if (tap != NULL) { + tid = WME_AC_TO_TID(tap->txa_ac); + wn = (void *)tap->txa_ni; + wn->agg[tid].bitmap = bitmap; + wn->agg[tid].startidx = start; + wn->agg[tid].nframes = nframes; + } seqno = le32toh(*(status + nframes)) & 0xfff; for (lastidx = (seqno & 0xff); ring->read != lastidx;) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 18:35:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D068C106566B; Tue, 7 Feb 2012 18:35:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE7D78FC0A; Tue, 7 Feb 2012 18:35: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 q17IZI8B002065; Tue, 7 Feb 2012 18:35:18 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17IZIQe002063; Tue, 7 Feb 2012 18:35:18 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071835.q17IZIQe002063@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 18:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231144 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 18:35:18 -0000 Author: mm Date: Tue Feb 7 18:35:18 2012 New Revision: 231144 URL: http://svn.freebsd.org/changeset/base/231144 Log: Merge illumos revision 13594: uninitialized variables in zfs(8) may make snapshots undestroyable [1] References: https://www.illumos.org/issues/2067 [1] Obtained from: illumos (issue #2067) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 7 18:05:10 2012 (r231143) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 7 18:35:18 2012 (r231144) @@ -590,7 +590,7 @@ zfs_do_clone(int argc, char **argv) zfs_handle_t *zhp = NULL; boolean_t parents = B_FALSE; nvlist_t *props; - int ret; + int ret = 0; int c; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) @@ -1052,7 +1052,7 @@ destroy_print_cb(zfs_handle_t *zhp, void static int destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb) { - int err; + int err = 0; assert(cb->cb_firstsnap == NULL); assert(cb->cb_prevsnap == NULL); err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb); @@ -1130,7 +1130,7 @@ destroy_clones(destroy_cbdata_t *cb) ZFS_TYPE_SNAPSHOT); if (zhp != NULL) { boolean_t defer = cb->cb_defer_destroy; - int err; + int err = 0; /* * We can't defer destroy non-snapshots, so set it to @@ -1207,7 +1207,7 @@ zfs_do_destroy(int argc, char **argv) at = strchr(argv[0], '@'); if (at != NULL) { - int err; + int err = 0; /* Build the list of snaps to destroy in cb_nvl. */ if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) @@ -1474,7 +1474,7 @@ zfs_do_get(int argc, char **argv) zprop_get_cbdata_t cb = { 0 }; int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; char *value, *fields; - int ret; + int ret = 0; int limit = 0; zprop_list_t fake_name = { 0 }; @@ -1711,7 +1711,7 @@ zfs_do_inherit(int argc, char **argv) zfs_prop_t prop; inherit_cbdata_t cb = { 0 }; char *propname; - int ret; + int ret = 0; int flags = 0; boolean_t received = B_FALSE; @@ -1917,7 +1917,7 @@ zfs_do_upgrade(int argc, char **argv) { boolean_t all = B_FALSE; boolean_t showversions = B_FALSE; - int ret; + int ret = 0; upgrade_cbdata_t cb = { 0 }; char c; int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -2206,7 +2206,7 @@ userspace_cb(void *arg, const char *doma uid_t id; uint64_t classes; #ifdef sun - int err; + int err = 0; directory_error_t e; #endif @@ -2562,7 +2562,7 @@ zfs_do_userspace(int argc, char **argv) boolean_t prtnum = B_FALSE; boolean_t parseable = B_FALSE; boolean_t sid2posix = B_FALSE; - int error; + int error = 0; int c; zfs_sort_column_t *default_sortcol = NULL; zfs_sort_column_t *sortcol = NULL; @@ -2925,7 +2925,7 @@ zfs_do_list(int argc, char **argv) list_cbdata_t cb = { 0 }; char *value; int limit = 0; - int ret; + int ret = 0; zfs_sort_column_t *sortcol = NULL; int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -3062,7 +3062,9 @@ zfs_do_rename(int argc, char **argv) { zfs_handle_t *zhp; renameflags_t flags = { 0 }; - int c, ret, types; + int c; + int ret = 0; + int types; boolean_t parents = B_FALSE; /* check options */ @@ -3155,7 +3157,7 @@ static int zfs_do_promote(int argc, char **argv) { zfs_handle_t *zhp; - int ret; + int ret = 0; /* check options */ if (argc > 1 && argv[1][0] == '-') { @@ -3276,7 +3278,7 @@ rollback_check(zfs_handle_t *zhp, void * static int zfs_do_rollback(int argc, char **argv) { - int ret; + int ret = 0; int c; boolean_t force = B_FALSE; rollback_cbdata_t cb = { 0 }; @@ -3394,7 +3396,7 @@ static int zfs_do_set(int argc, char **argv) { set_cbdata_t cb; - int ret; + int ret = 0; /* check for options */ if (argc > 1 && argv[1][0] == '-') { @@ -3448,7 +3450,7 @@ static int zfs_do_snapshot(int argc, char **argv) { boolean_t recursive = B_FALSE; - int ret; + int ret = 0; char c; nvlist_t *props; @@ -5286,7 +5288,7 @@ zfs_do_holds(int argc, char **argv) holds_cbdata_t cb = { 0 }; int limit = 0; - int ret; + int ret = 0; int flags = 0; /* check options */ @@ -5863,7 +5865,7 @@ static int unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual) { zfs_handle_t *zhp; - int ret; + int ret = 0; struct stat64 statbuf; struct extmnttab entry; const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount"; @@ -6331,7 +6333,7 @@ manual_mount(int argc, char **argv) zfs_handle_t *zhp; char mountpoint[ZFS_MAXPROPLEN]; char mntopts[MNT_LINE_MAX] = { '\0' }; - int ret; + int ret = 0; int c; int flags = 0; char *dataset, *path; @@ -6481,7 +6483,7 @@ zfs_do_diff(int argc, char **argv) char *tosnap = NULL; char *fromsnap = NULL; char *atp, *copy; - int err; + int err = 0; int c; while ((c = getopt(argc, argv, "FHt")) != -1) { @@ -6551,7 +6553,7 @@ zfs_do_diff(int argc, char **argv) int main(int argc, char **argv) { - int ret; + int ret = 0; int i; char *progname; char *cmdname; From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 18:38:32 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57B95106566B; Tue, 7 Feb 2012 18:38:32 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 4768D8FC13; Tue, 7 Feb 2012 18:38:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q17IcIDS046804; Tue, 7 Feb 2012 22:38:18 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q17IcI66046803; Tue, 7 Feb 2012 22:38:18 +0400 (MSK) (envelope-from ache) Date: Tue, 7 Feb 2012 22:38:18 +0400 From: Andrey Chernov To: Martin Matuska Message-ID: <20120207183818.GA46739@vniz.net> Mail-Followup-To: Andrey Chernov , Martin Matuska , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG, svn-src-stable-9@FreeBSD.ORG References: <201202071746.q17Hk2Hb000142@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202071746.q17Hk2Hb000142@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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: r231138 - stable/9/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 18:38:32 -0000 On Tue, Feb 07, 2012 at 05:46:02PM +0000, Martin Matuska wrote: > Author: mm > Date: Tue Feb 7 17:46:02 2012 > New Revision: 231138 > URL: http://svn.freebsd.org/changeset/base/231138 > > Log: > MFC r230495: > Try resolving jail path with realpath(3). Please note that our realpath(3) is far from perfect, see my followup to http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/128933 -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:03:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97FA8106566B; Tue, 7 Feb 2012 19:03:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE3E8FC1A; Tue, 7 Feb 2012 19:03:48 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 2717546B0A; Tue, 7 Feb 2012 14:03:48 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 85331B924; Tue, 7 Feb 2012 14:03:47 -0500 (EST) From: John Baldwin To: Nathan Whitehorn Date: Tue, 7 Feb 2012 14:00:17 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202051654.q15GsQcc092137@svn.freebsd.org> <201202061106.59098.jhb@freebsd.org> <4F3008C5.8020104@freebsd.org> In-Reply-To: <4F3008C5.8020104@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201202071400.17798.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 07 Feb 2012 14:03:47 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:03:48 -0000 On Monday, February 06, 2012 12:07:17 pm Nathan Whitehorn wrote: > On 02/06/12 10:06, John Baldwin wrote: > > On Monday, February 06, 2012 10:40:54 am Nathan Whitehorn wrote: > >> On 02/06/12 06:53, John Baldwin wrote: > >>> On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: > >>>> Author: nwhitehorn > >>>> Date: Sun Feb 5 16:54:26 2012 > >>>> New Revision: 231026 > >>>> URL: http://svn.freebsd.org/changeset/base/231026 > >>>> > >>>> Log: > >>>> Make sure to remap adjusted resources. > >>> Hmm, I had considered remapping adjusted resources an invalid operation (i.e. > >>> should fail with EINVAL). I believe that the NEW_PCIB code should only apply > >>> this API to resources backing the resource windows in PCI-PCI bridges and that > >>> those resources should never have RF_ACTIVE set. Are you seeing calls of it > >>> for active resources? > >>> > >> No, I was just trying to be safe here, since it wasn't clear that that > >> was invalid. I'm happy to replace the contents of the if with return > >> EINVAL or something. > > Yeah, I would do that, perhaps with a KASSERT() as well so it panics in HEAD. > > > > How does this look? I've kept both the EINVAL and the KASSERT. > -Nathan Looks good to me, thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:11:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A0DF1065676; Tue, 7 Feb 2012 19:11:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6729F8FC2B; Tue, 7 Feb 2012 19:11:55 +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 q17JBtuR003212; Tue, 7 Feb 2012 19:11:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JBtxI003203; Tue, 7 Feb 2012 19:11:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071911.q17JBtxI003203@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:11:55 +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: r231145 - in stable/9/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:11:55 -0000 Author: jhb Date: Tue Feb 7 19:11:54 2012 New Revision: 231145 URL: http://svn.freebsd.org/changeset/base/231145 Log: MFC 228957: Implement linux_fadvise64() and linux_fadvise64_64() using kern_posix_fadvise(). Modified: stable/9/sys/amd64/linux32/linux.h stable/9/sys/amd64/linux32/linux32_dummy.c stable/9/sys/amd64/linux32/syscalls.master stable/9/sys/compat/linux/linux_file.c stable/9/sys/i386/linux/linux.h stable/9/sys/i386/linux/linux_dummy.c stable/9/sys/i386/linux/syscalls.master 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) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/amd64/linux32/linux.h ============================================================================== --- stable/9/sys/amd64/linux32/linux.h Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/amd64/linux32/linux.h Tue Feb 7 19:11:54 2012 (r231145) @@ -597,6 +597,16 @@ int linux_ioctl_unregister_handler(struc #define LINUX_F_UNLCK 2 /* + * posix_fadvise advice + */ +#define LINUX_POSIX_FADV_NORMAL 0 +#define LINUX_POSIX_FADV_RANDOM 1 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 + +/* * mount flags */ #define LINUX_MS_RDONLY 0x0001 Modified: stable/9/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_dummy.c Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/amd64/linux32/linux32_dummy.c Tue Feb 7 19:11:54 2012 (r231145) @@ -59,7 +59,6 @@ DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); DUMMY(mincore); -DUMMY(fadvise64); DUMMY(ptrace); DUMMY(lookup_dcookie); DUMMY(epoll_create); @@ -72,7 +71,6 @@ DUMMY(timer_gettime); DUMMY(timer_getoverrun); DUMMY(timer_delete); DUMMY(fstatfs64); -DUMMY(fadvise64_64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: stable/9/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/9/sys/amd64/linux32/syscalls.master Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/amd64/linux32/syscalls.master Tue Feb 7 19:11:54 2012 (r231145) @@ -419,7 +419,8 @@ 247 AUE_NULL UNIMPL linux_io_getevents 248 AUE_NULL UNIMPL linux_io_submit 249 AUE_NULL UNIMPL linux_io_cancel -250 AUE_NULL STD { int linux_fadvise64(void); } +250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ + l_size_t len, int advice); } 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } 253 AUE_NULL STD { int linux_lookup_dcookie(void); } @@ -443,7 +444,9 @@ 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } -272 AUE_NULL STD { int linux_fadvise64_64(void); } +272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ + l_loff_t offset, l_loff_t len, \ + int advice); } 273 AUE_NULL UNIMPL 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } Modified: stable/9/sys/compat/linux/linux_file.c ============================================================================== --- stable/9/sys/compat/linux/linux_file.c Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/compat/linux/linux_file.c Tue Feb 7 19:11:54 2012 (r231145) @@ -1530,3 +1530,48 @@ linux_lchown(struct thread *td, struct l LFREEPATH(path); return (error); } + +static int +convert_fadvice(int advice) +{ + switch (advice) { + case LINUX_POSIX_FADV_NORMAL: + return (POSIX_FADV_NORMAL); + case LINUX_POSIX_FADV_RANDOM: + return (POSIX_FADV_RANDOM); + case LINUX_POSIX_FADV_SEQUENTIAL: + return (POSIX_FADV_SEQUENTIAL); + case LINUX_POSIX_FADV_WILLNEED: + return (POSIX_FADV_WILLNEED); + case LINUX_POSIX_FADV_DONTNEED: + return (POSIX_FADV_DONTNEED); + case LINUX_POSIX_FADV_NOREUSE: + return (POSIX_FADV_NOREUSE); + default: + return (-1); + } +} + +int +linux_fadvise64(struct thread *td, struct linux_fadvise64_args *args) +{ + int advice; + + advice = convert_fadvice(args->advice); + if (advice == -1) + return (EINVAL); + return (kern_posix_fadvise(td, args->fd, args->offset, args->len, + advice)); +} + +int +linux_fadvise64_64(struct thread *td, struct linux_fadvise64_64_args *args) +{ + int advice; + + advice = convert_fadvice(args->advice); + if (advice == -1) + return (EINVAL); + return (kern_posix_fadvise(td, args->fd, args->offset, args->len, + advice)); +} Modified: stable/9/sys/i386/linux/linux.h ============================================================================== --- stable/9/sys/i386/linux/linux.h Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/i386/linux/linux.h Tue Feb 7 19:11:54 2012 (r231145) @@ -573,6 +573,16 @@ int linux_ioctl_unregister_handler(struc #define LINUX_F_UNLCK 2 /* + * posix_fadvise advice + */ +#define LINUX_POSIX_FADV_NORMAL 0 +#define LINUX_POSIX_FADV_RANDOM 1 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 + +/* * mount flags */ #define LINUX_MS_RDONLY 0x0001 Modified: stable/9/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/9/sys/i386/linux/linux_dummy.c Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/i386/linux/linux_dummy.c Tue Feb 7 19:11:54 2012 (r231145) @@ -62,14 +62,12 @@ DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); DUMMY(mincore); -DUMMY(fadvise64); DUMMY(lookup_dcookie); DUMMY(epoll_create); DUMMY(epoll_ctl); DUMMY(epoll_wait); DUMMY(remap_file_pages); DUMMY(fstatfs64); -DUMMY(fadvise64_64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: stable/9/sys/i386/linux/syscalls.master ============================================================================== --- stable/9/sys/i386/linux/syscalls.master Tue Feb 7 18:35:18 2012 (r231144) +++ stable/9/sys/i386/linux/syscalls.master Tue Feb 7 19:11:54 2012 (r231145) @@ -421,7 +421,8 @@ 247 AUE_NULL UNIMPL linux_io_getevents 248 AUE_NULL UNIMPL linux_io_submit 249 AUE_NULL UNIMPL linux_io_cancel -250 AUE_NULL STD { int linux_fadvise64(void); } +250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ + l_size_t len, int advice); } 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } 253 AUE_NULL STD { int linux_lookup_dcookie(void); } @@ -447,7 +448,9 @@ 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } -272 AUE_NULL STD { int linux_fadvise64_64(void); } +272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ + l_loff_t offset, l_loff_t len, \ + int advice); } 273 AUE_NULL UNIMPL 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:12:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF937106566C; Tue, 7 Feb 2012 19:12:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACB7C8FC20; Tue, 7 Feb 2012 19:12: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 q17JCLVY003271; Tue, 7 Feb 2012 19:12:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JCL69003263; Tue, 7 Feb 2012 19:12:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071912.q17JCL69003263@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:12: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: r231146 - in stable/8/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:12:21 -0000 Author: jhb Date: Tue Feb 7 19:12:21 2012 New Revision: 231146 URL: http://svn.freebsd.org/changeset/base/231146 Log: MFC 228957: Implement linux_fadvise64() and linux_fadvise64_64() using kern_posix_fadvise(). Modified: stable/8/sys/amd64/linux32/linux.h stable/8/sys/amd64/linux32/linux32_dummy.c stable/8/sys/amd64/linux32/syscalls.master stable/8/sys/compat/linux/linux_file.c stable/8/sys/i386/linux/linux.h stable/8/sys/i386/linux/linux_dummy.c stable/8/sys/i386/linux/syscalls.master Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/modules/sound/driver/emu10k1/ (props changed) stable/8/sys/modules/sound/driver/emu10kx/ (props changed) Modified: stable/8/sys/amd64/linux32/linux.h ============================================================================== --- stable/8/sys/amd64/linux32/linux.h Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/amd64/linux32/linux.h Tue Feb 7 19:12:21 2012 (r231146) @@ -594,6 +594,16 @@ int linux_ioctl_unregister_handler(struc #define LINUX_F_UNLCK 2 /* + * posix_fadvise advice + */ +#define LINUX_POSIX_FADV_NORMAL 0 +#define LINUX_POSIX_FADV_RANDOM 1 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 + +/* * mount flags */ #define LINUX_MS_RDONLY 0x0001 Modified: stable/8/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_dummy.c Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/amd64/linux32/linux32_dummy.c Tue Feb 7 19:12:21 2012 (r231146) @@ -59,7 +59,6 @@ DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); DUMMY(mincore); -DUMMY(fadvise64); DUMMY(ptrace); DUMMY(lookup_dcookie); DUMMY(epoll_create); @@ -72,7 +71,6 @@ DUMMY(timer_gettime); DUMMY(timer_getoverrun); DUMMY(timer_delete); DUMMY(fstatfs64); -DUMMY(fadvise64_64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: stable/8/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/8/sys/amd64/linux32/syscalls.master Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/amd64/linux32/syscalls.master Tue Feb 7 19:12:21 2012 (r231146) @@ -419,7 +419,8 @@ 247 AUE_NULL UNIMPL linux_io_getevents 248 AUE_NULL UNIMPL linux_io_submit 249 AUE_NULL UNIMPL linux_io_cancel -250 AUE_NULL STD { int linux_fadvise64(void); } +250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ + l_size_t len, int advice); } 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } 253 AUE_NULL STD { int linux_lookup_dcookie(void); } @@ -443,7 +444,9 @@ 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } -272 AUE_NULL STD { int linux_fadvise64_64(void); } +272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ + l_loff_t offset, l_loff_t len, \ + int advice); } 273 AUE_NULL UNIMPL 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } Modified: stable/8/sys/compat/linux/linux_file.c ============================================================================== --- stable/8/sys/compat/linux/linux_file.c Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/compat/linux/linux_file.c Tue Feb 7 19:12:21 2012 (r231146) @@ -1533,3 +1533,48 @@ linux_lchown(struct thread *td, struct l LFREEPATH(path); return (error); } + +static int +convert_fadvice(int advice) +{ + switch (advice) { + case LINUX_POSIX_FADV_NORMAL: + return (POSIX_FADV_NORMAL); + case LINUX_POSIX_FADV_RANDOM: + return (POSIX_FADV_RANDOM); + case LINUX_POSIX_FADV_SEQUENTIAL: + return (POSIX_FADV_SEQUENTIAL); + case LINUX_POSIX_FADV_WILLNEED: + return (POSIX_FADV_WILLNEED); + case LINUX_POSIX_FADV_DONTNEED: + return (POSIX_FADV_DONTNEED); + case LINUX_POSIX_FADV_NOREUSE: + return (POSIX_FADV_NOREUSE); + default: + return (-1); + } +} + +int +linux_fadvise64(struct thread *td, struct linux_fadvise64_args *args) +{ + int advice; + + advice = convert_fadvice(args->advice); + if (advice == -1) + return (EINVAL); + return (kern_posix_fadvise(td, args->fd, args->offset, args->len, + advice)); +} + +int +linux_fadvise64_64(struct thread *td, struct linux_fadvise64_64_args *args) +{ + int advice; + + advice = convert_fadvice(args->advice); + if (advice == -1) + return (EINVAL); + return (kern_posix_fadvise(td, args->fd, args->offset, args->len, + advice)); +} Modified: stable/8/sys/i386/linux/linux.h ============================================================================== --- stable/8/sys/i386/linux/linux.h Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/i386/linux/linux.h Tue Feb 7 19:12:21 2012 (r231146) @@ -570,6 +570,16 @@ int linux_ioctl_unregister_handler(struc #define LINUX_F_UNLCK 2 /* + * posix_fadvise advice + */ +#define LINUX_POSIX_FADV_NORMAL 0 +#define LINUX_POSIX_FADV_RANDOM 1 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 + +/* * mount flags */ #define LINUX_MS_RDONLY 0x0001 Modified: stable/8/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/8/sys/i386/linux/linux_dummy.c Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/i386/linux/linux_dummy.c Tue Feb 7 19:12:21 2012 (r231146) @@ -62,14 +62,12 @@ DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); DUMMY(mincore); -DUMMY(fadvise64); DUMMY(lookup_dcookie); DUMMY(epoll_create); DUMMY(epoll_ctl); DUMMY(epoll_wait); DUMMY(remap_file_pages); DUMMY(fstatfs64); -DUMMY(fadvise64_64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: stable/8/sys/i386/linux/syscalls.master ============================================================================== --- stable/8/sys/i386/linux/syscalls.master Tue Feb 7 19:11:54 2012 (r231145) +++ stable/8/sys/i386/linux/syscalls.master Tue Feb 7 19:12:21 2012 (r231146) @@ -421,7 +421,8 @@ 247 AUE_NULL UNIMPL linux_io_getevents 248 AUE_NULL UNIMPL linux_io_submit 249 AUE_NULL UNIMPL linux_io_cancel -250 AUE_NULL STD { int linux_fadvise64(void); } +250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ + l_size_t len, int advice); } 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } 253 AUE_NULL STD { int linux_lookup_dcookie(void); } @@ -447,7 +448,9 @@ 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } -272 AUE_NULL STD { int linux_fadvise64_64(void); } +272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ + l_loff_t offset, l_loff_t len, \ + int advice); } 273 AUE_NULL UNIMPL 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:13:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 220E11065673; Tue, 7 Feb 2012 19:13:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EBD98FC15; Tue, 7 Feb 2012 19:13: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 q17JDZF8003347; Tue, 7 Feb 2012 19:13:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JDYvu003336; Tue, 7 Feb 2012 19:13:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071913.q17JDYvu003336@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:13:34 +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: r231147 - in stable/9/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:13:35 -0000 Author: jhb Date: Tue Feb 7 19:13:34 2012 New Revision: 231147 URL: http://svn.freebsd.org/changeset/base/231147 Log: Regen. Modified: stable/9/sys/amd64/linux32/linux32_proto.h stable/9/sys/amd64/linux32/linux32_syscall.h stable/9/sys/amd64/linux32/linux32_syscalls.c stable/9/sys/amd64/linux32/linux32_sysent.c stable/9/sys/amd64/linux32/linux32_systrace_args.c stable/9/sys/i386/linux/linux_proto.h stable/9/sys/i386/linux/linux_syscall.h stable/9/sys/i386/linux/linux_syscalls.c stable/9/sys/i386/linux/linux_sysent.c stable/9/sys/i386/linux/linux_systrace_args.c Modified: stable/9/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/9/sys/amd64/linux32/linux32_proto.h Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_proto.h Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #ifndef _LINUX_SYSPROTO_H_ @@ -755,7 +755,10 @@ struct linux_set_thread_area_args { char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)]; }; struct linux_fadvise64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_exit_group_args { char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; @@ -829,7 +832,10 @@ struct linux_utimes_args { char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; }; struct linux_fadvise64_64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_mbind_args { register_t dummy; Modified: stable/9/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/9/sys/amd64/linux32/linux32_syscall.h Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_syscall.h Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #define LINUX_SYS_exit 1 Modified: stable/9/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_syscalls.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_syscalls.c Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ const char *linux_syscallnames[] = { Modified: stable/9/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_sysent.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_sysent.c Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #include "opt_compat.h" @@ -269,7 +269,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 247 = linux_io_getevents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_fadvise64 */ + { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = linux_lookup_dcookie */ @@ -291,7 +291,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ + { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = linux_get_mempolicy */ Modified: stable/9/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_systrace_args.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/amd64/linux32/linux32_systrace_args.c Tue Feb 7 19:13:34 2012 (r231147) @@ -1674,7 +1674,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64 */ case 250: { - *n_args = 0; + struct linux_fadvise64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_size_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_exit_group */ @@ -1808,7 +1813,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64_64 */ case 272: { - *n_args = 0; + struct linux_fadvise64_64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_loff_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_mbind */ @@ -4613,6 +4623,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64 */ case 250: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_size_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_exit_group */ case 252: @@ -4772,6 +4798,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64_64 */ case 272: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_mbind */ case 274: Modified: stable/9/sys/i386/linux/linux_proto.h ============================================================================== --- stable/9/sys/i386/linux/linux_proto.h Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_proto.h Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #ifndef _LINUX_SYSPROTO_H_ @@ -755,7 +755,10 @@ struct linux_get_thread_area_args { char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)]; }; struct linux_fadvise64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_exit_group_args { char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; @@ -834,7 +837,10 @@ struct linux_utimes_args { char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; }; struct linux_fadvise64_64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_mbind_args { register_t dummy; Modified: stable/9/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/9/sys/i386/linux/linux_syscall.h Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_syscall.h Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #define LINUX_SYS_exit 1 Modified: stable/9/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/9/sys/i386/linux/linux_syscalls.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_syscalls.c Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ const char *linux_syscallnames[] = { Modified: stable/9/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/9/sys/i386/linux/linux_sysent.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_sysent.c Tue Feb 7 19:13:34 2012 (r231147) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb */ #include @@ -268,7 +268,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 247 = linux_io_getevents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_fadvise64 */ + { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = linux_lookup_dcookie */ @@ -290,7 +290,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ + { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = linux_get_mempolicy */ Modified: stable/9/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/9/sys/i386/linux/linux_systrace_args.c Tue Feb 7 19:12:21 2012 (r231146) +++ stable/9/sys/i386/linux/linux_systrace_args.c Tue Feb 7 19:13:34 2012 (r231147) @@ -1724,7 +1724,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64 */ case 250: { - *n_args = 0; + struct linux_fadvise64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_size_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_exit_group */ @@ -1873,7 +1878,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64_64 */ case 272: { - *n_args = 0; + struct linux_fadvise64_64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_loff_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_mbind */ @@ -4775,6 +4785,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64 */ case 250: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_size_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_exit_group */ case 252: @@ -4984,6 +5010,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64_64 */ case 272: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_mbind */ case 274: From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:13:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A71810657D2; Tue, 7 Feb 2012 19:13:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4728A8FC14; Tue, 7 Feb 2012 19:13:48 +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 q17JDmm4003399; Tue, 7 Feb 2012 19:13:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JDmgQ003388; Tue, 7 Feb 2012 19:13:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071913.q17JDmgQ003388@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:13:48 +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: r231148 - in stable/8/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:13:48 -0000 Author: jhb Date: Tue Feb 7 19:13:47 2012 New Revision: 231148 URL: http://svn.freebsd.org/changeset/base/231148 Log: Regen. Modified: stable/8/sys/amd64/linux32/linux32_proto.h stable/8/sys/amd64/linux32/linux32_syscall.h stable/8/sys/amd64/linux32/linux32_syscalls.c stable/8/sys/amd64/linux32/linux32_sysent.c stable/8/sys/amd64/linux32/linux32_systrace_args.c stable/8/sys/i386/linux/linux_proto.h stable/8/sys/i386/linux/linux_syscall.h stable/8/sys/i386/linux/linux_syscalls.c stable/8/sys/i386/linux/linux_sysent.c stable/8/sys/i386/linux/linux_systrace_args.c Modified: stable/8/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/8/sys/amd64/linux32/linux32_proto.h Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_proto.h Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #ifndef _LINUX_SYSPROTO_H_ @@ -755,7 +755,10 @@ struct linux_set_thread_area_args { char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)]; }; struct linux_fadvise64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_exit_group_args { char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; @@ -829,7 +832,10 @@ struct linux_utimes_args { char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; }; struct linux_fadvise64_64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_mbind_args { register_t dummy; Modified: stable/8/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/8/sys/amd64/linux32/linux32_syscall.h Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_syscall.h Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #define LINUX_SYS_exit 1 Modified: stable/8/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_syscalls.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_syscalls.c Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ const char *linux_syscallnames[] = { Modified: stable/8/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_sysent.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_sysent.c Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #include "opt_compat.h" @@ -269,7 +269,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 247 = linux_io_getevents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ + { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0 }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0 }, /* 253 = linux_lookup_dcookie */ @@ -291,7 +291,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0 }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0 }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0 }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ + { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0 }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0 }, /* 275 = linux_get_mempolicy */ Modified: stable/8/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_systrace_args.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/amd64/linux32/linux32_systrace_args.c Tue Feb 7 19:13:47 2012 (r231148) @@ -1674,7 +1674,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64 */ case 250: { - *n_args = 0; + struct linux_fadvise64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_size_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_exit_group */ @@ -1808,7 +1813,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64_64 */ case 272: { - *n_args = 0; + struct linux_fadvise64_64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_loff_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_mbind */ @@ -4613,6 +4623,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64 */ case 250: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_size_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_exit_group */ case 252: @@ -4772,6 +4798,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64_64 */ case 272: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_mbind */ case 274: Modified: stable/8/sys/i386/linux/linux_proto.h ============================================================================== --- stable/8/sys/i386/linux/linux_proto.h Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_proto.h Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #ifndef _LINUX_SYSPROTO_H_ @@ -755,7 +755,10 @@ struct linux_get_thread_area_args { char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)]; }; struct linux_fadvise64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_exit_group_args { char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; @@ -834,7 +837,10 @@ struct linux_utimes_args { char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; }; struct linux_fadvise64_64_args { - register_t dummy; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_mbind_args { register_t dummy; Modified: stable/8/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/8/sys/i386/linux/linux_syscall.h Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_syscall.h Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #define LINUX_SYS_exit 1 Modified: stable/8/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/8/sys/i386/linux/linux_syscalls.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_syscalls.c Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ const char *linux_syscallnames[] = { Modified: stable/8/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/8/sys/i386/linux/linux_sysent.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_sysent.c Tue Feb 7 19:13:47 2012 (r231148) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 222555 2011-06-01 05:50:24Z art + * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 231146 2012-02-07 19:12:21Z jhb */ #include @@ -268,7 +268,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 247 = linux_io_getevents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 249 = linux_io_cancel */ - { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ + { AS(linux_fadvise64_args), (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0 }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0 }, /* 253 = linux_lookup_dcookie */ @@ -290,7 +290,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0 }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0 }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0 }, /* 271 = linux_utimes */ - { 0, (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ + { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0 }, /* 272 = linux_fadvise64_64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 273 = */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0 }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0 }, /* 275 = linux_get_mempolicy */ Modified: stable/8/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/8/sys/i386/linux/linux_systrace_args.c Tue Feb 7 19:13:34 2012 (r231147) +++ stable/8/sys/i386/linux/linux_systrace_args.c Tue Feb 7 19:13:47 2012 (r231148) @@ -1724,7 +1724,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64 */ case 250: { - *n_args = 0; + struct linux_fadvise64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_size_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_exit_group */ @@ -1873,7 +1878,12 @@ systrace_args(int sysnum, void *params, } /* linux_fadvise64_64 */ case 272: { - *n_args = 0; + struct linux_fadvise64_64_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* l_loff_t */ + iarg[2] = p->len; /* l_loff_t */ + iarg[3] = p->advice; /* int */ + *n_args = 4; break; } /* linux_mbind */ @@ -4775,6 +4785,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64 */ case 250: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_size_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_exit_group */ case 252: @@ -4984,6 +5010,22 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_fadvise64_64 */ case 272: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_loff_t"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "int"; + break; + default: + break; + }; break; /* linux_mbind */ case 274: From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:14:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25DA71065686; Tue, 7 Feb 2012 19:14:14 +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 145F68FC08; Tue, 7 Feb 2012 19:14: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 q17JEDNC003451; Tue, 7 Feb 2012 19:14:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JEDBK003449; Tue, 7 Feb 2012 19:14:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202071914.q17JEDBK003449@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 7 Feb 2012 19:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231149 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:14:14 -0000 Author: nwhitehorn Date: Tue Feb 7 19:14:13 2012 New Revision: 231149 URL: http://svn.freebsd.org/changeset/base/231149 Log: The bus resource adjustment API is not meant to work on active resources. Return an error if a driver attempts this, and, if INVARIANTS is on, panic. Reviewed by: jhb Modified: head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Tue Feb 7 19:13:47 2012 (r231148) +++ head/sys/powerpc/ofw/ofw_pci.c Tue Feb 7 19:14:13 2012 (r231149) @@ -431,7 +431,11 @@ ofw_pci_adjust_resource(device_t bus, de { struct rman *rm = NULL; struct ofw_pci_softc *sc = device_get_softc(bus); - int error; + + KASSERT(!(rman_get_flags(res) & RF_ACTIVE), + ("active resources cannot be adjusted")); + if (rman_get_flags(res) & RF_ACTIVE) + return (EINVAL); switch (type) { case SYS_RES_MEMORY: @@ -447,21 +451,7 @@ ofw_pci_adjust_resource(device_t bus, de if (!rman_is_region_manager(res, rm)) return (EINVAL); - error = rman_adjust_resource(res, start, end); - if (error) - return (error); - - if (rman_get_flags(res) & RF_ACTIVE) { - /* Remap memory resources */ - error = ofw_pci_deactivate_resource(bus, child, type, - rman_get_rid(res), res); - if (error) - return (error); - error = ofw_pci_activate_resource(bus, child, type, - rman_get_rid(res), res); - } - - return (error); + return (rman_adjust_resource(res, start, end)); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:23:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2FF4106564A; Tue, 7 Feb 2012 19:23:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6E058FC13; Tue, 7 Feb 2012 19:23:08 +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 q17JN80S003795; Tue, 7 Feb 2012 19:23:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JN8o4003792; Tue, 7 Feb 2012 19:23:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071923.q17JN8o4003792@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:23:08 +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: r231150 - in stable/9/sys: i386/i386 mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:23:09 -0000 Author: jhb Date: Tue Feb 7 19:23:08 2012 New Revision: 231150 URL: http://svn.freebsd.org/changeset/base/231150 Log: MFC 228962: Use curthread rather than PCPU_GET(curthread). 'curthread' uses special-case optimizations on several platforms and is preferred. Modified: stable/9/sys/i386/i386/sys_machdep.c stable/9/sys/mips/mips/gdb_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) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/i386/i386/sys_machdep.c ============================================================================== --- stable/9/sys/i386/i386/sys_machdep.c Tue Feb 7 19:14:13 2012 (r231149) +++ stable/9/sys/i386/i386/sys_machdep.c Tue Feb 7 19:23:08 2012 (r231150) @@ -549,7 +549,7 @@ user_ldt_free(struct thread *td) return; } - if (td == PCPU_GET(curthread)) { + if (td == curthread) { #ifdef XEN i386_reset_ldt(&default_proc_ldt); PCPU_SET(currentldt, (int)&default_proc_ldt); Modified: stable/9/sys/mips/mips/gdb_machdep.c ============================================================================== --- stable/9/sys/mips/mips/gdb_machdep.c Tue Feb 7 19:14:13 2012 (r231149) +++ stable/9/sys/mips/mips/gdb_machdep.c Tue Feb 7 19:23:08 2012 (r231150) @@ -116,7 +116,7 @@ gdb_cpu_getreg(int regnum, size_t *regsz { *regsz = gdb_cpu_regsz(regnum); - if (kdb_thread == PCPU_GET(curthread)) { + if (kdb_thread == curthread) { register_t *zero_ptr = &kdb_frame->zero; return zero_ptr + regnum; } @@ -154,7 +154,7 @@ gdb_cpu_setreg(int regnum, void *val) switch (regnum) { case GDB_REG_PC: kdb_thrctx->pcb_context[10] = *(register_t *)val; - if (kdb_thread == PCPU_GET(curthread)) + if (kdb_thread == curthread) kdb_frame->pc = *(register_t *)val; } } From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:23:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15601065674; Tue, 7 Feb 2012 19:23:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5E638FC1C; Tue, 7 Feb 2012 19:23:31 +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 q17JNVLI003841; Tue, 7 Feb 2012 19:23:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JNVQZ003838; Tue, 7 Feb 2012 19:23:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071923.q17JNVQZ003838@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:23:31 +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: r231151 - in stable/8/sys: i386/i386 mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:23:32 -0000 Author: jhb Date: Tue Feb 7 19:23:31 2012 New Revision: 231151 URL: http://svn.freebsd.org/changeset/base/231151 Log: MFC 228962: Use curthread rather than PCPU_GET(curthread). 'curthread' uses special-case optimizations on several platforms and is preferred. Modified: stable/8/sys/i386/i386/sys_machdep.c stable/8/sys/mips/mips/gdb_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/modules/sound/driver/emu10k1/ (props changed) stable/8/sys/modules/sound/driver/emu10kx/ (props changed) Modified: stable/8/sys/i386/i386/sys_machdep.c ============================================================================== --- stable/8/sys/i386/i386/sys_machdep.c Tue Feb 7 19:23:08 2012 (r231150) +++ stable/8/sys/i386/i386/sys_machdep.c Tue Feb 7 19:23:31 2012 (r231151) @@ -522,7 +522,7 @@ user_ldt_free(struct thread *td) return; } - if (td == PCPU_GET(curthread)) { + if (td == curthread) { #ifdef XEN i386_reset_ldt(&default_proc_ldt); PCPU_SET(currentldt, (int)&default_proc_ldt); Modified: stable/8/sys/mips/mips/gdb_machdep.c ============================================================================== --- stable/8/sys/mips/mips/gdb_machdep.c Tue Feb 7 19:23:08 2012 (r231150) +++ stable/8/sys/mips/mips/gdb_machdep.c Tue Feb 7 19:23:31 2012 (r231151) @@ -116,7 +116,7 @@ gdb_cpu_getreg(int regnum, size_t *regsz { *regsz = gdb_cpu_regsz(regnum); - if (kdb_thread == PCPU_GET(curthread)) { + if (kdb_thread == curthread) { register_t *zero_ptr = &kdb_frame->zero; return zero_ptr + regnum; } @@ -154,7 +154,7 @@ gdb_cpu_setreg(int regnum, void *val) switch (regnum) { case GDB_REG_PC: kdb_thrctx->pcb_context[10] = *(register_t *)val; - if (kdb_thread == PCPU_GET(curthread)) + if (kdb_thread == curthread) kdb_frame->pc = *(register_t *)val; } } From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:32:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3040A106566C; Tue, 7 Feb 2012 19:32:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C0158FC0C; Tue, 7 Feb 2012 19:32: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 q17JWKxl004150; Tue, 7 Feb 2012 19:32:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JWKK0004149; Tue, 7 Feb 2012 19:32:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071932.q17JWKK0004149@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:32:20 +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: r231152 - in stable/9/sys: . amd64/include/xen boot boot/i386/efi boot/ia64/efi boot/ia64/ski boot/powerpc/boot1.chrp boot/powerpc/ofw cddl/contrib/opensolaris conf contrib/dev/acpica c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:32:21 -0000 Author: jhb Date: Tue Feb 7 19:32:20 2012 New Revision: 231152 URL: http://svn.freebsd.org/changeset/base/231152 Log: Hoist mergeinfo for modules/sound/driver/* up to sys/. Modified: 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) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:40:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED0D106566C; Tue, 7 Feb 2012 19:40:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC8B48FC14; Tue, 7 Feb 2012 19:40: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 q17JeqG8004452; Tue, 7 Feb 2012 19:40:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JeqjF004449; Tue, 7 Feb 2012 19:40:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071940.q17JeqjF004449@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:40: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: r231153 - stable/9/sys/dev/ichwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:40:53 -0000 Author: jhb Date: Tue Feb 7 19:40:52 2012 New Revision: 231153 URL: http://svn.freebsd.org/changeset/base/231153 Log: MFC 229598: Remove use of explicit bus space tags and handles and use methods that operate on resource objects instead. Modified: stable/9/sys/dev/ichwd/ichwd.c stable/9/sys/dev/ichwd/ichwd.h 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/dev/ichwd/ichwd.c ============================================================================== --- stable/9/sys/dev/ichwd/ichwd.c Tue Feb 7 19:32:20 2012 (r231152) +++ stable/9/sys/dev/ichwd/ichwd.c Tue Feb 7 19:40:52 2012 (r231153) @@ -198,26 +198,26 @@ static struct ichwd_device ichwd_devices static devclass_t ichwd_devclass; #define ichwd_read_tco_1(sc, off) \ - bus_space_read_1((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_1((sc)->tco_res, (off)) #define ichwd_read_tco_2(sc, off) \ - bus_space_read_2((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_2((sc)->tco_res, (off)) #define ichwd_read_tco_4(sc, off) \ - bus_space_read_4((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_4((sc)->tco_res, (off)) #define ichwd_read_smi_4(sc, off) \ - bus_space_read_4((sc)->smi_bst, (sc)->smi_bsh, (off)) + bus_read_4((sc)->smi_res, (off)) #define ichwd_read_gcs_4(sc, off) \ - bus_space_read_4((sc)->gcs_bst, (sc)->gcs_bsh, (off)) + bus_read_4((sc)->gcs_res, (off)) #define ichwd_write_tco_1(sc, off, val) \ - bus_space_write_1((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_1((sc)->tco_res, (off), (val)) #define ichwd_write_tco_2(sc, off, val) \ - bus_space_write_2((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_2((sc)->tco_res, (off), (val)) #define ichwd_write_tco_4(sc, off, val) \ - bus_space_write_4((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_4((sc)->tco_res, (off), (val)) #define ichwd_write_smi_4(sc, off, val) \ - bus_space_write_4((sc)->smi_bst, (sc)->smi_bsh, (off), (val)) + bus_write_4((sc)->smi_res, (off), (val)) #define ichwd_write_gcs_4(sc, off, val) \ - bus_space_write_4((sc)->gcs_bst, (sc)->gcs_bsh, (off), (val)) + bus_write_4((sc)->gcs_res, (off), (val)) #define ichwd_verbose_printf(dev, ...) \ do { \ @@ -519,8 +519,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve SMI registers\n"); goto fail; } - sc->smi_bst = rman_get_bustag(sc->smi_res); - sc->smi_bsh = rman_get_bushandle(sc->smi_res); sc->tco_rid = 1; sc->tco_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->tco_rid, @@ -530,8 +528,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve TCO registers\n"); goto fail; } - sc->tco_bst = rman_get_bustag(sc->tco_res); - sc->tco_bsh = rman_get_bushandle(sc->tco_res); sc->gcs_rid = 0; if (sc->ich_version >= 6) { @@ -541,12 +537,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve GCS registers\n"); goto fail; } - sc->gcs_bst = rman_get_bustag(sc->gcs_res); - sc->gcs_bsh = rman_get_bushandle(sc->gcs_res); - } else { - sc->gcs_res = 0; - sc->gcs_bst = 0; - sc->gcs_bsh = 0; } if (ichwd_clear_noreboot(sc) != 0) Modified: stable/9/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/9/sys/dev/ichwd/ichwd.h Tue Feb 7 19:32:20 2012 (r231152) +++ stable/9/sys/dev/ichwd/ichwd.h Tue Feb 7 19:40:52 2012 (r231153) @@ -48,18 +48,12 @@ struct ichwd_softc { int smi_enabled; int smi_rid; struct resource *smi_res; - bus_space_tag_t smi_bst; - bus_space_handle_t smi_bsh; int tco_rid; struct resource *tco_res; - bus_space_tag_t tco_bst; - bus_space_handle_t tco_bsh; int gcs_rid; struct resource *gcs_res; - bus_space_tag_t gcs_bst; - bus_space_handle_t gcs_bsh; eventhandler_tag ev_tag; }; From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:41:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB221065672; Tue, 7 Feb 2012 19:41:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9988F8FC13; Tue, 7 Feb 2012 19:41: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 q17JfLax004503; Tue, 7 Feb 2012 19:41:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JfLmq004500; Tue, 7 Feb 2012 19:41:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071941.q17JfLmq004500@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:41: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: r231154 - stable/8/sys/dev/ichwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:41:21 -0000 Author: jhb Date: Tue Feb 7 19:41:21 2012 New Revision: 231154 URL: http://svn.freebsd.org/changeset/base/231154 Log: MFC 229598: Remove use of explicit bus space tags and handles and use methods that operate on resource objects instead. Modified: stable/8/sys/dev/ichwd/ichwd.c stable/8/sys/dev/ichwd/ichwd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/modules/sound/driver/emu10k1/ (props changed) stable/8/sys/modules/sound/driver/emu10kx/ (props changed) Modified: stable/8/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/8/sys/dev/ichwd/ichwd.c Tue Feb 7 19:40:52 2012 (r231153) +++ stable/8/sys/dev/ichwd/ichwd.c Tue Feb 7 19:41:21 2012 (r231154) @@ -198,26 +198,26 @@ static struct ichwd_device ichwd_devices static devclass_t ichwd_devclass; #define ichwd_read_tco_1(sc, off) \ - bus_space_read_1((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_1((sc)->tco_res, (off)) #define ichwd_read_tco_2(sc, off) \ - bus_space_read_2((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_2((sc)->tco_res, (off)) #define ichwd_read_tco_4(sc, off) \ - bus_space_read_4((sc)->tco_bst, (sc)->tco_bsh, (off)) + bus_read_4((sc)->tco_res, (off)) #define ichwd_read_smi_4(sc, off) \ - bus_space_read_4((sc)->smi_bst, (sc)->smi_bsh, (off)) + bus_read_4((sc)->smi_res, (off)) #define ichwd_read_gcs_4(sc, off) \ - bus_space_read_4((sc)->gcs_bst, (sc)->gcs_bsh, (off)) + bus_read_4((sc)->gcs_res, (off)) #define ichwd_write_tco_1(sc, off, val) \ - bus_space_write_1((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_1((sc)->tco_res, (off), (val)) #define ichwd_write_tco_2(sc, off, val) \ - bus_space_write_2((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_2((sc)->tco_res, (off), (val)) #define ichwd_write_tco_4(sc, off, val) \ - bus_space_write_4((sc)->tco_bst, (sc)->tco_bsh, (off), (val)) + bus_write_4((sc)->tco_res, (off), (val)) #define ichwd_write_smi_4(sc, off, val) \ - bus_space_write_4((sc)->smi_bst, (sc)->smi_bsh, (off), (val)) + bus_write_4((sc)->smi_res, (off), (val)) #define ichwd_write_gcs_4(sc, off, val) \ - bus_space_write_4((sc)->gcs_bst, (sc)->gcs_bsh, (off), (val)) + bus_write_4((sc)->gcs_res, (off), (val)) #define ichwd_verbose_printf(dev, ...) \ do { \ @@ -519,8 +519,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve SMI registers\n"); goto fail; } - sc->smi_bst = rman_get_bustag(sc->smi_res); - sc->smi_bsh = rman_get_bushandle(sc->smi_res); sc->tco_rid = 1; sc->tco_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->tco_rid, @@ -530,8 +528,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve TCO registers\n"); goto fail; } - sc->tco_bst = rman_get_bustag(sc->tco_res); - sc->tco_bsh = rman_get_bushandle(sc->tco_res); sc->gcs_rid = 0; if (sc->ich_version >= 6) { @@ -541,12 +537,6 @@ ichwd_attach(device_t dev) device_printf(dev, "unable to reserve GCS registers\n"); goto fail; } - sc->gcs_bst = rman_get_bustag(sc->gcs_res); - sc->gcs_bsh = rman_get_bushandle(sc->gcs_res); - } else { - sc->gcs_res = 0; - sc->gcs_bst = 0; - sc->gcs_bsh = 0; } if (ichwd_clear_noreboot(sc) != 0) Modified: stable/8/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/8/sys/dev/ichwd/ichwd.h Tue Feb 7 19:40:52 2012 (r231153) +++ stable/8/sys/dev/ichwd/ichwd.h Tue Feb 7 19:41:21 2012 (r231154) @@ -48,18 +48,12 @@ struct ichwd_softc { int smi_enabled; int smi_rid; struct resource *smi_res; - bus_space_tag_t smi_bst; - bus_space_handle_t smi_bsh; int tco_rid; struct resource *tco_res; - bus_space_tag_t tco_bst; - bus_space_handle_t tco_bsh; int gcs_rid; struct resource *gcs_res; - bus_space_tag_t gcs_bst; - bus_space_handle_t gcs_bsh; eventhandler_tag ev_tag; }; From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:45:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7938F106566B; Tue, 7 Feb 2012 19:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65B278FC08; Tue, 7 Feb 2012 19:45: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 q17JjG8e004679; Tue, 7 Feb 2012 19:45:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JjGcT004678; Tue, 7 Feb 2012 19:45:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071945.q17JjGcT004678@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:45: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: r231155 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/e1000 modules/sound/driver/emu10k1 modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:45:16 -0000 Author: jhb Date: Tue Feb 7 19:45:15 2012 New Revision: 231155 URL: http://svn.freebsd.org/changeset/base/231155 Log: Hoist mergeinfo for modules/sound/driver/* up to sys/. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/modules/sound/driver/emu10k1/ (props changed) stable/8/sys/modules/sound/driver/emu10kx/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:53:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1CC2106566C; Tue, 7 Feb 2012 19:53:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A682C8FC0C; Tue, 7 Feb 2012 19:53: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 q17Jr2Fm004951; Tue, 7 Feb 2012 19:53:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Jr2iZ004946; Tue, 7 Feb 2012 19:53:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071953.q17Jr2iZ004946@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:53:02 +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: r231156 - in stable/9/sys/dev: bxe qlxgb sfxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:53:03 -0000 Author: jhb Date: Tue Feb 7 19:53:02 2012 New Revision: 231156 URL: http://svn.freebsd.org/changeset/base/231156 Log: MFC 229613: Update recently added drivers to use the if_*addr_r*lock() wrapper functions instead of using the IF_ADDR_LOCK directly. The wrapper functions are the supported interface for device drivers. Modified: stable/9/sys/dev/bxe/if_bxe.c stable/9/sys/dev/qlxgb/qla_os.c stable/9/sys/dev/sfxge/sfxge_port.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/dev/bxe/if_bxe.c ============================================================================== --- stable/9/sys/dev/bxe/if_bxe.c Tue Feb 7 19:45:15 2012 (r231155) +++ stable/9/sys/dev/bxe/if_bxe.c Tue Feb 7 19:53:02 2012 (r231156) @@ -14115,7 +14115,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) i = 0; config = BXE_SP(sc, mcast_config); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -14144,7 +14144,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) config_table->cam_entry.lsb_mac_addr); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); old = config->hdr.length; @@ -14172,7 +14172,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) /* Accept one or more multicasts */ memset(mc_filter, 0, 4 * MC_HASH_SIZE); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -14184,7 +14184,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) bit &= 0x1f; mc_filter[regidx] |= (1 << bit); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < MC_HASH_SIZE; i++) REG_WR(sc, MC_HASH_OFFSET(sc, i), mc_filter[i]); Modified: stable/9/sys/dev/qlxgb/qla_os.c ============================================================================== --- stable/9/sys/dev/qlxgb/qla_os.c Tue Feb 7 19:45:15 2012 (r231155) +++ stable/9/sys/dev/qlxgb/qla_os.c Tue Feb 7 19:53:02 2012 (r231156) @@ -760,7 +760,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a int mcnt = 0; struct ifnet *ifp = ha->ifp; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -776,7 +776,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); qla_hw_set_multi(ha, mta, mcnt, add_multi); Modified: stable/9/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/9/sys/dev/sfxge/sfxge_port.c Tue Feb 7 19:45:15 2012 (r231155) +++ stable/9/sys/dev/sfxge/sfxge_port.c Tue Feb 7 19:53:02 2012 (r231156) @@ -301,7 +301,7 @@ sfxge_mac_filter_set_locked(struct sfxge * 0xff. */ bucket[0xff] = 1; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family == AF_LINK) { sa = (struct sockaddr_dl *)ifma->ifma_addr; @@ -309,7 +309,7 @@ sfxge_mac_filter_set_locked(struct sfxge bucket[index] = 1; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } return efx_mac_hash_set(enp, bucket); } @@ -391,10 +391,10 @@ sfxge_port_start(struct sfxge_softc *sc) goto fail2; /* Set the unicast address */ - IF_ADDR_LOCK(ifp); + if_addr_rlock(ifp); bcopy(LLADDR((struct sockaddr_dl *)ifp->if_addr->ifa_addr), mac_addr, sizeof(mac_addr)); - IF_ADDR_UNLOCK(ifp); + if_addr_runlock(ifp); if ((rc = efx_mac_addr_set(enp, mac_addr)) != 0) goto fail; From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:55:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A8DC106568C; Tue, 7 Feb 2012 19:55:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FEA28FC25; Tue, 7 Feb 2012 19:55:59 +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 q17JtwBh005100; Tue, 7 Feb 2012 19:55:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Jtwe5005098; Tue, 7 Feb 2012 19:55:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071955.q17Jtwe5005098@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:55: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: r231157 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:55:59 -0000 Author: jhb Date: Tue Feb 7 19:55:58 2012 New Revision: 231157 URL: http://svn.freebsd.org/changeset/base/231157 Log: MFC 229614: Add new variants of the IF_ADDR_*LOCK*() macros used for protecting interface address lists that distinguish read locks from write locks. To preserve the KPI, the previous operations are mapped to the write lock macros. The lock is still kept as a mutex for now. Modified: stable/9/sys/net/if_var.h 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/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Tue Feb 7 19:53:02 2012 (r231156) +++ stable/9/sys/net/if_var.h Tue Feb 7 19:55:58 2012 (r231157) @@ -248,9 +248,15 @@ typedef void if_init_f_t(void *); #define IF_ADDR_LOCK_INIT(if) mtx_init(&(if)->if_addr_mtx, \ "if_addr_mtx", NULL, MTX_DEF) #define IF_ADDR_LOCK_DESTROY(if) mtx_destroy(&(if)->if_addr_mtx) -#define IF_ADDR_LOCK(if) mtx_lock(&(if)->if_addr_mtx) -#define IF_ADDR_UNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_WLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_WUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_RLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_RUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) #define IF_ADDR_LOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +#define IF_ADDR_WLOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +/* XXX: Compat. */ +#define IF_ADDR_LOCK(if) IF_ADDR_WLOCK(if) +#define IF_ADDR_UNLOCK(if) IF_ADDR_WUNLOCK(if) /* * Function variations on locking macros intended to be used by loadable From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 19:56:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A5E1106567A; Tue, 7 Feb 2012 19:56:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38B158FC2F; Tue, 7 Feb 2012 19:56: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 q17JuNmn005153; Tue, 7 Feb 2012 19:56:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JuNaa005151; Tue, 7 Feb 2012 19:56:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071956.q17JuNaa005151@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231158 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:56:23 -0000 Author: jhb Date: Tue Feb 7 19:56:22 2012 New Revision: 231158 URL: http://svn.freebsd.org/changeset/base/231158 Log: MFC 229614: Add new variants of the IF_ADDR_*LOCK*() macros used for protecting interface address lists that distinguish read locks from write locks. To preserve the KPI, the previous operations are mapped to the write lock macros. The lock is still kept as a mutex for now. Modified: stable/8/sys/net/if_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Tue Feb 7 19:55:58 2012 (r231157) +++ stable/8/sys/net/if_var.h Tue Feb 7 19:56:22 2012 (r231158) @@ -249,9 +249,15 @@ typedef void if_init_f_t(void *); #define IF_ADDR_LOCK_INIT(if) mtx_init(&(if)->if_addr_mtx, \ "if_addr_mtx", NULL, MTX_DEF) #define IF_ADDR_LOCK_DESTROY(if) mtx_destroy(&(if)->if_addr_mtx) -#define IF_ADDR_LOCK(if) mtx_lock(&(if)->if_addr_mtx) -#define IF_ADDR_UNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_WLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_WUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_RLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_RUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) #define IF_ADDR_LOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +#define IF_ADDR_WLOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +/* XXX: Compat. */ +#define IF_ADDR_LOCK(if) IF_ADDR_WLOCK(if) +#define IF_ADDR_UNLOCK(if) IF_ADDR_WUNLOCK(if) /* * Function variations on locking macros intended to be used by loadable From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 20:03:01 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB7701065672; Tue, 7 Feb 2012 20:03:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8671A8FC13; Tue, 7 Feb 2012 20:03:00 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA25630; Tue, 07 Feb 2012 22:02:58 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RurFi-000OdD-Aw; Tue, 07 Feb 2012 22:02:58 +0200 Message-ID: <4F318370.4060500@FreeBSD.org> Date: Tue, 07 Feb 2012 22:02:56 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0) Gecko/20120202 Thunderbird/10.0 MIME-Version: 1.0 To: Martin Matuska References: <201202071835.q17IZIQe002063@svn.freebsd.org> In-Reply-To: <201202071835.q17IZIQe002063@svn.freebsd.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231144 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 20:03:01 -0000 on 07/02/2012 20:35 Martin Matuska said the following: > Author: mm > Date: Tue Feb 7 18:35:18 2012 > New Revision: 231144 > URL: http://svn.freebsd.org/changeset/base/231144 > > Log: > Merge illumos revision 13594: > > uninitialized variables in zfs(8) may make snapshots undestroyable [1] > > References: > https://www.illumos.org/issues/2067 [1] > > Obtained from: illumos (issue #2067) > MFC after: 3 days PR 164802 seems to be related. Could you please take over it? > Modified: > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 7 18:05:10 2012 (r231143) > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 7 18:35:18 2012 (r231144) > @@ -590,7 +590,7 @@ zfs_do_clone(int argc, char **argv) > zfs_handle_t *zhp = NULL; > boolean_t parents = B_FALSE; > nvlist_t *props; > - int ret; > + int ret = 0; > int c; > > if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) > @@ -1052,7 +1052,7 @@ destroy_print_cb(zfs_handle_t *zhp, void > static int > destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb) > { > - int err; > + int err = 0; > assert(cb->cb_firstsnap == NULL); > assert(cb->cb_prevsnap == NULL); > err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb); > @@ -1130,7 +1130,7 @@ destroy_clones(destroy_cbdata_t *cb) > ZFS_TYPE_SNAPSHOT); > if (zhp != NULL) { > boolean_t defer = cb->cb_defer_destroy; > - int err; > + int err = 0; > > /* > * We can't defer destroy non-snapshots, so set it to > @@ -1207,7 +1207,7 @@ zfs_do_destroy(int argc, char **argv) > > at = strchr(argv[0], '@'); > if (at != NULL) { > - int err; > + int err = 0; > > /* Build the list of snaps to destroy in cb_nvl. */ > if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) > @@ -1474,7 +1474,7 @@ zfs_do_get(int argc, char **argv) > zprop_get_cbdata_t cb = { 0 }; > int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; > char *value, *fields; > - int ret; > + int ret = 0; > int limit = 0; > zprop_list_t fake_name = { 0 }; > > @@ -1711,7 +1711,7 @@ zfs_do_inherit(int argc, char **argv) > zfs_prop_t prop; > inherit_cbdata_t cb = { 0 }; > char *propname; > - int ret; > + int ret = 0; > int flags = 0; > boolean_t received = B_FALSE; > > @@ -1917,7 +1917,7 @@ zfs_do_upgrade(int argc, char **argv) > { > boolean_t all = B_FALSE; > boolean_t showversions = B_FALSE; > - int ret; > + int ret = 0; > upgrade_cbdata_t cb = { 0 }; > char c; > int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; > @@ -2206,7 +2206,7 @@ userspace_cb(void *arg, const char *doma > uid_t id; > uint64_t classes; > #ifdef sun > - int err; > + int err = 0; > directory_error_t e; > #endif > > @@ -2562,7 +2562,7 @@ zfs_do_userspace(int argc, char **argv) > boolean_t prtnum = B_FALSE; > boolean_t parseable = B_FALSE; > boolean_t sid2posix = B_FALSE; > - int error; > + int error = 0; > int c; > zfs_sort_column_t *default_sortcol = NULL; > zfs_sort_column_t *sortcol = NULL; > @@ -2925,7 +2925,7 @@ zfs_do_list(int argc, char **argv) > list_cbdata_t cb = { 0 }; > char *value; > int limit = 0; > - int ret; > + int ret = 0; > zfs_sort_column_t *sortcol = NULL; > int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; > > @@ -3062,7 +3062,9 @@ zfs_do_rename(int argc, char **argv) > { > zfs_handle_t *zhp; > renameflags_t flags = { 0 }; > - int c, ret, types; > + int c; > + int ret = 0; > + int types; > boolean_t parents = B_FALSE; > > /* check options */ > @@ -3155,7 +3157,7 @@ static int > zfs_do_promote(int argc, char **argv) > { > zfs_handle_t *zhp; > - int ret; > + int ret = 0; > > /* check options */ > if (argc > 1 && argv[1][0] == '-') { > @@ -3276,7 +3278,7 @@ rollback_check(zfs_handle_t *zhp, void * > static int > zfs_do_rollback(int argc, char **argv) > { > - int ret; > + int ret = 0; > int c; > boolean_t force = B_FALSE; > rollback_cbdata_t cb = { 0 }; > @@ -3394,7 +3396,7 @@ static int > zfs_do_set(int argc, char **argv) > { > set_cbdata_t cb; > - int ret; > + int ret = 0; > > /* check for options */ > if (argc > 1 && argv[1][0] == '-') { > @@ -3448,7 +3450,7 @@ static int > zfs_do_snapshot(int argc, char **argv) > { > boolean_t recursive = B_FALSE; > - int ret; > + int ret = 0; > char c; > nvlist_t *props; > > @@ -5286,7 +5288,7 @@ zfs_do_holds(int argc, char **argv) > holds_cbdata_t cb = { 0 }; > > int limit = 0; > - int ret; > + int ret = 0; > int flags = 0; > > /* check options */ > @@ -5863,7 +5865,7 @@ static int > unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual) > { > zfs_handle_t *zhp; > - int ret; > + int ret = 0; > struct stat64 statbuf; > struct extmnttab entry; > const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount"; > @@ -6331,7 +6333,7 @@ manual_mount(int argc, char **argv) > zfs_handle_t *zhp; > char mountpoint[ZFS_MAXPROPLEN]; > char mntopts[MNT_LINE_MAX] = { '\0' }; > - int ret; > + int ret = 0; > int c; > int flags = 0; > char *dataset, *path; > @@ -6481,7 +6483,7 @@ zfs_do_diff(int argc, char **argv) > char *tosnap = NULL; > char *fromsnap = NULL; > char *atp, *copy; > - int err; > + int err = 0; > int c; > > while ((c = getopt(argc, argv, "FHt")) != -1) { > @@ -6551,7 +6553,7 @@ zfs_do_diff(int argc, char **argv) > int > main(int argc, char **argv) > { > - int ret; > + int ret = 0; > int i; > char *progname; > char *cmdname; -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 20:24:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9B96106566B; Tue, 7 Feb 2012 20:24:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 988408FC13; Tue, 7 Feb 2012 20:24: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 q17KOr4G006174; Tue, 7 Feb 2012 20:24:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17KOrLx006172; Tue, 7 Feb 2012 20:24:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202072024.q17KOrLx006172@svn.freebsd.org> From: Marius Strobl Date: Tue, 7 Feb 2012 20:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231159 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 20:24:53 -0000 Author: marius Date: Tue Feb 7 20:24:52 2012 New Revision: 231159 URL: http://svn.freebsd.org/changeset/base/231159 Log: Call bge_add_sysctls() early and especially before bge_can_use_msi() so r230337 actually has a chance of working and doesn't always unconditionally disable the use of MSIs. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Feb 7 19:56:22 2012 (r231158) +++ head/sys/dev/bge/if_bge.c Tue Feb 7 20:24:52 2012 (r231159) @@ -2786,6 +2786,8 @@ bge_attach(device_t dev) sc = device_get_softc(dev); sc->bge_dev = dev; + bge_add_sysctls(sc); + TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); /* @@ -3198,8 +3200,6 @@ bge_attach(device_t dev) goto fail; } - bge_add_sysctls(sc); - /* Set default tuneable values. */ sc->bge_stat_ticks = BGE_TICKS_PER_SEC; sc->bge_rx_coal_ticks = 150; From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 20:43:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9AEF1065680; Tue, 7 Feb 2012 20:43:28 +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 A815D8FC1C; Tue, 7 Feb 2012 20:43:28 +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 q17KhSQV006767; Tue, 7 Feb 2012 20:43:28 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17KhSJx006765; Tue, 7 Feb 2012 20:43:28 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201202072043.q17KhSJx006765@svn.freebsd.org> From: Kirk McKusick Date: Tue, 7 Feb 2012 20:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231160 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 20:43:28 -0000 Author: mckusick Date: Tue Feb 7 20:43:28 2012 New Revision: 231160 URL: http://svn.freebsd.org/changeset/base/231160 Log: In the original days of BSD, a sync was issued on every filesystem every 30 seconds. This spike in I/O caused the system to pause every 30 seconds which was quite annoying. So, the way that sync worked was changed so that when a vnode was first dirtied, it was put on a 30-second cleaning queue (see the syncer_workitem_pending queues in kern/vfs_subr.c). If the file has not been written or deleted after 30 seconds, the syncer pushes it out. As the syncer runs once per second, dirty files are trickled out slowly over the 30-second period instead of all at once by a call to sync(2). The one drawback to this is that it does not cover the filesystem metadata. To handle the metadata, vfs_allocate_syncvnode() is called to create a "filesystem syncer vnode" at mount time which cycles around the cleaning queue being sync'ed every 30 seconds. In the original design, the only things it would sync for UFS were the filesystem metadata: inode blocks, cylinder group bitmaps, and the superblock (e.g., by VOP_FSYNC'ing devvp, the device vnode from which the filesystem is mounted). Somewhere in its path to integration with FreeBSD the flushing of the filesystem syncer vnode got changed to sync every vnode associated with the filesystem. The result of this change is to return to the old filesystem-wide flush every 30-seconds behavior and makes the whole 30-second delay per vnode useless. This change goes back to the originally intended trickle out sync behavior. Key to ensuring that all the intended semantics are preserved (e.g., that all inode updates get flushed within a bounded period of time) is that all inode modifications get pushed to their corresponding inode blocks so that the metadata flush by the filesystem syncer vnode gets them to the disk in a timely way. Thanks to Konstantin Belousov (kib@) for doing the audit and commit -r231122 which ensures that all of these updates are being made. Reviewed by: kib Tested by: scottl MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Feb 7 20:24:52 2012 (r231159) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Feb 7 20:43:28 2012 (r231160) @@ -1436,17 +1436,26 @@ ffs_sync(mp, waitfor) int softdep_accdeps; struct bufobj *bo; + wait = 0; + suspend = 0; + suspended = 0; td = curthread; fs = ump->um_fs; if (fs->fs_fmod != 0 && fs->fs_ronly != 0 && ump->um_fsckpid == 0) panic("%s: ffs_sync: modification on read-only filesystem", fs->fs_fsmnt); /* + * For a lazy sync, we just care about the filesystem metadata. + */ + if (waitfor == MNT_LAZY) { + secondary_accwrites = 0; + secondary_writes = 0; + lockreq = 0; + goto metasync; + } + /* * Write back each (modified) inode. */ - wait = 0; - suspend = 0; - suspended = 0; lockreq = LK_EXCLUSIVE | LK_NOWAIT; if (waitfor == MNT_SUSPEND) { suspend = 1; @@ -1517,11 +1526,12 @@ loop: #ifdef QUOTA qsync(mp); #endif + +metasync: devvp = ump->um_devvp; bo = &devvp->v_bufobj; BO_LOCK(bo); - if (waitfor != MNT_LAZY && - (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0)) { + if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) { BO_UNLOCK(bo); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_FSYNC(devvp, waitfor, td)) != 0) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 20:54:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84967106564A; Tue, 7 Feb 2012 20:54:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72D958FC16; Tue, 7 Feb 2012 20:54: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 q17KsjPT007155; Tue, 7 Feb 2012 20:54:45 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17KsjCT007149; Tue, 7 Feb 2012 20:54:45 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202072054.q17KsjCT007149@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Feb 2012 20:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231161 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 20:54:45 -0000 Author: jkim Date: Tue Feb 7 20:54:44 2012 New Revision: 231161 URL: http://svn.freebsd.org/changeset/base/231161 Log: - Give all clocks and timers on acpi0 the equal probing order. - Increase probing order for ECDT table to match HID-based probing. - Decrease probing order for HPET table to match HID-based probing. - Decrease probing order for CPUs and system resources. - Fix ACPI_DEV_BASE_ORDER to reflect the reality. Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_ec.c head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_timer.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpi.c Tue Feb 7 20:54:44 2012 (r231161) @@ -1812,23 +1812,29 @@ acpi_probe_children(device_t bus) static void acpi_probe_order(ACPI_HANDLE handle, int *order) { - ACPI_OBJECT_TYPE type; + ACPI_OBJECT_TYPE type; - /* - * 1. CPUs - * 2. I/O port and memory system resource holders - * 3. Embedded controllers (to handle early accesses) - * 4. PCI Link Devices - */ - AcpiGetType(handle, &type); - if (type == ACPI_TYPE_PROCESSOR) - *order = 1; - else if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02")) - *order = 2; - else if (acpi_MatchHid(handle, "PNP0C09")) - *order = 3; - else if (acpi_MatchHid(handle, "PNP0C0F")) - *order = 4; + /* + * 0. CPUs + * 1. I/O port and memory system resource holders + * 2. Clocks and timers (to handle early accesses) + * 3. Embedded controllers (to handle early accesses) + * 4. PCI Link Devices + */ + AcpiGetType(handle, &type); + if (type == ACPI_TYPE_PROCESSOR) + *order = 0; + else if (acpi_MatchHid(handle, "PNP0C01") || + acpi_MatchHid(handle, "PNP0C02")) + *order = 1; + else if (acpi_MatchHid(handle, "PNP0100") || + acpi_MatchHid(handle, "PNP0103") || + acpi_MatchHid(handle, "PNP0B00")) + *order = 2; + else if (acpi_MatchHid(handle, "PNP0C09")) + *order = 3; + else if (acpi_MatchHid(handle, "PNP0C0F")) + *order = 4; } /* @@ -1889,7 +1895,7 @@ acpi_probe_child(ACPI_HANDLE handle, UIN * resources). */ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str)); - order = level * 10 + 100; + order = level * 10 + ACPI_DEV_BASE_ORDER; acpi_probe_order(handle, &order); child = BUS_ADD_CHILD(bus, order, NULL, -1); if (child == NULL) Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpi_ec.c Tue Feb 7 20:54:44 2012 (r231161) @@ -295,7 +295,7 @@ acpi_ec_ecdt_probe(device_t parent) } /* Create the child device with the given unit number. */ - child = BUS_ADD_CHILD(parent, 0, "acpi_ec", ecdt->Uid); + child = BUS_ADD_CHILD(parent, 3, "acpi_ec", ecdt->Uid); if (child == NULL) { printf("%s: can't add child\n", __func__); return; Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpi_hpet.c Tue Feb 7 20:54:44 2012 (r231161) @@ -342,7 +342,7 @@ hpet_identify(driver_t *driver, device_t if (found) continue; /* If not - create it from table info. */ - child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "hpet", 0); + child = BUS_ADD_CHILD(parent, 2, "hpet", 0); if (child == NULL) { printf("%s: can't add child\n", __func__); continue; Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpi_timer.c Tue Feb 7 20:54:44 2012 (r231161) @@ -124,7 +124,7 @@ acpi_timer_identify(driver_t *driver, de acpi_timer_dev) return_VOID; - if ((dev = BUS_ADD_CHILD(parent, 0, "acpi_timer", 0)) == NULL) { + if ((dev = BUS_ADD_CHILD(parent, 2, "acpi_timer", 0)) == NULL) { device_printf(parent, "could not add acpi_timer0\n"); return_VOID; } Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpivar.h Tue Feb 7 20:54:44 2012 (r231161) @@ -473,7 +473,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL * probe order sorted so that things like sysresource are available before * their children need them. */ -#define ACPI_DEV_BASE_ORDER 10 +#define ACPI_DEV_BASE_ORDER 100 /* Default maximum number of tasks to enqueue. */ #ifndef ACPI_MAX_TASKS From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 21:46:24 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D6B81065674; Tue, 7 Feb 2012 21:46:24 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:150:6101::4]) by mx1.freebsd.org (Postfix) with ESMTP id C94528FC17; Tue, 7 Feb 2012 21:46:23 +0000 (UTC) Received: from core2.vx.sk (localhost [127.0.0.2]) by mail.vx.sk (Postfix) with ESMTP id 013412115F; Tue, 7 Feb 2012 22:46:23 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by core2.vx.sk (amavisd-new, unix socket) with LMTP id m8vzJsWmxzWT; Tue, 7 Feb 2012 22:46:20 +0100 (CET) Received: from [10.9.8.1] (188-167-78-15.dynamic.chello.sk [188.167.78.15]) by mail.vx.sk (Postfix) with ESMTPSA id 416ED21159; Tue, 7 Feb 2012 22:46:20 +0100 (CET) Message-ID: <4F319BAB.30802@FreeBSD.org> Date: Tue, 07 Feb 2012 22:46:19 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120130 Thunderbird/10.0 MIME-Version: 1.0 To: Andriy Gapon References: <201202071835.q17IZIQe002063@svn.freebsd.org> <4F318370.4060500@FreeBSD.org> In-Reply-To: <4F318370.4060500@FreeBSD.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231144 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 21:46:24 -0000 Dňa 7.2.2012 21:02, Andriy Gapon wrote / napísal(a): > on 07/02/2012 20:35 Martin Matuska said the following: >> Author: mm >> Date: Tue Feb 7 18:35:18 2012 >> New Revision: 231144 >> URL: http://svn.freebsd.org/changeset/base/231144 >> >> Log: >> Merge illumos revision 13594: >> >> uninitialized variables in zfs(8) may make snapshots undestroyable [1] >> >> References: >> https://www.illumos.org/issues/2067 [1] >> >> Obtained from: illumos (issue #2067) >> MFC after: 3 days > > PR 164802 seems to be related. Could you please take over it? PR taken over, state changed to patched. Thanks. From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 21:56:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9065B106566C; Tue, 7 Feb 2012 21:56:59 +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 63DE08FC0C; Tue, 7 Feb 2012 21:56:59 +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 q17Lux50009058; Tue, 7 Feb 2012 21:56:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Lux75009056; Tue, 7 Feb 2012 21:56:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072156.q17Lux75009056@svn.freebsd.org> From: Xin LI Date: Tue, 7 Feb 2012 21:56:59 +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: r231162 - in stable: 8/sbin/newfs_msdos 9/sbin/newfs_msdos X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 21:56:59 -0000 Author: delphij Date: Tue Feb 7 21:56:58 2012 New Revision: 231162 URL: http://svn.freebsd.org/changeset/base/231162 Log: MFC r227454: Use __packed to prevent alignment from taking place, which otherwise may change the on-disk format in an incompatible way. Without this change, msdosfs created on FreeBSD/arm would not be mountable. PR: bin/162486 Submitted by: Ian Lepore Reported by: Mattia Rossi Modified: stable/9/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/9/sbin/newfs_msdos/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/8/sbin/newfs_msdos/ (props changed) Modified: stable/9/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/9/sbin/newfs_msdos/newfs_msdos.c Tue Feb 7 20:54:44 2012 (r231161) +++ stable/9/sbin/newfs_msdos/newfs_msdos.c Tue Feb 7 21:56:58 2012 (r231162) @@ -99,7 +99,7 @@ static const char rcsid[] = struct bs { u_int8_t bsJump[3]; /* bootstrap entry point */ u_int8_t bsOemName[8]; /* OEM name and version */ -}; +} __packed; struct bsbpb { u_int8_t bpbBytesPerSec[2]; /* bytes per sector */ @@ -114,7 +114,7 @@ struct bsbpb { u_int8_t bpbHeads[2]; /* drive heads */ u_int8_t bpbHiddenSecs[4]; /* hidden sectors */ u_int8_t bpbHugeSectors[4]; /* big total sectors */ -}; +} __packed; struct bsxbpb { u_int8_t bpbBigFATsecs[4]; /* big sectors per FAT */ @@ -124,7 +124,7 @@ struct bsxbpb { u_int8_t bpbFSInfo[2]; /* file system info sector */ u_int8_t bpbBackup[2]; /* backup boot sector */ u_int8_t bpbReserved[12]; /* reserved */ -}; +} __packed; struct bsx { u_int8_t exDriveNumber; /* drive number */ @@ -133,7 +133,7 @@ struct bsx { u_int8_t exVolumeID[4]; /* volume ID number */ u_int8_t exVolumeLabel[11]; /* volume label */ u_int8_t exFileSysType[8]; /* file system type */ -}; +} __packed; struct de { u_int8_t deName[11]; /* name and extension */ @@ -143,7 +143,7 @@ struct de { u_int8_t deMDate[2]; /* creation date */ u_int8_t deStartCluster[2]; /* starting cluster */ u_int8_t deFileSize[4]; /* size */ -}; +} __packed; struct bpb { u_int bpbBytesPerSec; /* bytes per sector */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 21:56:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61A71065670; Tue, 7 Feb 2012 21:56:59 +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 99A1D8FC12; Tue, 7 Feb 2012 21:56:59 +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 q17LuxuX009065; Tue, 7 Feb 2012 21:56:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Luxj2009063; Tue, 7 Feb 2012 21:56:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072156.q17Luxj2009063@svn.freebsd.org> From: Xin LI Date: Tue, 7 Feb 2012 21:56:59 +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: r231162 - in stable: 8/sbin/newfs_msdos 9/sbin/newfs_msdos X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 21:56:59 -0000 Author: delphij Date: Tue Feb 7 21:56:58 2012 New Revision: 231162 URL: http://svn.freebsd.org/changeset/base/231162 Log: MFC r227454: Use __packed to prevent alignment from taking place, which otherwise may change the on-disk format in an incompatible way. Without this change, msdosfs created on FreeBSD/arm would not be mountable. PR: bin/162486 Submitted by: Ian Lepore Reported by: Mattia Rossi Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/8/sbin/newfs_msdos/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/9/sbin/newfs_msdos/ (props changed) Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/8/sbin/newfs_msdos/newfs_msdos.c Tue Feb 7 20:54:44 2012 (r231161) +++ stable/8/sbin/newfs_msdos/newfs_msdos.c Tue Feb 7 21:56:58 2012 (r231162) @@ -99,7 +99,7 @@ static const char rcsid[] = struct bs { u_int8_t bsJump[3]; /* bootstrap entry point */ u_int8_t bsOemName[8]; /* OEM name and version */ -}; +} __packed; struct bsbpb { u_int8_t bpbBytesPerSec[2]; /* bytes per sector */ @@ -114,7 +114,7 @@ struct bsbpb { u_int8_t bpbHeads[2]; /* drive heads */ u_int8_t bpbHiddenSecs[4]; /* hidden sectors */ u_int8_t bpbHugeSectors[4]; /* big total sectors */ -}; +} __packed; struct bsxbpb { u_int8_t bpbBigFATsecs[4]; /* big sectors per FAT */ @@ -124,7 +124,7 @@ struct bsxbpb { u_int8_t bpbFSInfo[2]; /* file system info sector */ u_int8_t bpbBackup[2]; /* backup boot sector */ u_int8_t bpbReserved[12]; /* reserved */ -}; +} __packed; struct bsx { u_int8_t exDriveNumber; /* drive number */ @@ -133,7 +133,7 @@ struct bsx { u_int8_t exVolumeID[4]; /* volume ID number */ u_int8_t exVolumeLabel[11]; /* volume label */ u_int8_t exFileSysType[8]; /* file system type */ -}; +} __packed; struct de { u_int8_t deName[11]; /* name and extension */ @@ -143,7 +143,7 @@ struct de { u_int8_t deMDate[2]; /* creation date */ u_int8_t deStartCluster[2]; /* starting cluster */ u_int8_t deFileSize[4]; /* size */ -}; +} __packed; struct bpb { u_int bpbBytesPerSec; /* bytes per sector */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 22:13:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08FEF106566C; Tue, 7 Feb 2012 22:13:34 +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 EAFEF8FC15; Tue, 7 Feb 2012 22:13:33 +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 q17MDXCJ009681; Tue, 7 Feb 2012 22:13:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MDXh9009679; Tue, 7 Feb 2012 22:13:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072213.q17MDXh9009679@svn.freebsd.org> From: Xin LI Date: Tue, 7 Feb 2012 22:13:33 +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: r231164 - in stable: 8/usr.bin/newgrp 9/usr.bin/newgrp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:13:34 -0000 Author: delphij Date: Tue Feb 7 22:13:33 2012 New Revision: 231164 URL: http://svn.freebsd.org/changeset/base/231164 Log: MFC r226274,r226416: Fix the error message when setgid() failed. PR: bin/161509 Submitted by: Jeremy Huddleston Modified: stable/9/usr.bin/newgrp/newgrp.c Directory Properties: stable/9/usr.bin/newgrp/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.bin/newgrp/newgrp.c Directory Properties: stable/8/usr.bin/newgrp/ (props changed) Modified: stable/9/usr.bin/newgrp/newgrp.c ============================================================================== --- stable/9/usr.bin/newgrp/newgrp.c Tue Feb 7 22:13:24 2012 (r231163) +++ stable/9/usr.bin/newgrp/newgrp.c Tue Feb 7 22:13:33 2012 (r231164) @@ -140,7 +140,7 @@ restoregrps(void) if (initres < 0) warn("initgroups"); if (setres < 0) - warn("setgroups"); + warn("setgid"); } static void From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 22:13:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D9461065670; Tue, 7 Feb 2012 22:13:34 +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 2BA8C8FC16; Tue, 7 Feb 2012 22:13:34 +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 q17MDYuh009687; Tue, 7 Feb 2012 22:13:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MDXHL009685; Tue, 7 Feb 2012 22:13:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072213.q17MDXHL009685@svn.freebsd.org> From: Xin LI Date: Tue, 7 Feb 2012 22:13:33 +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: r231164 - in stable: 8/usr.bin/newgrp 9/usr.bin/newgrp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:13:34 -0000 Author: delphij Date: Tue Feb 7 22:13:33 2012 New Revision: 231164 URL: http://svn.freebsd.org/changeset/base/231164 Log: MFC r226274,r226416: Fix the error message when setgid() failed. PR: bin/161509 Submitted by: Jeremy Huddleston Modified: stable/8/usr.bin/newgrp/newgrp.c Directory Properties: stable/8/usr.bin/newgrp/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.bin/newgrp/newgrp.c Directory Properties: stable/9/usr.bin/newgrp/ (props changed) Modified: stable/8/usr.bin/newgrp/newgrp.c ============================================================================== --- stable/8/usr.bin/newgrp/newgrp.c Tue Feb 7 22:13:24 2012 (r231163) +++ stable/8/usr.bin/newgrp/newgrp.c Tue Feb 7 22:13:33 2012 (r231164) @@ -140,7 +140,7 @@ restoregrps(void) if (initres < 0) warn("initgroups"); if (setres < 0) - warn("setgroups"); + warn("setgid"); } static void From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 22:13:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A409C106579D; Tue, 7 Feb 2012 22:13:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 507BB8FC18; Tue, 7 Feb 2012 22:13:39 +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 q17MDdUH009726; Tue, 7 Feb 2012 22:13:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MDdb5009724; Tue, 7 Feb 2012 22:13:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202072213.q17MDdb5009724@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 22:13:39 +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: r231165 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:13:41 -0000 Author: jhb Date: Tue Feb 7 22:13:38 2012 New Revision: 231165 URL: http://svn.freebsd.org/changeset/base/231165 Log: MFC 229465: Use correct locking when traversing interface address list. 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 Tue Feb 7 22:13:33 2012 (r231164) +++ stable/9/sys/netinet6/in6.c Tue Feb 7 22:13:38 2012 (r231165) @@ -2211,9 +2211,7 @@ in6_ifawithifp(struct ifnet *ifp, struct IF_ADDR_UNLOCK(ifp); return (besta); } - IF_ADDR_UNLOCK(ifp); - IN6_IFADDR_RLOCK(); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET6) continue; @@ -2231,10 +2229,10 @@ in6_ifawithifp(struct ifnet *ifp, struct if (ifa != NULL) ifa_ref(ifa); - IN6_IFADDR_RUNLOCK(); + IF_ADDR_UNLOCK(ifp); return (struct in6_ifaddr *)ifa; } - IN6_IFADDR_RUNLOCK(); + IF_ADDR_UNLOCK(ifp); /* use the last-resort values, that are, deprecated addresses */ if (dep[0]) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 22:13:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD815106566C; Tue, 7 Feb 2012 22:13:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC2418FC13; Tue, 7 Feb 2012 22:13:54 +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 q17MDsfH009767; Tue, 7 Feb 2012 22:13:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MDsql009765; Tue, 7 Feb 2012 22:13:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202072213.q17MDsql009765@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 22:13:54 +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: r231166 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:13:54 -0000 Author: jhb Date: Tue Feb 7 22:13:54 2012 New Revision: 231166 URL: http://svn.freebsd.org/changeset/base/231166 Log: MFC 229465: Use correct locking when traversing interface address list. 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) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Tue Feb 7 22:13:38 2012 (r231165) +++ stable/8/sys/netinet6/in6.c Tue Feb 7 22:13:54 2012 (r231166) @@ -2128,9 +2128,7 @@ in6_ifawithifp(struct ifnet *ifp, struct IF_ADDR_UNLOCK(ifp); return (besta); } - IF_ADDR_UNLOCK(ifp); - IN6_IFADDR_RLOCK(); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET6) continue; @@ -2148,10 +2146,10 @@ in6_ifawithifp(struct ifnet *ifp, struct if (ifa != NULL) ifa_ref(ifa); - IN6_IFADDR_RUNLOCK(); + IF_ADDR_UNLOCK(ifp); return (struct in6_ifaddr *)ifa; } - IN6_IFADDR_RUNLOCK(); + IF_ADDR_UNLOCK(ifp); /* use the last-resort values, that are, deprecated addresses */ if (dep[0]) From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 22:31:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44762106564A; Tue, 7 Feb 2012 22:31:17 +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 3285D8FC12; Tue, 7 Feb 2012 22:31: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 q17MVHJh010418; Tue, 7 Feb 2012 22:31:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MVHd5010416; Tue, 7 Feb 2012 22:31:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202072231.q17MVHd5010416@svn.freebsd.org> From: Xin LI Date: Tue, 7 Feb 2012 22:31: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: r231167 - stable/8/contrib/smbfs/mount_smbfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:31:17 -0000 Author: delphij Date: Tue Feb 7 22:31:16 2012 New Revision: 231167 URL: http://svn.freebsd.org/changeset/base/231167 Log: MFC r225643,225644: Change the example of using smbfs in fstab to a password-less one, which is less likely to block a remote system from boot. Submitted by: Garrett Cooper PR: doc/160775 Modified: stable/8/contrib/smbfs/mount_smbfs/mount_smbfs.8 Directory Properties: stable/8/contrib/smbfs/ (props changed) Modified: stable/8/contrib/smbfs/mount_smbfs/mount_smbfs.8 ============================================================================== --- stable/8/contrib/smbfs/mount_smbfs/mount_smbfs.8 Tue Feb 7 22:13:54 2012 (r231166) +++ stable/8/contrib/smbfs/mount_smbfs/mount_smbfs.8 Tue Feb 7 22:31:16 2012 (r231167) @@ -1,6 +1,6 @@ .\" $Id: mount_smbfs.8,v 1.10 2002/04/16 02:47:41 bp Exp $ .\" $FreeBSD$ -.Dd January 21, 2008 +.Dd September 17, 2011 .Dt MOUNT_SMBFS 8 .Os .Sh NAME @@ -157,11 +157,11 @@ mount_smbfs -I samba.mydomain.com //gues mount_smbfs -I 192.168.20.3 -E koi8-r:cp866 //guest@samba/tmp /smb/tmp .Ed .Pp -It is possible to use +It is also possible to use .Xr fstab 5 -for smbfs mounts: +for smbfs mounts (the example below doesn't prompt for a password): .Pp -.Dl "//guest@samba/public /smb/public smbfs rw,noauto 0 0" +.Dl "//guest@samba/public /smb/public smbfs rw,noauto,-N 0 0" .Sh AUTHORS .An Boris Popov Aq bp@butya.kz , .Aq bp@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 22:31:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 048C9106564A; Tue, 7 Feb 2012 22:31:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E79DC8FC1A; Tue, 7 Feb 2012 22:31:28 +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 q17MVSlK010459; Tue, 7 Feb 2012 22:31:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MVSc6010455; Tue, 7 Feb 2012 22:31:28 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202072231.q17MVSc6010455@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 7 Feb 2012 22:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231168 - head/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:31:29 -0000 Author: pfg Date: Tue Feb 7 22:31:28 2012 New Revision: 231168 URL: http://svn.freebsd.org/changeset/base/231168 Log: Update the data structures with some fields reserved for ext4 but that can be used in ext3 mode. Also adjust the internal inode to carry the birthtime, like in UFS, which is starting to get some use when big inodes are available. Right now these are just placeholders for features to come. Approved by: jhb (mentor) MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Tue Feb 7 22:31:16 2012 (r231167) +++ head/sys/fs/ext2fs/ext2_dinode.h Tue Feb 7 22:31:28 2012 (r231168) @@ -70,7 +70,7 @@ struct ext2fs_dinode { uint16_t e2di_uid; /* 2: Owner UID */ uint32_t e2di_size; /* 4: Size (in bytes) */ uint32_t e2di_atime; /* 8: Access time */ - uint32_t e2di_ctime; /* 12: Create time */ + uint32_t e2di_ctime; /* 12: Change time */ uint32_t e2di_mtime; /* 16: Modification time */ uint32_t e2di_dtime; /* 20: Deletion time */ uint16_t e2di_gid; /* 24: Owner GID */ @@ -89,6 +89,8 @@ struct ext2fs_dinode { uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ uint32_t e2di_linux_reserved3; /* 124 */ + uint16_t e2di_extra_isize; + uint16_t e2di_pad1; }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Tue Feb 7 22:31:16 2012 (r231167) +++ head/sys/fs/ext2fs/ext2fs.h Tue Feb 7 22:31:28 2012 (r231168) @@ -123,7 +123,22 @@ struct ext2fs { char e3fs_reserved_char_pad; uint32_t e3fs_default_mount_opts; uint32_t e3fs_first_meta_bg; /* First metablock block group */ - uint32_t reserved2[190]; /* Padding to the end of the block */ + uint32_t e3fs_mkfs_time; /* when the fs was created */ + uint32_t e3fs_jnl_blks[17]; /* backup of the journal inode */ + uint32_t e4fs_bcount_hi; /* block count */ + uint32_t e4fs_rbcount_hi; /* reserved blocks count */ + uint32_t e4fs_fbcount_hi; /* free blocks count */ + uint16_t e4fs_min_extra_isize;/* all inodes have at least some bytes */ + uint16_t e4fs_want_extra_isize; /* new inodes should reserve some bytes */ + uint32_t e4fs_flags; /* miscellaneous flags */ + uint16_t e4fs_raid_stride; /* RAID stride */ + uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ + uint64_t e4fs_mmpblk; /* block for multi-mount protection */ + uint32_t e4fs_raid_stripe_wid;/* blocks on all data disks (N * stride) */ + uint8_t e4fs_log_gpf; /* FLEX_BG group size */ + uint8_t e4fs_char_pad2; + uint16_t e4fs_pad; + uint32_t reserved2[162]; /* Padding to the end of the block */ }; @@ -139,15 +154,15 @@ struct m_ext2fs { uint32_t e2fs_bsize; /* Block size */ uint32_t e2fs_bshift; /* calc of logical block no */ int32_t e2fs_bmask; /* calc of block offset */ - int32_t e2fs_bpg; /* Number of blocks per group */ + int32_t e2fs_bpg; /* Number of blocks per group */ int64_t e2fs_qbmask; /* = s_blocksize -1 */ uint32_t e2fs_fsbtodb; /* Shift to get disk block */ - uint32_t e2fs_ipg; /* Number of inodes per group */ - uint32_t e2fs_ipb; /* Number of inodes per block */ + uint32_t e2fs_ipg; /* Number of inodes per group */ + uint32_t e2fs_ipb; /* Number of inodes per block */ uint32_t e2fs_itpg; /* Number of inode table per group */ uint32_t e2fs_fsize; /* Size of fragments per block */ - uint32_t e2fs_fpb; /* Number of fragments per block */ - uint32_t e2fs_fpg; /* Number of fragments per group */ + uint32_t e2fs_fpb; /* Number of fragments per block */ + uint32_t e2fs_fpg; /* Number of fragments per group */ uint32_t e2fs_dbpg; /* Number of descriptor blocks per group */ uint32_t e2fs_descpb; /* Number of group descriptors per block */ uint32_t e2fs_gdbcount; /* Number of group descriptors */ @@ -161,7 +176,7 @@ struct m_ext2fs { char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ - int32_t e2fs_maxcontig; /* max number of contiguous blks */ + int32_t e2fs_maxcontig; /* max number of contiguous blks */ int32_t e2fs_contigsumsize; /* size of cluster summary array */ int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Tue Feb 7 22:31:16 2012 (r231167) +++ head/sys/fs/ext2fs/inode.h Tue Feb 7 22:31:28 2012 (r231168) @@ -85,11 +85,13 @@ struct inode { int16_t i_nlink; /* File link count. */ uint64_t i_size; /* File byte count. */ int32_t i_atime; /* Last access time. */ - int32_t i_atimensec; /* Last access time. */ int32_t i_mtime; /* Last modified time. */ - int32_t i_mtimensec; /* Last modified time. */ int32_t i_ctime; /* Last inode change time. */ + int32_t i_birthtime; /* Inode creation time. */ + int32_t i_mtimensec; /* Last modified time. */ + int32_t i_atimensec; /* Last access time. */ int32_t i_ctimensec; /* Last inode change time. */ + int32_t i_birthnsec; /* Inode creation time. */ int32_t i_db[NDADDR]; /* Direct disk blocks. */ int32_t i_ib[NIADDR]; /* Indirect disk blocks. */ uint32_t i_flags; /* Status flags (chflags). */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 23:24:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4200A1065687; Tue, 7 Feb 2012 23:24:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3151E8FC0C; Tue, 7 Feb 2012 23:24: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 q17NOUeE012128; Tue, 7 Feb 2012 23:24:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17NOT0i012126; Tue, 7 Feb 2012 23:24:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202072324.q17NOT0i012126@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Feb 2012 23:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231169 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 23:24:30 -0000 Author: jkim Date: Tue Feb 7 23:24:29 2012 New Revision: 231169 URL: http://svn.freebsd.org/changeset/base/231169 Log: Do not EOI local APIC too early. Just do doreti normally after resuming. Modified: head/sys/amd64/amd64/apic_vector.S Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Tue Feb 7 22:31:28 2012 (r231168) +++ head/sys/amd64/amd64/apic_vector.S Tue Feb 7 23:24:29 2012 (r231169) @@ -300,13 +300,10 @@ IDTVEC(cpustop) IDTVEC(cpususpend) PUSH_FRAME + call cpususpend_handler movq lapic, %rax movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ - - call cpususpend_handler - - POP_FRAME - jmp doreti_iret + jmp doreti /* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. From owner-svn-src-all@FreeBSD.ORG Tue Feb 7 23:43:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A0551065672; Tue, 7 Feb 2012 23:43:30 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D9788FC0A; Tue, 7 Feb 2012 23:43: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 q17NhUvd012705; Tue, 7 Feb 2012 23:43:30 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17NhUpY012703; Tue, 7 Feb 2012 23:43:30 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202072343.q17NhUpY012703@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 7 Feb 2012 23:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231170 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 23:43:30 -0000 Author: ken Date: Tue Feb 7 23:43:29 2012 New Revision: 231170 URL: http://svn.freebsd.org/changeset/base/231170 Log: Update the mps(4) man page for the changes in the new LSI-supported driver. This should have been included in change 230592. The supported hardware section still needs some updating to reflect the current reality. MFC after: 3 days Modified: head/share/man/man4/mps.4 Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Tue Feb 7 23:24:29 2012 (r231169) +++ head/share/man/man4/mps.4 Tue Feb 7 23:43:29 2012 (r231170) @@ -31,10 +31,10 @@ .\" .\" Author: Ken Merry .\" -.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#4 $ +.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd September 13, 2010 +.Dd February 7, 2012 .Dt MPS 4 .Os .Sh NAME @@ -58,7 +58,7 @@ The .Nm driver provides support for LSI Logic Fusion-MPT 2 .Tn SAS -controllers. +controllers and WarpDrive solid state storage cards. .Sh HARDWARE The .Nm @@ -90,6 +90,16 @@ driver instances, set the following tuna hw.mps.disable_msi=1 .Ed .Pp +To disable MSI interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.disable_msi=1 +.Ed +.Pp +where X is the adapter number. +.Pp To disable MSI-X interrupts for all .Nm driver instances, set the following tunable value in @@ -98,19 +108,51 @@ driver instances, set the following tuna hw.mps.disable_msix=1 .Ed .Pp -To allow the driver to send multiple task management commands (like abort, -LUN reset, etc.), set the following variable: +To disable MSI-X interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : .Bd -literal -offset indent -hw.mps.X.allow_multiple_tm_cmds=1 +dev.mps.X.disable_msix=1 .Ed .Pp -via -.Xr loader.conf 5 -or -.Xr sysctl 8 , -where X is the adapter number. -By default the driver only sends one task management command at a time, to -avoid causing a potential controller lock-up. +To set the maximum number of DMA chains allocated for all adapters, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mps.max_chains=NNNN +.Ed +.Pp +To set the maximum number of DMA chains allocated for a specific adapter, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.max_chains=NNNN +.Ed +.Pp +This variable may also be viewed via +.Xr sysctl 8 +to see the maximum set for a given adapter. +.Pp +The current number of free chain frames may be seen via the +dev.mps.X.chain_free +.Xr sysctl 8 +variable. +.Pp +The lowest number of free chain frames may be seen via the +dev.mps.X.chain_free_lowwater +.Xr sysctl 8 +variable. +.Pp +The current number of active I/O commands is shown in the +dev.mps.X.io_cmds_active +.Xr sysctl 8 +variable. +.Pp +The maximum number of active I/O command seen since boot is shown in the +dev.mps.X.io_cmds_highwater +.Xr sysctl 8 +variable. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -142,7 +184,9 @@ Enable prints for controller events. .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , -.Xr targ 4 +.Xr targ 4 , +.Xr loader.conf 5 , +.Xr sysctl 8 .Sh HISTORY The .Nm @@ -154,20 +198,19 @@ The .Nm driver was originally written by .An Scott Long Aq scottl@FreeBSD.org . +It has been improved and tested by LSI Logic Corporation. This man page was written by .An Ken Merry Aq ken@FreeBSD.org . .Sh BUGS -This driver is still in development, it has only been tested on the amd64 -architecture and has some known shortcomings: +This driver has a couple of known shortcomings: .Bl -bullet -compact .It -No IR (Integrated RAID) support. +Not endian safe. +It only works on little endian machines (e.g. amd64 and i386). .It -No userland utility support (e.g. -.Xr mptutil 8). -.It -Sometimes the driver gets into a state where devices arrive and depart multiple -times, without user intervention. +No userland utility available (e.g. +.Xr mptutil 8) .It -The error recovery code isn't complete. +The driver probes devices sequentially. +If your system has a large number of devices, the probe will take a while. .El From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 00:08:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15D96106567E; Wed, 8 Feb 2012 00:08:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9502C8FC0A; Wed, 8 Feb 2012 00:08: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 q1808LMM013497; Wed, 8 Feb 2012 00:08:21 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1808LlN013493; Wed, 8 Feb 2012 00:08:21 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201202080008.q1808LlN013493@svn.freebsd.org> From: Glen Barber Date: Wed, 8 Feb 2012 00:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231171 - in head: etc/defaults etc/periodic/daily share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 00:08:22 -0000 Author: gjb (doc committer) Date: Wed Feb 8 00:08:21 2012 New Revision: 231171 URL: http://svn.freebsd.org/changeset/base/231171 Log: Add an option to 404.status-zfs (enabled by default) to list all zfs pools on the system. While here, document daily_status_zfs_enable in periodic.conf(5). Discussed on: -fs [1] Reviewed by: netchild [1] Approved by: jhb MFC after: 1 week [1] - http://lists.freebsd.org/pipermail/freebsd-fs/2011-June/011869.html Modified: head/etc/defaults/periodic.conf head/etc/periodic/daily/404.status-zfs head/share/man/man5/periodic.conf.5 Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Tue Feb 7 23:43:29 2012 (r231170) +++ head/etc/defaults/periodic.conf Wed Feb 8 00:08:21 2012 (r231171) @@ -96,6 +96,7 @@ daily_status_disks_df_flags="-l -h" # d # 404.status-zfs daily_status_zfs_enable="NO" # Check ZFS +daily_status_zfs_zpool_list_enable="YES" # List ZFS pools # 405.status-ata_raid daily_status_ata_raid_enable="NO" # Check ATA raid status Modified: head/etc/periodic/daily/404.status-zfs ============================================================================== --- head/etc/periodic/daily/404.status-zfs Tue Feb 7 23:43:29 2012 (r231170) +++ head/etc/periodic/daily/404.status-zfs Wed Feb 8 00:08:21 2012 (r231171) @@ -16,12 +16,21 @@ case "$daily_status_zfs_enable" in echo echo 'Checking status of zfs pools:' - out=`zpool status -x` - echo "$out" + case "$daily_status_zfs_zpool_list_enable" in + [Yy][Ee][Ss]) + lout=`zpool list` + echo "$lout" + echo + ;; + *) + ;; + esac + sout=`zpool status -x` + echo "$sout" # zpool status -x always exits with 0, so we have to interpret its # output to see what's going on. - if [ "$out" = "all pools are healthy" \ - -o "$out" = "no pools available" ]; then + if [ "$sout" = "all pools are healthy" \ + -o "$sout" = "no pools available" ]; then rc=0 else rc=1 Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Tue Feb 7 23:43:29 2012 (r231170) +++ head/share/man/man5/periodic.conf.5 Wed Feb 8 00:08:21 2012 (r231171) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2011 +.Dd February 7, 2012 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -335,6 +335,28 @@ utility when .Va daily_status_disks_enable is set to .Dq Li YES . +.It Va daily_status_zfs_enable +.Pq Vt bool +Set to +.Dq Li YES +if you want to run +.Nm zpool Cm status +on your +.Xr zfs 8 +pools. +.It Va daily_status_zfs_zpool_list_enable +.Pq Vt bool +Set to +.Dq Li YES +if you want to run +.Nm zpool Cm list +on your +.Xr zfs 8 +pools. +Requires +.Va daily_status_zfs_enable +to be set to +.Li YES . .It Va daily_status_ata_raid_enable .Pq Vt bool Set to From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 00:36:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFFBC106567B; Wed, 8 Feb 2012 00:36:36 +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 C4F618FC14; Wed, 8 Feb 2012 00:36:36 +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 q180aaX1014446; Wed, 8 Feb 2012 00:36:36 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q180aale014444; Wed, 8 Feb 2012 00:36:36 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202080036.q180aale014444@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 8 Feb 2012 00:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231172 - head/sys/dev/cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 00:36:37 -0000 Author: np Date: Wed Feb 8 00:36:36 2012 New Revision: 231172 URL: http://svn.freebsd.org/changeset/base/231172 Log: Program the MAC exact match table in batches of 7 addresses at a time when possible. This is more efficient than one at a time. Submitted by: gnn MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Feb 8 00:08:21 2012 (r231171) +++ head/sys/dev/cxgbe/t4_main.c Wed Feb 8 00:36:36 2012 (r231172) @@ -2013,6 +2013,8 @@ build_medialist(struct port_info *pi) PORT_UNLOCK(pi); } +#define FW_MAC_EXACT_CHUNK 7 + /* * Program the port's XGMAC based on parameters in ifnet. The caller also * indicates which parameters should be programmed (the rest are left alone). @@ -2064,28 +2066,57 @@ update_mac_settings(struct port_info *pi } if (flags & XGMAC_MCADDRS) { - const uint8_t *mcaddr; + const uint8_t *mcaddr[FW_MAC_EXACT_CHUNK]; int del = 1; uint64_t hash = 0; struct ifmultiaddr *ifma; + int i = 0, j; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) + if (ifma->ifma_addr->sa_family == AF_LINK) continue; - mcaddr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); + mcaddr[i++] = + LLADDR((struct sockaddr_dl *)ifma->ifma_addr); - rc = t4_alloc_mac_filt(sc, sc->mbox, pi->viid, del, 1, - &mcaddr, NULL, &hash, 0); + if (i == FW_MAC_EXACT_CHUNK) { + rc = t4_alloc_mac_filt(sc, sc->mbox, pi->viid, + del, i, mcaddr, NULL, &hash, 0); + if (rc < 0) { + rc = -rc; + for (j = 0; j < i; j++) { + if_printf(ifp, + "failed to add mc address" + " %02x:%02x:%02x:" + "%02x:%02x:%02x rc=%d\n", + mcaddr[j][0], mcaddr[j][1], + mcaddr[j][2], mcaddr[j][3], + mcaddr[j][4], mcaddr[j][5], + rc); + } + goto mcfail; + } + del = 0; + i = 0; + } + } + if (i > 0) { + rc = t4_alloc_mac_filt(sc, sc->mbox, pi->viid, + del, i, mcaddr, NULL, &hash, 0); if (rc < 0) { rc = -rc; - if_printf(ifp, "failed to add mc address" - " %02x:%02x:%02x:%02x:%02x:%02x rc=%d\n", - mcaddr[0], mcaddr[1], mcaddr[2], mcaddr[3], - mcaddr[4], mcaddr[5], rc); + for (j = 0; j < i; j++) { + if_printf(ifp, + "failed to add mc address" + " %02x:%02x:%02x:" + "%02x:%02x:%02x rc=%d\n", + mcaddr[j][0], mcaddr[j][1], + mcaddr[j][2], mcaddr[j][3], + mcaddr[j][4], mcaddr[j][5], + rc); + } goto mcfail; } - del = 0; } rc = -t4_set_addr_hash(sc, sc->mbox, pi->viid, 0, hash, 0); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 03:02:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F15CB106571E; Wed, 8 Feb 2012 03:02:12 +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 DCCEC8FC0A; Wed, 8 Feb 2012 03:02: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 q1832CoR019078; Wed, 8 Feb 2012 03:02:12 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1832CGE019076; Wed, 8 Feb 2012 03:02:12 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202080302.q1832CGE019076@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 8 Feb 2012 03:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231175 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 03:02:13 -0000 Author: np Date: Wed Feb 8 03:02:12 2012 New Revision: 231175 URL: http://svn.freebsd.org/changeset/base/231175 Log: Allocate the BAR for userspace doorbells after the is_offload check is functional. MFC after: 3 days Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Wed Feb 8 02:15:59 2012 (r231174) +++ head/sys/dev/cxgb/cxgb_main.c Wed Feb 8 03:02:12 2012 (r231175) @@ -473,15 +473,6 @@ cxgb_controller_attach(device_t dev) device_printf(dev, "Cannot allocate BAR region 0\n"); return (ENXIO); } - sc->udbs_rid = PCIR_BAR(2); - sc->udbs_res = NULL; - if (is_offload(sc) && - ((sc->udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->udbs_rid, RF_ACTIVE)) == NULL)) { - device_printf(dev, "Cannot allocate BAR region 1\n"); - error = ENXIO; - goto out; - } snprintf(sc->lockbuf, ADAPTER_LOCK_NAME_LEN, "cxgb controller lock %d", device_get_unit(dev)); @@ -510,6 +501,17 @@ cxgb_controller_attach(device_t dev) error = ENODEV; goto out; } + + sc->udbs_rid = PCIR_BAR(2); + sc->udbs_res = NULL; + if (is_offload(sc) && + ((sc->udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->udbs_rid, RF_ACTIVE)) == NULL)) { + device_printf(dev, "Cannot allocate BAR region 1\n"); + error = ENXIO; + goto out; + } + /* Allocate the BAR for doing MSI-X. If it succeeds, try to allocate * enough messages for the queue sets. If that fails, try falling * back to MSI. If that fails, then try falling back to the legacy From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 04:05:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9540E1065713; Wed, 8 Feb 2012 04:05:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 800558FC15; Wed, 8 Feb 2012 04:05:38 +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 q1845c7J021232; Wed, 8 Feb 2012 04:05:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1845cMe021230; Wed, 8 Feb 2012 04:05:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201202080405.q1845cMe021230@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 8 Feb 2012 04:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231177 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 04:05:38 -0000 Author: marcel Date: Wed Feb 8 04:05:38 2012 New Revision: 231177 URL: http://svn.freebsd.org/changeset/base/231177 Log: Rev. 228360 moved the call to cpu_set_upcall() to happen before td_proc gets initialized in td (=newtd). Use td0 instead. MFC after: 3 days Modified: head/sys/ia64/ia64/vm_machdep.c Modified: head/sys/ia64/ia64/vm_machdep.c ============================================================================== --- head/sys/ia64/ia64/vm_machdep.c Wed Feb 8 03:16:29 2012 (r231176) +++ head/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:05:38 2012 (r231177) @@ -192,7 +192,7 @@ cpu_set_upcall(struct thread *td, struct bcopy(td0->td_pcb, pcb, sizeof(*pcb)); pcb->pcb_special.bspstore = td->td_kstack; pcb->pcb_special.pfs = 0; - pcb->pcb_current_pmap = vmspace_pmap(td->td_proc->p_vmspace); + pcb->pcb_current_pmap = vmspace_pmap(td0->td_proc->p_vmspace); pcb->pcb_special.sp = (uintptr_t)tf - 16; pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline); cpu_set_fork_handler(td, (void (*)(void*))fork_return, td); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 04:40:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2944D1065705; Wed, 8 Feb 2012 04:40:15 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12E5A8FC18; Wed, 8 Feb 2012 04:40: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 q184eExu022416; Wed, 8 Feb 2012 04:40:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q184eEmO022414; Wed, 8 Feb 2012 04:40:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201202080440.q184eEmO022414@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 8 Feb 2012 04:40:14 +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: r231178 - stable/9/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 04:40:15 -0000 Author: marcel Date: Wed Feb 8 04:40:14 2012 New Revision: 231178 URL: http://svn.freebsd.org/changeset/base/231178 Log: MFC r231177: Rev. 228360 moved the call to cpu_set_upcall() to happen before td_proc gets initialized in td (=newtd). Use td0 instead. Modified: stable/9/sys/ia64/ia64/vm_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/ia64/ia64/vm_machdep.c ============================================================================== --- stable/9/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:05:38 2012 (r231177) +++ stable/9/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:40:14 2012 (r231178) @@ -192,7 +192,7 @@ cpu_set_upcall(struct thread *td, struct bcopy(td0->td_pcb, pcb, sizeof(*pcb)); pcb->pcb_special.bspstore = td->td_kstack; pcb->pcb_special.pfs = 0; - pcb->pcb_current_pmap = vmspace_pmap(td->td_proc->p_vmspace); + pcb->pcb_current_pmap = vmspace_pmap(td0->td_proc->p_vmspace); pcb->pcb_special.sp = (uintptr_t)tf - 16; pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline); cpu_set_fork_handler(td, (void (*)(void*))fork_return, td); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 04:47:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17A3C10656DC; Wed, 8 Feb 2012 04:47:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 011548FC0C; Wed, 8 Feb 2012 04:47: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 q184l6xJ022696; Wed, 8 Feb 2012 04:47:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q184l6QS022694; Wed, 8 Feb 2012 04:47:06 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201202080447.q184l6QS022694@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 8 Feb 2012 04:47:06 +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: r231179 - stable/8/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 04:47:07 -0000 Author: marcel Date: Wed Feb 8 04:47:06 2012 New Revision: 231179 URL: http://svn.freebsd.org/changeset/base/231179 Log: MFC r231177: Rev. 228360 moved the call to cpu_set_upcall() to happen before td_proc gets initialized in td (=newtd). Use td0 instead. Modified: stable/8/sys/ia64/ia64/vm_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/ia64/ia64/vm_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:40:14 2012 (r231178) +++ stable/8/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:47:06 2012 (r231179) @@ -192,7 +192,7 @@ cpu_set_upcall(struct thread *td, struct bcopy(td0->td_pcb, pcb, sizeof(*pcb)); pcb->pcb_special.bspstore = td->td_kstack; pcb->pcb_special.pfs = 0; - pcb->pcb_current_pmap = vmspace_pmap(td->td_proc->p_vmspace); + pcb->pcb_current_pmap = vmspace_pmap(td0->td_proc->p_vmspace); pcb->pcb_special.sp = (uintptr_t)tf - 16; pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline); cpu_set_fork_handler(td, (void (*)(void*))fork_return, td); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 05:03:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 053D310656B8; Wed, 8 Feb 2012 05:03:05 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44298FC08; Wed, 8 Feb 2012 05:03:04 +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 q18534at023278; Wed, 8 Feb 2012 05:03:04 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18534fK023276; Wed, 8 Feb 2012 05:03:04 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <201202080503.q18534fK023276@svn.freebsd.org> From: Garrett Wollman Date: Wed, 8 Feb 2012 05:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231181 - head/usr.sbin/tzsetup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 05:03:05 -0000 Author: wollman Date: Wed Feb 8 05:03:04 2012 New Revision: 231181 URL: http://svn.freebsd.org/changeset/base/231181 Log: It's not an error if unlink(2) fails because the pathname doesn't exist. Noticed by: kevlo Pointy hat to: wollman Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Wed Feb 8 04:55:00 2012 (r231180) +++ head/usr.sbin/tzsetup/tzsetup.c Wed Feb 8 05:03:04 2012 (r231181) @@ -723,7 +723,7 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } - if (unlink(path_localtime) < 0) { + if (unlink(path_localtime) < 0 && errno != ENOENT) { snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); @@ -780,7 +780,7 @@ install_zoneinfo_file(const char *zonein fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } - if (unlink(path_localtime) < 0) { + if (unlink(path_localtime) < 0 && errno != ENOENT) { snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 06:56:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DC14106566C; Wed, 8 Feb 2012 06:56:20 +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 1F2578FC15; Wed, 8 Feb 2012 06:56: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 q186uKkr027054; Wed, 8 Feb 2012 06:56:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q186uK80027052; Wed, 8 Feb 2012 06:56:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202080656.q186uK80027052@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 Feb 2012 06:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231187 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 06:56:20 -0000 Author: adrian Date: Wed Feb 8 06:56:19 2012 New Revision: 231187 URL: http://svn.freebsd.org/changeset/base/231187 Log: Update the 802.11s IE numbers to represent the latest 802.11 amendment standard. Submitted by: monthadar@gmail.com Reviewed by: rpaulo Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Wed Feb 8 06:55:22 2012 (r231186) +++ head/sys/net80211/ieee80211.h Wed Feb 8 06:56:19 2012 (r231187) @@ -709,27 +709,32 @@ enum { IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ /* - * 802.11s IEs based on D3.03 spec and were not assigned by - * ANA. Beware changing them because some of them are being - * kept compatible with Linux. + * 802.11s IEs + * NB: On vanilla Linux still IEEE80211_ELEMID_MESHPEER = 55, + * but they defined a new with id 117 called PEER_MGMT. + * NB: complies with open80211 */ - IEEE80211_ELEMID_MESHCONF = 51, - IEEE80211_ELEMID_MESHID = 52, - IEEE80211_ELEMID_MESHLINK = 35, - IEEE80211_ELEMID_MESHCNGST = 36, - IEEE80211_ELEMID_MESHPEER = 55, - IEEE80211_ELEMID_MESHCSA = 38, - IEEE80211_ELEMID_MESHTIM = 39, - IEEE80211_ELEMID_MESHAWAKEW = 40, - IEEE80211_ELEMID_MESHBEACONT = 41, - IEEE80211_ELEMID_MESHPANN = 48, - IEEE80211_ELEMID_MESHRANN = 49, - IEEE80211_ELEMID_MESHPREQ = 68, - IEEE80211_ELEMID_MESHPREP = 69, - IEEE80211_ELEMID_MESHPERR = 70, - IEEE80211_ELEMID_MESHPXU = 53, - IEEE80211_ELEMID_MESHPXUC = 54, - IEEE80211_ELEMID_MESHAH = 60, /* Abbreviated Handshake */ + IEEE80211_ELEMID_MESHCONF = 113, + IEEE80211_ELEMID_MESHID = 114, + IEEE80211_ELEMID_MESHLINK = 115, + IEEE80211_ELEMID_MESHCNGST = 116, + IEEE80211_ELEMID_MESHPEER = 117, + IEEE80211_ELEMID_MESHCSA = 118, + IEEE80211_ELEMID_MESHTIM = 39, /* XXX: remove */ + IEEE80211_ELEMID_MESHAWAKEW = 119, + IEEE80211_ELEMID_MESHBEACONT = 120, + /* 121-124 MMCAOP not implemented yet */ + IEEE80211_ELEMID_MESHPANN = 125, /* XXX: is GANN now, not used */ + IEEE80211_ELEMID_MESHRANN = 126, + /* 127 Extended Capabilities */ + /* 128-129 reserved */ + IEEE80211_ELEMID_MESHPREQ = 130, + IEEE80211_ELEMID_MESHPREP = 131, + IEEE80211_ELEMID_MESHPERR = 132, + /* 133-136 reserved */ + IEEE80211_ELEMID_MESHPXU = 137, + IEEE80211_ELEMID_MESHPXUC = 138, + IEEE80211_ELEMID_MESHAH = 60, /* XXX: remove */ }; struct ieee80211_tim_ie { From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 07:30:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ACD4106564A; Wed, 8 Feb 2012 07:30:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75E238FC0C; Wed, 8 Feb 2012 07:30:48 +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 q187Umds028148; Wed, 8 Feb 2012 07:30:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q187Ums5028146; Wed, 8 Feb 2012 07:30:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202080730.q187Ums5028146@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Feb 2012 07:30:48 +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: r231188 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 07:30:48 -0000 Author: mav Date: Wed Feb 8 07:30:48 2012 New Revision: 231188 URL: http://svn.freebsd.org/changeset/base/231188 Log: MFC 230877: Fix NULL dereference panic on attempt to turn off (on system shutdown) disconnected swap device. This is quick and imperfect solution, as swap device will still be opened and GEOM will not be able to destroy it. Proper solution would be to automatically turn off and close disconnected swap device, but with existing code it will cause panic if there is at least one page on device, even if it is unimportant page of the user-level process. It needs some work. Modified: stable/9/sys/vm/swap_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/swap_pager.c ============================================================================== --- stable/9/sys/vm/swap_pager.c Wed Feb 8 06:56:19 2012 (r231187) +++ stable/9/sys/vm/swap_pager.c Wed Feb 8 07:30:48 2012 (r231188) @@ -2521,7 +2521,7 @@ swapgeom_orphan(struct g_consumer *cp) mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) if (sp->sw_id == cp) - sp->sw_id = NULL; + sp->sw_flags |= SW_CLOSING; mtx_unlock(&sw_dev_mtx); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 07:31:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2E741065670; Wed, 8 Feb 2012 07:31:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3458FC1A; Wed, 8 Feb 2012 07:31:55 +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 q187VtYO028235; Wed, 8 Feb 2012 07:31:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q187VtNb028233; Wed, 8 Feb 2012 07:31:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202080731.q187VtNb028233@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Feb 2012 07:31:55 +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: r231189 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 07:31:55 -0000 Author: mav Date: Wed Feb 8 07:31:55 2012 New Revision: 231189 URL: http://svn.freebsd.org/changeset/base/231189 Log: MFC 230877: Fix NULL dereference panic on attempt to turn off (on system shutdown) disconnected swap device. This is quick and imperfect solution, as swap device will still be opened and GEOM will not be able to destroy it. Proper solution would be to automatically turn off and close disconnected swap device, but with existing code it will cause panic if there is at least one page on device, even if it is unimportant page of the user-level process. It needs some work. Modified: stable/8/sys/vm/swap_pager.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/vm/swap_pager.c ============================================================================== --- stable/8/sys/vm/swap_pager.c Wed Feb 8 07:30:48 2012 (r231188) +++ stable/8/sys/vm/swap_pager.c Wed Feb 8 07:31:55 2012 (r231189) @@ -2484,7 +2484,7 @@ swapgeom_orphan(struct g_consumer *cp) mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) if (sp->sw_id == cp) - sp->sw_id = NULL; + sp->sw_flags |= SW_CLOSING; mtx_unlock(&sw_dev_mtx); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 07:34:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C06C9106566B; Wed, 8 Feb 2012 07:34:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAEFB8FC14; Wed, 8 Feb 2012 07:34:03 +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 q187Y3hR028366; Wed, 8 Feb 2012 07:34:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q187Y3XM028364; Wed, 8 Feb 2012 07:34:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202080734.q187Y3XM028364@svn.freebsd.org> From: Alexander Motin Date: Wed, 8 Feb 2012 07:34:03 +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: r231190 - stable/7/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 07:34:03 -0000 Author: mav Date: Wed Feb 8 07:34:03 2012 New Revision: 231190 URL: http://svn.freebsd.org/changeset/base/231190 Log: MFC 230877: Fix NULL dereference panic on attempt to turn off (on system shutdown) disconnected swap device. This is quick and imperfect solution, as swap device will still be opened and GEOM will not be able to destroy it. Proper solution would be to automatically turn off and close disconnected swap device, but with existing code it will cause panic if there is at least one page on device, even if it is unimportant page of the user-level process. It needs some work. Modified: stable/7/sys/vm/swap_pager.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/vm/swap_pager.c ============================================================================== --- stable/7/sys/vm/swap_pager.c Wed Feb 8 07:31:55 2012 (r231189) +++ stable/7/sys/vm/swap_pager.c Wed Feb 8 07:34:03 2012 (r231190) @@ -2368,7 +2368,7 @@ swapgeom_orphan(struct g_consumer *cp) mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) if (sp->sw_id == cp) - sp->sw_id = NULL; + sp->sw_flags |= SW_CLOSING; mtx_unlock(&sw_dev_mtx); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 08:32:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3971A106566C; Wed, 8 Feb 2012 08:32:49 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 082428FC08; Wed, 8 Feb 2012 08:32:47 +0000 (UTC) Received: by eaan10 with SMTP id n10so106281eaa.13 for ; Wed, 08 Feb 2012 00:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=DyZ86sHXu14jIrCZAqMYj7T4wZb/K/n/BKLvL1lbAV0=; b=Rv1CjnldyTzUj467EOb1FaV9LdlnOdOgyNFITQYd7Sl5N+tFdqnsmW3nuf/mgDSBI5 1sqpt1gKl/D242+NtdE5uuTXvsdKVZUC30UdwLzkLPNPL/RJX5BpDZiJkBqcq4fUnFde sxPlw6l9AYvxKgcRP4TOhN4gey6KJNIc7GchM= Received: by 10.14.23.201 with SMTP id v49mr5175027eev.92.1328689967148; Wed, 08 Feb 2012 00:32:47 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id n56sm2734810eeh.6.2012.02.08.00.32.43 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Feb 2012 00:32:45 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek Organization: TOA Ukraine References: <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> Sender: Mikolaj Golub Date: Wed, 08 Feb 2012 10:32:41 +0200 In-Reply-To: <20120206221742.GA1336@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Mon, 6 Feb 2012 23:17:43 +0100") Message-ID: <86liodu3me.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:32:49 -0000 --=-=-= On Mon, 6 Feb 2012 23:17:43 +0100 Pawel Jakub Dawidek wrote: PJD> On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote: >> Thanks. The updated version is attached. PJD> Looks good to me. Thanks. But I still think that adding some signal handling is a good idea. I agree that there may be no sense in trying to handle many different signals, but handling SIGTERM (software termination signal :-) nicely looks like a good thing. This would solve problems like stale pid files after shutdown or orphaned programs (again with stale pid files and a possibility to start another instance) due to a user mistakenly terminated the supervising daemons. Also it is possible then to add "automatic restart" option, as Andrey has proposed. Here is the patch that does it. It also change proctitle to make identifying a a supervisor with its charge. On the other hand not being an active user of daemon(8) utility, I don't have a strong opinion and would like to see what other people, especially those who use it, think about this. A technical question concerning the patch :-). Does sombody know if sigwaitinfo() may be interrupted in my case and I should check for EINTR, as I do in the patch? -- Mikolaj Golub --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=daemon.c.3.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231014) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,30 +32,36 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include #include #include +#include +#include #include #include #include +static void dummy_sighandler(int); static void restrict_process(const char *); +static int wait_child(pid_t, sigset_t *); static void usage(void); int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + sigset_t mask, oldmask; + int ch, nochdir, noclose, restart; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; + restart = 0; pidfile = user = NULL; - while ((ch = getopt(argc, argv, "-cfp:u:")) != -1) { + while ((ch = getopt(argc, argv, "-cfp:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; @@ -66,6 +72,9 @@ main(int argc, char *argv[]) case 'p': pidfile = optarg; break; + case 'r': + restart = 1; + break; case 'u': user = optarg; break; @@ -79,14 +88,12 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - if (user != NULL) - restrict_process(user); - + pfh = NULL; /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently */ - if (pidfile) { + if (pidfile != NULL) { pfh = pidfile_open(pidfile, 0600, &otherpid); if (pfh == NULL) { if (errno == EEXIST) { @@ -99,26 +106,83 @@ main(int argc, char *argv[]) if (daemon(nochdir, noclose) == -1) err(1, NULL); + /* + * If pidfile or restart option is specified the daemon + * executes the command in a forked process and wait on child + * exit to remove the pidfile or restart the command. + * Normally we don't want the monitoring daemon to be + * terminated leaving the running process and the stale + * pidfile, so we catch SIGTERM and pass it to the children + * expecting to get SIGCHLD eventually. + */ + pid = -1; + if (pidfile != NULL || restart) { + /* + * Restore default action for SIGTERM in case the + * parent process decided to ignore it. + */ + if (signal(SIGTERM, SIG_DFL) == SIG_ERR) + err(1, "signal"); + /* + * Because SIGCHLD is ignored by default, setup dummy handler + * for it, so we can mask it. + */ + if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) + err(1, "signal"); + /* + * Block interesting signals. + */ + sigemptyset(&mask); + sigaddset(&mask, SIGTERM); + sigaddset(&mask, SIGCHLD); + if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) + err(1, "sigprocmask"); +restart: + /* + * Spawn a child to exec the command, so in the parent + * we could wait for it to exit and remove pidfile. + */ + pid = fork(); + if (pid == -1) { + pidfile_remove(pfh); + err(1, "fork"); + } + } + if (pid <= 0) { + if (pid == 0) { + /* Restore old sigmask in the child. */ + if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) + err(1, "sigprocmask"); + } - /* Now that we are the child, write out the pid */ - if (pidfile) + /* Now that we are the child, write out the pid. */ pidfile_write(pfh); - execvp(argv[0], argv); + if (user != NULL) + restrict_process(user); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error - */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) - pidfile_remove(pfh); + execvp(argv[0], argv); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + setproctitle("%s[%d]", argv[0], pid); + if (wait_child(pid, &mask) == 0 && restart) + goto restart; + pidfile_remove(pfh); + exit(0); /* Exit status does not matter. */ } static void +dummy_sighandler(int sig __unused) +{ + /* Nothing to do. */ +} + +static void restrict_process(const char *user) { struct passwd *pw = NULL; @@ -131,11 +195,42 @@ restrict_process(const char *user) errx(1, "failed to set user environment"); } +static int +wait_child(pid_t pid, sigset_t *mask) +{ + int terminate; + int signo; + + terminate = 0; + for (;;) { + signo = sigwaitinfo(mask, NULL); + switch (signo) { + case SIGCHLD: + return terminate; + case SIGTERM: + terminate = 1; + if (kill(pid, signo) == -1) { + warn("kill"); + return -1; + } + continue; + case -1: + if (errno == EINTR) + continue; + warn("sigwaitinfo"); + return -1; + default: + warnx("sigwaitinfo: invalid signal: %d", signo); + return -1; + } + } +} + static void usage(void) { (void)fprintf(stderr, - "usage: daemon [-cf] [-p pidfile] [-u user] command " + "usage: daemon [-cfr] [-p pidfile] [-u user] command " "arguments ...\n"); exit(1); } --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 08:42:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 669EE106566B; Wed, 8 Feb 2012 08:42:18 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3799D8FC13; Wed, 8 Feb 2012 08:42: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 q188gIZ3030566; Wed, 8 Feb 2012 08:42:18 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q188gHxn030563; Wed, 8 Feb 2012 08:42:18 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202080842.q188gHxn030563@svn.freebsd.org> From: Kevin Lo Date: Wed, 8 Feb 2012 08:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231191 - head/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:42:18 -0000 Author: kevlo Date: Wed Feb 8 08:42:17 2012 New Revision: 231191 URL: http://svn.freebsd.org/changeset/base/231191 Log: Add offsetof.3 man page Obtained from: OpenBSD Added: head/share/man/man3/offsetof.3 (contents, props changed) Modified: head/share/man/man3/Makefile Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Wed Feb 8 07:34:03 2012 (r231190) +++ head/share/man/man3/Makefile Wed Feb 8 08:42:17 2012 (r231191) @@ -10,6 +10,7 @@ MAN= assert.3 \ fpgetround.3 \ intro.3 \ makedev.3 \ + offsetof.3 \ ${PTHREAD_MAN} \ queue.3 \ siginfo.3 \ Added: head/share/man/man3/offsetof.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/offsetof.3 Wed Feb 8 08:42:17 2012 (r231191) @@ -0,0 +1,47 @@ +.\" $OpenBSD: offsetof.3,v 1.2 2010/02/18 18:30:19 jmc Exp $ +.\" +.\" Copyright (c) 2010 Thomas Pfaff +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 18 2010 +.Dt OFFSETOF 3 +.Os +.Sh NAME +.Nm offsetof +.Nd offset of a structure member +.Sh SYNOPSIS +.Fd #include +.Ft size_t +.Fn offsetof "type" "member" +.Sh DESCRIPTION +The +.Fn offsetof +macro expands to an integer constant expression of type +.Ft size_t +and yields the offset, +in bytes, of the field +.Ar member +from the start of the structure +.Ar type . +.Pp +A compiler error will result if +.Ar member +is not aligned to a byte boundary (i.e. it is a bit-field). +.Sh STANDARDS +The +.Fn offsetof +macro conforms to +.St -ansiC . From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 08:43:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D3B5106566C; Wed, 8 Feb 2012 08:43:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECE088FC0C; Wed, 8 Feb 2012 08:43:41 +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 q188hfWZ030640; Wed, 8 Feb 2012 08:43:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q188hfws030638; Wed, 8 Feb 2012 08:43:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202080843.q188hfws030638@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 8 Feb 2012 08:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231192 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:43:42 -0000 Author: pjd Date: Wed Feb 8 08:43:41 2012 New Revision: 231192 URL: http://svn.freebsd.org/changeset/base/231192 Log: Note that calling pidfile_write(3) multiple times is fine. MFC after: 3 days Modified: head/lib/libutil/pidfile.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Wed Feb 8 08:42:17 2012 (r231191) +++ head/lib/libutil/pidfile.3 Wed Feb 8 08:43:41 2012 (r231192) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2011 +.Dd February 8, 2012 .Dt PIDFILE 3 .Os .Sh NAME @@ -85,6 +85,9 @@ function sets the O_CLOEXEC close-on-exe The .Fn pidfile_write function writes process' PID into a previously opened file. +The file is truncated before write, so calling the +.Fn pidfile_write +function multiple times is supported. .Pp The .Fn pidfile_close From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 08:49:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C5BB1065670; Wed, 8 Feb 2012 08:49:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 186088FC08; Wed, 8 Feb 2012 08:49:31 +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 q188nUQ2030874; Wed, 8 Feb 2012 08:49:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q188nUDD030871; Wed, 8 Feb 2012 08:49:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202080849.q188nUDD030871@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 8 Feb 2012 08:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231193 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:49:31 -0000 Author: pjd Date: Wed Feb 8 08:49:30 2012 New Revision: 231193 URL: http://svn.freebsd.org/changeset/base/231193 Log: Add a comment to the example that pidfile_* functions can handle pfh being NULL. MFC after: 3 days Modified: head/lib/libutil/pidfile.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Wed Feb 8 08:43:41 2012 (r231192) +++ head/lib/libutil/pidfile.3 Wed Feb 8 08:49:30 2012 (r231193) @@ -150,6 +150,11 @@ if (pfh == NULL) { } /* If we cannot create pidfile from other reasons, only warn. */ warn("Cannot open or create pidfile"); + /* + * Eventhough pfh is NULL we can continue, as the other pidfile_* + * function can handle such situation by doing nothing except setting + * errno to EDOOFUS. + */ } if (daemon(0, 0) == -1) { From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 08:52:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95465106566B; Wed, 8 Feb 2012 08:52:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 751058FC13; Wed, 8 Feb 2012 08:52:41 +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 q188qf5L031013; Wed, 8 Feb 2012 08:52:41 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q188qfMr031008; Wed, 8 Feb 2012 08:52:41 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202080852.q188qfMr031008@svn.freebsd.org> From: Doug Barton Date: Wed, 8 Feb 2012 08:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231194 - in head: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:52:41 -0000 Author: dougb Date: Wed Feb 8 08:52:40 2012 New Revision: 231194 URL: http://svn.freebsd.org/changeset/base/231194 Log: As it stands right now, the default devfs rulesets are only loaded as a side effect of something else using them. If they haven't been loaded already but you want to use them, say for configuring a jail, you're out of luck. So add a knob to always load the default rulesets. While I'm here document the other devfs_ knobs in rc.conf.5. Modified: head/etc/defaults/rc.conf head/etc/rc.d/devfs head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Feb 8 08:49:30 2012 (r231193) +++ head/etc/defaults/rc.conf Wed Feb 8 08:52:40 2012 (r231194) @@ -648,6 +648,7 @@ devfs_rulesets="/etc/defaults/devfs.rule devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to # apply (must be mounted already, i.e. fstab(5)) +devfs_load_rulesets="NO" # Enable to always load the default rulesets performance_cx_lowest="HIGH" # Online CPU idle state performance_cpu_freq="NONE" # Online CPU frequency economy_cx_lowest="HIGH" # Offline CPU idle state Modified: head/etc/rc.d/devfs ============================================================================== --- head/etc/rc.d/devfs Wed Feb 8 08:49:30 2012 (r231193) +++ head/etc/rc.d/devfs Wed Feb 8 08:52:40 2012 (r231194) @@ -16,7 +16,8 @@ stop_cmd=':' devfs_start() { - if [ -n "$devfs_system_ruleset" -o -n "$devfs_set_rulesets" ]; then + if [ -n "$devfs_system_ruleset" -o -n "$devfs_set_rulesets" ] || + checkyesno devfs_load_rulesets; then devfs_init_rulesets if [ -n "$devfs_system_ruleset" ]; then devfs_set_ruleset $devfs_system_ruleset /dev Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Feb 8 08:49:30 2012 (r231193) +++ head/share/man/man5/rc.conf.5 Wed Feb 8 08:52:40 2012 (r231194) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2011 +.Dd February 8, 2012 .Dt RC.CONF 5 .Os .Sh NAME @@ -3673,6 +3673,25 @@ is set to these are the flags passed to the .Xr watchdogd 8 daemon. +.It Va devfs_rulesets +.Pq Vt str +List of files containing sets of rules for +.Xr devfs 8 . +.It Va devfs_system_ruleset +.Pq Vt str +Rule name(s) to apply to the system +.Pa /dev +itself. +.It Va devfs_set_rulesets +.Pq Vt str +Pairs of already-mounted +.Pa dev +directories and rulesets that should be applied to them. +For example: /mount/dev=ruleset_name +.It Va devfs_load_rulesets +.Pq Vt bool +If set, always load the default rulesets listed in +.Va devfs_rulesets . .It Va performance_cx_lowest .Pq Vt str CPU idle state to use while on AC power. @@ -4532,6 +4551,7 @@ The default is 30. .Xr chkprintcap 8 , .Xr chown 8 , .Xr cron 8 , +.Xr devfs 8 , .Xr dhclient 8 , .Xr ftpd 8 , .Xr geli 8 , From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 09:07:16 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B695106566B; Wed, 8 Feb 2012 09:07:16 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E40248FC14; Wed, 8 Feb 2012 09:07:15 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 6F885262; Wed, 8 Feb 2012 10:07:13 +0100 (CET) Date: Wed, 8 Feb 2012 10:06:01 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120208090600.GA1308@garage.freebsd.pl> References: <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <86liodu3me.fsf@in138.ua3> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 09:07:16 -0000 --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 08, 2012 at 10:32:41AM +0200, Mikolaj Golub wrote: >=20 > On Mon, 6 Feb 2012 23:17:43 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote: >=20 > >> Thanks. The updated version is attached. >=20 > PJD> Looks good to me. >=20 > Thanks. But I still think that adding some signal handling is a good idea= =2E I > agree that there may be no sense in trying to handle many different signa= ls, > but handling SIGTERM (software termination signal :-) nicely looks like a= good > thing. Ok:) In that case could you break you patch into one that only fixes the problem we discussed and the other that implements new functionality? > This would solve problems like stale pid files after shutdown or orphaned > programs (again with stale pid files and a possibility to start another > instance) due to a user mistakenly terminated the supervising daemons. >=20 > Also it is possible then to add "automatic restart" option, as Andrey has > proposed. >=20 > Here is the patch that does it. It also change proctitle to make identify= ing a > a supervisor with its charge. I'd prefer to see more general solution to that problem, but I guess this can't hurt. I've only one suggestion based on my experience. Before you restart the program, wait for 1 second. This helps a lot when you have misbehaving program or some misconfiguration that make the process to exit immediately. > A technical question concerning the patch :-). Does sombody know if > sigwaitinfo() may be interrupted in my case and I should check for EINTR,= as I > do in the patch? Calling sigwaitinfo() with second argument equal to NULL is equivalent to calling sigwait(). The only difference is that sigwait() cannot be interrupted by signal, thus never sets errno to EINTR. Why not to use just that? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8yOvgACgkQForvXbEpPzQNVwCgxOxaz6gr8eiuvKD6Fj7qKCem JuMAnib1UpQbb2phqNIg5aeYH6ILy+3S =gjll -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 09:18:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D6EB106564A; Wed, 8 Feb 2012 09:18:23 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2866C8FC12; Wed, 8 Feb 2012 09:18: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 q189INxi031866; Wed, 8 Feb 2012 09:18:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q189IM5i031864; Wed, 8 Feb 2012 09:18:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202080918.q189IM5i031864@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 8 Feb 2012 09:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231195 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 09:18:23 -0000 Author: pjd Date: Wed Feb 8 09:18:22 2012 New Revision: 231195 URL: http://svn.freebsd.org/changeset/base/231195 Log: Allow to set kern.ipc.shmmax from /boot/loader.conf. MFC after: 1 week Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Wed Feb 8 08:52:40 2012 (r231194) +++ head/sys/kern/sysv_shm.c Wed Feb 8 09:18:22 2012 (r231195) @@ -891,14 +891,14 @@ shminit() printf("kern.ipc.shmmaxpgs is now called kern.ipc.shmall!\n"); #endif TUNABLE_ULONG_FETCH("kern.ipc.shmall", &shminfo.shmall); - - /* Initialize shmmax dealing with possible overflow. */ - for (i = PAGE_SIZE; i > 0; i--) { - shminfo.shmmax = shminfo.shmall * i; - if (shminfo.shmmax >= shminfo.shmall) - break; + if (!TUNABLE_ULONG_FETCH("kern.ipc.shmmax", &shminfo.shmmax)) { + /* Initialize shmmax dealing with possible overflow. */ + for (i = PAGE_SIZE; i > 0; i--) { + shminfo.shmmax = shminfo.shmall * i; + if (shminfo.shmmax >= shminfo.shmall) + break; + } } - TUNABLE_ULONG_FETCH("kern.ipc.shmmin", &shminfo.shmmin); TUNABLE_ULONG_FETCH("kern.ipc.shmmni", &shminfo.shmmni); TUNABLE_ULONG_FETCH("kern.ipc.shmseg", &shminfo.shmseg); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 11:30:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6DC6106566C; Wed, 8 Feb 2012 11:30:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A26D68FC17; Wed, 8 Feb 2012 11:30:13 +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 q18BUDcX040490; Wed, 8 Feb 2012 11:30:13 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18BUDWo040488; Wed, 8 Feb 2012 11:30:13 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201202081130.q18BUDWo040488@svn.freebsd.org> From: Brooks Davis Date: Wed, 8 Feb 2012 11:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231196 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 11:30:13 -0000 Author: brooks Date: Wed Feb 8 11:30:13 2012 New Revision: 231196 URL: http://svn.freebsd.org/changeset/base/231196 Log: eui64_aton and eui64_ntoa are actually the equivalent of ether_aton_r and ether_nota_r and do not use static variables so remove the note copied from ethers.3 saying they do. Reported by: bms MFC after: 3 days Modified: head/lib/libc/net/eui64.3 Modified: head/lib/libc/net/eui64.3 ============================================================================== --- head/lib/libc/net/eui64.3 Wed Feb 8 09:18:22 2012 (r231195) +++ head/lib/libc/net/eui64.3 Wed Feb 8 11:30:13 2012 (r231196) @@ -221,10 +221,3 @@ These functions first appears in They are derived from the .Xr ethers 3 family of functions. -.Sh BUGS -The -.Fn eui64_aton -and -.Fn eui64_ntoa -functions returns values that are stored in static memory areas -which may be overwritten the next time they are called. From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 11:33:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAEAF1065670; Wed, 8 Feb 2012 11:33:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBB1A8FC13; Wed, 8 Feb 2012 11:33:46 +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 q18BXkdx040648; Wed, 8 Feb 2012 11:33:46 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18BXkUo040647; Wed, 8 Feb 2012 11:33:46 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202081133.q18BXkUo040647@svn.freebsd.org> From: Martin Matuska Date: Wed, 8 Feb 2012 11:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231197 - vendor/libarchive/2.8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 11:33:47 -0000 Author: mm Date: Wed Feb 8 11:33:46 2012 New Revision: 231197 URL: http://svn.freebsd.org/changeset/base/231197 Log: Copy libarchive's dist to 2.8, vendor has moved to git Added: vendor/libarchive/2.8/ - copied from r231196, vendor/libarchive/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 11:43:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9490A1065672; Wed, 8 Feb 2012 11:43:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DAB08FC15; Wed, 8 Feb 2012 11:43: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 q18BhUTG040956; Wed, 8 Feb 2012 11:43:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18BhUth040948; Wed, 8 Feb 2012 11:43:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202081143.q18BhUth040948@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 8 Feb 2012 11:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231198 - in head: sys/dev/netmap sys/net tools/tools/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 11:43:30 -0000 Author: luigi Date: Wed Feb 8 11:43:29 2012 New Revision: 231198 URL: http://svn.freebsd.org/changeset/base/231198 Log: - change the buffer size from a constant to a TUNABLE variable (hw.netmap.buf_size) so we can experiment with values different from 2048 which may give better cache performance. - rearrange the memory allocation code so it will be easier to replace it with a different implementation. The current code relies on a single large contiguous chunk of memory obtained through contigmalloc. The new implementation (not committed yet) uses multiple smaller chunks which are easier to fit in a fragmented address space. Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/net/netmap.h head/sys/net/netmap_user.h head/tools/tools/netmap/pkt-gen.c Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/if_em_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -61,7 +61,6 @@ em_netmap_attach(struct adapter *adapter na.nm_rxsync = em_netmap_rxsync; na.nm_lock = em_netmap_lock_wrapper; na.nm_register = em_netmap_reg; - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, adapter->num_queues); } Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/if_igb_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -58,7 +58,6 @@ igb_netmap_attach(struct adapter *adapte na.nm_rxsync = igb_netmap_rxsync; na.nm_lock = igb_netmap_lock_wrapper; na.nm_register = igb_netmap_reg; - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, adapter->num_queues); } Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/if_lem_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -62,7 +62,6 @@ lem_netmap_attach(struct adapter *adapte na.nm_rxsync = lem_netmap_rxsync; na.nm_lock = lem_netmap_lock_wrapper; na.nm_register = lem_netmap_reg; - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, 1); } @@ -247,6 +246,7 @@ lem_netmap_txsync(void *a, u_int ring_nr ring->avail = kring->nr_hwavail; } } + if (do_lock) EM_TX_UNLOCK(adapter); return 0; @@ -351,9 +351,9 @@ lem_netmap_rxsync(void *a, u_int ring_nr /* tell userspace that there are new packets */ ring->avail = kring->nr_hwavail ; + if (do_lock) EM_RX_UNLOCK(adapter); return 0; } - - +/* end of file */ Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/if_re_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -56,7 +56,6 @@ re_netmap_attach(struct rl_softc *sc) na.nm_rxsync = re_netmap_rxsync; na.nm_lock = re_netmap_lock_wrapper; na.nm_register = re_netmap_reg; - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, 1); } Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/ixgbe_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -82,13 +82,6 @@ ixgbe_netmap_attach(struct adapter *adap na.nm_rxsync = ixgbe_netmap_rxsync; na.nm_lock = ixgbe_netmap_lock_wrapper; na.nm_register = ixgbe_netmap_reg; - /* - * XXX where do we put this comment ? - * adapter->rx_mbuf_sz is set by SIOCSETMTU, but in netmap mode - * we allocate the buffers on the first register. So we must - * disallow a SIOCSETMTU when if_capenable & IFCAP_NETMAP is set. - */ - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, adapter->num_queues); } @@ -354,7 +347,8 @@ ring_reset: * otherwise we go to sleep (in netmap_poll()) and will be * woken up when slot nr_kflags will be ready. */ - struct ixgbe_legacy_tx_desc *txd = (struct ixgbe_legacy_tx_desc *)txr->tx_base; + struct ixgbe_legacy_tx_desc *txd = + (struct ixgbe_legacy_tx_desc *)txr->tx_base; j = txr->next_to_clean + kring->nkr_num_slots/2; if (j >= kring->nkr_num_slots) @@ -365,9 +359,7 @@ ring_reset: kring->nr_kflags = j; /* the slot to check */ j = txd[j].upper.fields.status & IXGBE_TXD_STAT_DD; } - if (!j) { - netmap_skip_txsync++; - } else { + if (j) { int delta; /* @@ -471,7 +463,7 @@ ixgbe_netmap_rxsync(void *a, u_int ring_ if (j > lim) j -= lim + 1; - if (force_update) { + if (netmap_no_pendintr || force_update) { for (n = 0; ; n++) { union ixgbe_adv_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->wb.upper.status_error); @@ -548,6 +540,7 @@ ixgbe_netmap_rxsync(void *a, u_int ring_ } /* tell userspace that there are new packets */ ring->avail = kring->nr_hwavail ; + if (do_lock) IXGBE_RX_UNLOCK(rxr); return 0; Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/netmap.c Wed Feb 8 11:43:29 2012 (r231198) @@ -92,6 +92,39 @@ MALLOC_DEFINE(M_NETMAP, "netmap", "Netwo */ #define NMA_LOCK() mtx_lock(&netmap_mem_d->nm_mtx); #define NMA_UNLOCK() mtx_unlock(&netmap_mem_d->nm_mtx); +struct netmap_mem_d; +static struct netmap_mem_d *netmap_mem_d; /* Our memory allocator. */ + +u_int netmap_total_buffers; +char *netmap_buffer_base; /* address of an invalid buffer */ + +/* user-controlled variables */ +int netmap_verbose; + +static int netmap_no_timestamp; /* don't timestamp on rxsync */ + +SYSCTL_NODE(_dev, OID_AUTO, netmap, CTLFLAG_RW, 0, "Netmap args"); +SYSCTL_INT(_dev_netmap, OID_AUTO, verbose, + CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); +SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, + CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); +int netmap_buf_size = 2048; +TUNABLE_INT("hw.netmap.buf_size", &netmap_buf_size); +SYSCTL_INT(_dev_netmap, OID_AUTO, buf_size, + CTLFLAG_RD, &netmap_buf_size, 0, "Size of packet buffers"); +int netmap_mitigate = 1; +SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); +int netmap_no_pendintr; +SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, + CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); + + + +/*----- memory allocator -----------------*/ +/* + * Here we have the low level routines for memory allocator + * and its primary users. + */ /* * Default amount of memory pre-allocated by the module. @@ -128,30 +161,13 @@ struct netmap_buf_pool { uint32_t *bitmap; /* one bit per buffer, 1 means free */ }; struct netmap_buf_pool nm_buf_pool; -/* XXX move these two vars back into netmap_buf_pool */ -u_int netmap_total_buffers; -char *netmap_buffer_base; /* address of an invalid buffer */ - -/* user-controlled variables */ -int netmap_verbose; - -static int no_timestamp; /* don't timestamp on rxsync */ - -SYSCTL_NODE(_dev, OID_AUTO, netmap, CTLFLAG_RW, 0, "Netmap args"); -SYSCTL_INT(_dev_netmap, OID_AUTO, verbose, - CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); -SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, - CTLFLAG_RW, &no_timestamp, 0, "no_timestamp"); SYSCTL_INT(_dev_netmap, OID_AUTO, total_buffers, CTLFLAG_RD, &nm_buf_pool.total_buffers, 0, "total_buffers"); SYSCTL_INT(_dev_netmap, OID_AUTO, free_buffers, CTLFLAG_RD, &nm_buf_pool.free, 0, "free_buffers"); -int netmap_mitigate = 1; -SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); -int netmap_skip_txsync; -SYSCTL_INT(_dev_netmap, OID_AUTO, skip_txsync, CTLFLAG_RW, &netmap_skip_txsync, 0, ""); -int netmap_skip_rxsync; -SYSCTL_INT(_dev_netmap, OID_AUTO, skip_rxsync, CTLFLAG_RW, &netmap_skip_rxsync, 0, ""); + + + /* * Allocate n buffers from the ring, and fill the slot. @@ -165,79 +181,446 @@ netmap_new_bufs(struct netmap_if *nifp _ uint32_t bi = 0; /* index in the bitmap */ uint32_t mask, j, i = 0; /* slot counter */ - if (n > p->free) { - D("only %d out of %d buffers available", i, n); - return; - } - /* termination is guaranteed by p->free */ - while (i < n && p->free > 0) { - uint32_t cur = p->bitmap[bi]; - if (cur == 0) { /* bitmask is fully used */ - bi++; - continue; - } - /* locate a slot */ - for (j = 0, mask = 1; (cur & mask) == 0; j++, mask <<= 1) ; - p->bitmap[bi] &= ~mask; /* slot in use */ - p->free--; - slot[i].buf_idx = bi*32+j; - slot[i].len = p->bufsize; - slot[i].flags = NS_BUF_CHANGED; - i++; - } - ND("allocated %d buffers, %d available", n, p->free); + if (n > p->free) { + D("only %d out of %d buffers available", i, n); + return; + } + /* termination is guaranteed by p->free */ + while (i < n && p->free > 0) { + uint32_t cur = p->bitmap[bi]; + if (cur == 0) { /* bitmask is fully used */ + bi++; + continue; + } + /* locate a slot */ + for (j = 0, mask = 1; (cur & mask) == 0; j++, mask <<= 1) ; + p->bitmap[bi] &= ~mask; /* slot in use */ + p->free--; + slot[i].buf_idx = bi*32+j; + slot[i].len = p->bufsize; + slot[i].flags = NS_BUF_CHANGED; + i++; + } + ND("allocated %d buffers, %d available", n, p->free); +} + + +static void +netmap_free_buf(struct netmap_if *nifp __unused, uint32_t i) +{ + struct netmap_buf_pool *p = &nm_buf_pool; + + uint32_t pos, mask; + if (i >= p->total_buffers) { + D("invalid free index %d", i); + return; + } + pos = i / 32; + mask = 1 << (i % 32); + if (p->bitmap[pos] & mask) { + D("slot %d already free", i); + return; + } + p->bitmap[pos] |= mask; + p->free++; +} + + +/* Descriptor of the memory objects handled by our memory allocator. */ +struct netmap_mem_obj { + TAILQ_ENTRY(netmap_mem_obj) nmo_next; /* next object in the + chain. */ + int nmo_used; /* flag set on used memory objects. */ + size_t nmo_size; /* size of the memory area reserved for the + object. */ + void *nmo_data; /* pointer to the memory area. */ +}; + +/* Wrap our memory objects to make them ``chainable``. */ +TAILQ_HEAD(netmap_mem_obj_h, netmap_mem_obj); + + +/* Descriptor of our custom memory allocator. */ +struct netmap_mem_d { + struct mtx nm_mtx; /* lock used to handle the chain of memory + objects. */ + struct netmap_mem_obj_h nm_molist; /* list of memory objects */ + size_t nm_size; /* total amount of memory used for rings etc. */ + size_t nm_totalsize; /* total amount of allocated memory + (the difference is used for buffers) */ + size_t nm_buf_start; /* offset of packet buffers. + This is page-aligned. */ + size_t nm_buf_len; /* total memory for buffers */ + void *nm_buffer; /* pointer to the whole pre-allocated memory + area. */ +}; + +/* Shorthand to compute a netmap interface offset. */ +#define netmap_if_offset(v) \ + ((char *) (v) - (char *) netmap_mem_d->nm_buffer) +/* .. and get a physical address given a memory offset */ +#define netmap_ofstophys(o) \ + (vtophys(netmap_mem_d->nm_buffer) + (o)) + + +/*------ netmap memory allocator -------*/ +/* + * Request for a chunk of memory. + * + * Memory objects are arranged into a list, hence we need to walk this + * list until we find an object with the needed amount of data free. + * This sounds like a completely inefficient implementation, but given + * the fact that data allocation is done once, we can handle it + * flawlessly. + * + * Return NULL on failure. + */ +static void * +netmap_malloc(size_t size, __unused const char *msg) +{ + struct netmap_mem_obj *mem_obj, *new_mem_obj; + void *ret = NULL; + + NMA_LOCK(); + TAILQ_FOREACH(mem_obj, &netmap_mem_d->nm_molist, nmo_next) { + if (mem_obj->nmo_used != 0 || mem_obj->nmo_size < size) + continue; + + new_mem_obj = malloc(sizeof(struct netmap_mem_obj), M_NETMAP, + M_WAITOK | M_ZERO); + TAILQ_INSERT_BEFORE(mem_obj, new_mem_obj, nmo_next); + + new_mem_obj->nmo_used = 1; + new_mem_obj->nmo_size = size; + new_mem_obj->nmo_data = mem_obj->nmo_data; + memset(new_mem_obj->nmo_data, 0, new_mem_obj->nmo_size); + + mem_obj->nmo_size -= size; + mem_obj->nmo_data = (char *) mem_obj->nmo_data + size; + if (mem_obj->nmo_size == 0) { + TAILQ_REMOVE(&netmap_mem_d->nm_molist, mem_obj, + nmo_next); + free(mem_obj, M_NETMAP); + } + + ret = new_mem_obj->nmo_data; + + break; + } + NMA_UNLOCK(); + ND("%s: %d bytes at %p", msg, size, ret); + + return (ret); +} + +/* + * Return the memory to the allocator. + * + * While freeing a memory object, we try to merge adjacent chunks in + * order to reduce memory fragmentation. + */ +static void +netmap_free(void *addr, const char *msg) +{ + size_t size; + struct netmap_mem_obj *cur, *prev, *next; + + if (addr == NULL) { + D("NULL addr for %s", msg); + return; + } + + NMA_LOCK(); + TAILQ_FOREACH(cur, &netmap_mem_d->nm_molist, nmo_next) { + if (cur->nmo_data == addr && cur->nmo_used) + break; + } + if (cur == NULL) { + NMA_UNLOCK(); + D("invalid addr %s %p", msg, addr); + return; + } + + size = cur->nmo_size; + cur->nmo_used = 0; + + /* merge current chunk of memory with the previous one, + if present. */ + prev = TAILQ_PREV(cur, netmap_mem_obj_h, nmo_next); + if (prev && prev->nmo_used == 0) { + TAILQ_REMOVE(&netmap_mem_d->nm_molist, cur, nmo_next); + prev->nmo_size += cur->nmo_size; + free(cur, M_NETMAP); + cur = prev; + } + + /* merge with the next one */ + next = TAILQ_NEXT(cur, nmo_next); + if (next && next->nmo_used == 0) { + TAILQ_REMOVE(&netmap_mem_d->nm_molist, next, nmo_next); + cur->nmo_size += next->nmo_size; + free(next, M_NETMAP); + } + NMA_UNLOCK(); + ND("freed %s %d bytes at %p", msg, size, addr); +} + + +/* + * Create and return a new ``netmap_if`` object, and possibly also + * rings and packet buffors. + * + * Return NULL on failure. + */ +static void * +netmap_if_new(const char *ifname, struct netmap_adapter *na) +{ + struct netmap_if *nifp; + struct netmap_ring *ring; + char *buff; + u_int i, len, ofs; + u_int n = na->num_queues + 1; /* shorthand, include stack queue */ + + /* + * the descriptor is followed inline by an array of offsets + * to the tx and rx rings in the shared memory region. + */ + len = sizeof(struct netmap_if) + 2 * n * sizeof(ssize_t); + nifp = netmap_if_malloc(len); + if (nifp == NULL) + return (NULL); + + /* initialize base fields */ + *(int *)(uintptr_t)&nifp->ni_num_queues = na->num_queues; + strncpy(nifp->ni_name, ifname, IFNAMSIZ); + + (na->refcount)++; /* XXX atomic ? we are under lock */ + if (na->refcount > 1) + goto final; + + /* + * If this is the first instance, allocate the shadow rings and + * buffers for this card (one for each hw queue, one for the host). + * The rings are contiguous, but have variable size. + * The entire block is reachable at + * na->tx_rings[0].ring + */ + + len = n * (2 * sizeof(struct netmap_ring) + + (na->num_tx_desc + na->num_rx_desc) * + sizeof(struct netmap_slot) ); + buff = netmap_ring_malloc(len); + if (buff == NULL) { + D("failed to allocate %d bytes for %s shadow ring", + len, ifname); +error: + (na->refcount)--; + netmap_if_free(nifp); + return (NULL); + } + /* do we have the bufers ? we are in need of num_tx_desc buffers for + * each tx ring and num_tx_desc buffers for each rx ring. */ + len = n * (na->num_tx_desc + na->num_rx_desc); + NMA_LOCK(); + if (nm_buf_pool.free < len) { + NMA_UNLOCK(); + netmap_free(buff, "not enough bufs"); + goto error; + } + /* + * in the kring, store the pointers to the shared rings + * and initialize the rings. We are under NMA_LOCK(). + */ + ofs = 0; + for (i = 0; i < n; i++) { + struct netmap_kring *kring; + int numdesc; + + /* Transmit rings */ + kring = &na->tx_rings[i]; + numdesc = na->num_tx_desc; + bzero(kring, sizeof(*kring)); + kring->na = na; + + ring = kring->ring = (struct netmap_ring *)(buff + ofs); + *(ssize_t *)(uintptr_t)&ring->buf_ofs = + nm_buf_pool.base - (char *)ring; + ND("txring[%d] at %p ofs %d", i, ring, ring->buf_ofs); + *(uint32_t *)(uintptr_t)&ring->num_slots = + kring->nkr_num_slots = numdesc; + + /* + * IMPORTANT: + * Always keep one slot empty, so we can detect new + * transmissions comparing cur and nr_hwcur (they are + * the same only if there are no new transmissions). + */ + ring->avail = kring->nr_hwavail = numdesc - 1; + ring->cur = kring->nr_hwcur = 0; + *(uint16_t *)(uintptr_t)&ring->nr_buf_size = NETMAP_BUF_SIZE; + netmap_new_bufs(nifp, ring->slot, numdesc); + + ofs += sizeof(struct netmap_ring) + + numdesc * sizeof(struct netmap_slot); + + /* Receive rings */ + kring = &na->rx_rings[i]; + numdesc = na->num_rx_desc; + bzero(kring, sizeof(*kring)); + kring->na = na; + + ring = kring->ring = (struct netmap_ring *)(buff + ofs); + *(ssize_t *)(uintptr_t)&ring->buf_ofs = + nm_buf_pool.base - (char *)ring; + ND("rxring[%d] at %p offset %d", i, ring, ring->buf_ofs); + *(uint32_t *)(uintptr_t)&ring->num_slots = + kring->nkr_num_slots = numdesc; + ring->cur = kring->nr_hwcur = 0; + ring->avail = kring->nr_hwavail = 0; /* empty */ + *(uint16_t *)(uintptr_t)&ring->nr_buf_size = NETMAP_BUF_SIZE; + netmap_new_bufs(nifp, ring->slot, numdesc); + ofs += sizeof(struct netmap_ring) + + numdesc * sizeof(struct netmap_slot); + } + NMA_UNLOCK(); + for (i = 0; i < n+1; i++) { + // XXX initialize the selrecord structs. + } +final: + /* + * fill the slots for the rx and tx queues. They contain the offset + * between the ring and nifp, so the information is usable in + * userspace to reach the ring from the nifp. + */ + for (i = 0; i < n; i++) { + char *base = (char *)nifp; + *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i] = + (char *)na->tx_rings[i].ring - base; + *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i+n] = + (char *)na->rx_rings[i].ring - base; + } + return (nifp); +} + +/* + * Initialize the memory allocator. + * + * Create the descriptor for the memory , allocate the pool of memory + * and initialize the list of memory objects with a single chunk + * containing the whole pre-allocated memory marked as free. + * + * Start with a large size, then halve as needed if we fail to + * allocate the block. While halving, always add one extra page + * because buffers 0 and 1 are used for special purposes. + * Return 0 on success, errno otherwise. + */ +static int +netmap_memory_init(void) +{ + struct netmap_mem_obj *mem_obj; + void *buf = NULL; + int i, n, sz = NETMAP_MEMORY_SIZE; + int extra_sz = 0; // space for rings and two spare buffers + + for (; sz >= 1<<20; sz >>=1) { + extra_sz = sz/200; + extra_sz = (extra_sz + 2*PAGE_SIZE - 1) & ~(PAGE_SIZE-1); + buf = contigmalloc(sz + extra_sz, + M_NETMAP, + M_WAITOK | M_ZERO, + 0, /* low address */ + -1UL, /* high address */ + PAGE_SIZE, /* alignment */ + 0 /* boundary */ + ); + if (buf) + break; + } + if (buf == NULL) + return (ENOMEM); + sz += extra_sz; + netmap_mem_d = malloc(sizeof(struct netmap_mem_d), M_NETMAP, + M_WAITOK | M_ZERO); + mtx_init(&netmap_mem_d->nm_mtx, "netmap memory allocator lock", NULL, + MTX_DEF); + TAILQ_INIT(&netmap_mem_d->nm_molist); + netmap_mem_d->nm_buffer = buf; + netmap_mem_d->nm_totalsize = sz; + + /* + * A buffer takes 2k, a slot takes 8 bytes + ring overhead, + * so the ratio is 200:1. In other words, we can use 1/200 of + * the memory for the rings, and the rest for the buffers, + * and be sure we never run out. + */ + netmap_mem_d->nm_size = sz/200; + netmap_mem_d->nm_buf_start = + (netmap_mem_d->nm_size + PAGE_SIZE - 1) & ~(PAGE_SIZE-1); + netmap_mem_d->nm_buf_len = sz - netmap_mem_d->nm_buf_start; + + nm_buf_pool.base = netmap_mem_d->nm_buffer; + nm_buf_pool.base += netmap_mem_d->nm_buf_start; + netmap_buffer_base = nm_buf_pool.base; + D("netmap_buffer_base %p (offset %d)", + netmap_buffer_base, (int)netmap_mem_d->nm_buf_start); + /* number of buffers, they all start as free */ + + netmap_total_buffers = nm_buf_pool.total_buffers = + netmap_mem_d->nm_buf_len / NETMAP_BUF_SIZE; + nm_buf_pool.bufsize = NETMAP_BUF_SIZE; + + D("Have %d MB, use %dKB for rings, %d buffers at %p", + (sz >> 20), (int)(netmap_mem_d->nm_size >> 10), + nm_buf_pool.total_buffers, nm_buf_pool.base); + + /* allocate and initialize the bitmap. Entry 0 is considered + * always busy (used as default when there are no buffers left). + */ + n = (nm_buf_pool.total_buffers + 31) / 32; + nm_buf_pool.bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, + M_WAITOK | M_ZERO); + nm_buf_pool.bitmap[0] = ~3; /* slot 0 and 1 always busy */ + for (i = 1; i < n; i++) + nm_buf_pool.bitmap[i] = ~0; + nm_buf_pool.free = nm_buf_pool.total_buffers - 2; + + mem_obj = malloc(sizeof(struct netmap_mem_obj), M_NETMAP, + M_WAITOK | M_ZERO); + TAILQ_INSERT_HEAD(&netmap_mem_d->nm_molist, mem_obj, nmo_next); + mem_obj->nmo_used = 0; + mem_obj->nmo_size = netmap_mem_d->nm_size; + mem_obj->nmo_data = netmap_mem_d->nm_buffer; + + return (0); } +/* + * Finalize the memory allocator. + * + * Free all the memory objects contained inside the list, and deallocate + * the pool of memory; finally free the memory allocator descriptor. + */ static void -netmap_free_buf(struct netmap_if *nifp __unused, uint32_t i) +netmap_memory_fini(void) { - struct netmap_buf_pool *p = &nm_buf_pool; + struct netmap_mem_obj *mem_obj; - uint32_t pos, mask; - if (i >= p->total_buffers) { - D("invalid free index %d", i); - return; - } - pos = i / 32; - mask = 1 << (i % 32); - if (p->bitmap[pos] & mask) { - D("slot %d already free", i); - return; + while (!TAILQ_EMPTY(&netmap_mem_d->nm_molist)) { + mem_obj = TAILQ_FIRST(&netmap_mem_d->nm_molist); + TAILQ_REMOVE(&netmap_mem_d->nm_molist, mem_obj, nmo_next); + if (mem_obj->nmo_used == 1) { + printf("netmap: leaked %d bytes at %p\n", + (int)mem_obj->nmo_size, + mem_obj->nmo_data); + } + free(mem_obj, M_NETMAP); } - p->bitmap[pos] |= mask; - p->free++; + contigfree(netmap_mem_d->nm_buffer, netmap_mem_d->nm_totalsize, M_NETMAP); + // XXX mutex_destroy(nm_mtx); + free(netmap_mem_d, M_NETMAP); } - - -/* Descriptor of the memory objects handled by our memory allocator. */ -struct netmap_mem_obj { - TAILQ_ENTRY(netmap_mem_obj) nmo_next; /* next object in the - chain. */ - int nmo_used; /* flag set on used memory objects. */ - size_t nmo_size; /* size of the memory area reserved for the - object. */ - void *nmo_data; /* pointer to the memory area. */ -}; - -/* Wrap our memory objects to make them ``chainable``. */ -TAILQ_HEAD(netmap_mem_obj_h, netmap_mem_obj); - - -/* Descriptor of our custom memory allocator. */ -struct netmap_mem_d { - struct mtx nm_mtx; /* lock used to handle the chain of memory - objects. */ - struct netmap_mem_obj_h nm_molist; /* list of memory objects */ - size_t nm_size; /* total amount of memory used for rings etc. */ - size_t nm_totalsize; /* total amount of allocated memory - (the difference is used for buffers) */ - size_t nm_buf_start; /* offset of packet buffers. - This is page-aligned. */ - size_t nm_buf_len; /* total memory for buffers */ - void *nm_buffer; /* pointer to the whole pre-allocated memory - area. */ -}; +/*------------- end of memory allocator -----------------*/ /* Structure associated to each thread which registered an interface. */ @@ -250,15 +633,8 @@ struct netmap_priv_d { uint16_t np_txpoll; }; -/* Shorthand to compute a netmap interface offset. */ -#define netmap_if_offset(v) \ - ((char *) (v) - (char *) netmap_mem_d->nm_buffer) -/* .. and get a physical address given a memory offset */ -#define netmap_ofstophys(o) \ - (vtophys(netmap_mem_d->nm_buffer) + (o)) static struct cdev *netmap_dev; /* /dev/netmap character device. */ -static struct netmap_mem_d *netmap_mem_d; /* Our memory allocator. */ static d_mmap_t netmap_mmap; @@ -351,6 +727,7 @@ netmap_kqfilter(struct cdev *dev, struct } #endif /* NETMAP_KEVENT */ + /* * File descriptor's private data destructor. * @@ -358,19 +735,13 @@ netmap_kqfilter(struct cdev *dev, struct * revert to normal operation. We expect that np_ifp has not gone. */ static void -netmap_dtor(void *data) +netmap_dtor_locked(void *data) { struct netmap_priv_d *priv = data; struct ifnet *ifp = priv->np_ifp; struct netmap_adapter *na = NA(ifp); struct netmap_if *nifp = priv->np_nifp; - if (0) - printf("%s starting for %p ifp %p\n", __FUNCTION__, priv, - priv ? priv->np_ifp : NULL); - - na->nm_lock(ifp->if_softc, NETMAP_CORE_LOCK, 0); - na->refcount--; if (na->refcount <= 0) { /* last instance */ u_int i; @@ -411,159 +782,34 @@ netmap_dtor(void *data) for (j = 0; j < lim; j++) netmap_free_buf(nifp, ring->slot[j].buf_idx); - ND("rx queue %d", i); - ring = na->rx_rings[i].ring; - lim = na->rx_rings[i].nkr_num_slots; - for (j = 0; j < lim; j++) - netmap_free_buf(nifp, ring->slot[j].buf_idx); - } - NMA_UNLOCK(); - netmap_free_rings(na); - wakeup(na); - } - netmap_if_free(nifp); - - na->nm_lock(ifp->if_softc, NETMAP_CORE_UNLOCK, 0); - - if_rele(ifp); - - bzero(priv, sizeof(*priv)); /* XXX for safety */ - free(priv, M_DEVBUF); -} - - -/* - * Create and return a new ``netmap_if`` object, and possibly also - * rings and packet buffors. - * - * Return NULL on failure. - */ -static void * -netmap_if_new(const char *ifname, struct netmap_adapter *na) -{ - struct netmap_if *nifp; - struct netmap_ring *ring; - char *buff; - u_int i, len, ofs; - u_int n = na->num_queues + 1; /* shorthand, include stack queue */ - - /* - * the descriptor is followed inline by an array of offsets - * to the tx and rx rings in the shared memory region. - */ - len = sizeof(struct netmap_if) + 2 * n * sizeof(ssize_t); - nifp = netmap_if_malloc(len); - if (nifp == NULL) - return (NULL); - - /* initialize base fields */ - *(int *)(uintptr_t)&nifp->ni_num_queues = na->num_queues; - strncpy(nifp->ni_name, ifname, IFNAMSIZ); - - (na->refcount)++; /* XXX atomic ? we are under lock */ - if (na->refcount > 1) - goto final; - - /* - * If this is the first instance, allocate the shadow rings and - * buffers for this card (one for each hw queue, one for the host). - * The rings are contiguous, but have variable size. - * The entire block is reachable at - * na->tx_rings[0].ring - */ - - len = n * (2 * sizeof(struct netmap_ring) + - (na->num_tx_desc + na->num_rx_desc) * - sizeof(struct netmap_slot) ); - buff = netmap_ring_malloc(len); - if (buff == NULL) { - D("failed to allocate %d bytes for %s shadow ring", - len, ifname); -error: - (na->refcount)--; - netmap_if_free(nifp); - return (NULL); - } - /* do we have the bufers ? we are in need of num_tx_desc buffers for - * each tx ring and num_tx_desc buffers for each rx ring. */ - len = n * (na->num_tx_desc + na->num_rx_desc); - NMA_LOCK(); - if (nm_buf_pool.free < len) { - NMA_UNLOCK(); - netmap_free(buff, "not enough bufs"); - goto error; - } - /* - * in the kring, store the pointers to the shared rings - * and initialize the rings. We are under NMA_LOCK(). - */ - ofs = 0; - for (i = 0; i < n; i++) { - struct netmap_kring *kring; - int numdesc; - - /* Transmit rings */ - kring = &na->tx_rings[i]; - numdesc = na->num_tx_desc; - bzero(kring, sizeof(*kring)); - kring->na = na; - - ring = kring->ring = (struct netmap_ring *)(buff + ofs); - *(ssize_t *)(uintptr_t)&ring->buf_ofs = - nm_buf_pool.base - (char *)ring; - ND("txring[%d] at %p ofs %d", i, ring, ring->buf_ofs); - *(int *)(int *)(uintptr_t)&ring->num_slots = - kring->nkr_num_slots = numdesc; - - /* - * IMPORTANT: - * Always keep one slot empty, so we can detect new - * transmissions comparing cur and nr_hwcur (they are - * the same only if there are no new transmissions). - */ - ring->avail = kring->nr_hwavail = numdesc - 1; - ring->cur = kring->nr_hwcur = 0; - netmap_new_bufs(nifp, ring->slot, numdesc); - - ofs += sizeof(struct netmap_ring) + - numdesc * sizeof(struct netmap_slot); - - /* Receive rings */ - kring = &na->rx_rings[i]; - numdesc = na->num_rx_desc; - bzero(kring, sizeof(*kring)); - kring->na = na; - - ring = kring->ring = (struct netmap_ring *)(buff + ofs); - *(ssize_t *)(uintptr_t)&ring->buf_ofs = - nm_buf_pool.base - (char *)ring; - ND("rxring[%d] at %p offset %d", i, ring, ring->buf_ofs); - *(int *)(int *)(uintptr_t)&ring->num_slots = - kring->nkr_num_slots = numdesc; - ring->cur = kring->nr_hwcur = 0; - ring->avail = kring->nr_hwavail = 0; /* empty */ - netmap_new_bufs(nifp, ring->slot, numdesc); - ofs += sizeof(struct netmap_ring) + - numdesc * sizeof(struct netmap_slot); - } - NMA_UNLOCK(); - for (i = 0; i < n+1; i++) { - // XXX initialize the selrecord structs. - } -final: - /* - * fill the slots for the rx and tx queues. They contain the offset - * between the ring and nifp, so the information is usable in - * userspace to reach the ring from the nifp. - */ - for (i = 0; i < n; i++) { - char *base = (char *)nifp; - *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i] = - (char *)na->tx_rings[i].ring - base; - *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i+n] = - (char *)na->rx_rings[i].ring - base; + ND("rx queue %d", i); + ring = na->rx_rings[i].ring; + lim = na->rx_rings[i].nkr_num_slots; + for (j = 0; j < lim; j++) + netmap_free_buf(nifp, ring->slot[j].buf_idx); + } + NMA_UNLOCK(); + netmap_free_rings(na); + wakeup(na); } - return (nifp); + netmap_if_free(nifp); +} + + +static void +netmap_dtor(void *data) +{ + struct netmap_priv_d *priv = data; + struct ifnet *ifp = priv->np_ifp; + struct netmap_adapter *na = NA(ifp); + + na->nm_lock(ifp->if_softc, NETMAP_CORE_LOCK, 0); + netmap_dtor_locked(data); + na->nm_lock(ifp->if_softc, NETMAP_CORE_UNLOCK, 0); + + if_rele(ifp); + bzero(priv, sizeof(*priv)); /* XXX for safety */ + free(priv, M_DEVBUF); } @@ -894,7 +1140,6 @@ netmap_ioctl(__unused struct cdev *dev, break; } - for (i = 10; i > 0; i--) { na->nm_lock(adapter, NETMAP_CORE_LOCK, 0); if (!NETMAP_DELETING(na)) @@ -924,25 +1169,16 @@ netmap_ioctl(__unused struct cdev *dev, * and make it use the shared buffers. */ error = na->nm_register(ifp, 1); /* mode on */ - if (error) { - /* - * do something similar to netmap_dtor(). - */ - netmap_free_rings(na); - // XXX tx_rings is inline, must not be freed. - // free(na->tx_rings, M_DEVBUF); // XXX wrong ? - na->tx_rings = na->rx_rings = NULL; - na->refcount--; - netmap_if_free(nifp); - nifp = NULL; - } + if (error) + netmap_dtor_locked(priv); } if (error) { /* reg. failed, release priv and ref */ error: na->nm_lock(adapter, NETMAP_CORE_UNLOCK, 0); - free(priv, M_DEVBUF); if_rele(ifp); /* return the refcount */ + bzero(priv, sizeof(*priv)); + free(priv, M_DEVBUF); break; } @@ -1166,6 +1402,12 @@ netmap_poll(__unused struct cdev *dev, i if (priv->np_txpoll || want_tx) { for (i = priv->np_qfirst; i < priv->np_qlast; i++) { kring = &na->tx_rings[i]; + /* + * Skip the current ring if want_tx == 0 + * (we have already done a successful sync on + * a previous ring) AND kring->cur == kring->hwcur + * (there are no pending transmissions for this ring). + */ if (!want_tx && kring->ring->cur == kring->nr_hwcur) continue; if (core_lock == NEED_CL) { @@ -1181,6 +1423,7 @@ netmap_poll(__unused struct cdev *dev, i if (na->nm_txsync(adapter, i, 0 /* no lock */)) revents |= POLLERR; + /* Check avail/call selrecord only if called with POLLOUT */ if (want_tx) { if (kring->ring->avail > 0) { /* stop at the first ring. We don't risk @@ -1212,9 +1455,10 @@ netmap_poll(__unused struct cdev *dev, i if (na->nm_rxsync(adapter, i, 0 /* no lock */)) revents |= POLLERR; - if (no_timestamp == 0 || - kring->ring->flags & NR_TIMESTAMP) + if (netmap_no_timestamp == 0 || *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 12:52:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E50D106566C; Wed, 8 Feb 2012 12:52:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 600188FC0C; Wed, 8 Feb 2012 12:52: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 q18Cq2km043185; Wed, 8 Feb 2012 12:52:02 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Cq2Ba043183; Wed, 8 Feb 2012 12:52:02 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202081252.q18Cq2Ba043183@svn.freebsd.org> From: Martin Matuska Date: Wed, 8 Feb 2012 12:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231199 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 12:52:02 -0000 Author: mm Date: Wed Feb 8 12:52:01 2012 New Revision: 231199 URL: http://svn.freebsd.org/changeset/base/231199 Log: Libarchive 3.0.3 import Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Wed Feb 8 11:43:29 2012 (r231198) +++ svnadmin/conf/sizelimit.conf Wed Feb 8 12:52:01 2012 (r231199) @@ -29,6 +29,7 @@ jb jeff kmacy lstewart +mm obrien rpaulo rwatson From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 12:53:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0527B106564A; Wed, 8 Feb 2012 12:53:17 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDCFA8FC0A; Wed, 8 Feb 2012 12:53: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 q18CrGD0043259; Wed, 8 Feb 2012 12:53:16 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18CrGmF043254; Wed, 8 Feb 2012 12:53:16 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202081253.q18CrGmF043254@svn.freebsd.org> From: Martin Matuska Date: Wed, 8 Feb 2012 12:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231200 - in vendor/libarchive/dist: . build build/autoconf build/cmake build/pkgconfig build/utils contrib contrib/psota-benchmark contrib/shar cpio cpio/test doc doc/html doc/man doc/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 12:53:17 -0000 Author: mm Date: Wed Feb 8 12:53:14 2012 New Revision: 231200 URL: http://svn.freebsd.org/changeset/base/231200 Log: Update vendor libarchive dist to new "release" branch (post 3.0.3) Git branch: release Git commit: 9af87742342aa4f37a22ec12c4cc1c82e00ffa2f Obtained from: https://github.com/libarchive/libarchive.git Added: vendor/libarchive/dist/build/autoconf/config.rpath (contents, props changed) vendor/libarchive/dist/build/autoconf/iconv.m4 (contents, props changed) vendor/libarchive/dist/build/autoconf/lib-ld.m4 (contents, props changed) vendor/libarchive/dist/build/autoconf/lib-link.m4 (contents, props changed) vendor/libarchive/dist/build/autoconf/lib-prefix.m4 (contents, props changed) vendor/libarchive/dist/build/makerelease.sh (contents, props changed) vendor/libarchive/dist/build/utils/ vendor/libarchive/dist/build/utils/gen_archive_string_composition_h.sh (contents, props changed) vendor/libarchive/dist/cpio/test/test_option_0.c (contents, props changed) vendor/libarchive/dist/doc/html/.ignore_me (contents, props changed) vendor/libarchive/dist/doc/man/.ignore_me (contents, props changed) vendor/libarchive/dist/doc/pdf/.ignore_me (contents, props changed) vendor/libarchive/dist/doc/text/.ignore_me (contents, props changed) vendor/libarchive/dist/doc/wiki/.ignore_me (contents, props changed) vendor/libarchive/dist/libarchive/archive_acl.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_acl_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_crypto.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_crypto_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_acl.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_linkify.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_locale.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_paths.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_perms.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_sparse.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_stat.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_time.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_options.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_options_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_ppmd7.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_ppmd7_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_ppmd_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_rb.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_rb.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_data.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_disk_posix.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_disk.c vendor/libarchive/dist/libarchive/archive_read_disk_windows.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_extract.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_filter.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_format.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_free.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_header.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_new.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_open.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_set_options.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_set_options.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_support_filter_all.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_support_compression_all.c vendor/libarchive/dist/libarchive/archive_read_support_filter_bzip2.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_support_compression_bzip2.c vendor/libarchive/dist/libarchive/archive_read_support_filter_compress.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_support_compression_compress.c vendor/libarchive/dist/libarchive/archive_read_support_filter_gzip.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_support_compression_gzip.c vendor/libarchive/dist/libarchive/archive_read_support_filter_none.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_support_compression_none.c vendor/libarchive/dist/libarchive/archive_read_support_filter_program.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_support_compression_program.c vendor/libarchive/dist/libarchive/archive_read_support_filter_rpm.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_support_compression_rpm.c vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_support_compression_uu.c vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_read_support_compression_xz.c vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_support_format_by_code.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_string_composition.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_add_filter_bzip2.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_write_set_compression_bzip2.c vendor/libarchive/dist/libarchive/archive_write_add_filter_compress.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_write_set_compression_compress.c vendor/libarchive/dist/libarchive/archive_write_add_filter_gzip.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_write_set_compression_gzip.c vendor/libarchive/dist/libarchive/archive_write_add_filter_none.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_write_set_compression_none.c vendor/libarchive/dist/libarchive/archive_write_add_filter_program.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_write_set_compression_program.c vendor/libarchive/dist/libarchive/archive_write_add_filter_xz.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_write_set_compression_xz.c vendor/libarchive/dist/libarchive/archive_write_blocksize.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_data.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_disk_posix.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/archive_write_disk.c vendor/libarchive/dist/libarchive/archive_write_disk_windows.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_filter.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_finish_entry.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_format.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_free.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_header.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_new.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_open.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_format_gnutar.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_options.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_options.c (contents, props changed) vendor/libarchive/dist/libarchive/libarchive_changes.3 (contents, props changed) vendor/libarchive/dist/libarchive/test/test_acl_nfs4.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_acl_pax.tar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c - copied, changed from r231198, vendor/libarchive/dist/libarchive/test/test_acl_basic.c vendor/libarchive/dist/libarchive/test/test_archive_clear_error.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_crypto.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_close_twice.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_close_twice_open_fd.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_close_twice_open_filename.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_next_header_empty.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_next_header_raw.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_open2.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_set_filter_option.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_set_format_option.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_set_option.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_set_options.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_support.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_set_error.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_string.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_string_conversion.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_string_conversion.txt.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_write_set_filter_option.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_write_set_format_option.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_write_set_option.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_write_set_options.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_lzip.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_lzip_1.tlz.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_lzip_2.tlz.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_mac-1.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_mac-2.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_mac.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_pax_libarchive_2x.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_solaris_pax_sparse.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_solaris_pax_sparse_1.pax.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_solaris_pax_sparse_2.pax.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_zip_3.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_zip_4.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_zip_5.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_zip_6.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_zip_7.xps.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_filter_count.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_fuzz.cab.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_fuzz.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_gnutar_filename_encoding.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj2_bzip2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj2_copy_1.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj2_copy_2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj2_copy_lzma.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj2_deflate.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj2_lzma1_1.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj2_lzma1_2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj2_lzma2_1.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj2_lzma2_2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj_bzip2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj_copy.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj_deflate.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj_lzma1.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bcj_lzma2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_bzip2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_copy.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_copy_2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_deflate.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_delta_lzma1.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_delta_lzma2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_empty_archive.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_empty_file.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_lzma1.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_lzma1_2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_lzma1_lzma2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_lzma2.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_ppmd.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_symbolic_name.7z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cab.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cab_1.cab.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cab_2.cab.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cab_3.cab.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cab_filename.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cab_filename_cp932.cab.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cpio_afio.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_lzip.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cpio_filename.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cpio_filename_cp866.cpio.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cpio_filename_eucjp.cpio.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cpio_filename_koi8r.cpio.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cpio_filename_utf8_jp.cpio.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cpio_filename_utf8_ru.cpio.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_gtar_filename.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_gtar_filename_cp866.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_gtar_filename_eucjp.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_gtar_filename_koi8r.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_iso_joliet_by_nero.iso.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_iso_xorriso.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_iso_xorriso.iso.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_isojoliet_versioned.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_filename.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_filename_cp932.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_header0.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_header1.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_header2.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_header3.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_lh0.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_lh6.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_lh7.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_withjunk.lzh.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_mtree_nomagic.mtree.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_binary_data.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_compress_best.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_compress_normal.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_noeof.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_sfx.exe.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_subblock.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_unicode.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_windows.rar.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_tar_filename.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_tar_filename_koi8r.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_ustar_filename.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_ustar_filename_cp866.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_ustar_filename_eucjp.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_ustar_filename_koi8r.tar.Z.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename_cp866.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename_cp932.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename_koi8r.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_length_at_end.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_symlink.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_ux.zip.uu (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_truncated_filter.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_sparse_basic.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_ustar_filename_encoding.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_compress_lzip.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_disk_lookup.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_7zip.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_gnutar.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_boot.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_empty.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_filename.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_mtree_fflags.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_tar_sparse.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_xar.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_xar_empty.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_zip_filename_encoding.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_C_upper.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_H_upper.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_L_upper.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_O_upper.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_U_upper.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_X_upper.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_b.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_exclude.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_gid_gname.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_k.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_keep_newer_files.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_keep_newer_files.tar.Z.uu (contents, props changed) vendor/libarchive/dist/tar/test/test_option_n.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_newer_than.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_s.tar.Z.uu (contents, props changed) vendor/libarchive/dist/tar/test/test_option_uid_uname.c (contents, props changed) vendor/libarchive/dist/tar/test/test_print_longpath.c (contents, props changed) vendor/libarchive/dist/tar/test/test_print_longpath.tar.Z.uu (contents, props changed) Deleted: vendor/libarchive/dist/build/cmake/AddTest28.cmake vendor/libarchive/dist/examples/minitar/tree.c vendor/libarchive/dist/examples/minitar/tree.h vendor/libarchive/dist/libarchive/archive_hash.h vendor/libarchive/dist/libarchive/archive_read_disk.c vendor/libarchive/dist/libarchive/archive_read_support_compression_all.c vendor/libarchive/dist/libarchive/archive_read_support_compression_bzip2.c vendor/libarchive/dist/libarchive/archive_read_support_compression_compress.c vendor/libarchive/dist/libarchive/archive_read_support_compression_gzip.c vendor/libarchive/dist/libarchive/archive_read_support_compression_none.c vendor/libarchive/dist/libarchive/archive_read_support_compression_program.c vendor/libarchive/dist/libarchive/archive_read_support_compression_rpm.c vendor/libarchive/dist/libarchive/archive_read_support_compression_uu.c vendor/libarchive/dist/libarchive/archive_read_support_compression_xz.c vendor/libarchive/dist/libarchive/archive_write_disk.c vendor/libarchive/dist/libarchive/archive_write_set_compression_bzip2.c vendor/libarchive/dist/libarchive/archive_write_set_compression_compress.c vendor/libarchive/dist/libarchive/archive_write_set_compression_gzip.c vendor/libarchive/dist/libarchive/archive_write_set_compression_none.c vendor/libarchive/dist/libarchive/archive_write_set_compression_program.c vendor/libarchive/dist/libarchive/archive_write_set_compression_xz.c vendor/libarchive/dist/libarchive/test/test_acl_basic.c Modified: vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/COPYING vendor/libarchive/dist/INSTALL vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/README vendor/libarchive/dist/build/autogen.sh vendor/libarchive/dist/build/clean.sh vendor/libarchive/dist/build/cmake/FindLZMA.cmake vendor/libarchive/dist/build/cmake/config.h.in vendor/libarchive/dist/build/pkgconfig/libarchive.pc.in vendor/libarchive/dist/build/version vendor/libarchive/dist/configure.ac vendor/libarchive/dist/contrib/README vendor/libarchive/dist/contrib/libarchive.1aix53.spec vendor/libarchive/dist/contrib/libarchive.spec vendor/libarchive/dist/contrib/psota-benchmark/results.txt vendor/libarchive/dist/contrib/psota-benchmark/tcp.sh vendor/libarchive/dist/contrib/shar/shar.c vendor/libarchive/dist/contrib/untar.c vendor/libarchive/dist/cpio/bsdcpio.1 vendor/libarchive/dist/cpio/cmdline.c vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/cpio/cpio.h vendor/libarchive/dist/cpio/test/CMakeLists.txt vendor/libarchive/dist/cpio/test/main.c vendor/libarchive/dist/cpio/test/test.h vendor/libarchive/dist/cpio/test/test_0.c vendor/libarchive/dist/cpio/test/test_basic.c vendor/libarchive/dist/cpio/test/test_format_newc.c vendor/libarchive/dist/cpio/test/test_option_c.c vendor/libarchive/dist/cpio/test/test_option_t.c vendor/libarchive/dist/cpio/test/test_option_u.c vendor/libarchive/dist/cpio/test/test_owner_parse.c vendor/libarchive/dist/doc/mdoc2wiki.awk vendor/libarchive/dist/examples/minitar/Makefile vendor/libarchive/dist/examples/minitar/minitar.c vendor/libarchive/dist/examples/tarfilter.c vendor/libarchive/dist/examples/untar.c vendor/libarchive/dist/libarchive/CMakeLists.txt vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_check_magic.c vendor/libarchive/dist/libarchive/archive_crc32.h vendor/libarchive/dist/libarchive/archive_entry.3 vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_entry_copy_bhfi.c vendor/libarchive/dist/libarchive/archive_entry_copy_stat.c vendor/libarchive/dist/libarchive/archive_entry_link_resolver.c vendor/libarchive/dist/libarchive/archive_entry_private.h vendor/libarchive/dist/libarchive/archive_entry_stat.c vendor/libarchive/dist/libarchive/archive_private.h vendor/libarchive/dist/libarchive/archive_read.3 vendor/libarchive/dist/libarchive/archive_read.c vendor/libarchive/dist/libarchive/archive_read_data_into_fd.c vendor/libarchive/dist/libarchive/archive_read_disk.3 vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_disk_private.h vendor/libarchive/dist/libarchive/archive_read_disk_set_standard_lookup.c vendor/libarchive/dist/libarchive/archive_read_extract.c vendor/libarchive/dist/libarchive/archive_read_open_fd.c vendor/libarchive/dist/libarchive/archive_read_open_file.c vendor/libarchive/dist/libarchive/archive_read_open_filename.c vendor/libarchive/dist/libarchive/archive_read_open_memory.c vendor/libarchive/dist/libarchive/archive_read_private.h vendor/libarchive/dist/libarchive/archive_read_support_format_all.c vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c vendor/libarchive/dist/libarchive/archive_read_support_format_empty.c vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive/archive_read_support_format_raw.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_string.c vendor/libarchive/dist/libarchive/archive_string.h vendor/libarchive/dist/libarchive/archive_string_sprintf.c vendor/libarchive/dist/libarchive/archive_util.3 vendor/libarchive/dist/libarchive/archive_util.c vendor/libarchive/dist/libarchive/archive_virtual.c vendor/libarchive/dist/libarchive/archive_windows.c vendor/libarchive/dist/libarchive/archive_windows.h vendor/libarchive/dist/libarchive/archive_write.3 vendor/libarchive/dist/libarchive/archive_write.c vendor/libarchive/dist/libarchive/archive_write_disk.3 vendor/libarchive/dist/libarchive/archive_write_disk_set_standard_lookup.c vendor/libarchive/dist/libarchive/archive_write_open_filename.c vendor/libarchive/dist/libarchive/archive_write_open_memory.c vendor/libarchive/dist/libarchive/archive_write_private.h vendor/libarchive/dist/libarchive/archive_write_set_format.c vendor/libarchive/dist/libarchive/archive_write_set_format_ar.c vendor/libarchive/dist/libarchive/archive_write_set_format_by_name.c vendor/libarchive/dist/libarchive/archive_write_set_format_cpio.c vendor/libarchive/dist/libarchive/archive_write_set_format_cpio_newc.c vendor/libarchive/dist/libarchive/archive_write_set_format_mtree.c vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c vendor/libarchive/dist/libarchive/archive_write_set_format_shar.c vendor/libarchive/dist/libarchive/archive_write_set_format_ustar.c vendor/libarchive/dist/libarchive/archive_write_set_format_zip.c vendor/libarchive/dist/libarchive/config_freebsd.h vendor/libarchive/dist/libarchive/filter_fork_windows.c vendor/libarchive/dist/libarchive/libarchive-formats.5 vendor/libarchive/dist/libarchive/libarchive.3 vendor/libarchive/dist/libarchive/libarchive_internals.3 vendor/libarchive/dist/libarchive/tar.5 vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/main.c vendor/libarchive/dist/libarchive/test/read_open_memory.c vendor/libarchive/dist/libarchive/test/test.h vendor/libarchive/dist/libarchive/test/test_acl_freebsd.c vendor/libarchive/dist/libarchive/test/test_acl_pax.c vendor/libarchive/dist/libarchive/test/test_archive_api_feature.c vendor/libarchive/dist/libarchive/test/test_bad_fd.c vendor/libarchive/dist/libarchive/test/test_compat_bzip2.c vendor/libarchive/dist/libarchive/test/test_compat_cpio.c vendor/libarchive/dist/libarchive/test/test_compat_gtar.c vendor/libarchive/dist/libarchive/test/test_compat_gzip.c vendor/libarchive/dist/libarchive/test/test_compat_lzma.c vendor/libarchive/dist/libarchive/test/test_compat_solaris_tar_acl.c vendor/libarchive/dist/libarchive/test/test_compat_tar_hardlink.c vendor/libarchive/dist/libarchive/test/test_compat_xz.c vendor/libarchive/dist/libarchive/test/test_compat_zip.c vendor/libarchive/dist/libarchive/test/test_compat_zip_2.zip.uu vendor/libarchive/dist/libarchive/test/test_empty_write.c vendor/libarchive/dist/libarchive/test/test_entry.c vendor/libarchive/dist/libarchive/test/test_extattr_freebsd.c vendor/libarchive/dist/libarchive/test/test_fuzz.c vendor/libarchive/dist/libarchive/test/test_open_failure.c vendor/libarchive/dist/libarchive/test/test_open_fd.c vendor/libarchive/dist/libarchive/test/test_open_file.c vendor/libarchive/dist/libarchive/test/test_open_filename.c vendor/libarchive/dist/libarchive/test/test_pax_filename_encoding.c vendor/libarchive/dist/libarchive/test/test_read_compress_program.c vendor/libarchive/dist/libarchive/test/test_read_data_large.c vendor/libarchive/dist/libarchive/test/test_read_disk.c vendor/libarchive/dist/libarchive/test/test_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/test/test_read_extract.c vendor/libarchive/dist/libarchive/test/test_read_file_nonexistent.c vendor/libarchive/dist/libarchive/test/test_read_format_ar.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_Z.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_be.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_gz.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_lzma.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_xz.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_odc.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4_gzip.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4c_Z.c vendor/libarchive/dist/libarchive/test/test_read_format_empty.c vendor/libarchive/dist/libarchive/test/test_read_format_gtar_gz.c vendor/libarchive/dist/libarchive/test/test_read_format_gtar_lzma.c vendor/libarchive/dist/libarchive/test/test_read_format_gtar_sparse.c vendor/libarchive/dist/libarchive/test/test_read_format_iso_Z.c vendor/libarchive/dist/libarchive/test/test_read_format_iso_multi_extent.c vendor/libarchive/dist/libarchive/test/test_read_format_isojoliet_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_isojoliet_long.c vendor/libarchive/dist/libarchive/test/test_read_format_isojoliet_rr.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_ce.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_new_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_rr_moved.c vendor/libarchive/dist/libarchive/test/test_read_format_isozisofs_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_mtree.c vendor/libarchive/dist/libarchive/test/test_read_format_mtree.mtree.uu vendor/libarchive/dist/libarchive/test/test_read_format_pax_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_raw.c vendor/libarchive/dist/libarchive/test/test_read_format_tar.c vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_filename.c vendor/libarchive/dist/libarchive/test/test_read_format_tbz.c vendor/libarchive/dist/libarchive/test/test_read_format_tgz.c vendor/libarchive/dist/libarchive/test/test_read_format_tlz.c vendor/libarchive/dist/libarchive/test/test_read_format_txz.c vendor/libarchive/dist/libarchive/test/test_read_format_tz.c vendor/libarchive/dist/libarchive/test/test_read_format_xar.c vendor/libarchive/dist/libarchive/test/test_read_format_zip.c vendor/libarchive/dist/libarchive/test/test_read_format_zip.zip.uu vendor/libarchive/dist/libarchive/test/test_read_large.c vendor/libarchive/dist/libarchive/test/test_read_pax_truncated.c vendor/libarchive/dist/libarchive/test/test_read_position.c vendor/libarchive/dist/libarchive/test/test_read_truncated.c vendor/libarchive/dist/libarchive/test/test_read_uu.c vendor/libarchive/dist/libarchive/test/test_tar_filenames.c vendor/libarchive/dist/libarchive/test/test_tar_large.c vendor/libarchive/dist/libarchive/test/test_ustar_filenames.c vendor/libarchive/dist/libarchive/test/test_write_compress.c vendor/libarchive/dist/libarchive/test/test_write_compress_bzip2.c vendor/libarchive/dist/libarchive/test/test_write_compress_gzip.c vendor/libarchive/dist/libarchive/test/test_write_compress_lzma.c vendor/libarchive/dist/libarchive/test/test_write_compress_program.c vendor/libarchive/dist/libarchive/test/test_write_compress_xz.c vendor/libarchive/dist/libarchive/test/test_write_disk.c vendor/libarchive/dist/libarchive/test/test_write_disk_failures.c vendor/libarchive/dist/libarchive/test/test_write_disk_hardlink.c vendor/libarchive/dist/libarchive/test/test_write_disk_perms.c vendor/libarchive/dist/libarchive/test/test_write_disk_secure.c vendor/libarchive/dist/libarchive/test/test_write_disk_sparse.c vendor/libarchive/dist/libarchive/test/test_write_disk_symlink.c vendor/libarchive/dist/libarchive/test/test_write_disk_times.c vendor/libarchive/dist/libarchive/test/test_write_format_ar.c vendor/libarchive/dist/libarchive/test/test_write_format_cpio.c vendor/libarchive/dist/libarchive/test/test_write_format_cpio_empty.c vendor/libarchive/dist/libarchive/test/test_write_format_cpio_newc.c vendor/libarchive/dist/libarchive/test/test_write_format_cpio_odc.c vendor/libarchive/dist/libarchive/test/test_write_format_mtree.c vendor/libarchive/dist/libarchive/test/test_write_format_pax.c vendor/libarchive/dist/libarchive/test/test_write_format_shar_empty.c vendor/libarchive/dist/libarchive/test/test_write_format_tar.c vendor/libarchive/dist/libarchive/test/test_write_format_tar_empty.c vendor/libarchive/dist/libarchive/test/test_write_format_tar_ustar.c vendor/libarchive/dist/libarchive/test/test_write_format_zip.c vendor/libarchive/dist/libarchive/test/test_write_format_zip_empty.c vendor/libarchive/dist/libarchive/test/test_write_format_zip_no_compression.c vendor/libarchive/dist/libarchive/test/test_write_open_memory.c vendor/libarchive/dist/libarchive_fe/line_reader.c vendor/libarchive/dist/libarchive_fe/matching.c vendor/libarchive/dist/libarchive_fe/pathmatch.c vendor/libarchive/dist/tar/CMakeLists.txt vendor/libarchive/dist/tar/bsdtar.1 vendor/libarchive/dist/tar/bsdtar.c vendor/libarchive/dist/tar/bsdtar.h vendor/libarchive/dist/tar/bsdtar_platform.h vendor/libarchive/dist/tar/bsdtar_windows.h vendor/libarchive/dist/tar/cmdline.c vendor/libarchive/dist/tar/getdate.c vendor/libarchive/dist/tar/read.c vendor/libarchive/dist/tar/subst.c vendor/libarchive/dist/tar/test/CMakeLists.txt vendor/libarchive/dist/tar/test/main.c vendor/libarchive/dist/tar/test/test.h vendor/libarchive/dist/tar/test/test_0.c vendor/libarchive/dist/tar/test/test_basic.c vendor/libarchive/dist/tar/test/test_option_T_upper.c vendor/libarchive/dist/tar/test/test_option_q.c vendor/libarchive/dist/tar/test/test_option_r.c vendor/libarchive/dist/tar/test/test_option_s.c vendor/libarchive/dist/tar/test/test_patterns.c vendor/libarchive/dist/tar/test/test_strip_components.c vendor/libarchive/dist/tar/test/test_symlink_dir.c vendor/libarchive/dist/tar/tree.c vendor/libarchive/dist/tar/util.c vendor/libarchive/dist/tar/write.c Modified: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/CMakeLists.txt Wed Feb 8 12:52:01 2012 (r231199) +++ vendor/libarchive/dist/CMakeLists.txt Wed Feb 8 12:53:14 2012 (r231200) @@ -2,11 +2,16 @@ # PROJECT(libarchive C) # -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) endif() +SET(CMAKE_BUILD_TYPE "Release") + +# On MacOS, prefer MacPorts libraries to system libraries. +# I haven't come up with a compelling argument for this to be conditional. +list(APPEND CMAKE_PREFIX_PATH /opt/local) # # Version - read from 'version' file. @@ -21,41 +26,52 @@ STRING(REGEX REPLACE STRING(REGEX REPLACE "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]([a-z]?)$" "\\1" _quality ${_version}) SET(_version_number ${_major}${_minor}${_revision}) -STRING(REGEX REPLACE "[0]*([^0][0-9]*)$" "\\1" _minor ${_minor}) -STRING(REGEX REPLACE "[0]*([^0][0-9]*)$" "\\1" _revision ${_revision}) +STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_minor ${_minor}) +STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_revision ${_revision}) # -SET(VERSION "${_major}.${_minor}.${_revision}${_quality}") +SET(VERSION "${_major}.${_trimmed_minor}.${_trimmed_revision}${_quality}") SET(BSDCPIO_VERSION_STRING "${VERSION}") SET(BSDTAR_VERSION_STRING "${VERSION}") SET(LIBARCHIVE_VERSION_NUMBER "${_version_number}") SET(LIBARCHIVE_VERSION_STRING "${VERSION}") -# Shared library number -SET(SOVERSION 8) + +# INTERFACE_VERSION increments with every release +# libarchive 2.7 == interface version 9 = 2 + 7 +# libarchive 2.8 == interface version 10 = 2 + 8 +# libarchive 2.9 == interface version 11 = 2 + 9 +# libarchive 3.0 == interface version 12 +# libarchive 3.x == interface version 12 + x +math(EXPR INTERFACE_VERSION "12 + ${_minor}") + +# Set SOVERSION == Interface version +# ?? Should there be more here ?? +SET(SOVERSION "${INTERFACE_VERSION}") + +# Especially for early development, we want to be a little +# aggressive about diagnosing build problems; this can get +# relaxed somewhat in final shipping versions. +IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + ADD_DEFINITIONS(-Wall) + SET(CMAKE_REQUIRED_FLAGS "-Wall") +ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") # Enable CTest/CDash support include(CTest) -# Provide ADD_TEST_28 macro to approximate CMake 2.8 ADD_TEST(NAME). -# TODO: Require CMake 2.8 and drop this workaround (perhaps late 2010). -INCLUDE(AddTest28) - +OPTION(ENABLE_NETTLE "Enable use of Nettle" ON) OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON) OPTION(ENABLE_TAR "Enable tar building" ON) -OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" OFF) +OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" FALSE) OPTION(ENABLE_CPIO "Enable cpio building" ON) -OPTION(ENABLE_CPIO_SHARED "Enable dynamic build of cpio" OFF) +OPTION(ENABLE_CPIO_SHARED "Enable dynamic build of cpio" FALSE) OPTION(ENABLE_XATTR "Enable extended attribute support" ON) OPTION(ENABLE_ACL "Enable ACL support" ON) +OPTION(ENABLE_ICONV "Enable iconv support" ON) OPTION(ENABLE_TEST "Enable unit and regression tests" ON) IF(ENABLE_TEST) ENABLE_TESTING() ENDIF(ENABLE_TEST) -IF(WIN32 AND NOT CYGWIN) - # Currently, dynamic build only. - SET(ENABLE_TAR_SHARED ON) - SET(ENABLE_CPIO_SHARED ON) -ENDIF(WIN32 AND NOT CYGWIN) IF(WIN32) SET(_WIN32_WINNT 0x0500 CACHE INTERNAL "Setting _WIN32_WINNT to 0x0500 for Windows 2000 APIs") @@ -63,6 +79,7 @@ IF(WIN32) ENDIF(WIN32) # +INCLUDE(CheckCSourceCompiles) INCLUDE(CheckCSourceRuns) INCLUDE(CheckFileOffsetBits) INCLUDE(CheckFuncs) @@ -185,18 +202,11 @@ IF(LZMA_FOUND) SET(HAVE_LZMA_H 1) INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${LZMA_LIBRARIES}) - MARK_AS_ADVANCED(CLEAR LZMA_INCLUDE_DIR) - MARK_AS_ADVANCED(CLEAR LZMA_LIBRARY) ELSEIF(LZMADEC_FOUND) SET(HAVE_LIBLZMADEC 1) SET(HAVE_LZMADEC_H 1) INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES}) - MARK_AS_ADVANCED(CLEAR LZMADEC_INCLUDE_DIR) - MARK_AS_ADVANCED(CLEAR LZMADEC_LIBRARY) -ELSE(LZMA_FOUND) - MARK_AS_ADVANCED(CLEAR LZMA_INCLUDE_DIR) - MARK_AS_ADVANCED(CLEAR LZMA_LIBRARY) ENDIF(LZMA_FOUND) # @@ -218,17 +228,25 @@ LA_CHECK_INCLUDE_FILE("sys/types.h" HAVE # Alphabetize the rest unless there's a compelling reason LA_CHECK_INCLUDE_FILE("acl/libacl.h" HAVE_ACL_LIBACL_H) LA_CHECK_INCLUDE_FILE("ctype.h" HAVE_CTYPE_H) +LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H) LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H) LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H) LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H) + +CHECK_C_SOURCE_COMPILES("#include +#include +int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS) + LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H) LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H) LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) LA_CHECK_INCLUDE_FILE("langinfo.h" HAVE_LANGINFO_H) LA_CHECK_INCLUDE_FILE("limits.h" HAVE_LIMITS_H) +LA_CHECK_INCLUDE_FILE("linux/fiemap.h" HAVE_LINUX_FIEMAP_H) LA_CHECK_INCLUDE_FILE("linux/fs.h" HAVE_LINUX_FS_H) +LA_CHECK_INCLUDE_FILE("linux/magic.h" HAVE_LINUX_MAGIC_H) LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H) LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H) @@ -246,12 +264,17 @@ LA_CHECK_INCLUDE_FILE("sys/acl.h" HAVE_S LA_CHECK_INCLUDE_FILE("sys/cdefs.h" HAVE_SYS_CDEFS_H) LA_CHECK_INCLUDE_FILE("sys/ioctl.h" HAVE_SYS_IOCTL_H) LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H) +LA_CHECK_INCLUDE_FILE("sys/mount.h" HAVE_SYS_MOUNT_H) LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H) LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H) LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H) LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +LA_CHECK_INCLUDE_FILE("sys/statfs.h" HAVE_SYS_STATFS_H) +LA_CHECK_INCLUDE_FILE("sys/statvfs.h" HAVE_SYS_STATVFS_H) LA_CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H) LA_CHECK_INCLUDE_FILE("sys/utime.h" HAVE_SYS_UTIME_H) +LA_CHECK_INCLUDE_FILE("sys/utsname.h" HAVE_SYS_UTSNAME_H) +LA_CHECK_INCLUDE_FILE("sys/vfs.h" HAVE_SYS_VFS_H) LA_CHECK_INCLUDE_FILE("sys/wait.h" HAVE_SYS_WAIT_H) LA_CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H) LA_CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) @@ -259,17 +282,47 @@ LA_CHECK_INCLUDE_FILE("utime.h" HAVE_UTI LA_CHECK_INCLUDE_FILE("wchar.h" HAVE_WCHAR_H) LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H) LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) - - -# -# Some headers require extra includes when they're available. -# +# Following files need windwos.h, so we should test it after windows.h test. +LA_CHECK_INCLUDE_FILE("wincrypt.h" HAVE_WINCRYPT_H) +LA_CHECK_INCLUDE_FILE("winioctl.h" HAVE_WINIOCTL_H) + +# +# Check whether use of __EXTENSIONS__ is safe. +# We need some macro such as _GNU_SOURCE to use extension functions. +# +SET(_INCLUDE_FILES) +FOREACH (it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") +ENDFOREACH (it) + +CHECK_C_SOURCE_COMPILES( + "#define __EXTENSIONS__ 1 + ${_INCLUDE_FILES} + int main() { return 0;}" + SAFE_TO_DEFINE_EXTENSIONS) + +# +# Find Nettle +# +IF(ENABLE_NETTLE) + CHECK_LIBRARY_EXISTS(nettle "nettle_sha1_digest" "" NETTLE_FOUND) + IF(NETTLE_FOUND) + SET(CMAKE_REQUIRED_LIBRARIES "nettle") + FIND_LIBRARY(NETTLE_LIBRARY NAMES nettle) + LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARY}) + ELSE(NETTLE_FOUND) + SET(ENABLE_NETTLE OFF) + ENDIF(NETTLE_FOUND) +ENDIF(ENABLE_NETTLE) # # Find OpenSSL +# (Except on Mac, where OpenSSL is deprecated.) # -IF(ENABLE_OPENSSL) +IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") FIND_PACKAGE(OpenSSL) +ELSE() + SET(OPENSSL_FOUND FALSE) # Override cached value ENDIF() # FreeBSD libmd @@ -281,126 +334,134 @@ IF(LIBMD_FOUND) ENDIF(LIBMD_FOUND) # -# How to prove that HASH functions, which have several names on various -# platforms, can be mapped to archive_{hash name}_init, -# archive_{hash name}_update and archive_{hash name}_final through -# archive_hash.h +# How to prove that CRYPTO functions, which have several names on various +# platforms, just see if archive_crypto.c can compile and link against +# required libraries. # -MACRO(CHECK_MD HASH IMPLEMENTATIONS) +MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) IF(HAVE_SYS_TYPES_H) - SET(HASH_HEADER_CONFIG "#define HAVE_SYS_TYPES_H 1\n") + SET(CRYPTO_HEADER_CONFIG "#define HAVE_SYS_TYPES_H 1\n") ELSE(HAVE_SYS_TYPES_H) - SET(HASH_HEADER_CONFIG "") + SET(CRYPTO_HEADER_CONFIG "") ENDIF(HAVE_SYS_TYPES_H) - FOREACH(IMPLEMENTATION ${IMPLEMENTATIONS}) - IF(NOT DEFINED ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) - STRING(TOLOWER "${HASH}" lower_hash) - STRING(TOUPPER "${HASH}" hash) - - SET(HASH_REQUIRED_INCLUDES) - SET(TRY_HASH_REQUIRED_INCLUDES - "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/libarchive") - SET(HASH_REQUIRED_LIBS) - SET(TRY_HASH_REQUIRED_LIBS) + FOREACH(ALGORITHM ${ALGORITHMS}) + STRING(TOLOWER "${ALGORITHM}" lower_algorithm) + STRING(TOUPPER "${ALGORITHM}" algorithm) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) + SET(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} FALSE) + ELSEIF("${IMPLEMENTATION}" MATCHES "^NETTLE$" AND NOT NETTLE_FOUND) + SET(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} FALSE) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) + + IF(NOT DEFINED ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + # Probe the local implementation for whether this + # crypto implementation is available on this platform. + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/libarchive;${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp") + SET(TRY_CRYPTO_REQUIRED_LIBS) IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) - SET(HASH_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) - SET(TRY_HASH_REQUIRED_INCLUDES - "${TRY_HASH_REQUIRED_INCLUDES};${OPENSSL_INCLUDE_DIR}") - SET(HASH_REQUIRED_LIBS ${OPENSSL_LIBRARIES}) - SET(TRY_HASH_REQUIRED_LIBS + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "${TRY_CRYPTO_REQUIRED_INCLUDES};${OPENSSL_INCLUDE_DIR}") + SET(TRY_CRYPTO_REQUIRED_LIBS "-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^NETTLE$" AND NETTLE_FOUND) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) - SET(TRY_HASH_REQUIRED_LIBS + SET(TRY_CRYPTO_REQUIRED_LIBS "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") - ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/libarchive/archive_crypto.c" + ARCHIVE_CRYPTO_C) - SET(SOURCE "#define ${hash}_COMPILE_TEST -#define ARCHIVE_HASH_${hash}_${IMPLEMENTATION} -#define __LIBARCHIVE_BUILD -${HASH_HEADER_CONFIG} -#include \"archive_hash.h\" + SET(SOURCE " +#define ARCHIVE_${algorithm}_COMPILE_TEST +#define ARCHIVE_CRYPTO_${algorithm}_${IMPLEMENTATION} +#define PLATFORM_CONFIG_H \"check_crypto_md.h\" + +${ARCHIVE_CRYPTO_C} int main(int argc, char **argv) { - archive_${lower_hash}_ctx ctx; - - archive_${lower_hash}_init(&ctx); - archive_${lower_hash}_update(&ctx, *argv, argc); - archive_${lower_hash}_final(&ctx, *argv); - return 0; + archive_${lower_crypto}_ctx ctx; + archive_${lower_crypto}_init(&ctx); + archive_${lower_crypto}_update(&ctx, *argv, argc); + archive_${lower_crypto}_final(&ctx, NULL); + return 0; } ") - FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_hash_md.c" "${SOURCE}") - MESSAGE(STATUS "Checking support for ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}") + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.h" "") + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c" "${SOURCE}") + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}") - TRY_COMPILE(ARCHIVE_HASH_${HASH}_${IMPLEMENTATION} + TRY_COMPILE(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_hash_md.c + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c CMAKE_FLAGS - "${TRY_HASH_REQUIRED_LIBS}" - "${TRY_HASH_REQUIRED_INCLUDES}" + "${TRY_CRYPTO_REQUIRED_LIBS}" + "${TRY_CRYPTO_REQUIRED_INCLUDES}" OUTPUT_VARIABLE OUTPUT) - IF (ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) - MESSAGE(STATUS "Checking support for ARCHIVE_HASH_${HASH}_${IMPLEMENTATION} -- found") - IF (HASH_REQUIRED_INCLUDES) - INCLUDE_DIRECTORIES(${HASH_REQUIRED_INCLUDES}) - ENDIF (HASH_REQUIRED_INCLUDES) - IF (HASH_REQUIRED_LIBS) - LIST(APPEND ADDITIONAL_LIBS ${HASH_REQUIRED_LIBS}) - LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) - ENDIF (HASH_REQUIRED_LIBS) - BREAK() - ENDIF (ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) - - MESSAGE(STATUS "Checking support for ARCHIVE_HASH_${HASH}_${IMPLEMENTATION} -- not found") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Checking support for ARCHIVE_HASH_${HASH}_${IMPLEMENTATION} failed with the following output:\n" + # Inform user whether or not we found it; if not, log why we didn't. + IF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- found") + ELSE (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- not found") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} failed with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") - ELSE(NOT DEFINED ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) - IF(ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) - BREAK() - ENDIF(ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) - ENDIF(NOT DEFINED ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) - ENDFOREACH(IMPLEMENTATION) -ENDMACRO(CHECK_MD HASH IMPLEMENTATIONS) + ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + ENDIF(NOT DEFINED ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) -# -# HASH functions on Windows is defined at archive_windows.c, thus we do not -# need the test what the functions can be mapped to archive_{hash name}_init, -# archive_{hash name}_update and archive_{hash name}_final. -# The functions on Windows use CALG_{hash name} macro to create a crypt object -# and then we need to know what CALG_{hash name} macros is available to show -# ARCHIVE_HASH_{hash name}_WIN macros because Windows 2000 and earlier version + # Add appropriate libs/includes depending on whether the implementation + # was found on this platform. + IF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) + LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) + ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + ENDFOREACH(ALGORITHM ${ALGORITHMS}) +ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + +# +# CRYPTO functions on Windows is defined at archive_windows.c, thus we do not +# need the test what the functions can be mapped to archive_{crypto name}_init, +# archive_{crypto name}_update and archive_{crypto name}_final. +# The functions on Windows use CALG_{crypto name} macro to create a crypt object +# and then we need to know what CALG_{crypto name} macros is available to show +# ARCHIVE_CRYPTO_{crypto name}_WIN macros because Windows 2000 and earlier version # of Windows XP do not support SHA256, SHA384 and SHA512. # -MACRO(CHECK_HASH_WIN HASH_LIST) +MACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) IF(WIN32 AND NOT CYGWIN) - FOREACH(HASH ${HASH_LIST}) - IF(NOT DEFINED ARCHIVE_HASH_${HASH}_WIN) - STRING(TOUPPER "${HASH}" hash) + FOREACH(CRYPTO ${CRYPTO_LIST}) + IF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN) + STRING(TOUPPER "${CRYPTO}" crypto) SET(ALGID "") - IF ("${HASH}" MATCHES "^MD5$") + IF ("${CRYPTO}" MATCHES "^MD5$") SET(ALGID "CALG_MD5") - ENDIF ("${HASH}" MATCHES "^MD5$") - IF ("${HASH}" MATCHES "^SHA1$") + ENDIF ("${CRYPTO}" MATCHES "^MD5$") + IF ("${CRYPTO}" MATCHES "^SHA1$") SET(ALGID "CALG_SHA1") - ENDIF ("${HASH}" MATCHES "^SHA1$") - IF ("${HASH}" MATCHES "^SHA256$") + ENDIF ("${CRYPTO}" MATCHES "^SHA1$") + IF ("${CRYPTO}" MATCHES "^SHA256$") SET(ALGID "CALG_SHA_256") - ENDIF ("${HASH}" MATCHES "^SHA256$") - IF ("${HASH}" MATCHES "^SHA384$") + ENDIF ("${CRYPTO}" MATCHES "^SHA256$") + IF ("${CRYPTO}" MATCHES "^SHA384$") SET(ALGID "CALG_SHA_384") - ENDIF ("${HASH}" MATCHES "^SHA384$") - IF ("${HASH}" MATCHES "^SHA512$") + ENDIF ("${CRYPTO}" MATCHES "^SHA384$") + IF ("${CRYPTO}" MATCHES "^SHA512$") SET(ALGID "CALG_SHA_512") - ENDIF ("${HASH}" MATCHES "^SHA512$") + ENDIF ("${CRYPTO}" MATCHES "^SHA512$") - SET(SOURCE "#define ${hash}_COMPILE_TEST + SET(SOURCE "#define ${crypto}_COMPILE_TEST #define _WIN32_WINNT ${_WIN32_WINNT} #define WINVER ${WINVER} #include @@ -412,45 +473,112 @@ main(int argc, char **argv) return ${ALGID}; } ") - SET(SOURCE_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_hash_win.c") + SET(SOURCE_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_win.c") FILE(WRITE "${SOURCE_FILE}" "${SOURCE}") - MESSAGE(STATUS "Checking support for ARCHIVE_HASH_${HASH}_WIN") + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN") - TRY_COMPILE(ARCHIVE_HASH_${HASH}_WIN + TRY_COMPILE(ARCHIVE_CRYPTO_${CRYPTO}_WIN ${CMAKE_BINARY_DIR} ${SOURCE_FILE} CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/libarchive" OUTPUT_VARIABLE OUTPUT) - IF (ARCHIVE_HASH_${HASH}_WIN) + IF (ARCHIVE_CRYPTO_${CRYPTO}_WIN) MESSAGE(STATUS - "Checking support for ARCHIVE_HASH_${HASH}_WIN -- found") - ELSE (ARCHIVE_HASH_${HASH}_WIN) + "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- found") + ELSE (ARCHIVE_CRYPTO_${CRYPTO}_WIN) MESSAGE(STATUS - "Checking support for ARCHIVE_HASH_${HASH}_WIN -- not found") + "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- not found") FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Checking support for ARCHIVE_HASH_${HASH}_WIN failed with the following output:\n" + "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN failed with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") - ENDIF (ARCHIVE_HASH_${HASH}_WIN) + ENDIF (ARCHIVE_CRYPTO_${CRYPTO}_WIN) - ENDIF(NOT DEFINED ARCHIVE_HASH_${HASH}_WIN) - ENDFOREACH(HASH) + ENDIF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN) + ENDFOREACH(CRYPTO) ENDIF(WIN32 AND NOT CYGWIN) -ENDMACRO(CHECK_HASH_WIN HASH_LIST) +ENDMACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) # -# Check MD5/RMD160/SHA support -# -CHECK_MD(MD5 "LIBC;LIBMD;LIBSYSTEM;OPENSSL") -CHECK_MD(RMD160 "LIBC;OPENSSL") -CHECK_MD(SHA1 "LIBC;LIBMD;LIBSYSTEM;OPENSSL") -CHECK_MD(SHA256 "LIBC;LIBC2;LIBC3;LIBMD;LIBSYSTEM;OPENSSL") -CHECK_MD(SHA384 "LIBC;LIBC2;LIBC3;LIBSYSTEM;OPENSSL") -CHECK_MD(SHA512 "LIBC;LIBC2;LIBC3;LIBMD;LIBSYSTEM;OPENSSL") -CHECK_HASH_WIN("MD5;SHA1;SHA256;SHA384;SHA512") +# Find iconv +# POSIX defines the second arg as const char ** +# and requires it to be in libc. But we can accept +# a non-const argument here and can support iconv() +# being in libiconv. +# +MACRO(CHECK_ICONV LIB TRY_ICONV_CONST) + IF(NOT HAVE_ICONV) + CHECK_C_SOURCE_COMPILES( + "#include + #include + int main() { + ${TRY_ICONV_CONST} char *ccp; + iconv_t cd = iconv_open(\"\", \"\"); + iconv(cd, &ccp, (size_t *)0, (char **)0, (size_t *)0); + iconv_close(cd); + return 0; + }" + HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + IF(HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + SET(HAVE_ICONV true) + SET(ICONV_CONST ${TRY_ICONV_CONST}) + ENDIF(HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + ENDIF(NOT HAVE_ICONV) +ENDMACRO(CHECK_ICONV TRY_ICONV_CONST) + +IF(ENABLE_ICONV) + FIND_PATH(ICONV_INCLUDE_DIR iconv.h) + IF(ICONV_INCLUDE_DIR) + #SET(INCLUDES ${INCLUDES} "iconv.h") + SET(HAVE_ICONV_H 1) + INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + CHECK_ICONV("libc" "const") + CHECK_ICONV("libc" "") + + # If iconv isn't in libc and we have a libiconv, try that. + FIND_LIBRARY(LIBICONV_PATH iconv) + IF(NOT HAVE_ICONV AND LIBICONV_PATH) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBICONV_PATH}) + CHECK_ICONV("libiconv" "const") + CHECK_ICONV("libiconv" "") + IF (HAVE_ICONV) + LIST(APPEND ADDITIONAL_LIBS ${LIBICONV_PATH}) + ENDIF(HAVE_ICONV) + ENDIF(NOT HAVE_ICONV AND LIBICONV_PATH) + ENDIF(ICONV_INCLUDE_DIR) + # + # Find locale_charset() for libiconv. + # + IF(LIBICONV_PATH) + CHECK_INCLUDE_FILES("localcharset.h" HAVE_LOCALCHARSET_H) + CHECK_FUNCTION_EXISTS_GLIBC(locale_charset HAVE_LOCALE_CHARSET) + IF(NOT HAVE_LOCALE_CHARSET) + FIND_LIBRARY(LIBCHARSET_PATH charset) + IF(LIBCHARSET_PATH) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBCHARSET_PATH}) + CHECK_FUNCTION_EXISTS_GLIBC(locale_charset HAVE_LOCALE_CHARSET) + IF(HAVE_LOCALE_CHARSET) + LIST(APPEND ADDITIONAL_LIBS ${LIBCHARSET_PATH}) + ENDIF(HAVE_LOCALE_CHARSET) + ENDIF(LIBCHARSET_PATH) + ENDIF(NOT HAVE_LOCALE_CHARSET) + ENDIF(LIBICONV_PATH) +ELSE(ENABLE_ICONV) + # Make sure ICONV variables are not in CACHE after ENABLE_ICONV disabled + # (once enabled). + UNSET(HAVE_LOCALE_CHARSET CACHE) + UNSET(HAVE_ICONV CACHE) + UNSET(HAVE_ICONV_libc_ CACHE) + UNSET(HAVE_ICONV_libc_const CACHE) + UNSET(HAVE_ICONV_libiconv_ CACHE) + UNSET(HAVE_ICONV_libiconv_const CACHE) + UNSET(ICONV_INCLUDE_DIR CACHE) + UNSET(LIBICONV_PATH CACHE) +ENDIF(ENABLE_ICONV) # # Find Libxml2 @@ -461,12 +589,9 @@ IF(LIBXML2_FOUND) LIST(APPEND ADDITIONAL_LIBS ${LIBXML2_LIBRARIES}) SET(HAVE_LIBXML2 1) # libxml2's include files use iconv.h - # We need a directory path of iconv.h so that it won't fail to check - # "libxml/xmlreader.h". - FIND_PATH(ICONV_INCLUDE_DIR iconv.h) - INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) CHECK_INCLUDE_FILES("libxml/xmlreader.h" HAVE_LIBXML_XMLREADER_H) + CHECK_INCLUDE_FILES("libxml/xmlwriter.h" HAVE_LIBXML_XMLWRITER_H) SET(CMAKE_REQUIRED_INCLUDES "") ELSE(LIBXML2_FOUND) # @@ -484,39 +609,59 @@ ENDIF(LIBXML2_FOUND) # # Check functions # -CHECK_SYMBOL_EXISTS(CreateHardLinkA "windows.h" HAVE_CREATEHARDLINKA) -CHECK_SYMBOL_EXISTS(CreateHardLinkW "windows.h" HAVE_CREATEHARDLINKW) +IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + # + # During checking functions, we should use -fno-builtin to avoid the + # failure of function detection which failure is an error "conflicting + # types for built-in function" caused by using -Werror option. + # + SET(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-builtin") +ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") CHECK_SYMBOL_EXISTS(_CrtSetReportMode "crtdbg.h" HAVE__CrtSetReportMode) CHECK_FUNCTION_EXISTS_GLIBC(chflags HAVE_CHFLAGS) CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN) CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT) +CHECK_FUNCTION_EXISTS_GLIBC(ctime_r HAVE_CTIME_R) CHECK_FUNCTION_EXISTS_GLIBC(fchdir HAVE_FCHDIR) CHECK_FUNCTION_EXISTS_GLIBC(fchflags HAVE_FCHFLAGS) CHECK_FUNCTION_EXISTS_GLIBC(fchmod HAVE_FCHMOD) CHECK_FUNCTION_EXISTS_GLIBC(fchown HAVE_FCHOWN) CHECK_FUNCTION_EXISTS_GLIBC(fcntl HAVE_FCNTL) +CHECK_FUNCTION_EXISTS_GLIBC(fdopendir HAVE_FDOPENDIR) CHECK_FUNCTION_EXISTS_GLIBC(fork HAVE_FORK) CHECK_FUNCTION_EXISTS_GLIBC(fstat HAVE_FSTAT) +CHECK_FUNCTION_EXISTS_GLIBC(fstatat HAVE_FSTATAT) +CHECK_FUNCTION_EXISTS_GLIBC(fstatfs HAVE_FSTATFS) +CHECK_FUNCTION_EXISTS_GLIBC(fstatvfs HAVE_FSTATVFS) CHECK_FUNCTION_EXISTS_GLIBC(ftruncate HAVE_FTRUNCATE) CHECK_FUNCTION_EXISTS_GLIBC(futimens HAVE_FUTIMENS) CHECK_FUNCTION_EXISTS_GLIBC(futimes HAVE_FUTIMES) +CHECK_FUNCTION_EXISTS_GLIBC(futimesat HAVE_FUTIMESAT) CHECK_FUNCTION_EXISTS_GLIBC(geteuid HAVE_GETEUID) CHECK_FUNCTION_EXISTS_GLIBC(getgrgid_r HAVE_GETGRGID_R) CHECK_FUNCTION_EXISTS_GLIBC(getgrnam_r HAVE_GETGRNAM_R) CHECK_FUNCTION_EXISTS_GLIBC(getpwnam_r HAVE_GETPWNAM_R) CHECK_FUNCTION_EXISTS_GLIBC(getpwuid_r HAVE_GETPWUID_R) CHECK_FUNCTION_EXISTS_GLIBC(getpid HAVE_GETPID) +CHECK_FUNCTION_EXISTS_GLIBC(getvfsbyname HAVE_GETVFSBYNAME) +CHECK_FUNCTION_EXISTS_GLIBC(gmtime_r HAVE_GMTIME_R) CHECK_FUNCTION_EXISTS_GLIBC(lchflags HAVE_LCHFLAGS) CHECK_FUNCTION_EXISTS_GLIBC(lchmod HAVE_LCHMOD) CHECK_FUNCTION_EXISTS_GLIBC(lchown HAVE_LCHOWN) CHECK_FUNCTION_EXISTS_GLIBC(link HAVE_LINK) +CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) +CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +CHECK_FUNCTION_EXISTS_GLIBC(mbsnrtowcs HAVE_MBSNRTOWCS) CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +CHECK_FUNCTION_EXISTS_GLIBC(mkstemp HAVE_MKSTEMP) CHECK_FUNCTION_EXISTS_GLIBC(nl_langinfo HAVE_NL_LANGINFO) +CHECK_FUNCTION_EXISTS_GLIBC(openat HAVE_OPENAT) CHECK_FUNCTION_EXISTS_GLIBC(pipe HAVE_PIPE) CHECK_FUNCTION_EXISTS_GLIBC(poll HAVE_POLL) CHECK_FUNCTION_EXISTS_GLIBC(readlink HAVE_READLINK) @@ -524,6 +669,8 @@ CHECK_FUNCTION_EXISTS_GLIBC(select HAVE_ CHECK_FUNCTION_EXISTS_GLIBC(setenv HAVE_SETENV) CHECK_FUNCTION_EXISTS_GLIBC(setlocale HAVE_SETLOCALE) CHECK_FUNCTION_EXISTS_GLIBC(sigaction HAVE_SIGACTION) +CHECK_FUNCTION_EXISTS_GLIBC(statfs HAVE_STATFS) +CHECK_FUNCTION_EXISTS_GLIBC(statvfs HAVE_STATVFS) CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR) CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP) CHECK_FUNCTION_EXISTS_GLIBC(strerror HAVE_STRERROR) @@ -541,19 +688,52 @@ CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +CHECK_FUNCTION_EXISTS_GLIBC(wcsnrtombs HAVE_WCSNRTOMBS) CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) -CHECK_SYMBOL_EXISTS(wmemcmp "wchar.h" HAVE_WMEMCMP) -CHECK_SYMBOL_EXISTS(wmemcpy "wchar.h" HAVE_WMEMCPY) +CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) +CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) +CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +CHECK_FUNCTION_EXISTS_GLIBC(_localtime64_s HAVE__LOCALTIME64_S) +CHECK_FUNCTION_EXISTS_GLIBC(_mkgmtime64 HAVE__MKGMTIME64) SET(CMAKE_REQUIRED_LIBRARIES "") -CHECK_SYMBOL_EXISTS(fseeko "stdio.h" HAVE_FSEEKO) -CHECK_SYMBOL_EXISTS(strerror_r "string.h" HAVE_STRERROR_R) -CHECK_SYMBOL_EXISTS(strftime "time.h" HAVE_STRFTIME) -CHECK_SYMBOL_EXISTS(vprintf "stdio.h" HAVE_VPRINTF) -CHECK_SYMBOL_EXISTS(cygwin_conv_path "sys/cygwin.h" HAVE_CYGWIN_CONV_PATH) - -CHECK_SYMBOL_EXISTS(major "sys/mkdev.h" MAJOR_IN_MKDEV) -CHECK_SYMBOL_EXISTS(major "sys/sysmacros.h" MAJOR_IN_SYSMACROS) +CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) +CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) +CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) +CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) + +# Restore CMAKE_REQUIRED_FLAGS +IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + SET(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS}) +ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + +# Make sure we have the POSIX version of readdir_r, not the +# older 2-argument version. +CHECK_C_SOURCE_COMPILES( + "#include \nint main() {DIR *d = opendir(\".\"); struct dirent e,*r; return readdir_r(d,&e,&r);}" + HAVE_READDIR_R) + + +# Only detect readlinkat() if we also have AT_FDCWD in unistd.h. +# NOTE: linux requires fcntl.h for AT_FDCWD. +CHECK_C_SOURCE_COMPILES( + "#include \n#include \nint main() {char buf[10]; return readlinkat(AT_FDCWD, \"\", buf, 0);}" + HAVE_READLINKAT) + + +# To verify major(), we need to both include the header +# of interest and verify that the result can be linked. +# CHECK_FUNCTION_EXISTS doesn't accept a header argument, +# CHECK_SYMBOL_EXISTS doesn't test linkage. +CHECK_C_SOURCE_COMPILES( + "#include \nint main() { return major(256); }" + MAJOR_IN_MKDEV) +CHECK_C_SOURCE_COMPILES( + "#include \nint main() { return major(256); }" + MAJOR_IN_SYSMACROS) IF(HAVE_STRERROR_R) SET(HAVE_DECL_STRERROR_R 1) @@ -572,8 +752,6 @@ ENDIF(HAVE_INTTYPES_H) CHECK_SYMBOL_EXISTS(EFTYPE "errno.h" HAVE_EFTYPE) CHECK_SYMBOL_EXISTS(EILSEQ "errno.h" HAVE_EILSEQ) CHECK_SYMBOL_EXISTS(D_MD_ORDER "langinfo.h" HAVE_D_MD_ORDER) -CHECK_SYMBOL_EXISTS(optarg "unistd.h" HAVE_DECL_OPTARG) -CHECK_SYMBOL_EXISTS(optind "unistd.h" HAVE_DECL_OPTIND) CHECK_SYMBOL_EXISTS(INT64_MAX "${headers}" HAVE_DECL_INT64_MAX) CHECK_SYMBOL_EXISTS(INT64_MIN "${headers}" HAVE_DECL_INT64_MIN) CHECK_SYMBOL_EXISTS(UINT32_MAX "${headers}" HAVE_DECL_UINT32_MAX) @@ -584,6 +762,16 @@ CHECK_SYMBOL_EXISTS(SSIZE_MAX "li # # Check struct members # +# Check for tm_gmtoff in struct tm +CHECK_STRUCT_MEMBER("struct tm" tm_gmtoff + "time.h" HAVE_STRUCT_TM_TM_GMTOFF) +CHECK_STRUCT_MEMBER("struct tm" __tm_gmtoff + "time.h" HAVE_STRUCT_TM___TM_GMTOFF) + +# Check for f_namemax in struct statfs +CHECK_STRUCT_MEMBER("struct statfs" f_namemax + "sys/param.h;sys/mount.h" HAVE_STRUCT_STATFS_F_NAMEMAX) + # Check for birthtime in struct stat CHECK_STRUCT_MEMBER("struct stat" st_birthtime "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BIRTHTIME) @@ -615,13 +803,30 @@ CHECK_STRUCT_MEMBER("struct tm" tm_sec # # Check for integer types # -# XXX There must be a way to make this simpler XXXX # -CHECK_TYPE_SIZE("long long int" LONG_LONG_INT) -CHECK_TYPE_SIZE("unsigned long long" UNSIGNED_LONG_LONG) -CHECK_TYPE_SIZE("unsigned long long int" UNSIGNED_LONG_LONG_INT) +CHECK_TYPE_SIZE("short" SIZE_OF_SHORT) +CHECK_TYPE_SIZE("int" SIZE_OF_INT) +CHECK_TYPE_SIZE("long" SIZE_OF_LONG) +CHECK_TYPE_SIZE("long long" SIZE_OF_LONG_LONG) + +CHECK_TYPE_SIZE("unsigned short" SIZE_OF_UNSIGNED_SHORT) +CHECK_TYPE_SIZE("unsigned" SIZE_OF_UNSIGNED) +CHECK_TYPE_SIZE("unsigned long" SIZE_OF_UNSIGNED_LONG) +CHECK_TYPE_SIZE("unsigned long long" SIZE_OF_UNSIGNED_LONG_LONG) + +CHECK_TYPE_SIZE("__int64" __INT64) +CHECK_TYPE_SIZE("unsigned __int64" UNSIGNED___INT64) + +CHECK_TYPE_SIZE(int16_t INT16_T) +CHECK_TYPE_SIZE(int32_t INT32_T) +CHECK_TYPE_SIZE(int64_t INT64_T) +CHECK_TYPE_SIZE(intmax_t INTMAX_T) +CHECK_TYPE_SIZE(uint8_t UINT8_T) +CHECK_TYPE_SIZE(uint16_t UINT16_T) +CHECK_TYPE_SIZE(uint32_t UINT32_T) +CHECK_TYPE_SIZE(uint64_t UINT64_T) +CHECK_TYPE_SIZE(uintmax_t UINTMAX_T) -# CHECK_TYPE_SIZE(dev_t DEV_T) IF(NOT HAVE_DEV_T) IF(MSVC) @@ -647,23 +852,6 @@ IF(NOT HAVE_ID_T) ENDIF(WIN32) ENDIF(NOT HAVE_ID_T) # -CHECK_TYPE_SIZE(int32_t INT32_T) -IF(NOT HAVE_INT32_T) - SET(int32_t "int") -ENDIF(NOT HAVE_INT32_T) -# -CHECK_TYPE_SIZE(int64_t INT64_T) -IF(NOT HAVE_INT64_T) - IF(WIN32) - SET(int64_t __int64) - ENDIF(WIN32) -ENDIF(NOT HAVE_INT64_T) -# -CHECK_TYPE_SIZE(intmax_t INTMAX_T) -IF(NOT HAVE_INTMAX_T) - SET(intmax_t "int64_t") -ENDIF(NOT HAVE_INTMAX_T) -# CHECK_TYPE_SIZE(mode_t MODE_T) IF(NOT HAVE_MODE_T) IF(WIN32) @@ -714,28 +902,6 @@ IF(NOT HAVE_PID_T) ENDIF(WIN32) ENDIF(NOT HAVE_PID_T) # -CHECK_TYPE_SIZE(uint16_t UINT16_T) -IF(NOT HAVE_UINT16_T) - SET(uint16_t "unsigned short") -ENDIF(NOT HAVE_UINT16_T) -# -CHECK_TYPE_SIZE(uint32_t UINT32_T) -IF(NOT HAVE_UINT32_T) - SET(uint32_t "unsigned int") -ENDIF(NOT HAVE_UINT32_T) -# -CHECK_TYPE_SIZE(uint64_t UINT64_T) -IF(NOT HAVE_UINT64_T) - IF(WIN32) - SET(uint64_t "unsigned __int64") - ENDIF(WIN32) -ENDIF(NOT HAVE_UINT64_T) -# -CHECK_TYPE_SIZE(uintmax_t UINTMAX_T) -IF(NOT HAVE_UINTMAX_T) - SET(uintmax_t "uint64_t") -ENDIF(NOT HAVE_UINTMAX_T) -# CHECK_TYPE_SIZE(intptr_t INTPTR_T) IF(NOT HAVE_INTPTR_T) IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) @@ -763,8 +929,6 @@ ENDIF(HAVE_SIZEOF_WCHAR_T) # CHECK_FILE_OFFSET_BITS() - - # # Check for Extended Attribute libraries, headers, and functions # @@ -772,21 +936,57 @@ IF(ENABLE_XATTR) LA_CHECK_INCLUDE_FILE(attr/xattr.h HAVE_ATTR_XATTR_H) LA_CHECK_INCLUDE_FILE(sys/xattr.h HAVE_SYS_XATTR_H) LA_CHECK_INCLUDE_FILE(sys/extattr.h HAVE_SYS_EXTATTR_H) - CHECK_LIBRARY_EXISTS(attr "setxattr" "" HAVE_ATTR_LIB) - IF(HAVE_ATTR_LIB) + CHECK_LIBRARY_EXISTS(attr "setxattr" "" HAVE_LIBATTR) + IF(HAVE_LIBATTR) SET(CMAKE_REQUIRED_LIBRARIES "attr") - ENDIF(HAVE_ATTR_LIB) + ENDIF(HAVE_LIBATTR) CHECK_SYMBOL_EXISTS(EXTATTR_NAMESPACE_USER "sys/types.h;sys/extattr.h" HAVE_DECL_EXTATTR_NAMESPACE_USER) CHECK_FUNCTION_EXISTS_GLIBC(extattr_get_file HAVE_EXTATTR_GET_FILE) CHECK_FUNCTION_EXISTS_GLIBC(extattr_list_file HAVE_EXTATTR_LIST_FILE) CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_fd HAVE_EXTATTR_SET_FD) CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_file HAVE_EXTATTR_SET_FILE) + CHECK_FUNCTION_EXISTS_GLIBC(fgetxattr HAVE_FGETXATTR) + CHECK_FUNCTION_EXISTS_GLIBC(flistxattr HAVE_FLISTXATTR) CHECK_FUNCTION_EXISTS_GLIBC(fsetxattr HAVE_FSETXATTR) CHECK_FUNCTION_EXISTS_GLIBC(getxattr HAVE_GETXATTR) CHECK_FUNCTION_EXISTS_GLIBC(lgetxattr HAVE_LGETXATTR) CHECK_FUNCTION_EXISTS_GLIBC(listxattr HAVE_LISTXATTR) CHECK_FUNCTION_EXISTS_GLIBC(llistxattr HAVE_LLISTXATTR) CHECK_FUNCTION_EXISTS_GLIBC(lsetxattr HAVE_LSETXATTR) + CHECK_FUNCTION_EXISTS_GLIBC(fgetea HAVE_FGETEA) + CHECK_FUNCTION_EXISTS_GLIBC(flistea HAVE_FLISTEA) + CHECK_FUNCTION_EXISTS_GLIBC(fsetea HAVE_FSETEA) + CHECK_FUNCTION_EXISTS_GLIBC(getea HAVE_GETEA) + CHECK_FUNCTION_EXISTS_GLIBC(lgetea HAVE_LGETEA) + CHECK_FUNCTION_EXISTS_GLIBC(listea HAVE_LISTEA) + CHECK_FUNCTION_EXISTS_GLIBC(llistea HAVE_LLISTEA) + CHECK_FUNCTION_EXISTS_GLIBC(lsetea HAVE_LSETEA) +ELSE(ENABLE_XATTR) + SET(HAVE_ATTR_LIB FALSE) + SET(HAVE_ATTR_XATTR_H FALSE) + SET(HAVE_DECL_EXTATTR_NAMESPACE_USER FALSE) + SET(HAVE_EXTATTR_GET_FILE FALSE) + SET(HAVE_EXTATTR_LIST_FILE FALSE) + SET(HAVE_EXTATTR_SET_FD FALSE) + SET(HAVE_EXTATTR_SET_FILE FALSE) + SET(HAVE_FGETEA FALSE) + SET(HAVE_FGETXATTR FALSE) + SET(HAVE_FLISTEA FALSE) + SET(HAVE_FLISTXATTR FALSE) + SET(HAVE_FSETEA FALSE) + SET(HAVE_FSETXATTR FALSE) + SET(HAVE_GETEA FALSE) + SET(HAVE_GETXATTR FALSE) + SET(HAVE_LGETEA FALSE) + SET(HAVE_LGETXATTR FALSE) + SET(HAVE_LISTEA FALSE) + SET(HAVE_LISTXATTR FALSE) + SET(HAVE_LLISTEA FALSE) + SET(HAVE_LLISTXATTR FALSE) + SET(HAVE_LSETEA FALSE) + SET(HAVE_LSETXATTR FALSE) + SET(HAVE_SYS_EXTATTR_H FALSE) + SET(HAVE_SYS_XATTR_H FALSE) ENDIF(ENABLE_XATTR) # @@ -798,12 +998,12 @@ ENDIF(ENABLE_XATTR) # which makes the following checks rather more complex than I would like. # IF(ENABLE_ACL) - CHECK_LIBRARY_EXISTS(acl "acl_get_file" "" HAVE_ACL_LIB) - IF(HAVE_ACL_LIB) + CHECK_LIBRARY_EXISTS(acl "acl_get_file" "" HAVE_LIBACL) + IF(HAVE_LIBACL) SET(CMAKE_REQUIRED_LIBRARIES "acl") FIND_LIBRARY(ACL_LIBRARY NAMES acl) LIST(APPEND ADDITIONAL_LIBS ${ACL_LIBRARY}) - ENDIF(HAVE_ACL_LIB) + ENDIF(HAVE_LIBACL) # CHECK_FUNCTION_EXISTS_GLIBC(acl_create_entry HAVE_ACL_CREATE_ENTRY) CHECK_FUNCTION_EXISTS_GLIBC(acl_init HAVE_ACL_INIT) @@ -817,16 +1017,47 @@ IF(ENABLE_ACL) # test for specific permissions in a permset.) Linux uses the obvious # name, FreeBSD adds _np to mark it as "non-Posix extension." # Test for both as a double-check that we really have POSIX-style ACL support. - CHECK_SYMBOL_EXISTS(acl_get_perm "${INCLUDES}" HAVE_ACL_GET_PERM) - CHECK_SYMBOL_EXISTS(acl_get_perm_np "${INCLUDES}" HAVE_ACL_GET_PERM_NP) - CHECK_SYMBOL_EXISTS(acl_get_link "${INCLUDES}" HAVE_ACL_GET_LINK) - CHECK_SYMBOL_EXISTS(acl_get_link_np "${INCLUDES}" HAVE_ACL_GET_LINK_NP) + CHECK_FUNCTION_EXISTS(acl_get_perm HAVE_ACL_GET_PERM) + CHECK_FUNCTION_EXISTS(acl_get_perm_np HAVE_ACL_GET_PERM_NP) + CHECK_FUNCTION_EXISTS(acl_get_link HAVE_ACL_GET_LINK) + CHECK_FUNCTION_EXISTS(acl_get_link_np HAVE_ACL_GET_LINK_NP) # MacOS has an acl.h that isn't POSIX. It can be detected by # checking for ACL_USER CHECK_SYMBOL_EXISTS(ACL_USER "${INCLUDES}" HAVE_ACL_USER) +ELSE(ENABLE_ACL) + # If someone runs cmake, then disables ACL support, we need + # to forcibly override the cached values for these. + SET(HAVE_ACL_CREATE_ENTRY FALSE) + SET(HAVE_ACL_GET_LINK FALSE) + SET(HAVE_ACL_GET_LINK_NP FALSE) + SET(HAVE_ACL_GET_PERM FALSE) + SET(HAVE_ACL_GET_PERM_NP FALSE) + SET(HAVE_ACL_INIT FALSE) + SET(HAVE_ACL_LIB FALSE) + SET(HAVE_ACL_PERMSET_T FALSE) + SET(HAVE_ACL_SET_FD FALSE) + SET(HAVE_ACL_SET_FD_NP FALSE) + SET(HAVE_ACL_SET_FILE FALSE) + SET(HAVE_ACL_USER FALSE) ENDIF(ENABLE_ACL) +# +# Check MD5/RMD160/SHA support +# NOTE: Crypto checks must be run last before generating config.h +# +CHECK_CRYPTO("MD5;RMD160;SHA1;SHA256;SHA384;SHA512" LIBC) +CHECK_CRYPTO("SHA256;SHA384;SHA512" LIBC2) +CHECK_CRYPTO("SHA256;SHA384;SHA512" LIBC3) +CHECK_CRYPTO("MD5;SHA1;SHA256;SHA384;SHA512" LIBSYSTEM) +CHECK_CRYPTO("MD5;RMD160;SHA1;SHA256;SHA384;SHA512" NETTLE) +CHECK_CRYPTO("MD5;RMD160;SHA1;SHA256;SHA384;SHA512" OPENSSL) + +# Libmd has to be probed after OpenSSL. +CHECK_CRYPTO("MD5;RMD160;SHA1;SHA256;SHA512" LIBMD) + +CHECK_CRYPTO_WIN("MD5;SHA1;SHA256;SHA384;SHA512") + # Generate "config.h" from "build/cmake/config.h.in" CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) @@ -858,8 +1089,13 @@ IF(MSVC) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) ENDIF(MSVC) +# We need CoreServices on Mac OS. +IF(APPLE) + LIST(APPEND ADDITIONAL_LIBS "-framework CoreServices") +ENDIF(APPLE) + IF(ENABLE_TEST) -ADD_CUSTOM_TARGET(run_all_tests) + ADD_CUSTOM_TARGET(run_all_tests) ENDIF(ENABLE_TEST) add_subdirectory(libarchive) Modified: vendor/libarchive/dist/COPYING ============================================================================== --- vendor/libarchive/dist/COPYING Wed Feb 8 12:52:01 2012 (r231199) +++ vendor/libarchive/dist/COPYING Wed Feb 8 12:53:14 2012 (r231200) @@ -16,8 +16,8 @@ the actual statements in the files are c a 3-clause UC Regents copyright; please read the individual source files for details: libarchive/archive_entry.c - libarchive/archive_read_support_compression_compress.c - libarchive/archive_write_set_compression_compress.c + libarchive/archive_read_support_filter_compress.c + libarchive/archive_write_set_filter_compress.c libarchive/mtree.5 tar/matching.c Modified: vendor/libarchive/dist/INSTALL ============================================================================== --- vendor/libarchive/dist/INSTALL Wed Feb 8 12:52:01 2012 (r231199) +++ vendor/libarchive/dist/INSTALL Wed Feb 8 12:53:14 2012 (r231200) @@ -19,7 +19,7 @@ configure script and other build files: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 13:39:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 344BB106564A; Wed, 8 Feb 2012 13:39:39 +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 1F9398FC08; Wed, 8 Feb 2012 13:39:39 +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 q18DdcZ6044965; Wed, 8 Feb 2012 13:39:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Ddc62044963; Wed, 8 Feb 2012 13:39:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202081339.q18Ddc62044963@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 8 Feb 2012 13:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231201 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 13:39:39 -0000 Author: glebius Date: Wed Feb 8 13:39:38 2012 New Revision: 231201 URL: http://svn.freebsd.org/changeset/base/231201 Log: Set vnet context in callouts and taskqueues. PR: 164696 Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Feb 8 12:53:14 2012 (r231200) +++ head/sys/netinet/ip_carp.c Wed Feb 8 13:39:38 2012 (r231201) @@ -707,19 +707,24 @@ carp_send_ad_all(void *ctx __unused, int LIST_FOREACH(sc, &carp_list, sc_next) if (sc->sc_state == MASTER) { CARP_LOCK(sc); + CURVNET_SET(sc->sc_carpdev->if_vnet); carp_send_ad_locked(sc); + CURVNET_RESTORE(); CARP_UNLOCK(sc); } mtx_unlock(&carp_mtx); } +/* Send a periodic advertisement, executed in callout context. */ static void carp_send_ad(void *v) { struct carp_softc *sc = v; CARP_LOCK_ASSERT(sc); + CURVNET_SET(sc->sc_carpdev->if_vnet); carp_send_ad_locked(sc); + CURVNET_RESTORE(); CARP_UNLOCK(sc); } @@ -1090,6 +1095,7 @@ carp_forus(struct ifnet *ifp, u_char *dh return (0); } +/* Master down timeout event, executed in callout context. */ static void carp_master_down(void *v) { @@ -1097,12 +1103,14 @@ carp_master_down(void *v) CARP_LOCK_ASSERT(sc); + CURVNET_SET(sc->sc_carpdev->if_vnet); if (sc->sc_state == BACKUP) { CARP_LOG("VHID %u@%s: BACKUP -> MASTER (master down)\n", sc->sc_vhid, sc->sc_carpdev->if_xname); carp_master_down_locked(sc); } + CURVNET_RESTORE(); CARP_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 14:09:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B245106566C; Wed, 8 Feb 2012 14:09:09 +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 595A68FC1B; Wed, 8 Feb 2012 14:09: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 q18E99pT046013; Wed, 8 Feb 2012 14:09:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18E99T6046011; Wed, 8 Feb 2012 14:09:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081409.q18E99T6046011@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 14:09: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: r231202 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 14:09:09 -0000 Author: kib Date: Wed Feb 8 14:09:08 2012 New Revision: 231202 URL: http://svn.freebsd.org/changeset/base/231202 Log: MFC r230553: When doing vflush(WRITECLOSE), clean vnode pages. Unmounts do vfs_msync() before calling VFS_UNMOUNT(), but there is still a race allowing a process to dirty pages after msync finished. Remounts rw->ro just left dirty pages in system. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Wed Feb 8 13:39:38 2012 (r231201) +++ stable/9/sys/kern/vfs_subr.c Wed Feb 8 14:09:08 2012 (r231202) @@ -2496,6 +2496,18 @@ loop: * vnodes open for writing. */ if (flags & WRITECLOSE) { + if (vp->v_object != NULL) { + VM_OBJECT_LOCK(vp->v_object); + vm_object_page_clean(vp->v_object, 0, 0, 0); + VM_OBJECT_UNLOCK(vp->v_object); + } + error = VOP_FSYNC(vp, MNT_WAIT, td); + if (error != 0) { + VOP_UNLOCK(vp, 0); + vdrop(vp); + MNT_VNODE_FOREACH_ABORT(mp, mvp); + return (error); + } error = VOP_GETATTR(vp, &vattr, td->td_ucred); VI_LOCK(vp); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 14:21:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49AA5106566B; Wed, 8 Feb 2012 14:21:21 +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 1DBB78FC08; Wed, 8 Feb 2012 14:21: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 q18ELKnJ046454; Wed, 8 Feb 2012 14:21:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18ELKkN046452; Wed, 8 Feb 2012 14:21:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081421.q18ELKkN046452@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 14:21:20 +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: r231203 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 14:21:21 -0000 Author: kib Date: Wed Feb 8 14:21:20 2012 New Revision: 231203 URL: http://svn.freebsd.org/changeset/base/231203 Log: MFC r230866: Add kqueue support to /dev/klog. PR: kern/156423 Modified: stable/9/sys/kern/subr_log.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_log.c ============================================================================== --- stable/9/sys/kern/subr_log.c Wed Feb 8 14:09:08 2012 (r231202) +++ stable/9/sys/kern/subr_log.c Wed Feb 8 14:21:20 2012 (r231203) @@ -59,6 +59,7 @@ static d_close_t logclose; static d_read_t logread; static d_ioctl_t logioctl; static d_poll_t logpoll; +static d_kqfilter_t logkqfilter; static void logtimeout(void *arg); @@ -69,9 +70,20 @@ static struct cdevsw log_cdevsw = { .d_read = logread, .d_ioctl = logioctl, .d_poll = logpoll, + .d_kqfilter = logkqfilter, .d_name = "log", }; +static int logkqread(struct knote *note, long hint); +static void logkqdetach(struct knote *note); + +static struct filterops log_read_filterops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = logkqdetach, + .f_event = logkqread, +}; + static struct logsoftc { int sc_state; /* see above for possibilities */ struct selinfo sc_selp; /* process waiting on select call */ @@ -181,6 +193,40 @@ logpoll(struct cdev *dev, int events, st return (revents); } +static int +logkqfilter(struct cdev *dev, struct knote *kn) +{ + + if (kn->kn_filter != EVFILT_READ) + return (EINVAL); + + kn->kn_fop = &log_read_filterops; + kn->kn_hook = NULL; + + mtx_lock(&msgbuf_lock); + knlist_add(&logsoftc.sc_selp.si_note, kn, 1); + mtx_unlock(&msgbuf_lock); + return (0); +} + +static int +logkqread(struct knote *kn, long hint) +{ + + mtx_assert(&msgbuf_lock, MA_OWNED); + kn->kn_data = msgbuf_getcount(msgbufp); + return (kn->kn_data != 0); +} + +static void +logkqdetach(struct knote *kn) +{ + + mtx_lock(&msgbuf_lock); + knlist_remove(&logsoftc.sc_selp.si_note, kn, 1); + mtx_unlock(&msgbuf_lock); +} + static void logtimeout(void *arg) { @@ -198,6 +244,7 @@ logtimeout(void *arg) } msgbuftrigger = 0; selwakeuppri(&logsoftc.sc_selp, LOG_RDPRI); + KNOTE_LOCKED(&logsoftc.sc_selp.si_note, 0); if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL) pgsigio(&logsoftc.sc_sigio, SIGIO, 0); cv_broadcastpri(&log_wakeup, LOG_RDPRI); @@ -256,6 +303,7 @@ log_drvinit(void *unused) cv_init(&log_wakeup, "klog"); callout_init_mtx(&logsoftc.sc_callout, &msgbuf_lock, 0); + knlist_init_mtx(&logsoftc.sc_selp.si_note, &msgbuf_lock); make_dev_credf(MAKEDEV_ETERNAL, &log_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, "klog"); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 15:07:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0DC0106566B; Wed, 8 Feb 2012 15:07:19 +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 CFF598FC18; Wed, 8 Feb 2012 15:07:19 +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 q18F7Jfv048078; Wed, 8 Feb 2012 15:07:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18F7JmQ048076; Wed, 8 Feb 2012 15:07:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081507.q18F7JmQ048076@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 15:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231204 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 15:07:20 -0000 Author: kib Date: Wed Feb 8 15:07:19 2012 New Revision: 231204 URL: http://svn.freebsd.org/changeset/base/231204 Log: Unbreak detection of the async mode for clustered writes after r231075. Submitted by: bde MFC after: 12 days Modified: head/sys/kern/vfs_cluster.c Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Wed Feb 8 14:21:20 2012 (r231203) +++ head/sys/kern/vfs_cluster.c Wed Feb 8 15:07:19 2012 (r231204) @@ -604,7 +604,7 @@ cluster_write(struct vnode *vp, struct b int async; if (vp->v_type == VREG) { - async = vp->v_mount->mnt_kern_flag & MNTK_ASYNC; + async = DOINGASYNC(vp); lblocksize = vp->v_mount->mnt_stat.f_iosize; } else { async = 0; From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 15:19:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A67C4106566B; Wed, 8 Feb 2012 15:19:49 +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 94A038FC14; Wed, 8 Feb 2012 15:19:49 +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 q18FJniF048497; Wed, 8 Feb 2012 15:19:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18FJn8O048495; Wed, 8 Feb 2012 15:19:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081519.q18FJn8O048495@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 15:19:49 +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: r231205 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 15:19:49 -0000 Author: kib Date: Wed Feb 8 15:19:49 2012 New Revision: 231205 URL: http://svn.freebsd.org/changeset/base/231205 Log: MFC r230553: When doing vflush(WRITECLOSE), clean vnode pages. Unmounts do vfs_msync() before calling VFS_UNMOUNT(), but there is still a race allowing a process to dirty pages after msync finished. Remounts rw->ro just left dirty pages in system. Modified: stable/8/sys/kern/vfs_subr.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Wed Feb 8 15:07:19 2012 (r231204) +++ stable/8/sys/kern/vfs_subr.c Wed Feb 8 15:19:49 2012 (r231205) @@ -2501,6 +2501,18 @@ loop: * vnodes open for writing. */ if (flags & WRITECLOSE) { + if (vp->v_object != NULL) { + VM_OBJECT_LOCK(vp->v_object); + vm_object_page_clean(vp->v_object, 0, 0, 0); + VM_OBJECT_UNLOCK(vp->v_object); + } + error = VOP_FSYNC(vp, MNT_WAIT, td); + if (error != 0) { + VOP_UNLOCK(vp, 0); + vdrop(vp); + MNT_VNODE_FOREACH_ABORT(mp, mvp); + return (error); + } error = VOP_GETATTR(vp, &vattr, td->td_ucred); VI_LOCK(vp); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 15:37:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D3C81065670; Wed, 8 Feb 2012 15:37:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B42C8FC0C; Wed, 8 Feb 2012 15:37: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 q18FbZmp049075; Wed, 8 Feb 2012 15:37:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18FbZiq049073; Wed, 8 Feb 2012 15:37:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081537.q18FbZiq049073@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 15:37: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: r231206 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 15:37:35 -0000 Author: bz Date: Wed Feb 8 15:37:34 2012 New Revision: 231206 URL: http://svn.freebsd.org/changeset/base/231206 Log: MFC r225030: While not explicitly allowed by RFC 2460, in case there is no translation technology involved (and that section is suggested to be removed by Errata 2843), single packet fragments do not harm. There is another errata and further drafts under discussion to clarify on these kinds of packets. Meanwhile add a sysctl to allow disabling this behaviour again. We will treat single packet fragment (a fragment header added when not needed) as if there was no fragment header. Submitted by: Matthew Luckie (mjl luckie.org.nz) (original version) PR: kern/145733 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 15:19:49 2012 (r231205) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 15:37:34 2012 (r231206) @@ -103,6 +103,9 @@ static VNET_DEFINE(int, ipfw_vnet_ready) static VNET_DEFINE(int, fw_deny_unknown_exthdrs); #define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) +static VNET_DEFINE(int, fw_permit_single_frag6) = 1; +#define V_fw_permit_single_frag6 VNET(fw_permit_single_frag6) + #ifdef IPFIREWALL_DEFAULT_TO_ACCEPT static int default_to_accept = 1; #else @@ -177,6 +180,9 @@ SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, "Deny packets with unknown IPv6 Extension Headers"); +SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, permit_single_frag6, + CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_permit_single_frag6), 0, + "Permit single packet IPv6 fragments"); #endif /* INET6 */ SYSEND @@ -838,10 +844,14 @@ ipfw_chk(struct ip_fw_args *args) * we have a fragment at this offset of an IPv4 packet. * offset == 0 means that (if this is an IPv4 packet) * this is the first or only fragment. - * For IPv6 offset == 0 means there is no Fragment Header. + * For IPv6 offset == 0 means there is no Fragment Header or there + * is a single packet fragement (fragement header added without + * needed). We will treat a single packet fragment as if there + * was no fragment header (or log/block depending on the + * V_fw_permit_single_frag6 sysctl setting). * If offset != 0 for IPv6 always use correct mask to - * get the correct offset because we add IP6F_MORE_FRAG - * to be able to dectect the first fragment which would + * get the correct offset because we add IP6F_MORE_FRAG to be able + * to dectect the first of multiple fragments which would * otherwise have offset = 0. */ u_short offset = 0; @@ -1004,10 +1014,11 @@ do { \ offset = ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_OFF_MASK; /* Add IP6F_MORE_FRAG for offset of first - * fragment to be != 0. */ + * fragment to be != 0 if there shall be more. */ offset |= ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_MORE_FRAG; - if (offset == 0) { + if (V_fw_permit_single_frag6 == 0 && + offset == 0) { printf("IPFW2: IPV6 - Invalid Fragment " "Header\n"); if (V_fw_deny_unknown_exthdrs) From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 15:38:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C2A9106564A; Wed, 8 Feb 2012 15:38:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A3DF8FC12; Wed, 8 Feb 2012 15:38:37 +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 q18FcbnH049140; Wed, 8 Feb 2012 15:38:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18FcaTu049138; Wed, 8 Feb 2012 15:38:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081538.q18FcaTu049138@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 15:38:36 +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: r231207 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 15:38:37 -0000 Author: bz Date: Wed Feb 8 15:38:36 2012 New Revision: 231207 URL: http://svn.freebsd.org/changeset/base/231207 Log: MFC r225030: While not explicitly allowed by RFC 2460, in case there is no translation technology involved (and that section is suggested to be removed by Errata 2843), single packet fragments do not harm. There is another errata and further drafts under discussion to clarify on these kinds of packets. Meanwhile add a sysctl to allow disabling this behaviour again. We will treat single packet fragment (a fragment header added when not needed) as if there was no fragment header. Submitted by: Matthew Luckie (mjl luckie.org.nz) (original version) PR: kern/145733 Modified: stable/7/sys/netinet/ip_fw2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/ip_fw2.c ============================================================================== --- stable/7/sys/netinet/ip_fw2.c Wed Feb 8 15:37:34 2012 (r231206) +++ stable/7/sys/netinet/ip_fw2.c Wed Feb 8 15:38:36 2012 (r231207) @@ -110,6 +110,9 @@ static u_int32_t set_disable; static int fw_verbose; static struct callout ipfw_timeout; static int verbose_limit; +#ifdef INET6 +static int fw_permit_single_frag6 = 1; +#endif #ifdef IPFIREWALL_DEFAULT_TO_ACCEPT static int default_to_accept = 1; @@ -2158,10 +2161,14 @@ ipfw_chk(struct ip_fw_args *args) * we have a fragment at this offset of an IPv4 packet. * offset == 0 means that (if this is an IPv4 packet) * this is the first or only fragment. - * For IPv6 offset == 0 means there is no Fragment Header. + * For IPv6 offset == 0 means there is no Fragment Header or there + * is a single packet fragement (fragement header added without + * needed). We will treat a single packet fragment as if there + * was no fragment header (or log/block depending on the + * fw_permit_single_frag6 sysctl setting). * If offset != 0 for IPv6 always use correct mask to - * get the correct offset because we add IP6F_MORE_FRAG - * to be able to dectect the first fragment which would + * get the correct offset because we add IP6F_MORE_FRAG to be able + * to dectect the first of multiple fragments which would * otherwise have offset = 0. */ u_short offset = 0; @@ -2318,10 +2325,11 @@ do { \ offset = ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_OFF_MASK; /* Add IP6F_MORE_FRAG for offset of first - * fragment to be != 0. */ + * fragment to be != 0 if there shall be more. */ offset |= ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_MORE_FRAG; - if (offset == 0) { + if (fw_permit_single_frag6 == 0 && + offset == 0) { printf("IPFW2: IPV6 - Invalid Fragment " "Header\n"); if (fw_deny_unknown_exthdrs) @@ -4506,6 +4514,10 @@ ipfw_init(void) OID_AUTO, "deny_unknown_exthdrs", CTLFLAG_RW | CTLFLAG_SECURE, &fw_deny_unknown_exthdrs, 0, "Deny packets with unknown IPv6 Extension Headers"); + SYSCTL_ADD_INT(&ip6_fw_sysctl_ctx, SYSCTL_CHILDREN(ip6_fw_sysctl_tree), + OID_AUTO, "permit_single_frag6", CTLFLAG_RW | CTLFLAG_SECURE, + &fw_permit_single_frag6, 0, + "Permit single packet IPv6 fragments"); #endif layer3_chain.rules = NULL; From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 16:03:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F0BB106564A; Wed, 8 Feb 2012 16:03:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 322988FC15; Wed, 8 Feb 2012 16:03: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 q18G36iB050106; Wed, 8 Feb 2012 16:03:06 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18G35gB050103; Wed, 8 Feb 2012 16:03:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081603.q18G35gB050103@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 16:03:05 +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: r231208 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:03:06 -0000 Author: bz Date: Wed Feb 8 16:03:05 2012 New Revision: 231208 URL: http://svn.freebsd.org/changeset/base/231208 Log: MFC r225032,225034: ipfw internally checks for offset == 0 to determine whether the packet is a/the first fragment or not. For IPv6 we have added the "more fragments" flag as well to be able to determine on whether there will be more as we do not have the fragment header avaialble for logging, while for IPv4 this information can be derived directly from the IPv4 header. This allowed fragmented packets to bypass normal rules as proper masking was not done when checking offset. Split variables to not need masking for IPv6 to avoid further errors. After r225032 fix logging in a similar way masking the the IPv6 more fragments flag off so that offset == 0 checks work properly. Submitted by: Matthew Luckie (mjl luckie.org.nz) PR: kern/145733 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c stable/8/sys/netinet/ipfw/ip_fw_log.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 15:38:36 2012 (r231207) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:03:05 2012 (r231208) @@ -844,17 +844,14 @@ ipfw_chk(struct ip_fw_args *args) * we have a fragment at this offset of an IPv4 packet. * offset == 0 means that (if this is an IPv4 packet) * this is the first or only fragment. - * For IPv6 offset == 0 means there is no Fragment Header or there - * is a single packet fragement (fragement header added without - * needed). We will treat a single packet fragment as if there - * was no fragment header (or log/block depending on the + * For IPv6 offset|ip6f_mf == 0 means there is no Fragment Header + * or there is a single packet fragement (fragement header added + * without needed). We will treat a single packet fragment as if + * there was no fragment header (or log/block depending on the * V_fw_permit_single_frag6 sysctl setting). - * If offset != 0 for IPv6 always use correct mask to - * get the correct offset because we add IP6F_MORE_FRAG to be able - * to dectect the first of multiple fragments which would - * otherwise have offset = 0. */ u_short offset = 0; + u_short ip6f_mf = 0; /* * Local copies of addresses. They are only valid if we have @@ -1013,12 +1010,10 @@ do { \ proto = ((struct ip6_frag *)ulp)->ip6f_nxt; offset = ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_OFF_MASK; - /* Add IP6F_MORE_FRAG for offset of first - * fragment to be != 0 if there shall be more. */ - offset |= ((struct ip6_frag *)ulp)->ip6f_offlg & + ip6f_mf = ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_MORE_FRAG; if (V_fw_permit_single_frag6 == 0 && - offset == 0) { + offset == 0 && ip6f_mf == 0) { printf("IPFW2: IPV6 - Invalid Fragment " "Header\n"); if (V_fw_deny_unknown_exthdrs) @@ -1666,7 +1661,7 @@ do { \ case O_LOG: ipfw_log(f, hlen, args, m, - oif, offset, tablearg, ip); + oif, offset | ip6f_mf, tablearg, ip); match = 1; break; Modified: stable/8/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_log.c Wed Feb 8 15:38:36 2012 (r231207) +++ stable/8/sys/netinet/ipfw/ip_fw_log.c Wed Feb 8 16:03:05 2012 (r231208) @@ -328,10 +328,14 @@ ipfw_log(struct ip_fw *f, u_int hlen, st #ifdef INET6 struct ip6_hdr *ip6 = NULL; struct icmp6_hdr *icmp6; + u_short ip6f_mf; #endif src[0] = '\0'; dst[0] = '\0'; #ifdef INET6 + ip6f_mf = offset & IP6F_MORE_FRAG; + offset &= IP6F_OFF_MASK; + if (IS_IP6_FLOW_ID(&(args->f_id))) { char ip6buf[INET6_ADDRSTRLEN]; snprintf(src, sizeof(src), "[%s]", @@ -413,8 +417,7 @@ ipfw_log(struct ip_fw *f, u_int hlen, st " (frag %08x:%d@%d%s)", args->f_id.extra, ntohs(ip6->ip6_plen) - hlen, - ntohs(offset & IP6F_OFF_MASK) << 3, - (offset & IP6F_MORE_FRAG) ? "+" : ""); + ntohs(offset) << 3, ip6f_mf ? "+" : ""); } else #endif { From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 16:07:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 123CA106566B; Wed, 8 Feb 2012 16:07:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9CB58FC14; Wed, 8 Feb 2012 16:07: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 q18G77mA050265; Wed, 8 Feb 2012 16:07:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18G774q050262; Wed, 8 Feb 2012 16:07:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081607.q18G774q050262@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 16:07:07 +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: r231209 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:07:08 -0000 Author: bz Date: Wed Feb 8 16:07:07 2012 New Revision: 231209 URL: http://svn.freebsd.org/changeset/base/231209 Log: MFC r225032,225034: ipfw internally checks for offset == 0 to determine whether the packet is a/the first fragment or not. For IPv6 we have added the "more fragments" flag as well to be able to determine on whether there will be more as we do not have the fragment header avaialble for logging, while for IPv4 this information can be derived directly from the IPv4 header. This allowed fragmented packets to bypass normal rules as proper masking was not done when checking offset. Split variables to not need masking for IPv6 to avoid further errors. After r225032 fix logging in a similar way masking the the IPv6 more fragments flag off so that offset == 0 checks work properly. Submitted by: Matthew Luckie (mjl luckie.org.nz) PR: kern/145733 Modified: stable/7/sys/netinet/ip_fw2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/ip_fw2.c ============================================================================== --- stable/7/sys/netinet/ip_fw2.c Wed Feb 8 16:03:05 2012 (r231208) +++ stable/7/sys/netinet/ip_fw2.c Wed Feb 8 16:07:07 2012 (r231209) @@ -897,10 +897,14 @@ ipfw_log(struct ip_fw *f, u_int hlen, st #ifdef INET6 struct ip6_hdr *ip6 = NULL; struct icmp6_hdr *icmp6; + u_short ip6f_mf; #endif src[0] = '\0'; dst[0] = '\0'; #ifdef INET6 + ip6f_mf = offset & IP6F_MORE_FRAG; + offset &= IP6F_OFF_MASK; + if (IS_IP6_FLOW_ID(&(args->f_id))) { char ip6buf[INET6_ADDRSTRLEN]; snprintf(src, sizeof(src), "[%s]", @@ -982,8 +986,7 @@ ipfw_log(struct ip_fw *f, u_int hlen, st " (frag %08x:%d@%d%s)", args->f_id.frag_id6, ntohs(ip6->ip6_plen) - hlen, - ntohs(offset & IP6F_OFF_MASK) << 3, - (offset & IP6F_MORE_FRAG) ? "+" : ""); + ntohs(offset) << 3, ip6f_mf ? "+" : ""); } else #endif { @@ -2161,17 +2164,14 @@ ipfw_chk(struct ip_fw_args *args) * we have a fragment at this offset of an IPv4 packet. * offset == 0 means that (if this is an IPv4 packet) * this is the first or only fragment. - * For IPv6 offset == 0 means there is no Fragment Header or there - * is a single packet fragement (fragement header added without - * needed). We will treat a single packet fragment as if there - * was no fragment header (or log/block depending on the + * For IPv6 offset|ip6f_mf == 0 means there is no Fragment Header + * or there is a single packet fragement (fragement header added + * without needed). We will treat a single packet fragment as if + * there was no fragment header (or log/block depending on the * fw_permit_single_frag6 sysctl setting). - * If offset != 0 for IPv6 always use correct mask to - * get the correct offset because we add IP6F_MORE_FRAG to be able - * to dectect the first of multiple fragments which would - * otherwise have offset = 0. */ u_short offset = 0; + u_short ip6f_mf = 0; /* * Local copies of addresses. They are only valid if we have @@ -2324,12 +2324,10 @@ do { \ proto = ((struct ip6_frag *)ulp)->ip6f_nxt; offset = ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_OFF_MASK; - /* Add IP6F_MORE_FRAG for offset of first - * fragment to be != 0 if there shall be more. */ - offset |= ((struct ip6_frag *)ulp)->ip6f_offlg & + ip6f_mf = ((struct ip6_frag *)ulp)->ip6f_offlg & IP6F_MORE_FRAG; if (fw_permit_single_frag6 == 0 && - offset == 0) { + offset == 0 && ip6f_mf == 0) { printf("IPFW2: IPV6 - Invalid Fragment " "Header\n"); if (fw_deny_unknown_exthdrs) @@ -2918,7 +2916,7 @@ check_body: case O_LOG: if (fw_verbose) ipfw_log(f, hlen, args, m, - oif, offset, tablearg, ip); + oif, offset | ip6f_mf, tablearg, ip); match = 1; break; From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 16:24:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6D03106564A; Wed, 8 Feb 2012 16:24:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C51FF8FC08; Wed, 8 Feb 2012 16:24: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 q18GOuwb050963; Wed, 8 Feb 2012 16:24:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18GOuVr050961; Wed, 8 Feb 2012 16:24:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081624.q18GOuVr050961@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 16:24: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: r231210 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:24:56 -0000 Author: bz Date: Wed Feb 8 16:24:56 2012 New Revision: 231210 URL: http://svn.freebsd.org/changeset/base/231210 Log: MFC r225033: If we detect an IPv6 fragment header and it is not the first fragment, then terminate the loop as we will not find any further headers and for short fragments this could otherwise lead to a pullup error discarding the fragment. Submitted by: Matthew Luckie (mjl luckie.org.nz) PR: kern/145733 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:07:07 2012 (r231209) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:24:56 2012 (r231210) @@ -945,7 +945,7 @@ do { \ proto = ip6->ip6_nxt; /* Search extension headers to find upper layer protocols */ - while (ulp == NULL) { + while (ulp == NULL && offset == 0) { switch (proto) { case IPPROTO_ICMPV6: PULLUP_TO(hlen, ulp, struct icmp6_hdr); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 16:26:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3A0F1065676; Wed, 8 Feb 2012 16:26:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D21088FC1D; Wed, 8 Feb 2012 16:26: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 q18GQ16w051034; Wed, 8 Feb 2012 16:26:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18GQ1gu051032; Wed, 8 Feb 2012 16:26:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081626.q18GQ1gu051032@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 16:26:01 +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: r231211 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:26:02 -0000 Author: bz Date: Wed Feb 8 16:26:01 2012 New Revision: 231211 URL: http://svn.freebsd.org/changeset/base/231211 Log: MFC r225033: If we detect an IPv6 fragment header and it is not the first fragment, then terminate the loop as we will not find any further headers and for short fragments this could otherwise lead to a pullup error discarding the fragment. Submitted by: Matthew Luckie (mjl luckie.org.nz) PR: kern/145733 Modified: stable/7/sys/netinet/ip_fw2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/ip_fw2.c ============================================================================== --- stable/7/sys/netinet/ip_fw2.c Wed Feb 8 16:24:56 2012 (r231210) +++ stable/7/sys/netinet/ip_fw2.c Wed Feb 8 16:26:01 2012 (r231211) @@ -2260,7 +2260,7 @@ do { \ proto = ip6->ip6_nxt; /* Search extension headers to find upper layer protocols */ - while (ulp == NULL) { + while (ulp == NULL && offset == 0) { switch (proto) { case IPPROTO_ICMPV6: PULLUP_TO(hlen, ulp, struct icmp6_hdr); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 16:44:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EE48106564A; Wed, 8 Feb 2012 16:44:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D17E8FC18; Wed, 8 Feb 2012 16:44:55 +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 q18GisRr051754; Wed, 8 Feb 2012 16:44:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18GisSD051752; Wed, 8 Feb 2012 16:44:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081644.q18GisSD051752@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 16:44:54 +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: r231212 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:44:55 -0000 Author: bz Date: Wed Feb 8 16:44:54 2012 New Revision: 231212 URL: http://svn.freebsd.org/changeset/base/231212 Log: MFC r225036: Hide IPv6 next header parsing warnings under the verbose sysctl so people can possibly disable it when their consoles are flooded, or enabled it for debugging. Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:26:01 2012 (r231211) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Wed Feb 8 16:44:54 2012 (r231212) @@ -990,9 +990,11 @@ do { \ ext_hd |= EXT_RTHDR2; break; default: - printf("IPFW2: IPV6 - Unknown Routing " - "Header type(%d)\n", - ((struct ip6_rthdr *)ulp)->ip6r_type); + if (V_fw_verbose) + printf("IPFW2: IPV6 - Unknown " + "Routing Header type(%d)\n", + ((struct ip6_rthdr *) + ulp)->ip6r_type); if (V_fw_deny_unknown_exthdrs) return (IP_FW_DENY); break; @@ -1014,8 +1016,9 @@ do { \ IP6F_MORE_FRAG; if (V_fw_permit_single_frag6 == 0 && offset == 0 && ip6f_mf == 0) { - printf("IPFW2: IPV6 - Invalid Fragment " - "Header\n"); + if (V_fw_verbose) + printf("IPFW2: IPV6 - Invalid " + "Fragment Header\n"); if (V_fw_deny_unknown_exthdrs) return (IP_FW_DENY); break; @@ -1086,8 +1089,10 @@ do { \ break; default: - printf("IPFW2: IPV6 - Unknown Extension " - "Header(%d), ext_hd=%x\n", proto, ext_hd); + if (V_fw_verbose) + printf("IPFW2: IPV6 - Unknown " + "Extension Header(%d), ext_hd=%x\n", + proto, ext_hd); if (V_fw_deny_unknown_exthdrs) return (IP_FW_DENY); PULLUP_TO(hlen, ulp, struct ip6_ext); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 16:45:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0248C1065744; Wed, 8 Feb 2012 16:45:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CADC18FC17; Wed, 8 Feb 2012 16:45: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 q18GjKbr051807; Wed, 8 Feb 2012 16:45:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18GjKL4051805; Wed, 8 Feb 2012 16:45:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081645.q18GjKL4051805@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 16:45: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: r231213 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 16:45:21 -0000 Author: bz Date: Wed Feb 8 16:45:20 2012 New Revision: 231213 URL: http://svn.freebsd.org/changeset/base/231213 Log: MFC r225036: Hide IPv6 next header parsing warnings under the verbose sysctl so people can possibly disable it when their consoles are flooded, or enabled it for debugging. Modified: stable/7/sys/netinet/ip_fw2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/ip_fw2.c ============================================================================== --- stable/7/sys/netinet/ip_fw2.c Wed Feb 8 16:44:54 2012 (r231212) +++ stable/7/sys/netinet/ip_fw2.c Wed Feb 8 16:45:20 2012 (r231213) @@ -2304,9 +2304,11 @@ do { \ ext_hd |= EXT_RTHDR2; break; default: - printf("IPFW2: IPV6 - Unknown Routing " - "Header type(%d)\n", - ((struct ip6_rthdr *)ulp)->ip6r_type); + if (fw_verbose) + printf("IPFW2: IPV6 - Unknown " + "Routing Header type(%d)\n", + ((struct ip6_rthdr *) + ulp)->ip6r_type); if (fw_deny_unknown_exthdrs) return (IP_FW_DENY); break; @@ -2328,8 +2330,9 @@ do { \ IP6F_MORE_FRAG; if (fw_permit_single_frag6 == 0 && offset == 0 && ip6f_mf == 0) { - printf("IPFW2: IPV6 - Invalid Fragment " - "Header\n"); + if (fw_verbose) + printf("IPFW2: IPV6 - Invalid " + "Fragment Header\n"); if (fw_deny_unknown_exthdrs) return (IP_FW_DENY); break; @@ -2400,8 +2403,10 @@ do { \ break; default: - printf("IPFW2: IPV6 - Unknown Extension " - "Header(%d), ext_hd=%x\n", proto, ext_hd); + if (fw_verbose) + printf("IPFW2: IPV6 - Unknown " + "Extension Header(%d), ext_hd=%x\n", + proto, ext_hd); if (fw_deny_unknown_exthdrs) return (IP_FW_DENY); PULLUP_TO(hlen, ulp, struct ip6_ext); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 17:03:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0087E106566B; Wed, 8 Feb 2012 17:03:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2EC08FC16; Wed, 8 Feb 2012 17:03: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 q18H3CfT052452; Wed, 8 Feb 2012 17:03:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18H3CoW052450; Wed, 8 Feb 2012 17:03:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081703.q18H3CoW052450@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 17:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231214 - stable/8/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 17:03:13 -0000 Author: bz Date: Wed Feb 8 17:03:12 2012 New Revision: 231214 URL: http://svn.freebsd.org/changeset/base/231214 Log: MFC r225428: Shorten a variable access some using a cached value rather than casting the input argument again, making the code more readable. Reviewed by: jhb Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Wed Feb 8 16:45:20 2012 (r231213) +++ stable/8/sys/dev/mfi/mfi.c Wed Feb 8 17:03:12 2012 (r231214) @@ -2154,8 +2154,7 @@ mfi_ioctl(struct cdev *dev, u_long cmd, if (ioc->mfi_sense_len) { /* get user-space sense ptr then copy out sense */ - bcopy(&((struct mfi_ioc_packet*)arg) - ->mfi_frame.raw[ioc->mfi_sense_off], + bcopy(&ioc->mfi_frame.raw[ioc->mfi_sense_off], &sense_ptr.sense_ptr_data[0], sizeof(sense_ptr.sense_ptr_data)); #ifdef __amd64__ From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 17:03:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DE231065677; Wed, 8 Feb 2012 17:03:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5668FC19; Wed, 8 Feb 2012 17:03:31 +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 q18H3VuQ052497; Wed, 8 Feb 2012 17:03:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18H3VKv052495; Wed, 8 Feb 2012 17:03:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081703.q18H3VKv052495@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 17:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231215 - stable/7/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 17:03:31 -0000 Author: bz Date: Wed Feb 8 17:03:30 2012 New Revision: 231215 URL: http://svn.freebsd.org/changeset/base/231215 Log: MFC r225428: Shorten a variable access some using a cached value rather than casting the input argument again, making the code more readable. Reviewed by: jhb Modified: stable/7/sys/dev/mfi/mfi.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/mfi/mfi.c ============================================================================== --- stable/7/sys/dev/mfi/mfi.c Wed Feb 8 17:03:12 2012 (r231214) +++ stable/7/sys/dev/mfi/mfi.c Wed Feb 8 17:03:30 2012 (r231215) @@ -2133,8 +2133,7 @@ mfi_ioctl(struct cdev *dev, u_long cmd, if (ioc->mfi_sense_len) { /* get user-space sense ptr then copy out sense */ - bcopy(&((struct mfi_ioc_packet*)arg) - ->mfi_frame.raw[ioc->mfi_sense_off], + bcopy(&ioc->mfi_frame.raw[ioc->mfi_sense_off], &sense_ptr.sense_ptr_data[0], sizeof(sense_ptr.sense_ptr_data)); #ifdef __amd64__ From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 17:30:09 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E3BF106564A; Wed, 8 Feb 2012 17:30:09 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 059088FC16; Wed, 8 Feb 2012 17:30:08 +0000 (UTC) Received: from [172.23.7.29] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q18H3uNU035977 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 8 Feb 2012 09:04:02 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201202052356.q15NuNuh007220@svn.freebsd.org> Date: Wed, 8 Feb 2012 09:03:51 -0800 Content-Transfer-Encoding: 7bit Message-Id: <1FDDE018-A652-44D1-B4A4-B52713A36108@xcllnt.net> References: <201202052356.q15NuNuh007220@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231057 - in head: contrib/llvm/tools/bugpoint contrib/llvm/tools/llc contrib/llvm/tools/lli contrib/llvm/tools/llvm-ar contrib/llvm/tools/llvm-as contrib/llvm/tools/llvm-bcanalyzer con... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 17:30:09 -0000 On Feb 5, 2012, at 3:56 PM, Dimitry Andric wrote: > Author: dim > Date: Sun Feb 5 23:56:22 2012 > New Revision: 231057 > URL: http://svn.freebsd.org/changeset/base/231057 > > Log: > Add a WITH_CLANG_EXTRAS option for src.conf(5), disabled by default, > that builds the following additional llvm/clang tools: Thanks! -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 17:54:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1341065675; Wed, 8 Feb 2012 17:54:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAF188FC08; Wed, 8 Feb 2012 17:54: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 q18Hs27H054100; Wed, 8 Feb 2012 17:54:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Hs2eK054096; Wed, 8 Feb 2012 17:54:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081754.q18Hs2eK054096@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 17:54:02 +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: r231216 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 17:54:03 -0000 Author: bz Date: Wed Feb 8 17:54:02 2012 New Revision: 231216 URL: http://svn.freebsd.org/changeset/base/231216 Log: MFC r222845: Correct comments and debug logging in ipsec to better match reality. Modified: stable/8/sys/netinet/ip_input.c stable/8/sys/netinet/ip_ipsec.c stable/8/sys/netinet6/ip6_ipsec.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ip_input.c ============================================================================== --- stable/8/sys/netinet/ip_input.c Wed Feb 8 17:03:30 2012 (r231215) +++ stable/8/sys/netinet/ip_input.c Wed Feb 8 17:54:02 2012 (r231216) @@ -510,7 +510,7 @@ tooshort: } #ifdef IPSEC /* - * Bypass packet filtering for packets from a tunnel (gif). + * Bypass packet filtering for packets previously handled by IPsec. */ if (ip_ipsec_filtertunnel(m)) goto passin; Modified: stable/8/sys/netinet/ip_ipsec.c ============================================================================== --- stable/8/sys/netinet/ip_ipsec.c Wed Feb 8 17:03:30 2012 (r231215) +++ stable/8/sys/netinet/ip_ipsec.c Wed Feb 8 17:54:02 2012 (r231216) @@ -95,7 +95,7 @@ ip_ipsec_filtertunnel(struct mbuf *m) #if defined(IPSEC) /* - * Bypass packet filtering for packets from a tunnel. + * Bypass packet filtering for packets previously handled by IPsec. */ if (!V_ip4_ipsec_filtertunnel && m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) Modified: stable/8/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/8/sys/netinet6/ip6_ipsec.c Wed Feb 8 17:03:30 2012 (r231215) +++ stable/8/sys/netinet6/ip6_ipsec.c Wed Feb 8 17:54:02 2012 (r231216) @@ -95,7 +95,7 @@ SYSCTL_VNET_INT(_net_inet6_ipsec6, OID_A /* * Check if we have to jump over firewall processing for this packet. - * Called from ip_input(). + * Called from ip6_input(). * 1 = jump over firewall, 0 = packet goes through firewall. */ int @@ -104,7 +104,7 @@ ip6_ipsec_filtertunnel(struct mbuf *m) #if defined(IPSEC) /* - * Bypass packet filtering for packets from a tunnel. + * Bypass packet filtering for packets previously handled by IPsec. */ if (!V_ip6_ipsec6_filtertunnel && m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) @@ -116,7 +116,7 @@ ip6_ipsec_filtertunnel(struct mbuf *m) /* * Check if this packet has an active SA and needs to be dropped instead * of forwarded. - * Called from ip_input(). + * Called from ip6_input(). * 1 = drop packet, 0 = forward packet. */ int @@ -139,7 +139,7 @@ ip6_ipsec_fwd(struct mbuf *m) if (sp == NULL) { /* NB: can happen if error */ splx(s); /*XXX error stat???*/ - DPRINTF(("ip_input: no SP for forwarding\n")); /*XXX*/ + DPRINTF(("%s: no SP for forwarding\n", __func__)); /*XXX*/ return 1; } @@ -161,7 +161,7 @@ ip6_ipsec_fwd(struct mbuf *m) * Check if protocol type doesn't have a further header and do IPSEC * decryption or reject right now. Protocols with further headers get * their IPSEC treatment within the protocol specific processing. - * Called from ip_input(). + * Called from ip6_input(). * 1 = drop packet, 0 = continue processing packet. */ int @@ -204,7 +204,7 @@ ip6_ipsec_input(struct mbuf *m, int nxt) } else { /* XXX error stat??? */ error = EINVAL; - DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/ + DPRINTF(("%s: no SP, packet discarded\n", __func__));/*XXX*/ return 1; } splx(s); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 17:54:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83ED31065670; Wed, 8 Feb 2012 17:54:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71C498FC12; Wed, 8 Feb 2012 17:54: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 q18HsCSM054143; Wed, 8 Feb 2012 17:54:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18HsCpI054138; Wed, 8 Feb 2012 17:54:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081754.q18HsCpI054138@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 17:54:12 +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: r231217 - in stable/7/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 17:54:12 -0000 Author: bz Date: Wed Feb 8 17:54:11 2012 New Revision: 231217 URL: http://svn.freebsd.org/changeset/base/231217 Log: MFC r222845: Correct comments and debug logging in ipsec to better match reality. Modified: stable/7/sys/netinet/ip_input.c stable/7/sys/netinet/ip_ipsec.c stable/7/sys/netinet6/ip6_ipsec.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/netinet/ip_input.c ============================================================================== --- stable/7/sys/netinet/ip_input.c Wed Feb 8 17:54:02 2012 (r231216) +++ stable/7/sys/netinet/ip_input.c Wed Feb 8 17:54:11 2012 (r231217) @@ -393,7 +393,7 @@ tooshort: } #ifdef IPSEC /* - * Bypass packet filtering for packets from a tunnel (gif). + * Bypass packet filtering for packets previously handled by IPsec. */ if (ip_ipsec_filtertunnel(m)) goto passin; Modified: stable/7/sys/netinet/ip_ipsec.c ============================================================================== --- stable/7/sys/netinet/ip_ipsec.c Wed Feb 8 17:54:02 2012 (r231216) +++ stable/7/sys/netinet/ip_ipsec.c Wed Feb 8 17:54:11 2012 (r231217) @@ -75,7 +75,7 @@ ip_ipsec_filtertunnel(struct mbuf *m) { #if defined(IPSEC) && !defined(IPSEC_FILTERTUNNEL) /* - * Bypass packet filtering for packets from a tunnel. + * Bypass packet filtering for packets previously handled by IPsec. */ if (m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) return 1; Modified: stable/7/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/7/sys/netinet6/ip6_ipsec.c Wed Feb 8 17:54:02 2012 (r231216) +++ stable/7/sys/netinet6/ip6_ipsec.c Wed Feb 8 17:54:11 2012 (r231217) @@ -75,7 +75,7 @@ extern struct protosw inet6sw[]; /* * Check if we have to jump over firewall processing for this packet. - * Called from ip_input(). + * Called from ip6_input(). * 1 = jump over firewall, 0 = packet goes through firewall. */ int @@ -83,7 +83,7 @@ ip6_ipsec_filtertunnel(struct mbuf *m) { #if defined(IPSEC) && !defined(IPSEC_FILTERTUNNEL) /* - * Bypass packet filtering for packets from a tunnel. + * Bypass packet filtering for packets previously handled by IPsec. */ if (m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) return 1; @@ -94,7 +94,7 @@ ip6_ipsec_filtertunnel(struct mbuf *m) /* * Check if this packet has an active SA and needs to be dropped instead * of forwarded. - * Called from ip_input(). + * Called from ip6_input(). * 1 = drop packet, 0 = forward packet. */ int @@ -117,7 +117,7 @@ ip6_ipsec_fwd(struct mbuf *m) if (sp == NULL) { /* NB: can happen if error */ splx(s); /*XXX error stat???*/ - DPRINTF(("ip_input: no SP for forwarding\n")); /*XXX*/ + DPRINTF(("%s: no SP for forwarding\n", __func__)); /*XXX*/ return 1; } @@ -139,7 +139,7 @@ ip6_ipsec_fwd(struct mbuf *m) * Check if protocol type doesn't have a further header and do IPSEC * decryption or reject right now. Protocols with further headers get * their IPSEC treatment within the protocol specific processing. - * Called from ip_input(). + * Called from ip6_input(). * 1 = drop packet, 0 = continue processing packet. */ int @@ -182,7 +182,7 @@ ip6_ipsec_input(struct mbuf *m, int nxt) } else { /* XXX error stat??? */ error = EINVAL; - DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/ + DPRINTF(("%s: no SP, packet discarded\n", __func__));/*XXX*/ return 1; } splx(s); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 18:21:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CA2B106564A; Wed, 8 Feb 2012 18:21:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B6B08FC1E; Wed, 8 Feb 2012 18:21:49 +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 q18ILnMC055090; Wed, 8 Feb 2012 18:21:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18ILnDm055088; Wed, 8 Feb 2012 18:21:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081821.q18ILnDm055088@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 18:21:49 +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: r231218 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:21:49 -0000 Author: bz Date: Wed Feb 8 18:21:48 2012 New Revision: 231218 URL: http://svn.freebsd.org/changeset/base/231218 Log: Remove sun4v from universe targets. Approved by: re Modified: stable/8/Makefile Modified: stable/8/Makefile ============================================================================== --- stable/8/Makefile Wed Feb 8 17:54:11 2012 (r231217) +++ stable/8/Makefile Wed Feb 8 18:21:48 2012 (r231218) @@ -284,7 +284,7 @@ toolchains: # existing system is. # .if make(universe) || make(universe_kernels) || make(tinderbox) -TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v +TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 .if defined(UNIVERSE_TARGET) MAKE_JUST_WORLDS= YES From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 18:22:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CEE110656D4; Wed, 8 Feb 2012 18:22:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BACD8FC17; Wed, 8 Feb 2012 18:22: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 q18IMBRX055151; Wed, 8 Feb 2012 18:22:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18IMBwm055149; Wed, 8 Feb 2012 18:22:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081822.q18IMBwm055149@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 18:22:11 +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: r231219 - stable/7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:22:11 -0000 Author: bz Date: Wed Feb 8 18:22:10 2012 New Revision: 231219 URL: http://svn.freebsd.org/changeset/base/231219 Log: Remove sun4v from universe targets. Approved by: re Modified: stable/7/Makefile Modified: stable/7/Makefile ============================================================================== --- stable/7/Makefile Wed Feb 8 18:21:48 2012 (r231218) +++ stable/7/Makefile Wed Feb 8 18:22:10 2012 (r231219) @@ -272,7 +272,7 @@ make: .PHONY # existing system is. # .if make(universe) -TARGETS?=amd64 arm i386 ia64 pc98 powerpc sparc64 sun4v +TARGETS?=amd64 arm i386 ia64 pc98 powerpc sparc64 universe: universe_prologue universe_prologue: From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 18:36:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04666106564A; Wed, 8 Feb 2012 18:36:08 +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 E7DF38FC12; Wed, 8 Feb 2012 18:36: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 q18Ia7vf055654; Wed, 8 Feb 2012 18:36:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Ia7jw055652; Wed, 8 Feb 2012 18:36:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081836.q18Ia7jw055652@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 18:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231220 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:36:08 -0000 Author: kib Date: Wed Feb 8 18:36:07 2012 New Revision: 231220 URL: http://svn.freebsd.org/changeset/base/231220 Log: Trim 8 unused bytes from struct vnode on 64-bit architectures. Reviewed by: alc Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Feb 8 18:22:10 2012 (r231219) +++ head/sys/sys/vnode.h Wed Feb 8 18:36:07 2012 (r231220) @@ -149,8 +149,8 @@ struct vnode { struct lock *v_vnlock; /* u pointer to vnode lock */ int v_holdcnt; /* i prevents recycling. */ int v_usecount; /* i ref count of users */ - u_long v_iflag; /* i vnode flags (see below) */ - u_long v_vflag; /* v vnode flags */ + u_int v_iflag; /* i vnode flags (see below) */ + u_int v_vflag; /* v vnode flags */ int v_writecount; /* v ref count of writers */ /* From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 18:51:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC25106564A; Wed, 8 Feb 2012 18:51:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 938758FC08; Wed, 8 Feb 2012 18:51: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 q18IpBvF056190; Wed, 8 Feb 2012 18:51:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18IpBp8056187; Wed, 8 Feb 2012 18:51:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081851.q18IpBp8056187@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 18:51: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: r231221 - stable/9/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:51:11 -0000 Author: bz Date: Wed Feb 8 18:51:10 2012 New Revision: 231221 URL: http://svn.freebsd.org/changeset/base/231221 Log: MFC r228641: Allow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum offloading on vlans and document the new option. Modified: stable/9/sbin/ifconfig/ifconfig.8 stable/9/sbin/ifconfig/ifvlan.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) Modified: stable/9/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:36:07 2012 (r231220) +++ stable/9/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:51:10 2012 (r231221) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 13, 2011 +.Dd December 17, 2011 .Dt IFCONFIG 8 .Os .Sh NAME @@ -423,10 +423,10 @@ they support in their capabilities. is a synonym for enabling all available WOL mechanisms. To disable WOL use .Fl wol . -.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso +.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwcsum, vlanhwtso If the driver offers user-configurable VLAN support, enable reception of extended frames, tag processing in hardware, -frame filtering in hardware, or TSO on VLAN, +frame filtering in hardware, checksum offloading, or TSO on VLAN, respectively. Note that this must be issued on a physical interface associated with .Xr vlan 4 , Modified: stable/9/sbin/ifconfig/ifvlan.c ============================================================================== --- stable/9/sbin/ifconfig/ifvlan.c Wed Feb 8 18:36:07 2012 (r231220) +++ stable/9/sbin/ifconfig/ifvlan.c Wed Feb 8 18:51:10 2012 (r231221) @@ -183,6 +183,8 @@ static struct cmd vlan_cmds[] = { DEF_CMD("-vlanhwfilter", -IFCAP_VLAN_HWFILTER, setifcap), DEF_CMD("-vlanhwtso", -IFCAP_VLAN_HWTSO, setifcap), DEF_CMD("vlanhwtso", IFCAP_VLAN_HWTSO, setifcap), + DEF_CMD("vlanhwcsum", IFCAP_VLAN_HWCSUM, setifcap), + DEF_CMD("-vlanhwcsum", -IFCAP_VLAN_HWCSUM, setifcap), }; static struct afswtch af_vlan = { .af_name = "af_vlan", From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 18:51:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF5C21065672; Wed, 8 Feb 2012 18:51:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 936958FC14; Wed, 8 Feb 2012 18:51: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 q18IpK09056232; Wed, 8 Feb 2012 18:51:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18IpK8c056229; Wed, 8 Feb 2012 18:51:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081851.q18IpK8c056229@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 18:51:20 +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: r231222 - stable/8/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:51:20 -0000 Author: bz Date: Wed Feb 8 18:51:20 2012 New Revision: 231222 URL: http://svn.freebsd.org/changeset/base/231222 Log: MFC r228641: Allow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum offloading on vlans and document the new option. Modified: stable/8/sbin/ifconfig/ifconfig.8 stable/8/sbin/ifconfig/ifvlan.c Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:51:10 2012 (r231221) +++ stable/8/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:51:20 2012 (r231222) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd March 20, 2011 +.Dd December 17, 2011 .Dt IFCONFIG 8 .Os .Sh NAME @@ -408,10 +408,10 @@ they support in their capabilities. is a synonym for enabling all available WOL mechanisms. To disable WOL use .Fl wol . -.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso +.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwcsum, vlanhwtso If the driver offers user-configurable VLAN support, enable reception of extended frames, tag processing in hardware, -frame filtering in hardware, or TSO on VLAN, +frame filtering in hardware, checksum offloading, or TSO on VLAN, respectively. Note that this must be issued on a physical interface associated with .Xr vlan 4 , Modified: stable/8/sbin/ifconfig/ifvlan.c ============================================================================== --- stable/8/sbin/ifconfig/ifvlan.c Wed Feb 8 18:51:10 2012 (r231221) +++ stable/8/sbin/ifconfig/ifvlan.c Wed Feb 8 18:51:20 2012 (r231222) @@ -183,6 +183,8 @@ static struct cmd vlan_cmds[] = { DEF_CMD("-vlanhwfilter", -IFCAP_VLAN_HWFILTER, setifcap), DEF_CMD("-vlanhwtso", -IFCAP_VLAN_HWTSO, setifcap), DEF_CMD("vlanhwtso", IFCAP_VLAN_HWTSO, setifcap), + DEF_CMD("vlanhwcsum", IFCAP_VLAN_HWCSUM, setifcap), + DEF_CMD("-vlanhwcsum", -IFCAP_VLAN_HWCSUM, setifcap), }; static struct afswtch af_vlan = { .af_name = "af_vlan", From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 18:51:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 145971065868; Wed, 8 Feb 2012 18:51:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3851C8FC17; Wed, 8 Feb 2012 18:51: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 q18IpQ9Z056273; Wed, 8 Feb 2012 18:51:26 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18IpPjP056270; Wed, 8 Feb 2012 18:51:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081851.q18IpPjP056270@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 18:51:25 +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: r231223 - stable/7/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:51:27 -0000 Author: bz Date: Wed Feb 8 18:51:25 2012 New Revision: 231223 URL: http://svn.freebsd.org/changeset/base/231223 Log: MFC r228641: Allow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum offloading on vlans and document the new option. Modified: stable/7/sbin/ifconfig/ifconfig.8 stable/7/sbin/ifconfig/ifvlan.c Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:51:20 2012 (r231222) +++ stable/7/sbin/ifconfig/ifconfig.8 Wed Feb 8 18:51:25 2012 (r231223) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd March 20, 2011 +.Dd December 17, 2011 .Dt IFCONFIG 8 .Os .Sh NAME @@ -402,10 +402,10 @@ they support in their capabilities. is a synonym for enabling all available WOL mechanisms. To disable WOL use .Fl wol . -.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso +.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwcsum, vlanhwtso If the driver offers user-configurable VLAN support, enable reception of extended frames, tag processing in hardware, -frame filtering in hardware, or TSO on VLAN, +frame filtering in hardware, checksum offloading, or TSO on VLAN, respectively. Note that this must be issued on a physical interface associated with .Xr vlan 4 , Modified: stable/7/sbin/ifconfig/ifvlan.c ============================================================================== --- stable/7/sbin/ifconfig/ifvlan.c Wed Feb 8 18:51:20 2012 (r231222) +++ stable/7/sbin/ifconfig/ifvlan.c Wed Feb 8 18:51:25 2012 (r231223) @@ -184,6 +184,8 @@ static struct cmd vlan_cmds[] = { DEF_CMD("-vlanhwfilter", -IFCAP_VLAN_HWFILTER, setifcap), DEF_CMD("-vlanhwtso", -IFCAP_VLAN_HWTSO, setifcap), DEF_CMD("vlanhwtso", IFCAP_VLAN_HWTSO, setifcap), + DEF_CMD("vlanhwcsum", IFCAP_VLAN_HWCSUM, setifcap), + DEF_CMD("-vlanhwcsum", -IFCAP_VLAN_HWCSUM, setifcap), }; static struct afswtch af_vlan = { .af_name = "af_vlan", From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 19:20:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1BB4106564A; Wed, 8 Feb 2012 19:20:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9015A8FC08; Wed, 8 Feb 2012 19:20: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 q18JKBmS057622; Wed, 8 Feb 2012 19:20:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18JKBif057619; Wed, 8 Feb 2012 19:20:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081920.q18JKBif057619@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 19:20:11 +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: r231224 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 19:20:11 -0000 Author: bz Date: Wed Feb 8 19:20:11 2012 New Revision: 231224 URL: http://svn.freebsd.org/changeset/base/231224 Log: MFC r223359: Garbage collect never used global, sysctl, externs. Modified: stable/7/sys/net/route.c stable/7/sys/net/route.h Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/net/route.c ============================================================================== --- stable/7/sys/net/route.c Wed Feb 8 18:51:25 2012 (r231223) +++ stable/7/sys/net/route.c Wed Feb 8 19:20:11 2012 (r231224) @@ -130,12 +130,6 @@ static void rt_maskedcopy(struct sockadd static uma_zone_t rtzone; /* Routing table UMA zone. */ -#if 0 -/* default fib for tunnels to use */ -u_int tunnel_fib = 0; -SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, ""); -#endif - /* * handler for net.my_fibnum */ Modified: stable/7/sys/net/route.h ============================================================================== --- stable/7/sys/net/route.h Wed Feb 8 18:51:25 2012 (r231223) +++ stable/7/sys/net/route.h Wed Feb 8 19:20:11 2012 (r231224) @@ -83,8 +83,6 @@ struct rt_metrics { #define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) extern u_int rt_numfibs; /* number fo usable routing tables */ -extern u_int tunnel_fib; /* tunnels use these */ -extern u_int fwd_fib; /* packets being forwarded use these routes */ /* * XXX kernel function pointer `rt_output' is visible to applications. */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 19:31:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9385B106566B; Wed, 8 Feb 2012 19:31:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 820FE8FC12; Wed, 8 Feb 2012 19:31:33 +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 q18JVXxr058370; Wed, 8 Feb 2012 19:31:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18JVXwo058366; Wed, 8 Feb 2012 19:31:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202081931.q18JVXwo058366@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 8 Feb 2012 19:31:33 +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: r231225 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 19:31:33 -0000 Author: bz Date: Wed Feb 8 19:31:32 2012 New Revision: 231225 URL: http://svn.freebsd.org/changeset/base/231225 Log: MFC r223359: Garbage collect never used global, sysctl, externs. Modified: stable/8/sys/net/route.c stable/8/sys/net/route.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Wed Feb 8 19:20:11 2012 (r231224) +++ stable/8/sys/net/route.c Wed Feb 8 19:31:32 2012 (r231225) @@ -116,12 +116,6 @@ VNET_DEFINE(int, rttrash); /* routes no static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) -#if 0 -/* default fib for tunnels to use */ -u_int tunnel_fib = 0; -SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, ""); -#endif - /* * handler for net.my_fibnum */ Modified: stable/8/sys/net/route.h ============================================================================== --- stable/8/sys/net/route.h Wed Feb 8 19:20:11 2012 (r231224) +++ stable/8/sys/net/route.h Wed Feb 8 19:31:32 2012 (r231225) @@ -108,8 +108,6 @@ struct rt_metrics { #endif extern u_int rt_numfibs; /* number fo usable routing tables */ -extern u_int tunnel_fib; /* tunnels use these */ -extern u_int fwd_fib; /* packets being forwarded use these routes */ /* * XXX kernel function pointer `rt_output' is visible to applications. */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 20:31:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34AF51065670; Wed, 8 Feb 2012 20:31:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 183998FC08; Wed, 8 Feb 2012 20:31: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 q18KVgfC062103; Wed, 8 Feb 2012 20:31:42 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18KVgdC062099; Wed, 8 Feb 2012 20:31:42 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202082031.q18KVgdC062099@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 8 Feb 2012 20:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231226 - in head: etc sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 20:31:43 -0000 Author: jkim Date: Wed Feb 8 20:31:42 2012 New Revision: 231226 URL: http://svn.freebsd.org/changeset/base/231226 Log: Revert r211288 and move the logic to the acpi_timer itself. Modified: head/etc/rc.resume head/etc/rc.suspend head/sys/dev/acpica/acpi_timer.c Modified: head/etc/rc.resume ============================================================================== --- head/etc/rc.resume Wed Feb 8 19:31:32 2012 (r231225) +++ head/etc/rc.resume Wed Feb 8 20:31:42 2012 (r231226) @@ -43,12 +43,6 @@ if [ -r /var/run/rc.suspend.pid ]; then echo 'rc.resume: killed rc.suspend that was still around' fi -if [ -r /var/run/rc.suspend.tch ]; then - _t=`cat /var/run/rc.suspend.tch` - /sbin/sysctl -n kern.timecounter.hardware=$_t > /dev/null 2>&1 - /bin/rm -f /var/run/rc.suspend.tch -fi - if [ -r /var/run/moused.pid ]; then pkill -HUP -F /var/run/moused.pid fi Modified: head/etc/rc.suspend ============================================================================== --- head/etc/rc.suspend Wed Feb 8 19:31:32 2012 (r231225) +++ head/etc/rc.suspend Wed Feb 8 20:31:42 2012 (r231226) @@ -43,18 +43,6 @@ fi echo $$ 2> /dev/null > /var/run/rc.suspend.pid -_t=`/sbin/sysctl -n kern.timecounter.hardware 2> /dev/null` -case ${_t#ACPI-} in -fast|safe) - /bin/rm -f /var/run/rc.suspend.tch - ;; -*) - { /sbin/sysctl -n kern.timecounter.hardware=ACPI-fast || \ - /sbin/sysctl -n kern.timecounter.hardware=ACPI-safe; } \ - > /dev/null 2>&1 && echo $_t > /var/run/rc.suspend.tch - ;; -esac - # If you have troubles on suspending with PC-CARD modem, try this. # See also contrib/pccardq.c (Only for PAO users). # pccardq | awk -F '~' '$5 == "filled" && $4 ~ /uart/ \ Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Wed Feb 8 19:31:32 2012 (r231225) +++ head/sys/dev/acpica/acpi_timer.c Wed Feb 8 20:31:42 2012 (r231226) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include #include +#include #include #include #include @@ -60,12 +61,15 @@ static device_t acpi_timer_dev; static struct resource *acpi_timer_reg; static bus_space_handle_t acpi_timer_bsh; static bus_space_tag_t acpi_timer_bst; +static eventhandler_tag acpi_timer_eh; static u_int acpi_timer_frequency = 14318182 / 4; static void acpi_timer_identify(driver_t *driver, device_t parent); static int acpi_timer_probe(device_t dev); static int acpi_timer_attach(device_t dev); +static int acpi_timer_suspend(device_t); +static void acpi_timer_resume_handler(struct timecounter *); static u_int acpi_timer_get_timecount(struct timecounter *tc); static u_int acpi_timer_get_timecount_safe(struct timecounter *tc); static int acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS); @@ -77,6 +81,7 @@ static device_method_t acpi_timer_method DEVMETHOD(device_identify, acpi_timer_identify), DEVMETHOD(device_probe, acpi_timer_probe), DEVMETHOD(device_attach, acpi_timer_attach), + DEVMETHOD(device_suspend, acpi_timer_suspend), {0, 0} }; @@ -247,6 +252,49 @@ acpi_timer_attach(device_t dev) return (0); } +static void +acpi_timer_resume_handler(struct timecounter *newtc) +{ + struct timecounter *tc; + + tc = timecounter; + if (tc != newtc) { + if (bootverbose) + device_printf(acpi_timer_dev, + "restoring timecounter, %s -> %s\n", + tc->tc_name, newtc->tc_name); + (void)newtc->tc_get_timecount(newtc); + (void)newtc->tc_get_timecount(newtc); + timecounter = newtc; + } +} + +static int +acpi_timer_suspend(device_t dev) +{ + struct timecounter *newtc, *tc; + int error; + + error = bus_generic_suspend(dev); + if (acpi_timer_eh != NULL) { + EVENTHANDLER_DEREGISTER(power_resume, acpi_timer_eh); + acpi_timer_eh = NULL; + } + tc = timecounter; + newtc = &acpi_timer_timecounter; + if (tc != newtc) { + if (bootverbose) + device_printf(dev, "switching timecounter, %s -> %s\n", + tc->tc_name, newtc->tc_name); + (void)acpi_timer_read(); + (void)acpi_timer_read(); + timecounter = newtc; + acpi_timer_eh = EVENTHANDLER_REGISTER(power_resume, + acpi_timer_resume_handler, tc, EVENTHANDLER_PRI_LAST); + } + return (error); +} + /* * Fetch current time value from reliable hardware. */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 21:23:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BE21106564A; Wed, 8 Feb 2012 21:23:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A52E8FC14; Wed, 8 Feb 2012 21: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 q18LNLCs065348; Wed, 8 Feb 2012 21:23:21 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18LNL9d065344; Wed, 8 Feb 2012 21:23:21 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202082123.q18LNL9d065344@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 8 Feb 2012 21:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231227 - in head/sys: amd64/acpica dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 21:23:21 -0000 Author: jkim Date: Wed Feb 8 21:23:20 2012 New Revision: 231227 URL: http://svn.freebsd.org/changeset/base/231227 Log: Reset clock after atrtc(4) is properly resumed. Modified: head/sys/amd64/acpica/acpi_wakeup.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpivar.h Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Wed Feb 8 20:31:42 2012 (r231226) +++ head/sys/amd64/acpica/acpi_wakeup.c Wed Feb 8 21:23:20 2012 (r231227) @@ -291,7 +291,6 @@ acpi_sleep_machdep(struct acpi_softc *sc if (!CPU_EMPTY(&wakeup_cpus)) acpi_wakeup_cpus(sc, &wakeup_cpus); #endif - acpi_resync_clock(sc); ret = 0; } Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Feb 8 20:31:42 2012 (r231226) +++ head/sys/dev/acpica/acpi.c Wed Feb 8 21:23:20 2012 (r231227) @@ -152,6 +152,7 @@ static ACPI_STATUS acpi_EnterSleepState( static void acpi_shutdown_final(void *arg, int howto); static void acpi_enable_fixed_events(struct acpi_softc *sc); static BOOLEAN acpi_has_hid(ACPI_HANDLE handle); +static void acpi_resync_clock(struct acpi_softc *sc); static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_prep_walk(int sstate); @@ -277,11 +278,13 @@ TUNABLE_INT("debug.acpi.interpreter_slac SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN, &acpi_interpreter_slack, 1, "Turn on interpreter slack mode."); +#ifdef __amd64__ /* Reset system clock while resuming. XXX Remove once tested. */ static int acpi_reset_clock = 1; TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock); SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW, &acpi_reset_clock, 1, "Reset system clock while resuming."); +#endif /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); @@ -2741,8 +2744,10 @@ backout: AcpiLeaveSleepState(state); if (slp_state >= ACPI_SS_DEV_SUSPEND) DEVICE_RESUME(root_bus); - if (slp_state >= ACPI_SS_SLEPT) + if (slp_state >= ACPI_SS_SLEPT) { + acpi_resync_clock(sc); acpi_enable_fixed_events(sc); + } sc->acpi_next_sstate = 0; mtx_unlock(&Giant); @@ -2765,10 +2770,10 @@ backout: return_ACPI_STATUS (status); } -void +static void acpi_resync_clock(struct acpi_softc *sc) { - +#ifdef __amd64__ if (!acpi_reset_clock) return; @@ -2778,6 +2783,7 @@ acpi_resync_clock(struct acpi_softc *sc) (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); inittodr(time_second + sc->acpi_sleep_delay); +#endif } /* Enable or disable the device's wake GPE. */ Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Feb 8 20:31:42 2012 (r231226) +++ head/sys/dev/acpica/acpivar.h Wed Feb 8 21:23:20 2012 (r231227) @@ -339,7 +339,6 @@ ACPI_STATUS acpi_SetIntrModel(int model) int acpi_ReqSleepState(struct acpi_softc *sc, int state); int acpi_AckSleepState(struct apm_clone_data *clone, int error); ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state); -void acpi_resync_clock(struct acpi_softc *sc); int acpi_wake_set_enable(device_t dev, int enable); int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw); ACPI_STATUS acpi_Startup(void); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 21:40:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C09E106566B; Wed, 8 Feb 2012 21:40:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A24B8FC13; Wed, 8 Feb 2012 21:40:55 +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 q18LetPi066122; Wed, 8 Feb 2012 21:40:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Letcd066118; Wed, 8 Feb 2012 21:40:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202082140.q18Letcd066118@svn.freebsd.org> From: Marius Strobl Date: Wed, 8 Feb 2012 21:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231228 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 21:40:55 -0000 Author: marius Date: Wed Feb 8 21:40:54 2012 New Revision: 231228 URL: http://svn.freebsd.org/changeset/base/231228 Log: Remove extra newlines from panic messages. Modified: head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_cam.c Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Wed Feb 8 21:23:20 2012 (r231227) +++ head/sys/dev/mpt/mpt.c Wed Feb 8 21:40:54 2012 (r231228) @@ -148,7 +148,7 @@ static __inline struct mpt_personality * mpt_pers_find(struct mpt_softc *mpt, u_int start_at) { KASSERT(start_at <= MPT_MAX_PERSONALITIES, - ("mpt_pers_find: starting position out of range\n")); + ("mpt_pers_find: starting position out of range")); while (start_at < MPT_MAX_PERSONALITIES && (mpt->mpt_pers_mask & (0x1 << start_at)) == 0) { @@ -1197,8 +1197,7 @@ mpt_free_request(struct mpt_softc *mpt, uint32_t offset, reply_baddr; if (req == NULL || req != &mpt->request_pool[req->index]) { - panic("mpt_free_request bad req ptr\n"); - return; + panic("mpt_free_request: bad req ptr"); } if ((nxt = req->chain) != NULL) { req->chain = NULL; @@ -1261,7 +1260,7 @@ retry: req = TAILQ_FIRST(&mpt->request_free_list); if (req != NULL) { KASSERT(req == &mpt->request_pool[req->index], - ("mpt_get_request: corrupted request free list\n")); + ("mpt_get_request: corrupted request free list")); KASSERT(req->state == REQ_STATE_FREE, ("req %p:%u not free on free list %x index %d function %x", req, req->serno, req->state, req->index, Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Wed Feb 8 21:23:20 2012 (r231227) +++ head/sys/dev/mpt/mpt.h Wed Feb 8 21:40:54 2012 (r231228) @@ -851,7 +851,7 @@ mpt_lockspl(struct mpt_softc *mpt) mpt->mpt_splsaved = s; } else { splx(s); - panic("Recursed lock with mask: 0x%x\n", s); + panic("Recursed lock with mask: 0x%x", s); } } @@ -863,7 +863,7 @@ mpt_unlockspl(struct mpt_softc *mpt) splx(mpt->mpt_splsaved); } } else - panic("Negative lock count\n"); + panic("Negative lock count"); } static __inline int @@ -1144,7 +1144,7 @@ static __inline request_t * mpt_tag_2_req(struct mpt_softc *mpt, uint32_t tag) { uint16_t rtg = (tag >> 18); - KASSERT(rtg < mpt->tgt_cmds_allocated, ("bad tag %d\n", tag)); + KASSERT(rtg < mpt->tgt_cmds_allocated, ("bad tag %d", tag)); KASSERT(mpt->tgt_cmd_ptrs, ("no cmd backpointer array")); KASSERT(mpt->tgt_cmd_ptrs[rtg], ("no cmd backpointer")); return (mpt->tgt_cmd_ptrs[rtg]); @@ -1211,7 +1211,7 @@ mpt_req_spcl(struct mpt_softc *mpt, requ return; } } - panic("%s(%d): req %p:%u function %x not in els or tgt ptrs\n", + panic("%s(%d): req %p:%u function %x not in els or tgt ptrs", s, line, req, req->serno, ((PTR_MSG_REQUEST_HEADER)req->req_vbuf)->Function); } @@ -1225,13 +1225,13 @@ mpt_req_not_spcl(struct mpt_softc *mpt, int i; for (i = 0; i < mpt->els_cmds_allocated; i++) { KASSERT(req != mpt->els_cmd_ptrs[i], - ("%s(%d): req %p:%u func %x in els ptrs at ioindex %d\n", + ("%s(%d): req %p:%u func %x in els ptrs at ioindex %d", s, line, req, req->serno, ((PTR_MSG_REQUEST_HEADER)req->req_vbuf)->Function, i)); } for (i = 0; i < mpt->tgt_cmds_allocated; i++) { KASSERT(req != mpt->tgt_cmd_ptrs[i], - ("%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d\n", + ("%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d", s, line, req, req->serno, ((PTR_MSG_REQUEST_HEADER)req->req_vbuf)->Function, i)); } Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Wed Feb 8 21:23:20 2012 (r231227) +++ head/sys/dev/mpt/mpt_cam.c Wed Feb 8 21:40:54 2012 (r231228) @@ -1356,7 +1356,7 @@ bad: MPT_TGT_STATE(mpt, cmd_req)->req = NULL; } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); @@ -1634,7 +1634,7 @@ out: bus_dmamap_unload(mpt->buffer_dmat, req->dmap); } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); @@ -1759,7 +1759,7 @@ bad: MPT_TGT_STATE(mpt, cmd_req)->req = NULL; } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); @@ -2029,7 +2029,7 @@ out: bus_dmamap_unload(mpt->buffer_dmat, req->dmap); } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); @@ -2737,7 +2737,7 @@ mpt_scsi_reply_handler(struct mpt_softc mpt_prt(mpt, "mpt_scsi_reply_handler: %p:%u complete\n", req, req->serno); } - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); @@ -3652,7 +3652,7 @@ mpt_action(struct cam_sim *sim, union cc break; } mpt_calc_geometry(ccg, /*extended*/1); - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); break; } case XPT_PATH_INQ: /* Path routing inquiry */ @@ -4551,7 +4551,7 @@ mpt_target_start_io(struct mpt_softc *mp request_t *req; KASSERT((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE, - ("dxfer_len %u but direction is NONE\n", csio->dxfer_len)); + ("dxfer_len %u but direction is NONE", csio->dxfer_len)); if ((req = mpt_get_request(mpt, FALSE)) == NULL) { if (mpt->outofbeer == 0) { @@ -5455,7 +5455,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt_set_ccb_status(ccb, CAM_REQ_CMP); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, - ("zero ccb sts at %d\n", __LINE__)); + ("zero ccb sts at %d", __LINE__)); tgt->state = TGT_STATE_IN_CAM; if (mpt->outofbeer) { ccb->ccb_h.status |= CAM_RELEASE_SIMQ; @@ -5517,7 +5517,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt_set_ccb_status(ccb, CAM_REQ_CMP); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, - ("ZERO ccb sts at %d\n", __LINE__)); + ("ZERO ccb sts at %d", __LINE__)); tgt->ccb = NULL; } else { mpt_lprt(mpt, MPT_PRT_DEBUG, @@ -5589,7 +5589,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so } tgt = MPT_TGT_STATE(mpt, req); KASSERT(tgt->state == TGT_STATE_LOADING, - ("bad state 0x%x on reply to buffer post\n", tgt->state)); + ("bad state 0x%x on reply to buffer post", tgt->state)); mpt_assign_serno(mpt, req); tgt->state = TGT_STATE_LOADED; break; From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 22:05:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22488106566B; Wed, 8 Feb 2012 22:05:27 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB1E48FC15; Wed, 8 Feb 2012 22:05: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 q18M5QAS066919; Wed, 8 Feb 2012 22:05:26 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18M5Q6f066916; Wed, 8 Feb 2012 22:05:26 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202082205.q18M5Q6f066916@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 8 Feb 2012 22:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231229 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 22:05:27 -0000 Author: pluknet Date: Wed Feb 8 22:05:26 2012 New Revision: 231229 URL: http://svn.freebsd.org/changeset/base/231229 Log: g/c last bit of old ipv6 prefix management. Reviewed by: bz Obtained from: NetBSD, net/if.h, rev 1.80 Modified: head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Feb 8 21:40:54 2012 (r231228) +++ head/sys/net/if.c Wed Feb 8 22:05:26 2012 (r231229) @@ -456,7 +456,6 @@ if_alloc(u_char type) ifp->if_afdata_initialized = 0; IF_AFDATA_LOCK_INIT(ifp); TAILQ_INIT(&ifp->if_addrhead); - TAILQ_INIT(&ifp->if_prefixhead); TAILQ_INIT(&ifp->if_multiaddrs); TAILQ_INIT(&ifp->if_groups); #ifdef MAC Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Feb 8 21:40:54 2012 (r231228) +++ head/sys/net/if_var.h Wed Feb 8 22:05:26 2012 (r231229) @@ -96,7 +96,6 @@ struct vnet; TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */ -TAILQ_HEAD(ifprefixhead, ifprefix); TAILQ_HEAD(ifmultihead, ifmultiaddr); TAILQ_HEAD(ifgrouphead, ifg_group); @@ -184,7 +183,7 @@ struct ifnet { struct label *if_label; /* interface MAC label */ /* these are only used by IPv6 */ - struct ifprefixhead if_prefixhead; /* list of prefixes per if */ + void *if_unused[2]; void *if_afdata[AF_MAX]; int if_afdata_initialized; struct rwlock if_afdata_lock; @@ -762,20 +761,6 @@ void ifa_ref(struct ifaddr *ifa); #endif /* - * The prefix structure contains information about one prefix - * of an interface. They are maintained by the different address families, - * are allocated and attached when a prefix or an address is set, - * and are linked together so all prefixes for an interface can be located. - */ -struct ifprefix { - struct sockaddr *ifpr_prefix; /* prefix of interface */ - struct ifnet *ifpr_ifp; /* back-pointer to interface */ - TAILQ_ENTRY(ifprefix) ifpr_list; /* queue macro glue */ - u_char ifpr_plen; /* prefix length in bits */ - u_char ifpr_type; /* protocol dependent prefix type */ -}; - -/* * Multicast address structure. This is analogous to the ifaddr * structure except that it keeps track of multicast addresses. */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 22:27:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12657106566C; Wed, 8 Feb 2012 22:27:08 +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 001C08FC12; Wed, 8 Feb 2012 22:27: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 q18MR7xg067743; Wed, 8 Feb 2012 22:27:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18MR7O0067741; Wed, 8 Feb 2012 22:27:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201202082227.q18MR7O0067741@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 8 Feb 2012 22:27: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: r231230 - stable/8/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 22:27:08 -0000 Author: hselasky Date: Wed Feb 8 22:27:07 2012 New Revision: 231230 URL: http://svn.freebsd.org/changeset/base/231230 Log: MFC r229317: Fix support for suspend and resume. Modified: stable/8/sys/dev/usb/controller/usb_controller.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/8/sys/dev/usb/controller/usb_controller.c Wed Feb 8 22:05:26 2012 (r231229) +++ stable/8/sys/dev/usb/controller/usb_controller.c Wed Feb 8 22:27:07 2012 (r231230) @@ -472,10 +472,18 @@ usb_bus_resume(struct usb_proc_msg *pm) if (bus->methods->set_hw_power != NULL) (bus->methods->set_hw_power) (bus); + /* restore USB configuration to index 0 */ err = usbd_set_config_index(udev, 0); if (err) device_printf(bus->bdev, "Could not configure root HUB\n"); + /* probe and attach */ + err = usb_probe_and_attach(udev, USB_IFACE_INDEX_ANY); + if (err) { + device_printf(bus->bdev, "Could not probe and " + "attach root HUB\n"); + } + usbd_enum_unlock(udev); USB_BUS_LOCK(bus); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 22:29:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3835106566B; Wed, 8 Feb 2012 22:29:41 +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 B13EB8FC14; Wed, 8 Feb 2012 22:29:41 +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 q18MTfOa067861; Wed, 8 Feb 2012 22:29:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18MTfC1067859; Wed, 8 Feb 2012 22:29:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201202082229.q18MTfC1067859@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 8 Feb 2012 22:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231231 - stable/8/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 22:29:41 -0000 Author: hselasky Date: Wed Feb 8 22:29:41 2012 New Revision: 231231 URL: http://svn.freebsd.org/changeset/base/231231 Log: MFC r227285: Add support for new USB modem protocol. PR: usb/159919 Modified: stable/8/sys/dev/usb/serial/umodem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/8/sys/dev/usb/serial/umodem.c Wed Feb 8 22:27:07 2012 (r231230) +++ stable/8/sys/dev/usb/serial/umodem.c Wed Feb 8 22:29:41 2012 (r231231) @@ -127,7 +127,11 @@ static const STRUCT_USB_HOST_ID umodem_d /* Generic Modem class match */ {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), - USB_IFACE_PROTOCOL(UIPROTO_CDC_AT)}, + USB_IFACE_PROTOCOL(UIPROTO_CDC_AT)}, + /* Huawei Modem class match */ + {USB_IFACE_CLASS(UICLASS_CDC), + USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), + USB_IFACE_PROTOCOL(0xFF)}, /* Kyocera AH-K3001V */ {USB_VPI(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_AHK3001V, 1)}, {USB_VPI(USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720, 1)}, From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 23:12:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B597F106564A; Wed, 8 Feb 2012 23:12:05 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39948FC0A; Wed, 8 Feb 2012 23:12: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 q18NC5pB069241; Wed, 8 Feb 2012 23:12:05 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18NC5Ie069239; Wed, 8 Feb 2012 23:12:05 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202082312.q18NC5Ie069239@svn.freebsd.org> From: Sean Farley Date: Wed, 8 Feb 2012 23:12:05 +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: r231233 - stable/7/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:12:05 -0000 Author: scf Date: Wed Feb 8 23:12:05 2012 New Revision: 231233 URL: http://svn.freebsd.org/changeset/base/231233 Log: Merge from head to stable/7: r230655: Since April 2, 2006, Indiana has observed DST. Modified: stable/7/usr.sbin/cron/crontab/crontab.5 Directory Properties: stable/7/usr.sbin/cron/crontab/ (props changed) Modified: stable/7/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- stable/7/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 22:33:51 2012 (r231232) +++ stable/7/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 23:12:05 2012 (r231233) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2005 +.Dd January 28, 2012 .Dt CRONTAB 5 .Os .Sh NAME @@ -301,7 +301,7 @@ affected. In general, it is not a good idea to schedule jobs during this period. .Pp -For US timezones (except parts of IN, AZ, and HI) the time shift occurs at +For US timezones (except parts of AZ and HI) the time shift occurs at 2AM local time. For others, the output of the .Xr zdump 8 From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 23:13:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4037A1065670; Wed, 8 Feb 2012 23:13:22 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4D28FC08; Wed, 8 Feb 2012 23:13: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 q18NDMDu069325; Wed, 8 Feb 2012 23:13:22 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18NDLb4069323; Wed, 8 Feb 2012 23:13:21 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202082313.q18NDLb4069323@svn.freebsd.org> From: Sean Farley Date: Wed, 8 Feb 2012 23:13: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: r231234 - stable/8/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:13:22 -0000 Author: scf Date: Wed Feb 8 23:13:21 2012 New Revision: 231234 URL: http://svn.freebsd.org/changeset/base/231234 Log: Merge from head to stable/8: r230655: Since April 2, 2006, Indiana has observed DST. Modified: stable/8/usr.sbin/cron/crontab/crontab.5 Directory Properties: stable/8/usr.sbin/cron/crontab/ (props changed) Modified: stable/8/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- stable/8/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 23:12:05 2012 (r231233) +++ stable/8/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 23:13:21 2012 (r231234) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2005 +.Dd January 28, 2012 .Dt CRONTAB 5 .Os .Sh NAME @@ -301,7 +301,7 @@ affected. In general, it is not a good idea to schedule jobs during this period. .Pp -For US timezones (except parts of IN, AZ, and HI) the time shift occurs at +For US timezones (except parts of AZ and HI) the time shift occurs at 2AM local time. For others, the output of the .Xr zdump 8 From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 23:14:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69C74106564A; Wed, 8 Feb 2012 23:14:27 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57EC88FC12; Wed, 8 Feb 2012 23:14: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 q18NERDO069410; Wed, 8 Feb 2012 23:14:27 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18NERJJ069408; Wed, 8 Feb 2012 23:14:27 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202082314.q18NERJJ069408@svn.freebsd.org> From: Sean Farley Date: Wed, 8 Feb 2012 23:14: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: r231235 - stable/9/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:14:27 -0000 Author: scf Date: Wed Feb 8 23:14:26 2012 New Revision: 231235 URL: http://svn.freebsd.org/changeset/base/231235 Log: Merge from head to stable/9: r230655: Since April 2, 2006, Indiana has observed DST. Modified: stable/9/usr.sbin/cron/crontab/crontab.5 Directory Properties: stable/9/usr.sbin/cron/crontab/ (props changed) Modified: stable/9/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- stable/9/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 23:13:21 2012 (r231234) +++ stable/9/usr.sbin/cron/crontab/crontab.5 Wed Feb 8 23:14:26 2012 (r231235) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2005 +.Dd January 28, 2012 .Dt CRONTAB 5 .Os .Sh NAME @@ -301,7 +301,7 @@ affected. In general, it is not a good idea to schedule jobs during this period. .Pp -For US timezones (except parts of IN, AZ, and HI) the time shift occurs at +For US timezones (except parts of AZ and HI) the time shift occurs at 2AM local time. For others, the output of the .Xr zdump 8 From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 23:34:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DC72106566C; Wed, 8 Feb 2012 23:34:48 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CB618FC08; Wed, 8 Feb 2012 23:34:48 +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 q18NYmLJ070131; Wed, 8 Feb 2012 23:34:48 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18NYmtm070129; Wed, 8 Feb 2012 23:34:48 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201202082334.q18NYmtm070129@svn.freebsd.org> From: Jamie Gritton Date: Wed, 8 Feb 2012 23:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231236 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:34:48 -0000 Author: jamie Date: Wed Feb 8 23:34:47 2012 New Revision: 231236 URL: http://svn.freebsd.org/changeset/base/231236 Log: Acknowledge that jail_attach and jail_remove can return EPERM. MFC after: 1 week Modified: head/lib/libc/sys/jail.2 Modified: head/lib/libc/sys/jail.2 ============================================================================== --- head/lib/libc/sys/jail.2 Wed Feb 8 23:14:26 2012 (r231235) +++ head/lib/libc/sys/jail.2 Wed Feb 8 23:34:47 2012 (r231236) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2009 +.Dd February 8, 2012 .Dt JAIL 2 .Os .Sh NAME @@ -400,6 +400,8 @@ and system calls will fail if: .Bl -tag -width Er +.It Bq Er EPERM +A user other than the super-user attempted to attach to or remove a jail. .It Bq Er EINVAL The jail specified by .Fa jid From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 23:47:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2DF4106564A; Wed, 8 Feb 2012 23:47:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0C468FC14; Wed, 8 Feb 2012 23:47: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 q18NlM2l070544; Wed, 8 Feb 2012 23:47:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18NlMAb070541; Wed, 8 Feb 2012 23:47:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202082347.q18NlMAb070541@svn.freebsd.org> From: Marius Strobl Date: Wed, 8 Feb 2012 23:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231237 - stable/8/sys/sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:47:22 -0000 Author: marius Date: Wed Feb 8 23:47:22 2012 New Revision: 231237 URL: http://svn.freebsd.org/changeset/base/231237 Log: Merge from r230889: Mark cpu_{halt,reset}() and hv_mach_{exit,sir}() as __dead2 as appropriate. This is a direct commit to stable/8. Modified: stable/8/sys/sun4v/include/cpu.h stable/8/sys/sun4v/include/hv_api.h Modified: stable/8/sys/sun4v/include/cpu.h ============================================================================== --- stable/8/sys/sun4v/include/cpu.h Wed Feb 8 23:34:47 2012 (r231236) +++ stable/8/sys/sun4v/include/cpu.h Wed Feb 8 23:47:22 2012 (r231237) @@ -53,8 +53,8 @@ extern void cpu_yield(void); extern char btext[]; extern char etext[]; -void cpu_halt(void); -void cpu_reset(void); +void cpu_halt(void) __dead2; +void cpu_reset(void) __dead2; void fork_trampoline(void); void swi_vm(void *v); Modified: stable/8/sys/sun4v/include/hv_api.h ============================================================================== --- stable/8/sys/sun4v/include/hv_api.h Wed Feb 8 23:34:47 2012 (r231236) +++ stable/8/sys/sun4v/include/hv_api.h Wed Feb 8 23:47:22 2012 (r231237) @@ -52,8 +52,8 @@ typedef uint64_t io_addr_t; * Section 10 Domain Services */ -extern void hv_mach_sir(void); -extern void hv_mach_exit(uint64_t exit_code); +extern void hv_mach_sir(void) __dead2; +extern void hv_mach_exit(uint64_t exit_code) __dead2; extern uint64_t hv_mach_desc(uint64_t buffer_ra, uint64_t *buffer_sizep); extern uint64_t hv_mach_watchdog(uint64_t timeout, uint64_t *time_remaining); From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 23:57:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E79EB106566C; Wed, 8 Feb 2012 23:57:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB1A88FC08; Wed, 8 Feb 2012 23:57:03 +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 q18Nv3pM070900; Wed, 8 Feb 2012 23:57:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Nv3hJ070898; Wed, 8 Feb 2012 23:57:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202082357.q18Nv3hJ070898@svn.freebsd.org> From: Marius Strobl Date: Wed, 8 Feb 2012 23:57:03 +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: r231239 - stable/8/sys/sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:57:04 -0000 Author: marius Date: Wed Feb 8 23:57:03 2012 New Revision: 231239 URL: http://svn.freebsd.org/changeset/base/231239 Log: Given that sun4u uses sparc64/sparc64/ofw_machdep.c, use the sparc64 here also. This isn't exactly a clean approach though as ofw_machdep.h also includes some prototypes for functions that aren't actually shared between both architectures but just happen to have the same interface. Given that the sun4v support actually is dead and this is just to allow things to continue to compile it should be okay though. This is a direct commit to stable/8. Modified: stable/8/sys/sun4v/include/ofw_machdep.h Modified: stable/8/sys/sun4v/include/ofw_machdep.h ============================================================================== --- stable/8/sys/sun4v/include/ofw_machdep.h Wed Feb 8 23:51:46 2012 (r231238) +++ stable/8/sys/sun4v/include/ofw_machdep.h Wed Feb 8 23:57:03 2012 (r231239) @@ -1,44 +1,7 @@ /*- - * Copyright (c) 2001 by Thomas Moestl . - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This file is in the public domain. * * $FreeBSD$ */ -#ifndef _MACHINE_OFW_MACHDEP_H_ -#define _MACHINE_OFW_MACHDEP_H_ - -#include -#include -#include - -typedef uint64_t cell_t; - -int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); -void OF_getetheraddr(device_t, u_char *); -u_int OF_getscsinitid(device_t); -void cpu_shutdown(void *); -int ofw_entry(void *); -void ofw_exit(void *); - -#endif /* _MACHINE_OFW_MACHDEP_H_ */ +#include From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 00:16:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3939F1065672; Thu, 9 Feb 2012 00:16:13 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 269C98FC12; Thu, 9 Feb 2012 00:16:13 +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 q190GDao071536; Thu, 9 Feb 2012 00:16:13 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q190GDUV071529; Thu, 9 Feb 2012 00:16:13 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202090016.q190GDUV071529@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 9 Feb 2012 00:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231240 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 00:16:13 -0000 Author: ken Date: Thu Feb 9 00:16:12 2012 New Revision: 231240 URL: http://svn.freebsd.org/changeset/base/231240 Log: Bring in a number of mps(4) driver fixes from LSI: 1. Fixed timeout specification for the msleep in mps_wait_command(). Added 30 second timeout for mps_wait_command() calls in mps_user.c. 2. Make sure we call mps_detach_user() from the kldunload path. 3. Raid Hotplug behavior change. The driver now removes a volume when it goes to a failed state, so we also need to add volume back to the OS when it goes to opitimal/degraded/online from failed/missing. Handle raid volume add and remove from the IR_Volume event. 4. Added some more debugging information. 5. Replace xpt_async(AC_LOST_DEVICE, path, NULL) with mpssas_rescan_target(). This is to work around a panic in CAM that shows up when adding a drive with a rescan and removing another device from the driver thread with an AC_LOST_DEVICE async notification. This problem was encountered in testing with the LSI sas2ircu utility, which was used to create a RAID volume from physical disks. The driver has to create the RAID volume target and remove the physical disk targets, and triggered a panic in the process. The CAM issue needs to be fully diagnosed and fixed, but this works around the issue for now. 6. Fix some memory initialization issues in mps_free_command(). 7. Resolve the "devq freeze forever" issue. This was caused by the internal read capacity command issued in the non-head version of the driver. When the command completed with an error, the driver wasn't unfreezing thd device queue. The version in head uses the CAM infrastructure for getting the read capacity information, and therefore doesn't have the same issue. 8. Bump the version to 13.00.00.00-fbsd. (this is very close to LSI's internal stable driver 13.00.00.00) Submitted by: Kashyap Desai MFC after: 3 days Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas.h head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps.c Thu Feb 9 00:16:12 2012 (r231240) @@ -529,7 +529,7 @@ mps_enqueue_request(struct mps_softc *sc mps_dprint(sc, MPS_TRACE, "%s SMID %u cm %p ccb %p\n", __func__, cm->cm_desc.Default.SMID, cm, cm->cm_ccb); - if (sc->mps_flags & MPS_FLAGS_ATTACH_DONE) + if (sc->mps_flags & MPS_FLAGS_ATTACH_DONE && !(sc->mps_flags & MPS_FLAGS_SHUTDOWN)) mtx_assert(&sc->mps_mtx, MA_OWNED); if (++sc->io_cmds_active > sc->io_cmds_highwater) @@ -1335,6 +1335,8 @@ mps_free(struct mps_softc *sc) ((error = mps_detach_sas(sc)) != 0)) return (error); + mps_detach_user(sc); + /* Put the IOC back in the READY state. */ mps_lock(sc); if ((error = mps_transition_ready(sc)) != 0) { @@ -2142,7 +2144,7 @@ mps_wait_command(struct mps_softc *sc, s error = mps_map_command(sc, cm); if ((error != 0) && (error != EINPROGRESS)) return (error); - error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout); + error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout*hz); if (error == EWOULDBLOCK) error = ETIMEDOUT; return (error); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps_sas.c Thu Feb 9 00:16:12 2012 (r231240) @@ -139,7 +139,6 @@ static uint8_t op_code_prot[256] = { MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); -static struct mpssas_target * mpssas_find_target_by_handle(struct mpssas_softc *, int, uint16_t); static void mpssas_discovery_timeout(void *data); static void mpssas_remove_device(struct mps_softc *, struct mps_command *); static void mpssas_remove_complete(struct mps_softc *, struct mps_command *); @@ -175,7 +174,7 @@ static int mpssas_send_portenable(struct static void mpssas_portenable_complete(struct mps_softc *sc, struct mps_command *cm); -static struct mpssas_target * +struct mpssas_target * mpssas_find_target_by_handle(struct mpssas_softc *sassc, int start, uint16_t handle) { struct mpssas_target *target; @@ -351,22 +350,123 @@ mpssas_log_command(struct mps_command *c va_end(ap); } + static void -mpssas_lost_target(struct mps_softc *sc, struct mpssas_target *targ) +mpssas_remove_volume(struct mps_softc *sc, struct mps_command *tm) { - struct mpssas_softc *sassc = sc->sassc; - path_id_t pathid = cam_sim_path(sassc->sim); - struct cam_path *path; + MPI2_SCSI_TASK_MANAGE_REPLY *reply; + struct mpssas_target *targ; + uint16_t handle; + + mps_dprint(sc, MPS_INFO, "%s\n", __func__); + + reply = (MPI2_SCSI_TASK_MANAGE_REPLY *)tm->cm_reply; + handle = (uint16_t)(uintptr_t)tm->cm_complete_data; + targ = tm->cm_targ; - mps_printf(sc, "%s targetid %u\n", __func__, targ->tid); - if (xpt_create_path(&path, NULL, pathid, targ->tid, 0) != CAM_REQ_CMP) { - mps_printf(sc, "unable to create path for lost target %d\n", - targ->tid); + if (reply == NULL) { + /* XXX retry the remove after the diag reset completes? */ + mps_printf(sc, "%s NULL reply reseting device 0x%04x\n", + __func__, handle); + mpssas_free_tm(sc, tm); return; } - xpt_async(AC_LOST_DEVICE, path, NULL); - xpt_free_path(path); + if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) { + mps_printf(sc, "IOCStatus = 0x%x while resetting device 0x%x\n", + reply->IOCStatus, handle); + mpssas_free_tm(sc, tm); + return; + } + + mps_printf(sc, "Reset aborted %u commands\n", reply->TerminationCount); + mps_free_reply(sc, tm->cm_reply_data); + tm->cm_reply = NULL; /* Ensures the the reply won't get re-freed */ + + mps_printf(sc, "clearing target %u handle 0x%04x\n", targ->tid, handle); + + /* + * Don't clear target if remove fails because things will get confusing. + * Leave the devname and sasaddr intact so that we know to avoid reusing + * this target id if possible, and so we can assign the same target id + * to this device if it comes back in the future. + */ + if (reply->IOCStatus == MPI2_IOCSTATUS_SUCCESS) { + targ = tm->cm_targ; + targ->handle = 0x0; + targ->encl_handle = 0x0; + targ->encl_slot = 0x0; + targ->exp_dev_handle = 0x0; + targ->phy_num = 0x0; + targ->linkrate = 0x0; + targ->devinfo = 0x0; + targ->flags = 0x0; + } + + mpssas_free_tm(sc, tm); +} + + +/* + * No Need to call "MPI2_SAS_OP_REMOVE_DEVICE" For Volume removal. + * Otherwise Volume Delete is same as Bare Drive Removal. + */ +void +mpssas_prepare_volume_remove(struct mpssas_softc *sassc, uint16_t handle) +{ + MPI2_SCSI_TASK_MANAGE_REQUEST *req; + struct mps_softc *sc; + struct mps_command *cm; + struct mpssas_target *targ = NULL; + + mps_dprint(sassc->sc, MPS_INFO, "%s\n", __func__); + sc = sassc->sc; + +#ifdef WD_SUPPORT + /* + * If this is a WD controller, determine if the disk should be exposed + * to the OS or not. If disk should be exposed, return from this + * function without doing anything. + */ + if (sc->WD_available && (sc->WD_hide_expose == + MPS_WD_EXPOSE_ALWAYS)) { + return; + } +#endif //WD_SUPPORT + + targ = mpssas_find_target_by_handle(sassc, 0, handle); + if (targ == NULL) { + /* FIXME: what is the action? */ + /* We don't know about this device? */ + printf("%s %d : invalid handle 0x%x \n", __func__,__LINE__, handle); + return; + } + + targ->flags |= MPSSAS_TARGET_INREMOVAL; + + cm = mpssas_alloc_tm(sc); + if (cm == NULL) { + mps_printf(sc, "%s: command alloc failure\n", __func__); + return; + } + + mpssas_rescan_target(sc, targ); + + req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; + req->DevHandle = targ->handle; + req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; + req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; + + /* SAS Hard Link Reset / SATA Link Reset */ + req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; + + cm->cm_targ = targ; + cm->cm_data = NULL; + cm->cm_desc.HighPriority.RequestFlags = + MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; + cm->cm_complete = mpssas_remove_volume; + cm->cm_complete_data = (void *)(uintptr_t)handle; + mps_map_command(sc, cm); } /* @@ -386,7 +486,7 @@ mpssas_prepare_remove(struct mpssas_soft struct mps_command *cm; struct mpssas_target *targ = NULL; - mps_dprint(sassc->sc, MPS_TRACE, "%s\n", __func__); + mps_dprint(sassc->sc, MPS_INFO, "%s\n", __func__); /* * If this is a WD controller, determine if the disk should be exposed @@ -403,7 +503,7 @@ mpssas_prepare_remove(struct mpssas_soft if (targ == NULL) { /* FIXME: what is the action? */ /* We don't know about this device? */ - printf("%s: invalid handle 0x%x \n", __func__, handle); + printf("%s %d : invalid handle 0x%x \n", __func__,__LINE__, handle); return; } @@ -415,7 +515,7 @@ mpssas_prepare_remove(struct mpssas_soft return; } - mpssas_lost_target(sc, targ); + mpssas_rescan_target(sc, targ); req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; memset(req, 0, sizeof(*req)); @@ -443,7 +543,7 @@ mpssas_remove_device(struct mps_softc *s struct mps_command *next_cm; uint16_t handle; - mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + mps_dprint(sc, MPS_INFO, "%s\n", __func__); reply = (MPI2_SCSI_TASK_MANAGE_REPLY *)tm->cm_reply; handle = (uint16_t)(uintptr_t)tm->cm_complete_data; @@ -514,7 +614,7 @@ mpssas_remove_complete(struct mps_softc uint16_t handle; struct mpssas_target *targ; - mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + mps_dprint(sc, MPS_INFO, "%s\n", __func__); reply = (MPI2_SAS_IOUNIT_CONTROL_REPLY *)tm->cm_reply; handle = (uint16_t)(uintptr_t)tm->cm_complete_data; @@ -558,6 +658,7 @@ mpssas_remove_complete(struct mps_softc targ->phy_num = 0x0; targ->linkrate = 0x0; targ->devinfo = 0x0; + targ->flags = 0x0; } mpssas_free_tm(sc, tm); @@ -690,7 +791,7 @@ mps_detach_sas(struct mps_softc *sc) { struct mpssas_softc *sassc; - mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + mps_dprint(sc, MPS_INFO, "%s\n", __func__); if (sc->sassc == NULL) return (0); @@ -733,6 +834,7 @@ mps_detach_sas(struct mps_softc *sc) } mps_unlock(sc); + mps_dprint(sc, MPS_INFO, "%s:%d\n", __func__,__LINE__); if (sassc->devq != NULL) cam_simq_free(sassc->devq); @@ -1475,11 +1577,11 @@ mpssas_action_scsiio(struct mpssas_softc uint16_t eedp_flags; sc = sassc->sc; - mps_dprint(sc, MPS_TRACE, "%s ccb %p\n", __func__, ccb); mtx_assert(&sc->mps_mtx, MA_OWNED); csio = &ccb->csio; targ = &sassc->targets[csio->ccb_h.target_id]; + mps_dprint(sc, MPS_TRACE, "%s ccb %p target flag %x\n", __func__, ccb, targ->flags); if (targ->handle == 0x0) { mps_dprint(sc, MPS_TRACE, "%s NULL handle for target %u\n", __func__, csio->ccb_h.target_id); @@ -1487,6 +1589,13 @@ mpssas_action_scsiio(struct mpssas_softc xpt_done(ccb); return; } + if (targ->flags & MPS_TARGET_FLAGS_RAID_COMPONENT) { + mps_dprint(sc, MPS_TRACE, "%s Raid component no SCSI IO supported %u\n", + __func__, csio->ccb_h.target_id); + csio->ccb_h.status = CAM_TID_INVALID; + xpt_done(ccb); + return; + } /* * If devinfo is 0 this will be a volume. In that case don't tell CAM * that the volume has timed out. We want volumes to be enumerated @@ -1684,6 +1793,198 @@ mpssas_action_scsiio(struct mpssas_softc } static void +mps_response_code(struct mps_softc *sc, u8 response_code) +{ + char *desc; + + switch (response_code) { + case MPI2_SCSITASKMGMT_RSP_TM_COMPLETE: + desc = "task management request completed"; + break; + case MPI2_SCSITASKMGMT_RSP_INVALID_FRAME: + desc = "invalid frame"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED: + desc = "task management request not supported"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_FAILED: + desc = "task management request failed"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED: + desc = "task management request succeeded"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN: + desc = "invalid lun"; + break; + case 0xA: + desc = "overlapped tag attempted"; + break; + case MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC: + desc = "task queued, however not sent to target"; + break; + default: + desc = "unknown"; + break; + } + mps_dprint(sc, MPS_INFO, "response_code(0x%01x): %s\n", + response_code, desc); +} +/** + * mps_sc_failed_io_info - translated non-succesfull SCSI_IO request + */ +static void +mps_sc_failed_io_info(struct mps_softc *sc, struct ccb_scsiio *csio, + Mpi2SCSIIOReply_t *mpi_reply) +{ + u32 response_info; + u8 *response_bytes; + u16 ioc_status = le16toh(mpi_reply->IOCStatus) & + MPI2_IOCSTATUS_MASK; + u8 scsi_state = mpi_reply->SCSIState; + u8 scsi_status = mpi_reply->SCSIStatus; + char *desc_ioc_state = NULL; + char *desc_scsi_status = NULL; + char *desc_scsi_state = sc->tmp_string; + u32 log_info = le32toh(mpi_reply->IOCLogInfo); + + if (log_info == 0x31170000) + return; + + switch (ioc_status) { + case MPI2_IOCSTATUS_SUCCESS: + desc_ioc_state = "success"; + break; + case MPI2_IOCSTATUS_INVALID_FUNCTION: + desc_ioc_state = "invalid function"; + break; + case MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR: + desc_ioc_state = "scsi recovered error"; + break; + case MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE: + desc_ioc_state = "scsi invalid dev handle"; + break; + case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE: + desc_ioc_state = "scsi device not there"; + break; + case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: + desc_ioc_state = "scsi data overrun"; + break; + case MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN: + desc_ioc_state = "scsi data underrun"; + break; + case MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR: + desc_ioc_state = "scsi io data error"; + break; + case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR: + desc_ioc_state = "scsi protocol error"; + break; + case MPI2_IOCSTATUS_SCSI_TASK_TERMINATED: + desc_ioc_state = "scsi task terminated"; + break; + case MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: + desc_ioc_state = "scsi residual mismatch"; + break; + case MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED: + desc_ioc_state = "scsi task mgmt failed"; + break; + case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: + desc_ioc_state = "scsi ioc terminated"; + break; + case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: + desc_ioc_state = "scsi ext terminated"; + break; + case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: + desc_ioc_state = "eedp guard error"; + break; + case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR: + desc_ioc_state = "eedp ref tag error"; + break; + case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR: + desc_ioc_state = "eedp app tag error"; + break; + default: + desc_ioc_state = "unknown"; + break; + } + + switch (scsi_status) { + case MPI2_SCSI_STATUS_GOOD: + desc_scsi_status = "good"; + break; + case MPI2_SCSI_STATUS_CHECK_CONDITION: + desc_scsi_status = "check condition"; + break; + case MPI2_SCSI_STATUS_CONDITION_MET: + desc_scsi_status = "condition met"; + break; + case MPI2_SCSI_STATUS_BUSY: + desc_scsi_status = "busy"; + break; + case MPI2_SCSI_STATUS_INTERMEDIATE: + desc_scsi_status = "intermediate"; + break; + case MPI2_SCSI_STATUS_INTERMEDIATE_CONDMET: + desc_scsi_status = "intermediate condmet"; + break; + case MPI2_SCSI_STATUS_RESERVATION_CONFLICT: + desc_scsi_status = "reservation conflict"; + break; + case MPI2_SCSI_STATUS_COMMAND_TERMINATED: + desc_scsi_status = "command terminated"; + break; + case MPI2_SCSI_STATUS_TASK_SET_FULL: + desc_scsi_status = "task set full"; + break; + case MPI2_SCSI_STATUS_ACA_ACTIVE: + desc_scsi_status = "aca active"; + break; + case MPI2_SCSI_STATUS_TASK_ABORTED: + desc_scsi_status = "task aborted"; + break; + default: + desc_scsi_status = "unknown"; + break; + } + + desc_scsi_state[0] = '\0'; + if (!scsi_state) + desc_scsi_state = " "; + if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) + strcat(desc_scsi_state, "response info "); + if (scsi_state & MPI2_SCSI_STATE_TERMINATED) + strcat(desc_scsi_state, "state terminated "); + if (scsi_state & MPI2_SCSI_STATE_NO_SCSI_STATUS) + strcat(desc_scsi_state, "no status "); + if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_FAILED) + strcat(desc_scsi_state, "autosense failed "); + if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) + strcat(desc_scsi_state, "autosense valid "); + + mps_dprint(sc, MPS_INFO, "\thandle(0x%04x), ioc_status(%s)(0x%04x), \n", + le16toh(mpi_reply->DevHandle), + desc_ioc_state, ioc_status); + /* We can add more detail about underflow data here + * TO-DO + * */ + mps_dprint(sc, MPS_INFO, "\tscsi_status(%s)(0x%02x), " + "scsi_state(%s)(0x%02x)\n", desc_scsi_status, + scsi_status, desc_scsi_state, scsi_state); + + if (sc->mps_debug & MPS_INFO && + scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) { + mps_dprint(sc, MPS_INFO, "-> Sense Buffer Data : Start :\n"); + scsi_sense_print(csio); + mps_dprint(sc, MPS_INFO, "-> Sense Buffer Data : End :\n"); + } + + if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) { + response_info = le32toh(mpi_reply->ResponseInfo); + response_bytes = (u8 *)&response_info; + mps_response_code(sc,response_bytes[0]); + } +} + +static void mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm) { MPI2_SCSI_IO_REPLY *rep; @@ -2018,6 +2319,8 @@ mpssas_scsiio_complete(struct mps_softc ccb->ccb_h.status = CAM_REQ_CMP_ERR; break; } + + mps_sc_failed_io_info(sc,csio,rep); if (sassc->flags & MPSSAS_QUEUE_FROZEN) { ccb->ccb_h.status |= CAM_RELEASE_SIMQ; @@ -2799,17 +3102,26 @@ mpssas_scanner_thread(void *arg) mps_lock(sc); for (;;) { + /* Sleep for 1 second and check the queue status*/ msleep(&sassc->ccb_scanq, &sc->mps_mtx, PRIBIO, - "mps_scanq", 0); + "mps_scanq", 1 * hz); if (sassc->flags & MPSSAS_SHUTDOWN) { mps_dprint(sc, MPS_TRACE, "Scanner shutting down\n"); break; } +next_work: + // Get first work. ccb = (union ccb *)TAILQ_FIRST(&sassc->ccb_scanq); if (ccb == NULL) continue; + // Got first work. TAILQ_REMOVE(&sassc->ccb_scanq, &ccb->ccb_h, sim_links.tqe); xpt_action(ccb); + if (sassc->flags & MPSSAS_SHUTDOWN) { + mps_dprint(sc, MPS_TRACE, "Scanner shutting down\n"); + break; + } + goto next_work; } sassc->flags &= ~MPSSAS_SCANTHREAD; @@ -3009,7 +3321,7 @@ mpssas_check_eedp(struct mpssas_softc *s } if (!found_lun) { lun = malloc(sizeof(struct mpssas_lun), - M_MPT2, M_WAITOK | M_ZERO); + M_MPT2, M_NOWAIT | M_ZERO); if (lun == NULL) { mps_dprint(sc, MPS_FAULT, "Unable to alloc LUN for " @@ -3084,6 +3396,20 @@ mpssas_read_cap_done(struct cam_periph * if (done_ccb == NULL) return; + + /* Driver need to release devq, it Scsi command is + * generated by driver internally. + * Currently there is a single place where driver + * calls scsi command internally. In future if driver + * calls more scsi command internally, it needs to release + * devq internally, since those command will not go back to + * cam_periph. + */ + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) ) { + done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; + xpt_release_devq(done_ccb->ccb_h.path, + /*count*/ 1, /*run_queue*/TRUE); + } rcap_buf = (struct scsi_read_capacity_eedp *)done_ccb->csio.data_ptr; Modified: head/sys/dev/mps/mps_sas.h ============================================================================== --- head/sys/dev/mps/mps_sas.h Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps_sas.h Thu Feb 9 00:16:12 2012 (r231240) @@ -49,8 +49,11 @@ struct mpssas_target { #define MPSSAS_TARGET_INRESET (1 << 1) #define MPSSAS_TARGET_INDIAGRESET (1 << 2) #define MPSSAS_TARGET_INREMOVAL (1 << 3) +#define MPS_TARGET_FLAGS_RAID_COMPONENT (1 << 4) +#define MPS_TARGET_FLAGS_VOLUME (1 << 5) #define MPSSAS_TARGET_INRECOVERY (MPSSAS_TARGET_INABORT | \ MPSSAS_TARGET_INRESET | MPSSAS_TARGET_INCHIPRESET) + #define MPSSAS_TARGET_ADD (1 << 29) #define MPSSAS_TARGET_REMOVE (1 << 30) uint16_t tid; Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps_sas_lsi.c Thu Feb 9 00:16:12 2012 (r231240) @@ -107,7 +107,7 @@ struct _ata_identify_device_data { u16 model_number[20]; /* 27-46*/ u16 reserved3[209]; /* 47-255*/ }; - +static u32 event_count; static void mpssas_fw_work(struct mps_softc *sc, struct mps_fw_event_work *fw_event); static void mpssas_fw_event_free(struct mps_softc *, @@ -119,7 +119,7 @@ static int mpssas_get_sata_identify(stru int mpssas_get_sas_address_for_sata_disk(struct mps_softc *sc, u64 *sas_address, u16 handle, u32 device_info); static int mpssas_volume_add(struct mps_softc *sc, - Mpi2EventIrConfigElement_t *element); + u16 handle); void mpssas_evt_handler(struct mps_softc *sc, uintptr_t data, @@ -191,6 +191,8 @@ mpssas_fw_work(struct mps_softc *sc, str struct mpssas_softc *sassc; sassc = sc->sassc; + mps_dprint(sc, MPS_INFO, "(%d)->(%s) Working on Event: [%x]\n", + event_count++,__func__,fw_event->event); switch (fw_event->event) { case MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST: { @@ -284,7 +286,7 @@ mpssas_fw_work(struct mps_softc *sc, str case MPI2_EVENT_IR_CHANGE_RC_VOLUME_CREATED: case MPI2_EVENT_IR_CHANGE_RC_ADDED: if (!foreign_config) { - if (mpssas_volume_add(sc, element)) { + if (mpssas_volume_add(sc, le16toh(element->VolDevHandle))){ printf("%s: failed to add RAID " "volume with handle 0x%x\n", __func__, le16toh(element-> @@ -319,12 +321,18 @@ mpssas_fw_work(struct mps_softc *sc, str } break; case MPI2_EVENT_IR_CHANGE_RC_PD_CREATED: + case MPI2_EVENT_IR_CHANGE_RC_HIDE: /* * Phys Disk of a volume has been created. Hide * it from the OS. */ - mpssas_prepare_remove(sassc, element-> - PhysDiskDevHandle); + targ = mpssas_find_target_by_handle(sassc, 0, element->PhysDiskDevHandle); + if (targ == NULL) + break; + + targ->flags |= MPS_TARGET_FLAGS_RAID_COMPONENT; + mpssas_rescan_target(sc, targ); + break; case MPI2_EVENT_IR_CHANGE_RC_PD_DELETED: /* @@ -379,6 +387,35 @@ mpssas_fw_work(struct mps_softc *sc, str "handle 0x%x", event_data->PreviousValue, event_data->NewValue, event_data->VolDevHandle); + u32 state; + struct mpssas_target *targ; + state = le32toh(event_data->NewValue); + switch (state) { + case MPI2_RAID_VOL_STATE_MISSING: + case MPI2_RAID_VOL_STATE_FAILED: + mpssas_prepare_volume_remove(sassc, event_data-> + VolDevHandle); + break; + + case MPI2_RAID_VOL_STATE_ONLINE: + case MPI2_RAID_VOL_STATE_DEGRADED: + case MPI2_RAID_VOL_STATE_OPTIMAL: + targ = mpssas_find_target_by_handle(sassc, 0, event_data->VolDevHandle); + if (targ) { + printf("%s %d: Volume handle 0x%x is already added \n", + __func__, __LINE__ , event_data->VolDevHandle); + break; + } + if (mpssas_volume_add(sc, le16toh(event_data->VolDevHandle))) { + printf("%s: failed to add RAID " + "volume with handle 0x%x\n", + __func__, le16toh(event_data-> + VolDevHandle)); + } + break; + default: + break; + } break; default: break; @@ -389,6 +426,7 @@ mpssas_fw_work(struct mps_softc *sc, str { Mpi2EventDataIrPhysicalDisk_t *event_data = fw_event->event_data; + struct mpssas_target *targ; /* * Informational only. @@ -399,7 +437,7 @@ mpssas_fw_work(struct mps_softc *sc, str mps_dprint(sc, MPS_INFO, " Phys Disk Settings " "changed from 0x%x to 0x%x for Phys Disk Number " "%d and handle 0x%x at Enclosure handle 0x%x, Slot " - "%d", event_data->PreviousValue, + "%d\n", event_data->PreviousValue, event_data->NewValue, event_data->PhysDiskNum, event_data->PhysDiskDevHandle, event_data->EnclosureHandle, event_data->Slot); @@ -407,7 +445,7 @@ mpssas_fw_work(struct mps_softc *sc, str case MPI2_EVENT_IR_PHYSDISK_RC_STATUS_FLAGS_CHANGED: mps_dprint(sc, MPS_INFO, " Phys Disk Status changed " "from 0x%x to 0x%x for Phys Disk Number %d and " - "handle 0x%x at Enclosure handle 0x%x, Slot %d", + "handle 0x%x at Enclosure handle 0x%x, Slot %d\n", event_data->PreviousValue, event_data->NewValue, event_data->PhysDiskNum, event_data->PhysDiskDevHandle, @@ -416,12 +454,38 @@ mpssas_fw_work(struct mps_softc *sc, str case MPI2_EVENT_IR_PHYSDISK_RC_STATE_CHANGED: mps_dprint(sc, MPS_INFO, " Phys Disk State changed " "from 0x%x to 0x%x for Phys Disk Number %d and " - "handle 0x%x at Enclosure handle 0x%x, Slot %d", + "handle 0x%x at Enclosure handle 0x%x, Slot %d\n", event_data->PreviousValue, event_data->NewValue, event_data->PhysDiskNum, event_data->PhysDiskDevHandle, event_data->EnclosureHandle, event_data->Slot); - break; + switch (event_data->NewValue) { + case MPI2_RAID_PD_STATE_ONLINE: + case MPI2_RAID_PD_STATE_DEGRADED: + case MPI2_RAID_PD_STATE_REBUILDING: + case MPI2_RAID_PD_STATE_OPTIMAL: + case MPI2_RAID_PD_STATE_HOT_SPARE: + targ = mpssas_find_target_by_handle(sassc, 0, + event_data->PhysDiskDevHandle); + if (targ) { + targ->flags |= MPS_TARGET_FLAGS_RAID_COMPONENT; + printf("%s %d: Found Target for handle 0x%x. \n", + __func__, __LINE__ , event_data->PhysDiskDevHandle); + } + break; + case MPI2_RAID_PD_STATE_OFFLINE: + case MPI2_RAID_PD_STATE_NOT_CONFIGURED: + case MPI2_RAID_PD_STATE_NOT_COMPATIBLE: + default: + targ = mpssas_find_target_by_handle(sassc, 0, + event_data->PhysDiskDevHandle); + if (targ) { + targ->flags |= ~MPS_TARGET_FLAGS_RAID_COMPONENT; + printf("%s %d: Found Target for handle 0x%x. \n", + __func__, __LINE__ , event_data->PhysDiskDevHandle); + } + break; + } default: break; } @@ -494,6 +558,7 @@ mpssas_fw_work(struct mps_softc *sc, str break; } + mps_dprint(sc, MPS_INFO, "(%d)->(%s) Event Free: [%x]\n",event_count,__func__, fw_event->event); mpssas_fw_event_free(sc, fw_event); } @@ -584,7 +649,7 @@ mpssas_add_device(struct mps_softc *sc, error = ENXIO; goto out; } - mps_vprintf(sc, "SAS Address from SAS device page0 = %jx\n", + mps_dprint(sc, MPS_INFO, "SAS Address from SAS device page0 = %jx\n", sas_address); targ = &sassc->targets[id]; targ->devinfo = device_info; @@ -605,12 +670,12 @@ mpssas_add_device(struct mps_softc *sc, TAILQ_INIT(&targ->timedout_commands); SLIST_INIT(&targ->luns); mps_describe_devinfo(targ->devinfo, devstring, 80); - mps_vprintf(sc, "Found device <%s> <%s> <0x%04x> <%d/%d>\n", devstring, + mps_dprint(sc, MPS_INFO, "Found device <%s> <%s> <0x%04x> <%d/%d>\n", devstring, mps_describe_table(mps_linkrate_names, targ->linkrate), targ->handle, targ->encl_handle, targ->encl_slot); if ((sassc->flags & MPSSAS_IN_STARTUP) == 0) mpssas_rescan_target(sc, targ); - mps_vprintf(sc, "Target id 0x%x added\n", targ->tid); + mps_dprint(sc, MPS_INFO, "Target id 0x%x added\n", targ->tid); out: mpssas_startup_decrement(sassc); return (error); @@ -751,12 +816,11 @@ out: } static int -mpssas_volume_add(struct mps_softc *sc, Mpi2EventIrConfigElement_t *element) +mpssas_volume_add(struct mps_softc *sc, u16 handle) { struct mpssas_softc *sassc; struct mpssas_target *targ; u64 wwid; - u16 handle = le16toh(element->VolDevHandle); unsigned int id; int error = 0; @@ -855,7 +919,9 @@ mpssas_ir_shutdown(struct mps_softc *sc) action->Function = MPI2_FUNCTION_RAID_ACTION; action->Action = MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; + mps_lock(sc); mps_request_polled(sc, cm); + mps_unlock(sc); /* * Don't check for reply, just leave. Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps_user.c Thu Feb 9 00:16:12 2012 (r231240) @@ -712,7 +712,7 @@ mps_user_command(struct mps_softc *sc, s cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; mps_lock(sc); - err = mps_wait_command(sc, cm, 0); + err = mps_wait_command(sc, cm, 30); if (err) { mps_printf(sc, "%s: invalid request: error %d\n", @@ -842,7 +842,7 @@ mps_user_pass_thru(struct mps_softc *sc, cm->cm_complete = NULL; cm->cm_complete_data = NULL; - err = mps_wait_command(sc, cm, 0); + err = mps_wait_command(sc, cm, 30); if (err != 0) { err = EIO; @@ -979,7 +979,7 @@ mps_user_pass_thru(struct mps_softc *sc, mps_lock(sc); - err = mps_wait_command(sc, cm, 0); + err = mps_wait_command(sc, cm, 30); if (err) { mps_printf(sc, "%s: invalid request: error %d\n", __func__, @@ -1098,10 +1098,12 @@ mps_user_get_adapter_data(struct mps_sof * Need to get BIOS Config Page 3 for the BIOS Version. */ data->BiosVersion = 0; + mps_lock(sc); if (mps_config_get_bios_pg3(sc, &mpi_reply, &config_page)) printf("%s: Error while retrieving BIOS Version\n", __func__); else data->BiosVersion = config_page.BiosVersion; + mps_unlock(sc); } static void @@ -1194,7 +1196,7 @@ mps_post_fw_diag_buffer(struct mps_softc /* * Send command synchronously. */ - status = mps_wait_command(sc, cm, 0); + status = mps_wait_command(sc, cm, 30); if (status) { mps_printf(sc, "%s: invalid request: error %d\n", __func__, status); @@ -1278,7 +1280,7 @@ mps_release_fw_diag_buffer(struct mps_so /* * Send command synchronously. */ - status = mps_wait_command(sc, cm, 0); + status = mps_wait_command(sc, cm, 30); if (status) { mps_printf(sc, "%s: invalid request: error %d\n", __func__, status); Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mpsvar.h Thu Feb 9 00:16:12 2012 (r231240) @@ -58,7 +58,7 @@ #ifndef _MPSVAR_H #define _MPSVAR_H -#define MPS_DRIVER_VERSION "11.255.03.00-fbsd" +#define MPS_DRIVER_VERSION "13.00.00.00-fbsd" #define MPS_DB_MAX_WAIT 2500 @@ -78,6 +78,7 @@ #define MPS_PERIODIC_DELAY 1 /* 1 second heartbeat/watchdog check */ #define MPS_SCSI_RI_INVALID_FRAME (0x00000002) +#define MPS_STRING_LENGTH 64 /* * host mapping related macro definitions @@ -309,7 +310,7 @@ struct mps_softc { struct callout periodic; struct mpssas_softc *sassc; - + char tmp_string[MPS_STRING_LENGTH]; TAILQ_HEAD(, mps_command) req_list; TAILQ_HEAD(, mps_command) high_priority_req_list; TAILQ_HEAD(, mps_chain) chain_list; @@ -521,6 +522,12 @@ mps_free_command(struct mps_softc *sc, s cm->cm_max_segs = 0; cm->cm_lun = 0; cm->cm_state = MPS_CM_STATE_FREE; + cm->cm_data = NULL; + cm->cm_length = 0; + cm->cm_out_len = 0; + cm->cm_sglsize = 0; + cm->cm_sge = NULL; + TAILQ_FOREACH_SAFE(chain, &cm->cm_chain_list, chain_link, chain_temp) { TAILQ_REMOVE(&cm->cm_chain_list, chain, chain_link); mps_free_chain(sc, chain); @@ -749,7 +756,9 @@ void mps_mapping_ir_config_change_event( void mpssas_evt_handler(struct mps_softc *sc, uintptr_t data, MPI2_EVENT_NOTIFICATION_REPLY *event); void mpssas_prepare_remove(struct mpssas_softc *sassc, uint16_t handle); +void mpssas_prepare_volume_remove(struct mpssas_softc *sassc, uint16_t handle); int mpssas_startup(struct mps_softc *sc); +struct mpssas_target * mpssas_find_target_by_handle(struct mpssas_softc *, int, uint16_t); SYSCTL_DECL(_hw_mps); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 01:18:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E91BC106564A; Thu, 9 Feb 2012 01:18:09 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D75228FC08; Thu, 9 Feb 2012 01:18: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 q191I9lA073536; Thu, 9 Feb 2012 01:18:09 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q191I9QG073534; Thu, 9 Feb 2012 01:18:09 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202090118.q191I9QG073534@svn.freebsd.org> From: Sean Farley Date: Thu, 9 Feb 2012 01:18:09 +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: r231241 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 01:18:10 -0000 Author: scf Date: Thu Feb 9 01:18:09 2012 New Revision: 231241 URL: http://svn.freebsd.org/changeset/base/231241 Log: Merge from head to stable/7: r230656: msdos was renamed to msdosfs in 2001 by r77577. Modified: stable/7/share/man/man4/umass.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/umass.4 ============================================================================== --- stable/7/share/man/man4/umass.4 Thu Feb 9 00:16:12 2012 (r231240) +++ stable/7/share/man/man4/umass.4 Thu Feb 9 01:18:09 2012 (r231241) @@ -232,7 +232,7 @@ based file systems when storing informat videos. These file systems can be accessed by specifying the file system type as -.Cm msdos +.Cm msdosfs when using .Xr mount 8 . .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 01:18:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8638C106564A; Thu, 9 Feb 2012 01:18:23 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 747048FC12; Thu, 9 Feb 2012 01:18: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 q191INwL073583; Thu, 9 Feb 2012 01:18:23 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q191INhG073581; Thu, 9 Feb 2012 01:18:23 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202090118.q191INhG073581@svn.freebsd.org> From: Sean Farley Date: Thu, 9 Feb 2012 01:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231242 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 01:18:23 -0000 Author: scf Date: Thu Feb 9 01:18:23 2012 New Revision: 231242 URL: http://svn.freebsd.org/changeset/base/231242 Log: Merge from head to stable/8: r230656: msdos was renamed to msdosfs in 2001 by r77577. Modified: stable/8/share/man/man4/umass.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/umass.4 ============================================================================== --- stable/8/share/man/man4/umass.4 Thu Feb 9 01:18:09 2012 (r231241) +++ stable/8/share/man/man4/umass.4 Thu Feb 9 01:18:23 2012 (r231242) @@ -234,7 +234,7 @@ based file systems when storing informat videos. These file systems can be accessed by specifying the file system type as -.Cm msdos +.Cm msdosfs when using .Xr mount 8 . .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 01:18:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D7F1106566C; Thu, 9 Feb 2012 01:18:35 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC088FC15; Thu, 9 Feb 2012 01:18: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 q191IZoZ073629; Thu, 9 Feb 2012 01:18:35 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q191IZg8073627; Thu, 9 Feb 2012 01:18:35 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201202090118.q191IZg8073627@svn.freebsd.org> From: Sean Farley Date: Thu, 9 Feb 2012 01:18:35 +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: r231243 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 01:18:35 -0000 Author: scf Date: Thu Feb 9 01:18:35 2012 New Revision: 231243 URL: http://svn.freebsd.org/changeset/base/231243 Log: Merge from head to stable/9: r230656: msdos was renamed to msdosfs in 2001 by r77577. Modified: stable/9/share/man/man4/umass.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/umass.4 ============================================================================== --- stable/9/share/man/man4/umass.4 Thu Feb 9 01:18:23 2012 (r231242) +++ stable/9/share/man/man4/umass.4 Thu Feb 9 01:18:35 2012 (r231243) @@ -231,7 +231,7 @@ based file systems when storing informat videos. These file systems can be accessed by specifying the file system type as -.Cm msdos +.Cm msdosfs when using .Xr mount 8 . .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 04:13:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E494C106564A; Thu, 9 Feb 2012 04:13:56 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id B052D8FC18; Thu, 9 Feb 2012 04:13:56 +0000 (UTC) Received: by pbcxa7 with SMTP id xa7so108012pbc.13 for ; Wed, 08 Feb 2012 20:13:56 -0800 (PST) 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 :content-transfer-encoding; bh=/Q7TM20WASmEc2Ohv80PHaPrmllrPeAH7fC10rp8TDo=; b=hOYFIkSdIKjUqIqouD88zFkCKDELWa48F5ksYeZxDP8S6lvmgmhDpZ8mk1bYFEpjrS rsAo3Z8sASj/vldkCPjjkknnklSGMNtvciFE6oLyE7Ug9shBvQk/fp7xpFSXm6TnukRm edb8rUjSJ5Yv8Mi7ALQc3kCK4DKaTdkrJjkn0= MIME-Version: 1.0 Received: by 10.68.225.4 with SMTP id rg4mr71210614pbc.111.1328728919094; Wed, 08 Feb 2012 11:21:59 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.131.9 with HTTP; Wed, 8 Feb 2012 11:21:59 -0800 (PST) In-Reply-To: <201202081836.q18Ia7jw055652@svn.freebsd.org> References: <201202081836.q18Ia7jw055652@svn.freebsd.org> Date: Wed, 8 Feb 2012 11:21:59 -0800 X-Google-Sender-Auth: Q0iZweMGRvi9HVnXWknG2jJuHT0 Message-ID: From: mdf@FreeBSD.org To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231220 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 04:13:57 -0000 On Wed, Feb 8, 2012 at 10:36 AM, Konstantin Belousov wrot= e: > Author: kib > Date: Wed Feb =A08 18:36:07 2012 > New Revision: 231220 > URL: http://svn.freebsd.org/changeset/base/231220 > > Log: > =A0Trim 8 unused bytes from struct vnode on 64-bit architectures. Doesn't this change the KBI? So should __FreeBSD_version be bumped? Thanks, matthew > Modified: > =A0head/sys/sys/vnode.h > > Modified: head/sys/sys/vnode.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 > --- head/sys/sys/vnode.h =A0 =A0 =A0 =A0Wed Feb =A08 18:22:10 2012 =A0 = =A0 =A0 =A0(r231219) > +++ head/sys/sys/vnode.h =A0 =A0 =A0 =A0Wed Feb =A08 18:36:07 2012 =A0 = =A0 =A0 =A0(r231220) > @@ -149,8 +149,8 @@ struct vnode { > =A0 =A0 =A0 =A0struct =A0lock *v_vnlock; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = /* u pointer to vnode lock */ > =A0 =A0 =A0 =A0int =A0 =A0 v_holdcnt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0/* i prevents recycling. */ > =A0 =A0 =A0 =A0int =A0 =A0 v_usecount; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 /* i ref count of users */ > - =A0 =A0 =A0 u_long =A0v_iflag; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0/* i vnode flags (see below) */ > - =A0 =A0 =A0 u_long =A0v_vflag; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0/* v vnode flags */ > + =A0 =A0 =A0 u_int =A0 v_iflag; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0/* i vnode flags (see below) */ > + =A0 =A0 =A0 u_int =A0 v_vflag; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0/* v vnode flags */ > =A0 =A0 =A0 =A0int =A0 =A0 v_writecount; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 /* v ref count of writers */ > > =A0 =A0 =A0 =A0/* From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 04:37:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CA46106566C; Thu, 9 Feb 2012 04:37:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A01F8FC15; Thu, 9 Feb 2012 04:37:31 +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 q194bVl1081655; Thu, 9 Feb 2012 04:37:31 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q194bVRs081642; Thu, 9 Feb 2012 04:37:31 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201202090437.q194bVRs081642@svn.freebsd.org> From: Glen Barber Date: Thu, 9 Feb 2012 04:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231244 - in head/share/man: man4 man5 man7 man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 04:37:31 -0000 Author: gjb (doc committer) Date: Thu Feb 9 04:37:30 2012 New Revision: 231244 URL: http://svn.freebsd.org/changeset/base/231244 Log: Fix some Xr references: - ada(4): ad(4) - removed, ada(4) would be a self-referencing entry - cd(4): ad(4) -> ada(4) - da(4): ad(4) -> ada(4) - DEVICE_PROBE(9): ugen(5) -> ugen(4) - ed(4): dhclinet(8) -> dhclient(8) (typo) - lmc(4): Netgraph(4) -> netgraph(4) - security(7): rc.conf(8) -> rc.conf(5) - sfxge(4): cpuset(8) -> cpuset(1) - sbp(4): sysctl(1) -> sysctl(8) - portindex(5): build(1) -> build(7) - u3g(4): usbconfig(5) -> usbconfig(8) - usb_quirk(4): usbconfig(5) -> usbconfig(8) Found with: textproc/igor MFC after: 3 days Modified: head/share/man/man4/ada.4 head/share/man/man4/cd.4 head/share/man/man4/da.4 head/share/man/man4/ed.4 head/share/man/man4/lmc.4 head/share/man/man4/sbp.4 head/share/man/man4/sfxge.4 head/share/man/man4/u3g.4 head/share/man/man4/usb_quirk.4 head/share/man/man5/portindex.5 head/share/man/man7/security.7 head/share/man/man9/DEVICE_PROBE.9 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/ada.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2011 +.Dd February 8, 2012 .Dt ADA 4 .Os .Sh NAME @@ -139,7 +139,6 @@ The per-device default is to leave it as ATA device nodes .El .Sh SEE ALSO -.Xr ad 4 , .Xr ahci 4 , .Xr cam 4 , .Xr da 4 , Modified: head/share/man/man4/cd.4 ============================================================================== --- head/share/man/man4/cd.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/cd.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2009 +.Dd February 8, 2012 .Dt CD 4 .Os .Sh NAME @@ -52,7 +52,7 @@ but it will only last until the .Tn CD-ROM is unmounted. In general the interfaces are similar to those described by -.Xr ad 4 +.Xr ada 4 and .Xr da 4 . .Pp Modified: head/share/man/man4/da.4 ============================================================================== --- head/share/man/man4/da.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/da.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2003 +.Dd February 8, 2012 .Dt DA 4 .Os .Sh NAME @@ -195,7 +195,7 @@ SCSI disk device nodes .Sh DIAGNOSTICS None. .Sh SEE ALSO -.Xr ad 4 , +.Xr ada 4 , .Xr cam 4 , .Xr geom 4 , .Xr bsdlabel 8 , Modified: head/share/man/man4/ed.4 ============================================================================== --- head/share/man/man4/ed.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/ed.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2009 +.Dd February 8, 2012 .Dt ED 4 .Os .Sh NAME @@ -435,7 +435,7 @@ Some devices supported by do not generate the link state change events used by .Xr devd 8 to start -.Xr dhclinet 8 . +.Xr dhclient 8 . If you have problems with .Xr dhclient 8 not starting and the device is always attached to the network it may Modified: head/share/man/man4/lmc.4 ============================================================================== --- head/share/man/man4/lmc.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/lmc.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd July 23, 2011 +.Dd February 8, 2012 .Dt LMC 4 .Os .\" @@ -179,7 +179,7 @@ higher-level issues like protocol multip This driver is compatible with several line protocol packages: .Bl -tag -width "Generic HDLC" .It Sy "Netgraph" -.Xr Netgraph 4 +.Xr netgraph 4 implements many basic packet-handling functions as kernel loadable modules. They can be interconnected in a graph to implement many protocols. Configuration is done from userland without rebuilding the kernel. Modified: head/share/man/man4/sbp.4 ============================================================================== --- head/share/man/man4/sbp.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/sbp.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2002 +.Dd February 8, 2012 .Dt SBP 4 .Os .Sh NAME @@ -71,7 +71,7 @@ topology. If you want to force to detach the device, run .Dq Nm fwcontrol Fl r several times or set hw.firewire.hold_count=0 by -.Xr sysctl 1 . +.Xr sysctl 8 . .Pp Some (broken) HDDs do not work well with tagged queuing. If you have problems with such drives, try Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/sfxge.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 16, 2011 +.Dd February 8, 2012 .Dt SFXGE 4 .Os .Sh NAME @@ -57,7 +57,7 @@ and Receive Side Scaling (RSS) using MSI The driver allocates 1 receive queue, transmit queue, event queue and IRQ per CPU up to a maximum of 64. IRQ affinities should be spread out using -.Xr cpuset 8 . +.Xr cpuset 1 . Interrupt moderation may be controlled through the sysctl .Va dev.sfxge.%d.int_mod (units are microseconds). @@ -85,7 +85,7 @@ go to the Solarflare support website at: .Xr netintro 4 , .Xr ng_ether 4 , .Xr vlan 4 , -.Xr cpuset 8 , +.Xr cpuset 1 , .Xr ifconfig 8 .Sh AUTHORS The Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/u3g.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2011 +.Dd February 8, 2012 .Dt U3G 4 .Os .Sh NAME @@ -88,7 +88,7 @@ driver is present which contains Windows The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires additional commands to switch it to modem mode. If your device is not switching automatically, please try to add quirks. See -.Xr usbconfig 5 +.Xr usbconfig 8 and .Xr usb_quirk 4 . .Pp @@ -97,7 +97,7 @@ and .Xr ucom 4 , .Xr usb 4 , .Xr usb_quirk 4 , -.Xr usbconfig 5 +.Xr usbconfig 8 .Sh HISTORY The .Nm Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/usb_quirk.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2011 +.Dd February 8, 2012 .Dt USB_QUIRK 4 .Os .Sh NAME @@ -41,7 +41,7 @@ The .Nm module provides support for dynamically adding and removing quirks for USB devices with -.Xr usbconfig 5 . +.Xr usbconfig 8 . .Sh General quirks: .Bl -tag -width Ds .It UQ_AUDIO_SWAP_LR @@ -183,7 +183,7 @@ device which appears as a USB device on usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT .Ed .Sh SEE ALSO -.Xr usbconfig 5 +.Xr usbconfig 8 .Sh HISTORY The .Nm Modified: head/share/man/man5/portindex.5 ============================================================================== --- head/share/man/man5/portindex.5 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man5/portindex.5 Thu Feb 9 04:37:30 2012 (r231244) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 28, 2009 +.Dd February 8, 2012 .Dt PORTINDEX 5 .Os .Sh NAME @@ -90,7 +90,7 @@ branch. vim-6.3.15|/usr/ports/editors/vim|/usr/local|Vi "workalike", with many additional features|/usr/ports/editors/vim/pkg-descr|obrien@FreeBSD.org|editors|libiconv-1.9.2_1|libiconv-1.9.2_1|http://www.vim.org/||| .Ed .Sh SEE ALSO -.Xr build 1 , +.Xr build 7 , .Xr csup 1 , .Xr ports 7 .Sh AUTHORS Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man7/security.7 Thu Feb 9 04:37:30 2012 (r231244) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2010 +.Dd February 8, 2012 .Dt SECURITY 7 .Os .Sh NAME @@ -579,7 +579,7 @@ configuration cannot be adjusted. .El .Pp The security level can be configured with variables documented in -.Xr rc.conf 8 . +.Xr rc.conf 5 . .Sh CHECKING FILE INTEGRITY: BINARIES, CONFIG FILES, ETC When it comes right down to it, you can only protect your core system configuration and control files so much before the convenience factor Modified: head/share/man/man9/DEVICE_PROBE.9 ============================================================================== --- head/share/man/man9/DEVICE_PROBE.9 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man9/DEVICE_PROBE.9 Thu Feb 9 04:37:30 2012 (r231244) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2008 +.Dd February 8, 2012 .Dt DEVICE_PROBE 9 .Os .Sh NAME @@ -120,7 +120,7 @@ treatment for some reason. .It BUS_PROBE_HOOVER The driver matches all unclaimed devices on a bus. The -.Xr ugen 5 +.Xr ugen 4 device is one example. .It BUS_PROBE_NOWILDCARD The driver expects its parent to tell it which children to manage From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 06:48:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EF4A106566B; Thu, 9 Feb 2012 06:48:05 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 584568FC16; Thu, 9 Feb 2012 06:48: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 q196m5t5085806; Thu, 9 Feb 2012 06:48:05 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q196m5r7085801; Thu, 9 Feb 2012 06:48:05 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090648.q196m5r7085801@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 06:48: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: r231247 - in stable/9: lib/libfetch usr.bin/fetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 06:48:05 -0000 Author: bapt Date: Thu Feb 9 06:48:04 2012 New Revision: 231247 URL: http://svn.freebsd.org/changeset/base/231247 Log: MFH r230307: fix SIGINFO-related data corruption bug Approved by: des (mentor) Modified: stable/9/lib/libfetch/common.c stable/9/lib/libfetch/common.h stable/9/lib/libfetch/http.c stable/9/usr.bin/fetch/fetch.c Directory Properties: stable/9/lib/libfetch/ (props changed) stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/lib/libfetch/common.c ============================================================================== --- stable/9/lib/libfetch/common.c Thu Feb 9 05:43:50 2012 (r231246) +++ stable/9/lib/libfetch/common.c Thu Feb 9 06:48:04 2012 (r231247) @@ -404,6 +404,34 @@ fetch_ssl_read(SSL *ssl, char *buf, size } #endif +/* + * Cache some data that was read from a socket but cannot be immediately + * returned because of an interrupted system call. + */ +static int +fetch_cache_data(conn_t *conn, char *src, size_t nbytes) +{ + char *tmp; + + if (conn->cache.size < nbytes) { + tmp = realloc(conn->cache.buf, nbytes); + if (tmp == NULL) { + errno = ENOMEM; + fetch_syserr(); + return (-1); + } + conn->cache.buf = tmp; + conn->cache.size = nbytes; + } + + memcpy(conn->cache.buf, src, nbytes); + conn->cache.len = nbytes; + conn->cache.pos = 0; + + return (0); +} + + static ssize_t fetch_socket_read(int sd, char *buf, size_t len) { @@ -429,6 +457,7 @@ fetch_read(conn_t *conn, char *buf, size fd_set readfds; ssize_t rlen, total; int r; + char *start; if (fetchTimeout) { FD_ZERO(&readfds); @@ -437,6 +466,24 @@ fetch_read(conn_t *conn, char *buf, size } total = 0; + start = buf; + + if (conn->cache.len > 0) { + /* + * The last invocation of fetch_read was interrupted by a + * signal after some data had been read from the socket. Copy + * the cached data into the supplied buffer before trying to + * read from the socket again. + */ + total = (conn->cache.len < len) ? conn->cache.len : len; + memcpy(buf, conn->cache.buf, total); + + conn->cache.len -= total; + conn->cache.pos += total; + len -= total; + buf+= total; + } + while (len > 0) { /* * The socket is non-blocking. Instead of the canonical @@ -472,6 +519,8 @@ fetch_read(conn_t *conn, char *buf, size total += rlen; continue; } else if (rlen == FETCH_READ_ERROR) { + if (errno == EINTR) + fetch_cache_data(conn, start, total); return (-1); } // assert(rlen == FETCH_READ_WAIT); @@ -492,8 +541,12 @@ fetch_read(conn_t *conn, char *buf, size errno = 0; r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); if (r == -1) { - if (errno == EINTR && fetchRestartCalls) - continue; + if (errno == EINTR) { + if (fetchRestartCalls) + continue; + /* Save anything that was read. */ + fetch_cache_data(conn, start, total); + } fetch_syserr(); return (-1); } @@ -677,6 +730,7 @@ fetch_close(conn_t *conn) if (--conn->ref > 0) return (0); ret = close(conn->sd); + free(conn->cache.buf); free(conn->buf); free(conn); return (ret); Modified: stable/9/lib/libfetch/common.h ============================================================================== --- stable/9/lib/libfetch/common.h Thu Feb 9 05:43:50 2012 (r231246) +++ stable/9/lib/libfetch/common.h Thu Feb 9 06:48:04 2012 (r231247) @@ -52,6 +52,13 @@ struct fetchconn { size_t bufsize; /* buffer size */ size_t buflen; /* length of buffer contents */ int err; /* last protocol reply code */ + struct { /* data cached after an interrupted + read */ + char *buf; + size_t size; + size_t pos; + size_t len; + } cache; #ifdef WITH_SSL SSL *ssl; /* SSL handle */ SSL_CTX *ssl_ctx; /* SSL context */ Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Thu Feb 9 05:43:50 2012 (r231246) +++ stable/9/lib/libfetch/http.c Thu Feb 9 06:48:04 2012 (r231247) @@ -196,6 +196,8 @@ http_growbuf(struct httpio *io, size_t l static int http_fillbuf(struct httpio *io, size_t len) { + ssize_t nbytes; + if (io->error) return (-1); if (io->eof) @@ -204,10 +206,11 @@ http_fillbuf(struct httpio *io, size_t l if (io->chunked == 0) { if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->bufpos = 0; return (io->buflen); } @@ -227,10 +230,11 @@ http_fillbuf(struct httpio *io, size_t l len = io->chunksize; if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->chunksize -= io->buflen; if (io->chunksize == 0) { @@ -272,8 +276,11 @@ http_readfn(void *v, char *buf, int len) io->bufpos += l; } - if (!pos && io->error) + if (!pos && io->error) { + if (io->error == EINTR) + io->error = 0; return (-1); + } return (pos); } Modified: stable/9/usr.bin/fetch/fetch.c ============================================================================== --- stable/9/usr.bin/fetch/fetch.c Thu Feb 9 05:43:50 2012 (r231246) +++ stable/9/usr.bin/fetch/fetch.c Thu Feb 9 06:48:04 2012 (r231247) @@ -317,7 +317,7 @@ fetch(char *URL, const char *path) struct stat sb, nsb; struct xferstat xs; FILE *f, *of; - size_t size, wr; + size_t size, readcnt, wr; off_t count; char flags[8]; const char *slash; @@ -636,21 +636,26 @@ fetch(char *URL, const char *path) stat_end(&xs); siginfo = 0; } - if ((size = fread(buf, 1, size, f)) == 0) { + + if (size == 0) + break; + + if ((readcnt = fread(buf, 1, size, f)) < size) { if (ferror(f) && errno == EINTR && !sigint) clearerr(f); - else + else if (readcnt == 0) break; } - stat_update(&xs, count += size); - for (ptr = buf; size > 0; ptr += wr, size -= wr) - if ((wr = fwrite(ptr, 1, size, of)) < size) { + + stat_update(&xs, count += readcnt); + for (ptr = buf; readcnt > 0; ptr += wr, readcnt -= wr) + if ((wr = fwrite(ptr, 1, readcnt, of)) < readcnt) { if (ferror(of) && errno == EINTR && !sigint) clearerr(of); else break; } - if (size != 0) + if (readcnt != 0) break; } if (!sigalrm) From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 06:50:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86B86106564A; Thu, 9 Feb 2012 06:50:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FEAA8FC0C; Thu, 9 Feb 2012 06:50: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 q196oiVc085922; Thu, 9 Feb 2012 06:50:44 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q196oids085917; Thu, 9 Feb 2012 06:50:44 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090650.q196oids085917@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 06:50: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: r231248 - in stable/8: lib/libfetch usr.bin/fetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 06:50:44 -0000 Author: bapt Date: Thu Feb 9 06:50:43 2012 New Revision: 231248 URL: http://svn.freebsd.org/changeset/base/231248 Log: MFH r230307: fix SIGINFO-related data corruption bug Approved by: des (mentor) Modified: stable/8/lib/libfetch/common.c stable/8/lib/libfetch/common.h stable/8/lib/libfetch/http.c stable/8/usr.bin/fetch/fetch.c Directory Properties: stable/8/lib/libfetch/ (props changed) stable/8/usr.bin/fetch/ (props changed) Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Thu Feb 9 06:48:04 2012 (r231247) +++ stable/8/lib/libfetch/common.c Thu Feb 9 06:50:43 2012 (r231248) @@ -404,6 +404,34 @@ fetch_ssl_read(SSL *ssl, char *buf, size } #endif +/* + * Cache some data that was read from a socket but cannot be immediately + * returned because of an interrupted system call. + */ +static int +fetch_cache_data(conn_t *conn, char *src, size_t nbytes) +{ + char *tmp; + + if (conn->cache.size < nbytes) { + tmp = realloc(conn->cache.buf, nbytes); + if (tmp == NULL) { + errno = ENOMEM; + fetch_syserr(); + return (-1); + } + conn->cache.buf = tmp; + conn->cache.size = nbytes; + } + + memcpy(conn->cache.buf, src, nbytes); + conn->cache.len = nbytes; + conn->cache.pos = 0; + + return (0); +} + + static ssize_t fetch_socket_read(int sd, char *buf, size_t len) { @@ -429,6 +457,7 @@ fetch_read(conn_t *conn, char *buf, size fd_set readfds; ssize_t rlen, total; int r; + char *start; if (fetchTimeout) { FD_ZERO(&readfds); @@ -437,6 +466,24 @@ fetch_read(conn_t *conn, char *buf, size } total = 0; + start = buf; + + if (conn->cache.len > 0) { + /* + * The last invocation of fetch_read was interrupted by a + * signal after some data had been read from the socket. Copy + * the cached data into the supplied buffer before trying to + * read from the socket again. + */ + total = (conn->cache.len < len) ? conn->cache.len : len; + memcpy(buf, conn->cache.buf, total); + + conn->cache.len -= total; + conn->cache.pos += total; + len -= total; + buf+= total; + } + while (len > 0) { /* * The socket is non-blocking. Instead of the canonical @@ -472,6 +519,8 @@ fetch_read(conn_t *conn, char *buf, size total += rlen; continue; } else if (rlen == FETCH_READ_ERROR) { + if (errno == EINTR) + fetch_cache_data(conn, start, total); return (-1); } // assert(rlen == FETCH_READ_WAIT); @@ -492,8 +541,12 @@ fetch_read(conn_t *conn, char *buf, size errno = 0; r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); if (r == -1) { - if (errno == EINTR && fetchRestartCalls) - continue; + if (errno == EINTR) { + if (fetchRestartCalls) + continue; + /* Save anything that was read. */ + fetch_cache_data(conn, start, total); + } fetch_syserr(); return (-1); } @@ -677,6 +730,7 @@ fetch_close(conn_t *conn) if (--conn->ref > 0) return (0); ret = close(conn->sd); + free(conn->cache.buf); free(conn->buf); free(conn); return (ret); Modified: stable/8/lib/libfetch/common.h ============================================================================== --- stable/8/lib/libfetch/common.h Thu Feb 9 06:48:04 2012 (r231247) +++ stable/8/lib/libfetch/common.h Thu Feb 9 06:50:43 2012 (r231248) @@ -52,6 +52,13 @@ struct fetchconn { size_t bufsize; /* buffer size */ size_t buflen; /* length of buffer contents */ int err; /* last protocol reply code */ + struct { /* data cached after an interrupted + read */ + char *buf; + size_t size; + size_t pos; + size_t len; + } cache; #ifdef WITH_SSL SSL *ssl; /* SSL handle */ SSL_CTX *ssl_ctx; /* SSL context */ Modified: stable/8/lib/libfetch/http.c ============================================================================== --- stable/8/lib/libfetch/http.c Thu Feb 9 06:48:04 2012 (r231247) +++ stable/8/lib/libfetch/http.c Thu Feb 9 06:50:43 2012 (r231248) @@ -196,6 +196,8 @@ http_growbuf(struct httpio *io, size_t l static int http_fillbuf(struct httpio *io, size_t len) { + ssize_t nbytes; + if (io->error) return (-1); if (io->eof) @@ -204,10 +206,11 @@ http_fillbuf(struct httpio *io, size_t l if (io->chunked == 0) { if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->bufpos = 0; return (io->buflen); } @@ -227,10 +230,11 @@ http_fillbuf(struct httpio *io, size_t l len = io->chunksize; if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->chunksize -= io->buflen; if (io->chunksize == 0) { @@ -272,8 +276,11 @@ http_readfn(void *v, char *buf, int len) io->bufpos += l; } - if (!pos && io->error) + if (!pos && io->error) { + if (io->error == EINTR) + io->error = 0; return (-1); + } return (pos); } Modified: stable/8/usr.bin/fetch/fetch.c ============================================================================== --- stable/8/usr.bin/fetch/fetch.c Thu Feb 9 06:48:04 2012 (r231247) +++ stable/8/usr.bin/fetch/fetch.c Thu Feb 9 06:50:43 2012 (r231248) @@ -317,7 +317,7 @@ fetch(char *URL, const char *path) struct stat sb, nsb; struct xferstat xs; FILE *f, *of; - size_t size, wr; + size_t size, readcnt, wr; off_t count; char flags[8]; const char *slash; @@ -636,21 +636,26 @@ fetch(char *URL, const char *path) stat_end(&xs); siginfo = 0; } - if ((size = fread(buf, 1, size, f)) == 0) { + + if (size == 0) + break; + + if ((readcnt = fread(buf, 1, size, f)) < size) { if (ferror(f) && errno == EINTR && !sigint) clearerr(f); - else + else if (readcnt == 0) break; } - stat_update(&xs, count += size); - for (ptr = buf; size > 0; ptr += wr, size -= wr) - if ((wr = fwrite(ptr, 1, size, of)) < size) { + + stat_update(&xs, count += readcnt); + for (ptr = buf; readcnt > 0; ptr += wr, readcnt -= wr) + if ((wr = fwrite(ptr, 1, readcnt, of)) < readcnt) { if (ferror(of) && errno == EINTR && !sigint) clearerr(of); else break; } - if (size != 0) + if (readcnt != 0) break; } if (!sigalrm) From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 07:27:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB0F106564A; Thu, 9 Feb 2012 07:27:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 960718FC14; Thu, 9 Feb 2012 07:27:59 +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 q197Rxpk087286; Thu, 9 Feb 2012 07:27:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197Rxuc087284; Thu, 9 Feb 2012 07:27:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090727.q197Rxuc087284@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 07:27:59 +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: r231249 - stable/8/contrib/ntp/ntpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:27:59 -0000 Author: bz Date: Thu Feb 9 07:27:59 2012 New Revision: 231249 URL: http://svn.freebsd.org/changeset/base/231249 Log: MRC r223626: Compare port numbers correctly. They are stored by SRCPORT() in host byte order, so we need to compare them as such. Properly compare IPv6 addresses as well. This allows the, by default, 8 badaddrs slots per address family to work correctly and only print sendto() errors once. The change is no longer applicable to any latest upstream versions. Approved by: roberto Sponsored by: Sandvine Incorporated Modified: stable/8/contrib/ntp/ntpd/ntp_io.c Directory Properties: stable/8/contrib/ntp/ (props changed) Modified: stable/8/contrib/ntp/ntpd/ntp_io.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_io.c Thu Feb 9 06:50:43 2012 (r231248) +++ stable/8/contrib/ntp/ntpd/ntp_io.c Thu Feb 9 07:27:59 2012 (r231249) @@ -2646,14 +2646,14 @@ sendpkt( for (slot = ERRORCACHESIZE; --slot >= 0; ) if(dest->ss_family == AF_INET) { - if (badaddrs[slot].port == ((struct sockaddr_in*)dest)->sin_port && + if (badaddrs[slot].port == SRCPORT(dest) && badaddrs[slot].addr.s_addr == ((struct sockaddr_in*)dest)->sin_addr.s_addr) break; } #ifdef INCLUDE_IPV6_SUPPORT else if (dest->ss_family == AF_INET6) { - if (badaddrs6[slot].port == ((struct sockaddr_in6*)dest)->sin6_port && - badaddrs6[slot].addr.s6_addr == ((struct sockaddr_in6*)dest)->sin6_addr.s6_addr) + if (badaddrs6[slot].port == SRCPORT(dest) && + !memcmp(&badaddrs6[slot].addr, &((struct sockaddr_in6*)dest)->sin6_addr, sizeof(struct in6_addr))) break; } #endif /* INCLUDE_IPV6_SUPPORT */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 07:28:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 023FD10657C0; Thu, 9 Feb 2012 07:28:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E06B38FC15; Thu, 9 Feb 2012 07:28: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 q197SHqL087333; Thu, 9 Feb 2012 07:28:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197SH1A087331; Thu, 9 Feb 2012 07:28:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090728.q197SH1A087331@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 07:28:17 +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: r231250 - stable/7/contrib/ntp/ntpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:28:18 -0000 Author: bz Date: Thu Feb 9 07:28:17 2012 New Revision: 231250 URL: http://svn.freebsd.org/changeset/base/231250 Log: MFC r223626: Compare port numbers correctly. They are stored by SRCPORT() in host byte order, so we need to compare them as such. Properly compare IPv6 addresses as well. This allows the, by default, 8 badaddrs slots per address family to work correctly and only print sendto() errors once. The change is no longer applicable to any latest upstream versions. Approved by: roberto Sponsored by: Sandvine Incorporated Modified: stable/7/contrib/ntp/ntpd/ntp_io.c Directory Properties: stable/7/contrib/ntp/ (props changed) Modified: stable/7/contrib/ntp/ntpd/ntp_io.c ============================================================================== --- stable/7/contrib/ntp/ntpd/ntp_io.c Thu Feb 9 07:27:59 2012 (r231249) +++ stable/7/contrib/ntp/ntpd/ntp_io.c Thu Feb 9 07:28:17 2012 (r231250) @@ -2646,14 +2646,14 @@ sendpkt( for (slot = ERRORCACHESIZE; --slot >= 0; ) if(dest->ss_family == AF_INET) { - if (badaddrs[slot].port == ((struct sockaddr_in*)dest)->sin_port && + if (badaddrs[slot].port == SRCPORT(dest) && badaddrs[slot].addr.s_addr == ((struct sockaddr_in*)dest)->sin_addr.s_addr) break; } #ifdef INCLUDE_IPV6_SUPPORT else if (dest->ss_family == AF_INET6) { - if (badaddrs6[slot].port == ((struct sockaddr_in6*)dest)->sin6_port && - badaddrs6[slot].addr.s6_addr == ((struct sockaddr_in6*)dest)->sin6_addr.s6_addr) + if (badaddrs6[slot].port == SRCPORT(dest) && + !memcmp(&badaddrs6[slot].addr, &((struct sockaddr_in6*)dest)->sin6_addr, sizeof(struct in6_addr))) break; } #endif /* INCLUDE_IPV6_SUPPORT */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 07:38:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66526106566B; Thu, 9 Feb 2012 07:38:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FFBE8FC0C; Thu, 9 Feb 2012 07:38:57 +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 q197cvHd087746; Thu, 9 Feb 2012 07:38:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197cv7B087744; Thu, 9 Feb 2012 07:38:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202090738.q197cv7B087744@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Feb 2012 07:38:57 +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: r231251 - stable/9/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:38:57 -0000 Author: mav Date: Thu Feb 9 07:38:56 2012 New Revision: 231251 URL: http://svn.freebsd.org/changeset/base/231251 Log: MFC r230912: Make CAM ATA honor old hw.ata.ata_dma and hw.ata.atapi_dma tunables. Even having more specific hint.ata.X.mode controls, global ones are still could be useful from some points, including compatibility. PR: kern/164651 Modified: stable/9/sys/cam/ata/ata_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Thu Feb 9 07:28:17 2012 (r231250) +++ stable/9/sys/cam/ata/ata_xpt.c Thu Feb 9 07:38:56 2012 (r231251) @@ -186,6 +186,12 @@ static void ata_dev_async(u_int32_t asy static void ata_action(union ccb *start_ccb); static void ata_announce_periph(struct cam_periph *periph); +static int ata_dma = 1; +static int atapi_dma = 1; + +TUNABLE_INT("hw.ata.ata_dma", &ata_dma); +TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); + static struct xpt_xport ata_xport = { .alloc_device = ata_alloc_device, .action = ata_action, @@ -356,6 +362,13 @@ probestart(struct cam_periph *periph, un if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) mode = cts.xport_specific.sata.mode; } + if (periph->path->device->protocol == PROTO_ATA) { + if (ata_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) + mode = ATA_PIO_MAX; + } else { + if (atapi_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) + mode = ATA_PIO_MAX; + } negotiate: /* Honor device capabilities. */ wantmode = mode = ata_max_mode(ident_buf, mode); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 07:40:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A70C1065672; Thu, 9 Feb 2012 07:40:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 655168FC17; Thu, 9 Feb 2012 07:40: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 q197eElD087840; Thu, 9 Feb 2012 07:40:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197eEaH087838; Thu, 9 Feb 2012 07:40:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202090740.q197eEaH087838@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Feb 2012 07:40: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: r231252 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:40:14 -0000 Author: mav Date: Thu Feb 9 07:40:13 2012 New Revision: 231252 URL: http://svn.freebsd.org/changeset/base/231252 Log: MFC r230912: Make CAM ATA honor old hw.ata.ata_dma and hw.ata.atapi_dma tunables. Even having more specific hint.ata.X.mode controls, global ones are still could be useful from some points, including compatibility. PR: kern/164651 Modified: stable/8/sys/cam/ata/ata_xpt.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Thu Feb 9 07:38:56 2012 (r231251) +++ stable/8/sys/cam/ata/ata_xpt.c Thu Feb 9 07:40:13 2012 (r231252) @@ -186,6 +186,12 @@ static void ata_dev_async(u_int32_t asy static void ata_action(union ccb *start_ccb); static void ata_announce_periph(struct cam_periph *periph); +static int ata_dma = 1; +static int atapi_dma = 1; + +TUNABLE_INT("hw.ata.ata_dma", &ata_dma); +TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); + static struct xpt_xport ata_xport = { .alloc_device = ata_alloc_device, .action = ata_action, @@ -356,6 +362,13 @@ probestart(struct cam_periph *periph, un if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) mode = cts.xport_specific.sata.mode; } + if (periph->path->device->protocol == PROTO_ATA) { + if (ata_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) + mode = ATA_PIO_MAX; + } else { + if (atapi_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) + mode = ATA_PIO_MAX; + } negotiate: /* Honor device capabilities. */ wantmode = mode = ata_max_mode(ident_buf, mode); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 07:43:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29F68106564A; Thu, 9 Feb 2012 07:43:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDDDE8FC14; Thu, 9 Feb 2012 07:43:38 +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 q197hcQf087990; Thu, 9 Feb 2012 07:43:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197hc9H087987; Thu, 9 Feb 2012 07:43:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202090743.q197hc9H087987@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Feb 2012 07:43:38 +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: r231253 - in stable/9/sys/cam: ata scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:43:39 -0000 Author: mav Date: Thu Feb 9 07:43:38 2012 New Revision: 231253 URL: http://svn.freebsd.org/changeset/base/231253 Log: MFC r230921: Insert ordered command every 1/4 of the current command timeout, not 1/4 of the default one. Without this change setting kern.cam.ada.default_timeout to 1 instead of 30 allowed me to trigger several false positive command timeouts under heavy ZFS load on a SiI3132 siis(4) controller with 5 HDDs on a port multiplier. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Feb 9 07:40:13 2012 (r231252) +++ stable/9/sys/cam/ata/ata_da.c Thu Feb 9 07:43:38 2012 (r231253) @@ -1105,7 +1105,7 @@ adaregister(struct cam_periph *periph, v */ callout_init_mtx(&softc->sendordered_c, periph->sim->mtx, 0); callout_reset(&softc->sendordered_c, - (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, + (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); if (ADA_RA >= 0 && @@ -1660,7 +1660,7 @@ adasendorderedtag(void *arg) } /* Queue us up again */ callout_reset(&softc->sendordered_c, - (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, + (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); } Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Feb 9 07:40:13 2012 (r231252) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Feb 9 07:43:38 2012 (r231253) @@ -1098,7 +1098,7 @@ dadump(void *arg, void *virtual, vm_offs /*data_ptr*/(u_int8_t *) virtual, /*dxfer_len*/length, /*sense_len*/SSD_FULL_SIZE, - DA_DEFAULT_TIMEOUT * 1000); + da_default_timeout * 1000); xpt_polled_action((union ccb *)&csio); if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1511,7 +1511,7 @@ daregister(struct cam_periph *periph, vo */ callout_init_mtx(&softc->sendordered_c, periph->sim->mtx, 0); callout_reset(&softc->sendordered_c, - (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL, + (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); mtx_unlock(periph->sim->mtx); @@ -2398,7 +2398,7 @@ dasendorderedtag(void *arg) } /* Queue us up again */ callout_reset(&softc->sendordered_c, - (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL, + (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 07:45:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CF93106566B; Thu, 9 Feb 2012 07:45:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184B78FC08; Thu, 9 Feb 2012 07:45:03 +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 q197j2HW088102; Thu, 9 Feb 2012 07:45:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197j28m088100; Thu, 9 Feb 2012 07:45:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202090745.q197j28m088100@svn.freebsd.org> From: Alexander Motin Date: Thu, 9 Feb 2012 07:45:02 +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: r231254 - in stable/8/sys/cam: ata scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:45:03 -0000 Author: mav Date: Thu Feb 9 07:45:02 2012 New Revision: 231254 URL: http://svn.freebsd.org/changeset/base/231254 Log: MFC r230921: Insert ordered command every 1/4 of the current command timeout, not 1/4 of the default one. Without this change setting kern.cam.ada.default_timeout to 1 instead of 30 allowed me to trigger several false positive command timeouts under heavy ZFS load on a SiI3132 siis(4) controller with 5 HDDs on a port multiplier. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Thu Feb 9 07:43:38 2012 (r231253) +++ stable/8/sys/cam/ata/ata_da.c Thu Feb 9 07:45:02 2012 (r231254) @@ -1032,7 +1032,7 @@ adaregister(struct cam_periph *periph, v */ callout_init_mtx(&softc->sendordered_c, periph->sim->mtx, 0); callout_reset(&softc->sendordered_c, - (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, + (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); if (ADA_RA >= 0 && @@ -1572,7 +1572,7 @@ adasendorderedtag(void *arg) } /* Queue us up again */ callout_reset(&softc->sendordered_c, - (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, + (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); } Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Thu Feb 9 07:43:38 2012 (r231253) +++ stable/8/sys/cam/scsi/scsi_da.c Thu Feb 9 07:45:02 2012 (r231254) @@ -1095,7 +1095,7 @@ dadump(void *arg, void *virtual, vm_offs /*data_ptr*/(u_int8_t *) virtual, /*dxfer_len*/length, /*sense_len*/SSD_FULL_SIZE, - DA_DEFAULT_TIMEOUT * 1000); + da_default_timeout * 1000); xpt_polled_action((union ccb *)&csio); if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1451,7 +1451,7 @@ daregister(struct cam_periph *periph, vo */ callout_init_mtx(&softc->sendordered_c, periph->sim->mtx, 0); callout_reset(&softc->sendordered_c, - (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL, + (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); mtx_unlock(periph->sim->mtx); @@ -2299,7 +2299,7 @@ dasendorderedtag(void *arg) } /* Queue us up again */ callout_reset(&softc->sendordered_c, - (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL, + (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 07:52:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5E9F1065674; Thu, 9 Feb 2012 07:52:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F5108FC0C; Thu, 9 Feb 2012 07:52: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 q197qiSQ088363; Thu, 9 Feb 2012 07:52:44 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197qi7k088360; Thu, 9 Feb 2012 07:52:44 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090752.q197qi7k088360@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 07:52:44 +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: r231255 - stable/7/contrib/ntp/ntpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:52:44 -0000 Author: bz Date: Thu Feb 9 07:52:44 2012 New Revision: 231255 URL: http://svn.freebsd.org/changeset/base/231255 Log: MFC r223667: In case ntp cannot resolve a hostname on startup it will queue the entry for resolving by a child process that, upon success, will add the entry to the config of the running running parent process. Unfortunately there are a couple of bugs with this, fixed in various later versions of upstream in potentially different ways due to other code changes: 1) Upon server [-46] the [-46] are used as FQDN for later resolving which does not work. Make sure we always pass the name (or IP there). 2) The intermediate file to carry the information to the child process does not know about -4/-6 restrictions, so that a dual-stacked host could resolve to an IPv6 address but that might be unreachable (see r223626) leading to no working synchronization ignoring a IPv4 record. Thus alter the intermediate format to also pass the address family (AF_UNSPEC (default), AF_INET or AF_INET6) to the child process depending on -4 or -6. 3) Make the child process to parse the new intermediate file format and save the address family for getaddrinfo() hints flags. 4) Change child to always reload resolv.conf calling res_init() before trying to resolve names. This will pick up resolv.conf changes or new resolv.confs should they have not existed or been empty or unusable on ntp startup. This fix is more conditional in upstream versions but given FreeBSD has res_init there is no need for the configure logic as well. Approved by: roberto Sponsored by: Sandvine Incorporated Modified: stable/7/contrib/ntp/ntpd/ntp_config.c stable/7/contrib/ntp/ntpd/ntp_intres.c Directory Properties: stable/7/contrib/ntp/ (props changed) Modified: stable/7/contrib/ntp/ntpd/ntp_config.c ============================================================================== --- stable/7/contrib/ntp/ntpd/ntp_config.c Thu Feb 9 07:45:02 2012 (r231254) +++ stable/7/contrib/ntp/ntpd/ntp_config.c Thu Feb 9 07:52:44 2012 (r231255) @@ -414,7 +414,7 @@ enum gnn_type { static int getnetnum P((const char *, struct sockaddr_storage *, int, enum gnn_type)); static void save_resolve P((char *, int, int, int, int, u_int, int, - keyid_t, u_char *)); + keyid_t, u_char *, u_char)); static void do_resolve_internal P((void)); static void abort_resolve P((void)); #if !defined(VMS) && !defined(SYS_WINNT) @@ -870,9 +870,9 @@ getconfig( stoa(&peeraddr)); } } else if (errflg == -1) { - save_resolve(tokens[1], hmode, peerversion, + save_resolve(tokens[istart - 1], hmode, peerversion, minpoll, maxpoll, peerflags, ttl, - peerkey, peerkeystr); + peerkey, peerkeystr, peeraddr.ss_family); } break; @@ -2325,7 +2325,8 @@ save_resolve( u_int flags, int ttl, keyid_t keyid, - u_char *keystr + u_char *keystr, + u_char peeraf ) { #ifndef SYS_VXWORKS @@ -2365,11 +2366,11 @@ save_resolve( } #endif - (void)fprintf(res_fp, "%s %d %d %d %d %d %d %u %s\n", name, + (void)fprintf(res_fp, "%s %u %d %d %d %d %d %d %u %s\n", name, peeraf, mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr); #ifdef DEBUG if (debug > 1) - printf("config: %s %d %d %d %d %x %d %u %s\n", name, mode, + printf("config: %s %u %d %d %d %d %x %d %u %s\n", name, peeraf, mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr); #endif Modified: stable/7/contrib/ntp/ntpd/ntp_intres.c ============================================================================== --- stable/7/contrib/ntp/ntpd/ntp_intres.c Thu Feb 9 07:45:02 2012 (r231254) +++ stable/7/contrib/ntp/ntpd/ntp_intres.c Thu Feb 9 07:52:44 2012 (r231255) @@ -34,6 +34,7 @@ #include #include +#include #include /**/ @@ -116,15 +117,16 @@ static int resolve_value; /* next value * is supposed to consist of entries in the following order */ #define TOK_HOSTNAME 0 -#define TOK_HMODE 1 -#define TOK_VERSION 2 -#define TOK_MINPOLL 3 -#define TOK_MAXPOLL 4 -#define TOK_FLAGS 5 -#define TOK_TTL 6 -#define TOK_KEYID 7 -#define TOK_KEYSTR 8 -#define NUMTOK 9 +#define TOK_PEERAF 1 +#define TOK_HMODE 2 +#define TOK_VERSION 3 +#define TOK_MINPOLL 4 +#define TOK_MAXPOLL 5 +#define TOK_FLAGS 6 +#define TOK_TTL 7 +#define TOK_KEYID 8 +#define TOK_KEYSTR 9 +#define NUMTOK 10 #define MAXLINESIZE 512 @@ -145,7 +147,7 @@ char *req_file; /* name of the file wit static void checkparent P((void)); static void removeentry P((struct conf_entry *)); static void addentry P((char *, int, int, int, int, u_int, - int, keyid_t, char *)); + int, keyid_t, char *, u_char)); static int findhostaddr P((struct conf_entry *)); static void openntp P((void)); static int request P((struct conf_peer *)); @@ -402,7 +404,8 @@ addentry( u_int flags, int ttl, keyid_t keyid, - char *keystr + char *keystr, + u_char peeraf ) { register char *cp; @@ -412,7 +415,7 @@ addentry( #ifdef DEBUG if (debug > 1) msyslog(LOG_INFO, - "intres: <%s> %d %d %d %d %x %d %x %s\n", name, + "intres: <%s> %u %d %d %d %d %x %d %x %s\n", name, peeraf, mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr); #endif @@ -427,6 +430,7 @@ addentry( ce->ce_peeraddr6 = in6addr_any; #endif ANYSOCK(&ce->peer_store); + ce->peer_store.ss_family = peeraf; /* Save AF for getaddrinfo hints. */ ce->ce_hmode = (u_char)mode; ce->ce_version = (u_char)version; ce->ce_minpoll = (u_char)minpoll; @@ -488,7 +492,8 @@ findhostaddr( #endif /* DEBUG */ memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; + hints.ai_family = entry->peer_store.ss_family; + hints.ai_socktype = SOCK_DGRAM; /* * If the IPv6 stack is not available look only for IPv4 addresses */ @@ -1022,6 +1027,13 @@ readconf( } } + if (intval[TOK_PEERAF] != AF_UNSPEC && intval[TOK_PEERAF] != + AF_INET && intval[TOK_PEERAF] != AF_INET6) { + msyslog(LOG_ERR, "invalid peer address family (%u) in " + "file %s", intval[TOK_PEERAF], name); + exit(1); + } + if (intval[TOK_HMODE] != MODE_ACTIVE && intval[TOK_HMODE] != MODE_CLIENT && intval[TOK_HMODE] != MODE_BROADCAST) { @@ -1078,7 +1090,7 @@ readconf( addentry(token[TOK_HOSTNAME], (int)intval[TOK_HMODE], (int)intval[TOK_VERSION], (int)intval[TOK_MINPOLL], (int)intval[TOK_MAXPOLL], flags, (int)intval[TOK_TTL], - intval[TOK_KEYID], token[TOK_KEYSTR]); + intval[TOK_KEYID], token[TOK_KEYSTR], (u_char)intval[TOK_PEERAF]); } } @@ -1100,6 +1112,9 @@ doconfigure( dores ? "with" : "without" ); #endif + if (dores) /* Reload /etc/resolv.conf - bug 1226 */ + res_init(); + ce = confentries; while (ce != NULL) { #ifdef DEBUG From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 07:52:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F815106566B; Thu, 9 Feb 2012 07:52:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 195338FC13; Thu, 9 Feb 2012 07:52:46 +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 q197qjdZ088399; Thu, 9 Feb 2012 07:52:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q197qjre088396; Thu, 9 Feb 2012 07:52:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090752.q197qjre088396@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 07:52:45 +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: r231256 - stable/8/contrib/ntp/ntpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 07:52:46 -0000 Author: bz Date: Thu Feb 9 07:52:45 2012 New Revision: 231256 URL: http://svn.freebsd.org/changeset/base/231256 Log: MFC r223667: In case ntp cannot resolve a hostname on startup it will queue the entry for resolving by a child process that, upon success, will add the entry to the config of the running running parent process. Unfortunately there are a couple of bugs with this, fixed in various later versions of upstream in potentially different ways due to other code changes: 1) Upon server [-46] the [-46] are used as FQDN for later resolving which does not work. Make sure we always pass the name (or IP there). 2) The intermediate file to carry the information to the child process does not know about -4/-6 restrictions, so that a dual-stacked host could resolve to an IPv6 address but that might be unreachable (see r223626) leading to no working synchronization ignoring a IPv4 record. Thus alter the intermediate format to also pass the address family (AF_UNSPEC (default), AF_INET or AF_INET6) to the child process depending on -4 or -6. 3) Make the child process to parse the new intermediate file format and save the address family for getaddrinfo() hints flags. 4) Change child to always reload resolv.conf calling res_init() before trying to resolve names. This will pick up resolv.conf changes or new resolv.confs should they have not existed or been empty or unusable on ntp startup. This fix is more conditional in upstream versions but given FreeBSD has res_init there is no need for the configure logic as well. Approved by: roberto Sponsored by: Sandvine Incorporated Modified: stable/8/contrib/ntp/ntpd/ntp_config.c stable/8/contrib/ntp/ntpd/ntp_intres.c Directory Properties: stable/8/contrib/ntp/ (props changed) Modified: stable/8/contrib/ntp/ntpd/ntp_config.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_config.c Thu Feb 9 07:52:44 2012 (r231255) +++ stable/8/contrib/ntp/ntpd/ntp_config.c Thu Feb 9 07:52:45 2012 (r231256) @@ -414,7 +414,7 @@ enum gnn_type { static int getnetnum P((const char *, struct sockaddr_storage *, int, enum gnn_type)); static void save_resolve P((char *, int, int, int, int, u_int, int, - keyid_t, u_char *)); + keyid_t, u_char *, u_char)); static void do_resolve_internal P((void)); static void abort_resolve P((void)); #if !defined(VMS) && !defined(SYS_WINNT) @@ -870,9 +870,9 @@ getconfig( stoa(&peeraddr)); } } else if (errflg == -1) { - save_resolve(tokens[1], hmode, peerversion, + save_resolve(tokens[istart - 1], hmode, peerversion, minpoll, maxpoll, peerflags, ttl, - peerkey, peerkeystr); + peerkey, peerkeystr, peeraddr.ss_family); } break; @@ -2325,7 +2325,8 @@ save_resolve( u_int flags, int ttl, keyid_t keyid, - u_char *keystr + u_char *keystr, + u_char peeraf ) { #ifndef SYS_VXWORKS @@ -2365,11 +2366,11 @@ save_resolve( } #endif - (void)fprintf(res_fp, "%s %d %d %d %d %d %d %u %s\n", name, + (void)fprintf(res_fp, "%s %u %d %d %d %d %d %d %u %s\n", name, peeraf, mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr); #ifdef DEBUG if (debug > 1) - printf("config: %s %d %d %d %d %x %d %u %s\n", name, mode, + printf("config: %s %u %d %d %d %d %x %d %u %s\n", name, peeraf, mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr); #endif Modified: stable/8/contrib/ntp/ntpd/ntp_intres.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_intres.c Thu Feb 9 07:52:44 2012 (r231255) +++ stable/8/contrib/ntp/ntpd/ntp_intres.c Thu Feb 9 07:52:45 2012 (r231256) @@ -34,6 +34,7 @@ #include #include +#include #include /**/ @@ -116,15 +117,16 @@ static int resolve_value; /* next value * is supposed to consist of entries in the following order */ #define TOK_HOSTNAME 0 -#define TOK_HMODE 1 -#define TOK_VERSION 2 -#define TOK_MINPOLL 3 -#define TOK_MAXPOLL 4 -#define TOK_FLAGS 5 -#define TOK_TTL 6 -#define TOK_KEYID 7 -#define TOK_KEYSTR 8 -#define NUMTOK 9 +#define TOK_PEERAF 1 +#define TOK_HMODE 2 +#define TOK_VERSION 3 +#define TOK_MINPOLL 4 +#define TOK_MAXPOLL 5 +#define TOK_FLAGS 6 +#define TOK_TTL 7 +#define TOK_KEYID 8 +#define TOK_KEYSTR 9 +#define NUMTOK 10 #define MAXLINESIZE 512 @@ -145,7 +147,7 @@ char *req_file; /* name of the file wit static void checkparent P((void)); static void removeentry P((struct conf_entry *)); static void addentry P((char *, int, int, int, int, u_int, - int, keyid_t, char *)); + int, keyid_t, char *, u_char)); static int findhostaddr P((struct conf_entry *)); static void openntp P((void)); static int request P((struct conf_peer *)); @@ -402,7 +404,8 @@ addentry( u_int flags, int ttl, keyid_t keyid, - char *keystr + char *keystr, + u_char peeraf ) { register char *cp; @@ -412,7 +415,7 @@ addentry( #ifdef DEBUG if (debug > 1) msyslog(LOG_INFO, - "intres: <%s> %d %d %d %d %x %d %x %s\n", name, + "intres: <%s> %u %d %d %d %d %x %d %x %s\n", name, peeraf, mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr); #endif @@ -427,6 +430,7 @@ addentry( ce->ce_peeraddr6 = in6addr_any; #endif ANYSOCK(&ce->peer_store); + ce->peer_store.ss_family = peeraf; /* Save AF for getaddrinfo hints. */ ce->ce_hmode = (u_char)mode; ce->ce_version = (u_char)version; ce->ce_minpoll = (u_char)minpoll; @@ -488,7 +492,8 @@ findhostaddr( #endif /* DEBUG */ memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; + hints.ai_family = entry->peer_store.ss_family; + hints.ai_socktype = SOCK_DGRAM; /* * If the IPv6 stack is not available look only for IPv4 addresses */ @@ -1022,6 +1027,13 @@ readconf( } } + if (intval[TOK_PEERAF] != AF_UNSPEC && intval[TOK_PEERAF] != + AF_INET && intval[TOK_PEERAF] != AF_INET6) { + msyslog(LOG_ERR, "invalid peer address family (%u) in " + "file %s", intval[TOK_PEERAF], name); + exit(1); + } + if (intval[TOK_HMODE] != MODE_ACTIVE && intval[TOK_HMODE] != MODE_CLIENT && intval[TOK_HMODE] != MODE_BROADCAST) { @@ -1078,7 +1090,7 @@ readconf( addentry(token[TOK_HOSTNAME], (int)intval[TOK_HMODE], (int)intval[TOK_VERSION], (int)intval[TOK_MINPOLL], (int)intval[TOK_MAXPOLL], flags, (int)intval[TOK_TTL], - intval[TOK_KEYID], token[TOK_KEYSTR]); + intval[TOK_KEYID], token[TOK_KEYSTR], (u_char)intval[TOK_PEERAF]); } } @@ -1100,6 +1112,9 @@ doconfigure( dores ? "with" : "without" ); #endif + if (dores) /* Reload /etc/resolv.conf - bug 1226 */ + res_init(); + ce = confentries; while (ce != NULL) { #ifdef DEBUG From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 08:33:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF795106564A; Thu, 9 Feb 2012 08:33:04 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0AAE8FC0C; Thu, 9 Feb 2012 08:33:04 +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 q198X4T9089857; Thu, 9 Feb 2012 08:33:04 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q198X4vs089855; Thu, 9 Feb 2012 08:33:04 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202090833.q198X4vs089855@svn.freebsd.org> From: Kevin Lo Date: Thu, 9 Feb 2012 08:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231257 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 08:33:05 -0000 Author: kevlo Date: Thu Feb 9 08:33:04 2012 New Revision: 231257 URL: http://svn.freebsd.org/changeset/base/231257 Log: Mention run(4) Modified: head/usr.sbin/wpa/hostapd/hostapd.8 Modified: head/usr.sbin/wpa/hostapd/hostapd.8 ============================================================================== --- head/usr.sbin/wpa/hostapd/hostapd.8 Thu Feb 9 07:52:45 2012 (r231256) +++ head/usr.sbin/wpa/hostapd/hostapd.8 Thu Feb 9 08:33:04 2012 (r231257) @@ -112,6 +112,7 @@ Store PID in .Xr ipw 4 , .Xr iwi 4 , .Xr ral 4 , +.Xr run 4 , .Xr ural 4 , .Xr wi 4 , .Xr hostapd.conf 5 , From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 08:41:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 037A51065673; Thu, 9 Feb 2012 08:41:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E21118FC14; Thu, 9 Feb 2012 08:41: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 q198fucs090222; Thu, 9 Feb 2012 08:41:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q198fuMt090220; Thu, 9 Feb 2012 08:41:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090841.q198fuMt090220@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 08:41: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: r231258 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 08:41:57 -0000 Author: bz Date: Thu Feb 9 08:41:56 2012 New Revision: 231258 URL: http://svn.freebsd.org/changeset/base/231258 Log: MFC r223739: Remove extra white space to comply with style for the rest of the struct. Modified: stable/8/sys/net/if_var.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Thu Feb 9 08:33:04 2012 (r231257) +++ stable/8/sys/net/if_var.h Thu Feb 9 08:41:56 2012 (r231258) @@ -197,14 +197,14 @@ struct ifnet { /* protected by if_addr_mtx */ void *if_pf_kif; void *if_lagg; /* lagg glue */ - u_char if_alloctype; /* if_type at time of allocation */ + u_char if_alloctype; /* if_type at time of allocation */ /* * Spare fields are added so that we can modify sensitive data * structures without changing the kernel binary interface, and must * be used with care where binary compatibility is required. */ - char if_cspare[3]; + char if_cspare[3]; char *if_description; /* interface description */ void *if_pspare[7]; int if_ispare[4]; From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 09:01:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2DE11065679; Thu, 9 Feb 2012 09:01:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93F598FC21; Thu, 9 Feb 2012 09:01:03 +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 q19913dH090902; Thu, 9 Feb 2012 09:01:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19913Mm090900; Thu, 9 Feb 2012 09:01:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090901.q19913Mm090900@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 09:01:03 +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: r231259 - stable/7/contrib/pf/ftp-proxy X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:01:03 -0000 Author: bz Date: Thu Feb 9 09:01:03 2012 New Revision: 231259 URL: http://svn.freebsd.org/changeset/base/231259 Log: MF8 r224326: Flush output buffers before closing TCP session. Fixes the case where the proxy would eat the 221 response coming from the server towards the client. Obtained from: OpenBSD r1.18 PR: bin/154469 Modified: stable/7/contrib/pf/ftp-proxy/ftp-proxy.c Directory Properties: stable/7/contrib/pf/ (props changed) Modified: stable/7/contrib/pf/ftp-proxy/ftp-proxy.c ============================================================================== --- stable/7/contrib/pf/ftp-proxy/ftp-proxy.c Thu Feb 9 08:41:56 2012 (r231258) +++ stable/7/contrib/pf/ftp-proxy/ftp-proxy.c Thu Feb 9 09:01:03 2012 (r231259) @@ -273,6 +273,12 @@ end_session(struct session *s) logmsg(LOG_INFO, "#%d ending session", s->id); + /* Flush output buffers. */ + if (s->client_bufev && s->client_fd != -1) + evbuffer_write(s->client_bufev->output, s->client_fd); + if (s->server_bufev && s->server_fd != -1) + evbuffer_write(s->server_bufev->output, s->server_fd); + if (s->client_fd != -1) close(s->client_fd); if (s->server_fd != -1) From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 09:09:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CD991065672; Thu, 9 Feb 2012 09:09:13 +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 202BC8FC12; Thu, 9 Feb 2012 09:09:11 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q1998sPj084551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 9 Feb 2012 11:08:54 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q1998rSu056478; Thu, 9 Feb 2012 11:08:53 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q1998rGU056477; Thu, 9 Feb 2012 11:08:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 9 Feb 2012 11:08:53 +0200 From: Konstantin Belousov To: mdf@freebsd.org Message-ID: <20120209090853.GY3283@deviant.kiev.zoral.com.ua> References: <201202081836.q18Ia7jw055652@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jGviIKn9uLGVFpXC" Content-Disposition: inline In-Reply-To: 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.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231220 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:09:13 -0000 --jGviIKn9uLGVFpXC Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 08, 2012 at 11:21:59AM -0800, mdf@freebsd.org wrote: > On Wed, Feb 8, 2012 at 10:36 AM, Konstantin Belousov wr= ote: > > Author: kib > > Date: Wed Feb =9A8 18:36:07 2012 > > New Revision: 231220 > > URL: http://svn.freebsd.org/changeset/base/231220 > > > > Log: > > =9ATrim 8 unused bytes from struct vnode on 64-bit architectures. >=20 > Doesn't this change the KBI? So should __FreeBSD_version be bumped? Definitely, it changes the KBI. This is the reason I did not specified MFC period (but really wanted it). We do not track KBI changes on HEAD with __FreeBSD_version. IMO, __FreeBSD_version is more about KPI, and even for KPI, it is more at the discretion of the committer and usefulness of notification. With this change, all VFS modules must be recompiled. But HEAD had a lot of changes related to VFS interface which went in silently. --jGviIKn9uLGVFpXC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk8zjSUACgkQC3+MBN1Mb4ikOwCcDjK3GfY2e+O9zHjBbG1N+WC2 jxkAoJY8rC1thtr4sfL2rI9RD+x6/dCk =5grN -----END PGP SIGNATURE----- --jGviIKn9uLGVFpXC-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 09:20:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDB64106566C; Thu, 9 Feb 2012 09:20:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F808FC0A; Thu, 9 Feb 2012 09:20:34 +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 q199KYrj091536; Thu, 9 Feb 2012 09:20:34 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199KYwJ091533; Thu, 9 Feb 2012 09:20:34 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090920.q199KYwJ091533@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 09:20:34 +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: r231260 - stable/9/bin/df X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:20:35 -0000 Author: bapt Date: Thu Feb 9 09:20:34 2012 New Revision: 231260 URL: http://svn.freebsd.org/changeset/base/231260 Log: MFH r226502,r226503: factor out the common code and fix two display bugs Approved by: des (mentor) Modified: stable/9/bin/df/df.1 stable/9/bin/df/df.c Directory Properties: stable/9/bin/df/ (props changed) Modified: stable/9/bin/df/df.1 ============================================================================== --- stable/9/bin/df/df.1 Thu Feb 9 09:01:03 2012 (r231259) +++ stable/9/bin/df/df.1 Thu Feb 9 09:20:34 2012 (r231260) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd November 23, 2008 +.Dd October 18, 2011 .Dt DF 1 .Os .Sh NAME @@ -63,6 +63,7 @@ The following options are available: Show all mount points, including those that were mounted with the .Dv MNT_IGNORE flag. +This is implied for file systems specified on the command line. .It Fl b Use 512-byte blocks rather than the default. Note that Modified: stable/9/bin/df/df.c ============================================================================== --- stable/9/bin/df/df.c Thu Feb 9 09:01:03 2012 (r231259) +++ stable/9/bin/df/df.c Thu Feb 9 09:20:34 2012 (r231260) @@ -107,7 +107,7 @@ main(int argc, char *argv[]) const char *fstype; char *mntpath, *mntpt; const char **vfslist; - size_t i, mntsize; + int i, mntsize; int ch, rv; fstype = "ufs"; @@ -187,30 +187,21 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - bzero(&maxwidths, sizeof(maxwidths)); - for (i = 0; i < mntsize; i++) - update_maxwidths(&maxwidths, &mntbuf[i]); - rv = 0; if (!*argv) { + /* everything (modulo -t) */ + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); - bzero(&maxwidths, sizeof(maxwidths)); - for (i = 0; i < mntsize; i++) { - if (cflag) - addstat(&totalbuf, &mntbuf[i]); - update_maxwidths(&maxwidths, &mntbuf[i]); - } - if (cflag) - update_maxwidths(&maxwidths, &totalbuf); - for (i = 0; i < mntsize; i++) - if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) - prtstat(&mntbuf[i], &maxwidths); - if (cflag) - prtstat(&totalbuf, &maxwidths); - exit(rv); + } else { + /* just the filesystems specified on the command line */ + mntbuf = malloc(argc * sizeof(*mntbuf)); + if (mntbuf == 0) + err(1, "malloc()"); + mntsize = 0; + /* continued in for loop below */ } + /* iterate through specified filesystems */ for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == 0) { @@ -279,14 +270,24 @@ main(int argc, char *argv[]) continue; } - if (argc == 1) { - bzero(&maxwidths, sizeof(maxwidths)); - update_maxwidths(&maxwidths, &statfsbuf); + /* the user asked for it, so ignore the ignore flag */ + statfsbuf.f_flags &= ~MNT_IGNORE; + + /* add to list */ + mntbuf[mntsize++] = statfsbuf; + } + + bzero(&maxwidths, sizeof(maxwidths)); + for (i = 0; i < mntsize; i++) { + if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) { + update_maxwidths(&maxwidths, &mntbuf[i]); + if (cflag) + addstat(&totalbuf, &mntbuf[i]); } - prtstat(&statfsbuf, &maxwidths); - if (cflag) - addstat(&totalbuf, &statfsbuf); } + for (i = 0; i < mntsize; i++) + if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) + prtstat(&mntbuf[i], &maxwidths); if (cflag) prtstat(&totalbuf, &maxwidths); return (rv); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 09:20:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEF01065784; Thu, 9 Feb 2012 09:20:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A601B8FC16; Thu, 9 Feb 2012 09:20:50 +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 q199KoAL091582; Thu, 9 Feb 2012 09:20:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199Ko7S091579; Thu, 9 Feb 2012 09:20:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090920.q199Ko7S091579@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 09:20:50 +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: r231261 - stable/8/bin/df X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:20:50 -0000 Author: bapt Date: Thu Feb 9 09:20:50 2012 New Revision: 231261 URL: http://svn.freebsd.org/changeset/base/231261 Log: MFH r226502,r226503: factor out the common code and fix two display bugs Approved by: des (mentor) Modified: stable/8/bin/df/df.1 stable/8/bin/df/df.c Directory Properties: stable/8/bin/df/ (props changed) Modified: stable/8/bin/df/df.1 ============================================================================== --- stable/8/bin/df/df.1 Thu Feb 9 09:20:34 2012 (r231260) +++ stable/8/bin/df/df.1 Thu Feb 9 09:20:50 2012 (r231261) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd November 23, 2008 +.Dd October 18, 2011 .Dt DF 1 .Os .Sh NAME @@ -63,6 +63,7 @@ The following options are available: Show all mount points, including those that were mounted with the .Dv MNT_IGNORE flag. +This is implied for file systems specified on the command line. .It Fl b Use 512-byte blocks rather than the default. Note that Modified: stable/8/bin/df/df.c ============================================================================== --- stable/8/bin/df/df.c Thu Feb 9 09:20:34 2012 (r231260) +++ stable/8/bin/df/df.c Thu Feb 9 09:20:50 2012 (r231261) @@ -107,7 +107,7 @@ main(int argc, char *argv[]) const char *fstype; char *mntpath, *mntpt; const char **vfslist; - size_t i, mntsize; + int i, mntsize; int ch, rv; fstype = "ufs"; @@ -187,30 +187,21 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - bzero(&maxwidths, sizeof(maxwidths)); - for (i = 0; i < mntsize; i++) - update_maxwidths(&maxwidths, &mntbuf[i]); - rv = 0; if (!*argv) { + /* everything (modulo -t) */ + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); - bzero(&maxwidths, sizeof(maxwidths)); - for (i = 0; i < mntsize; i++) { - if (cflag) - addstat(&totalbuf, &mntbuf[i]); - update_maxwidths(&maxwidths, &mntbuf[i]); - } - if (cflag) - update_maxwidths(&maxwidths, &totalbuf); - for (i = 0; i < mntsize; i++) - if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) - prtstat(&mntbuf[i], &maxwidths); - if (cflag) - prtstat(&totalbuf, &maxwidths); - exit(rv); + } else { + /* just the filesystems specified on the command line */ + mntbuf = malloc(argc * sizeof(*mntbuf)); + if (mntbuf == 0) + err(1, "malloc()"); + mntsize = 0; + /* continued in for loop below */ } + /* iterate through specified filesystems */ for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == 0) { @@ -279,14 +270,24 @@ main(int argc, char *argv[]) continue; } - if (argc == 1) { - bzero(&maxwidths, sizeof(maxwidths)); - update_maxwidths(&maxwidths, &statfsbuf); + /* the user asked for it, so ignore the ignore flag */ + statfsbuf.f_flags &= ~MNT_IGNORE; + + /* add to list */ + mntbuf[mntsize++] = statfsbuf; + } + + bzero(&maxwidths, sizeof(maxwidths)); + for (i = 0; i < mntsize; i++) { + if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) { + update_maxwidths(&maxwidths, &mntbuf[i]); + if (cflag) + addstat(&totalbuf, &mntbuf[i]); } - prtstat(&statfsbuf, &maxwidths); - if (cflag) - addstat(&totalbuf, &statfsbuf); } + for (i = 0; i < mntsize; i++) + if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) + prtstat(&mntbuf[i], &maxwidths); if (cflag) prtstat(&totalbuf, &maxwidths); return (rv); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 09:23:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB6E4106566C; Thu, 9 Feb 2012 09:23:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B57CB8FC12; Thu, 9 Feb 2012 09:23:37 +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 q199NbGL091718; Thu, 9 Feb 2012 09:23:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199Nb6m091716; Thu, 9 Feb 2012 09:23:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202090923.q199Nb6m091716@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 09:23:37 +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: r231262 - stable/8/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:23:37 -0000 Author: bz Date: Thu Feb 9 09:23:37 2012 New Revision: 231262 URL: http://svn.freebsd.org/changeset/base/231262 Log: MFC r224011: Fix indentation. Obtained from: Ed Maste at Sandvine Incorporated Sponsored by: Sandvine Incorporated Modified: stable/8/usr.bin/top/machine.c Directory Properties: stable/8/usr.bin/top/ (props changed) Modified: stable/8/usr.bin/top/machine.c ============================================================================== --- stable/8/usr.bin/top/machine.c Thu Feb 9 09:20:50 2012 (r231261) +++ stable/8/usr.bin/top/machine.c Thu Feb 9 09:23:37 2012 (r231262) @@ -841,7 +841,7 @@ format_next_process(caddr_t handle, char (args = kvm_getargv(kd, pp, cmdlengthdelta)) == NULL || !(*args)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && - pp->ki_ocomm[0]) { + pp->ki_ocomm[0]) { snprintf(cmdbuf, cmdlengthdelta, "{%s}", pp->ki_ocomm); } else { From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 09:24:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 900C6106566B; Thu, 9 Feb 2012 09:24:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 791858FC08; Thu, 9 Feb 2012 09:24:33 +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 q199OX7f091786; Thu, 9 Feb 2012 09:24:33 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199OXAt091783; Thu, 9 Feb 2012 09:24:33 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090924.q199OXAt091783@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 09:24:33 +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: r231263 - stable/9/usr.bin/ktrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:24:33 -0000 Author: bapt Date: Thu Feb 9 09:24:33 2012 New Revision: 231263 URL: http://svn.freebsd.org/changeset/base/231263 Log: MFH r226504: Make ktrace(1) build cleanly at WARNS level 6 Approved by: des (mentor) Modified: stable/9/usr.bin/ktrace/Makefile stable/9/usr.bin/ktrace/ktrace.c Directory Properties: stable/9/usr.bin/ktrace/ (props changed) Modified: stable/9/usr.bin/ktrace/Makefile ============================================================================== --- stable/9/usr.bin/ktrace/Makefile Thu Feb 9 09:23:37 2012 (r231262) +++ stable/9/usr.bin/ktrace/Makefile Thu Feb 9 09:24:33 2012 (r231263) @@ -5,6 +5,4 @@ PROG= ktrace SRCS= ktrace.c subr.c MLINKS= ktrace.1 trace.1 -WARNS?= 4 - .include Modified: stable/9/usr.bin/ktrace/ktrace.c ============================================================================== --- stable/9/usr.bin/ktrace/ktrace.c Thu Feb 9 09:23:37 2012 (r231262) +++ stable/9/usr.bin/ktrace/ktrace.c Thu Feb 9 09:24:33 2012 (r231263) @@ -43,14 +43,15 @@ static char sccsid[] = "@(#)ktrace.c 8.1 __FBSDID("$FreeBSD$"); #include -#include #include +#include #include -#include #include #include #include +#include +#include #include #include #include @@ -59,21 +60,22 @@ __FBSDID("$FreeBSD$"); static char def_tracefile[] = DEF_TRACEFILE; +static enum clear { NOTSET, CLEAR, CLEARALL } clear = NOTSET; +static int pid; + static void no_ktrace(int); -static int rpid(char *); +static void set_pid_clear(const char *, enum clear); static void usage(void); int main(int argc, char *argv[]) { - enum { NOTSET, CLEAR, CLEARALL } clear; - int append, ch, fd, inherit, ops, pid, pidset, trpoints; + int append, ch, fd, inherit, ops, trpoints; const char *tracefile; mode_t omask; struct stat sb; - clear = NOTSET; - append = ops = pidset = inherit = 0; + append = ops = inherit = 0; trpoints = DEF_POINTS; tracefile = def_tracefile; while ((ch = getopt(argc,argv,"aCcdf:g:ip:t:")) != -1) @@ -82,11 +84,10 @@ main(int argc, char *argv[]) append = 1; break; case 'C': - clear = CLEARALL; - pidset = 1; + set_pid_clear("1", CLEARALL); break; case 'c': - clear = CLEAR; + set_pid_clear(NULL, CLEAR); break; case 'd': ops |= KTRFLAG_DESCEND; @@ -95,15 +96,14 @@ main(int argc, char *argv[]) tracefile = optarg; break; case 'g': - pid = -rpid(optarg); - pidset = 1; + set_pid_clear(optarg, NOTSET); + pid = -pid; break; case 'i': inherit = 1; break; case 'p': - pid = rpid(optarg); - pidset = 1; + set_pid_clear(optarg, NOTSET); break; case 't': trpoints = getpoints(optarg); @@ -115,12 +115,19 @@ main(int argc, char *argv[]) default: usage(); } + argv += optind; argc -= optind; - - if ((pidset && *argv) || (!pidset && clear == NOTSET && !*argv)) + + /* must have either -[Cc], a pid or a command */ + if (clear == NOTSET && pid == 0 && argc == 0) + usage(); + /* can't have both a pid and a command */ + /* (note that -C sets pid to 1) */ + if (pid != 0 && argc > 0) { usage(); - + } + if (inherit) trpoints |= KTRFAC_INHERIT; @@ -129,10 +136,9 @@ main(int argc, char *argv[]) if (clear == CLEARALL) { ops = KTROP_CLEAR | KTRFLAG_DESCEND; trpoints = ALL_POINTS; - pid = 1; - } else - ops |= pidset ? KTROP_CLEAR : KTROP_CLEARFILE; - + } else { + ops |= pid ? KTROP_CLEAR : KTROP_CLEARFILE; + } if (ktrace(tracefile, ops, trpoints, pid) < 0) err(1, "%s", tracefile); exit(0); @@ -160,46 +166,75 @@ main(int argc, char *argv[]) trpoints |= PROC_ABI_POINTS; - if (*argv) { + if (argc > 0) { if (ktrace(tracefile, ops, trpoints, getpid()) < 0) err(1, "%s", tracefile); - execvp(argv[0], &argv[0]); - err(1, "exec of '%s' failed", argv[0]); + execvp(*argv, argv); + err(1, "exec of '%s' failed", *argv); } - else if (ktrace(tracefile, ops, trpoints, pid) < 0) + if (ktrace(tracefile, ops, trpoints, pid) < 0) err(1, "%s", tracefile); exit(0); } -static int -rpid(char *p) +static void +set_pid_clear(const char *p, enum clear cl) { - static int first; + intmax_t n; + char *e; - if (first++) { - warnx("only one -g or -p flag is permitted"); + if (clear != NOTSET && cl != NOTSET) { + /* either -c and -C or either of them twice */ + warnx("only one -c or -C flag is permitted"); + usage(); + } + if ((clear == CLEARALL && p != NULL) || (cl == CLEARALL && pid != 0)) { + /* both -C and a pid or pgid */ + warnx("the -C flag may not be combined with -g or -p"); usage(); } - if (!*p) { - warnx("illegal process id"); + if (p != NULL && pid != 0) { + /* either -p and -g or either of them twice */ + warnx("only one -g or -p flag is permitted"); usage(); } - return(atoi(p)); + if (p != NULL) { + errno = 0; + n = strtoimax(p, &e, 10); + /* + * 1) not a number, or outside the range of an intmax_t + * 2) inside the range of intmax_t but outside the range + * of an int, keeping in mind that the pid may be + * negated if it's actually a pgid. + */ + if (*e != '\0' || n < 1 || errno == ERANGE || + n > (intmax_t)INT_MAX || n > -(intmax_t)INT_MIN) { + warnx("invalid process or group id"); + usage(); + } + pid = n; + } + if (cl != NOTSET) + if ((clear = cl) == CLEARALL) + pid = 1; } static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n", -"usage: ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t trstr]", -" ktrace [-adi] [-f trfile] [-t trstr] command"); + + fprintf(stderr, "%s\n%s\n", + "usage: ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t trstr]", + " ktrace [-adi] [-f trfile] [-t trstr] command"); exit(1); } static void no_ktrace(int sig __unused) { - (void)fprintf(stderr, -"error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'options KTRACE'\n"); + + fprintf(stderr, "error:\t%s\n\t%s\n", + "ktrace() system call not supported in the running kernel", + "re-compile kernel with 'options KTRACE'"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 09:24:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3263310657F2; Thu, 9 Feb 2012 09:24:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39F578FC17; Thu, 9 Feb 2012 09:24: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 q199OrNk091831; Thu, 9 Feb 2012 09:24:53 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q199OrRn091829; Thu, 9 Feb 2012 09:24:53 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202090924.q199OrRn091829@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 09:24:53 +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: r231264 - stable/8/usr.bin/ktrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:24:54 -0000 Author: bapt Date: Thu Feb 9 09:24:52 2012 New Revision: 231264 URL: http://svn.freebsd.org/changeset/base/231264 Log: MFH r226504: Make ktrace(1) build cleanly at WARNS level 6 Approved by: des (mentor) Modified: stable/8/usr.bin/ktrace/ktrace.c Directory Properties: stable/8/usr.bin/ktrace/ (props changed) Modified: stable/8/usr.bin/ktrace/ktrace.c ============================================================================== --- stable/8/usr.bin/ktrace/ktrace.c Thu Feb 9 09:24:33 2012 (r231263) +++ stable/8/usr.bin/ktrace/ktrace.c Thu Feb 9 09:24:52 2012 (r231264) @@ -47,15 +47,15 @@ static char sccsid[] = "@(#)ktrace.c 8.1 __FBSDID("$FreeBSD$"); #include -#include #include +#include #include -#include #include #include #include -#include +#include +#include #include #include #include @@ -64,21 +64,22 @@ __FBSDID("$FreeBSD$"); static char def_tracefile[] = DEF_TRACEFILE; +static enum clear { NOTSET, CLEAR, CLEARALL } clear = NOTSET; +static int pid; + static void no_ktrace(int); -static int rpid(char *); +static void set_pid_clear(const char *, enum clear); static void usage(void); int main(int argc, char *argv[]) { - enum { NOTSET, CLEAR, CLEARALL } clear; - int append, ch, fd, inherit, ops, pid, pidset, trpoints; + int append, ch, fd, inherit, ops, trpoints; const char *tracefile; mode_t omask; struct stat sb; - clear = NOTSET; - append = ops = pidset = inherit = 0; + append = ops = inherit = 0; trpoints = DEF_POINTS; tracefile = def_tracefile; while ((ch = getopt(argc,argv,"aCcdf:g:ip:t:")) != -1) @@ -87,11 +88,10 @@ main(int argc, char *argv[]) append = 1; break; case 'C': - clear = CLEARALL; - pidset = 1; + set_pid_clear("1", CLEARALL); break; case 'c': - clear = CLEAR; + set_pid_clear(NULL, CLEAR); break; case 'd': ops |= KTRFLAG_DESCEND; @@ -100,15 +100,14 @@ main(int argc, char *argv[]) tracefile = optarg; break; case 'g': - pid = -rpid(optarg); - pidset = 1; + set_pid_clear(optarg, NOTSET); + pid = -pid; break; case 'i': inherit = 1; break; case 'p': - pid = rpid(optarg); - pidset = 1; + set_pid_clear(optarg, NOTSET); break; case 't': trpoints = getpoints(optarg); @@ -120,12 +119,19 @@ main(int argc, char *argv[]) default: usage(); } + argv += optind; argc -= optind; - - if ((pidset && *argv) || (!pidset && clear == NOTSET && !*argv)) + + /* must have either -[Cc], a pid or a command */ + if (clear == NOTSET && pid == 0 && argc == 0) usage(); - + /* can't have both a pid and a command */ + /* (note that -C sets pid to 1) */ + if (pid != 0 && argc > 0) { + usage(); + } + if (inherit) trpoints |= KTRFAC_INHERIT; @@ -134,10 +140,9 @@ main(int argc, char *argv[]) if (clear == CLEARALL) { ops = KTROP_CLEAR | KTRFLAG_DESCEND; trpoints = ALL_POINTS; - pid = 1; - } else - ops |= pidset ? KTROP_CLEAR : KTROP_CLEARFILE; - + } else { + ops |= pid ? KTROP_CLEAR : KTROP_CLEARFILE; + } if (ktrace(tracefile, ops, trpoints, pid) < 0) err(1, "%s", tracefile); exit(0); @@ -165,46 +170,75 @@ main(int argc, char *argv[]) trpoints |= PROC_ABI_POINTS; - if (*argv) { + if (argc > 0) { if (ktrace(tracefile, ops, trpoints, getpid()) < 0) err(1, "%s", tracefile); - execvp(argv[0], &argv[0]); - err(1, "exec of '%s' failed", argv[0]); + execvp(*argv, argv); + err(1, "exec of '%s' failed", *argv); } - else if (ktrace(tracefile, ops, trpoints, pid) < 0) + if (ktrace(tracefile, ops, trpoints, pid) < 0) err(1, "%s", tracefile); exit(0); } -static int -rpid(char *p) +static void +set_pid_clear(const char *p, enum clear cl) { - static int first; + intmax_t n; + char *e; - if (first++) { - warnx("only one -g or -p flag is permitted"); + if (clear != NOTSET && cl != NOTSET) { + /* either -c and -C or either of them twice */ + warnx("only one -c or -C flag is permitted"); + usage(); + } + if ((clear == CLEARALL && p != NULL) || (cl == CLEARALL && pid != 0)) { + /* both -C and a pid or pgid */ + warnx("the -C flag may not be combined with -g or -p"); usage(); } - if (!*p) { - warnx("illegal process id"); + if (p != NULL && pid != 0) { + /* either -p and -g or either of them twice */ + warnx("only one -g or -p flag is permitted"); usage(); } - return(atoi(p)); + if (p != NULL) { + errno = 0; + n = strtoimax(p, &e, 10); + /* + * 1) not a number, or outside the range of an intmax_t + * 2) inside the range of intmax_t but outside the range + * of an int, keeping in mind that the pid may be + * negated if it's actually a pgid. + */ + if (*e != '\0' || n < 1 || errno == ERANGE || + n > (intmax_t)INT_MAX || n > -(intmax_t)INT_MIN) { + warnx("invalid process or group id"); + usage(); + } + pid = n; + } + if (cl != NOTSET) + if ((clear = cl) == CLEARALL) + pid = 1; } static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n", -"usage: ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t trstr]", -" ktrace [-adi] [-f trfile] [-t trstr] command"); + + fprintf(stderr, "%s\n%s\n", + "usage: ktrace [-aCcdi] [-f trfile] [-g pgrp | -p pid] [-t trstr]", + " ktrace [-adi] [-f trfile] [-t trstr] command"); exit(1); } static void no_ktrace(int sig __unused) { - (void)fprintf(stderr, -"error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'options KTRACE'\n"); + + fprintf(stderr, "error:\t%s\n\t%s\n", + "ktrace() system call not supported in the running kernel", + "re-compile kernel with 'options KTRACE'"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 10:09:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A57BE1065670; Thu, 9 Feb 2012 10:09:13 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 904C28FC0C; Thu, 9 Feb 2012 10:09:13 +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 q19A9Dbe093391; Thu, 9 Feb 2012 10:09:13 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19A9D2B093386; Thu, 9 Feb 2012 10:09:13 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202091009.q19A9D2B093386@svn.freebsd.org> From: Martin Matuska Date: Thu, 9 Feb 2012 10:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231265 - in head: share/man/man5 sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:09:13 -0000 Author: mm Date: Thu Feb 9 10:09:12 2012 New Revision: 231265 URL: http://svn.freebsd.org/changeset/base/231265 Log: Introduce the "ruleset=number" option for devfs(5) mounts. Add support for updating the devfs mount (currently only changing the ruleset number is supported). Check mnt_optnew with vfs_filteropt(9). This new option sets the specified ruleset number as the active ruleset of the new devfs mount and applies all its rules at mount time. If the specified ruleset doesn't exist, a new empty ruleset is created. MFC after: 1 month Modified: head/share/man/man5/devfs.5 head/sys/fs/devfs/devfs.h head/sys/fs/devfs/devfs_rule.c head/sys/fs/devfs/devfs_vfsops.c Modified: head/share/man/man5/devfs.5 ============================================================================== --- head/share/man/man5/devfs.5 Thu Feb 9 09:24:52 2012 (r231264) +++ head/share/man/man5/devfs.5 Thu Feb 9 10:09:12 2012 (r231265) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2010 +.Dd February 9, 2012 .Dt DEVFS 5 .Os .Sh NAME @@ -90,6 +90,29 @@ and .Pa 2 . .Xr fdescfs 5 creates files for all open descriptors. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl o Ar options +Use the specified mount +.Ar options , +as described in +.Xr mount 8 . +The following devfs file system-specific options are available: +.Bl -tag -width indent +.It Cm ruleset Ns No = Ns Ar ruleset +Set ruleset number +.Ar ruleset +as the current ruleset for the mount-point and apply all its rules. If the +ruleset number +.Ar ruleset +does not exist, an empty ruleset with the number +.Ar ruleset +is created. See +.Xr devfs 8 +for more information on working with devfs rulesets. +.El +.El .Sh FILES .Bl -tag -width /dev/XXXX -compact .It Pa /dev Modified: head/sys/fs/devfs/devfs.h ============================================================================== --- head/sys/fs/devfs/devfs.h Thu Feb 9 09:24:52 2012 (r231264) +++ head/sys/fs/devfs/devfs.h Thu Feb 9 10:09:12 2012 (r231265) @@ -182,6 +182,8 @@ void devfs_rules_apply(struct devfs_moun void devfs_rules_cleanup(struct devfs_mount *); int devfs_rules_ioctl(struct devfs_mount *, u_long, caddr_t, struct thread *); +void devfs_ruleset_set(devfs_rsnum rsnum, struct devfs_mount *dm); +void devfs_ruleset_apply(struct devfs_mount *dm); int devfs_allocv(struct devfs_dirent *, struct mount *, int, struct vnode **); char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *, Modified: head/sys/fs/devfs/devfs_rule.c ============================================================================== --- head/sys/fs/devfs/devfs_rule.c Thu Feb 9 09:24:52 2012 (r231264) +++ head/sys/fs/devfs/devfs_rule.c Thu Feb 9 10:09:12 2012 (r231265) @@ -771,3 +771,38 @@ devfs_rules_cleanup(struct devfs_mount * devfs_ruleset_reap(ds); } } + +/* + * Make rsnum the active ruleset for dm (locked) + */ +void +devfs_ruleset_set(devfs_rsnum rsnum, struct devfs_mount *dm) +{ + + sx_assert(&dm->dm_lock, SX_XLOCKED); + + sx_xlock(&sx_rules); + devfs_ruleset_use(rsnum, dm); + sx_xunlock(&sx_rules); +} + +/* + * Apply the current active ruleset on a mount + */ +void +devfs_ruleset_apply(struct devfs_mount *dm) +{ + struct devfs_ruleset *ds; + + sx_assert(&dm->dm_lock, SX_XLOCKED); + + sx_xlock(&sx_rules); + if (dm->dm_ruleset == 0) { + sx_xunlock(&sx_rules); + return; + } + ds = devfs_ruleset_bynum(dm->dm_ruleset); + if (ds != NULL) + devfs_ruleset_applydm(ds, dm); + sx_xunlock(&sx_rules); +} Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Thu Feb 9 09:24:52 2012 (r231264) +++ head/sys/fs/devfs/devfs_vfsops.c Thu Feb 9 10:09:12 2012 (r231265) @@ -56,6 +56,10 @@ static vfs_unmount_t devfs_unmount; static vfs_root_t devfs_root; static vfs_statfs_t devfs_statfs; +static const char *devfs_opts[] = { + "from", "ruleset", NULL +}; + /* * Mount the filesystem */ @@ -65,15 +69,46 @@ devfs_mount(struct mount *mp) int error; struct devfs_mount *fmp; struct vnode *rvp; + int rsnum; if (devfs_unr == NULL) devfs_unr = new_unrhdr(0, INT_MAX, NULL); error = 0; - if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) + if (mp->mnt_flag & MNT_ROOTFS) return (EOPNOTSUPP); + rsnum = 0; + + if (mp->mnt_optnew != NULL) { + if (vfs_filteropt(mp->mnt_optnew, devfs_opts)) + return (EINVAL); + + if (vfs_getopt(mp->mnt_optnew, "ruleset", NULL, NULL) == 0 && + (vfs_scanopt(mp->mnt_optnew, "ruleset", "%d", + &rsnum) != 1 || rsnum < 0 || rsnum > 65535)) + error = EINVAL; + } + + if (error) { + vfs_mount_error(mp, "%s", "invalid ruleset specification"); + return (error); + } + + if (mp->mnt_flag & MNT_UPDATE) { + if (rsnum != 0) { + fmp = mp->mnt_data; + if (fmp != NULL) { + sx_xlock(&fmp->dm_lock); + devfs_ruleset_set((devfs_rsnum)rsnum, fmp); + devfs_ruleset_apply(fmp); + sx_xunlock(&fmp->dm_lock); + } + } + return (0); + } + fmp = malloc(sizeof *fmp, M_DEVFS, M_WAITOK | M_ZERO); fmp->dm_idx = alloc_unr(devfs_unr); sx_init(&fmp->dm_lock, "devfsmount"); @@ -101,6 +136,12 @@ devfs_mount(struct mount *mp) return (error); } + if (rsnum != 0) { + sx_xlock(&fmp->dm_lock); + devfs_ruleset_set((devfs_rsnum)rsnum, fmp); + sx_xunlock(&fmp->dm_lock); + } + VOP_UNLOCK(rvp, 0); vfs_mountedfrom(mp, "devfs"); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 10:20:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B93A1065670; Thu, 9 Feb 2012 10:20:42 +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 75CFB8FC08; Thu, 9 Feb 2012 10:20:42 +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 q19AKguL093787; Thu, 9 Feb 2012 10:20:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19AKgi0093783; Thu, 9 Feb 2012 10:20:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202091020.q19AKgi0093783@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 9 Feb 2012 10:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231266 - in head: share/man/man4 sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:20:42 -0000 Author: glebius Date: Thu Feb 9 10:20:41 2012 New Revision: 231266 URL: http://svn.freebsd.org/changeset/base/231266 Log: Add support for RICOH R5CE823 card reader, that can be found in some Lenovo laptops. The conroller needs a quirk to lower its frequency, and after that it operates normally. Modified: head/share/man/man4/sdhci.4 head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/share/man/man4/sdhci.4 ============================================================================== --- head/share/man/man4/sdhci.4 Thu Feb 9 10:09:12 2012 (r231265) +++ head/share/man/man4/sdhci.4 Thu Feb 9 10:20:41 2012 (r231266) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2009 +.Dd February 9, 2012 .Dt SDHCI 4 .Os .Sh NAME @@ -69,6 +69,8 @@ ENE CB714 .It RICOH R5C822 .It +RICOH R5CE823 +.It TI PCIXX21/XX11 .El .Sh SEE ALSO Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Thu Feb 9 10:09:12 2012 (r231265) +++ head/sys/dev/sdhci/sdhci.c Thu Feb 9 10:20:41 2012 (r231266) @@ -74,6 +74,8 @@ __FBSDID("$FreeBSD$"); #define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<7) /* Controller has broken read timings */ #define SDHCI_QUIRK_BROKEN_TIMINGS (1<<8) +/* Controller needs lowered frequency */ +#define SDHCI_QUIRK_LOWER_FREQUENCY (1<<9) static const struct sdhci_device { uint32_t model; @@ -85,6 +87,8 @@ static const struct sdhci_device { SDHCI_QUIRK_FORCE_DMA }, { 0xe8221180, 0xffff, "RICOH SD", SDHCI_QUIRK_FORCE_DMA }, + { 0xe8231180, 0xffff, "RICOH R5CE823 SD", + SDHCI_QUIRK_LOWER_FREQUENCY }, { 0x8034104c, 0xffff, "TI XX21/XX11 SD", SDHCI_QUIRK_FORCE_DMA }, { 0x05501524, 0xffff, "ENE CB712 SD", @@ -350,6 +354,24 @@ sdhci_init(struct sdhci_slot *slot) } static void +sdhci_lower_frequency(device_t dev) +{ + + /* Enable SD2.0 mode. */ + pci_write_config(dev, SDHC_PCI_MODE_KEY, 0xfc, 1); + pci_write_config(dev, SDHC_PCI_MODE, SDHC_PCI_MODE_SD20, 1); + pci_write_config(dev, SDHC_PCI_MODE_KEY, 0x00, 1); + + /* + * Some SD/MMC cards don't work with the default base + * clock frequency of 200MHz. Lower it to 50Hz. + */ + pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x01, 1); + pci_write_config(dev, SDHC_PCI_BASE_FREQ, 50, 1); + pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x00, 1); +} + +static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock) { uint32_t res; @@ -631,6 +653,9 @@ sdhci_attach(device_t dev) break; } } + /* Some controllers need to be bumped into the right mode. */ + if (sc->quirks & SDHCI_QUIRK_LOWER_FREQUENCY) + sdhci_lower_frequency(dev); /* Read slots info from PCI registers. */ slots = pci_read_config(dev, PCI_SLOT_INFO, 1); bar = PCI_SLOT_INFO_FIRST_BAR(slots); Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Thu Feb 9 10:09:12 2012 (r231265) +++ head/sys/dev/sdhci/sdhci.h Thu Feb 9 10:20:41 2012 (r231266) @@ -38,6 +38,15 @@ #define PCI_SLOT_INFO_FIRST_BAR(x) ((x) & 7) /* + * RICOH specific PCI registers + */ +#define SDHC_PCI_MODE_KEY 0xf9 +#define SDHC_PCI_MODE 0x150 +#define SDHC_PCI_MODE_SD20 0x10 +#define SDHC_PCI_BASE_FREQ_KEY 0xfc +#define SDHC_PCI_BASE_FREQ 0xe1 + +/* * Controller registers */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 10:22:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F5741065689; Thu, 9 Feb 2012 10:22:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3941A8FC22; Thu, 9 Feb 2012 10:22: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 q19AM8wB093885; Thu, 9 Feb 2012 10:22:08 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19AM8VO093880; Thu, 9 Feb 2012 10:22:08 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202091022.q19AM8VO093880@svn.freebsd.org> From: Martin Matuska Date: Thu, 9 Feb 2012 10:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231267 - in head: sys/fs/devfs sys/kern sys/sys usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:22:09 -0000 Author: mm Date: Thu Feb 9 10:22:08 2012 New Revision: 231267 URL: http://svn.freebsd.org/changeset/base/231267 Log: Add support for mounting devfs inside jails. A new jail(8) option "devfs_ruleset" defines the ruleset enforcement for mounting devfs inside jails. A value of -1 disables mounting devfs in jails, a value of zero means no restrictions. Nested jails can only have mounting devfs disabled or inherit parent's enforcement as jails are not allowed to view or manipulate devfs(8) rules. Utilizes new functions introduced in r231265. Reviewed by: jamie MFC after: 1 month Modified: head/sys/fs/devfs/devfs_vfsops.c head/sys/kern/kern_jail.c head/sys/sys/jail.h head/usr.sbin/jail/jail.8 Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Thu Feb 9 10:20:41 2012 (r231266) +++ head/sys/fs/devfs/devfs_vfsops.c Thu Feb 9 10:22:08 2012 (r231267) @@ -44,6 +44,7 @@ #include #include #include +#include #include @@ -69,6 +70,7 @@ devfs_mount(struct mount *mp) int error; struct devfs_mount *fmp; struct vnode *rvp; + struct thread *td = curthread; int rsnum; if (devfs_unr == NULL) @@ -91,6 +93,16 @@ devfs_mount(struct mount *mp) error = EINVAL; } + /* jails enforce their ruleset, prison0 has no restrictions */ + if (td->td_ucred->cr_prison->pr_devfs_rsnum != 0) { + rsnum = td->td_ucred->cr_prison->pr_devfs_rsnum; + if (rsnum == -1) + return (EPERM); + /* check rsnum for sanity, devfs_rsnum is uint16_t */ + if (rsnum < 0 || rsnum > 65535) + error = EINVAL; + } + if (error) { vfs_mount_error(mp, "%s", "invalid ruleset specification"); return (error); @@ -227,4 +239,4 @@ static struct vfsops devfs_vfsops = { .vfs_unmount = devfs_unmount, }; -VFS_SET(devfs_vfsops, devfs, VFCF_SYNTHETIC); +VFS_SET(devfs_vfsops, devfs, VFCF_SYNTHETIC | VFCF_JAIL); Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Feb 9 10:20:41 2012 (r231266) +++ head/sys/kern/kern_jail.c Thu Feb 9 10:22:08 2012 (r231267) @@ -103,6 +103,7 @@ struct prison prison0 = { .pr_uref = 1, .pr_path = "/", .pr_securelevel = -1, + .pr_devfs_rsnum = 0, .pr_childmax = JAIL_MAX, .pr_hostuuid = DEFAULT_HOSTUUID, .pr_children = LIST_HEAD_INITIALIZER(prison0.pr_children), @@ -216,8 +217,10 @@ const size_t pr_allow_nonames_size = siz #define JAIL_DEFAULT_ALLOW PR_ALLOW_SET_HOSTNAME #define JAIL_DEFAULT_ENFORCE_STATFS 2 +#define JAIL_DEFAULT_DEVFS_RSNUM -1 static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; +static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; #if defined(INET) || defined(INET6) static unsigned jail_max_af_ips = 255; #endif @@ -529,9 +532,9 @@ kern_jail_set(struct thread *td, struct unsigned long hid; size_t namelen, onamelen; int created, cuflags, descend, enforce, error, errmsg_len, errmsg_pos; - int gotchildmax, gotenforce, gothid, gotslevel; + int gotchildmax, gotenforce, gothid, gotrsnum, gotslevel; int fi, jid, jsys, len, level; - int childmax, slevel, vfslocked; + int childmax, rsnum, slevel, vfslocked; int fullpath_disabled; #if defined(INET) || defined(INET6) int ii, ij; @@ -612,6 +615,14 @@ kern_jail_set(struct thread *td, struct } else gotenforce = 1; + error = vfs_copyopt(opts, "devfs_ruleset", &rsnum, sizeof(rsnum)); + if (error == ENOENT) + gotrsnum = 0; + else if (error != 0) + goto done_free; + else + gotrsnum = 1; + pr_flags = ch_flags = 0; for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); fi++) { @@ -1268,6 +1279,7 @@ kern_jail_set(struct thread *td, struct pr->pr_securelevel = ppr->pr_securelevel; pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; + pr->pr_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; LIST_INIT(&pr->pr_children); mtx_init(&pr->pr_mtx, "jail mutex", NULL, MTX_DEF | MTX_DUPOK); @@ -1346,6 +1358,27 @@ kern_jail_set(struct thread *td, struct goto done_deref_locked; } } + if (gotrsnum) { + /* + * devfs_rsnum is a uint16_t + * value of -1 disables devfs mounts + */ + if (rsnum < -1 || rsnum > 65535) { + error = EINVAL; + goto done_deref_locked; + } + /* + * Nested jails may inherit parent's devfs ruleset + * or disable devfs + */ + if (jailed(td->td_ucred)) { + if (rsnum > 0 && rsnum != ppr->pr_devfs_rsnum) { + error = EPERM; + goto done_deref_locked; + } else if (rsnum == 0) + rsnum = ppr->pr_devfs_rsnum; + } + } #ifdef INET if (ip4s > 0) { if (ppr->pr_flags & PR_IP4) { @@ -1586,6 +1619,13 @@ kern_jail_set(struct thread *td, struct if (tpr->pr_enforce_statfs < enforce) tpr->pr_enforce_statfs = enforce; } + if (gotrsnum) { + pr->pr_devfs_rsnum = rsnum; + /* Pass this restriction on to the children. */ + FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) + if (tpr->pr_devfs_rsnum != -1) + tpr->pr_devfs_rsnum = rsnum; + } if (name != NULL) { if (ppr == &prison0) strlcpy(pr->pr_name, name, sizeof(pr->pr_name)); @@ -2020,6 +2060,10 @@ kern_jail_get(struct thread *td, struct sizeof(pr->pr_enforce_statfs)); if (error != 0 && error != ENOENT) goto done_deref; + error = vfs_setopt(opts, "devfs_ruleset", &pr->pr_devfs_rsnum, + sizeof(pr->pr_devfs_rsnum)); + if (error != 0 && error != ENOENT) + goto done_deref; for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); fi++) { if (pr_flag_names[fi] == NULL) @@ -4173,6 +4217,12 @@ SYSCTL_PROC(_security_jail, OID_AUTO, en sysctl_jail_default_level, "I", "Processes in jail cannot see all mounted file systems"); +SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + &jail_default_devfs_rsnum, offsetof(struct prison, pr_devfs_rsnum), + sysctl_jail_default_level, "I", + "Ruleset for the devfs filesystem in jail"); + /* * Nodes to describe jail parameters. Maximum length of string parameters * is returned in the string itself, and the other parameters exist merely @@ -4221,6 +4271,8 @@ SYSCTL_JAIL_PARAM(, securelevel, CTLTYPE "I", "Jail secure level"); SYSCTL_JAIL_PARAM(, enforce_statfs, CTLTYPE_INT | CTLFLAG_RW, "I", "Jail cannot see all mounted file systems"); +SYSCTL_JAIL_PARAM(, devfs_ruleset, CTLTYPE_INT | CTLFLAG_RW, + "I", "Ruleset for in-jail devfs mounts"); SYSCTL_JAIL_PARAM(, persist, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail persistence"); #ifdef VIMAGE @@ -4413,6 +4465,7 @@ db_show_prison(struct prison *pr) #endif db_printf(" root = %p\n", pr->pr_root); db_printf(" securelevel = %d\n", pr->pr_securelevel); + db_printf(" devfs_rsnum = %d\n", pr->pr_devfs_rsnum); db_printf(" children.max = %d\n", pr->pr_childmax); db_printf(" children.cur = %d\n", pr->pr_childcount); db_printf(" child = %p\n", LIST_FIRST(&pr->pr_children)); Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Thu Feb 9 10:20:41 2012 (r231266) +++ head/sys/sys/jail.h Thu Feb 9 10:22:08 2012 (r231267) @@ -176,7 +176,8 @@ struct prison { unsigned pr_allow; /* (p) PR_ALLOW_* flags */ int pr_securelevel; /* (p) securelevel */ int pr_enforce_statfs; /* (p) statfs permission */ - int pr_spare[5]; + int pr_devfs_rsnum; /* (p) devfs ruleset */ + int pr_spare[4]; unsigned long pr_hostid; /* (p) jail hostid */ char pr_name[MAXHOSTNAMELEN]; /* (p) admin jail name */ char pr_path[MAXPATHLEN]; /* (c) chroot path */ Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu Feb 9 10:20:41 2012 (r231266) +++ head/usr.sbin/jail/jail.8 Thu Feb 9 10:22:08 2012 (r231267) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2011 +.Dd February 9, 2012 .Dt JAIL 8 .Os .Sh NAME @@ -301,6 +301,17 @@ A jail never has a lower securelevel tha setting this parameter it may have a higher one. If the system securelevel is changed, any jail securelevels will be at least as secure. +.It Va devfs_ruleset +The number of the devfs ruleset that is enforced for mounting devfs in +this jail and its descendants. A value of zero means no ruleset is enforced +or if set inside a jail for a descendant jail, the parent jails's devfs +ruleset enforcement is inherited. A value of -1 (default) means mounting a +devfs filesystem is not allowed. Mounting devfs inside a jail is possible +only if the +.Va allow.mount +permission is effective and +.Va enforce_statfs +is set to a value lower than 2. .It Va children.max The number of child jails allowed to be created by this jail (or by other jails under this jail). From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 10:22:15 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35ABA10657BA; Thu, 9 Feb 2012 10:22:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 48CC48FC21; Thu, 9 Feb 2012 10:22:14 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q19AMDvc031336; Thu, 9 Feb 2012 14:22:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q19AMDBI031335; Thu, 9 Feb 2012 14:22:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 9 Feb 2012 14:22:13 +0400 From: Gleb Smirnoff To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20120209102213.GX13554@FreeBSD.org> References: <201202091020.q19AKgi0093783@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201202091020.q19AKgi0093783@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r231266 - in head: share/man/man4 sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:22:15 -0000 On Thu, Feb 09, 2012 at 10:20:42AM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Thu Feb 9 10:20:41 2012 T> New Revision: 231266 T> URL: http://svn.freebsd.org/changeset/base/231266 T> T> Log: T> Add support for RICOH R5CE823 card reader, that can be found in T> some Lenovo laptops. T> T> The conroller needs a quirk to lower its frequency, and after T> that it operates normally. Forgot to mention: Obtained from: OpenBSD Also, I suppose, it is neccessary to run the quirk in sdhci_resume(), but it is definitely not sufficient to get controller resumed. It looks like sdhci_resume(4) lacks some more generic resume code. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 10:30:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150F7106566B; Thu, 9 Feb 2012 10:30:46 +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 D96778FC08; Thu, 9 Feb 2012 10:30: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 q19AUjT2094187; Thu, 9 Feb 2012 10:30:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19AUjVW094185; Thu, 9 Feb 2012 10:30:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202091030.q19AUjVW094185@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 9 Feb 2012 10:30: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: r231268 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:30:46 -0000 Author: kib Date: Thu Feb 9 10:30:45 2012 New Revision: 231268 URL: http://svn.freebsd.org/changeset/base/231268 Log: MFC r230341: Use shared lock for the executable vnode in the exec path after the VV_TEXT changes are handled. Assert that vnode is exclusively locked at the places that modify VV_TEXT. Modified: stable/9/sys/kern/kern_exec.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Thu Feb 9 10:22:08 2012 (r231267) +++ stable/9/sys/kern/kern_exec.c Thu Feb 9 10:30:45 2012 (r231268) @@ -471,6 +471,7 @@ interpret: * actually an executable image. */ textset = imgp->vp->v_vflag & VV_TEXT; + ASSERT_VOP_ELOCKED(imgp->vp, "vv_text"); imgp->vp->v_vflag |= VV_TEXT; error = exec_map_first_page(imgp); @@ -502,8 +503,10 @@ interpret: if (error) { if (error == -1) { - if (textset == 0) + if (textset == 0) { + ASSERT_VOP_ELOCKED(imgp->vp, "vv_text"); imgp->vp->v_vflag &= ~VV_TEXT; + } error = ENOEXEC; } goto exec_fail_dealloc; @@ -596,7 +599,7 @@ interpret: /* close files on exec */ fdcloseexec(td); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); /* Get a reference to the vnode prior to locking the proc */ VREF(binvp); @@ -701,7 +704,7 @@ interpret: VOP_UNLOCK(imgp->vp, 0); setugidsafety(td); error = fdcheckstd(td); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); if (error != 0) goto done1; PROC_LOCK(p); @@ -805,7 +808,7 @@ interpret: pe.pm_entryaddr = imgp->entry_addr; PMC_CALL_HOOK_X(td, PMC_FN_PROCESS_EXEC, (void *) &pe); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); } else PROC_UNLOCK(p); #else /* !HWPMC_HOOKS */ @@ -857,7 +860,7 @@ done1: if (tracecred != NULL) crfree(tracecred); #endif - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); pargs_drop(oldargs); pargs_drop(newargs); if (oldsigacts != NULL) From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 10:39:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62839106566B; Thu, 9 Feb 2012 10:39:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D39D8FC17; Thu, 9 Feb 2012 10:39: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 q19Ad2VE097024; Thu, 9 Feb 2012 10:39:02 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Ad2aM097022; Thu, 9 Feb 2012 10:39:02 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202091039.q19Ad2aM097022@svn.freebsd.org> From: Martin Matuska Date: Thu, 9 Feb 2012 10:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231269 - head/sys/fs/nullfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:39:02 -0000 Author: mm Date: Thu Feb 9 10:39:01 2012 New Revision: 231269 URL: http://svn.freebsd.org/changeset/base/231269 Log: Allow mounting nullfs(5) inside jails. This is now possible thanks to r230129. MFC after: 1 month Modified: head/sys/fs/nullfs/null_vfsops.c Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Thu Feb 9 10:30:45 2012 (r231268) +++ head/sys/fs/nullfs/null_vfsops.c Thu Feb 9 10:39:01 2012 (r231269) @@ -357,4 +357,4 @@ static struct vfsops null_vfsops = { .vfs_vget = nullfs_vget, }; -VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK); +VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK | VFCF_JAIL); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 10:56:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D32E106566B; Thu, 9 Feb 2012 10:56:06 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 650BC8FC08; Thu, 9 Feb 2012 10:56: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 q19Au6DF097621; Thu, 9 Feb 2012 10:56:06 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Au5wE097593; Thu, 9 Feb 2012 10:56:05 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202091056.q19Au5wE097593@svn.freebsd.org> From: Martin Matuska Date: Thu, 9 Feb 2012 10:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231270 - in vendor/libarchive/dist: cpio/test libarchive libarchive/test tar/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:56:06 -0000 Author: mm Date: Thu Feb 9 10:56:05 2012 New Revision: 231270 URL: http://svn.freebsd.org/changeset/base/231270 Log: Update libarchive's dist to latest changes in release branch Git branch: release Git commit: c477edc817b4382a1d0b2ff8c7b619af13bd349e Obtained from: https://github.com/libarchive/libarchive.git Modified: vendor/libarchive/dist/cpio/test/main.c vendor/libarchive/dist/libarchive/archive_acl.c vendor/libarchive/dist/libarchive/archive_ppmd_private.h vendor/libarchive/dist/libarchive/archive_read_open_memory.c vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_string.c vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c vendor/libarchive/dist/libarchive/test/main.c vendor/libarchive/dist/libarchive/test/test_acl_nfs4.c vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c vendor/libarchive/dist/libarchive/test/test_archive_read_next_header_raw.c vendor/libarchive/dist/libarchive/test/test_compat_mac.c vendor/libarchive/dist/libarchive/test/test_compat_zip.c vendor/libarchive/dist/libarchive/test/test_filter_count.c vendor/libarchive/dist/libarchive/test/test_read_format_mtree.c vendor/libarchive/dist/libarchive/test/test_read_position.c vendor/libarchive/dist/libarchive/test/test_read_uu.c vendor/libarchive/dist/libarchive/test/test_write_disk_lookup.c vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_filename.c vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_zisofs.c vendor/libarchive/dist/tar/test/main.c Modified: vendor/libarchive/dist/cpio/test/main.c ============================================================================== --- vendor/libarchive/dist/cpio/test/main.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/cpio/test/main.c Thu Feb 9 10:56:05 2012 (r231270) @@ -2505,25 +2505,25 @@ main(int argc, char **argv) } else { while (*(argv) != NULL) { if (**argv >= '0' && **argv <= '9') { - char *p = *argv; + char *vp = *argv; start = 0; - while (*p >= '0' && *p <= '9') { + while (*vp >= '0' && *vp <= '9') { start *= 10; - start += *p - '0'; - ++p; + start += *vp - '0'; + ++vp; } - if (*p == '\0') { + if (*vp == '\0') { end = start; - } else if (*p == '-') { - ++p; - if (*p == '\0') { + } else if (*vp == '-') { + ++vp; + if (*vp == '\0') { end = limit - 1; } else { end = 0; - while (*p >= '0' && *p <= '9') { + while (*vp >= '0' && *vp <= '9') { end *= 10; - end += *p - '0'; - ++p; + end += *vp - '0'; + ++vp; } } } else { Modified: vendor/libarchive/dist/libarchive/archive_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_acl.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_acl.c Thu Feb 9 10:56:05 2012 (r231270) @@ -52,6 +52,9 @@ static int acl_special(struct archive_ac int type, int permset, int tag); static struct archive_acl_entry *acl_new_entry(struct archive_acl *acl, int type, int permset, int tag, int id); +static int archive_acl_add_entry_len_l(struct archive_acl *acl, + int type, int permset, int tag, int id, const char *name, + size_t len, struct archive_string_conv *sc); static int isint_w(const wchar_t *start, const wchar_t *end, int *result); static int ismode_w(const wchar_t *start, const wchar_t *end, int *result); static void next_field_w(const wchar_t **wp, const wchar_t **start, @@ -65,7 +68,7 @@ static int isint(const char *start, cons static int ismode(const char *start, const char *end, int *result); static void next_field(const char **p, const char **start, const char **end, char *sep); -static int prefix(const char *start, const char *end, +static int prefix_c(const char *start, const char *end, const char *test); static void append_entry(char **p, const char *prefix, int tag, const char *name, int perm, int id); @@ -152,7 +155,7 @@ archive_acl_add_entry_w_len(struct archi return ARCHIVE_OK; } -int +static int archive_acl_add_entry_len_l(struct archive_acl *acl, int type, int permset, int tag, int id, const char *name, size_t len, struct archive_string_conv *sc) @@ -1088,7 +1091,7 @@ archive_acl_parse_l(struct archive_acl * type = default_type; name.start = name.end = NULL; - if (prefix(field[0].start, field[0].end, "user")) { + if (prefix_c(field[0].start, field[0].end, "user")) { if (!ismode(field[2].start, field[2].end, &permset)) return (ARCHIVE_WARN); if (id != -1 || field[1].start < field[1].end) { @@ -1096,7 +1099,7 @@ archive_acl_parse_l(struct archive_acl * name = field[1]; } else tag = ARCHIVE_ENTRY_ACL_USER_OBJ; - } else if (prefix(field[0].start, field[0].end, "group")) { + } else if (prefix_c(field[0].start, field[0].end, "group")) { if (!ismode(field[2].start, field[2].end, &permset)) return (ARCHIVE_WARN); if (id != -1 || field[1].start < field[1].end) { @@ -1104,7 +1107,7 @@ archive_acl_parse_l(struct archive_acl * name = field[1]; } else tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; - } else if (prefix(field[0].start, field[0].end, "other")) { + } else if (prefix_c(field[0].start, field[0].end, "other")) { if (fields == 2 && field[1].start < field[1].end && ismode(field[1].start, field[1].end, &permset)) { @@ -1117,7 +1120,7 @@ archive_acl_parse_l(struct archive_acl * } else return (ARCHIVE_WARN); tag = ARCHIVE_ENTRY_ACL_OTHER; - } else if (prefix(field[0].start, field[0].end, "mask")) { + } else if (prefix_c(field[0].start, field[0].end, "mask")) { if (fields == 2 && field[1].start < field[1].end && ismode(field[1].start, field[1].end, &permset)) { @@ -1246,7 +1249,7 @@ next_field(const char **p, const char ** * This makes it easy to handle the obvious abbreviations: 'u' for 'user', etc. */ static int -prefix(const char *start, const char *end, const char *test) +prefix_c(const char *start, const char *end, const char *test) { if (start == end) return (0); Modified: vendor/libarchive/dist/libarchive/archive_ppmd_private.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_ppmd_private.h Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_ppmd_private.h Thu Feb 9 10:56:05 2012 (r231270) @@ -152,7 +152,7 @@ typedef CPpmd_Byte_Ref; #define PPMD_SetAllBitsIn256Bytes(p) \ - { unsigned i; for (i = 0; i < 256 / sizeof(p[0]); i += 8) { \ - p[i+7] = p[i+6] = p[i+5] = p[i+4] = p[i+3] = p[i+2] = p[i+1] = p[i+0] = ~(size_t)0; }} + { unsigned j; for (j = 0; j < 256 / sizeof(p[0]); j += 8) { \ + p[j+7] = p[j+6] = p[j+5] = p[j+4] = p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0; }} #endif Modified: vendor/libarchive/dist/libarchive/archive_read_open_memory.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_open_memory.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_open_memory.c Thu Feb 9 10:56:05 2012 (r231270) @@ -149,6 +149,7 @@ memory_read_seek(struct archive *a, void { struct read_memory_data *mine = (struct read_memory_data *)client_data; + (void)a; /* UNUSED */ switch (whence) { case SEEK_SET: mine->p = mine->start + offset; Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Thu Feb 9 10:56:05 2012 (r231270) @@ -481,7 +481,7 @@ check_7zip_header_in_sfx(const char *p) * Magic Code, so we should do this in order not to * make a mis-detection. */ - if (crc32(0, (unsigned char *)p + 12, 20) + if (crc32(0, (const unsigned char *)p + 12, 20) != archive_le32dec(p + 8)) return (6); /* Hit the header! */ @@ -630,7 +630,7 @@ archive_read_format_7zip_read_header(str if (zip_entry->flg & ATIME_IS_SET) archive_entry_set_atime(entry, zip_entry->atime, zip_entry->atime_ns); - if (zip_entry->ssIndex != -1) { + if (zip_entry->ssIndex != (uint32_t)-1) { zip->entry_bytes_remaining = zip->si.ss.unpackSizes[zip_entry->ssIndex]; archive_entry_set_size(entry, zip->entry_bytes_remaining); @@ -646,7 +646,6 @@ archive_read_format_7zip_read_header(str if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) { unsigned char *symname = NULL; size_t symsize = 0; - int r; /* * Symbolic-name is recorded as its contents. We have to @@ -1985,7 +1984,7 @@ folder_uncompressed_size(struct _7z_fold while (--n >= 0) { unsigned i; for (i = 0; i < pairs; i++) { - if (f->bindPairs[i].outIndex == n) + if (f->bindPairs[i].outIndex == (uint64_t)n) break; } if (i >= pairs) @@ -2517,17 +2516,17 @@ read_Header(struct archive_read *a, stru #define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000) static void -fileTimeToUtc(uint64_t fileTime, time_t *time, long *ns) +fileTimeToUtc(uint64_t fileTime, time_t *timep, long *ns) { if (fileTime >= EPOC_TIME) { fileTime -= EPOC_TIME; /* milli seconds base */ - *time = (time_t)(fileTime / 10000000); + *timep = (time_t)(fileTime / 10000000); /* nano seconds base */ *ns = (long)(fileTime % 10000000) * 100; } else { - *time = 0; + *timep = 0; *ns = 0; } } @@ -2695,7 +2694,8 @@ slurp_central_directory(struct archive_r } /* CRC check. */ - if (crc32(0, (unsigned char *)p + 12, 20) != archive_le32dec(p + 8)) { + if (crc32(0, (const unsigned char *)p + 12, 20) + != archive_le32dec(p + 8)) { archive_set_error(&a->archive, -1, "Header CRC error"); return (ARCHIVE_FATAL); } @@ -2714,7 +2714,7 @@ slurp_central_directory(struct archive_r } __archive_read_consume(a, 32); if (next_header_offset != 0) { - if (bytes_avail >= next_header_offset) + if (bytes_avail >= (ssize_t)next_header_offset) __archive_read_consume(a, next_header_offset); else if (__archive_read_seek(a, next_header_offset + zip->seek_base, SEEK_SET) < 0) @@ -2827,7 +2827,7 @@ get_uncompressed_data(struct archive_rea struct _7zip *zip = (struct _7zip *)a->format->data; ssize_t bytes_avail; - if (zip->codec == _7Z_COPY && zip->codec2 == -1) { + if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) { /* Copy mode. */ /* @@ -2886,7 +2886,7 @@ extract_pack_stream(struct archive_read ssize_t bytes_avail; int r; - if (zip->codec == _7Z_COPY && zip->codec2 == -1) { + if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) { if (minimum == 0) minimum = 1; if (__archive_read_ahead(a, minimum, &bytes_avail) == NULL @@ -2896,10 +2896,10 @@ extract_pack_stream(struct archive_read "Truncated 7-Zip file body"); return (ARCHIVE_FATAL); } - if (bytes_avail > zip->pack_stream_inbytes_remaining) + if (bytes_avail > (ssize_t)zip->pack_stream_inbytes_remaining) bytes_avail = zip->pack_stream_inbytes_remaining; zip->pack_stream_inbytes_remaining -= bytes_avail; - if (bytes_avail > zip->folder_outbytes_remaining) + if (bytes_avail > (ssize_t)zip->folder_outbytes_remaining) bytes_avail = zip->folder_outbytes_remaining; zip->folder_outbytes_remaining -= bytes_avail; zip->uncompressed_buffer_bytes_remaining = bytes_avail; @@ -3041,7 +3041,7 @@ static int seek_pack(struct archive_read *a) { struct _7zip *zip = (struct _7zip *)a->format->data; - uint64_t pack_offset; + int64_t pack_offset; if (zip->pack_stream_remaining <= 0) { archive_set_error(&(a->archive), @@ -3321,7 +3321,7 @@ setup_decode_folder(struct archive_read if ((r = seek_pack(a)) < 0) return (r); - if (sunpack[i] == -1) + if (sunpack[i] == (uint64_t)-1) zip->folder_outbytes_remaining = zip->pack_stream_inbytes_remaining; else @@ -3506,16 +3506,16 @@ x86_Convert(struct _7zip *zip, uint8_t * uint32_t dest; for (;;) { uint8_t b; - int index; + int b_index; dest = src - (ip + (uint32_t)bufferPos); if (prevMask == 0) break; - index = kMaskToBitNumber[prevMask] * 8; - b = (uint8_t)(dest >> (24 - index)); + b_index = kMaskToBitNumber[prevMask] * 8; + b = (uint8_t)(dest >> (24 - b_index)); if (!Test86MSByte(b)) break; - src = dest ^ ((1 << (32 - index)) - 1); + src = dest ^ ((1 << (32 - b_index)) - 1); } p[4] = (uint8_t)(~(((dest >> 24) & 1) - 1)); p[3] = (uint8_t)(dest >> 16); @@ -3556,7 +3556,7 @@ x86_Convert(struct _7zip *zip, uint8_t * #define RC_READ_BYTE (*buffer++) #define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; } #define RC_INIT2 zip->bcj2_code = 0; zip->bcj2_range = 0xFFFFFFFF; \ - { int i; for (i = 0; i < 5; i++) { RC_TEST; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }} + { int ii; for (ii = 0; ii < 5; ii++) { RC_TEST; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }} #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; } @@ -3622,14 +3622,14 @@ Bcj2_Decode(struct _7zip *zip, uint8_t * if (zip->bcj_state == 1) { while (limit != 0) { - uint8_t b = buf0[inPos]; - outBuf[outPos++] = b; - if (IsJ(zip->bcj2_prevByte, b)) { + uint8_t bb = buf0[inPos]; + outBuf[outPos++] = bb; + if (IsJ(zip->bcj2_prevByte, bb)) { zip->bcj_state = 2; break; } inPos++; - zip->bcj2_prevByte = b; + zip->bcj2_prevByte = bb; limit--; } } Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c Thu Feb 9 10:56:05 2012 (r231270) @@ -349,7 +349,7 @@ static int lzx_read_bitlen(struct lzx_st static int lzx_huffman_init(struct huffman *, size_t, int); static void lzx_huffman_free(struct huffman *); static int lzx_make_huffman_table(struct huffman *); -static int inline lzx_decode_huffman(struct huffman *, unsigned); +static inline int lzx_decode_huffman(struct huffman *, unsigned); static int lzx_decode_huffman_tree(struct huffman *, unsigned, int); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Thu Feb 9 10:56:05 2012 (r231270) @@ -1756,7 +1756,8 @@ parse_file_info(struct archive_read *a, */ if (location > 0 && (location + ((fsize + iso9660->logical_block_size -1) - / iso9660->logical_block_size)) > iso9660->volume_block) { + / iso9660->logical_block_size)) + > (uint32_t)iso9660->volume_block) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Invalid location of extent of file"); return (NULL); @@ -2254,7 +2255,7 @@ register_CE(struct archive_read *a, int3 offset >= file->offset) || offset < iso9660->current_position || (((uint64_t)file->ce_offset) + file->ce_size) - > iso9660->logical_block_size || + > (uint64_t)iso9660->logical_block_size || offset + file->ce_offset + file->ce_size > iso9660->volume_size) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c Thu Feb 9 10:56:05 2012 (r231270) @@ -289,7 +289,7 @@ static void lzh_huffman_free(struct huff static int lzh_read_pt_bitlen(struct lzh_stream *, int start, int end); static int lzh_make_fake_table(struct huffman *, uint16_t); static int lzh_make_huffman_table(struct huffman *); -static int inline lzh_decode_huffman(struct huffman *, unsigned); +static inline int lzh_decode_huffman(struct huffman *, unsigned); static int lzh_decode_huffman_tree(struct huffman *, unsigned, int); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Thu Feb 9 10:56:05 2012 (r231270) @@ -101,6 +101,7 @@ struct mtree { int64_t cur_size; }; +static int bid_keycmp(const char *, const char *, ssize_t); static int cleanup(struct archive_read *); static int mtree_bid(struct archive_read *, int); static int parse_file(struct archive_read *, struct archive_entry *, @@ -317,7 +318,7 @@ next_line(struct archive_read *a, * Returns the length of a mtree keyword if matched. * Returns 0 if not matched. */ -int +static int bid_keycmp(const char *p, const char *key, ssize_t len) { int match_len = 0; Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Thu Feb 9 10:56:05 2012 (r231270) @@ -1021,7 +1021,7 @@ read_header(struct archive_read *a, stru char *strp; char packed_size[8]; char unp_size[8]; - int time; + int ttime; struct archive_string_conv *sconv, *fn_sconv; unsigned long crc32_val; int ret = (ARCHIVE_OK), ret2; @@ -1100,8 +1100,8 @@ read_header(struct archive_read *a, stru rar->compression_method = file_header.method; - time = archive_le32dec(file_header.file_time); - rar->mtime = get_time(time); + ttime = archive_le32dec(file_header.file_time); + rar->mtime = get_time(ttime); rar->file_crc = archive_le32dec(file_header.file_crc); @@ -1381,15 +1381,15 @@ read_header(struct archive_read *a, stru } static time_t -get_time(int time) +get_time(int ttime) { struct tm tm; - tm.tm_sec = 2 * (time & 0x1f); - tm.tm_min = (time >> 5) & 0x3f; - tm.tm_hour = (time >> 11) & 0x1f; - tm.tm_mday = (time >> 16) & 0x1f; - tm.tm_mon = ((time >> 21) & 0x0f) - 1; - tm.tm_year = ((time >> 25) & 0x7f) + 80; + tm.tm_sec = 2 * (ttime & 0x1f); + tm.tm_min = (ttime >> 5) & 0x3f; + tm.tm_hour = (ttime >> 11) & 0x1f; + tm.tm_mday = (ttime >> 16) & 0x1f; + tm.tm_mon = ((ttime >> 21) & 0x0f) - 1; + tm.tm_year = ((ttime >> 25) & 0x7f) + 80; tm.tm_isdst = -1; return mktime(&tm); } @@ -1398,7 +1398,7 @@ static int read_exttime(const char *p, struct rar *rar, const char *endp) { unsigned rmode, flags, rem, j, count; - int time, i; + int ttime, i; struct tm *tm; time_t t; long nsec; @@ -1420,8 +1420,8 @@ read_exttime(const char *p, struct rar * { if (p + 4 > endp) return (-1); - time = archive_le32dec(p); - t = get_time(time); + ttime = archive_le32dec(p); + t = get_time(ttime); p += 4; } rem = 0; @@ -2408,9 +2408,9 @@ expand(struct archive_read *a, int64_t e if ((lensymbol = read_next_symbol(a, &rar->lengthcode)) < 0) goto bad_data; - if (lensymbol > sizeof(lengthbases)/sizeof(lengthbases[0])) + if (lensymbol > (int)(sizeof(lengthbases)/sizeof(lengthbases[0]))) goto bad_data; - if (lensymbol > sizeof(lengthbits)/sizeof(lengthbits[0])) + if (lensymbol > (int)(sizeof(lengthbits)/sizeof(lengthbits[0]))) goto bad_data; len = lengthbases[lensymbol] + 2; if (lengthbits[lensymbol] > 0) { @@ -2442,9 +2442,9 @@ expand(struct archive_read *a, int64_t e } else { - if (symbol-271 > sizeof(lengthbases)/sizeof(lengthbases[0])) + if (symbol-271 > (int)(sizeof(lengthbases)/sizeof(lengthbases[0]))) goto bad_data; - if (symbol-271 > sizeof(lengthbits)/sizeof(lengthbits[0])) + if (symbol-271 > (int)(sizeof(lengthbits)/sizeof(lengthbits[0]))) goto bad_data; len = lengthbases[symbol-271]+3; if(lengthbits[symbol-271] > 0) { @@ -2456,9 +2456,9 @@ expand(struct archive_read *a, int64_t e if ((offssymbol = read_next_symbol(a, &rar->offsetcode)) < 0) goto bad_data; - if (offssymbol > sizeof(offsetbases)/sizeof(offsetbases[0])) + if (offssymbol > (int)(sizeof(offsetbases)/sizeof(offsetbases[0]))) goto bad_data; - if (offssymbol > sizeof(offsetbits)/sizeof(offsetbits[0])) + if (offssymbol > (int)(sizeof(offsetbits)/sizeof(offsetbits[0]))) goto bad_data; offs = offsetbases[offssymbol]+1; if(offsetbits[offssymbol] > 0) Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Thu Feb 9 10:56:05 2012 (r231270) @@ -2333,6 +2333,8 @@ solaris_sparse_parse(struct archive_read int64_t start, end; int hole = 1; + (void)entry; /* UNUSED */ + end = 0; if (*p == ' ') p++; Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c Thu Feb 9 10:56:05 2012 (r231270) @@ -2624,6 +2624,7 @@ strappend_base64(struct xar *xar, const unsigned char *b; size_t len; + (void)xar; /* UNUSED */ len = 0; out = buff; b = (const unsigned char *)s; Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Thu Feb 9 10:56:05 2012 (r231270) @@ -140,6 +140,9 @@ static time_t zip_time(const char *); static const char *compression_name(int compression); static void process_extra(const char *, size_t, struct zip_entry *); +int archive_read_support_format_zip_streamable(struct archive *); +int archive_read_support_format_zip_seekable(struct archive *); + int archive_read_support_format_zip_streamable(struct archive *_a) { @@ -716,8 +719,8 @@ compression_name(int compression) "deflation" }; - if (compression < - sizeof(compression_names)/sizeof(compression_names[0])) + if (0 <= compression && compression < + (int)(sizeof(compression_names)/sizeof(compression_names[0]))) return compression_names[compression]; else return "??"; @@ -860,6 +863,8 @@ zip_read_data_none(struct archive_read * const char *buff; ssize_t bytes_avail; + (void)offset; /* UNUSED */ + zip = (struct zip *)(a->format->data); if (zip->entry->flags & ZIP_LENGTH_AT_END) { @@ -940,6 +945,8 @@ zip_read_data_deflate(struct archive_rea const void *compressed_buff; int r; + (void)offset; /* UNUSED */ + zip = (struct zip *)(a->format->data); /* If the buffer hasn't been allocated, allocate it now. */ Modified: vendor/libarchive/dist/libarchive/archive_string.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_string.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_string.c Thu Feb 9 10:56:05 2012 (r231270) @@ -1286,7 +1286,7 @@ create_sconv_object(const char *fc, cons * Check if "from charset" and "to charset" are the same. */ if (strcmp(fc, tc) == 0 || - (sc->from_cp != -1 && sc->from_cp == sc->to_cp)) + (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp)) sc->same = 1; else sc->same = 0; Modified: vendor/libarchive/dist/libarchive/archive_write_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Thu Feb 9 10:56:05 2012 (r231270) @@ -2068,7 +2068,7 @@ set_times(struct archive_write_disk *a, time_t atime, long atime_nanos, time_t birthtime, long birthtime_nanos, time_t mtime, long mtime_nanos, - time_t ctime, long ctime_nanos) + time_t cctime, long ctime_nanos) { /* Note: set_time doesn't use libarchive return conventions! * It uses syscall conventions. So 0 here instead of ARCHIVE_OK. */ @@ -2083,9 +2083,12 @@ set_times(struct archive_write_disk *a, if (a->user_uid == 0 && set_time_tru64(fd, mode, name, atime, atime_nanos, mtime, - mtime_nanos, ctime, ctime_nanos) == 0) { + mtime_nanos, cctime, ctime_nanos) == 0) { return (ARCHIVE_OK); } +#else /* Tru64 */ + (void)cctime; /* UNUSED */ + (void)ctime_nanos; /* UNUSED */ #endif /* Tru64 */ #ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME @@ -2117,11 +2120,11 @@ set_times(struct archive_write_disk *a, static int set_times_from_entry(struct archive_write_disk *a) { - time_t atime, birthtime, mtime, ctime; + time_t atime, birthtime, mtime, cctime; long atime_nsec, birthtime_nsec, mtime_nsec, ctime_nsec; /* Suitable defaults. */ - atime = birthtime = mtime = ctime = a->start_time; + atime = birthtime = mtime = cctime = a->start_time; atime_nsec = birthtime_nsec = mtime_nsec = ctime_nsec = 0; /* If no time was provided, we're done. */ @@ -2145,7 +2148,7 @@ set_times_from_entry(struct archive_writ mtime_nsec = archive_entry_mtime_nsec(a->entry); } if (archive_entry_ctime_is_set(a->entry)) { - ctime = archive_entry_ctime(a->entry); + cctime = archive_entry_ctime(a->entry); ctime_nsec = archive_entry_ctime_nsec(a->entry); } @@ -2153,7 +2156,7 @@ set_times_from_entry(struct archive_writ atime, atime_nsec, birthtime, birthtime_nsec, mtime, mtime_nsec, - ctime, ctime_nsec); + cctime, ctime_nsec); } static int Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c Thu Feb 9 10:56:05 2012 (r231270) @@ -512,7 +512,7 @@ static int write_to_temp(struct archive_write *a, const void *buff, size_t s) { struct _7zip *zip; - unsigned char *p; + const unsigned char *p; ssize_t ws; zip = (struct _7zip *)a->format_data; @@ -530,7 +530,7 @@ write_to_temp(struct archive_write *a, c } } - p = (unsigned char *)buff; + p = (const unsigned char *)buff; while (s) { ws = write(zip->temp_fd, p, s); if (ws < 0) { @@ -846,7 +846,7 @@ enc_uint64(struct archive_write *a, uint int i; numdata[0] = 0; - for (i = 1; i < sizeof(numdata); i++) { + for (i = 1; i < (int)sizeof(numdata); i++) { if (val < mask) { numdata[0] |= (uint8_t)val; break; @@ -1130,11 +1130,11 @@ make_streamsInfo(struct archive_write *a #define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000) static uint64_t -utcToFiletime(time_t time, long ns) +utcToFiletime(time_t t, long ns) { uint64_t fileTime; - fileTime = time; + fileTime = t; fileTime *= 10000000; fileTime += ns / 100; fileTime += EPOC_TIME; @@ -1451,8 +1451,8 @@ static int file_cmp_node(const struct archive_rb_node *n1, const struct archive_rb_node *n2) { - struct file *f1 = (struct file *)n1; - struct file *f2 = (struct file *)n2; + const struct file *f1 = (const struct file *)n1; + const struct file *f2 = (const struct file *)n2; if (f1->name_len == f2->name_len) return (memcmp(f1->utf16name, f2->utf16name, f1->name_len)); @@ -1462,7 +1462,7 @@ file_cmp_node(const struct archive_rb_no static int file_cmp_key(const struct archive_rb_node *n, const void *key) { - struct file *f = (struct file *)n; + const struct file *f = (const struct file *)n; return (f->name_len - *(const char *)key); } @@ -2179,6 +2179,8 @@ compression_code_ppmd(struct archive *a, { struct ppmd_stream *strm; + (void)a; /* UNUSED */ + strm = (struct ppmd_stream *)lastrm->real_stream; /* Copy encoded data if there are remaining bytes from previous call. */ @@ -2219,6 +2221,8 @@ compression_end_ppmd(struct archive *a, { struct ppmd_stream *strm; + (void)a; /* UNUSED */ + strm = (struct ppmd_stream *)lastrm->real_stream; __archive_ppmd7_functions.Ppmd7_Free(&strm->ppmd7_context, &g_szalloc); free(strm->buff); Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Thu Feb 9 10:56:05 2012 (r231270) @@ -4508,8 +4508,7 @@ write_file_descriptors(struct archive_wr /* Write the boot file contents. */ if (iso9660->el_torito.boot != NULL) { - struct isofile *file = iso9660->el_torito.boot->file; - + file = iso9660->el_torito.boot->file; blocks = file->content.blocks; offset = file->content.offset_of_temp; if (offset != 0) { Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c Thu Feb 9 10:56:05 2012 (r231270) @@ -101,6 +101,8 @@ archive_write_set_format_xar(struct arch /*#define DEBUG_PRINT_TOC 1 */ +#define BAD_CAST_CONST (const xmlChar *) + #define HEADER_MAGIC 0x78617221 #define HEADER_SIZE 28 #define HEADER_VERSION 1 @@ -625,11 +627,11 @@ static int write_to_temp(struct archive_write *a, const void *buff, size_t s) { struct xar *xar; - unsigned char *p; + const unsigned char *p; ssize_t ws; xar = (struct xar *)a->format_data; - p = (unsigned char *)buff; + p = (const unsigned char *)buff; while (s) { ws = write(xar->temp_fd, p, s); if (ws < 0) { @@ -680,7 +682,7 @@ xar_write_data(struct archive_write *a, } #if !defined(_WIN32) || defined(__CYGWIN__) if (xar->bytes_remaining == - archive_entry_size(xar->cur_file->entry)) { + (uint64_t)archive_entry_size(xar->cur_file->entry)) { /* * Get the path of a shell script if so. */ @@ -760,7 +762,7 @@ xmlwrite_string_attr(struct archive_writ { int r; - r = xmlTextWriterStartElement(writer, BAD_CAST(key)); + r = xmlTextWriterStartElement(writer, BAD_CAST_CONST(key)); if (r < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -769,7 +771,7 @@ xmlwrite_string_attr(struct archive_writ } if (attrkey != NULL && attrvalue != NULL) { r = xmlTextWriterWriteAttribute(writer, - BAD_CAST(attrkey), BAD_CAST(attrvalue)); + BAD_CAST_CONST(attrkey), BAD_CAST_CONST(attrvalue)); if (r < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -778,7 +780,7 @@ xmlwrite_string_attr(struct archive_writ } } if (value != NULL) { - r = xmlTextWriterWriteString(writer, BAD_CAST(value)); + r = xmlTextWriterWriteString(writer, BAD_CAST_CONST(value)); if (r < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -805,7 +807,7 @@ xmlwrite_string(struct archive_write *a, if (value == NULL) return (ARCHIVE_OK); - r = xmlTextWriterStartElement(writer, BAD_CAST(key)); + r = xmlTextWriterStartElement(writer, BAD_CAST_CONST(key)); if (r < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -813,7 +815,7 @@ xmlwrite_string(struct archive_write *a, return (ARCHIVE_FATAL); } if (value != NULL) { - r = xmlTextWriterWriteString(writer, BAD_CAST(value)); + r = xmlTextWriterWriteString(writer, BAD_CAST_CONST(value)); if (r < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -1066,7 +1068,7 @@ make_fflags_entry(struct archive_write * } while (p != NULL); if (n > 0) { - r = xmlTextWriterStartElement(writer, BAD_CAST(element)); + r = xmlTextWriterStartElement(writer, BAD_CAST_CONST(element)); if (r < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -1561,7 +1563,7 @@ make_toc(struct archive_write *a) goto exit_toc; } r = xmlTextWriterWriteAttribute(writer, BAD_CAST("style"), - BAD_CAST(getalgname(xar->opt_toc_sumalg))); + BAD_CAST_CONST(getalgname(xar->opt_toc_sumalg))); if (r < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -1869,8 +1871,8 @@ static int file_cmp_node(const struct archive_rb_node *n1, const struct archive_rb_node *n2) { - struct file *f1 = (struct file *)n1; - struct file *f2 = (struct file *)n2; + const struct file *f1 = (const struct file *)n1; + const struct file *f2 = (const struct file *)n2; return (strcmp(f1->basename.s, f2->basename.s)); } @@ -1878,7 +1880,7 @@ file_cmp_node(const struct archive_rb_no static int file_cmp_key(const struct archive_rb_node *n, const void *key) { - struct file *f = (struct file *)n; + const struct file *f = (const struct file *)n; return (strcmp(f->basename.s, (const char *)key)); } @@ -1942,6 +1944,8 @@ file_create_virtual_dir(struct archive_w { struct file *file; + (void)xar; /* UNUSED */ + file = file_new(a, NULL); if (file == NULL) return (NULL); @@ -2468,8 +2472,8 @@ static int file_hd_cmp_node(const struct archive_rb_node *n1, const struct archive_rb_node *n2) { - struct hardlink *h1 = (struct hardlink *)n1; - struct hardlink *h2 = (struct hardlink *)n2; + const struct hardlink *h1 = (const struct hardlink *)n1; + const struct hardlink *h2 = (const struct hardlink *)n2; return (strcmp(archive_entry_pathname(h1->file_list.first->entry), archive_entry_pathname(h2->file_list.first->entry))); @@ -2478,7 +2482,7 @@ file_hd_cmp_node(const struct archive_rb static int file_hd_cmp_key(const struct archive_rb_node *n, const void *key) { - struct hardlink *h = (struct hardlink *)n; + const struct hardlink *h = (const struct hardlink *)n; return (strcmp(archive_entry_pathname(h->file_list.first->entry), (const char *)key)); Modified: vendor/libarchive/dist/libarchive/test/main.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/main.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/test/main.c Thu Feb 9 10:56:05 2012 (r231270) @@ -2503,25 +2503,25 @@ main(int argc, char **argv) } else { while (*(argv) != NULL) { if (**argv >= '0' && **argv <= '9') { - char *p = *argv; + char *vp = *argv; start = 0; - while (*p >= '0' && *p <= '9') { + while (*vp >= '0' && *vp <= '9') { start *= 10; - start += *p - '0'; - ++p; + start += *vp - '0'; + ++vp; } - if (*p == '\0') { + if (*vp == '\0') { end = start; - } else if (*p == '-') { - ++p; - if (*p == '\0') { + } else if (*vp == '-') { + ++vp; + if (*vp == '\0') { end = limit - 1; } else { end = 0; - while (*p >= '0' && *p <= '9') { + while (*vp >= '0' && *vp <= '9') { end *= 10; - end += *p - '0'; - ++p; + end += *vp - '0'; + ++vp; } } } else { Modified: vendor/libarchive/dist/libarchive/test/test_acl_nfs4.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_acl_nfs4.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/test/test_acl_nfs4.c Thu Feb 9 10:56:05 2012 (r231270) @@ -276,7 +276,7 @@ DEFINE_TEST(test_acl_nfs4) * fail when added to existing NFS4 ACLs. */ set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0])); - for (i = 0; i < sizeof(acls_bad)/sizeof(acls_bad[0]); ++i) { + for (i = 0; i < (int)(sizeof(acls_bad)/sizeof(acls_bad[0])); ++i) { struct acl_t *p = &acls_bad[i]; failure("Malformed ACL test #%d", i); assertEqualInt(ARCHIVE_FAILED, Modified: vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c Thu Feb 9 10:56:05 2012 (r231270) @@ -263,7 +263,7 @@ DEFINE_TEST(test_acl_posix1e) * fail when added to existing POSIX.1e ACLs. */ set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0])); - for (i = 0; i < sizeof(acls_nfs4)/sizeof(acls_nfs4[0]); ++i) { + for (i = 0; i < (int)(sizeof(acls_nfs4)/sizeof(acls_nfs4[0])); ++i) { struct acl_t *p = &acls_nfs4[i]; failure("Malformed ACL test #%d", i); assertEqualInt(ARCHIVE_FAILED, Modified: vendor/libarchive/dist/libarchive/test/test_archive_read_next_header_raw.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_archive_read_next_header_raw.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/test/test_archive_read_next_header_raw.c Thu Feb 9 10:56:05 2012 (r231270) @@ -40,8 +40,8 @@ test(int skip_explicitely) assertEqualInt(0, archive_errno(a)); assertEqualString(NULL, archive_error_string(a)); - assertEqualInt(ARCHIVE_OK, archive_read_open_memory(a, (void*) data, - sizeof(data))); + assertEqualInt(ARCHIVE_OK, archive_read_open_memory(a, + (void *)(uintptr_t) data, sizeof(data))); assertEqualString(NULL, archive_error_string(a)); assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &e)); Modified: vendor/libarchive/dist/libarchive/test/test_compat_mac.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_compat_mac.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/test/test_compat_mac.c Thu Feb 9 10:56:05 2012 (r231270) @@ -34,11 +34,15 @@ __FBSDID("$FreeBSD$"); "abcdefghijklmnopqrstuvwxyz/" \ "abcdefghijklmnopqrstuvwxyz/" +static void test_compat_mac_1(void); +static void test_compat_mac_2(void); + /* * Apple shipped an extended version of GNU tar with Mac OS X 10.5 * and earlier. */ -void test_compat_mac_1() +static void +test_compat_mac_1(void) { char name[] = "test_compat_mac-1.tar.Z"; struct archive_entry *ae; @@ -133,7 +137,8 @@ void test_compat_mac_1() /* * Apple shipped a customized version of bsdtar starting with MacOS 10.6. */ -void test_compat_mac_2() +static void +test_compat_mac_2(void) { char name[] = "test_compat_mac-2.tar.Z"; struct archive_entry *ae; Modified: vendor/libarchive/dist/libarchive/test/test_compat_zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_compat_zip.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/test/test_compat_zip.c Thu Feb 9 10:56:05 2012 (r231270) @@ -359,12 +359,16 @@ compat_zip_6_verify(struct archive *a) assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualString("New Folder/New Folder/", archive_entry_pathname(ae)); assertEqualInt(AE_IFDIR, archive_entry_filetype(ae)); - assertEqualInt(1327314468, archive_entry_mtime(ae)); + /* Zip timestamps are local time, so vary by time zone. */ + /* TODO: A more complex assert would work here; we could + verify that it's within +/- 24 hours of a particular value. */ + /* assertEqualInt(1327314468, archive_entry_mtime(ae)); */ assertEqualInt(0, archive_entry_size(ae)); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualString("New Folder/New Folder/New Text Document.txt", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); - assertEqualInt(1327314476, archive_entry_mtime(ae)); + /* Zip timestamps are local time, so vary by time zone. */ + /* assertEqualInt(1327314476, archive_entry_mtime(ae)); */ assertEqualInt(11, archive_entry_size(ae)); assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); } Modified: vendor/libarchive/dist/libarchive/test/test_filter_count.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_filter_count.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/test/test_filter_count.c Thu Feb 9 10:56:05 2012 (r231270) @@ -25,7 +25,10 @@ #include "test.h" __FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_file_nonexistent.c 189473 2009-03-07 02:09:21Z kientzle $"); -void +static void read_test(const char *name); +static void write_test(void); + +static void read_test(const char *name) { struct archive* a = archive_read_new(); @@ -44,7 +47,7 @@ read_test(const char *name) archive_read_free(a); } -void +static void write_test(void) { char buff[4096]; Modified: vendor/libarchive/dist/libarchive/test/test_read_format_mtree.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_read_format_mtree.c Thu Feb 9 10:39:01 2012 (r231269) +++ vendor/libarchive/dist/libarchive/test/test_read_format_mtree.c Thu Feb 9 10:56:05 2012 (r231270) @@ -36,7 +36,7 @@ test_read_format_mtree1(void) /* Compute max 64-bit signed twos-complement value * without relying on overflow. This assumes that long long * is at least 64 bits. */ - const static long long max_int64 = ((((long long)1) << 62) - 1) + (((long long)1) << 62); + static const long long max_int64 = ((((long long)1) << 62) - 1) + (((long long)1) << 62); time_t min_time, t; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 13:23:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99E11106564A; Thu, 9 Feb 2012 13:23:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 843258FC0C; Thu, 9 Feb 2012 13:23:33 +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 q19DNXNk002612; Thu, 9 Feb 2012 13:23:33 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19DNXEt002609; Thu, 9 Feb 2012 13:23:33 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091323.q19DNXEt002609@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 13:23:33 +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: r231271 - stable/9/rescue/rescue X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 13:23:33 -0000 Author: bapt Date: Thu Feb 9 13:23:33 2012 New Revision: 231271 URL: http://svn.freebsd.org/changeset/base/231271 Log: MFH r227531: Add netcat (nc) to /rescue. Approved by: des (mentor) Modified: stable/9/rescue/rescue/Makefile Directory Properties: stable/9/rescue/rescue/ (props changed) Modified: stable/9/rescue/rescue/Makefile ============================================================================== --- stable/9/rescue/rescue/Makefile Thu Feb 9 10:56:05 2012 (r231270) +++ stable/9/rescue/rescue/Makefile Thu Feb 9 13:23:33 2012 (r231271) @@ -181,7 +181,7 @@ CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRU # CRUNCH_SRCDIRS+= usr.bin -CRUNCH_PROGS_usr.bin= head mt sed tail tee +CRUNCH_PROGS_usr.bin= head mt nc sed tail tee CRUNCH_PROGS_usr.bin+= gzip CRUNCH_ALIAS_gzip= gunzip gzcat zcat From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 13:23:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CD3E10656D3; Thu, 9 Feb 2012 13:23:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42EFE8FC14; Thu, 9 Feb 2012 13:23: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 q19DNjg9002652; Thu, 9 Feb 2012 13:23:45 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19DNj6m002650; Thu, 9 Feb 2012 13:23:45 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091323.q19DNj6m002650@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 13:23:45 +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: r231272 - stable/8/rescue/rescue X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 13:23:45 -0000 Author: bapt Date: Thu Feb 9 13:23:44 2012 New Revision: 231272 URL: http://svn.freebsd.org/changeset/base/231272 Log: MFH r227531: Add netcat (nc) to /rescue. Approved by: des (mentor) Modified: stable/8/rescue/rescue/Makefile Directory Properties: stable/8/rescue/rescue/ (props changed) Modified: stable/8/rescue/rescue/Makefile ============================================================================== --- stable/8/rescue/rescue/Makefile Thu Feb 9 13:23:33 2012 (r231271) +++ stable/8/rescue/rescue/Makefile Thu Feb 9 13:23:44 2012 (r231272) @@ -199,7 +199,7 @@ CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRU # CRUNCH_SRCDIRS+= usr.bin -CRUNCH_PROGS_usr.bin= head mt sed tail tee +CRUNCH_PROGS_usr.bin= head mt nc sed tail tee CRUNCH_PROGS_usr.bin+= gzip CRUNCH_ALIAS_gzip= gunzip gzcat zcat From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 14:00:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B8D106564A; Thu, 9 Feb 2012 14:00:50 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC768FC15; Thu, 9 Feb 2012 14:00:50 +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 q19E0or5003961; Thu, 9 Feb 2012 14:00:50 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19E0oXs003959; Thu, 9 Feb 2012 14:00:50 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201202091400.q19E0oXs003959@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 9 Feb 2012 14:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231273 - head/sys/pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:00:50 -0000 Author: nyan Date: Thu Feb 9 14:00:49 2012 New Revision: 231273 URL: http://svn.freebsd.org/changeset/base/231273 Log: - Disable the olpt driver. Because it conflicts with the ppc/lpt driver. - Remove obsolete comment. MFC after: 3 days Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Thu Feb 9 13:23:44 2012 (r231272) +++ head/sys/pc98/conf/GENERIC Thu Feb 9 14:00:49 2012 (r231273) @@ -167,8 +167,7 @@ device plip # TCP/IP over parallel device ppi # Parallel port interface device #device vpo # Requires scbus and da # OLD Parallel port -# Please stay olpt driver after ppc driver -device olpt +#device olpt # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 14:13:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B702106566B; Thu, 9 Feb 2012 14:13:57 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03FF28FC13; Thu, 9 Feb 2012 14:13:57 +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 q19EDuue004452; Thu, 9 Feb 2012 14:13:56 GMT (envelope-from matthew@svn.freebsd.org) Received: (from matthew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EDujl004450; Thu, 9 Feb 2012 14:13:56 GMT (envelope-from matthew@svn.freebsd.org) Message-Id: <201202091413.q19EDujl004450@svn.freebsd.org> From: Matthew Seaman Date: Thu, 9 Feb 2012 14:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231274 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:13:57 -0000 Author: matthew (ports committer) Date: Thu Feb 9 14:13:56 2012 New Revision: 231274 URL: http://svn.freebsd.org/changeset/base/231274 Log: Add myself as a new committer Approved by: shaun (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Feb 9 14:00:49 2012 (r231273) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Feb 9 14:13:56 2012 (r231274) @@ -274,6 +274,7 @@ 09/12 Weongyo Jeong born in Haman, Korea, 1980 09/12 Benedict Christopher Reuschling born in Darmstadt, Germany, 1981 09/12 William C. Fumerola II born in Detroit, Michigan, United States, 1981 +09/14 Matthew Seaman born in Bristol, United Kingdom, 1965 09/15 Aleksandr Rybalko born in Odessa, Ukraine, 1977 09/15 Dima Panov born in Khabarovsk, Russian Federation, 1978 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 14:15:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFCD2106564A; Thu, 9 Feb 2012 14:15:20 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA5998FC13; Thu, 9 Feb 2012 14:15: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 q19EFKW6004541; Thu, 9 Feb 2012 14:15:20 GMT (envelope-from matthew@svn.freebsd.org) Received: (from matthew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EFKfJ004539; Thu, 9 Feb 2012 14:15:20 GMT (envelope-from matthew@svn.freebsd.org) Message-Id: <201202091415.q19EFKfJ004539@svn.freebsd.org> From: Matthew Seaman Date: Thu, 9 Feb 2012 14:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231275 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:15:21 -0000 Author: matthew (ports committer) Date: Thu Feb 9 14:15:20 2012 New Revision: 231275 URL: http://svn.freebsd.org/changeset/base/231275 Log: Adding myself as a new committer Approved by: shaun (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Feb 9 14:13:56 2012 (r231274) +++ head/share/misc/committers-ports.dot Thu Feb 9 14:15:20 2012 (r231275) @@ -134,6 +134,7 @@ marcus [label="Joe Marcus Clarke\nmarcus markus [label="Markus Brueffer\nmarkus@FreeBSD.org\n2004/02/21"] martymac [label="Ganael Laplanche\nmartymac@FreeBSD.org\n2010/09/24"] mat [label="Mathieu Arnold\nmat@FreeBSD.org\n2003/08/15"] +matthew [label="Matthew Seaman\nmatthew@FreeBSD.org\n2012/02/07"] mezz [label="Jeremy Messenger\nmezz@FreeBSD.org\n2004/04/30"] miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2006/06/04"] mm [label="Martin Matuska\nmm@FreeBSD.org\n2007/04/04"] @@ -413,6 +414,7 @@ sem -> delphij sem -> stas shaun -> timur +shaun -> matthew sobomax -> demon sobomax -> glewis From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 14:15:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C05E51065675; Thu, 9 Feb 2012 14:15:57 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64B818FC13; Thu, 9 Feb 2012 14:15:57 +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 q19EFvX2004600; Thu, 9 Feb 2012 14:15:57 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EFvYu004598; Thu, 9 Feb 2012 14:15:57 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201202091415.q19EFvYu004598@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 9 Feb 2012 14:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231276 - head/sys/pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:15:57 -0000 Author: nyan Date: Thu Feb 9 14:15:56 2012 New Revision: 231276 URL: http://svn.freebsd.org/changeset/base/231276 Log: Remove full debugger options and enable KDB_TRACE option instead to decrease kernel size and increase performance. Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Thu Feb 9 14:15:20 2012 (r231275) +++ head/sys/pc98/conf/GENERIC Thu Feb 9 14:15:56 2012 (r231276) @@ -67,20 +67,8 @@ options CAPABILITY_MODE # Capsicum cap options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework options INCLUDE_CONFIG_FILE # Include this file in kernel - -# Debugging support. Always need this: -options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options KDB # Kernel debugger related code +options KDB_TRACE # Print a stack trace for a panic # To make an SMP kernel, the next two lines are needed #options SMP # Symmetric MultiProcessor Kernel From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 14:16:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BB2B1065672; Thu, 9 Feb 2012 14:16:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 849828FC1B; Thu, 9 Feb 2012 14:16: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 q19EG1pj004643; Thu, 9 Feb 2012 14:16:01 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EG1w0004636; Thu, 9 Feb 2012 14:16:01 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091416.q19EG1w0004636@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 14:16: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: r231277 - in stable/9: etc/rc.d sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:16:01 -0000 Author: bapt Date: Thu Feb 9 14:16:00 2012 New Revision: 231277 URL: http://svn.freebsd.org/changeset/base/231277 Log: MFH r226345, r226464, r226879: Make dhclient use a pid file. Modify the rc script accordingly, fix some bugs Approved by: des (mentor) Modified: stable/9/etc/rc.d/dhclient stable/9/sbin/dhclient/Makefile stable/9/sbin/dhclient/dhclient.8 stable/9/sbin/dhclient/dhclient.c stable/9/sbin/dhclient/dhcpd.h stable/9/sbin/dhclient/errwarn.c Directory Properties: stable/9/etc/rc.d/ (props changed) stable/9/sbin/dhclient/ (props changed) Modified: stable/9/etc/rc.d/dhclient ============================================================================== --- stable/9/etc/rc.d/dhclient Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/etc/rc.d/dhclient Thu Feb 9 14:16:00 2012 (r231277) @@ -9,56 +9,49 @@ . /etc/rc.subr . /etc/network.subr +ifn="$2" + name="dhclient" rcvar= -start_cmd="dhclient_start" -stop_cmd="dhclient_stop" - -dhclient_start() +pidfile="/var/run/${name}.${ifn}.pid" +start_precmd="dhclient_prestart" +stop_precmd="dhclient_pre_check" + +# rc_force check can only be done at the run_rc_command +# time, so we're testing it in the pre* hooks. +dhclient_pre_check() { - # prevent unnecessary restarts - # XXX: dhclient had better create a pidfile - if [ -x /bin/pgrep ]; then - pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"` - if [ -n "$pids" ]; then - sleep 1 - pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"` - if [ -n "$pids" ]; then - exit 0 - fi - elif [ -e /var/run/dhclient.pid ]; then - if [ -n "`pgrep -F /var/run/dhclient.pid`" ]; then - exit 0 - fi - fi + if [ -z "${rc_force}" ] && ! dhcpif $ifn; then + err 1 "'$ifn' is not a DHCP-enabled interface" fi +} + +dhclient_prestart() +{ + dhclient_pre_check - # Override for $ifn specific flags (see rc.subr for $flags setting) - specific=`get_if_var $ifn dhclient_flags_IF` + # Interface-specific flags (see rc.subr for $flags setting) + specific=$(get_if_var $ifn dhclient_flags_IF) if [ -z "$flags" -a -n "$specific" ]; then rc_flags=$specific fi - background_dhclient=`get_if_var $ifn background_dhclient_IF $background_dhclient` + background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient) if checkyesno background_dhclient; then rc_flags="${rc_flags} -b" fi - ${dhclient_program} ${rc_flags} $ifn + rc_flags="${rc_flags} ${ifn}" } -dhclient_stop() -{ - ifconfig $ifn down # cause dhclient to die -} - -ifn="$2" - load_rc_config $name load_rc_config network -if ! dhcpif $ifn; then - return 1 +if [ -z $ifn ] ; then + # only complain if a command was specified but no interface + if [ -n "$1" ] ; then + err 1 "$0: no interface specified" + fi fi run_rc_command "$1" Modified: stable/9/sbin/dhclient/Makefile ============================================================================== --- stable/9/sbin/dhclient/Makefile Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/Makefile Thu Feb 9 14:16:00 2012 (r231277) @@ -39,6 +39,8 @@ PROG= dhclient SCRIPTS=dhclient-script MAN= dhclient.8 dhclient.conf.5 dhclient.leases.5 dhcp-options.5 \ dhclient-script.8 +DPADD= ${LIBUTIL} +LDADD= -lutil WARNS?= 2 Modified: stable/9/sbin/dhclient/dhclient.8 ============================================================================== --- stable/9/sbin/dhclient/dhclient.8 Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/dhclient.8 Thu Feb 9 14:16:00 2012 (r231277) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2007 +.Dd October 13, 2011 .Dt DHCLIENT 8 .Os .Sh NAME @@ -49,6 +49,7 @@ .Op Fl bdqu .Op Fl c Ar file .Op Fl l Ar file +.Op Fl p Ar file .Ar interface .Sh DESCRIPTION The @@ -83,6 +84,10 @@ will revert to running in the background Specify an alternate location, .Ar file , for the leases file. +.It Fl p Ar file +Specify an alternate location for the PID file. +The default is +.Pa /var/run/dhclient. Ns Ar interface Ns Pa .pid . .It Fl q Forces .Nm Modified: stable/9/sbin/dhclient/dhclient.c ============================================================================== --- stable/9/sbin/dhclient/dhclient.c Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/dhclient.c Thu Feb 9 14:16:00 2012 (r231277) @@ -95,6 +95,9 @@ struct iaddr iaddr_broadcast = { 4, { 25 struct in_addr inaddr_any; struct sockaddr_in sockaddr_broadcast; +char *path_dhclient_pidfile; +struct pidfh *pidfile; + /* * ASSERT_STATE() does nothing now; it used to be * assert (state_is == state_shouldbe). @@ -316,6 +319,8 @@ die: if (ifi->client->alias) script_write_params("alias_", ifi->client->alias); script_go(); + if (pidfile != NULL) + pidfile_remove(pidfile); exit(1); } @@ -327,12 +332,13 @@ main(int argc, char *argv[]) int pipe_fd[2]; int immediate_daemon = 0; struct passwd *pw; + pid_t otherpid; /* Initially, log errors to stderr as well as to syslogd. */ openlog(__progname, LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); setlogmask(LOG_UPTO(LOG_DEBUG)); - while ((ch = getopt(argc, argv, "bc:dl:qu")) != -1) + while ((ch = getopt(argc, argv, "bc:dl:p:qu")) != -1) switch (ch) { case 'b': immediate_daemon = 1; @@ -346,6 +352,9 @@ main(int argc, char *argv[]) case 'l': path_dhclient_db = optarg; break; + case 'p': + path_dhclient_pidfile = optarg; + break; case 'q': quiet = 1; break; @@ -362,6 +371,21 @@ main(int argc, char *argv[]) if (argc != 1) usage(); + if (path_dhclient_pidfile == NULL) { + asprintf(&path_dhclient_pidfile, + "%sdhclient.%s.pid", _PATH_VARRUN, *argv); + if (path_dhclient_pidfile == NULL) + error("asprintf"); + } + pidfile = pidfile_open(path_dhclient_pidfile, 0600, &otherpid); + if (pidfile == NULL) { + if (errno == EEXIST) + error("dhclient already running, pid: %d.", otherpid); + if (errno == EAGAIN) + error("dhclient already running."); + warning("Cannot open or create pidfile: %m"); + } + if ((ifi = calloc(1, sizeof(struct interface_info))) == NULL) error("calloc"); if (strlcpy(ifi->name, argv[0], IFNAMSIZ) >= IFNAMSIZ) @@ -385,6 +409,12 @@ main(int argc, char *argv[]) read_client_conf(); + /* The next bit is potentially very time-consuming, so write out + the pidfile right away. We will write it out again with the + correct pid after daemonizing. */ + if (pidfile != NULL) + pidfile_write(pidfile); + if (!interface_link_status(ifi->name)) { fprintf(stderr, "%s: no link ...", ifi->name); fflush(stderr); @@ -2298,6 +2328,9 @@ go_daemon(void) if (daemon(1, 0) == -1) error("daemon"); + if (pidfile != NULL) + pidfile_write(pidfile); + /* we are chrooted, daemon(3) fails to open /dev/null */ if (nullfd != -1) { dup2(nullfd, STDIN_FILENO); Modified: stable/9/sbin/dhclient/dhcpd.h ============================================================================== --- stable/9/sbin/dhclient/dhcpd.h Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/dhcpd.h Thu Feb 9 14:16:00 2012 (r231277) @@ -41,7 +41,7 @@ * $FreeBSD$ */ -#include +#include #include #include @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -353,6 +354,8 @@ extern int log_perror; extern struct client_config top_level_config; +extern struct pidfh *pidfile; + void dhcpoffer(struct packet *); void dhcpack(struct packet *); void dhcpnak(struct packet *); Modified: stable/9/sbin/dhclient/errwarn.c ============================================================================== --- stable/9/sbin/dhclient/errwarn.c Thu Feb 9 14:15:56 2012 (r231276) +++ stable/9/sbin/dhclient/errwarn.c Thu Feb 9 14:16:00 2012 (r231277) @@ -83,6 +83,8 @@ error(char *fmt, ...) fprintf(stderr, "exiting.\n"); fflush(stderr); } + if (pidfile != NULL) + pidfile_remove(pidfile); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 14:16:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D72671065670; Thu, 9 Feb 2012 14:16:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFFBD8FC12; Thu, 9 Feb 2012 14:16: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 q19EGe3i004712; Thu, 9 Feb 2012 14:16:40 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EGenl004705; Thu, 9 Feb 2012 14:16:40 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091416.q19EGenl004705@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 14:16:40 +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: r231278 - in stable/8: etc/rc.d sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:16:41 -0000 Author: bapt Date: Thu Feb 9 14:16:40 2012 New Revision: 231278 URL: http://svn.freebsd.org/changeset/base/231278 Log: MFH r226345, r226464, r226879: Make dhclient use a pid file. Modify the rc script accordingly, fix some bugs Approved by: des (mentor) Modified: stable/8/etc/rc.d/dhclient stable/8/sbin/dhclient/Makefile stable/8/sbin/dhclient/dhclient.8 stable/8/sbin/dhclient/dhclient.c stable/8/sbin/dhclient/dhcpd.h stable/8/sbin/dhclient/errwarn.c Directory Properties: stable/8/etc/rc.d/ (props changed) stable/8/sbin/dhclient/ (props changed) Modified: stable/8/etc/rc.d/dhclient ============================================================================== --- stable/8/etc/rc.d/dhclient Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/etc/rc.d/dhclient Thu Feb 9 14:16:40 2012 (r231278) @@ -9,56 +9,49 @@ . /etc/rc.subr . /etc/network.subr +ifn="$2" + name="dhclient" rcvar= -start_cmd="dhclient_start" -stop_cmd="dhclient_stop" - -dhclient_start() +pidfile="/var/run/${name}.${ifn}.pid" +start_precmd="dhclient_prestart" +stop_precmd="dhclient_pre_check" + +# rc_force check can only be done at the run_rc_command +# time, so we're testing it in the pre* hooks. +dhclient_pre_check() { - # prevent unnecessary restarts - # XXX: dhclient had better create a pidfile - if [ -x /bin/pgrep ]; then - pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"` - if [ -n "$pids" ]; then - sleep 1 - pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"` - if [ -n "$pids" ]; then - exit 0 - fi - elif [ -e /var/run/dhclient.pid ]; then - if [ -n "`pgrep -F /var/run/dhclient.pid`" ]; then - exit 0 - fi - fi + if [ -z "${rc_force}" ] && ! dhcpif $ifn; then + err 1 "'$ifn' is not a DHCP-enabled interface" fi +} + +dhclient_prestart() +{ + dhclient_pre_check - # Override for $ifn specific flags (see rc.subr for $flags setting) - specific=`get_if_var $ifn dhclient_flags_IF` + # Interface-specific flags (see rc.subr for $flags setting) + specific=$(get_if_var $ifn dhclient_flags_IF) if [ -z "$flags" -a -n "$specific" ]; then rc_flags=$specific fi - background_dhclient=`get_if_var $ifn background_dhclient_IF $background_dhclient` + background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient) if checkyesno background_dhclient; then rc_flags="${rc_flags} -b" fi - ${dhclient_program} ${rc_flags} $ifn + rc_flags="${rc_flags} ${ifn}" } -dhclient_stop() -{ - ifconfig $ifn down # cause dhclient to die -} - -ifn="$2" - load_rc_config $name load_rc_config network -if ! dhcpif $ifn; then - return 1 +if [ -z $ifn ] ; then + # only complain if a command was specified but no interface + if [ -n "$1" ] ; then + err 1 "$0: no interface specified" + fi fi run_rc_command "$1" Modified: stable/8/sbin/dhclient/Makefile ============================================================================== --- stable/8/sbin/dhclient/Makefile Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/Makefile Thu Feb 9 14:16:40 2012 (r231278) @@ -39,5 +39,7 @@ PROG= dhclient SCRIPTS=dhclient-script MAN= dhclient.8 dhclient.conf.5 dhclient.leases.5 dhcp-options.5 \ dhclient-script.8 +DPADD= ${LIBUTIL} +LDADD= -lutil .include Modified: stable/8/sbin/dhclient/dhclient.8 ============================================================================== --- stable/8/sbin/dhclient/dhclient.8 Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/dhclient.8 Thu Feb 9 14:16:40 2012 (r231278) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2007 +.Dd October 13, 2011 .Dt DHCLIENT 8 .Os .Sh NAME @@ -49,6 +49,7 @@ .Op Fl bdqu .Op Fl c Ar file .Op Fl l Ar file +.Op Fl p Ar file .Ar interface .Sh DESCRIPTION The @@ -83,6 +84,10 @@ will revert to running in the background Specify an alternate location, .Ar file , for the leases file. +.It Fl p Ar file +Specify an alternate location for the PID file. +The default is +.Pa /var/run/dhclient. Ns Ar interface Ns Pa .pid . .It Fl q Forces .Nm Modified: stable/8/sbin/dhclient/dhclient.c ============================================================================== --- stable/8/sbin/dhclient/dhclient.c Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/dhclient.c Thu Feb 9 14:16:40 2012 (r231278) @@ -95,6 +95,9 @@ struct iaddr iaddr_broadcast = { 4, { 25 struct in_addr inaddr_any; struct sockaddr_in sockaddr_broadcast; +char *path_dhclient_pidfile; +struct pidfh *pidfile; + /* * ASSERT_STATE() does nothing now; it used to be * assert (state_is == state_shouldbe). @@ -316,6 +319,8 @@ die: if (ifi->client->alias) script_write_params("alias_", ifi->client->alias); script_go(); + if (pidfile != NULL) + pidfile_remove(pidfile); exit(1); } @@ -327,12 +332,13 @@ main(int argc, char *argv[]) int pipe_fd[2]; int immediate_daemon = 0; struct passwd *pw; + pid_t otherpid; /* Initially, log errors to stderr as well as to syslogd. */ openlog(__progname, LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY); setlogmask(LOG_UPTO(LOG_DEBUG)); - while ((ch = getopt(argc, argv, "bc:dl:qu")) != -1) + while ((ch = getopt(argc, argv, "bc:dl:p:qu")) != -1) switch (ch) { case 'b': immediate_daemon = 1; @@ -346,6 +352,9 @@ main(int argc, char *argv[]) case 'l': path_dhclient_db = optarg; break; + case 'p': + path_dhclient_pidfile = optarg; + break; case 'q': quiet = 1; break; @@ -362,6 +371,21 @@ main(int argc, char *argv[]) if (argc != 1) usage(); + if (path_dhclient_pidfile == NULL) { + asprintf(&path_dhclient_pidfile, + "%sdhclient.%s.pid", _PATH_VARRUN, *argv); + if (path_dhclient_pidfile == NULL) + error("asprintf"); + } + pidfile = pidfile_open(path_dhclient_pidfile, 0600, &otherpid); + if (pidfile == NULL) { + if (errno == EEXIST) + error("dhclient already running, pid: %d.", otherpid); + if (errno == EAGAIN) + error("dhclient already running."); + warning("Cannot open or create pidfile: %m"); + } + if ((ifi = calloc(1, sizeof(struct interface_info))) == NULL) error("calloc"); if (strlcpy(ifi->name, argv[0], IFNAMSIZ) >= IFNAMSIZ) @@ -385,6 +409,12 @@ main(int argc, char *argv[]) read_client_conf(); + /* The next bit is potentially very time-consuming, so write out + the pidfile right away. We will write it out again with the + correct pid after daemonizing. */ + if (pidfile != NULL) + pidfile_write(pidfile); + if (!interface_link_status(ifi->name)) { fprintf(stderr, "%s: no link ...", ifi->name); fflush(stderr); @@ -2298,6 +2328,9 @@ go_daemon(void) if (daemon(1, 0) == -1) error("daemon"); + if (pidfile != NULL) + pidfile_write(pidfile); + /* we are chrooted, daemon(3) fails to open /dev/null */ if (nullfd != -1) { dup2(nullfd, STDIN_FILENO); Modified: stable/8/sbin/dhclient/dhcpd.h ============================================================================== --- stable/8/sbin/dhclient/dhcpd.h Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/dhcpd.h Thu Feb 9 14:16:40 2012 (r231278) @@ -41,7 +41,7 @@ * $FreeBSD$ */ -#include +#include #include #include @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -353,6 +354,8 @@ extern int log_perror; extern struct client_config top_level_config; +extern struct pidfh *pidfile; + void dhcpoffer(struct packet *); void dhcpack(struct packet *); void dhcpnak(struct packet *); Modified: stable/8/sbin/dhclient/errwarn.c ============================================================================== --- stable/8/sbin/dhclient/errwarn.c Thu Feb 9 14:16:00 2012 (r231277) +++ stable/8/sbin/dhclient/errwarn.c Thu Feb 9 14:16:40 2012 (r231278) @@ -83,6 +83,8 @@ error(char *fmt, ...) fprintf(stderr, "exiting.\n"); fflush(stderr); } + if (pidfile != NULL) + pidfile_remove(pidfile); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 15:21:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 619C71065673; Thu, 9 Feb 2012 15:21:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4648FC0C; Thu, 9 Feb 2012 15:21:55 +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 q19FLtAe006946; Thu, 9 Feb 2012 15:21:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19FLtfA006932; Thu, 9 Feb 2012 15:21:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091521.q19FLtfA006932@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 15:21:55 +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: r231279 - stable/9/usr.bin/systat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 15:21:55 -0000 Author: ed Date: Thu Feb 9 15:21:54 2012 New Revision: 231279 URL: http://svn.freebsd.org/changeset/base/231279 Log: MFC r226396: Fix whitespace inconsistencies in systat(1). According to md5(1), the resulting binary is the same. Modified: stable/9/usr.bin/systat/cmds.c stable/9/usr.bin/systat/cmdtab.c stable/9/usr.bin/systat/devs.c stable/9/usr.bin/systat/fetch.c stable/9/usr.bin/systat/ifcmds.c stable/9/usr.bin/systat/ifstat.c stable/9/usr.bin/systat/keyboard.c stable/9/usr.bin/systat/mode.c stable/9/usr.bin/systat/mode.h stable/9/usr.bin/systat/netstat.c stable/9/usr.bin/systat/systat.h stable/9/usr.bin/systat/vmstat.c Directory Properties: stable/9/usr.bin/systat/ (props changed) Modified: stable/9/usr.bin/systat/cmds.c ============================================================================== --- stable/9/usr.bin/systat/cmds.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/cmds.c Thu Feb 9 15:21:54 2012 (r231279) @@ -47,32 +47,32 @@ static const char sccsid[] = "@(#)cmds.c void command(const char *cmd) { - struct cmdtab *p; - char *cp, *tmpstr, *tmpstr1; + struct cmdtab *p; + char *cp, *tmpstr, *tmpstr1; int interval, omask; tmpstr = tmpstr1 = strdup(cmd); omask = sigblock(sigmask(SIGALRM)); - for (cp = tmpstr1; *cp && !isspace(*cp); cp++) - ; - if (*cp) - *cp++ = '\0'; + for (cp = tmpstr1; *cp && !isspace(*cp); cp++) + ; + if (*cp) + *cp++ = '\0'; if (*tmpstr1 == '\0') return; for (; *cp && isspace(*cp); cp++) ; - if (strcmp(tmpstr1, "quit") == 0 || strcmp(tmpstr1, "q") == 0) - die(0); + if (strcmp(tmpstr1, "quit") == 0 || strcmp(tmpstr1, "q") == 0) + die(0); if (strcmp(tmpstr1, "load") == 0) { load(); goto done; } - if (strcmp(tmpstr1, "stop") == 0) { - alarm(0); - mvaddstr(CMDLINE, 0, "Refresh disabled."); - clrtoeol(); + if (strcmp(tmpstr1, "stop") == 0) { + alarm(0); + mvaddstr(CMDLINE, 0, "Refresh disabled."); + clrtoeol(); goto done; - } + } if (strcmp(tmpstr1, "help") == 0) { int _col, _len; @@ -89,30 +89,30 @@ command(const char *cmd) goto done; } interval = atoi(tmpstr1); - if (interval <= 0 && + if (interval <= 0 && (strcmp(tmpstr1, "start") == 0 || strcmp(tmpstr1, "interval") == 0)) { interval = *cp ? atoi(cp) : naptime; - if (interval <= 0) { + if (interval <= 0) { error("%d: bad interval.", interval); goto done; - } + } } if (interval > 0) { - alarm(0); - naptime = interval; - display(0); - status(); + alarm(0); + naptime = interval; + display(0); + status(); goto done; - } + } p = lookup(tmpstr1); if (p == (struct cmdtab *)-1) { error("%s: Ambiguous command.", tmpstr1); goto done; } - if (p) { - if (curcmd == p) + if (p) { + if (curcmd == p) goto done; - alarm(0); + alarm(0); (*curcmd->c_close)(wnd); curcmd->c_flags &= ~CF_INIT; wnd = (*p->c_open)(); @@ -131,12 +131,12 @@ command(const char *cmd) else goto done; } - curcmd = p; + curcmd = p; labels(); - display(0); - status(); + display(0); + status(); goto done; - } + } if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(tmpstr1, cp)) error("%s: Unknown command.", tmpstr1); done: @@ -176,18 +176,18 @@ void status(void) { - error("Showing %s, refresh every %d seconds.", - curcmd->c_name, naptime); + error("Showing %s, refresh every %d seconds.", + curcmd->c_name, naptime); } int prefix(const char *s1, const char *s2) { - while (*s1 == *s2) { - if (*s1 == '\0') - return (1); - s1++, s2++; - } - return (*s1 == '\0'); + while (*s1 == *s2) { + if (*s1 == '\0') + return (1); + s1++, s2++; + } + return (*s1 == '\0'); } Modified: stable/9/usr.bin/systat/cmdtab.c ============================================================================== --- stable/9/usr.bin/systat/cmdtab.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/cmdtab.c Thu Feb 9 15:21:54 2012 (r231279) @@ -40,22 +40,22 @@ static const char sccsid[] = "@(#)cmdtab #include "mode.h" struct cmdtab cmdtab[] = { - { "pigs", showpigs, fetchpigs, labelpigs, + { "pigs", showpigs, fetchpigs, labelpigs, initpigs, openpigs, closepigs, 0, 0, CF_LOADAV }, - { "swap", showswap, fetchswap, labelswap, + { "swap", showswap, fetchswap, labelswap, initswap, openswap, closeswap, 0, 0, CF_LOADAV }, - { "mbufs", showmbufs, fetchmbufs, labelmbufs, + { "mbufs", showmbufs, fetchmbufs, labelmbufs, initmbufs, openmbufs, closembufs, 0, 0, CF_LOADAV }, - { "iostat", showiostat, fetchiostat, labeliostat, + { "iostat", showiostat, fetchiostat, labeliostat, initiostat, openiostat, closeiostat, cmdiostat, 0, CF_LOADAV }, - { "vmstat", showkre, fetchkre, labelkre, + { "vmstat", showkre, fetchkre, labelkre, initkre, openkre, closekre, cmdkre, 0, 0 }, - { "netstat", shownetstat, fetchnetstat, labelnetstat, + { "netstat", shownetstat, fetchnetstat, labelnetstat, initnetstat, opennetstat, closenetstat, cmdnetstat, 0, CF_LOADAV }, { "icmp", showicmp, fetchicmp, labelicmp, @@ -78,6 +78,6 @@ struct cmdtab cmdtab[] = { { "ifstat", showifstat, fetchifstat, labelifstat, initifstat, openifstat, closeifstat, cmdifstat, 0, CF_LOADAV }, - { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; struct cmdtab *curcmd = &cmdtab[0]; Modified: stable/9/usr.bin/systat/devs.c ============================================================================== --- stable/9/usr.bin/systat/devs.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/devs.c Thu Feb 9 15:21:54 2012 (r231279) @@ -105,7 +105,7 @@ dsinit(int maxshowdevs, struct statinfo /* * Make sure that the userland devstat version matches the kernel - * devstat version. If not, exit and print a message informing + * devstat version. If not, exit and print a message informing * the user of his mistake. */ if (devstat_checkversion(NULL) < 0) @@ -155,10 +155,10 @@ dscmd(const char *cmd, const char *args, if (prefix(cmd, "refresh")) { retval = devstat_selectdevs(&dev_select, &num_selected, &num_selections, &select_generation, generation, - s1->dinfo->devices, num_devices, + s1->dinfo->devices, num_devices, (last_type ==DS_MATCHTYPE_PATTERN) ? matches : NULL, (last_type ==DS_MATCHTYPE_PATTERN) ? num_matches : 0, - (last_type == DS_MATCHTYPE_SPEC) ?specified_devices : NULL, + (last_type == DS_MATCHTYPE_SPEC) ?specified_devices : NULL, (last_type == DS_MATCHTYPE_SPEC) ?num_devices_specified : 0, (last_type == DS_MATCHTYPE_NONE) ? DS_SELECT_ADD : DS_SELECT_ADDONLY, maxshowdevs, 0); @@ -220,7 +220,7 @@ dsmatchselect(const char *args, devstat_ } for (i = 0; i < num_args; i++) { - if (devstat_buildmatch(tstr[i], &matches, &num_matches) != 0) { + if (devstat_buildmatch(tstr[i], &matches, &num_matches) != 0) { warnx("%s", devstat_errbuf); return(0); } @@ -282,7 +282,7 @@ dsselect(const char *args, devstat_selec asprintf(&buffer, "%s%d", dev_select[i].device_name, dev_select[i].unit_number); if (strcmp(buffer, tmpstr1) == 0) { - + num_devices_specified++; specified_devices =(char **)realloc( Modified: stable/9/usr.bin/systat/fetch.c ============================================================================== --- stable/9/usr.bin/systat/fetch.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/fetch.c Thu Feb 9 15:21:54 2012 (r231279) @@ -62,17 +62,17 @@ void getsysctl(const char *name, void *p { size_t nlen = len; if (sysctlbyname(name, ptr, &nlen, NULL, 0) != 0) { - error("sysctl(%s...) failed: %s", name, + error("sysctl(%s...) failed: %s", name, strerror(errno)); } if (nlen != len) { - error("sysctl(%s...) expected %lu, got %lu", name, + error("sysctl(%s...) expected %lu, got %lu", name, (unsigned long)len, (unsigned long)nlen); } } /* - * Read sysctl data with variable size. Try some times (with increasing + * Read sysctl data with variable size. Try some times (with increasing * buffers), fail if still too small. * This is needed sysctls with possibly raplidly increasing data sizes, * but imposes little overhead in the case of constant sizes. @@ -84,8 +84,8 @@ void getsysctl(const char *name, void *p /* Some defines: Number of tries. */ #define SD_NTRIES 10 /* Percent of over-allocation (initial) */ -#define SD_MARGIN 10 -/* +#define SD_MARGIN 10 +/* * Factor for over-allocation in percent (the margin is increased by this on * any failed try). */ Modified: stable/9/usr.bin/systat/ifcmds.c ============================================================================== --- stable/9/usr.bin/systat/ifcmds.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/ifcmds.c Thu Feb 9 15:21:54 2012 (r231279) @@ -47,7 +47,7 @@ ifcmd(const char *cmd, const char *args) clrtoeol(); addstr("what scale? "); addstr(get_helplist()); - } + } } return (1); } Modified: stable/9/usr.bin/systat/ifstat.c ============================================================================== --- stable/9/usr.bin/systat/ifstat.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/ifstat.c Thu Feb 9 15:21:54 2012 (r231279) @@ -43,7 +43,7 @@ #include "extern.h" #include "convtbl.h" - /* Column numbers */ + /* Column numbers */ #define C1 0 /* 0-19 */ #define C2 20 /* 20-39 */ @@ -121,9 +121,9 @@ static u_int getifnum(void); } while (0) #define DOPUTTOTAL(c, r, d) do { \ - CLEAR_COLUMN((r), (c)); \ - mvprintw((r), (c), "%12.3f %s ", \ - convert(d##_##c, SC_AUTO), \ + CLEAR_COLUMN((r), (c)); \ + mvprintw((r), (c), "%12.3f %s ", \ + convert(d##_##c, SC_AUTO), \ get_string(d##_##c, SC_AUTO)); \ } while (0) @@ -255,8 +255,8 @@ fetchifstat(void) (void)getifmibdata(ifp->if_row, &ifp->if_mib); - new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; - new_outb = ifp->if_mib.ifmd_data.ifi_obytes; + new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; + new_outb = ifp->if_mib.ifmd_data.ifi_obytes; /* Display interface if it's received some traffic. */ if (new_inb > 0 && old_inb == 0) { @@ -269,9 +269,9 @@ fetchifstat(void) * for our current traffic rates, and while we're there, * see if we have new peak rates. */ - old_tv = ifp->tv; - timersub(&new_tv, &old_tv, &tv); - elapsed = tv.tv_sec + (tv.tv_usec * 1e-6); + old_tv = ifp->tv; + timersub(&new_tv, &old_tv, &tv); + elapsed = tv.tv_sec + (tv.tv_usec * 1e-6); ifp->if_in_curtraffic = new_inb - old_inb; ifp->if_out_curtraffic = new_outb - old_outb; @@ -281,8 +281,8 @@ fetchifstat(void) * and line, we divide by ``elapsed'' as this is likely * to be more accurate. */ - ifp->if_in_curtraffic /= elapsed; - ifp->if_out_curtraffic /= elapsed; + ifp->if_in_curtraffic /= elapsed; + ifp->if_out_curtraffic /= elapsed; if (ifp->if_in_curtraffic > ifp->if_in_traffic_peak) ifp->if_in_traffic_peak = ifp->if_in_curtraffic; Modified: stable/9/usr.bin/systat/keyboard.c ============================================================================== --- stable/9/usr.bin/systat/keyboard.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/keyboard.c Thu Feb 9 15:21:54 2012 (r231279) @@ -47,76 +47,76 @@ static const char sccsid[] = "@(#)keyboa int keyboard(void) { - char ch, line[80]; + char ch, line[80]; int oldmask; - for (;;) { - col = 0; - move(CMDLINE, 0); - do { - refresh(); - ch = getch(); - if (ch == ERR) { - if (errno == EINTR) - continue; - exit(1); - } - if (ch >= 'A' && ch <= 'Z') - ch += 'a' - 'A'; - if (col == 0) { + for (;;) { + col = 0; + move(CMDLINE, 0); + do { + refresh(); + ch = getch(); + if (ch == ERR) { + if (errno == EINTR) + continue; + exit(1); + } + if (ch >= 'A' && ch <= 'Z') + ch += 'a' - 'A'; + if (col == 0) { #define mask(s) (1 << ((s) - 1)) - if (ch == CTRL('l')) { + if (ch == CTRL('l')) { oldmask = sigblock(mask(SIGALRM)); wrefresh(curscr); sigsetmask(oldmask); - continue; - } + continue; + } if (ch == CTRL('g')) { oldmask = sigblock(mask(SIGALRM)); status(); sigsetmask(oldmask); continue; } - if (ch != ':') - continue; - move(CMDLINE, 0); - clrtoeol(); - } - if (ch == erasechar() && col > 0) { - if (col == 1 && line[0] == ':') - continue; - col--; - goto doerase; - } - if (ch == CTRL('w') && col > 0) { - while (--col >= 0 && isspace(line[col])) - ; - col++; - while (--col >= 0 && !isspace(line[col])) - if (col == 0 && line[0] == ':') - break; - col++; - goto doerase; - } - if (ch == killchar() && col > 0) { - col = 0; - if (line[0] == ':') - col++; - doerase: - move(CMDLINE, col); - clrtoeol(); - continue; - } - if (isprint(ch) || ch == ' ') { - line[col] = ch; - mvaddch(CMDLINE, col, ch); - col++; - } - } while (col == 0 || (ch != '\r' && ch != '\n')); - line[col] = '\0'; + if (ch != ':') + continue; + move(CMDLINE, 0); + clrtoeol(); + } + if (ch == erasechar() && col > 0) { + if (col == 1 && line[0] == ':') + continue; + col--; + goto doerase; + } + if (ch == CTRL('w') && col > 0) { + while (--col >= 0 && isspace(line[col])) + ; + col++; + while (--col >= 0 && !isspace(line[col])) + if (col == 0 && line[0] == ':') + break; + col++; + goto doerase; + } + if (ch == killchar() && col > 0) { + col = 0; + if (line[0] == ':') + col++; + doerase: + move(CMDLINE, col); + clrtoeol(); + continue; + } + if (isprint(ch) || ch == ' ') { + line[col] = ch; + mvaddch(CMDLINE, col, ch); + col++; + } + } while (col == 0 || (ch != '\r' && ch != '\n')); + line[col] = '\0'; oldmask = sigblock(mask(SIGALRM)); - command(line + 1); + command(line + 1); sigsetmask(oldmask); - } + } /*NOTREACHED*/ } Modified: stable/9/usr.bin/systat/mode.c ============================================================================== --- stable/9/usr.bin/systat/mode.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/mode.c Thu Feb 9 15:21:54 2012 (r231279) @@ -12,7 +12,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF Modified: stable/9/usr.bin/systat/mode.h ============================================================================== --- stable/9/usr.bin/systat/mode.h Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/mode.h Thu Feb 9 15:21:54 2012 (r231279) @@ -12,7 +12,7 @@ * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. - * + * * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF Modified: stable/9/usr.bin/systat/netstat.c ============================================================================== --- stable/9/usr.bin/systat/netstat.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/netstat.c Thu Feb 9 15:21:54 2012 (r231279) @@ -128,7 +128,7 @@ closenetstat(WINDOW *w) lastrow--; p->ni_line = -1; } - if (w != NULL) { + if (w != NULL) { wclear(w); wrefresh(w); delwin(w); Modified: stable/9/usr.bin/systat/systat.h ============================================================================== --- stable/9/usr.bin/systat/systat.h Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/systat.h Thu Feb 9 15:21:54 2012 (r231279) @@ -33,10 +33,10 @@ #include struct cmdtab { - const char *c_name; /* command name */ - void (*c_refresh)(void); /* display refresh */ - void (*c_fetch)(void); /* sets up data structures */ - void (*c_label)(void); /* label display */ + const char *c_name; /* command name */ + void (*c_refresh)(void); /* display refresh */ + void (*c_fetch)(void); /* sets up data structures */ + void (*c_label)(void); /* label display */ int (*c_init)(void); /* initialize namelist, etc. */ WINDOW *(*c_open)(void); /* open display */ void (*c_close)(WINDOW *); /* close display */ Modified: stable/9/usr.bin/systat/vmstat.c ============================================================================== --- stable/9/usr.bin/systat/vmstat.c Thu Feb 9 14:16:40 2012 (r231278) +++ stable/9/usr.bin/systat/vmstat.c Thu Feb 9 15:21:54 2012 (r231279) @@ -224,7 +224,7 @@ initkre(void) intrloc = calloc(nintr, sizeof (long)); intrname = calloc(nintr, sizeof (char *)); intrnamebuf = sysctl_dynread("hw.intrnames", NULL); - if (intrnamebuf == NULL || intrname == NULL || + if (intrnamebuf == NULL || intrname == NULL || intrloc == NULL) { error("Out of memory"); if (intrnamebuf) @@ -854,7 +854,7 @@ dinfo(int dn, int lc, struct statinfo *n elapsed_time = now->snap_time - then->snap_time; } else { /* Calculate relative to device creation */ - elapsed_time = now->snap_time - devstat_compute_etime( + elapsed_time = now->snap_time - devstat_compute_etime( &now->dinfo->devices[di].creation_time, NULL); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 15:23:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87373106568E; Thu, 9 Feb 2012 15:23:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 711B38FC22; Thu, 9 Feb 2012 15:23:39 +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 q19FNdTw007054; Thu, 9 Feb 2012 15:23:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19FNdZJ007052; Thu, 9 Feb 2012 15:23:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091523.q19FNdZJ007052@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 15:23:39 +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: r231280 - stable/9/usr.bin/systat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 15:23:39 -0000 Author: ed Date: Thu Feb 9 15:23:39 2012 New Revision: 231280 URL: http://svn.freebsd.org/changeset/base/231280 Log: MFC r226424: Use integer to store the result of getch(). We need to use an integer to make the comparison against ERR work. Modified: stable/9/usr.bin/systat/keyboard.c Directory Properties: stable/9/usr.bin/systat/ (props changed) Modified: stable/9/usr.bin/systat/keyboard.c ============================================================================== --- stable/9/usr.bin/systat/keyboard.c Thu Feb 9 15:21:54 2012 (r231279) +++ stable/9/usr.bin/systat/keyboard.c Thu Feb 9 15:23:39 2012 (r231280) @@ -47,8 +47,8 @@ static const char sccsid[] = "@(#)keyboa int keyboard(void) { - char ch, line[80]; - int oldmask; + char line[80]; + int ch, oldmask; for (;;) { col = 0; From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 15:26:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45BBF106566B; Thu, 9 Feb 2012 15:26:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F6A48FC0C; Thu, 9 Feb 2012 15:26:48 +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 q19FQmLN007210; Thu, 9 Feb 2012 15:26:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19FQl4V007208; Thu, 9 Feb 2012 15:26:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091526.q19FQl4V007208@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 15:26:47 +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: r231281 - stable/9/usr.sbin/bsnmpd/tools/libbsnmptools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 15:26:48 -0000 Author: ed Date: Thu Feb 9 15:26:47 2012 New Revision: 231281 URL: http://svn.freebsd.org/changeset/base/231281 Log: MFC r229385 Fix subtle typo: compare against idx -- not index. In this context, index refers to the index(3) function. In this case it doesn't really harm, as this function is never called with idx == NULL. Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Directory Properties: stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Thu Feb 9 15:23:39 2012 (r231280) +++ stable/9/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Thu Feb 9 15:26:47 2012 (r231281) @@ -469,7 +469,7 @@ snmp_leaf_insert(struct snmp_toolinfo *s static int32_t snmp_index_insert(struct snmp_idxlist *headp, struct index *idx) { - if (headp == NULL || index == NULL) + if (headp == NULL || idx == NULL) return (-1); STAILQ_INSERT_TAIL(headp, idx, link); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 15:28:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 289E81065740; Thu, 9 Feb 2012 15:28:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12E1E8FC08; Thu, 9 Feb 2012 15:28:29 +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 q19FSSvr007297; Thu, 9 Feb 2012 15:28:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19FSSnX007295; Thu, 9 Feb 2012 15:28:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091528.q19FSSnX007295@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 15:28:28 +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: r231282 - stable/9/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 15:28:29 -0000 Author: ed Date: Thu Feb 9 15:28:28 2012 New Revision: 231282 URL: http://svn.freebsd.org/changeset/base/231282 Log: MFC r229590 manually: It turns out our GCC has quite an interesting bug: typeof(1.0fi) != float _Complex typeof((float _Complex)1.0fi) != float _Complex typeof((float _Complex)1.0i) == float _Complex In other words: if casting to an equal size, GCC seems to take a shortcut. By casting down from a double to a float, GCC doesn't take this shortcut, yielding the proper type. Modified: stable/9/include/complex.h Modified: stable/9/include/complex.h ============================================================================== --- stable/9/include/complex.h Thu Feb 9 15:26:47 2012 (r231281) +++ stable/9/include/complex.h Thu Feb 9 15:28:28 2012 (r231282) @@ -33,7 +33,7 @@ #if __STDC_VERSION__ < 199901 #define _Complex __complex__ #endif -#define _Complex_I 1.0fi +#define _Complex_I ((float _Complex)1.0i) #endif #define complex _Complex From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 15:36:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7610F10656DB; Thu, 9 Feb 2012 15:36:55 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6063A8FC0C; Thu, 9 Feb 2012 15:36:55 +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 q19FatgW007602; Thu, 9 Feb 2012 15:36:55 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19FatqI007599; Thu, 9 Feb 2012 15:36:55 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201202091536.q19FatqI007599@svn.freebsd.org> From: Olivier Houchard Date: Thu, 9 Feb 2012 15:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231283 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 15:36:55 -0000 Author: cognet Date: Thu Feb 9 15:36:54 2012 New Revision: 231283 URL: http://svn.freebsd.org/changeset/base/231283 Log: Please welcome Damjan Marion to the zoo. Damjan has been working on omap and tegra support, as well as various bits in the cpu-independant arm stuff, for too long, and certainly deserves to be punished with a commit bit. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Feb 9 15:28:28 2012 (r231282) +++ svnadmin/conf/access Thu Feb 9 15:36:54 2012 (r231283) @@ -68,6 +68,7 @@ des dfr dg dim +dmarion dougb dumbbell dwhite Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Feb 9 15:28:28 2012 (r231282) +++ svnadmin/conf/mentors Thu Feb 9 15:36:54 2012 (r231283) @@ -15,6 +15,7 @@ andrew imp art avg Co-mentor: marcel bapt des benl philip Co-mentor: simon +dmarion cognet eadler cperciva eri mlaier Co-mentor: thompsa gber cognet From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:11:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F721065674; Thu, 9 Feb 2012 16:11:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53DA28FC0A; Thu, 9 Feb 2012 16:11: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 q19GBwOl008732; Thu, 9 Feb 2012 16:11:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GBwCt008730; Thu, 9 Feb 2012 16:11:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202091611.q19GBwCt008730@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 16:11: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: r231284 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:11:58 -0000 Author: bz Date: Thu Feb 9 16:11:57 2012 New Revision: 231284 URL: http://svn.freebsd.org/changeset/base/231284 Log: MFC r229127: Remove a declaration to a non-existent function. Modified: stable/9/sys/netinet6/scope6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/scope6_var.h ============================================================================== --- stable/9/sys/netinet6/scope6_var.h Thu Feb 9 15:36:54 2012 (r231283) +++ stable/9/sys/netinet6/scope6_var.h Thu Feb 9 16:11:57 2012 (r231284) @@ -49,7 +49,6 @@ int scope6_set __P((struct ifnet *, stru int scope6_get __P((struct ifnet *, struct scope6_id *)); void scope6_setdefault __P((struct ifnet *)); int scope6_get_default __P((struct scope6_id *)); -u_int32_t scope6_in6_addrscope __P((struct in6_addr *)); u_int32_t scope6_addr2default __P((struct in6_addr *)); int sa6_embedscope __P((struct sockaddr_in6 *, int)); int sa6_recoverscope __P((struct sockaddr_in6 *)); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:12:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C910510656D1; Thu, 9 Feb 2012 16:12:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B32718FC13; Thu, 9 Feb 2012 16:12: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 q19GCCQJ008781; Thu, 9 Feb 2012 16:12:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GCC3P008779; Thu, 9 Feb 2012 16:12:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202091612.q19GCC3P008779@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 16:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231285 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:12:12 -0000 Author: bz Date: Thu Feb 9 16:12:12 2012 New Revision: 231285 URL: http://svn.freebsd.org/changeset/base/231285 Log: MFC r229127: Remove a declaration to a non-existent function. Modified: stable/8/sys/netinet6/scope6_var.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/scope6_var.h ============================================================================== --- stable/8/sys/netinet6/scope6_var.h Thu Feb 9 16:11:57 2012 (r231284) +++ stable/8/sys/netinet6/scope6_var.h Thu Feb 9 16:12:12 2012 (r231285) @@ -49,7 +49,6 @@ int scope6_set __P((struct ifnet *, stru int scope6_get __P((struct ifnet *, struct scope6_id *)); void scope6_setdefault __P((struct ifnet *)); int scope6_get_default __P((struct scope6_id *)); -u_int32_t scope6_in6_addrscope __P((struct in6_addr *)); u_int32_t scope6_addr2default __P((struct in6_addr *)); int sa6_embedscope __P((struct sockaddr_in6 *, int)); int sa6_recoverscope __P((struct sockaddr_in6 *)); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:12:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD8201065816; Thu, 9 Feb 2012 16:12:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6ED68FC0A; Thu, 9 Feb 2012 16: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 q19GCPM7008828; Thu, 9 Feb 2012 16:12:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GCPYe008826; Thu, 9 Feb 2012 16:12:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202091612.q19GCPYe008826@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 16:12:25 +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: r231286 - stable/7/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:12:26 -0000 Author: bz Date: Thu Feb 9 16:12:25 2012 New Revision: 231286 URL: http://svn.freebsd.org/changeset/base/231286 Log: MFC r229127: Remove a declaration to a non-existent function. Modified: stable/7/sys/netinet6/scope6_var.h Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/netinet6/scope6_var.h ============================================================================== --- stable/7/sys/netinet6/scope6_var.h Thu Feb 9 16:12:12 2012 (r231285) +++ stable/7/sys/netinet6/scope6_var.h Thu Feb 9 16:12:25 2012 (r231286) @@ -49,7 +49,6 @@ int scope6_set __P((struct ifnet *, stru int scope6_get __P((struct ifnet *, struct scope6_id *)); void scope6_setdefault __P((struct ifnet *)); int scope6_get_default __P((struct scope6_id *)); -u_int32_t scope6_in6_addrscope __P((struct in6_addr *)); u_int32_t scope6_addr2default __P((struct in6_addr *)); int sa6_embedscope __P((struct sockaddr_in6 *, int)); int sa6_recoverscope __P((struct sockaddr_in6 *)); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:53:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9CB51065670; Thu, 9 Feb 2012 16:53:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1F8A8FC12; Thu, 9 Feb 2012 16:53:51 +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 q19Grpru010236; Thu, 9 Feb 2012 16:53:51 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Grpof010229; Thu, 9 Feb 2012 16:53:51 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091653.q19Grpof010229@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:53:51 +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: r231287 - in stable/9/sys/boot: arm/at91/boot2 arm/ixp425/boot2 i386/boot2 i386/gptboot i386/zfsboot pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:53:52 -0000 Author: bapt Date: Thu Feb 9 16:53:51 2012 New Revision: 231287 URL: http://svn.freebsd.org/changeset/base/231287 Log: MFH r226506: Look for /boot/config in addition to /boot.config Approved by: des (mentor) Modified: stable/9/sys/boot/arm/at91/boot2/boot2.c stable/9/sys/boot/arm/ixp425/boot2/boot2.c stable/9/sys/boot/i386/boot2/boot2.c stable/9/sys/boot/i386/gptboot/gptboot.c stable/9/sys/boot/i386/zfsboot/zfsboot.c stable/9/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/arm/at91/boot2/boot2.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/arm/at91/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) @@ -64,7 +64,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" //#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" @@ -160,7 +161,8 @@ main(void) autoboot = 1; /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: stable/9/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/arm/ixp425/boot2/boot2.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/arm/ixp425/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) @@ -62,7 +62,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_KERNEL "/boot/kernel/kernel" extern uint32_t _end; @@ -168,7 +169,8 @@ main(void) autoboot = 1; /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: stable/9/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/i386/boot2/boot2.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/i386/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) @@ -74,7 +74,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -238,7 +239,8 @@ main(void) autoboot = 1; - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: stable/9/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/9/sys/boot/i386/gptboot/gptboot.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/i386/gptboot/gptboot.c Thu Feb 9 16:53:51 2012 (r231287) @@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$"); #include "cons.h" #include "gpt.h" -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -163,8 +164,8 @@ main(void) for (;;) { *kname = '\0'; - ino = lookup(PATH_CONFIG); - if (ino > 0) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd != '\0') { Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/9/sys/boot/i386/zfsboot/zfsboot.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/i386/zfsboot/zfsboot.c Thu Feb 9 16:53:51 2012 (r231287) @@ -45,7 +45,8 @@ __FBSDID("$FreeBSD$"); /* Hint to loader that we came from ZFS */ #define KARGS_FLAGS_ZFS 0x4 -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -533,7 +534,8 @@ main(void) zfs_mount_pool(spa); - if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0) { + if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0 || + zfs_lookup(spa, PATH_DOTCONFIG, &dn) == 0) { off = 0; zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); } Modified: stable/9/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/pc98/boot2/boot2.c Thu Feb 9 16:12:25 2012 (r231286) +++ stable/9/sys/boot/pc98/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) @@ -76,7 +76,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -376,7 +377,8 @@ main(void) autoboot = 1; - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:54:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42A6C106566B; Thu, 9 Feb 2012 16:54:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A2D58FC08; Thu, 9 Feb 2012 16:54: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 q19Gs75E010295; Thu, 9 Feb 2012 16:54:07 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Gs6us010288; Thu, 9 Feb 2012 16:54:06 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091654.q19Gs6us010288@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:54:06 +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: r231288 - in stable/8/sys/boot: arm/at91/boot2 arm/ixp425/boot2 i386/boot2 i386/gptboot i386/zfsboot pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:54:07 -0000 Author: bapt Date: Thu Feb 9 16:54:06 2012 New Revision: 231288 URL: http://svn.freebsd.org/changeset/base/231288 Log: MFH r226506: Look for /boot/config in addition to /boot.config Approved by: des (mentor) Modified: stable/8/sys/boot/arm/at91/boot2/boot2.c stable/8/sys/boot/arm/ixp425/boot2/boot2.c stable/8/sys/boot/i386/boot2/boot2.c stable/8/sys/boot/i386/gptboot/gptboot.c stable/8/sys/boot/i386/zfsboot/zfsboot.c stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/arm/at91/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/arm/at91/boot2/boot2.c Thu Feb 9 16:54:06 2012 (r231288) @@ -64,7 +64,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" //#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/boot/kernel/kernel.gz.tramp" @@ -160,7 +161,8 @@ main(void) autoboot = 1; /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: stable/8/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/arm/ixp425/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/arm/ixp425/boot2/boot2.c Thu Feb 9 16:54:06 2012 (r231288) @@ -62,7 +62,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_KERNEL "/boot/kernel/kernel" extern uint32_t _end; @@ -168,7 +169,8 @@ main(void) autoboot = 1; /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: stable/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/i386/boot2/boot2.c Thu Feb 9 16:54:06 2012 (r231288) @@ -74,7 +74,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -238,7 +239,8 @@ main(void) autoboot = 1; - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: stable/8/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- stable/8/sys/boot/i386/gptboot/gptboot.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/i386/gptboot/gptboot.c Thu Feb 9 16:54:06 2012 (r231288) @@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$"); #include "cons.h" #include "gpt.h" -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -163,8 +164,8 @@ main(void) for (;;) { *kname = '\0'; - ino = lookup(PATH_CONFIG); - if (ino > 0) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd != '\0') { Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Thu Feb 9 16:54:06 2012 (r231288) @@ -45,7 +45,8 @@ __FBSDID("$FreeBSD$"); /* Hint to loader that we came from ZFS */ #define KARGS_FLAGS_ZFS 0x4 -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -528,7 +529,8 @@ main(void) zfs_mount_pool(spa); - if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0) { + if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0 || + zfs_lookup(spa, PATH_DOTCONFIG, &dn) == 0) { off = 0; zfs_read(spa, &dn, &off, cmd, sizeof(cmd)); } Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Thu Feb 9 16:53:51 2012 (r231287) +++ stable/8/sys/boot/pc98/boot2/boot2.c Thu Feb 9 16:54:06 2012 (r231288) @@ -76,7 +76,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_CONFIG "/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG "/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL "/boot/kernel/kernel" @@ -376,7 +377,8 @@ main(void) autoboot = 1; - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:55:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6314106564A; Thu, 9 Feb 2012 16:55:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFBC78FC13; Thu, 9 Feb 2012 16:55: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 q19GtKlH010434; Thu, 9 Feb 2012 16:55:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GtK7H010429; Thu, 9 Feb 2012 16:55:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091655.q19GtK7H010429@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 16:55:20 +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: r231289 - in stable/9/contrib/gcclibs/libcpp: . include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:55:21 -0000 Author: ed Date: Thu Feb 9 16:55:20 2012 New Revision: 231289 URL: http://svn.freebsd.org/changeset/base/231289 Log: MFC r228474: Add support for __COUNTER__. __COUNTER__ allows one to obtain incrementing (read: unique) numbers from the C preprocesor. This is useful when implementing things like a robust implementation of CTASSERT(), which currently fails when using it more than once on a single line of code. Probably not likely to cause any breakage, but still. __COUNTER__ was also added to GCC 4.3, but since that implementation is GPLv3 licensed, I took the liberty of implementing it without looking at any upstream sources. Therefore, this version is licensed under the same license as the rest of the code; GPLv2. Modified: stable/9/contrib/gcclibs/libcpp/include/cpplib.h stable/9/contrib/gcclibs/libcpp/init.c stable/9/contrib/gcclibs/libcpp/internal.h stable/9/contrib/gcclibs/libcpp/macro.c Directory Properties: stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcclibs/libcpp/include/cpplib.h ============================================================================== --- stable/9/contrib/gcclibs/libcpp/include/cpplib.h Thu Feb 9 16:54:06 2012 (r231288) +++ stable/9/contrib/gcclibs/libcpp/include/cpplib.h Thu Feb 9 16:55:20 2012 (r231289) @@ -555,7 +555,8 @@ enum builtin_type BT_TIME, /* `__TIME__' */ BT_STDC, /* `__STDC__' */ BT_PRAGMA, /* `_Pragma' operator */ - BT_TIMESTAMP /* `__TIMESTAMP__' */ + BT_TIMESTAMP, /* `__TIMESTAMP__' */ + BT_COUNTER /* `__COUNTER__' */ }; #define CPP_HASHNODE(HNODE) ((cpp_hashnode *) (HNODE)) Modified: stable/9/contrib/gcclibs/libcpp/init.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/init.c Thu Feb 9 16:54:06 2012 (r231288) +++ stable/9/contrib/gcclibs/libcpp/init.c Thu Feb 9 16:55:20 2012 (r231289) @@ -308,6 +308,7 @@ static const struct builtin builtin_arra B("__BASE_FILE__", BT_BASE_FILE), B("__LINE__", BT_SPECLINE), B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL), + B("__COUNTER__", BT_COUNTER), /* Keep builtins not used for -traditional-cpp at the end, and update init_builtins() if any more are added. */ B("_Pragma", BT_PRAGMA), Modified: stable/9/contrib/gcclibs/libcpp/internal.h ============================================================================== --- stable/9/contrib/gcclibs/libcpp/internal.h Thu Feb 9 16:54:06 2012 (r231288) +++ stable/9/contrib/gcclibs/libcpp/internal.h Thu Feb 9 16:55:20 2012 (r231289) @@ -448,6 +448,8 @@ struct cpp_reader /* A saved list of the defined macros, for dependency checking of precompiled headers. */ struct cpp_savedstate *savedstate; + + unsigned int nextcounter; }; /* Character classes. Based on the more primitive macros in safe-ctype.h. Modified: stable/9/contrib/gcclibs/libcpp/macro.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/macro.c Thu Feb 9 16:54:06 2012 (r231288) +++ stable/9/contrib/gcclibs/libcpp/macro.c Thu Feb 9 16:55:20 2012 (r231289) @@ -262,6 +262,10 @@ _cpp_builtin_macro_text (cpp_reader *pfi else result = pfile->time; break; + + case BT_COUNTER: + number = pfile->nextcounter++; + break; } if (result == NULL) From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:55:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F5CC1065675; Thu, 9 Feb 2012 16:55:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 592738FC13; Thu, 9 Feb 2012 16:55:42 +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 q19GtgXY010504; Thu, 9 Feb 2012 16:55:42 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Gtggv010502; Thu, 9 Feb 2012 16:55:42 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091655.q19Gtggv010502@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:55:42 +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: r231290 - stable/9/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:55:42 -0000 Author: bapt Date: Thu Feb 9 16:55:41 2012 New Revision: 231290 URL: http://svn.freebsd.org/changeset/base/231290 Log: MFH r226166: Document some not-so-recently added trace points Approved by: des (mentor) Modified: stable/9/lib/libc/sys/ktrace.2 Directory Properties: stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/ktrace.2 ============================================================================== --- stable/9/lib/libc/sys/ktrace.2 Thu Feb 9 16:55:20 2012 (r231289) +++ stable/9/lib/libc/sys/ktrace.2 Thu Feb 9 16:55:41 2012 (r231290) @@ -28,7 +28,7 @@ .\" @(#)ktrace.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 13, 2008 +.Dd October 9, 2011 .Dt KTRACE 2 .Os .Sh NAME @@ -80,7 +80,7 @@ The .Fa trpoints argument specifies the trace points of interest. The defined trace points are: -.Bl -column KTRFAC_SYSCALLXXX -offset indent +.Bl -column KTRFAC_PROCCTORXXX -offset indent .It "KTRFAC_SYSCALL Trace system calls." .It "KTRFAC_SYSRET Trace return values from system calls." .It "KTRFAC_NAMEI Trace name lookup operations." @@ -88,6 +88,11 @@ The defined trace points are: generate much output). .It "KTRFAC_PSIG Trace posted signals." .It "KTRFAC_CSW Trace context switch points." +.It "KTRFAC_USER Trace application-specific events." +.It "KTRFAC_STRUCT Trace certain data structures." +.It "KTRFAC_SYSCTL Trace sysctls." +.It "KTRFAC_PROCCTOR Trace process construction." +.It "KTRFAC_PROCDTOR Trace process destruction." .It "KTRFAC_INHERIT Inherit tracing to future children." .El .Pp From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:55:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B627E10657CE; Thu, 9 Feb 2012 16:55:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F9298FC21; Thu, 9 Feb 2012 16:55:50 +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 q19Gto1R010555; Thu, 9 Feb 2012 16:55:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GtoW5010553; Thu, 9 Feb 2012 16:55:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091655.q19GtoW5010553@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:55:50 +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: r231291 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:55:50 -0000 Author: bapt Date: Thu Feb 9 16:55:50 2012 New Revision: 231291 URL: http://svn.freebsd.org/changeset/base/231291 Log: MFH r226166: Document some not-so-recently added trace points Approved by: des (mentor) Modified: stable/8/lib/libc/sys/ktrace.2 Directory Properties: stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/ktrace.2 ============================================================================== --- stable/8/lib/libc/sys/ktrace.2 Thu Feb 9 16:55:41 2012 (r231290) +++ stable/8/lib/libc/sys/ktrace.2 Thu Feb 9 16:55:50 2012 (r231291) @@ -28,7 +28,7 @@ .\" @(#)ktrace.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 13, 2008 +.Dd October 9, 2011 .Dt KTRACE 2 .Os .Sh NAME @@ -80,7 +80,7 @@ The .Fa trpoints argument specifies the trace points of interest. The defined trace points are: -.Bl -column KTRFAC_SYSCALLXXX -offset indent +.Bl -column KTRFAC_PROCCTORXXX -offset indent .It "KTRFAC_SYSCALL Trace system calls." .It "KTRFAC_SYSRET Trace return values from system calls." .It "KTRFAC_NAMEI Trace name lookup operations." @@ -88,6 +88,11 @@ The defined trace points are: generate much output). .It "KTRFAC_PSIG Trace posted signals." .It "KTRFAC_CSW Trace context switch points." +.It "KTRFAC_USER Trace application-specific events." +.It "KTRFAC_STRUCT Trace certain data structures." +.It "KTRFAC_SYSCTL Trace sysctls." +.It "KTRFAC_PROCCTOR Trace process construction." +.It "KTRFAC_PROCDTOR Trace process destruction." .It "KTRFAC_INHERIT Inherit tracing to future children." .El .Pp From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:57:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B059106564A; Thu, 9 Feb 2012 16:57:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A6318FC0C; Thu, 9 Feb 2012 16:57: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 q19GvMnU010830; Thu, 9 Feb 2012 16:57:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GvMgq010827; Thu, 9 Feb 2012 16:57:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091657.q19GvMgq010827@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:57:22 +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: r231292 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:57:22 -0000 Author: bapt Date: Thu Feb 9 16:57:21 2012 New Revision: 231292 URL: http://svn.freebsd.org/changeset/base/231292 Log: MFH r226119: Mention tdsignal(9) Approved by: des (mentor) Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/psignal.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Thu Feb 9 16:55:50 2012 (r231291) +++ stable/9/share/man/man9/Makefile Thu Feb 9 16:57:21 2012 (r231292) @@ -1004,7 +1004,8 @@ MLINKS+=printf.9 log.9 \ MLINKS+=priv.9 priv_check.9 \ priv.9 priv_check_cred.9 MLINKS+=psignal.9 gsignal.9 \ - psignal.9 pgsignal.9 + psignal.9 pgsignal.9 \ + psignal.9 tdsignal.9 MLINKS+=random.9 arc4rand.9 \ random.9 arc4random.9 \ random.9 read_random.9 \ Modified: stable/9/share/man/man9/psignal.9 ============================================================================== --- stable/9/share/man/man9/psignal.9 Thu Feb 9 16:55:50 2012 (r231291) +++ stable/9/share/man/man9/psignal.9 Thu Feb 9 16:57:21 2012 (r231292) @@ -28,14 +28,15 @@ .\" $NetBSD: psignal.9,v 1.1 1996/06/22 22:57:35 pk Exp $ .\" $FreeBSD$ .\" -.Dd June 22, 1996 +.Dd October 8, 2011 .Dt PSIGNAL 9 .Os .Sh NAME .Nm psignal , .Nm pgsignal , -.Nm gsignal -.Nd post signal to a process or process group +.Nm gsignal , +.Nm tdsignal +.Nd post signal to a thread, process, or process group .Sh SYNOPSIS .In sys/types.h .In sys/signalvar.h @@ -45,8 +46,10 @@ .Fn pgsignal "struct pgrp *pgrp" "int signum" "int checkctty" .Ft void .Fn gsignal "int pgid" "int signum" +.Ft void +.Fn tdsignal "struct thread *td" "int signum" .Sh DESCRIPTION -These functions post a signal to one or more processes. +These functions post a signal to a thread or one or more processes. The argument .Fa signum common to all three functions should be in the range @@ -135,6 +138,13 @@ set to zero. If .Fa pgid is zero no action is taken. +.Pp +The +.Fn tdsignal +function posts signal number +.Fa signum +to the thread represented by the thread structure +.Fa td . .Sh SEE ALSO .Xr sigaction 2 , .Xr signal 9 , From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:57:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC29A106567E; Thu, 9 Feb 2012 16:57:34 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A684E8FC15; Thu, 9 Feb 2012 16:57:34 +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 q19GvYfF010888; Thu, 9 Feb 2012 16:57:34 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19GvY2t010885; Thu, 9 Feb 2012 16:57:34 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201202091657.q19GvY2t010885@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 9 Feb 2012 16:57:34 +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: r231293 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:57:35 -0000 Author: bapt Date: Thu Feb 9 16:57:34 2012 New Revision: 231293 URL: http://svn.freebsd.org/changeset/base/231293 Log: MFH r226119: Mention tdsignal(9) Approved by: des (mentor) Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/psignal.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Thu Feb 9 16:57:21 2012 (r231292) +++ stable/8/share/man/man9/Makefile Thu Feb 9 16:57:34 2012 (r231293) @@ -970,7 +970,8 @@ MLINKS+=printf.9 log.9 \ MLINKS+=priv.9 priv_check.9 \ priv.9 priv_check_cred.9 MLINKS+=psignal.9 gsignal.9 \ - psignal.9 pgsignal.9 + psignal.9 pgsignal.9 \ + psignal.9 tdsignal.9 MLINKS+=random.9 arc4rand.9 \ random.9 arc4random.9 \ random.9 read_random.9 \ Modified: stable/8/share/man/man9/psignal.9 ============================================================================== --- stable/8/share/man/man9/psignal.9 Thu Feb 9 16:57:21 2012 (r231292) +++ stable/8/share/man/man9/psignal.9 Thu Feb 9 16:57:34 2012 (r231293) @@ -35,14 +35,15 @@ .\" $NetBSD: psignal.9,v 1.1 1996/06/22 22:57:35 pk Exp $ .\" $FreeBSD$ .\" -.Dd June 22, 1996 +.Dd October 8, 2011 .Dt PSIGNAL 9 .Os .Sh NAME .Nm psignal , .Nm pgsignal , -.Nm gsignal -.Nd post signal to a process or process group +.Nm gsignal , +.Nm tdsignal +.Nd post signal to a thread, process, or process group .Sh SYNOPSIS .In sys/types.h .In sys/signalvar.h @@ -52,8 +53,10 @@ .Fn pgsignal "struct pgrp *pgrp" "int signum" "int checkctty" .Ft void .Fn gsignal "int pgid" "int signum" +.Ft void +.Fn tdsignal "struct thread *td" "int signum" .Sh DESCRIPTION -These functions post a signal to one or more processes. +These functions post a signal to a thread or one or more processes. The argument .Fa signum common to all three functions should be in the range @@ -142,6 +145,13 @@ set to zero. If .Fa pgid is zero no action is taken. +.Pp +The +.Fn tdsignal +function posts signal number +.Fa signum +to the thread represented by the thread structure +.Fa td . .Sh SEE ALSO .Xr sigaction 2 , .Xr signal 9 , From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 16:58:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D28BC1065672; Thu, 9 Feb 2012 16:58:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B11618FC19; Thu, 9 Feb 2012 16: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 q19Gw6B5010991; Thu, 9 Feb 2012 16:58:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Gw68A010985; Thu, 9 Feb 2012 16:58:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202091658.q19Gw68A010985@svn.freebsd.org> From: Ed Schouten Date: Thu, 9 Feb 2012 16:58:06 +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: r231294 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 16:58:07 -0000 Author: ed Date: Thu Feb 9 16:58:06 2012 New Revision: 231294 URL: http://svn.freebsd.org/changeset/base/231294 Log: MFC r230330: Remove remnants of dev_t. These functions take a `struct cdev *' -- not a dev_t. Inside the kernel, dev_t has the same use as in userspace, namely to store a device identifier. Modified: stable/9/share/man/man9/DEV_MODULE.9 stable/9/share/man/man9/devtoname.9 stable/9/share/man/man9/physio.9 stable/9/share/man/man9/uio.9 stable/9/share/man/man9/vcount.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/DEV_MODULE.9 ============================================================================== --- stable/9/share/man/man9/DEV_MODULE.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/DEV_MODULE.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2001 +.Dd January 19, 2012 .Dt DEV_MODULE 9 .Os .Sh NAME @@ -68,7 +68,7 @@ on load and to destroy it when it is unl static struct cdevsw foo_devsw = { ... }; -static dev_t sdev; +static struct cdev *sdev; static int foo_load(module_t mod, int cmd, void *arg) Modified: stable/9/share/man/man9/devtoname.9 ============================================================================== --- stable/9/share/man/man9/devtoname.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/devtoname.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -24,17 +24,17 @@ .\" .\" $FreeBSD$ .\" -.Dd September 25, 1999 +.Dd January 19, 2012 .Dt DEVTONAME 9 .Os .Sh NAME .Nm devtoname -.Nd "converts dev_t data into a string indicating the device name" +.Nd "converts character device into a string indicating the device name" .Sh SYNOPSIS .In sys/param.h .In sys/conf.h .Ft const char * -.Fn devtoname "dev_t dev" +.Fn devtoname "struct cdev *dev" .Sh DESCRIPTION The .Fn devtoname Modified: stable/9/share/man/man9/physio.9 ============================================================================== --- stable/9/share/man/man9/physio.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/physio.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2004 +.Dd January 19, 2012 .Dt PHYSIO 9 .Os .Sh NAME @@ -41,7 +41,7 @@ .In sys/bio.h .In sys/buf.h .Ft int -.Fn physio "dev_t dev" "struct uio *uio" "int ioflag" +.Fn physio "struct cdev *dev" "struct uio *uio" "int ioflag" .Sh DESCRIPTION The .Fn physio Modified: stable/9/share/man/man9/uio.9 ============================================================================== --- stable/9/share/man/man9/uio.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/uio.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2011 +.Dd January 19, 2012 .Dt UIO 9 .Os .Sh NAME @@ -154,7 +154,7 @@ static char buffer[BUFSIZE]; static int data_available; /* amount of data that can be read */ static int -fooread(dev_t dev, struct uio *uio, int flag) +fooread(struct cdev *dev, struct uio *uio, int flag) { int rv, amnt; Modified: stable/9/share/man/man9/vcount.9 ============================================================================== --- stable/9/share/man/man9/vcount.9 Thu Feb 9 16:57:34 2012 (r231293) +++ stable/9/share/man/man9/vcount.9 Thu Feb 9 16:58:06 2012 (r231294) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2001 +.Dd January 19, 2012 .Dt VCOUNT 9 .Os .Sh NAME @@ -47,7 +47,7 @@ .Ft int .Fn vcount "struct vnode *vp" .Ft int -.Fn count_dev "dev_t dev" +.Fn count_dev "struct cdev *dev" .Sh DESCRIPTION .Fn vcount is used to get the number of references to a particular device. @@ -56,7 +56,7 @@ It allows for the fact that multiple vno does the same thing as .Fn vcount , but takes a -.Vt dev_t +.Vt "struct cdev" rather than a .Vt "struct vnode" pointer as an argument. From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 17:38:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41842106566B; Thu, 9 Feb 2012 17:38:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 118FF8FC12; Thu, 9 Feb 2012 17:38: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 q19Hc8RA015087; Thu, 9 Feb 2012 17:38:08 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Hc8Iv015085; Thu, 9 Feb 2012 17:38:08 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202091738.q19Hc8Iv015085@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 9 Feb 2012 17:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231295 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 17:38:09 -0000 Author: jkim Date: Thu Feb 9 17:38:08 2012 New Revision: 231295 URL: http://svn.freebsd.org/changeset/base/231295 Log: Refine r231226. Swap timecounters before suspending any device drivers. Modified: head/sys/dev/acpica/acpi_timer.c Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Thu Feb 9 16:58:06 2012 (r231294) +++ head/sys/dev/acpica/acpi_timer.c Thu Feb 9 17:38:08 2012 (r231295) @@ -68,8 +68,8 @@ static u_int acpi_timer_frequency = 1431 static void acpi_timer_identify(driver_t *driver, device_t parent); static int acpi_timer_probe(device_t dev); static int acpi_timer_attach(device_t dev); -static int acpi_timer_suspend(device_t); static void acpi_timer_resume_handler(struct timecounter *); +static void acpi_timer_suspend_handler(struct timecounter *); static u_int acpi_timer_get_timecount(struct timecounter *tc); static u_int acpi_timer_get_timecount_safe(struct timecounter *tc); static int acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS); @@ -81,7 +81,6 @@ static device_method_t acpi_timer_method DEVMETHOD(device_identify, acpi_timer_identify), DEVMETHOD(device_probe, acpi_timer_probe), DEVMETHOD(device_attach, acpi_timer_attach), - DEVMETHOD(device_suspend, acpi_timer_suspend), {0, 0} }; @@ -249,6 +248,12 @@ acpi_timer_attach(device_t dev) return (ENXIO); acpi_timer_bsh = rman_get_bushandle(acpi_timer_reg); acpi_timer_bst = rman_get_bustag(acpi_timer_reg); + + /* Register suspend event handler. */ + if (EVENTHANDLER_REGISTER(power_suspend, acpi_timer_suspend_handler, + &acpi_timer_timecounter, EVENTHANDLER_PRI_LAST) == NULL) + device_printf(dev, "failed to register suspend event handler\n"); + return (0); } @@ -269,22 +274,25 @@ acpi_timer_resume_handler(struct timecou } } -static int -acpi_timer_suspend(device_t dev) +static void +acpi_timer_suspend_handler(struct timecounter *newtc) { - struct timecounter *newtc, *tc; - int error; + struct timecounter *tc; - error = bus_generic_suspend(dev); + /* Deregister existing resume event handler. */ if (acpi_timer_eh != NULL) { EVENTHANDLER_DEREGISTER(power_resume, acpi_timer_eh); acpi_timer_eh = NULL; } + + KASSERT(newtc == &acpi_timer_timecounter, + ("acpi_timer_suspend_handler: wrong timecounter")); + tc = timecounter; - newtc = &acpi_timer_timecounter; if (tc != newtc) { if (bootverbose) - device_printf(dev, "switching timecounter, %s -> %s\n", + device_printf(acpi_timer_dev, + "switching timecounter, %s -> %s\n", tc->tc_name, newtc->tc_name); (void)acpi_timer_read(); (void)acpi_timer_read(); @@ -292,7 +300,6 @@ acpi_timer_suspend(device_t dev) acpi_timer_eh = EVENTHANDLER_REGISTER(power_resume, acpi_timer_resume_handler, tc, EVENTHANDLER_PRI_LAST); } - return (error); } /* From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 17:50:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F63C106566B; Thu, 9 Feb 2012 17:50:25 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1808D8FC17; Thu, 9 Feb 2012 17:50: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 q19HoPNS016159; Thu, 9 Feb 2012 17:50:25 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19HoO0D016145; Thu, 9 Feb 2012 17:50:24 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201202091750.q19HoO0D016145@svn.freebsd.org> From: Jim Harris Date: Thu, 9 Feb 2012 17:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231296 - in head/sys: dev/isci dev/isci/scil modules/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 17:50:25 -0000 Author: jimharris Date: Thu Feb 9 17:50:24 2012 New Revision: 231296 URL: http://svn.freebsd.org/changeset/base/231296 Log: Remove explicit CC assignment in isci(4) Makefile to allow for building with clang. Also fix a number of warnings uncovered when building with clang around some implicit enum conversions. Sponsored by: Intel Approved by: scottl Modified: head/sys/dev/isci/isci.h head/sys/dev/isci/isci_io_request.c head/sys/dev/isci/isci_remote_device.c head/sys/dev/isci/scil/sati_abort_task_set.c head/sys/dev/isci/scil/scic_sds_controller.c head/sys/dev/isci/scil/scif_sas_controller.c head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c head/sys/dev/isci/scil/scif_sas_io_request.c head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c head/sys/dev/isci/scil/scif_sas_smp_remote_device.c head/sys/dev/isci/scil/scif_sas_stp_io_request.c head/sys/dev/isci/scil/scif_sas_stp_task_request.c head/sys/modules/isci/Makefile Modified: head/sys/dev/isci/isci.h ============================================================================== --- head/sys/dev/isci/isci.h Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/isci.h Thu Feb 9 17:50:24 2012 (r231296) @@ -160,7 +160,6 @@ struct ISCI_REQUEST struct ISCI_IO_REQUEST { struct ISCI_REQUEST parent; - SCI_STATUS status; SCI_IO_REQUEST_HANDLE_T sci_object; union ccb *ccb; uint32_t num_segments; Modified: head/sys/dev/isci/isci_io_request.c ============================================================================== --- head/sys/dev/isci/isci_io_request.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/isci_io_request.c Thu Feb 9 17:50:24 2012 (r231296) @@ -626,16 +626,16 @@ isci_io_request_construct(void *arg, bus return; } - io_request->status = scif_io_request_construct( + status = scif_io_request_construct( io_request->parent.controller_handle, io_request->parent.remote_device_handle, SCI_CONTROLLER_INVALID_IO_TAG, (void *)io_request, (void *)((char*)io_request + sizeof(struct ISCI_IO_REQUEST)), &io_request->sci_object); - if (io_request->status != SCI_SUCCESS) { + if (status != SCI_SUCCESS) { isci_io_request_complete(io_request->parent.controller_handle, - device, io_request, io_request->status); + device, io_request, (SCI_IO_STATUS)status); return; } @@ -650,7 +650,7 @@ isci_io_request_construct(void *arg, bus if (status != SCI_SUCCESS) { isci_io_request_complete(io_request->parent.controller_handle, - device, io_request, status); + device, io_request, (SCI_IO_STATUS)status); return; } @@ -900,7 +900,7 @@ isci_io_request_execute_smp_io(union ccb if (status != SCI_SUCCESS) { isci_io_request_complete(controller->scif_controller_handle, - smp_device_handle, io_request, status); + smp_device_handle, io_request, (SCI_IO_STATUS)status); return; } @@ -912,7 +912,7 @@ isci_io_request_execute_smp_io(union ccb if (status != SCI_SUCCESS) { isci_io_request_complete(controller->scif_controller_handle, - smp_device_handle, io_request, status); + smp_device_handle, io_request, (SCI_IO_STATUS)status); return; } Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/isci_remote_device.c Thu Feb 9 17:50:24 2012 (r231296) @@ -195,7 +195,7 @@ isci_remote_device_reset(struct ISCI_REM if (status != SCI_SUCCESS) { isci_task_request_complete(controller->scif_controller_handle, remote_device->sci_object, task_request->sci_object, - status); + (SCI_TASK_STATUS)status); return; } @@ -207,7 +207,7 @@ isci_remote_device_reset(struct ISCI_REM isci_task_request_complete( controller->scif_controller_handle, remote_device->sci_object, task_request->sci_object, - status); + (SCI_TASK_STATUS)status); return; } } Modified: head/sys/dev/isci/scil/sati_abort_task_set.c ============================================================================== --- head/sys/dev/isci/scil/sati_abort_task_set.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/sati_abort_task_set.c Thu Feb 9 17:50:24 2012 (r231296) @@ -124,8 +124,8 @@ SATI_STATUS sati_abort_task_set_translat for (tag_index = 0; tag_index < 32; tag_index++) { - void * matching_command; - SCI_STATUS completion_status; + void * matching_command; + SCI_IO_STATUS completion_status; sati_cb_device_get_request_by_ncq_tag( scsi_task, tag_index, @@ -141,7 +141,7 @@ SATI_STATUS sati_abort_task_set_translat ) { sati_translate_error(sequence, matching_command, log->error); - completion_status = SCI_FAILURE_IO_RESPONSE_VALID; + completion_status = SCI_IO_FAILURE_RESPONSE_VALID; if(sequence->state == SATI_SEQUENCE_STATE_READ_ERROR) { @@ -159,7 +159,7 @@ SATI_STATUS sati_abort_task_set_translat } else { - completion_status = SCI_FAILURE_IO_TERMINATED; + completion_status = SCI_IO_FAILURE_TERMINATED; } sati_cb_io_request_complete(matching_command, completion_status); Modified: head/sys/dev/isci/scil/scic_sds_controller.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_controller.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scic_sds_controller.c Thu Feb 9 17:50:24 2012 (r231296) @@ -4165,7 +4165,7 @@ SCI_IO_STATUS scic_controller_start_io( U16 io_tag ) { - SCI_IO_STATUS status; + SCI_STATUS status; SCIC_SDS_CONTROLLER_T *this_controller; this_controller = (SCIC_SDS_CONTROLLER_T *)controller; @@ -4183,7 +4183,7 @@ SCI_IO_STATUS scic_controller_start_io( io_tag ); - return status; + return (SCI_IO_STATUS)status; } // --------------------------------------------------------------------------- @@ -4253,7 +4253,7 @@ SCI_TASK_STATUS scic_controller_start_ta U16 task_tag ) { - SCI_TASK_STATUS status = SCI_FAILURE_INVALID_STATE; + SCI_STATUS status = SCI_FAILURE_INVALID_STATE; SCIC_SDS_CONTROLLER_T *this_controller; this_controller = (SCIC_SDS_CONTROLLER_T *)controller; @@ -4282,7 +4282,7 @@ SCI_TASK_STATUS scic_controller_start_ta )); } - return status; + return (SCI_TASK_STATUS)status; } // --------------------------------------------------------------------------- Modified: head/sys/dev/isci/scil/scif_sas_controller.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_controller.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_controller.c Thu Feb 9 17:50:24 2012 (r231296) @@ -271,6 +271,7 @@ SCI_IO_STATUS scif_controller_start_io( ) { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + SCI_STATUS status; SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), @@ -284,7 +285,7 @@ SCI_IO_STATUS scif_controller_start_io( || scif_sas_controller_sufficient_resource(controller) ) { - return fw_controller->state_handlers->start_io_handler( + status = fw_controller->state_handlers->start_io_handler( (SCI_BASE_CONTROLLER_T*) controller, (SCI_BASE_REMOTE_DEVICE_T*) remote_device, (SCI_BASE_REQUEST_T*) io_request, @@ -292,7 +293,9 @@ SCI_IO_STATUS scif_controller_start_io( ); } else - return SCI_FAILURE_INSUFFICIENT_RESOURCES; + status = SCI_FAILURE_INSUFFICIENT_RESOURCES; + + return (SCI_IO_STATUS)status; } // --------------------------------------------------------------------------- @@ -305,13 +308,14 @@ SCI_TASK_STATUS scif_controller_start_ta ) { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + SCI_STATUS status; // Validate the user supplied parameters. if ( (controller == SCI_INVALID_HANDLE) || (remote_device == SCI_INVALID_HANDLE) || (task_request == SCI_INVALID_HANDLE) ) { - return SCI_FAILURE_INVALID_PARAMETER_VALUE; + return SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE; } SCIF_LOG_TRACE(( @@ -323,7 +327,7 @@ SCI_TASK_STATUS scif_controller_start_ta if (scif_sas_controller_sufficient_resource(controller)) { - return fw_controller->state_handlers->start_task_handler( + status = fw_controller->state_handlers->start_task_handler( (SCI_BASE_CONTROLLER_T*) controller, (SCI_BASE_REMOTE_DEVICE_T*) remote_device, (SCI_BASE_REQUEST_T*) task_request, @@ -331,7 +335,9 @@ SCI_TASK_STATUS scif_controller_start_ta ); } else - return SCI_FAILURE_INSUFFICIENT_RESOURCES; + status = SCI_FAILURE_INSUFFICIENT_RESOURCES; + + return (SCI_TASK_STATUS)status; } // --------------------------------------------------------------------------- Modified: head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c Thu Feb 9 17:50:24 2012 (r231296) @@ -586,7 +586,7 @@ SCI_STATUS scif_sas_controller_ready_sta if (status == SCI_SUCCESS) { // Ask the core to start processing for this IO request. - status = scic_controller_start_io( + status = (SCI_STATUS)scic_controller_start_io( fw_controller->core_object, fw_device->core_object, fw_io->parent.core_object, @@ -903,7 +903,7 @@ SCI_STATUS scif_sas_controller_ready_sta } // Ask the core to start processing for this task request. - status = scic_controller_start_task( + status = (SCI_STATUS)scic_controller_start_task( fw_controller->core_object, fw_device->core_object, fw_task->parent.core_object, @@ -1072,7 +1072,7 @@ SCI_STATUS scif_sas_controller_common_st if (status == SCI_SUCCESS) { // Ask the core to start processing for this IO request. - status = scic_controller_start_io( + status = (SCI_STATUS)scic_controller_start_io( fw_controller->core_object, fw_device->core_object, fw_io->parent.core_object, @@ -1683,7 +1683,7 @@ SCI_STATUS scif_sas_controller_failed_st &((SCIF_SAS_CONTROLLER_T *)controller)->parent.state_machine) )); - return SCI_IO_FAILURE; + return SCI_FAILURE; } #define scif_sas_controller_stopping_complete_io_handler \ Modified: head/sys/dev/isci/scil/scif_sas_io_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_io_request.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_io_request.c Thu Feb 9 17:50:24 2012 (r231296) @@ -811,7 +811,7 @@ SCI_STATUS scif_sas_io_request_continue( ); //start the new constructed IO. - return scif_controller_start_io( + return (SCI_STATUS)scif_controller_start_io( (SCI_CONTROLLER_HANDLE_T) fw_controller, (SCI_REMOTE_DEVICE_HANDLE_T) fw_device, (SCI_IO_REQUEST_HANDLE_T) fw_request, Modified: head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c Thu Feb 9 17:50:24 2012 (r231296) @@ -255,7 +255,7 @@ void scif_sas_remote_device_ready_ncq_er } } - status = scif_controller_start_task( + scif_controller_start_task( fw_controller, fw_device, fw_request, Modified: head/sys/dev/isci/scil/scif_sas_smp_remote_device.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Thu Feb 9 17:50:24 2012 (r231296) @@ -1853,7 +1853,7 @@ void scif_sas_smp_remote_device_terminat )); scif_sas_smp_remote_device_decode_smp_response( - fw_device, fw_request, NULL, SCI_FAILURE_RETRY_REQUIRED + fw_device, fw_request, NULL, SCI_IO_FAILURE_RETRY_REQUIRED ); } Modified: head/sys/dev/isci/scil/scif_sas_stp_io_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_stp_io_request.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_stp_io_request.c Thu Feb 9 17:50:24 2012 (r231296) @@ -396,7 +396,7 @@ SCI_STATUS scif_sas_stp_io_request_const fw_io->parent.protocol_complete_handler = scif_sas_stp_core_cb_io_request_complete_handler; // Done with translation - sci_status = SATI_SUCCESS; + sci_status = SCI_SUCCESS; } else if (sati_status == SATI_COMPLETE) sci_status = SCI_SUCCESS_IO_COMPLETE_BEFORE_START; Modified: head/sys/dev/isci/scil/scif_sas_stp_task_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_stp_task_request.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_stp_task_request.c Thu Feb 9 17:50:24 2012 (r231296) @@ -254,7 +254,7 @@ void scif_sas_stp_task_request_abort_tas fw_domain->controller, fw_device, pending_request, - SCI_FAILURE_IO_TERMINATED + SCI_IO_FAILURE_TERMINATED ); } //otherwise, the abort succeeded. Since the waiting flag is cleared, Modified: head/sys/modules/isci/Makefile ============================================================================== --- head/sys/modules/isci/Makefile Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/modules/isci/Makefile Thu Feb 9 17:50:24 2012 (r231296) @@ -87,6 +87,4 @@ SRCS += \ SRCS += opt_scsi.h opt_cam.h opt_isci.h SRCS += device_if.h bus_if.h pci_if.h -CC = gcc - .include From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 19:13:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76A65106566B; Thu, 9 Feb 2012 19:13:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 637668FC0C; Thu, 9 Feb 2012 19:13:37 +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 q19JDb9H018897; Thu, 9 Feb 2012 19:13:37 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19JDaKF018882; Thu, 9 Feb 2012 19:13:36 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202091913.q19JDaKF018882@svn.freebsd.org> From: Martin Matuska Date: Thu, 9 Feb 2012 19:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231297 - in vendor/libarchive/dist: cpio/test libarchive libarchive/test tar/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 19:13:37 -0000 Author: mm Date: Thu Feb 9 19:13:36 2012 New Revision: 231297 URL: http://svn.freebsd.org/changeset/base/231297 Log: Update libarchive's vendor dist to latest changes in release branch. Now all the gcc warnings I have reported upstream should be fixed. Git branch: release Git commit: 01580b4298a946fb31e822a083bf49e9f37809ac Obtained from: https://github.com/libarchive/libarchive.git Modified: vendor/libarchive/dist/cpio/test/main.c vendor/libarchive/dist/libarchive/archive_rb.c vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_string.c vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/test/main.c vendor/libarchive/dist/libarchive/test/test_acl_pax.c vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c vendor/libarchive/dist/libarchive/test/test_sparse_basic.c vendor/libarchive/dist/tar/test/main.c Modified: vendor/libarchive/dist/cpio/test/main.c ============================================================================== --- vendor/libarchive/dist/cpio/test/main.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/cpio/test/main.c Thu Feb 9 19:13:36 2012 (r231297) @@ -1316,7 +1316,7 @@ assertion_file_nlinks(const char *file, assertion_count(file, line); r = lstat(pathname, &st); - if (r == 0 && st.st_nlink == nlinks) + if (r == 0 && (int)st.st_nlink == nlinks) return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); @@ -1380,7 +1380,7 @@ assertion_is_dir(const char *file, int l /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "Dir %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); @@ -1413,7 +1413,7 @@ assertion_is_reg(const char *file, int l /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "File %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); Modified: vendor/libarchive/dist/libarchive/archive_rb.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_rb.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/archive_rb.c Thu Feb 9 19:13:36 2012 (r231297) @@ -96,7 +96,7 @@ __archive_rb_tree_init(struct archive_rb const struct archive_rb_tree_ops *ops) { rbt->rbt_ops = ops; - *((const struct archive_rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE; + *((struct archive_rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE; } struct archive_rb_node * @@ -683,7 +683,7 @@ __archive_rb_tree_iterate(struct archive */ if (RB_SENTINEL_P(self->rb_nodes[direction])) { while (!RB_ROOT_P(rbt, self)) { - if (other == RB_POSITION(self)) + if (other == (unsigned int)RB_POSITION(self)) return RB_FATHER(self); self = RB_FATHER(self); } Modified: vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Thu Feb 9 19:13:36 2012 (r231297) @@ -191,7 +191,7 @@ archive_read_disk_entry_from_file(struct fd = open(path, O_RDONLY | O_NONBLOCK); if (fd >= 0) { unsigned long stflags; - int r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags); + r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags); if (r == 0 && stflags != 0) archive_entry_set_fflags(entry, stflags, 0); } @@ -870,12 +870,12 @@ setup_sparse(struct archive_read_disk *a if (fm->fm_mapped_extents == 0) break; fe = fm->fm_extents; - for (i = 0; i < fm->fm_mapped_extents; i++, fe++) { + for (i = 0; i < (int)fm->fm_mapped_extents; i++, fe++) { if (!(fe->fe_flags & FIEMAP_EXTENT_UNWRITTEN)) { /* The fe_length of the last block does not * adjust itself to its size files. */ int64_t length = fe->fe_length; - if (fe->fe_logical + length > size) + if (fe->fe_logical + length > (uint64_t)size) length -= fe->fe_logical + length - size; if (fe->fe_logical == 0 && length == size) { /* This is not sparse. */ Modified: vendor/libarchive/dist/libarchive/archive_read_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/archive_read_disk_posix.c Thu Feb 9 19:13:36 2012 (r231297) @@ -2214,7 +2214,8 @@ tree_target_is_same_as_parent(struct tre struct tree_entry *te; for (te = t->current->parent; te != NULL; te = te->parent) { - if (te->dev == st->st_dev && te->ino == st->st_ino) + if (te->dev == (int64_t)st->st_dev && + te->ino == (int64_t)st->st_ino) return (1); } return (0); @@ -2231,7 +2232,8 @@ tree_current_is_symblic_link_target(stru lst = tree_current_lstat(t); st = tree_current_stat(t); - return (st != NULL && st->st_dev == t->current_filesystem->dev && + return (st != NULL && + (int64_t)st->st_dev == t->current_filesystem->dev && st->st_dev != lst->st_dev); } Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Thu Feb 9 19:13:36 2012 (r231297) @@ -305,7 +305,7 @@ static int archive_read_format_rar_clean /* Support functions */ static int read_header(struct archive_read *, struct archive_entry *, char); -static time_t get_time(int time); +static time_t get_time(int); static int read_exttime(const char *, struct rar *, const char *); static int read_symlink_stored(struct archive_read *, struct archive_entry *, struct archive_string_conv *); @@ -1047,7 +1047,7 @@ read_header(struct archive_read *a, stru memcpy(&rar_header, p, sizeof(rar_header)); rar->file_flags = archive_le16dec(rar_header.flags); header_size = archive_le16dec(rar_header.size); - if (header_size < sizeof(file_header) + 7) { + if (header_size < (int64_t)sizeof(file_header) + 7) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Invalid header size"); return (ARCHIVE_FATAL); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Thu Feb 9 19:13:36 2012 (r231297) @@ -265,7 +265,7 @@ archive_read_format_zip_seekable_bid(str if (zip->central_directory_entries != archive_le16dec(p + 8)) return 0; /* Central directory can't extend beyond end of this file. */ - if (zip->central_directory_offset + zip->central_directory_size > filesize) + if (zip->central_directory_offset + (int64_t)zip->central_directory_size > filesize) return 0; /* This is just a tiny bit higher than the maximum returned by Modified: vendor/libarchive/dist/libarchive/archive_string.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_string.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/archive_string.c Thu Feb 9 19:13:36 2012 (r231297) @@ -1646,7 +1646,7 @@ make_codepage_from_charset(const char *c * Return ANSI Code Page of current locale set by setlocale(). */ static unsigned -get_current_codepage() +get_current_codepage(void) { char *locale, *p; unsigned cp; @@ -1721,7 +1721,7 @@ static struct { * Return OEM Code Page of current locale set by setlocale(). */ static unsigned -get_current_oemcp() +get_current_oemcp(void) { int i; char *locale, *p; @@ -1750,7 +1750,7 @@ get_current_oemcp() */ static unsigned -get_current_codepage() +get_current_codepage(void) { return (-1);/* Unknown */ } @@ -1761,7 +1761,7 @@ make_codepage_from_charset(const char *c return (-1);/* Unknown */ } static unsigned -get_current_oemcp() +get_current_oemcp(void) { return (-1);/* Unknown */ } Modified: vendor/libarchive/dist/libarchive/archive_write_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Thu Feb 9 19:13:36 2012 (r231297) @@ -1672,7 +1672,7 @@ cleanup_pathname_win(struct archive_writ p = a->name; while (*p != '\0' && alen) { l = mbtowc(&wc, p, alen); - if (l == -1) { + if (l == (size_t)-1) { while (*p != '\0') { if (*p == '\\') *p = '/'; @@ -1979,6 +1979,7 @@ set_time(int fd, int mode, const char *n * on fds and symlinks. */ struct timespec ts[2]; + (void)mode; /* UNUSED */ ts[0].tv_sec = atime; ts[0].tv_nsec = atime_nsec; ts[1].tv_sec = mtime; @@ -2036,6 +2037,11 @@ set_time(int fd, int mode, const char *n /* * We don't know how to set the time on this platform. */ + (void)fd; /* UNUSED */ + (void)mode; /* UNUSED */ + (void)name; /* UNUSED */ + (void)atime_nsec; /* UNUSED */ + (void)mtime_nsec; /* UNUSED */ return (ARCHIVE_WARN); #endif } @@ -2105,6 +2111,9 @@ set_times(struct archive_write_disk *a, r1 = set_time(fd, mode, name, atime, atime_nanos, birthtime, birthtime_nanos); +#else + (void)birthtime; /* UNUSED */ + (void)birthtime_nanos; /* UNUSED */ #endif r2 = set_time(fd, mode, name, atime, atime_nanos, @@ -2537,12 +2546,12 @@ set_mac_metadata(struct archive_write_di /* Default empty function body to satisfy mainline code. */ static int set_acls(struct archive_write_disk *a, int fd, const char *name, - struct archive_acl *acl) + struct archive_acl *aacl) { (void)a; /* UNUSED */ (void)fd; /* UNUSED */ (void)name; /* UNUSED */ - (void)acl; /* UNUSED */ + (void)aacl; /* UNUSED */ return (ARCHIVE_OK); } Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Thu Feb 9 19:13:36 2012 (r231297) @@ -3689,7 +3689,7 @@ wb_set_offset(struct archive_write *a, i ext_bytes = off - iso9660->wbuff_tail; iso9660->wbuff_remaining = sizeof(iso9660->wbuff) - (iso9660->wbuff_tail - iso9660->wbuff_offset); - while (ext_bytes >= iso9660->wbuff_remaining) { + while (ext_bytes >= (int64_t)iso9660->wbuff_remaining) { if (write_null(a, (size_t)iso9660->wbuff_remaining) != ARCHIVE_OK) return (ARCHIVE_FATAL); @@ -6513,8 +6513,7 @@ isoent_traverse_tree(struct archive_writ struct idr idr; int depth; int r; - int (*genid)(struct archive_write *a, struct isoent *isoent, - struct idr *idr); + int (*genid)(struct archive_write *, struct isoent *, struct idr *); idr_init(iso9660, vdd, &idr); np = vdd->rootent; @@ -7283,7 +7282,7 @@ setup_boot_information(struct archive_wr size_t rsize; ssize_t i, rs; - if (size > sizeof(buff)) + if (size > (int64_t)sizeof(buff)) rsize = sizeof(buff); else rsize = (size_t)size; @@ -7466,7 +7465,7 @@ zisofs_detect_magic(struct archive_write int64_t entry_size; entry_size = archive_entry_size(file->entry); - if (sizeof(iso9660->zisofs.magic_buffer) > entry_size) + if ((int64_t)sizeof(iso9660->zisofs.magic_buffer) > entry_size) magic_max = entry_size; else magic_max = sizeof(iso9660->zisofs.magic_buffer); @@ -7511,7 +7510,7 @@ zisofs_detect_magic(struct archive_write ceil = (uncompressed_size + (ARCHIVE_LITERAL_LL(1) << log2_bs) -1) >> log2_bs; doff = (ceil + 1) * 4 + 16; - if (entry_size < doff) + if (entry_size < (int64_t)doff) return;/* Invalid data. */ /* Check every Block Pointer has valid value. */ Modified: vendor/libarchive/dist/libarchive/test/main.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/main.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/test/main.c Thu Feb 9 19:13:36 2012 (r231297) @@ -1314,7 +1314,7 @@ assertion_file_nlinks(const char *file, assertion_count(file, line); r = lstat(pathname, &st); - if (r == 0 && st.st_nlink == nlinks) + if (r == 0 && (int)st.st_nlink == nlinks) return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); @@ -1378,7 +1378,7 @@ assertion_is_dir(const char *file, int l /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "Dir %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); @@ -1411,7 +1411,7 @@ assertion_is_reg(const char *file, int l /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "File %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); Modified: vendor/libarchive/dist/libarchive/test/test_acl_pax.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_acl_pax.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/test/test_acl_pax.c Thu Feb 9 19:13:36 2012 (r231297) @@ -163,7 +163,7 @@ compare_acls(struct archive_entry *ae, s } } assertEqualInt(ARCHIVE_EOF, r); - assert((mode & 0777) == (archive_entry_mode(ae) & 0777)); + assert((mode_t)(mode & 0777) == (archive_entry_mode(ae) & 0777)); failure("Could not find match for ACL " "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')", acls[marker[0]].type, acls[marker[0]].permset, Modified: vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/test/test_acl_posix1e.c Thu Feb 9 19:13:36 2012 (r231297) @@ -193,7 +193,7 @@ compare_acls(struct archive_entry *ae, s } } assertEqualInt(ARCHIVE_EOF, r); - assert((mode & 0777) == (archive_entry_mode(ae) & 0777)); + assert((mode_t)(mode & 0777) == (archive_entry_mode(ae) & 0777)); failure("Could not find match for ACL " "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')", acls[marker[0]].type, acls[marker[0]].permset, Modified: vendor/libarchive/dist/libarchive/test/test_sparse_basic.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_sparse_basic.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/libarchive/test/test_sparse_basic.c Thu Feb 9 19:13:36 2012 (r231297) @@ -177,6 +177,7 @@ is_sparse_supported(const char *path) char buff[1024]; const char *testfile = "can_sparse"; + (void)path; /* UNUSED */ memset(&ut, 0, sizeof(ut)); assertEqualInt(uname(&ut), 0); p = ut.release; @@ -221,6 +222,7 @@ is_sparse_supported(const char *path) static int is_sparse_supported(const char *path) { + (void)path; /* UNUSED */ return (0); } Modified: vendor/libarchive/dist/tar/test/main.c ============================================================================== --- vendor/libarchive/dist/tar/test/main.c Thu Feb 9 17:50:24 2012 (r231296) +++ vendor/libarchive/dist/tar/test/main.c Thu Feb 9 19:13:36 2012 (r231297) @@ -1316,7 +1316,7 @@ assertion_file_nlinks(const char *file, assertion_count(file, line); r = lstat(pathname, &st); - if (r == 0 && st.st_nlink == nlinks) + if (r == 0 && (int)st.st_nlink == nlinks) return (1); failure_start(file, line, "File %s has %d links, expected %d", pathname, st.st_nlink, nlinks); @@ -1380,7 +1380,7 @@ assertion_is_dir(const char *file, int l /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "Dir %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); @@ -1413,7 +1413,7 @@ assertion_is_reg(const char *file, int l /* Windows doesn't handle permissions the same way as POSIX, * so just ignore the mode tests. */ /* TODO: Can we do better here? */ - if (mode >= 0 && mode != (st.st_mode & 07777)) { + if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) { failure_start(file, line, "File %s has wrong mode", pathname); logprintf(" Expected: 0%3o\n", mode); logprintf(" Found: 0%3o\n", st.st_mode & 07777); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 20:44:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 815251065672; Thu, 9 Feb 2012 20:44:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F3D98FC14; Thu, 9 Feb 2012 20:44: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 q19KiLg4027541; Thu, 9 Feb 2012 20:44:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19KiLUT027539; Thu, 9 Feb 2012 20:44:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202092044.q19KiLUT027539@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 20:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231298 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:44:21 -0000 Author: eadler Date: Thu Feb 9 20:44:20 2012 New Revision: 231298 URL: http://svn.freebsd.org/changeset/base/231298 Log: Make etc/Makefile more conflict resistant PR: conf/163789 Submitted by: gcooper (iXsystems) Approved by: cperciva MFC after: 3 days Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Feb 9 19:13:36 2012 (r231297) +++ head/etc/Makefile Thu Feb 9 20:44:20 2012 (r231298) @@ -7,18 +7,48 @@ SUBDIR= sendmail .endif -BIN1= auth.conf \ - crontab devd.conf devfs.conf \ - ddb.conf dhclient.conf disktab fbtab \ - ftpusers gettytab group \ - hosts hosts.allow hosts.equiv \ - inetd.conf libalias.conf login.access login.conf mac.conf motd \ - netconfig network.subr networks newsyslog.conf nsswitch.conf \ - phones profile protocols \ - rc rc.bsdextended rc.firewall rc.initdiskless \ - rc.sendmail rc.shutdown \ - rc.subr remote rpc services shells \ - sysctl.conf syslog.conf termcap.small +BIN1= auth.conf +BIN1+= crontab +BIN1+= devd.conf +BIN1+= devfs.conf +BIN1+= ddb.conf +BIN1+= dhclient.conf +BIN1+= disktab +BIN1+= fbtab +BIN1+= ftpusers +BIN1+= gettytab +BIN1+= group +BIN1+= hosts +BIN1+= hosts.allow +BIN1+= hosts.equiv +BIN1+= inetd.conf +BIN1+= libalias.conf +BIN1+= login.access +BIN1+= login.conf +BIN1+= mac.conf +BIN1+= motd +BIN1+= netconfig +BIN1+= network.subr +BIN1+= networks +BIN1+= newsyslog.conf +BIN1+= nsswitch.conf +BIN1+= phones +BIN1+= profile +BIN1+= protocols +BIN1+= rc +BIN1+= rc.bsdextended +BIN1+= rc.firewall +BIN1+= rc.initdiskless +BIN1+= rc.sendmail +BIN1+= rc.shutdown +BIN1+= rc.subr +BIN1+= remote +BIN1+= rpc +BIN1+= services +BIN1+= shells +BIN1+= sysctl.conf +BIN1+= syslog.conf +BIN1+= termcap.small .if exists(${.CURDIR}/etc.${MACHINE}/ttys) BIN1+= etc.${MACHINE}/ttys From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 20:49:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4FA9106568A; Thu, 9 Feb 2012 20:49:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3D0F8FC12; Thu, 9 Feb 2012 20:49:03 +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 q19Kn3ud028151; Thu, 9 Feb 2012 20:49:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Kn3R2028149; Thu, 9 Feb 2012 20:49:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202092049.q19Kn3R2028149@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 20:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231299 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:49:03 -0000 Author: eadler Date: Thu Feb 9 20:49:03 2012 New Revision: 231299 URL: http://svn.freebsd.org/changeset/base/231299 Log: More accurately document what happens on error. PR: docs/127908 Submitted by: Matthew D. Fuller Approved by: cperciva MFC after: 1 week Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Thu Feb 9 20:44:20 2012 (r231298) +++ head/lib/libc/gen/directory.3 Thu Feb 9 20:49:03 2012 (r231299) @@ -122,9 +122,12 @@ function returns a pointer to the next directory entry. It returns .Dv NULL -upon reaching the end of the directory or detecting an invalid -.Fn seekdir -operation. +upon reaching the end of the directory or on error. +In the event of an error, +.Va errno +may be set to any of the values documented for the +.Xr getdirentries 2 +system call. .Pp The .Fn readdir_r From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 20:51:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04AB9106566B; Thu, 9 Feb 2012 20:51:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E75838FC17; Thu, 9 Feb 2012 20:51:03 +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 q19Kp3eV028438; Thu, 9 Feb 2012 20:51:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Kp3pj028436; Thu, 9 Feb 2012 20:51:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202092051.q19Kp3pj028436@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 20:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231300 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:51:04 -0000 Author: eadler Date: Thu Feb 9 20:51:03 2012 New Revision: 231300 URL: http://svn.freebsd.org/changeset/base/231300 Log: Permit the use of relative paths for the prefix argument. Remove an unnecessary cwd from created plists when -p is specified PR: bin/145000 Submitted by: gcooper Approved by: portmgr (flo) MFC after: 1 month Modified: head/usr.sbin/pkg_install/create/perform.c Modified: head/usr.sbin/pkg_install/create/perform.c ============================================================================== --- head/usr.sbin/pkg_install/create/perform.c Thu Feb 9 20:49:03 2012 (r231299) +++ head/usr.sbin/pkg_install/create/perform.c Thu Feb 9 20:51:03 2012 (r231300) @@ -214,8 +214,12 @@ pkg_perform(char **pkgs) read_plist(&plist, pkg_in); /* Prefix should add an @cwd to the packing list */ - if (Prefix) - add_plist_top(&plist, PLIST_CWD, Prefix); + if (Prefix) { + char resolved_prefix[PATH_MAX]; + if (realpath(Prefix, resolved_prefix) != 0) + err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); + add_plist_top(&plist, PLIST_CWD, resolved_prefix); + } /* Add the origin if asked, at the top */ if (Origin) @@ -260,7 +264,9 @@ pkg_perform(char **pkgs) /* mark_plist(&plist); */ /* Now put the release specific items in */ - add_plist(&plist, PLIST_CWD, "."); + if (!Prefix) { + add_plist(&plist, PLIST_CWD, "."); + } write_file(COMMENT_FNAME, Comment); add_plist(&plist, PLIST_IGNORE, NULL); add_plist(&plist, PLIST_FILE, COMMENT_FNAME); From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 20:54:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AA53106564A; Thu, 9 Feb 2012 20:54:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 477128FC0A; Thu, 9 Feb 2012 20: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 q19Ks5tK028850; Thu, 9 Feb 2012 20:54:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Ks5jt028848; Thu, 9 Feb 2012 20:54:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092054.q19Ks5jt028848@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 20: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: r231301 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:54:05 -0000 Author: bz Date: Thu Feb 9 20:54:04 2012 New Revision: 231301 URL: http://svn.freebsd.org/changeset/base/231301 Log: MFC r229276: Remove an uneeded inpcb forward declaration and align the function declaration following to match the style in the rest of the file. Modified: stable/9/sys/netinet6/in6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6_var.h ============================================================================== --- stable/9/sys/netinet6/in6_var.h Thu Feb 9 20:51:03 2012 (r231300) +++ stable/9/sys/netinet6/in6_var.h Thu Feb 9 20:54:04 2012 (r231301) @@ -779,8 +779,7 @@ void in6_ifremloop(struct ifaddr *); void in6_ifaddloop(struct ifaddr *); int in6_is_addr_deprecated __P((struct sockaddr_in6 *)); -struct inpcb; -int in6_src_ioctl __P((u_long, caddr_t)); +int in6_src_ioctl __P((u_long, caddr_t)); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 20:54:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F30A106564A; Thu, 9 Feb 2012 20:54:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D9258FC13; Thu, 9 Feb 2012 20:54: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 q19KsE6I028905; Thu, 9 Feb 2012 20:54:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19KsEtu028903; Thu, 9 Feb 2012 20:54:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092054.q19KsEtu028903@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 20:54: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: r231302 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:54:15 -0000 Author: bz Date: Thu Feb 9 20:54:14 2012 New Revision: 231302 URL: http://svn.freebsd.org/changeset/base/231302 Log: MFC r229276: Remove an uneeded inpcb forward declaration and align the function declaration following to match the style in the rest of the file. Modified: stable/8/sys/netinet6/in6_var.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6_var.h ============================================================================== --- stable/8/sys/netinet6/in6_var.h Thu Feb 9 20:54:04 2012 (r231301) +++ stable/8/sys/netinet6/in6_var.h Thu Feb 9 20:54:14 2012 (r231302) @@ -779,8 +779,7 @@ void in6_ifremloop(struct ifaddr *); void in6_ifaddloop(struct ifaddr *); int in6_is_addr_deprecated __P((struct sockaddr_in6 *)); -struct inpcb; -int in6_src_ioctl __P((u_long, caddr_t)); +int in6_src_ioctl __P((u_long, caddr_t)); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 20:54:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E21A7106566C; Thu, 9 Feb 2012 20:54:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D07698FC17; Thu, 9 Feb 2012 20:54: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 q19KsP8W028966; Thu, 9 Feb 2012 20:54:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19KsPfh028964; Thu, 9 Feb 2012 20:54:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092054.q19KsPfh028964@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 20:54:25 +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: r231303 - stable/7/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:54:26 -0000 Author: bz Date: Thu Feb 9 20:54:25 2012 New Revision: 231303 URL: http://svn.freebsd.org/changeset/base/231303 Log: MFC r229276: Remove an uneeded inpcb forward declaration and align the function declaration following to match the style in the rest of the file. Modified: stable/7/sys/netinet6/in6_var.h Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/netinet6/in6_var.h ============================================================================== --- stable/7/sys/netinet6/in6_var.h Thu Feb 9 20:54:14 2012 (r231302) +++ stable/7/sys/netinet6/in6_var.h Thu Feb 9 20:54:25 2012 (r231303) @@ -625,8 +625,7 @@ void in6_ifremloop(struct ifaddr *); void in6_ifaddloop(struct ifaddr *); int in6_is_addr_deprecated __P((struct sockaddr_in6 *)); -struct inpcb; -int in6_src_ioctl __P((u_long, caddr_t)); +int in6_src_ioctl __P((u_long, caddr_t)); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 20:57:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41008106566B; Thu, 9 Feb 2012 20:57:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F69E8FC17; Thu, 9 Feb 2012 20:57: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 q19KvQYH029420; Thu, 9 Feb 2012 20:57:26 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19KvPWT029418; Thu, 9 Feb 2012 20:57:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092057.q19KvPWT029418@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 20:57: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: r231304 - stable/9/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:57:26 -0000 Author: bz Date: Thu Feb 9 20:57:25 2012 New Revision: 231304 URL: http://svn.freebsd.org/changeset/base/231304 Log: MFC r229795: Correct comment for the IPv6 case to say "traffic class" not "TOS" as pointed out back in 2009. Modified: stable/9/sys/net80211/ieee80211_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net80211/ieee80211_output.c ============================================================================== --- stable/9/sys/net80211/ieee80211_output.c Thu Feb 9 20:54:25 2012 (r231303) +++ stable/9/sys/net80211/ieee80211_output.c Thu Feb 9 20:57:25 2012 (r231304) @@ -834,7 +834,7 @@ ieee80211_classify(struct ieee80211_node uint32_t flow; uint8_t tos; /* - * IPv6 frame, map the DSCP bits from the TOS field. + * IPv6 frame, map the DSCP bits from the traffic class field. */ m_copydata(m, sizeof(struct ether_header) + offsetof(struct ip6_hdr, ip6_flow), sizeof(flow), From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 20:57:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25A7A10656FA; Thu, 9 Feb 2012 20:57:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 141B68FC19; Thu, 9 Feb 2012 20:57:37 +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 q19Kvamo029478; Thu, 9 Feb 2012 20:57:36 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19KvaZH029475; Thu, 9 Feb 2012 20:57:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092057.q19KvaZH029475@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 20:57:36 +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: r231305 - stable/8/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:57:37 -0000 Author: bz Date: Thu Feb 9 20:57:36 2012 New Revision: 231305 URL: http://svn.freebsd.org/changeset/base/231305 Log: MFC r229795: Correct comment for the IPv6 case to say "traffic class" not "TOS" as pointed out back in 2009. Modified: stable/8/sys/net80211/ieee80211_output.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net80211/ieee80211_output.c ============================================================================== --- stable/8/sys/net80211/ieee80211_output.c Thu Feb 9 20:57:25 2012 (r231304) +++ stable/8/sys/net80211/ieee80211_output.c Thu Feb 9 20:57:36 2012 (r231305) @@ -823,7 +823,7 @@ ieee80211_classify(struct ieee80211_node uint32_t flow; uint8_t tos; /* - * IPv6 frame, map the DSCP bits from the TOS field. + * IPv6 frame, map the DSCP bits from the traffic class field. */ m_copydata(m, sizeof(struct ether_header) + offsetof(struct ip6_hdr, ip6_flow), sizeof(flow), From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 21:06:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D59D0106566C; Thu, 9 Feb 2012 21:06:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C48A08FC0A; Thu, 9 Feb 2012 21:06:47 +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 q19L6lec030731; Thu, 9 Feb 2012 21:06:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19L6l7I030729; Thu, 9 Feb 2012 21:06:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202092106.q19L6l7I030729@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 21:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231306 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 21:06:47 -0000 Author: eadler Date: Thu Feb 9 21:06:47 2012 New Revision: 231306 URL: http://svn.freebsd.org/changeset/base/231306 Log: Fix NULL ptr dereference in setusercontext if pwd is null, LOGIN_SETPRIORITY is set, and setting the priority (rtprio or setpriority) fails. PR: kern/164238 Submitted by: Alexander Wittig Reviewed by: des Approved by: cperciva MFC after: 1 month Modified: head/lib/libutil/login_class.c Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Thu Feb 9 20:57:36 2012 (r231305) +++ head/lib/libutil/login_class.c Thu Feb 9 21:06:47 2012 (r231306) @@ -452,18 +452,21 @@ setusercontext(login_cap_t *lc, const st p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else { if (setpriority(PRIO_PROCESS, 0, (int)p) != 0) syslog(LOG_WARNING, "setpriority '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } } From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 21:20:22 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFBA1106566C; Thu, 9 Feb 2012 21:20:22 +0000 (UTC) (envelope-from flo@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B7A428FC08; Thu, 9 Feb 2012 21:20:22 +0000 (UTC) Received: from nibbler-wlan.fritz.box (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q19LKKQB013600; Thu, 9 Feb 2012 21:20:21 GMT (envelope-from flo@FreeBSD.org) Message-ID: <4F343893.1070903@FreeBSD.org> Date: Thu, 09 Feb 2012 22:20:19 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120202 Thunderbird/11.0 MIME-Version: 1.0 To: Eitan Adler References: <201202092051.q19Kp3pj028436@svn.freebsd.org> In-Reply-To: <201202092051.q19Kp3pj028436@svn.freebsd.org> X-Enigmail-Version: 1.4a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB8E11E9250150B51B7DA621C" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231300 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 21:20:22 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB8E11E9250150B51B7DA621C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09.02.12 21:51, Eitan Adler wrote: > Author: eadler > Date: Thu Feb 9 20:51:03 2012 > New Revision: 231300 > URL: http://svn.freebsd.org/changeset/base/231300 >=20 > Log: > Permit the use of relative paths for the prefix argument. > Remove an unnecessary cwd from created plists when -p is specified > =20 > PR: bin/145000 > Submitted by: gcooper > Approved by: portmgr (flo) I guess this should read flz ;) Florian --------------enigB8E11E9250150B51B7DA621C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAk80OJQACgkQapo8P8lCvwn62gCcCSw60P1S1sZT9Rr0x/II/zdm 4aIAn3NgsL1BAYcnVpcVekr+Q3/WgplN =K0Tj -----END PGP SIGNATURE----- --------------enigB8E11E9250150B51B7DA621C-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 21:33:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD482106566B; Thu, 9 Feb 2012 21:33:36 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBB498FC0C; Thu, 9 Feb 2012 21:33:36 +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 q19LXa7J033935; Thu, 9 Feb 2012 21:33:36 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19LXarg033933; Thu, 9 Feb 2012 21:33:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092133.q19LXarg033933@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 21:33:36 +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: r231307 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 21:33:37 -0000 Author: bz Date: Thu Feb 9 21:33:36 2012 New Revision: 231307 URL: http://svn.freebsd.org/changeset/base/231307 Log: MFC r229546: Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT. Modified: stable/8/sys/netinet6/in6_ifattach.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/8/sys/netinet6/in6_ifattach.c Thu Feb 9 21:06:47 2012 (r231306) +++ stable/8/sys/netinet6/in6_ifattach.c Thu Feb 9 21:33:36 2012 (r231307) @@ -512,12 +512,8 @@ in6_ifattach_linklocal(struct ifnet *ifp } ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */ -#ifdef DIAGNOSTIC - if (!ia) { - panic("ia == NULL in in6_ifattach_linklocal"); - /* NOTREACHED */ - } -#endif + KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp)); + ifa_free(&ia->ia_ifa); /* From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 21:33:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 528BE1065670; Thu, 9 Feb 2012 21:33:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40F5C8FC15; Thu, 9 Feb 2012 21:33: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 q19LXjQR033988; Thu, 9 Feb 2012 21:33:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19LXjRq033986; Thu, 9 Feb 2012 21:33:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092133.q19LXjRq033986@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 21:33:45 +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: r231308 - stable/7/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 21:33:45 -0000 Author: bz Date: Thu Feb 9 21:33:44 2012 New Revision: 231308 URL: http://svn.freebsd.org/changeset/base/231308 Log: MFC r229546: Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT. Modified: stable/7/sys/netinet6/in6_ifattach.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/7/sys/netinet6/in6_ifattach.c Thu Feb 9 21:33:36 2012 (r231307) +++ stable/7/sys/netinet6/in6_ifattach.c Thu Feb 9 21:33:44 2012 (r231308) @@ -480,12 +480,7 @@ in6_ifattach_linklocal(struct ifnet *ifp } ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */ -#ifdef DIAGNOSTIC - if (!ia) { - panic("ia == NULL in in6_ifattach_linklocal"); - /* NOTREACHED */ - } -#endif + KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp)); /* * Make the link-local prefix (fe80::%link/64) as on-link. From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 21:47:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B3D106564A; Thu, 9 Feb 2012 21:47:19 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 1EDA38FC0C; Thu, 9 Feb 2012 21:47:18 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 6FB3490B; Thu, 9 Feb 2012 22:47:16 +0100 (CET) Date: Thu, 9 Feb 2012 22:46:02 +0100 From: Pawel Jakub Dawidek To: Martin Matuska Message-ID: <20120209214601.GA1313@garage.freebsd.pl> References: <201202091039.q19Ad2aM097022@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline In-Reply-To: <201202091039.q19Ad2aM097022@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231269 - head/sys/fs/nullfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 21:47:19 -0000 --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 09, 2012 at 10:39:02AM +0000, Martin Matuska wrote: > Author: mm > Date: Thu Feb 9 10:39:01 2012 > New Revision: 231269 > URL: http://svn.freebsd.org/changeset/base/231269 >=20 > Log: > Allow mounting nullfs(5) inside jails. > =20 > This is now possible thanks to r230129. > =20 > MFC after: 1 month I'd really like to know that someone actually audited nullfs to see it can be safely managed within a jail. devfs is probably even more critical - hopefully it isn't possible to make simple administrative mistake that will allow to get access to, eg. /dev/kmem from within a jail or something similar. Changes like this one, which can have serious security implications, should be really properly reviewed. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk80PpkACgkQForvXbEpPzRtUgCcDDpIn0FF81kIPQc2oc08OD0U aicAoLe+s1uqaITI8yhJXAXFM4ao5fGs =vS6O -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:02:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58FE3106566B; Thu, 9 Feb 2012 22:02:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4755F8FC12; Thu, 9 Feb 2012 22:02:00 +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 q19M20UE037398; Thu, 9 Feb 2012 22:02:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19M20Mo037396; Thu, 9 Feb 2012 22:02:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092202.q19M20Mo037396@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 22:02:00 +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: r231309 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:02:00 -0000 Author: bz Date: Thu Feb 9 22:01:59 2012 New Revision: 231309 URL: http://svn.freebsd.org/changeset/base/231309 Log: MFC r229546: Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT. Modified: stable/9/sys/netinet6/in6_ifattach.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/9/sys/netinet6/in6_ifattach.c Thu Feb 9 21:33:44 2012 (r231308) +++ stable/9/sys/netinet6/in6_ifattach.c Thu Feb 9 22:01:59 2012 (r231309) @@ -513,12 +513,8 @@ in6_ifattach_linklocal(struct ifnet *ifp } ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */ -#ifdef DIAGNOSTIC - if (!ia) { - panic("ia == NULL in in6_ifattach_linklocal"); - /* NOTREACHED */ - } -#endif + KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp)); + ifa_free(&ia->ia_ifa); /* From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:05:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A8A4106566C; Thu, 9 Feb 2012 22:05:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88EFB8FC13; Thu, 9 Feb 2012 22:05:51 +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 q19M5pHx037900; Thu, 9 Feb 2012 22:05:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19M5pnU037898; Thu, 9 Feb 2012 22:05:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202092205.q19M5pnU037898@svn.freebsd.org> From: Michael Tuexen Date: Thu, 9 Feb 2012 22:05:51 +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: r231310 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:05:51 -0000 Author: tuexen Date: Thu Feb 9 22:05:51 2012 New Revision: 231310 URL: http://svn.freebsd.org/changeset/base/231310 Log: MFC r231074: Fix a typo which was already fixed by eadler in r227489. We missed to integrate this fix in our code base, so it was removed in r227755. Modified: stable/9/sys/netinet/sctp_structs.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_structs.h ============================================================================== --- stable/9/sys/netinet/sctp_structs.h Thu Feb 9 22:01:59 2012 (r231309) +++ stable/9/sys/netinet/sctp_structs.h Thu Feb 9 22:05:51 2012 (r231310) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used a a bit mask */ +/* The upper byte is used as a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:13:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85F6E106566C; Thu, 9 Feb 2012 22:13:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 745AB8FC15; Thu, 9 Feb 2012 22:13: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 q19MDLgI038833; Thu, 9 Feb 2012 22:13:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19MDLRm038831; Thu, 9 Feb 2012 22:13:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092213.q19MDLRm038831@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 22:13: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: r231311 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:13:21 -0000 Author: bz Date: Thu Feb 9 22:13:20 2012 New Revision: 231311 URL: http://svn.freebsd.org/changeset/base/231311 Log: Fix no-IPv6 kernels after r231207. Reported by: someone via luigi Modified: stable/7/sys/netinet/ip_fw2.c Modified: stable/7/sys/netinet/ip_fw2.c ============================================================================== --- stable/7/sys/netinet/ip_fw2.c Thu Feb 9 22:05:51 2012 (r231310) +++ stable/7/sys/netinet/ip_fw2.c Thu Feb 9 22:13:20 2012 (r231311) @@ -110,9 +110,7 @@ static u_int32_t set_disable; static int fw_verbose; static struct callout ipfw_timeout; static int verbose_limit; -#ifdef INET6 static int fw_permit_single_frag6 = 1; -#endif #ifdef IPFIREWALL_DEFAULT_TO_ACCEPT static int default_to_accept = 1; From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:15:21 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFB3F1065672; Thu, 9 Feb 2012 22:15:21 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id A5D098FC12; Thu, 9 Feb 2012 22:15:21 +0000 (UTC) Received: from [172.23.7.29] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q19MFD65042946 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 9 Feb 2012 14:15:20 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201202092044.q19KiLUT027539@svn.freebsd.org> Date: Thu, 9 Feb 2012 14:15:07 -0800 Content-Transfer-Encoding: 7bit Message-Id: References: <201202092044.q19KiLUT027539@svn.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:15:22 -0000 On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > Author: eadler > Date: Thu Feb 9 20:44:20 2012 > New Revision: 231298 > URL: http://svn.freebsd.org/changeset/base/231298 > > Log: > Make etc/Makefile more conflict resistant Nice. Question though: why not the less verbose BIN1 = \ foo \ bar \ baz It's probably faster too, and friendlier when running "make -dv" Just a thought... -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:17:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ADBF106566B; Thu, 9 Feb 2012 22:17:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7DE8FC15; Thu, 9 Feb 2012 22:17: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 q19MHEpb039373; Thu, 9 Feb 2012 22:17:14 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19MHEuU039370; Thu, 9 Feb 2012 22:17:14 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202092217.q19MHEuU039370@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 9 Feb 2012 22:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231312 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:17:14 -0000 Author: gonzo Date: Thu Feb 9 22:17:13 2012 New Revision: 231312 URL: http://svn.freebsd.org/changeset/base/231312 Log: - Emulate RDHWR instruction for TLS support Reading register $29 with RDHWR is becoming the de-facto standard to implement TLS. According to linux-mips wiki, MIPS Technologies has reserved hardware register $29 for ABI use. Furthermore current GCC makes the following assumptions: - RDHWR is natively available or otherwise emulated by the kernel - Register $29 holds the TLS pointer Submitted by: Robert Millan Modified: head/sys/mips/include/mips_opcode.h head/sys/mips/mips/trap.c Modified: head/sys/mips/include/mips_opcode.h ============================================================================== --- head/sys/mips/include/mips_opcode.h Thu Feb 9 22:13:20 2012 (r231311) +++ head/sys/mips/include/mips_opcode.h Thu Feb 9 22:17:13 2012 (r231312) @@ -176,6 +176,11 @@ typedef union { #define OP_LDL 032 #define OP_LDR 033 +#define OP_SPECIAL2 034 +#define OP_JALX 035 + +#define OP_SPECIAL3 037 + #define OP_LB 040 #define OP_LH 041 #define OP_LWL 042 @@ -389,6 +394,11 @@ typedef union { #define OP_R_BGEZALL OP_BGEZALL /* + * Values for the 'func' field when 'op' == OP_SPECIAL3. + */ +#define OP_RDHWR 073 + +/* * Values for the 'rs' field when 'op' == OP_COPz. */ #define OP_MF 000 Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Feb 9 22:13:20 2012 (r231311) +++ head/sys/mips/mips/trap.c Thu Feb 9 22:17:13 2012 (r231312) @@ -414,6 +414,7 @@ trap(struct trapframe *trapframe) intptr_t addr = 0; register_t pc; int cop; + register_t *frame_regs; trapdebug_enter(trapframe, 0); @@ -762,9 +763,29 @@ dofault: } case T_RES_INST + T_USER: - log_illegal_instruction("RES_INST", trapframe); - i = SIGILL; - addr = trapframe->pc; + { + InstFmt inst; + inst = *(InstFmt *)trapframe->pc; + switch (inst.RType.op) { + case OP_SPECIAL3: + switch (inst.RType.func) { + case OP_RDHWR: + /* Register 29 used for TLS */ + if (inst.RType.rd == 29) { + frame_regs = &(trapframe->zero); + frame_regs[inst.RType.rt] = (register_t)td->td_md.md_tls; + trapframe->pc += sizeof(int); + goto out; + } + break; + } + break; + } + + log_illegal_instruction("RES_INST", trapframe); + i = SIGILL; + addr = trapframe->pc; + } break; case T_C2E: case T_C2E + T_USER: From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:33:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AECAC1065670; Thu, 9 Feb 2012 22:33:30 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 330778FC17; Thu, 9 Feb 2012 22:33:30 +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 28A4925D3870; Thu, 9 Feb 2012 22:33:29 +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 545D3BDB039; Thu, 9 Feb 2012 22:33:28 +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 L2P4tXzdsv5v; Thu, 9 Feb 2012 22:33:26 +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 8A950BDB038; Thu, 9 Feb 2012 22:33:26 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201202092217.q19MHEuU039370@svn.freebsd.org> Date: Thu, 9 Feb 2012 22:33:25 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201202092217.q19MHEuU039370@svn.freebsd.org> To: Oleksandr Tymoshenko X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231312 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:33:31 -0000 On 9. Feb 2012, at 22:17 , Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Thu Feb 9 22:17:13 2012 > New Revision: 231312 > URL: http://svn.freebsd.org/changeset/base/231312 >=20 > Log: > - Emulate RDHWR instruction for TLS support >=20 > Reading register $29 with RDHWR is becoming the de-facto standard to > implement TLS. According to linux-mips wiki, MIPS Technologies has > reserved hardware register $29 for ABI use. Furthermore current GCC > makes the following assumptions: > - RDHWR is natively available or otherwise emulated by the kernel > - Register $29 holds the TLS pointer >=20 > Submitted by: Robert Millan mips XLPN32 kernel failed, check _.mips.XLPN32 for details mips XLRN32 kernel failed, check _.mips.XLRN32 for details /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c: In function 'trap': /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:768: warning: cast to = pointer from integer of different size [-Wint-to-pointer-cast] /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:776: warning: cast from = pointer to integer of different size [-Wpointer-to-int-cast] >=20 > Modified: > head/sys/mips/include/mips_opcode.h > head/sys/mips/mips/trap.c >=20 > Modified: head/sys/mips/include/mips_opcode.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 > --- head/sys/mips/include/mips_opcode.h Thu Feb 9 22:13:20 2012 = (r231311) > +++ head/sys/mips/include/mips_opcode.h Thu Feb 9 22:17:13 2012 = (r231312) > @@ -176,6 +176,11 @@ typedef union { > #define OP_LDL 032 > #define OP_LDR 033 >=20 > +#define OP_SPECIAL2 034 > +#define OP_JALX 035 > + > +#define OP_SPECIAL3 037 > + > #define OP_LB 040 > #define OP_LH 041 > #define OP_LWL 042 > @@ -389,6 +394,11 @@ typedef union { > #define OP_R_BGEZALL OP_BGEZALL >=20 > /* > + * Values for the 'func' field when 'op' =3D=3D OP_SPECIAL3. > + */ > +#define OP_RDHWR 073 > + > +/* > * Values for the 'rs' field when 'op' =3D=3D OP_COPz. > */ > #define OP_MF 000 >=20 > Modified: head/sys/mips/mips/trap.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 > --- head/sys/mips/mips/trap.c Thu Feb 9 22:13:20 2012 = (r231311) > +++ head/sys/mips/mips/trap.c Thu Feb 9 22:17:13 2012 = (r231312) > @@ -414,6 +414,7 @@ trap(struct trapframe *trapframe) > intptr_t addr =3D 0; > register_t pc; > int cop; > + register_t *frame_regs; >=20 > trapdebug_enter(trapframe, 0); > =09 > @@ -762,9 +763,29 @@ dofault: > } >=20 > case T_RES_INST + T_USER: > - log_illegal_instruction("RES_INST", trapframe); > - i =3D SIGILL; > - addr =3D trapframe->pc; > + { > + InstFmt inst; > + inst =3D *(InstFmt *)trapframe->pc; > + switch (inst.RType.op) { > + case OP_SPECIAL3: > + switch (inst.RType.func) { > + case OP_RDHWR: > + /* Register 29 used for TLS */ > + if (inst.RType.rd =3D=3D 29) { > + frame_regs =3D = &(trapframe->zero); > + = frame_regs[inst.RType.rt] =3D (register_t)td->td_md.md_tls; > + trapframe->pc +=3D = sizeof(int); > + goto out; > + } > + break; > + } > + break; > + } > + > + log_illegal_instruction("RES_INST", trapframe); > + i =3D SIGILL; > + addr =3D trapframe->pc; > + } > break; > case T_C2E: > case T_C2E + T_USER: --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:34:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B931065672; Thu, 9 Feb 2012 22:34:17 +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 1526F8FC13; Thu, 9 Feb 2012 22:34: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 q19MYGFr040873; Thu, 9 Feb 2012 22:34:16 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19MYGEJ040871; Thu, 9 Feb 2012 22:34:16 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201202092234.q19MYGEJ040871@svn.freebsd.org> From: Kirk McKusick Date: Thu, 9 Feb 2012 22:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231313 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:34:17 -0000 Author: mckusick Date: Thu Feb 9 22:34:16 2012 New Revision: 231313 URL: http://svn.freebsd.org/changeset/base/231313 Log: Historically when an application wrote an entire block of a file, the kernel allocated a buffer but did not zero it as it was about to be completely filled by a uiomove() from the user's buffer. However, if the uiomove() failed, the old contents of the buffer could be exposed especially if the file was being mmap'ed. The fix was to always zero the buffer when it was allocated. This change first attempts the uiomove() to the newly allocated (and dirty) buffer and only zeros it if the uiomove() fails. The effect is to eliminate the gratuitous zeroing of the buffer in the usual case where the uiomove() successfully fills it. Reviewed by: kib Tested by: scottl MFC after: 2 weeks (to 9 only) Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Thu Feb 9 22:17:13 2012 (r231312) +++ head/sys/ufs/ffs/ffs_vnops.c Thu Feb 9 22:34:16 2012 (r231313) @@ -718,15 +718,6 @@ ffs_write(ap) vnode_pager_setsize(vp, ip->i_size); break; } - /* - * If the buffer is not valid we have to clear out any - * garbage data from the pages instantiated for the buffer. - * If we do not, a failed uiomove() during a write can leave - * the prior contents of the pages exposed to a userland - * mmap(). XXX deal with uiomove() errors a better way. - */ - if ((bp->b_flags & B_CACHE) == 0 && fs->fs_bsize <= xfersize) - vfs_bio_clrbuf(bp); if (ioflag & IO_DIRECT) bp->b_flags |= B_DIRECT; if ((ioflag & (IO_SYNC|IO_INVAL)) == (IO_SYNC|IO_INVAL)) @@ -743,6 +734,26 @@ ffs_write(ap) error = uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); + /* + * If the buffer is not already filled and we encounter an + * error while trying to fill it, we have to clear out any + * garbage data from the pages instantiated for the buffer. + * If we do not, a failed uiomove() during a write can leave + * the prior contents of the pages exposed to a userland mmap. + * + * Note that we need only clear buffers with a transfer size + * equal to the block size because buffers with a shorter + * transfer size were cleared above by the call to UFS_BALLOC() + * with the BA_CLRBUF flag set. + * + * If the source region for uiomove identically mmaps the + * buffer, uiomove() performed the NOP copy, and the buffer + * content remains valid because the page fault handler + * validated the pages. + */ + if (error != 0 && (bp->b_flags & B_CACHE) == 0 && + fs->fs_bsize == xfersize) + vfs_bio_clrbuf(bp); if ((ioflag & (IO_VMIO|IO_DIRECT)) && (LIST_EMPTY(&bp->b_dep))) { bp->b_flags |= B_RELBUF; From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:48:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA81D106566C; Thu, 9 Feb 2012 22:48:35 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B97198FC12; Thu, 9 Feb 2012 22:48: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 q19MmZOo041327; Thu, 9 Feb 2012 22:48:35 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19MmZo5041325; Thu, 9 Feb 2012 22:48:35 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202092248.q19MmZo5041325@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 9 Feb 2012 22:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231314 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:48:35 -0000 Author: gonzo Date: Thu Feb 9 22:48:35 2012 New Revision: 231314 URL: http://svn.freebsd.org/changeset/base/231314 Log: Fix n32 build breakage Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Feb 9 22:34:16 2012 (r231313) +++ head/sys/mips/mips/trap.c Thu Feb 9 22:48:35 2012 (r231314) @@ -765,7 +765,7 @@ dofault: case T_RES_INST + T_USER: { InstFmt inst; - inst = *(InstFmt *)trapframe->pc; + inst = *(InstFmt *)(intptr_t)trapframe->pc; switch (inst.RType.op) { case OP_SPECIAL3: switch (inst.RType.func) { @@ -773,7 +773,7 @@ dofault: /* Register 29 used for TLS */ if (inst.RType.rd == 29) { frame_regs = &(trapframe->zero); - frame_regs[inst.RType.rt] = (register_t)td->td_md.md_tls; + frame_regs[inst.RType.rt] = (register_t)(intptr_t)td->td_md.md_tls; trapframe->pc += sizeof(int); goto out; } From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:54:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00AA9106566C; Thu, 9 Feb 2012 22:54:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E340D8FC08; Thu, 9 Feb 2012 22:54: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 q19Ms72H041533; Thu, 9 Feb 2012 22:54:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Ms7Wm041531; Thu, 9 Feb 2012 22:54:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092254.q19Ms7Wm041531@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 22:54: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: r231315 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:54:08 -0000 Author: bz Date: Thu Feb 9 22:54:07 2012 New Revision: 231315 URL: http://svn.freebsd.org/changeset/base/231315 Log: MFC r230387: Remove a superfluous INET6 check (no opt_inet6.h included anyway). Modified: stable/8/sys/netinet/if_ether.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Thu Feb 9 22:48:35 2012 (r231314) +++ stable/8/sys/netinet/if_ether.c Thu Feb 9 22:54:07 2012 (r231315) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET) || defined(INET6) +#if defined(INET) #include #endif From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 22:54:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32A1F1065674; Thu, 9 Feb 2012 22:54:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 213568FC15; Thu, 9 Feb 2012 22:54: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 q19MsGS4041575; Thu, 9 Feb 2012 22:54:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19MsGte041573; Thu, 9 Feb 2012 22:54:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202092254.q19MsGte041573@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 Feb 2012 22:54: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: r231316 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:54:17 -0000 Author: bz Date: Thu Feb 9 22:54:16 2012 New Revision: 231316 URL: http://svn.freebsd.org/changeset/base/231316 Log: MFC r230387: Remove a superfluous INET6 check (no opt_inet6.h included anyway). Modified: stable/9/sys/netinet/if_ether.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/if_ether.c ============================================================================== --- stable/9/sys/netinet/if_ether.c Thu Feb 9 22:54:07 2012 (r231315) +++ stable/9/sys/netinet/if_ether.c Thu Feb 9 22:54:16 2012 (r231316) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET) || defined(INET6) +#if defined(INET) #include #endif From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 23:09:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1692B106566B; Thu, 9 Feb 2012 23:09:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4FF368FC1B; Thu, 9 Feb 2012 23:09:31 +0000 (UTC) Received: by werm13 with SMTP id m13so2341550wer.13 for ; Thu, 09 Feb 2012 15:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=TwLa1VJWwRXtTYrq8He535FGpqEqUvfFxFXsz27yTgY=; b=PBHAFZc00y9pCspU5UWpmXgLvVbRzaXJUsWnz8BmCKnwV56TsSl4u+fRl4Rn8Ycb2S t8wh6wPGVgZre7Z0hOSx1n8GjHaV21ifFbD9uRHMNZpERGbPHnOObT1t5wd6BnIUc96r glee9E8JIyryMD0t297LGojEsmNz1nrmPzTKw= Received: by 10.180.83.72 with SMTP id o8mr35445017wiy.22.1328828971199; Thu, 09 Feb 2012 15:09:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.103.10 with HTTP; Thu, 9 Feb 2012 15:09:01 -0800 (PST) In-Reply-To: References: <201202092044.q19KiLUT027539@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 18:09:01 -0500 X-Google-Sender-Auth: kOOnsKNZO1pVjXDN7ijH991fMbo Message-ID: To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlw5qLgbO0mZEfkkOzX56E5ooyW4/1NAV87Zm9ivhoOL2sjASK4uTIua7g1vSVGlcO578Oe Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 23:09:33 -0000 On Thu, Feb 9, 2012 at 5:15 PM, Marcel Moolenaar wrote: > > On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > >> Author: eadler >> Date: Thu Feb =C2=A09 20:44:20 2012 >> New Revision: 231298 >> URL: http://svn.freebsd.org/changeset/base/231298 >> >> Log: >> =C2=A0Make etc/Makefile more conflict resistant > > Nice. Question though: why not the less verbose Either would have worked but I went with what was in the original patch. If it is worth it I could change to use the format you describe. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 23:18:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAFEB1065670; Thu, 9 Feb 2012 23:18:24 +0000 (UTC) (envelope-from gonzo@hq.bluezbox.com) Received: from hq.bluezbox.com (hq.bluezbox.com [70.38.37.145]) by mx1.freebsd.org (Postfix) with ESMTP id 69B9C8FC0A; Thu, 9 Feb 2012 23:18:24 +0000 (UTC) Received: from localhost ([127.0.0.1]) by hq.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.73 (FreeBSD)) (envelope-from ) id 1Rvcsk-000Hfd-Uc; Thu, 09 Feb 2012 14:54:27 -0800 Message-ID: <4F344EA6.1040809@freebsd.org> Date: Thu, 09 Feb 2012 14:54:30 -0800 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201202092217.q19MHEuU039370@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@hq.bluezbox.com X-Spam-Level: ---- X-Spam-Report: Spam detection software, running on the system "hq.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 09/02/2012 2:33 PM, Bjoern A. Zeeb wrote: > > On 9. Feb 2012, at 22:17 , Oleksandr Tymoshenko wrote: > >> Author: gonzo >> Date: Thu Feb 9 22:17:13 2012 >> New Revision: 231312 >> URL: http://svn.freebsd.org/changeset/base/231312 >> >> Log: >> - Emulate RDHWR instruction for TLS support >> >> Reading register $29 with RDHWR is becoming the de-facto standard to >> implement TLS. According to linux-mips wiki, MIPS Technologies has >> reserved hardware register $29 for ABI use. Furthermore current GCC >> makes the following assumptions: >> - RDHWR is natively available or otherwise emulated by the kernel >> - Register $29 holds the TLS pointer >> >> Submitted by: Robert Millan > > mips XLPN32 kernel failed, check _.mips.XLPN32 for details > mips XLRN32 kernel failed, check _.mips.XLRN32 for details > > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c: In function 'trap': > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:768: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:776: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] [...] Content analysis details: (-4.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 0.0 AWL AWL: From: address is in the auto white-list Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231312 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 23:18:25 -0000 On 09/02/2012 2:33 PM, Bjoern A. Zeeb wrote: > > On 9. Feb 2012, at 22:17 , Oleksandr Tymoshenko wrote: > >> Author: gonzo >> Date: Thu Feb 9 22:17:13 2012 >> New Revision: 231312 >> URL: http://svn.freebsd.org/changeset/base/231312 >> >> Log: >> - Emulate RDHWR instruction for TLS support >> >> Reading register $29 with RDHWR is becoming the de-facto standard to >> implement TLS. According to linux-mips wiki, MIPS Technologies has >> reserved hardware register $29 for ABI use. Furthermore current GCC >> makes the following assumptions: >> - RDHWR is natively available or otherwise emulated by the kernel >> - Register $29 holds the TLS pointer >> >> Submitted by: Robert Millan > > mips XLPN32 kernel failed, check _.mips.XLPN32 for details > mips XLRN32 kernel failed, check _.mips.XLRN32 for details > > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c: In function 'trap': > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:768: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:776: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Thanks for spotting it. Fixed. From owner-svn-src-all@FreeBSD.ORG Thu Feb 9 23:19:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76E2F1065670; Thu, 9 Feb 2012 23:19:09 +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 65D238FC08; Thu, 9 Feb 2012 23:19: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 q19NJ9Wn042699; Thu, 9 Feb 2012 23:19:09 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19NJ9EC042696; Thu, 9 Feb 2012 23:19:09 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202092319.q19NJ9EC042696@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 9 Feb 2012 23:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231317 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 23:19:09 -0000 Author: np Date: Thu Feb 9 23:19:09 2012 New Revision: 231317 URL: http://svn.freebsd.org/changeset/base/231317 Log: Add IPv6 TSO (including TSO+VLAN) support to cxgb(4). If an IPv6 packet has extension headers the kernel needs to deal with it itself. For the rest it can set various CSUM_XXX flags and the driver will act on them. Modified: head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Thu Feb 9 22:54:16 2012 (r231316) +++ head/sys/dev/cxgb/cxgb_main.c Thu Feb 9 23:19:09 2012 (r231317) @@ -982,7 +982,7 @@ cxgb_makedev(struct port_info *pi) #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) -#define CXGB_CAP_ENABLE (CXGB_CAP & ~IFCAP_TSO6) +#define CXGB_CAP_ENABLE CXGB_CAP static int cxgb_port_attach(device_t dev) @@ -2059,8 +2059,8 @@ fail: } if (mask & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; - if (mask & IFCAP_TSO4) { - ifp->if_capenable ^= IFCAP_TSO4; + if (mask & IFCAP_TSO) { + ifp->if_capenable ^= IFCAP_TSO; if (IFCAP_TSO & ifp->if_capenable) { if (IFCAP_TXCSUM & ifp->if_capenable) Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Thu Feb 9 22:54:16 2012 (r231316) +++ head/sys/dev/cxgb/cxgb_sge.c Thu Feb 9 23:19:09 2012 (r231317) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1492,10 +1493,10 @@ t3_encap(struct sge_qset *qs, struct mbu check_ring_tx_db(sc, txq, 0); return (0); } else if (tso_info) { - int eth_type; + uint16_t eth_type; struct cpl_tx_pkt_lso *hdr = (struct cpl_tx_pkt_lso *)txd; struct ether_header *eh; - struct ip *ip; + void *l3hdr; struct tcphdr *tcp; txd->flit[2] = 0; @@ -1521,18 +1522,37 @@ t3_encap(struct sge_qset *qs, struct mbu } eh = mtod(m0, struct ether_header *); - if (eh->ether_type == htons(ETHERTYPE_VLAN)) { - eth_type = CPL_ETH_II_VLAN; - ip = (struct ip *)((struct ether_vlan_header *)eh + 1); + eth_type = eh->ether_type; + if (eth_type == htons(ETHERTYPE_VLAN)) { + struct ether_vlan_header *evh = (void *)eh; + + tso_info |= V_LSO_ETH_TYPE(CPL_ETH_II_VLAN); + l3hdr = evh + 1; + eth_type = evh->evl_proto; } else { - eth_type = CPL_ETH_II; - ip = (struct ip *)(eh + 1); + tso_info |= V_LSO_ETH_TYPE(CPL_ETH_II); + l3hdr = eh + 1; } - tcp = (struct tcphdr *)(ip + 1); - tso_info |= V_LSO_ETH_TYPE(eth_type) | - V_LSO_IPHDR_WORDS(ip->ip_hl) | - V_LSO_TCPHDR_WORDS(tcp->th_off); + if (eth_type == htons(ETHERTYPE_IP)) { + struct ip *ip = l3hdr; + + tso_info |= V_LSO_IPHDR_WORDS(ip->ip_hl); + tcp = (struct tcphdr *)(ip + 1); + } else if (eth_type == htons(ETHERTYPE_IPV6)) { + struct ip6_hdr *ip6 = l3hdr; + + KASSERT(ip6->ip6_nxt == IPPROTO_TCP, + ("%s: CSUM_TSO with ip6_nxt %d", + __func__, ip6->ip6_nxt)); + + tso_info |= F_LSO_IPV6; + tso_info |= V_LSO_IPHDR_WORDS(sizeof(*ip6) >> 2); + tcp = (struct tcphdr *)(ip6 + 1); + } else + panic("%s: CSUM_TSO but neither ip nor ip6", __func__); + + tso_info |= V_LSO_TCPHDR_WORDS(tcp->th_off); hdr->lso_info = htonl(tso_info); if (__predict_false(mlen <= PIO_LEN)) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:01:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45CD9106566C; Fri, 10 Feb 2012 00:01:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340D18FC17; Fri, 10 Feb 2012 00:01:51 +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 q1A01pg5044054; Fri, 10 Feb 2012 00:01:51 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A01pZW044052; Fri, 10 Feb 2012 00:01:51 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100001.q1A01pZW044052@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:01:51 +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: r231318 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:01:51 -0000 Author: bz Date: Fri Feb 10 00:01:50 2012 New Revision: 231318 URL: http://svn.freebsd.org/changeset/base/231318 Log: MFC r230494: Remove unnecessary line break. Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Thu Feb 9 23:19:09 2012 (r231317) +++ stable/8/sys/netinet6/in6.c Fri Feb 10 00:01:50 2012 (r231318) @@ -1275,8 +1275,7 @@ in6_purgeaddr(struct ifaddr *ifa) mltaddr.sin6_family = AF_INET6; mltaddr.sin6_addr = in6addr_linklocal_allnodes; - if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != - 0) + if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != 0) goto cleanup; rt = rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:02:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A0CB106564A; Fri, 10 Feb 2012 00:02:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 484C18FC0A; Fri, 10 Feb 2012 00:02:04 +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 q1A024JA044102; Fri, 10 Feb 2012 00:02:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0247k044100; Fri, 10 Feb 2012 00:02:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100002.q1A0247k044100@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:02:04 +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: r231319 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:02:04 -0000 Author: bz Date: Fri Feb 10 00:02:03 2012 New Revision: 231319 URL: http://svn.freebsd.org/changeset/base/231319 Log: MFC r230494: Remove unnecessary line break. Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Fri Feb 10 00:01:50 2012 (r231318) +++ stable/9/sys/netinet6/in6.c Fri Feb 10 00:02:03 2012 (r231319) @@ -1354,8 +1354,7 @@ in6_purgeaddr(struct ifaddr *ifa) mltaddr.sin6_family = AF_INET6; mltaddr.sin6_addr = in6addr_linklocal_allnodes; - if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != - 0) + if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != 0) goto cleanup; rt = rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:02:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C9011065675; Fri, 10 Feb 2012 00:02:14 +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 D50248FC08; Fri, 10 Feb 2012 00:02:13 +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 q1A02D5w044149; Fri, 10 Feb 2012 00:02:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A02DeH044144; Fri, 10 Feb 2012 00:02:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202100002.q1A02DeH044144@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Feb 2012 00:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231320 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:02:14 -0000 Author: kib Date: Fri Feb 10 00:02:13 2012 New Revision: 231320 URL: http://svn.freebsd.org/changeset/base/231320 Log: Mark the automatically attached child with PL_FLAG_CHILD in struct lwpinfo flags, for PT_FOLLOWFORK auto-attachment. In collaboration with: Dmitry Mikulin MFC after: 1 week Modified: head/sys/kern/kern_fork.c head/sys/kern/sys_process.c head/sys/sys/proc.h head/sys/sys/ptrace.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Feb 10 00:02:03 2012 (r231319) +++ head/sys/kern/kern_fork.c Fri Feb 10 00:02:13 2012 (r231320) @@ -1035,7 +1035,9 @@ fork_return(struct thread *td, struct tr p->p_oppid = p->p_pptr->p_pid; proc_reparent(p, dbg); sx_xunlock(&proctree_lock); + td->td_dbgflags |= TDB_CHILD; ptracestop(td, SIGSTOP); + td->td_dbgflags &= ~TDB_CHILD; } else { /* * ... otherwise clear the request. Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Fri Feb 10 00:02:03 2012 (r231319) +++ head/sys/kern/sys_process.c Fri Feb 10 00:02:13 2012 (r231320) @@ -1145,6 +1145,8 @@ kern_ptrace(struct thread *td, int req, pl->pl_flags |= PL_FLAG_FORKED; pl->pl_child_pid = td2->td_dbg_forked; } + if (td2->td_dbgflags & TDB_CHILD) + pl->pl_flags |= PL_FLAG_CHILD; pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; strcpy(pl->pl_tdname, td2->td_name); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Feb 10 00:02:03 2012 (r231319) +++ head/sys/sys/proc.h Fri Feb 10 00:02:13 2012 (r231320) @@ -384,6 +384,7 @@ do { \ process */ #define TDB_STOPATFORK 0x00000080 /* Stop at the return from fork (child only) */ +#define TDB_CHILD 0x00000100 /* New child indicator for ptrace() */ /* * "Private" flags kept in td_pflags: Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Fri Feb 10 00:02:03 2012 (r231319) +++ head/sys/sys/ptrace.h Fri Feb 10 00:02:13 2012 (r231320) @@ -107,6 +107,7 @@ struct ptrace_lwpinfo { #define PL_FLAG_EXEC 0x10 /* exec(2) succeeded */ #define PL_FLAG_SI 0x20 /* siginfo is valid */ #define PL_FLAG_FORKED 0x40 /* new child */ +#define PL_FLAG_CHILD 0x80 /* I am from child */ sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct __siginfo pl_siginfo; /* siginfo for signal */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:08:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8D09106566B; Fri, 10 Feb 2012 00:08:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D724D8FC14; Fri, 10 Feb 2012 00:08: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 q1A08rFd044527; Fri, 10 Feb 2012 00:08:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A08rdC044525; Fri, 10 Feb 2012 00:08:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100008.q1A08rdC044525@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 00:08: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: r231321 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:08:54 -0000 Author: eadler Date: Fri Feb 10 00:08:53 2012 New Revision: 231321 URL: http://svn.freebsd.org/changeset/base/231321 Log: MFC r228344: - Add support for Support SEAGATE DAT Scopion 130 PR: kern/141934 Approved by: cperciva Modified: stable/9/sys/cam/scsi/scsi_sa.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:02:13 2012 (r231320) +++ stable/9/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:08:53 2012 (r231321) @@ -334,6 +334,10 @@ static struct sa_quirk_entry sa_quirk_ta "STT20000*", "*"}, SA_QUIRK_1FM, 0 }, { + { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "SEAGATE", + "DAT 06241-XXX", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0 + }, + { { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG", " TDC 3600", "U07:"}, SA_QUIRK_NOCOMP|SA_QUIRK_1FM, 512 }, From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:09:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 936741065680; Fri, 10 Feb 2012 00:09:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81A7D8FC12; Fri, 10 Feb 2012 00:09: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 q1A09LKc044582; Fri, 10 Feb 2012 00:09:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A09Luv044580; Fri, 10 Feb 2012 00:09:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100009.q1A09Luv044580@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 00:09: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: r231322 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:09:21 -0000 Author: eadler Date: Fri Feb 10 00:09:21 2012 New Revision: 231322 URL: http://svn.freebsd.org/changeset/base/231322 Log: MFC r228344: - Add support for Support SEAGATE DAT Scopion 130 PR: kern/141934 Approved by: cperciva Modified: stable/8/sys/cam/scsi/scsi_sa.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:08:53 2012 (r231321) +++ stable/8/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:09:21 2012 (r231322) @@ -334,6 +334,10 @@ static struct sa_quirk_entry sa_quirk_ta "STT20000*", "*"}, SA_QUIRK_1FM, 0 }, { + { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "SEAGATE", + "DAT 06241-XXX", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0 + }, + { { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG", " TDC 3600", "U07:"}, SA_QUIRK_NOCOMP|SA_QUIRK_1FM, 512 }, From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:10:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3553D1065679; Fri, 10 Feb 2012 00:10:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 237BC8FC21; Fri, 10 Feb 2012 00:10: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 q1A0AEtS044657; Fri, 10 Feb 2012 00:10:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0AEt3044655; Fri, 10 Feb 2012 00:10:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100010.q1A0AEt3044655@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 00:10:14 +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: r231323 - stable/7/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:10:14 -0000 Author: eadler Date: Fri Feb 10 00:10:13 2012 New Revision: 231323 URL: http://svn.freebsd.org/changeset/base/231323 Log: MFC r228344: - Add support for Support SEAGATE DAT Scopion 130 PR: kern/141934 Approved by: cperciva Modified: stable/7/sys/cam/scsi/scsi_sa.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:09:21 2012 (r231322) +++ stable/7/sys/cam/scsi/scsi_sa.c Fri Feb 10 00:10:13 2012 (r231323) @@ -339,6 +339,10 @@ static struct sa_quirk_entry sa_quirk_ta "STT20000*", "*"}, SA_QUIRK_1FM, 0 }, { + { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "SEAGATE", + "DAT 06241-XXX", "*"}, SA_QUIRK_VARIABLE|SA_QUIRK_2FM, 0 + }, + { { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "TANDBERG", " TDC 3600", "U07:"}, SA_QUIRK_NOCOMP|SA_QUIRK_1FM, 512 }, From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:15:37 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24CB81065672; Fri, 10 Feb 2012 00:15:37 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id E5F8D8FC0A; Fri, 10 Feb 2012 00:15:36 +0000 (UTC) Received: from [172.23.7.29] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q1A0FS3V043336 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 9 Feb 2012 16:15:35 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: Date: Thu, 9 Feb 2012 16:15:23 -0800 Content-Transfer-Encoding: 7bit Message-Id: <1C3260CA-8CDB-4C84-A591-637D2B342683@xcllnt.net> References: <201202092044.q19KiLUT027539@svn.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:15:37 -0000 On Feb 9, 2012, at 3:09 PM, Eitan Adler wrote: > On Thu, Feb 9, 2012 at 5:15 PM, Marcel Moolenaar wrote: >> >> On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: >> >>> Author: eadler >>> Date: Thu Feb 9 20:44:20 2012 >>> New Revision: 231298 >>> URL: http://svn.freebsd.org/changeset/base/231298 >>> >>> Log: >>> Make etc/Makefile more conflict resistant >> >> Nice. Question though: why not the less verbose > > Either would have worked but I went with what was in the original > patch. If it is worth it I could change to use the format you > describe. I think it's convention (see sys/modules/Makefile or lib/Makefile), but I could just as well be mistaken (i.e. picked the only makefiles that do this :-) I leave it up to you... -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:24:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7D7A106566B; Fri, 10 Feb 2012 00:24:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A62AA8FC1A; Fri, 10 Feb 2012 00:24:39 +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 q1A0Odgl045174; Fri, 10 Feb 2012 00:24:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0OdN1045172; Fri, 10 Feb 2012 00:24:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100024.q1A0OdN1045172@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:24:39 +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: r231324 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:24:39 -0000 Author: bz Date: Fri Feb 10 00:24:39 2012 New Revision: 231324 URL: http://svn.freebsd.org/changeset/base/231324 Log: MFC r230506: Plug a possible ifa_ref leak in case of premature return from in6_purgeaddr(). Reviewed by: rwatson Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Fri Feb 10 00:10:13 2012 (r231323) +++ stable/9/sys/netinet6/in6.c Fri Feb 10 00:24:39 2012 (r231324) @@ -1448,6 +1448,8 @@ in6_purgeaddr(struct ifaddr *ifa) } cleanup: + if (ifa0 != NULL) + ifa_free(ifa0); plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ if ((ia->ia_flags & IFA_ROUTE) && plen == 128) { @@ -1472,8 +1474,6 @@ cleanup: return; ia->ia_flags &= ~IFA_ROUTE; } - if (ifa0 != NULL) - ifa_free(ifa0); in6_unlink_ifa(ia, ifp); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:24:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C375C106566C; Fri, 10 Feb 2012 00:24:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1D038FC1C; Fri, 10 Feb 2012 00:24:41 +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 q1A0OfVh045209; Fri, 10 Feb 2012 00:24:41 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0Ofq9045207; Fri, 10 Feb 2012 00:24:41 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100024.q1A0Ofq9045207@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231325 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:24:41 -0000 Author: bz Date: Fri Feb 10 00:24:41 2012 New Revision: 231325 URL: http://svn.freebsd.org/changeset/base/231325 Log: MFC r230506: Plug a possible ifa_ref leak in case of premature return from in6_purgeaddr(). Reviewed by: rwatson Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Fri Feb 10 00:24:39 2012 (r231324) +++ stable/8/sys/netinet6/in6.c Fri Feb 10 00:24:41 2012 (r231325) @@ -1369,6 +1369,8 @@ in6_purgeaddr(struct ifaddr *ifa) } cleanup: + if (ifa0 != NULL) + ifa_free(ifa0); plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ if ((ia->ia_flags & IFA_ROUTE) && plen == 128) { @@ -1393,8 +1395,6 @@ cleanup: return; ia->ia_flags &= ~IFA_ROUTE; } - if (ifa0 != NULL) - ifa_free(ifa0); in6_unlink_ifa(ia, ifp); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:26:28 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29CC8106566B; Fri, 10 Feb 2012 00:26:28 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 4B10E8FC16; Fri, 10 Feb 2012 00:26:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q1A0QPSb080006; Fri, 10 Feb 2012 04:26:25 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q1A0QPjA080005; Fri, 10 Feb 2012 04:26:25 +0400 (MSK) (envelope-from ache) Date: Fri, 10 Feb 2012 04:26:24 +0400 From: Andrey Chernov To: Eitan Adler Message-ID: <20120210002623.GA79894@vniz.net> Mail-Followup-To: Andrey Chernov , Eitan Adler , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201202092051.q19Kp3pj028436@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202092051.q19Kp3pj028436@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r231300 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:26:28 -0000 On Thu, Feb 09, 2012 at 08:51:03PM +0000, Eitan Adler wrote: > /* Prefix should add an @cwd to the packing list */ > - if (Prefix) > - add_plist_top(&plist, PLIST_CWD, Prefix); > + if (Prefix) { > + char resolved_prefix[PATH_MAX]; > + if (realpath(Prefix, resolved_prefix) != 0) > + err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); > + add_plist_top(&plist, PLIST_CWD, resolved_prefix); > + } This change cause "pkg_create: couldn't resolve path for prefix: /usr/local: No such file or directory" because test condition should really be: if (realpath(Prefix, resolved_prefix) == NULL) (and realpath(3) returns char *) -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:41:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D31E1065676; Fri, 10 Feb 2012 00:41:35 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 23BDA8FC12; Fri, 10 Feb 2012 00:41:33 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so2404914wgb.31 for ; Thu, 09 Feb 2012 16:41:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=L80gNgFxTLPKvZR5bVX5y0jTHq59M8fBxS5NeofOnzY=; b=CEX70VEndLygzl4nHk2jGQ/+qpUmt/LlPM/ZCw96TnC2Mcaf1+Q5YVSQrxpPZ6e9dA XjxiUhm+LE0Zk08KZKUyuD2d0dOQYyw2q59heAPJItfnr+CsyIj9FvvL63ZGik3CTUMk pDCf+m/AMGbqDYj0WAzEawRsiWXWm+HDQlZJU= Received: by 10.180.82.39 with SMTP id f7mr5945838wiy.19.1328834493220; Thu, 09 Feb 2012 16:41:33 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.103.10 with HTTP; Thu, 9 Feb 2012 16:41:03 -0800 (PST) In-Reply-To: <20120210002623.GA79894@vniz.net> References: <201202092051.q19Kp3pj028436@svn.freebsd.org> <20120210002623.GA79894@vniz.net> From: Eitan Adler Date: Thu, 9 Feb 2012 19:41:03 -0500 X-Google-Sender-Auth: 5UVzR6BmskSQDKskO9V8tdrz7So Message-ID: To: Andrey Chernov , Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQl9wySRaU2+ycf2csDUqZETzUnc4PSVsXWMMkdxgbbV+NrXNLLPDmWA7cRMOf2RCuqJZwLv Cc: Subject: Re: svn commit: r231300 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:41:35 -0000 On Thu, Feb 9, 2012 at 7:26 PM, Andrey Chernov wrote: > On Thu, Feb 09, 2012 at 08:51:03PM +0000, Eitan Adler wrote: >> =C2=A0 =C2=A0 =C2=A0/* Prefix should add an @cwd to the packing list */ >> - =C2=A0 =C2=A0if (Prefix) >> - =C2=A0 =C2=A0 add_plist_top(&plist, PLIST_CWD, Prefix); >> + =C2=A0 =C2=A0if (Prefix) { >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0char resolved_prefix[PATH_MAX]; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if (realpath(Prefix, resolved_prefix) !=3D = 0) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 err(EXIT_FAILURE, "couldn't resolve path f= or prefix: %s", Prefix); >> + =C2=A0 =C2=A0 add_plist_top(&plist, PLIST_CWD, resolved_prefix); >> + =C2=A0 =C2=A0} > > This change cause > "pkg_create: couldn't resolve path for prefix: /usr/local: No such file o= r > directory" > because test condition should really be: Patch sent - awaiting approval. Sorry for the breakage :( --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:51:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71CBB1065670; Fri, 10 Feb 2012 00:51:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 604F68FC15; Fri, 10 Feb 2012 00:51: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 q1A0pNMc046097; Fri, 10 Feb 2012 00:51:23 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0pNa2046095; Fri, 10 Feb 2012 00:51:23 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100051.q1A0pNa2046095@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:51: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: r231326 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:51:23 -0000 Author: bz Date: Fri Feb 10 00:51:23 2012 New Revision: 231326 URL: http://svn.freebsd.org/changeset/base/231326 Log: MFC r230510: Replace random ARIN direct assignment legacy IPs with proper RFC 5735 TEST-NET1 block for use in documentation and example code addresses. Modified: stable/9/sys/net/route.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/route.c ============================================================================== --- stable/9/sys/net/route.c Fri Feb 10 00:24:41 2012 (r231325) +++ stable/9/sys/net/route.c Fri Feb 10 00:51:23 2012 (r231326) @@ -1503,10 +1503,10 @@ rtinit1(struct ifaddr *ifa, int cmd, int #ifdef RADIX_MPATH /* * in case address alias finds the first address - * e.g. ifconfig bge0 192.103.54.246/24 - * e.g. ifconfig bge0 192.103.54.247/24 - * the address set in the route is 192.103.54.246 - * so we need to replace it with 192.103.54.247 + * e.g. ifconfig bge0 192.0.2.246/24 + * e.g. ifconfig bge0 192.0.2.247/24 + * the address set in the route is 192.0.2.246 + * so we need to replace it with 192.0.2.247 */ if (memcmp(rt->rt_ifa->ifa_addr, ifa->ifa_addr, ifa->ifa_addr->sa_len)) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:51:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00854106564A; Fri, 10 Feb 2012 00:51:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E32AD8FC19; Fri, 10 Feb 2012 00:51: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 q1A0pW6F046139; Fri, 10 Feb 2012 00:51:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0pWF1046137; Fri, 10 Feb 2012 00:51:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100051.q1A0pWF1046137@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 00:51: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: r231327 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:51:33 -0000 Author: bz Date: Fri Feb 10 00:51:32 2012 New Revision: 231327 URL: http://svn.freebsd.org/changeset/base/231327 Log: MFC r230510: Replace random ARIN direct assignment legacy IPs with proper RFC 5735 TEST-NET1 block for use in documentation and example code addresses. Modified: stable/8/sys/net/route.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Fri Feb 10 00:51:23 2012 (r231326) +++ stable/8/sys/net/route.c Fri Feb 10 00:51:32 2012 (r231327) @@ -1502,10 +1502,10 @@ rtinit1(struct ifaddr *ifa, int cmd, int #ifdef RADIX_MPATH /* * in case address alias finds the first address - * e.g. ifconfig bge0 192.103.54.246/24 - * e.g. ifconfig bge0 192.103.54.247/24 - * the address set in the route is 192.103.54.246 - * so we need to replace it with 192.103.54.247 + * e.g. ifconfig bge0 192.0.2.246/24 + * e.g. ifconfig bge0 192.0.2.247/24 + * the address set in the route is 192.0.2.246 + * so we need to replace it with 192.0.2.247 */ if (memcmp(rt->rt_ifa->ifa_addr, ifa->ifa_addr, ifa->ifa_addr->sa_len)) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 00:53:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B26DA1065773; Fri, 10 Feb 2012 00:53:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0E618FC14; Fri, 10 Feb 2012 00:53:39 +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 q1A0rdf0046270; Fri, 10 Feb 2012 00:53:39 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0rdbp046268; Fri, 10 Feb 2012 00:53:39 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100053.q1A0rdbp046268@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 00:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231328 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:53:39 -0000 Author: eadler Date: Fri Feb 10 00:53:39 2012 New Revision: 231328 URL: http://svn.freebsd.org/changeset/base/231328 Log: Fix r231300: Use correct test so we only bail out on error instead of on non-error. Also, fix a style bug. Submitted by: ache Approved by: cperciva MFC after: 1 month Modified: head/usr.sbin/pkg_install/create/perform.c Modified: head/usr.sbin/pkg_install/create/perform.c ============================================================================== --- head/usr.sbin/pkg_install/create/perform.c Fri Feb 10 00:51:32 2012 (r231327) +++ head/usr.sbin/pkg_install/create/perform.c Fri Feb 10 00:53:39 2012 (r231328) @@ -216,7 +216,7 @@ pkg_perform(char **pkgs) /* Prefix should add an @cwd to the packing list */ if (Prefix) { char resolved_prefix[PATH_MAX]; - if (realpath(Prefix, resolved_prefix) != 0) + if (realpath(Prefix, resolved_prefix) == NULL) err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); add_plist_top(&plist, PLIST_CWD, resolved_prefix); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 01:13:33 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id EF0761065675; Fri, 10 Feb 2012 01:13:33 +0000 (UTC) Date: Fri, 10 Feb 2012 01:13:33 +0000 From: Alexey Dokuchaev To: Marcel Moolenaar Message-ID: <20120210011333.GA71601@FreeBSD.org> References: <201202092044.q19KiLUT027539@svn.freebsd.org> <1C3260CA-8CDB-4C84-A591-637D2B342683@xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <1C3260CA-8CDB-4C84-A591-637D2B342683@xcllnt.net> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 01:13:34 -0000 On Thu, Feb 09, 2012 at 04:15:23PM -0800, Marcel Moolenaar wrote: > I think it's convention (see sys/modules/Makefile or lib/Makefile), > but I could just as well be mistaken (i.e. picked the only makefiles > that do this :-) I also believe this is the usual way to do things in FreeBSD. Those BIN1+='s are too chatty. ./danfe From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 03:30:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74125106566B; Fri, 10 Feb 2012 03:30:57 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 626328FC12; Fri, 10 Feb 2012 03:30:57 +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 q1A3Uv7N051457; Fri, 10 Feb 2012 03:30:57 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A3UvhU051455; Fri, 10 Feb 2012 03:30:57 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202100330.q1A3UvhU051455@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 03:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231329 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 03:30:57 -0000 Author: gonzo Date: Fri Feb 10 03:30:57 2012 New Revision: 231329 URL: http://svn.freebsd.org/changeset/base/231329 Log: Fix debug output for MIPS part of rtld Modified: head/libexec/rtld-elf/mips/reloc.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 00:53:39 2012 (r231328) +++ head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 03:30:57 2012 (r231329) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "debug.h" #include "rtld.h" @@ -244,9 +245,9 @@ _mips_rtld_bind(Obj_Entry *obj, Elf_Size _rtld_error("bind failed no symbol"); target = (Elf_Addr)(defobj->relocbase + def->st_value); - dbg("bind now/fixup at %s sym # %d in %s --> was=%p new=%p", + dbg("bind now/fixup at %s sym # %jd in %s --> was=%p new=%p", obj->path, - reloff, defobj->strtab + def->st_name, + (intmax_t)reloff, defobj->strtab + def->st_name, (void *)got[obj->local_gotno + reloff - obj->gotsym], (void *)target); got[obj->local_gotno + reloff - obj->gotsym] = target; @@ -283,8 +284,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry /* Relocate the local GOT entries */ got += i; - dbg("got:%p for %d entries adding %x", - got, obj->local_gotno, (uint32_t)obj->relocbase); + dbg("got:%p for %d entries adding %p", + got, obj->local_gotno, obj->relocbase); for (; i < obj->local_gotno; i++) { *got += (Elf_Addr)obj->relocbase; got++; @@ -339,8 +340,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry */ *got = sym->st_value + (Elf_Addr)obj->relocbase; if ((Elf_Addr)(*got) == (Elf_Addr)obj->relocbase) { - dbg("Warning2, i:%d maps to relocbase address:%x", - i, (uint32_t)obj->relocbase); + dbg("Warning2, i:%d maps to relocbase address:%p", + i, obj->relocbase); } } else if (sym->st_info == ELF_ST_INFO(STB_GLOBAL, STT_SECTION)) { @@ -349,8 +350,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *got = sym->st_value + (Elf_Addr)obj->relocbase; if ((Elf_Addr)(*got) == (Elf_Addr)obj->relocbase) { - dbg("Warning3, i:%d maps to relocbase address:%x", - i, (uint32_t)obj->relocbase); + dbg("Warning3, i:%d maps to relocbase address:%p", + i, obj->relocbase); } } } else { @@ -363,8 +364,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry } *got = def->st_value + (Elf_Addr)defobj->relocbase; if ((Elf_Addr)(*got) == (Elf_Addr)obj->relocbase) { - dbg("Warning4, i:%d maps to relocbase address:%x", - i, (uint32_t)obj->relocbase); + dbg("Warning4, i:%d maps to relocbase address:%p", + i, obj->relocbase); dbg("via first obj symbol %s", obj->strtab + obj->symtab[i].st_name); dbg("found in obj %p:%s", @@ -470,8 +471,8 @@ reloc_plt(Obj_Entry *obj) const Elf_Rel *rellim; const Elf_Rel *rel; - dbg("reloc_plt obj:%p pltrel:%p sz:%d", obj, obj->pltrel, (int)obj->pltrelsize); - dbg("gottable %p num syms:%d", obj->pltgot, obj->symtabno ); + dbg("reloc_plt obj:%p pltrel:%p sz:%s", obj, obj->pltrel, (int)obj->pltrelsize); + dbg("gottable %p num syms:%s", obj->pltgot, obj->symtabno ); dbg("*****************************************************"); rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 03:32:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F4B1065670; Fri, 10 Feb 2012 03:32:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B10178FC12; Fri, 10 Feb 2012 03:32:29 +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 q1A3WTVl051550; Fri, 10 Feb 2012 03:32:29 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A3WTom051545; Fri, 10 Feb 2012 03:32:29 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202100332.q1A3WTom051545@svn.freebsd.org> From: Rick Macklem Date: Fri, 10 Feb 2012 03:32:29 +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: r231330 - in stable/9/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 03:32:29 -0000 Author: rmacklem Date: Fri Feb 10 03:32:29 2012 New Revision: 231330 URL: http://svn.freebsd.org/changeset/base/231330 Log: MFC: r230605 A problem with respect to data read through the buffer cache for both NFS clients was reported to freebsd-fs@ under the subject "NFS corruption in recent HEAD" on Nov. 26, 2011. This problem occurred when a TCP mounted root fs was changed to using UDP. I believe that this problem was caused by the change in mnt_stat.f_iosize that occurred because rsize was decreased to the maximum supported by UDP. This patch fixes the problem by using v_bufobj.bo_bsize instead of f_iosize, since the latter is set to f_iosize when the vnode is allocated, but does not change for a given vnode when f_iosize changes. Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c stable/9/sys/fs/nfsclient/nfs_clnode.c stable/9/sys/fs/nfsclient/nfs_clport.c stable/9/sys/nfsclient/nfs_bio.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/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Fri Feb 10 03:30:57 2012 (r231329) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Fri Feb 10 03:32:29 2012 (r231330) @@ -480,7 +480,7 @@ ncl_bioread(struct vnode *vp, struct uio /* No caching/ no readaheads. Just read data into the user buffer */ return ncl_readrpc(vp, uio, cred); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); error = nfs_bioread_check_cons(vp, td, cred); @@ -960,7 +960,7 @@ flush_and_restart: if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes * would exceed the local maximum per-file write commit size when @@ -1264,12 +1264,8 @@ nfs_getcacheblk(struct vnode *vp, daddr_ bp = getblk(vp, bn, size, 0, 0, 0); } - if (vp->v_type == VREG) { - int biosize; - - biosize = mp->mnt_stat.f_iosize; - bp->b_blkno = bn * (biosize / DEV_BSIZE); - } + if (vp->v_type == VREG) + bp->b_blkno = bn * (vp->v_bufobj.bo_bsize / DEV_BSIZE); return (bp); } @@ -1785,7 +1781,7 @@ ncl_meta_setsize(struct vnode *vp, struc { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; - int biosize = vp->v_mount->mnt_stat.f_iosize; + int biosize = vp->v_bufobj.bo_bsize; int error = 0; mtx_lock(&np->n_mtx); Modified: stable/9/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clnode.c Fri Feb 10 03:30:57 2012 (r231329) +++ stable/9/sys/fs/nfsclient/nfs_clnode.c Fri Feb 10 03:32:29 2012 (r231330) @@ -136,6 +136,7 @@ ncl_nget(struct mount *mntp, u_int8_t *f return (error); } vp = nvp; + KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0")); vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; Modified: stable/9/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clport.c Fri Feb 10 03:30:57 2012 (r231329) +++ stable/9/sys/fs/nfsclient/nfs_clport.c Fri Feb 10 03:32:29 2012 (r231330) @@ -212,6 +212,7 @@ nfscl_nget(struct mount *mntp, struct vn return (error); } vp = nvp; + KASSERT(vp->v_bufobj.bo_bsize != 0, ("nfscl_nget: bo_bsize == 0")); vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; Modified: stable/9/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/9/sys/nfsclient/nfs_bio.c Fri Feb 10 03:30:57 2012 (r231329) +++ stable/9/sys/nfsclient/nfs_bio.c Fri Feb 10 03:32:29 2012 (r231330) @@ -474,7 +474,7 @@ nfs_bioread(struct vnode *vp, struct uio /* No caching/ no readaheads. Just read data into the user buffer */ return nfs_readrpc(vp, uio, cred); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); error = nfs_bioread_check_cons(vp, td, cred); @@ -951,7 +951,7 @@ flush_and_restart: if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes * would exceed the local maximum per-file write commit size when @@ -1255,12 +1255,8 @@ nfs_getcacheblk(struct vnode *vp, daddr_ bp = getblk(vp, bn, size, 0, 0, 0); } - if (vp->v_type == VREG) { - int biosize; - - biosize = mp->mnt_stat.f_iosize; - bp->b_blkno = bn * (biosize / DEV_BSIZE); - } + if (vp->v_type == VREG) + bp->b_blkno = bn * (vp->v_bufobj.bo_bsize / DEV_BSIZE); return (bp); } @@ -1767,7 +1763,7 @@ nfs_meta_setsize(struct vnode *vp, struc { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; - int biosize = vp->v_mount->mnt_stat.f_iosize; + int biosize = vp->v_bufobj.bo_bsize; int error = 0; mtx_lock(&np->n_mtx); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 03:34:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 363AF106566B; Fri, 10 Feb 2012 03:34:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF0D8FC08; Fri, 10 Feb 2012 03:34:33 +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 q1A3YWev051661; Fri, 10 Feb 2012 03:34:32 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A3YWGk051659; Fri, 10 Feb 2012 03:34:32 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201202100334.q1A3YWGk051659@svn.freebsd.org> From: Glen Barber Date: Fri, 10 Feb 2012 03:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231331 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 03:34:33 -0000 Author: gjb (doc committer) Date: Fri Feb 10 03:34:32 2012 New Revision: 231331 URL: http://svn.freebsd.org/changeset/base/231331 Log: Fix date from r231111. Pointy-hat to: gjb (myself, approver of r231111) Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Fri Feb 10 03:32:29 2012 (r231330) +++ head/share/man/man7/ports.7 Fri Feb 10 03:34:32 2012 (r231331) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Feb 06, 2012 +.Dd February 9, 2012 .Dt PORTS 7 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 04:01:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 690261065670; Fri, 10 Feb 2012 04:01:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55EC08FC16; Fri, 10 Feb 2012 04:01: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 q1A41IFu052543; Fri, 10 Feb 2012 04:01:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A41I9L052538; Fri, 10 Feb 2012 04:01:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202100401.q1A41I9L052538@svn.freebsd.org> From: Rick Macklem Date: Fri, 10 Feb 2012 04:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231332 - in stable/8/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 04:01:18 -0000 Author: rmacklem Date: Fri Feb 10 04:01:17 2012 New Revision: 231332 URL: http://svn.freebsd.org/changeset/base/231332 Log: MFC: r230605 A problem with respect to data read through the buffer cache for both NFS clients was reported to freebsd-fs@ under the subject "NFS corruption in recent HEAD" on Nov. 26, 2011. This problem occurred when a TCP mounted root fs was changed to using UDP. I believe that this problem was caused by the change in mnt_stat.f_iosize that occurred because rsize was decreased to the maximum supported by UDP. This patch fixes the problem by using v_bufobj.bo_bsize instead of f_iosize, since the latter is set to f_iosize when the vnode is allocated, but does not change for a given vnode when f_iosize changes. Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c stable/8/sys/fs/nfsclient/nfs_clnode.c stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/nfsclient/nfs_bio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Fri Feb 10 03:34:32 2012 (r231331) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Fri Feb 10 04:01:17 2012 (r231332) @@ -469,7 +469,7 @@ ncl_bioread(struct vnode *vp, struct uio /* No caching/ no readaheads. Just read data into the user buffer */ return ncl_readrpc(vp, uio, cred); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); error = nfs_bioread_check_cons(vp, td, cred); @@ -947,7 +947,7 @@ flush_and_restart: if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes * would exceed the local maximum per-file write commit size when @@ -1251,12 +1251,8 @@ nfs_getcacheblk(struct vnode *vp, daddr_ bp = getblk(vp, bn, size, 0, 0, 0); } - if (vp->v_type == VREG) { - int biosize; - - biosize = mp->mnt_stat.f_iosize; - bp->b_blkno = bn * (biosize / DEV_BSIZE); - } + if (vp->v_type == VREG) + bp->b_blkno = bn * (vp->v_bufobj.bo_bsize / DEV_BSIZE); return (bp); } @@ -1771,7 +1767,7 @@ ncl_meta_setsize(struct vnode *vp, struc { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; - int biosize = vp->v_mount->mnt_stat.f_iosize; + int biosize = vp->v_bufobj.bo_bsize; int error = 0; mtx_lock(&np->n_mtx); Modified: stable/8/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clnode.c Fri Feb 10 03:34:32 2012 (r231331) +++ stable/8/sys/fs/nfsclient/nfs_clnode.c Fri Feb 10 04:01:17 2012 (r231332) @@ -133,6 +133,7 @@ ncl_nget(struct mount *mntp, u_int8_t *f return (error); } vp = nvp; + KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0")); vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Fri Feb 10 03:34:32 2012 (r231331) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Fri Feb 10 04:01:17 2012 (r231332) @@ -189,6 +189,7 @@ nfscl_nget(struct mount *mntp, struct vn return (error); } vp = nvp; + KASSERT(vp->v_bufobj.bo_bsize != 0, ("nfscl_nget: bo_bsize == 0")); vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; Modified: stable/8/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/8/sys/nfsclient/nfs_bio.c Fri Feb 10 03:34:32 2012 (r231331) +++ stable/8/sys/nfsclient/nfs_bio.c Fri Feb 10 04:01:17 2012 (r231332) @@ -467,7 +467,7 @@ nfs_bioread(struct vnode *vp, struct uio /* No caching/ no readaheads. Just read data into the user buffer */ return nfs_readrpc(vp, uio, cred); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); error = nfs_bioread_check_cons(vp, td, cred); @@ -944,7 +944,7 @@ flush_and_restart: if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes * would exceed the local maximum per-file write commit size when @@ -1248,12 +1248,8 @@ nfs_getcacheblk(struct vnode *vp, daddr_ bp = getblk(vp, bn, size, 0, 0, 0); } - if (vp->v_type == VREG) { - int biosize; - - biosize = mp->mnt_stat.f_iosize; - bp->b_blkno = bn * (biosize / DEV_BSIZE); - } + if (vp->v_type == VREG) + bp->b_blkno = bn * (vp->v_bufobj.bo_bsize / DEV_BSIZE); return (bp); } @@ -1760,7 +1756,7 @@ nfs_meta_setsize(struct vnode *vp, struc { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; - int biosize = vp->v_mount->mnt_stat.f_iosize; + int biosize = vp->v_bufobj.bo_bsize; int error = 0; mtx_lock(&np->n_mtx); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 04:08:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1C87106564A; Fri, 10 Feb 2012 04:08:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 659418FC14; Fri, 10 Feb 2012 04:08: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 q1A48M64052780; Fri, 10 Feb 2012 04:08:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A48MB8052778; Fri, 10 Feb 2012 04:08:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100408.q1A48MB8052778@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 04:08:22 +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: r231333 - stable/9/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 04:08:22 -0000 Author: eadler Date: Fri Feb 10 04:08:22 2012 New Revision: 231333 URL: http://svn.freebsd.org/changeset/base/231333 Log: MFC r231111, r231331 PR: 159551 Approved by: gjb Modified: stable/9/share/man/man7/ports.7 Directory Properties: stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/ports.7 ============================================================================== --- stable/9/share/man/man7/ports.7 Fri Feb 10 04:01:17 2012 (r231332) +++ stable/9/share/man/man7/ports.7 Fri Feb 10 04:08:22 2012 (r231333) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2011 +.Dd February 9, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -408,10 +408,13 @@ Directory to put the package in. .It Va PKGFILE The full path to the package. .El -.It Va PREFIX -Where to install things in general -(usually +.It Va LOCALBASE +Where existing things are installed and where to search for files when +resolving dependencies (usually .Pa /usr/local ) . +.It Va PREFIX +Where to install this port (usually set to the same as +.Va LOCALBASE ) . .It Va MASTER_SITES Primary sites for distribution files if not found locally. .It Va PATCH_SITES From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 04:10:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EC62106564A; Fri, 10 Feb 2012 04:10:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE498FC0C; Fri, 10 Feb 2012 04:10:13 +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 q1A4ADTl052872; Fri, 10 Feb 2012 04:10:13 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A4ADc2052870; Fri, 10 Feb 2012 04:10:13 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100410.q1A4ADc2052870@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 04:10:13 +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: r231334 - stable/8/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 04:10:13 -0000 Author: eadler Date: Fri Feb 10 04:10:13 2012 New Revision: 231334 URL: http://svn.freebsd.org/changeset/base/231334 Log: MFC r231111, r231331: ports(7) currently makes no mention of LOCALBASE: fix that PR: 159551 Approved by: gjb Modified: stable/8/share/man/man7/ports.7 Directory Properties: stable/8/share/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/ports.7 ============================================================================== --- stable/8/share/man/man7/ports.7 Fri Feb 10 04:08:22 2012 (r231333) +++ stable/8/share/man/man7/ports.7 Fri Feb 10 04:10:13 2012 (r231334) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2011 +.Dd February 9, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -408,10 +408,13 @@ Directory to put the package in. .It Va PKGFILE The full path to the package. .El -.It Va PREFIX -Where to install things in general -(usually +.It Va LOCALBASE +Where existing things are installed and where to search for files when +resolving dependencies (usually .Pa /usr/local ) . +.It Va PREFIX +Where to install this port (usually set to the same as +.Va LOCALBASE ) . .It Va MASTER_SITES Primary sites for distribution files if not found locally. .It Va PATCH_SITES From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 04:11:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF2A51065670; Fri, 10 Feb 2012 04:11:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD5A48FC08; Fri, 10 Feb 2012 04:11:04 +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 q1A4B4gQ052946; Fri, 10 Feb 2012 04:11:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A4B4qF052944; Fri, 10 Feb 2012 04:11:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100411.q1A4B4qF052944@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 04:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231335 - stable/7/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 04:11:05 -0000 Author: eadler Date: Fri Feb 10 04:11:04 2012 New Revision: 231335 URL: http://svn.freebsd.org/changeset/base/231335 Log: MFC r231111, r231331: ports(7) currently makes no mention of LOCALBASE: fix that PR: 159551 Approved by: gjb Modified: stable/7/share/man/man7/ports.7 Directory Properties: stable/7/share/ (props changed) stable/7/share/man/ (props changed) stable/7/share/man/man7/ (props changed) Modified: stable/7/share/man/man7/ports.7 ============================================================================== --- stable/7/share/man/man7/ports.7 Fri Feb 10 04:10:13 2012 (r231334) +++ stable/7/share/man/man7/ports.7 Fri Feb 10 04:11:04 2012 (r231335) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2011 +.Dd February 9, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -408,10 +408,13 @@ Directory to put the package in. .It Va PKGFILE The full path to the package. .El -.It Va PREFIX -Where to install things in general -(usually +.It Va LOCALBASE +Where existing things are installed and where to search for files when +resolving dependencies (usually .Pa /usr/local ) . +.It Va PREFIX +Where to install this port (usually set to the same as +.Va LOCALBASE ) . .It Va MASTER_SITES Primary sites for distribution files if not found locally. .It Va PATCH_SITES From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 04:44:03 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 902311065673; Fri, 10 Feb 2012 04:44:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id 12C0B8FC14; Fri, 10 Feb 2012 04:44:02 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1A4hv4x010767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Feb 2012 15:44:00 +1100 Date: Fri, 10 Feb 2012 15:43:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar In-Reply-To: Message-ID: <20120210154307.V882@besplex.bde.org> References: <201202092044.q19KiLUT027539@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 04:44:03 -0000 On Thu, 9 Feb 2012, Marcel Moolenaar wrote: > On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > >> Author: eadler >> Date: Thu Feb 9 20:44:20 2012 >> New Revision: 231298 >> URL: http://svn.freebsd.org/changeset/base/231298 >> >> Log: >> Make etc/Makefile more conflict resistant > > Nice. Question though: why not the less verbose > > BIN1 = \ > foo \ > bar \ > baz > > It's probably faster too, and friendlier when > running "make -dv" And it isn't a style bug. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 05:03:18 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 558AF1065670; Fri, 10 Feb 2012 05:03:18 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 80FE614DE0B; Fri, 10 Feb 2012 05:03:15 +0000 (UTC) Message-ID: <4F34A50E.9050906@FreeBSD.org> Date: Thu, 09 Feb 2012 21:03:10 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Marcel Moolenaar References: <201202092044.q19KiLUT027539@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 05:03:18 -0000 On 02/09/2012 14:15, Marcel Moolenaar wrote: > > On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > >> Author: eadler >> Date: Thu Feb 9 20:44:20 2012 >> New Revision: 231298 >> URL: http://svn.freebsd.org/changeset/base/231298 >> >> Log: >> Make etc/Makefile more conflict resistant > > Nice. Question though: why not the less verbose > > BIN1 = \ > foo \ > bar \ > baz Yes, this change should be made to match the style in the rest of src. FWIW, the style Eitan used is what's used in all of the ports category Makefiles (which arguably should also be changed, but that's a whole 'nother windmill to tilt at). Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 05:05:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DD3D1065686; Fri, 10 Feb 2012 05:05:42 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C88F8FC0A; Fri, 10 Feb 2012 05:05:42 +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 q1A55gxG054660; Fri, 10 Feb 2012 05:05:42 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A55grV054658; Fri, 10 Feb 2012 05:05:42 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201202100505.q1A55grV054658@svn.freebsd.org> From: Tim Kientzle Date: Fri, 10 Feb 2012 05:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231336 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 05:05:42 -0000 Author: kientzle Date: Fri Feb 10 05:05:42 2012 New Revision: 231336 URL: http://svn.freebsd.org/changeset/base/231336 Log: Implement -print-file-name=include (which is undocumented but used by some Linux boot loaders). This option prints out the directory holding the include files needed by a freestanding program. The default implementation of this doesn't work on FreeBSD because of the different include file layout. But it's easy to implement: just return /usr/include (or the cross-compiling equivalent). Reviewed by: kan MFC after: 1 week Modified: head/contrib/gcc/gcc.c Modified: head/contrib/gcc/gcc.c ============================================================================== --- head/contrib/gcc/gcc.c Fri Feb 10 04:11:04 2012 (r231335) +++ head/contrib/gcc/gcc.c Fri Feb 10 05:05:42 2012 (r231336) @@ -2696,6 +2696,17 @@ find_a_file (const struct path_prefix *p return xstrdup (DEFAULT_LINKER); #endif +#ifdef FREEBSD_NATIVE + if (! strcmp(name, "include")) + { +#ifdef CROSS_INCLUDE_DIR + return xstrdup(CROSS_INCLUDE_DIR); +#else + return xstrdup(STANDARD_INCLUDE_DIR); +#endif + } +#endif + /* Determine the filename to execute (special case for absolute paths). */ if (IS_ABSOLUTE_PATH (name)) From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:02:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81506106564A; Fri, 10 Feb 2012 06:02:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5505A8FC13; Fri, 10 Feb 2012 06:02: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 q1A62Lg6056378; Fri, 10 Feb 2012 06:02:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A62L8X056376; Fri, 10 Feb 2012 06:02:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100602.q1A62L8X056376@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:02: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: r231337 - stable/8/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:02:21 -0000 Author: bz Date: Fri Feb 10 06:02:21 2012 New Revision: 231337 URL: http://svn.freebsd.org/changeset/base/231337 Log: MFC r224202: Constantly print the command name and if set include the thread name in per-thread mode. Discussed with: jhb Obtained from: Ed Maste at Sandvine Incorporated Sponsored by: Sandvine Incorporated Modified: stable/8/usr.bin/top/machine.c Directory Properties: stable/8/usr.bin/top/ (props changed) Modified: stable/8/usr.bin/top/machine.c ============================================================================== --- stable/8/usr.bin/top/machine.c Fri Feb 10 05:05:42 2012 (r231336) +++ stable/8/usr.bin/top/machine.c Fri Feb 10 06:02:21 2012 (r231337) @@ -831,7 +831,8 @@ format_next_process(caddr_t handle, char if (!(flags & FMT_SHOWARGS)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_ocomm[0]) { - snprintf(cmdbuf, cmdlengthdelta, "{%s}", pp->ki_ocomm); + snprintf(cmdbuf, cmdlengthdelta, "%s{%s}", pp->ki_comm, + pp->ki_ocomm); } else { snprintf(cmdbuf, cmdlengthdelta, "%s", pp->ki_comm); } @@ -843,7 +844,7 @@ format_next_process(caddr_t handle, char if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_ocomm[0]) { snprintf(cmdbuf, cmdlengthdelta, - "{%s}", pp->ki_ocomm); + "[%s{%s}]", pp->ki_comm, pp->ki_ocomm); } else { snprintf(cmdbuf, cmdlengthdelta, "[%s]", pp->ki_comm); @@ -887,12 +888,23 @@ format_next_process(caddr_t handle, char dst--; *dst = '\0'; - if (strcmp(cmd, pp->ki_comm) != 0 ) - snprintf(cmdbuf, cmdlengthdelta, - "%s (%s)",argbuf, pp->ki_comm); - else - strlcpy(cmdbuf, argbuf, cmdlengthdelta); - + if (strcmp(cmd, pp->ki_comm) != 0 ) { + if (ps.thread && pp->ki_flag & P_HADTHREADS && + pp->ki_ocomm[0]) + snprintf(cmdbuf, cmdlengthdelta, + "%s (%s){%s}", argbuf, pp->ki_comm, + pp->ki_ocomm); + else + snprintf(cmdbuf, cmdlengthdelta, + "%s (%s)", argbuf, pp->ki_comm); + } else { + if (ps.thread && pp->ki_flag & P_HADTHREADS && + pp->ki_ocomm[0]) + snprintf(cmdbuf, cmdlengthdelta, + "%s{%s}", argbuf, pp->ki_ocomm); + else + strlcpy(cmdbuf, argbuf, cmdlengthdelta); + } free(argbuf); } } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:06:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 981AA106566C; Fri, 10 Feb 2012 06:06:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 864358FC12; Fri, 10 Feb 2012 06:06: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 q1A66PCf056578; Fri, 10 Feb 2012 06:06:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A66Pft056576; Fri, 10 Feb 2012 06:06:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100606.q1A66Pft056576@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:06:25 +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: r231338 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:06:25 -0000 Author: bz Date: Fri Feb 10 06:06:25 2012 New Revision: 231338 URL: http://svn.freebsd.org/changeset/base/231338 Log: MFC r223259: Correct a typo in the function name. Modified: stable/8/share/man/man9/device_get_sysctl.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/device_get_sysctl.9 ============================================================================== --- stable/8/share/man/man9/device_get_sysctl.9 Fri Feb 10 06:02:21 2012 (r231337) +++ stable/8/share/man/man9/device_get_sysctl.9 Fri Feb 10 06:06:25 2012 (r231338) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2006 +.Dd June 18, 2011 .Dt DEVICE_GET_SYSCTL 9 .Os .Sh NAME @@ -49,7 +49,7 @@ This node can be accessed with the .Fn device_get_sysctl_tree function. The context for the node can be obtained with the -.Fn device_get_sysctl_ctl +.Fn device_get_sysctl_ctx function. .Sh SEE ALSO .Xr device 9 From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:06:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C954B106564A; Fri, 10 Feb 2012 06:06:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B79378FC13; Fri, 10 Feb 2012 06:06: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 q1A66UHF056617; Fri, 10 Feb 2012 06:06:30 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A66UFm056615; Fri, 10 Feb 2012 06:06:30 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100606.q1A66UFm056615@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:06:30 +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: r231339 - stable/7/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:06:30 -0000 Author: bz Date: Fri Feb 10 06:06:30 2012 New Revision: 231339 URL: http://svn.freebsd.org/changeset/base/231339 Log: MFC r223259: Correct a typo in the function name. Modified: stable/7/share/man/man9/device_get_sysctl.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/device_get_sysctl.9 ============================================================================== --- stable/7/share/man/man9/device_get_sysctl.9 Fri Feb 10 06:06:25 2012 (r231338) +++ stable/7/share/man/man9/device_get_sysctl.9 Fri Feb 10 06:06:30 2012 (r231339) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2006 +.Dd June 18, 2011 .Dt DEVICE_GET_SYSCTL 9 .Os .Sh NAME @@ -49,7 +49,7 @@ This node can be accessed with the .Fn device_get_sysctl_tree function. The context for the node can be obtained with the -.Fn device_get_sysctl_ctl +.Fn device_get_sysctl_ctx function. .Sh SEE ALSO .Xr device 9 From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:12:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01BD106564A; Fri, 10 Feb 2012 06:12:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEA208FC0A; Fri, 10 Feb 2012 06:12:48 +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 q1A6CmOO056869; Fri, 10 Feb 2012 06:12:48 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6Cmin056867; Fri, 10 Feb 2012 06:12:48 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100612.q1A6Cmin056867@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:12:48 +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: r231340 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:12:48 -0000 Author: bz Date: Fri Feb 10 06:12:48 2012 New Revision: 231340 URL: http://svn.freebsd.org/changeset/base/231340 Log: MFC r223334: Leave an extra comment about flowtable and IPv6 support rectifying a previous comment (r206024 in stable/8) to not forget things here in the future as well and merge the changes without conflicts. Modified: stable/8/sys/net/route.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Fri Feb 10 06:06:30 2012 (r231339) +++ stable/8/sys/net/route.c Fri Feb 10 06:12:48 2012 (r231340) @@ -1188,6 +1188,7 @@ rtrequest1_fib(int req, struct rt_addrin rt0 = NULL; /* XXX * "flow-table" only support IPv4 at the moment. + * XXX-BZ as of r205066 it would support IPv6. */ #ifdef INET if (dst->sa_family == AF_INET) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:30:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F6B4106564A; Fri, 10 Feb 2012 06:30:53 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E74B8FC0A; Fri, 10 Feb 2012 06:30: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 q1A6UroA057501; Fri, 10 Feb 2012 06:30:53 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6UrWd057499; Fri, 10 Feb 2012 06:30:53 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202100630.q1A6UrWd057499@svn.freebsd.org> From: Kevin Lo Date: Fri, 10 Feb 2012 06:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231341 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:30:53 -0000 Author: kevlo Date: Fri Feb 10 06:30:52 2012 New Revision: 231341 URL: http://svn.freebsd.org/changeset/base/231341 Log: Add a missing break. This bug was introduced in r228856. Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Fri Feb 10 06:12:48 2012 (r231340) +++ head/sys/kern/kern_tc.c Fri Feb 10 06:30:52 2012 (r231341) @@ -1085,6 +1085,7 @@ sysclock_snap2bintime(struct sysclock_sn /* Boot time adjustment, for uptime/monotonic clocks. */ if (flags & FFCLOCK_UPTIME) bintime_sub(bt, &ffclock_boottime); + break; #endif default: return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:33:03 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE4CA106566B; Fri, 10 Feb 2012 06:33:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE4B8FC12; Fri, 10 Feb 2012 06:33:02 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1A6X0YG015616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Feb 2012 17:33:01 +1100 Date: Fri, 10 Feb 2012 17:32:59 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kirk McKusick In-Reply-To: <201202092234.q19MYGEJ040871@svn.freebsd.org> Message-ID: <20120210154420.F882@besplex.bde.org> References: <201202092234.q19MYGEJ040871@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231313 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:33:03 -0000 On Thu, 9 Feb 2012, Kirk McKusick wrote: > Log: > Historically when an application wrote an entire block of a file, > the kernel allocated a buffer but did not zero it as it was about > to be completely filled by a uiomove() from the user's buffer. > However, if the uiomove() failed, the old contents of the buffer > could be exposed especially if the file was being mmap'ed. The > fix was to always zero the buffer when it was allocated. > > This change first attempts the uiomove() to the newly allocated > (and dirty) buffer and only zeros it if the uiomove() fails. The > effect is to eliminate the gratuitous zeroing of the buffer in > the usual case where the uiomove() successfully fills it. Lately I have been thinking again of the error handling near here: % if (error) { % if (ioflag & IO_UNIT) { % (void)ffs_truncate(vp, osize, % IO_NORMAL | (ioflag & IO_SYNC), % ap->a_cred, uio->uio_td); % uio->uio_offset -= resid - uio->uio_resid; % uio->uio_resid = resid; % } % } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) % error = ffs_update(vp, 1); This attempts to back out of the whole write after an error. But it is impossible to back out of a write in the middle of the file (unless you save all the blocks written to, and don't get more i/o errors trying to restore them). The above makes various messes trying, and even breaks some cases where the write is at the end of the file: suppose error != 0 and that some i/o has been done successfully (otherwise there is no problem): - suppose IO_UNIT is not set. Then the above fails to do anything. Even if not backing out is correct in this case, it is necessary to call ffs_update(vp, 1) under the condition where it is called in the non-error case, irrespective of whether the write is at the end of the file. But I think the existence of IO_UNIT is a bug. It is only used here and in VOP_WRITE() for some other file systems not including zfs. The others that use it are ext2fs, msdosfs and xfs (don't forget to change their VOPs when changing ffs). The 2 nfsclients have a comment saying that IO_UNIT is not used because all writes are atomic. IO_UNIT is also passed to VOP_READ(), but it is not used by any read VOPs. IO_UNIT is always set by vn_write(). Thus it is set in almost all cases. And I can't find any cases where it is not set, using grep in kern. Thus its existence does nothing except to make it hard to verify that it works correctly because it always has no effect. - suppose that IO_UNIT is set. - we don't check that ffs_truncate() succeeded, and we even explicitly (void) it, though we should check. We blindly proceed to resetting the i/o count, so that upper layers see the error and don't see the amount written, although the file may have been extended, depending on the details of how the truncation failed. - when the write is not at EOF and doesn't extend beyond the original end, ffs_truncate() usually succeeds and has no visible effect. We blindy proceed to resetting the i/o count, so that upper layers see the error and don't see the amount successfully written, although this amount is nonzero (since I specified that this case writes something before hitting the error). Upper layers also get no indication of the amount of clobbered bytes beyond the end of the successively written bytes. POSIX write semantics work very badly here. If we never return a short write, but always convert it to an error (this needs just a bit more force than the above, and might be the natural result of fixing these bugs), then writers should assume that the file is damaged for the whole region of the file that the write was attempted on, but for short writes, writers should be able to assume no damage. - when the write is not at EOF but extends beyond the original end, there is a combination of the above bugs. Just before here, we turn off the set*id bits if some i/o was done. This is unnecessary if there was an error and the i/o is successfully backed out of in a non-buggy way. But it is safer to do it anyway. It would be even safer to do it after any error. My version has the following (mostly wrong) comments and (mostly right) fixes in this area: % Index: ffs_vnops.c % =================================================================== % RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vnops.c,v % retrieving revision 1.130 % diff -u -2 -r1.130 ffs_vnops.c % --- ffs_vnops.c 21 May 2004 12:05:48 -0000 1.130 % +++ ffs_vnops.c 28 Sep 2010 10:45:17 -0000 % @@ -719,4 +722,8 @@ % * we clear the setuid and setgid bits as a precaution against % * tampering. % + * XXX too late, the tamperer may have opened the file while we % + * were writing the data (or before). % + * XXX too early, if (error && ioflag & IO_UNIT) then we will % + * unwrite the data. % */ % if (resid > uio->uio_resid && ap->a_cred && Probably wrong. Exlusive access should prevent problems. % @@ -725,7 +732,12 @@ % DIP(ip, i_mode) = ip->i_mode; % } % + /* XXX this seems to be misplaced. Which resid? */ % if (resid > uio->uio_resid) % VN_KNOTE(vp, NOTE_WRITE | (extended ? NOTE_EXTEND : 0)); This seems to have been fixed in -current, by moving the note taking to vfs, so it is now done after the back-out. % if (error) { % + /* % + * XXX should truncate to the last successfully written % + * data if the uiomove() failed. % + */ % if (ioflag & IO_UNIT) { % (void)UFS_TRUNCATE(vp, osize, Not a good idea -- see above. % @@ -735,6 +747,11 @@ % uio->uio_resid = resid; % } % - } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) % - error = UFS_UPDATE(vp, 1); % + } % + % + if (uio->uio_resid != resid) { % + ip->i_flag |= IN_CHANGE | IN_UPDATE; % + if (ioflag & IO_SYNC) % + error = UFS_UPDATE(vp, 1); % + } % return (error); % } This fixes 2 bugs: - spurious setting of IN_CHANGE | IN_UPDATE after backing out of the i/o. However, this enlarges the bugs when the backout just broke the i/o count by resetting it -- now the flags are not set despite the i/o having done some combination of successfully changing the file in the middle and clobbering the file in the middle. - 1 of the bugs pointed out above: missing update in the IO_SYNC subcase of the error case. Again this enlarges the bug if the backout just broke the i/o count by resetting it -- now the update is not done despite the i/o being non-null. In FreeBSD-1, I changed the corresponding code to do a bit more: % if (error == EFAULT || error && (ioflag & IO_UNIT)) { % (void) itrunc(ip, osize, ioflag & IO_SYNC); % uio->uio_offset -= resid - uio->uio_resid; % uio->uio_resid = resid; % } % if (!error && (ioflag & IO_SYNC)) % error = iupdat(ip, &time, &time, 1); This was a primitive incomplete fix for failing uio's. Most uio errors are when write() passes an invalid buffer to probe for security holes. The error for this case is EFAULT, and the backout is done unconditionally in this case. Any user could do this probe because, strangely, IO_UNIT was far from having no effect in FreeBSD-1 -- it was used for most but not all kernel writes (mainly for acct, ktrace and core dumps) but not for user write()s! I didn't know about the problem with mmap() at the time, but planned to fix this better someday. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:34:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1188B106566C; Fri, 10 Feb 2012 06:34:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F31B48FC13; Fri, 10 Feb 2012 06:34: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 q1A6YLJ0057660; Fri, 10 Feb 2012 06:34:21 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6YLLG057658; Fri, 10 Feb 2012 06:34:21 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100634.q1A6YLLG057658@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:34:21 +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: r231342 - stable/9/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:34:22 -0000 Author: ae Date: Fri Feb 10 06:34:21 2012 New Revision: 231342 URL: http://svn.freebsd.org/changeset/base/231342 Log: MFC r228061: The size of APM could be bigger than number of already allocated entries. And the first usable sector should not start from the inside of APM area. MFC r228076: Add an ability to increase number of allocated APM entries when we have reserved free space in the APM area. Also instead of one write request per each APM entry, use MAXPHYS sized writes when we are updating APM. Modified: stable/9/sys/geom/part/g_part_apm.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part_apm.c ============================================================================== --- stable/9/sys/geom/part/g_part_apm.c Fri Feb 10 06:30:52 2012 (r231341) +++ stable/9/sys/geom/part/g_part_apm.c Fri Feb 10 06:34:21 2012 (r231342) @@ -234,6 +234,12 @@ g_part_apm_add(struct g_part_table *base strncpy(entry->ent.ent_name, gpp->gpp_label, sizeof(entry->ent.ent_name)); } + if (baseentry->gpe_index >= table->self.ent_pmblkcnt) + table->self.ent_pmblkcnt = baseentry->gpe_index + 1; + KASSERT(table->self.ent_size >= table->self.ent_pmblkcnt, + ("%s", __func__)); + KASSERT(table->self.ent_size > baseentry->gpe_index, + ("%s", __func__)); return (0); } @@ -443,9 +449,9 @@ g_part_apm_read(struct g_part_table *bas table = (struct g_part_apm_table *)basetable; - basetable->gpt_first = table->self.ent_pmblkcnt + 1; + basetable->gpt_first = table->self.ent_size + 1; basetable->gpt_last = table->ddr.ddr_blkcount - 1; - basetable->gpt_entries = table->self.ent_pmblkcnt - 1; + basetable->gpt_entries = table->self.ent_size - 1; for (index = table->self.ent_pmblkcnt - 1; index > 0; index--) { error = apm_read_ent(cp, index + 1, &ent, table->tivo_series1); @@ -497,67 +503,78 @@ g_part_apm_type(struct g_part_table *bas static int g_part_apm_write(struct g_part_table *basetable, struct g_consumer *cp) { - char buf[512]; + struct g_provider *pp; struct g_part_entry *baseentry; struct g_part_apm_entry *entry; struct g_part_apm_table *table; - int error, index; + char *buf, *ptr; + uint32_t index; + int error; + size_t tblsz; + pp = cp->provider; table = (struct g_part_apm_table *)basetable; /* * Tivo Series 1 disk partitions are currently read-only. */ if (table->tivo_series1) return (EOPNOTSUPP); - bzero(buf, sizeof(buf)); - /* Write the DDR and 'self' entry only when we're newly created. */ + /* Write the DDR only when we're newly created. */ if (basetable->gpt_created) { + buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); be16enc(buf, table->ddr.ddr_sig); be16enc(buf + 2, table->ddr.ddr_blksize); be32enc(buf + 4, table->ddr.ddr_blkcount); - error = g_write_data(cp, 0, buf, sizeof(buf)); + error = g_write_data(cp, 0, buf, pp->sectorsize); + g_free(buf); if (error) return (error); } - be16enc(buf, table->self.ent_sig); - be16enc(buf + 2, 0); - be32enc(buf + 4, table->self.ent_pmblkcnt); + /* Allocate the buffer for all entries */ + tblsz = table->self.ent_pmblkcnt; + buf = g_malloc(tblsz * pp->sectorsize, M_WAITOK | M_ZERO); - if (basetable->gpt_created) { - be32enc(buf + 8, table->self.ent_start); - be32enc(buf + 12, table->self.ent_size); - bcopy(table->self.ent_name, buf + 16, - sizeof(table->self.ent_name)); - bcopy(table->self.ent_type, buf + 48, - sizeof(table->self.ent_type)); - error = g_write_data(cp, 512, buf, sizeof(buf)); - if (error) - return (error); - } + /* Fill the self entry */ + be16enc(buf, APM_ENT_SIG); + be32enc(buf + 4, table->self.ent_pmblkcnt); + be32enc(buf + 8, table->self.ent_start); + be32enc(buf + 12, table->self.ent_size); + bcopy(table->self.ent_name, buf + 16, sizeof(table->self.ent_name)); + bcopy(table->self.ent_type, buf + 48, sizeof(table->self.ent_type)); baseentry = LIST_FIRST(&basetable->gpt_entry); - for (index = 1; index <= basetable->gpt_entries; index++) { + for (index = 1; index < tblsz; index++) { entry = (baseentry != NULL && index == baseentry->gpe_index) ? (struct g_part_apm_entry *)baseentry : NULL; + ptr = buf + index * pp->sectorsize; + be16enc(ptr, APM_ENT_SIG); + be32enc(ptr + 4, table->self.ent_pmblkcnt); if (entry != NULL && !baseentry->gpe_deleted) { - be32enc(buf + 8, entry->ent.ent_start); - be32enc(buf + 12, entry->ent.ent_size); - bcopy(entry->ent.ent_name, buf + 16, + be32enc(ptr + 8, entry->ent.ent_start); + be32enc(ptr + 12, entry->ent.ent_size); + bcopy(entry->ent.ent_name, ptr + 16, sizeof(entry->ent.ent_name)); - bcopy(entry->ent.ent_type, buf + 48, + bcopy(entry->ent.ent_type, ptr + 48, sizeof(entry->ent.ent_type)); } else { - bzero(buf + 8, 4 + 4 + 32 + 32); - strcpy(buf + 48, APM_ENT_TYPE_UNUSED); + strcpy(ptr + 48, APM_ENT_TYPE_UNUSED); } - error = g_write_data(cp, (index + 1) * 512, buf, sizeof(buf)); - if (error) - return (error); if (entry != NULL) baseentry = LIST_NEXT(baseentry, gpe_entry); } + for (index = 0; index < tblsz; index += MAXPHYS / pp->sectorsize) { + error = g_write_data(cp, (1 + index) * pp->sectorsize, + buf + index * pp->sectorsize, + (tblsz - index > MAXPHYS / pp->sectorsize) ? MAXPHYS: + (tblsz - index) * pp->sectorsize); + if (error) { + g_free(buf); + return (error); + } + } + g_free(buf); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:35:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FFD8106566C; Fri, 10 Feb 2012 06:35:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D5C98FC19; Fri, 10 Feb 2012 06:35: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 q1A6ZEnE057726; Fri, 10 Feb 2012 06:35:14 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6ZEhX057724; Fri, 10 Feb 2012 06:35:14 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100635.q1A6ZEhX057724@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:35: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: r231343 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:35:15 -0000 Author: ae Date: Fri Feb 10 06:35:14 2012 New Revision: 231343 URL: http://svn.freebsd.org/changeset/base/231343 Log: MFC r228061: The size of APM could be bigger than number of already allocated entries. And the first usable sector should not start from the inside of APM area. MFC r228076: Add an ability to increase number of allocated APM entries when we have reserved free space in the APM area. Also instead of one write request per each APM entry, use MAXPHYS sized writes when we are updating APM. Modified: stable/8/sys/geom/part/g_part_apm.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part_apm.c ============================================================================== --- stable/8/sys/geom/part/g_part_apm.c Fri Feb 10 06:34:21 2012 (r231342) +++ stable/8/sys/geom/part/g_part_apm.c Fri Feb 10 06:35:14 2012 (r231343) @@ -231,6 +231,12 @@ g_part_apm_add(struct g_part_table *base strncpy(entry->ent.ent_name, gpp->gpp_label, sizeof(entry->ent.ent_name)); } + if (baseentry->gpe_index >= table->self.ent_pmblkcnt) + table->self.ent_pmblkcnt = baseentry->gpe_index + 1; + KASSERT(table->self.ent_size >= table->self.ent_pmblkcnt, + ("%s", __func__)); + KASSERT(table->self.ent_size > baseentry->gpe_index, + ("%s", __func__)); return (0); } @@ -437,9 +443,9 @@ g_part_apm_read(struct g_part_table *bas table = (struct g_part_apm_table *)basetable; - basetable->gpt_first = table->self.ent_pmblkcnt + 1; + basetable->gpt_first = table->self.ent_size + 1; basetable->gpt_last = table->ddr.ddr_blkcount - 1; - basetable->gpt_entries = table->self.ent_pmblkcnt - 1; + basetable->gpt_entries = table->self.ent_size - 1; for (index = table->self.ent_pmblkcnt - 1; index > 0; index--) { error = apm_read_ent(cp, index + 1, &ent, table->tivo_series1); @@ -491,67 +497,78 @@ g_part_apm_type(struct g_part_table *bas static int g_part_apm_write(struct g_part_table *basetable, struct g_consumer *cp) { - char buf[512]; + struct g_provider *pp; struct g_part_entry *baseentry; struct g_part_apm_entry *entry; struct g_part_apm_table *table; - int error, index; + char *buf, *ptr; + uint32_t index; + int error; + size_t tblsz; + pp = cp->provider; table = (struct g_part_apm_table *)basetable; /* * Tivo Series 1 disk partitions are currently read-only. */ if (table->tivo_series1) return (EOPNOTSUPP); - bzero(buf, sizeof(buf)); - /* Write the DDR and 'self' entry only when we're newly created. */ + /* Write the DDR only when we're newly created. */ if (basetable->gpt_created) { + buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); be16enc(buf, table->ddr.ddr_sig); be16enc(buf + 2, table->ddr.ddr_blksize); be32enc(buf + 4, table->ddr.ddr_blkcount); - error = g_write_data(cp, 0, buf, sizeof(buf)); + error = g_write_data(cp, 0, buf, pp->sectorsize); + g_free(buf); if (error) return (error); } - be16enc(buf, table->self.ent_sig); - be16enc(buf + 2, 0); - be32enc(buf + 4, table->self.ent_pmblkcnt); + /* Allocate the buffer for all entries */ + tblsz = table->self.ent_pmblkcnt; + buf = g_malloc(tblsz * pp->sectorsize, M_WAITOK | M_ZERO); - if (basetable->gpt_created) { - be32enc(buf + 8, table->self.ent_start); - be32enc(buf + 12, table->self.ent_size); - bcopy(table->self.ent_name, buf + 16, - sizeof(table->self.ent_name)); - bcopy(table->self.ent_type, buf + 48, - sizeof(table->self.ent_type)); - error = g_write_data(cp, 512, buf, sizeof(buf)); - if (error) - return (error); - } + /* Fill the self entry */ + be16enc(buf, APM_ENT_SIG); + be32enc(buf + 4, table->self.ent_pmblkcnt); + be32enc(buf + 8, table->self.ent_start); + be32enc(buf + 12, table->self.ent_size); + bcopy(table->self.ent_name, buf + 16, sizeof(table->self.ent_name)); + bcopy(table->self.ent_type, buf + 48, sizeof(table->self.ent_type)); baseentry = LIST_FIRST(&basetable->gpt_entry); - for (index = 1; index <= basetable->gpt_entries; index++) { + for (index = 1; index < tblsz; index++) { entry = (baseentry != NULL && index == baseentry->gpe_index) ? (struct g_part_apm_entry *)baseentry : NULL; + ptr = buf + index * pp->sectorsize; + be16enc(ptr, APM_ENT_SIG); + be32enc(ptr + 4, table->self.ent_pmblkcnt); if (entry != NULL && !baseentry->gpe_deleted) { - be32enc(buf + 8, entry->ent.ent_start); - be32enc(buf + 12, entry->ent.ent_size); - bcopy(entry->ent.ent_name, buf + 16, + be32enc(ptr + 8, entry->ent.ent_start); + be32enc(ptr + 12, entry->ent.ent_size); + bcopy(entry->ent.ent_name, ptr + 16, sizeof(entry->ent.ent_name)); - bcopy(entry->ent.ent_type, buf + 48, + bcopy(entry->ent.ent_type, ptr + 48, sizeof(entry->ent.ent_type)); } else { - bzero(buf + 8, 4 + 4 + 32 + 32); - strcpy(buf + 48, APM_ENT_TYPE_UNUSED); + strcpy(ptr + 48, APM_ENT_TYPE_UNUSED); } - error = g_write_data(cp, (index + 1) * 512, buf, sizeof(buf)); - if (error) - return (error); if (entry != NULL) baseentry = LIST_NEXT(baseentry, gpe_entry); } + for (index = 0; index < tblsz; index += MAXPHYS / pp->sectorsize) { + error = g_write_data(cp, (1 + index) * pp->sectorsize, + buf + index * pp->sectorsize, + (tblsz - index > MAXPHYS / pp->sectorsize) ? MAXPHYS: + (tblsz - index) * pp->sectorsize); + if (error) { + g_free(buf); + return (error); + } + } + g_free(buf); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:38:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 080211065670; Fri, 10 Feb 2012 06:38:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA7288FC08; Fri, 10 Feb 2012 06:38:03 +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 q1A6c3cJ057884; Fri, 10 Feb 2012 06:38:03 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6c3jm057882; Fri, 10 Feb 2012 06:38:03 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100638.q1A6c3jm057882@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:38:03 +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: r231344 - stable/9/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:38:04 -0000 Author: ae Date: Fri Feb 10 06:38:03 2012 New Revision: 231344 URL: http://svn.freebsd.org/changeset/base/231344 Log: MFC r230861: The scheme code may not know about some inconsistency in the metadata. So, add an integrity check after recovery attempt. Modified: stable/9/sys/geom/part/g_part.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Fri Feb 10 06:35:14 2012 (r231343) +++ stable/9/sys/geom/part/g_part.c Fri Feb 10 06:38:03 2012 (r231344) @@ -1215,6 +1215,9 @@ g_part_ctl_recover(struct gctl_req *req, if (table->gpt_corrupt) { error = G_PART_RECOVER(table); + if (error == 0) + error = g_part_check_integrity(table, + LIST_FIRST(&gp->consumer)); if (error) { gctl_error(req, "%d recovering '%s' failed", error, gp->name); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:38:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46DC71065674; Fri, 10 Feb 2012 06:38:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 353CF8FC1E; Fri, 10 Feb 2012 06:38: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 q1A6cwWv057945; Fri, 10 Feb 2012 06:38:58 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6cwM0057943; Fri, 10 Feb 2012 06:38:58 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100638.q1A6cwM0057943@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:38:58 +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: r231345 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:38:58 -0000 Author: ae Date: Fri Feb 10 06:38:57 2012 New Revision: 231345 URL: http://svn.freebsd.org/changeset/base/231345 Log: MFC r230861: The scheme code may not know about some inconsistency in the metadata. So, add an integrity check after recovery attempt. Modified: stable/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Fri Feb 10 06:38:03 2012 (r231344) +++ stable/8/sys/geom/part/g_part.c Fri Feb 10 06:38:57 2012 (r231345) @@ -1144,6 +1144,9 @@ g_part_ctl_recover(struct gctl_req *req, if (table->gpt_corrupt) { error = G_PART_RECOVER(table); + if (error == 0) + error = g_part_check_integrity(table, + LIST_FIRST(&gp->consumer)); if (error) { gctl_error(req, "%d recovering '%s' failed", error, gp->name); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:42:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3720106566B; Fri, 10 Feb 2012 06:42:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7A738FC08; Fri, 10 Feb 2012 06:42: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 q1A6g17u058097; Fri, 10 Feb 2012 06:42:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6g1PI058085; Fri, 10 Feb 2012 06:42:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100642.q1A6g1PI058085@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:42:01 +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: r231346 - in stable/8: sbin/ifconfig share/man/man9 sys/kern sys/net sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:42:01 -0000 Author: bz Date: Fri Feb 10 06:42:00 2012 New Revision: 231346 URL: http://svn.freebsd.org/changeset/base/231346 Log: MFC r223735: Add infrastructure to allow all frames/packets received on an interface to be assigned to a non-default FIB instance. Submitted by: cjsp Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) (original versions) Reviewed by: julian Reviewed by: Alexander V. Chernikov (melifaro ipfw.ru) Reviewed by: melifaro Added: stable/8/sbin/ifconfig/iffib.c - copied unchanged from r223735, head/sbin/ifconfig/iffib.c Modified: stable/8/sbin/ifconfig/Makefile stable/8/sbin/ifconfig/ifconfig.8 stable/8/share/man/man9/ifnet.9 stable/8/sys/kern/kern_jail.c stable/8/sys/net/if.c stable/8/sys/net/if.h stable/8/sys/net/if_debug.c stable/8/sys/net/if_var.h stable/8/sys/sys/priv.h stable/8/sys/sys/sockio.h Directory Properties: stable/8/sbin/ifconfig/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/sbin/ifconfig/Makefile ============================================================================== --- stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:42:00 2012 (r231346) @@ -23,6 +23,7 @@ SRCS+= af_nd6.c # ND6 support SRCS+= ifclone.c # clone device support SRCS+= ifmac.c # MAC support SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support +SRCS+= iffib.c # non-default FIB support SRCS+= ifvlan.c # SIOC[GS]ETVLAN support SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:42:00 2012 (r231346) @@ -294,6 +294,19 @@ Remove the interface from the given Fill interface index (lowermost 64bit of an IPv6 address) automatically. +.It Cm fib Ar fib_number +Specify interface FIB. +A FIB +.Ar fib_number +is assigned to all frames or packets received on that interface. +The FIB is not inherited, e.g. vlans or other sub-interfaces will use +the default FIB (0) irrespective of the parent interface's FIB. +The kernel needs to be tuned to support more than the default FIB +using the +.Va ROUTETABLES +kernel configuration option, or the +.Va net.fibs +tunable. .It Cm ipdst This is used to specify an Internet host who is willing to receive IP packets encapsulating IPX packets bound for a remote network. Copied: stable/8/sbin/ifconfig/iffib.c (from r223735, head/sbin/ifconfig/iffib.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sbin/ifconfig/iffib.c Fri Feb 10 06:42:00 2012 (r231346, copy of r223735, head/sbin/ifconfig/iffib.c) @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2011 Alexander V. Chernikov + * Copyright (c) 2011 Christian S.J. Peron + * Copyright (c) 2011 Bjoern A. Zeeb + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "ifconfig.h" + +static void +fib_status(int s) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + + if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) < 0) + return; + + /* Ignore if it is the default. */ + if (ifr.ifr_fib == 0) + return; + + printf("\tfib: %u\n", ifr.ifr_fib); +} + +static void +setiffib(const char *val, int dummy __unused, int s, + const struct afswtch *afp) +{ + unsigned long fib; + char *ep; + + fib = strtoul(val, &ep, 0); + if (*ep != '\0' || fib > UINT_MAX) { + warn("fib %s not valid", val); + return; + } + + strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + ifr.ifr_fib = fib; + if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) + warn("ioctl (SIOCSIFFIB)"); +} + +static struct cmd fib_cmds[] = { + DEF_CMD_ARG("fib", setiffib), +}; + +static struct afswtch af_fib = { + .af_name = "af_fib", + .af_af = AF_UNSPEC, + .af_other_status = fib_status, +}; + +static __constructor void +fib_ctor(void) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + size_t i; + + for (i = 0; i < N(fib_cmds); i++) + cmd_register(&fib_cmds[i]); + af_register(&af_fib); +#undef N +} Modified: stable/8/share/man/man9/ifnet.9 ============================================================================== --- stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:42:00 2012 (r231346) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2007 +.Dd July 3, 2011 .Dt IFNET 9 .Os .Sh NAME @@ -1156,11 +1156,12 @@ list. Caller must have appropriate privilege. (No call-down to driver.) .It Dv SIOCGIFCAP +.It Dv SIOCGIFFIB .It Dv SIOCGIFFLAGS .It Dv SIOCGIFMETRIC .It Dv SIOCGIFMTU .It Dv SIOCGIFPHYS -Get interface capabilities, flags, metric, MTU, medium selection. +Get interface capabilities, FIB, flags, metric, MTU, medium selection. (No call-down to driver.) .Pp .It Dv SIOCSIFCAP @@ -1179,6 +1180,12 @@ and .Va if_data.ifi_hwassist appropriately. .Pp +.It Dv SIOCSIFFIB +Sets interface FIB. +Caller must have appropriate privilege. +FIB values start at 0 and values greater or equals than +.Va net.fibs +are considered invalid. .It Dv SIOCSIFFLAGS Change interface flags. Caller must have appropriate privilege. Modified: stable/8/sys/kern/kern_jail.c ============================================================================== --- stable/8/sys/kern/kern_jail.c Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/kern/kern_jail.c Fri Feb 10 06:42:00 2012 (r231346) @@ -3620,6 +3620,7 @@ prison_priv_check(struct ucred *cred, in case PRIV_NET_LAGG: case PRIV_NET_GIF: case PRIV_NET_SETIFVNET: + case PRIV_NET_SETIFFIB: /* * 802.11-related privileges. Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/net/if.c Fri Feb 10 06:42:00 2012 (r231346) @@ -58,6 +58,8 @@ #include #include #include +#include + #include #include @@ -2195,6 +2197,20 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, free(odescrbuf, M_IFDESCR); break; + case SIOCGIFFIB: + ifr->ifr_fib = ifp->if_fib; + break; + + case SIOCSIFFIB: + error = priv_check(td, PRIV_NET_SETIFFIB); + if (error) + return (error); + if (ifr->ifr_fib >= rt_numfibs) + return (EINVAL); + + ifp->if_fib = ifr->ifr_fib; + break; + case SIOCSIFFLAGS: error = priv_check(td, PRIV_NET_SETIFFLAGS); if (error) Modified: stable/8/sys/net/if.h ============================================================================== --- stable/8/sys/net/if.h Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/net/if.h Fri Feb 10 06:42:00 2012 (r231346) @@ -315,6 +315,7 @@ struct ifreq { int ifru_media; caddr_t ifru_data; int ifru_cap[2]; + u_int ifru_fib; } ifr_ifru; #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ @@ -331,6 +332,7 @@ struct ifreq { #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ #define ifr_index ifr_ifru.ifru_index /* interface index */ +#define ifr_fib ifr_ifru.ifru_fib /* interface fib */ }; #define _SIZEOF_ADDR_IFREQ(ifr) \ Modified: stable/8/sys/net/if_debug.c ============================================================================== --- stable/8/sys/net/if_debug.c Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/net/if_debug.c Fri Feb 10 06:42:00 2012 (r231346) @@ -86,6 +86,7 @@ if_show_ifnet(struct ifnet *ifp) IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); IF_DB_PRINTF("%d", if_snd.altq_type); IF_DB_PRINTF("%x", if_snd.altq_flags); + IF_DB_PRINTF("%u", if_fib); #undef IF_DB_PRINTF } Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/net/if_var.h Fri Feb 10 06:42:00 2012 (r231346) @@ -207,7 +207,8 @@ struct ifnet { char if_cspare[3]; char *if_description; /* interface description */ void *if_pspare[7]; - int if_ispare[4]; + int if_ispare[3]; + u_int if_fib; /* interface FIB */ }; typedef void if_init_f_t(void *); Modified: stable/8/sys/sys/priv.h ============================================================================== --- stable/8/sys/sys/priv.h Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/sys/priv.h Fri Feb 10 06:42:00 2012 (r231346) @@ -336,6 +336,7 @@ #define PRIV_NET_GIF 416 /* Administer gif interface. */ #define PRIV_NET_SETIFVNET 417 /* Move interface to vnet. */ #define PRIV_NET_SETIFDESCR 418 /* Set interface description. */ +#define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ /* * 802.11-related privileges. Modified: stable/8/sys/sys/sockio.h ============================================================================== --- stable/8/sys/sys/sockio.h Fri Feb 10 06:38:57 2012 (r231345) +++ stable/8/sys/sys/sockio.h Fri Feb 10 06:42:00 2012 (r231346) @@ -110,6 +110,9 @@ #define SIOCSIFVNET _IOWR('i', 90, struct ifreq) /* move IF jail/vnet */ #define SIOCSIFRVNET _IOWR('i', 91, struct ifreq) /* reclaim vnet IF */ +#define SIOCGIFFIB _IOWR('i', 92, struct ifreq) /* get IF fib */ +#define SIOCSIFFIB _IOW('i', 93, struct ifreq) /* set IF fib */ + #define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific parameters */ #define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:42:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432CE1065673; Fri, 10 Feb 2012 06:42:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26F228FC1B; Fri, 10 Feb 2012 06:42:51 +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 q1A6gpKP058159; Fri, 10 Feb 2012 06:42:51 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6goSd058155; Fri, 10 Feb 2012 06:42:50 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202100642.q1A6goSd058155@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 06:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231347 - in head/libexec/rtld-elf: . mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:42:51 -0000 Author: gonzo Date: Fri Feb 10 06:42:50 2012 New Revision: 231347 URL: http://svn.freebsd.org/changeset/base/231347 Log: Switch MIPS TLS implementation to Variant I Modified: head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/mips/rtld_machdep.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 06:42:00 2012 (r231346) +++ head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 06:42:50 2012 (r231347) @@ -39,8 +39,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "debug.h" #include "rtld.h" +#include "rtld_printf.h" #ifdef __mips_n64 #define GOT1_MASK 0x8000000000000000UL @@ -528,11 +531,32 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr void allocate_initial_tls(Obj_Entry *objs) { + char *tls; + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic modules to + * use. + */ + tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; + + tls = ((char *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8) + + TLS_TP_OFFSET + TLS_TCB_SIZE); + + sysarch(MIPS_SET_TLS, tls); + rtld_printf("allocate_initial_tls -> %p(%p)\n", tls, tls - TLS_TP_OFFSET - TLS_TCB_SIZE); } void * __tls_get_addr(tls_index* ti) { - return (NULL); + Elf_Addr** tls; + char *p; + + sysarch(MIPS_GET_TLS, &tls); + + p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)tls - TLS_TP_OFFSET + - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset); + + return (p + TLS_DTV_OFFSET); } Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Fri Feb 10 06:42:00 2012 (r231346) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Fri Feb 10 06:42:50 2012 (r231347) @@ -47,21 +47,32 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, #define call_initfini_pointer(obj, target) \ (((InitFunc)(target))()) - + +/* + * TLS + */ + +#define TLS_TP_OFFSET 0x7000 +#define TLS_DTV_OFFSET 0x8000 +#ifdef __mips_n64 +#define TLS_TCB_SIZE 16 +#else +#define TLS_TCB_SIZE 8 +#endif + typedef struct { unsigned long ti_module; unsigned long ti_offset; } tls_index; #define round(size, align) \ - (((size) + (align) - 1) & ~((align) - 1)) + (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(size, align) + round(TLS_TCB_SIZE, align) #define calculate_tls_offset(prev_offset, prev_size, size, align) \ - round(prev_offset + prev_size, align) + round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) - - + /* * Lazy binding entry point, called via PLT. */ Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Feb 10 06:42:00 2012 (r231346) +++ head/libexec/rtld-elf/rtld.c Fri Feb 10 06:42:50 2012 (r231347) @@ -3543,7 +3543,7 @@ tls_get_addr_common(Elf_Addr** dtvp, int /* XXX not sure what variants to use for arm. */ -#if defined(__ia64__) || defined(__powerpc__) +#if defined(__ia64__) || defined(__powerpc__) || defined(__mips__) /* * Allocate Static TLS using the Variant I method. @@ -3625,7 +3625,7 @@ free_tls(void *tcb, size_t tcbsize, size #endif #if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) || \ - defined(__arm__) || defined(__mips__) + defined(__arm__) /* * Allocate Static TLS using the Variant II method. From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:43:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B357B106567A; Fri, 10 Feb 2012 06:43:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 966F78FC08; Fri, 10 Feb 2012 06:43: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 q1A6hHq7058216; Fri, 10 Feb 2012 06:43:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6hHRF058206; Fri, 10 Feb 2012 06:43:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202100643.q1A6hHRF058206@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 06:43:17 +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: r231348 - in stable/7: sbin/ifconfig share/man/man9 sys/net sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:43:17 -0000 Author: bz Date: Fri Feb 10 06:43:16 2012 New Revision: 231348 URL: http://svn.freebsd.org/changeset/base/231348 Log: MFC r223735: Add infrastructure to allow all frames/packets received on an interface to be assigned to a non-default FIB instance. Submitted by: cjsp Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) (original versions) Reviewed by: julian Reviewed by: Alexander V. Chernikov (melifaro ipfw.ru) Reviewed by: melifaro Added: stable/7/sbin/ifconfig/iffib.c - copied unchanged from r223735, head/sbin/ifconfig/iffib.c Modified: stable/7/sbin/ifconfig/Makefile stable/7/sbin/ifconfig/ifconfig.8 stable/7/share/man/man9/ifnet.9 stable/7/sys/net/if.c stable/7/sys/net/if.h stable/7/sys/net/if_var.h stable/7/sys/sys/priv.h stable/7/sys/sys/sockio.h Directory Properties: stable/7/sbin/ifconfig/ (props changed) stable/7/share/man/man9/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sbin/ifconfig/Makefile ============================================================================== --- stable/7/sbin/ifconfig/Makefile Fri Feb 10 06:42:50 2012 (r231347) +++ stable/7/sbin/ifconfig/Makefile Fri Feb 10 06:43:16 2012 (r231348) @@ -22,6 +22,7 @@ SRCS+= af_atalk.c # AppleTalk support SRCS+= ifclone.c # clone device support SRCS+= ifmac.c # MAC support SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support +SRCS+= iffib.c # non-default FIB support SRCS+= ifvlan.c # SIOC[GS]ETVLAN support SRCS+= ifieee80211.c # SIOC[GS]IEEE80211 support SRCS+= ifgre.c # GRE keys etc Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:42:50 2012 (r231347) +++ stable/7/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:43:16 2012 (r231348) @@ -288,6 +288,19 @@ Remove the interface from the given Fill interface index (lowermost 64bit of an IPv6 address) automatically. +.It Cm fib Ar fib_number +Specify interface FIB. +A FIB +.Ar fib_number +is assigned to all frames or packets received on that interface. +The FIB is not inherited, e.g. vlans or other sub-interfaces will use +the default FIB (0) irrespective of the parent interface's FIB. +The kernel needs to be tuned to support more than the default FIB +using the +.Va ROUTETABLES +kernel configuration option, or the +.Va net.fibs +tunable. .It Cm ipdst This is used to specify an Internet host who is willing to receive IP packets encapsulating IPX packets bound for a remote network. Copied: stable/7/sbin/ifconfig/iffib.c (from r223735, head/sbin/ifconfig/iffib.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sbin/ifconfig/iffib.c Fri Feb 10 06:43:16 2012 (r231348, copy of r223735, head/sbin/ifconfig/iffib.c) @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2011 Alexander V. Chernikov + * Copyright (c) 2011 Christian S.J. Peron + * Copyright (c) 2011 Bjoern A. Zeeb + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "ifconfig.h" + +static void +fib_status(int s) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + + if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) < 0) + return; + + /* Ignore if it is the default. */ + if (ifr.ifr_fib == 0) + return; + + printf("\tfib: %u\n", ifr.ifr_fib); +} + +static void +setiffib(const char *val, int dummy __unused, int s, + const struct afswtch *afp) +{ + unsigned long fib; + char *ep; + + fib = strtoul(val, &ep, 0); + if (*ep != '\0' || fib > UINT_MAX) { + warn("fib %s not valid", val); + return; + } + + strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); + ifr.ifr_fib = fib; + if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) + warn("ioctl (SIOCSIFFIB)"); +} + +static struct cmd fib_cmds[] = { + DEF_CMD_ARG("fib", setiffib), +}; + +static struct afswtch af_fib = { + .af_name = "af_fib", + .af_af = AF_UNSPEC, + .af_other_status = fib_status, +}; + +static __constructor void +fib_ctor(void) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + size_t i; + + for (i = 0; i < N(fib_cmds); i++) + cmd_register(&fib_cmds[i]); + af_register(&af_fib); +#undef N +} Modified: stable/7/share/man/man9/ifnet.9 ============================================================================== --- stable/7/share/man/man9/ifnet.9 Fri Feb 10 06:42:50 2012 (r231347) +++ stable/7/share/man/man9/ifnet.9 Fri Feb 10 06:43:16 2012 (r231348) @@ -28,8 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2007 -.Os +.Dd July 3, 2011 .Dt IFNET 9 .Sh NAME .Nm ifnet , @@ -1129,11 +1128,12 @@ list. Caller must have appropriate privilege. (No call-down to driver.) .It Dv SIOCGIFCAP +.It Dv SIOCGIFFIB .It Dv SIOCGIFFLAGS .It Dv SIOCGIFMETRIC .It Dv SIOCGIFMTU .It Dv SIOCGIFPHYS -Get interface capabilities, flags, metric, MTU, medium selection. +Get interface capabilities, FIB, flags, metric, MTU, medium selection. (No call-down to driver.) .Pp .It Dv SIOCSIFCAP @@ -1152,6 +1152,12 @@ and .Va if_data.ifi_hwassist appropriately. .Pp +.It Dv SIOCSIFFIB +Sets interface FIB. +Caller must have appropriate privilege. +FIB values start at 0 and values greater or equals than +.Va net.fibs +are considered invalid. .It Dv SIOCSIFFLAGS Change interface flags. Caller must have appropriate privilege. Modified: stable/7/sys/net/if.c ============================================================================== --- stable/7/sys/net/if.c Fri Feb 10 06:42:50 2012 (r231347) +++ stable/7/sys/net/if.c Fri Feb 10 06:43:16 2012 (r231348) @@ -56,6 +56,8 @@ #include #include #include +#include + #include #include @@ -1683,6 +1685,20 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, ifr->ifr_phys = ifp->if_physical; break; + case SIOCGIFFIB: + ifr->ifr_fib = ifp->if_fib; + break; + + case SIOCSIFFIB: + error = priv_check(td, PRIV_NET_SETIFFIB); + if (error) + return (error); + if (ifr->ifr_fib >= rt_numfibs) + return (EINVAL); + + ifp->if_fib = ifr->ifr_fib; + break; + case SIOCSIFFLAGS: error = priv_check(td, PRIV_NET_SETIFFLAGS); if (error) Modified: stable/7/sys/net/if.h ============================================================================== --- stable/7/sys/net/if.h Fri Feb 10 06:42:50 2012 (r231347) +++ stable/7/sys/net/if.h Fri Feb 10 06:43:16 2012 (r231348) @@ -303,6 +303,7 @@ struct ifreq { int ifru_media; caddr_t ifru_data; int ifru_cap[2]; + u_int ifru_fib; } ifr_ifru; #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ @@ -317,6 +318,7 @@ struct ifreq { #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ #define ifr_index ifr_ifru.ifru_index /* interface index */ +#define ifr_fib ifr_ifru.ifru_fib /* interface fib */ }; #define _SIZEOF_ADDR_IFREQ(ifr) \ Modified: stable/7/sys/net/if_var.h ============================================================================== --- stable/7/sys/net/if_var.h Fri Feb 10 06:42:50 2012 (r231347) +++ stable/7/sys/net/if_var.h Fri Feb 10 06:43:16 2012 (r231348) @@ -187,7 +187,8 @@ struct ifnet { void *if_pf_kif; void *if_lagg; /* lagg glue */ void *if_pspare[10]; /* multiq/TOE 3; vimage 3; general use 4 */ - int if_ispare[2]; /* general use 2 */ + int if_ispare[1]; /* general use */ + u_int if_fib; /* interface FIB */ }; typedef void if_init_f_t(void *); Modified: stable/7/sys/sys/priv.h ============================================================================== --- stable/7/sys/sys/priv.h Fri Feb 10 06:42:50 2012 (r231347) +++ stable/7/sys/sys/priv.h Fri Feb 10 06:43:16 2012 (r231348) @@ -328,6 +328,7 @@ #define PRIV_NET_DELIFADDR 414 /* Delete protocol addr on interface. */ #define PRIV_NET_LAGG 415 /* Administer lagg interface. */ #define PRIV_NET_GIF 416 /* Administer gif interface. */ +#define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ /* * 802.11-related privileges. Modified: stable/7/sys/sys/sockio.h ============================================================================== --- stable/7/sys/sys/sockio.h Fri Feb 10 06:42:50 2012 (r231347) +++ stable/7/sys/sys/sockio.h Fri Feb 10 06:43:16 2012 (r231348) @@ -108,6 +108,9 @@ #define SIOCGPRIVATE_0 _IOWR('i', 80, struct ifreq) /* device private 0 */ #define SIOCGPRIVATE_1 _IOWR('i', 81, struct ifreq) /* device private 1 */ +#define SIOCGIFFIB _IOWR('i', 92, struct ifreq) /* get IF fib */ +#define SIOCSIFFIB _IOW('i', 93, struct ifreq) /* set IF fib */ + #define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific parameters */ #define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:44:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7217E1065673; Fri, 10 Feb 2012 06:44:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 613D08FC0C; Fri, 10 Feb 2012 06:44:31 +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 q1A6iVDs058301; Fri, 10 Feb 2012 06:44:31 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6iVm3058299; Fri, 10 Feb 2012 06:44:31 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100644.q1A6iVm3058299@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231349 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:44:31 -0000 Author: ae Date: Fri Feb 10 06:44:30 2012 New Revision: 231349 URL: http://svn.freebsd.org/changeset/base/231349 Log: Let's be more realistic and limit maximum number of partition to 4k. MFC after: 1 week Modified: head/sys/geom/part/g_part_apm.c Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Fri Feb 10 06:43:16 2012 (r231348) +++ head/sys/geom/part/g_part_apm.c Fri Feb 10 06:44:30 2012 (r231349) @@ -102,7 +102,7 @@ static struct g_part_scheme g_part_apm_s sizeof(struct g_part_apm_table), .gps_entrysz = sizeof(struct g_part_apm_entry), .gps_minent = 16, - .gps_maxent = INT_MAX, + .gps_maxent = 4096, }; G_PART_SCHEME_DECLARE(g_part_apm); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 06:53:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93604106566B; Fri, 10 Feb 2012 06:53:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67CA58FC12; Fri, 10 Feb 2012 06:53: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 q1A6rQa4058609; Fri, 10 Feb 2012 06:53:26 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6rQRb058606; Fri, 10 Feb 2012 06:53:26 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202100653.q1A6rQRb058606@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 06:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231350 - in head/lib/libthr/arch/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:53:26 -0000 Author: gonzo Date: Fri Feb 10 06:53:25 2012 New Revision: 231350 URL: http://svn.freebsd.org/changeset/base/231350 Log: Switch MIPS TLS implementation to Variant I: Save pointer to the TLS structure taking into account TP_OFFSET and TCB structure size. Modified: head/lib/libthr/arch/mips/include/pthread_md.h head/lib/libthr/arch/mips/mips/pthread_md.c Modified: head/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/mips/include/pthread_md.h Fri Feb 10 06:44:30 2012 (r231349) +++ head/lib/libthr/arch/mips/include/pthread_md.h Fri Feb 10 06:53:25 2012 (r231350) @@ -39,15 +39,19 @@ #define CPU_SPINWAIT #define DTV_OFFSET offsetof(struct tcb, tcb_dtv) +#ifdef __mips_n64 +#define TP_OFFSET 0x7010 +#else +#define TP_OFFSET 0x7008 +#endif /* - * Variant II tcb, first two members are required by rtld. + * Variant I tcb. The structure layout is fixed, don't blindly + * change it! */ struct tcb { - struct tcb *tcb_self; /* required by rtld */ - void *tcb_dtv; /* required by rtld */ - struct pthread *tcb_thread; /* our hook */ - void *tcb_spare[1]; + void *tcb_dtv; + struct pthread *tcb_thread; }; /* @@ -61,7 +65,7 @@ static __inline void _tcb_set(struct tcb *tcb) { - sysarch(MIPS_SET_TLS, tcb); + sysarch(MIPS_SET_TLS, ((uint8_t*)tcb + TP_OFFSET)); } /* @@ -70,10 +74,10 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { - void *tcb; + uint8_t *tcb; sysarch(MIPS_GET_TLS, &tcb); - return tcb; + return ((struct tcb *)(tcb - TP_OFFSET)); } extern struct pthread *_thr_initial; Modified: head/lib/libthr/arch/mips/mips/pthread_md.c ============================================================================== --- head/lib/libthr/arch/mips/mips/pthread_md.c Fri Feb 10 06:44:30 2012 (r231349) +++ head/lib/libthr/arch/mips/mips/pthread_md.c Fri Feb 10 06:53:25 2012 (r231350) @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "pthread_md.h" struct tcb * @@ -41,16 +43,17 @@ _tcb_ctor(struct pthread *thread, int in { struct tcb *tcb; - tcb = malloc(sizeof(struct tcb)); - if (tcb) { - bzero(tcb, sizeof(struct tcb)); + tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL, + sizeof(struct tcb), 16); + if (tcb) tcb->tcb_thread = thread; - } + return (tcb); } void _tcb_dtor(struct tcb *tcb) { - free(tcb); + + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:03:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 401791065673; Fri, 10 Feb 2012 07:03:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0A98FC13; Fri, 10 Feb 2012 07:03:46 +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 q1A73kCj059035; Fri, 10 Feb 2012 07:03:46 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A73jum059033; Fri, 10 Feb 2012 07:03:45 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202100703.q1A73jum059033@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 07:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231351 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:03:46 -0000 Author: gonzo Date: Fri Feb 10 07:03:45 2012 New Revision: 231351 URL: http://svn.freebsd.org/changeset/base/231351 Log: Fix-up value passed by thr_new syscall to make it compatible with MIPS_TLS_GET/MIPS_TLS_SET sysarch API. Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Fri Feb 10 06:53:25 2012 (r231350) +++ head/sys/mips/mips/vm_machdep.c Fri Feb 10 07:03:45 2012 (r231351) @@ -601,7 +601,18 @@ int cpu_set_user_tls(struct thread *td, void *tls_base) { - td->td_md.md_tls = tls_base; + /* + * tls_base passed to this function + * from thr_new call and points to actual TCB struct, + * so we should add TP_OFFSET + sizeof(struct tcb) + * to make it the same way TLS base is passed to + * MIPS_SET_TLS/MIPS_GET_TLS API + */ +#ifndef __mips_n64 + td->td_md.md_tls = (char*)tls_base + 0x7010; +#else + td->td_md.md_tls = (char*)tls_base + 0x7008; +#endif return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:19:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64F55106566B; Fri, 10 Feb 2012 07:19:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 520A58FC12; Fri, 10 Feb 2012 07:19:37 +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 q1A7Jb9N059554; Fri, 10 Feb 2012 07:19:37 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7JbVQ059545; Fri, 10 Feb 2012 07:19:37 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100719.q1A7JbVQ059545@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:19:37 +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: r231352 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:19:37 -0000 Author: tuexen Date: Fri Feb 10 07:19:36 2012 New Revision: 231352 URL: http://svn.freebsd.org/changeset/base/231352 Log: MFC r216669: Improve plausibility check in sctp_handle_sack(). Allow cmt_on_off to support values 0 (no CMT), 1 (CMT), and 2 (CMT/RP). Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:19:36 2012 (r231352) @@ -76,12 +76,12 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_nets *net; /*- - * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off == 1) && + * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((asoc->fast_retran_loss_recovery == 0) || - (asoc->sctp_cmt_on_off == 1)) { + (asoc->sctp_cmt_on_off > 0)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* @@ -242,7 +242,7 @@ sctp_cwnd_update_after_sack(struct sctp_ * * Should we stop any running T3 timer here? */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; @@ -262,10 +262,9 @@ sctp_cwnd_update_after_sack(struct sctp_ * CMT fast recovery code */ /* - * if (sctp_cmt_on_off == 1 && - * net->fast_retran_loss_recovery && - * net->will_exit_fast_recovery == 0) { @@@ Do something } - * else if (sctp_cmt_on_off == 0 && + * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery + * && net->will_exit_fast_recovery == 0) { @@@ Do something + * } else if (sctp_cmt_on_off == 0 && * asoc->fast_retran_loss_recovery && will_exit == 0) { */ #endif @@ -284,7 +283,7 @@ sctp_cwnd_update_after_sack(struct sctp_ * moved. */ if (accum_moved || - ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { + ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { /* If the cumulative ack moved we can proceed */ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ @@ -705,12 +704,12 @@ sctp_hs_cwnd_update_after_fr(struct sctp struct sctp_nets *net; /* - * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off == 1) && + * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((asoc->fast_retran_loss_recovery == 0) || - (asoc->sctp_cmt_on_off == 1)) { + (asoc->sctp_cmt_on_off > 0)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* @@ -863,7 +862,7 @@ sctp_hs_cwnd_update_after_sack(struct sc * * Should we stop any running T3 timer here? */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; @@ -883,10 +882,9 @@ sctp_hs_cwnd_update_after_sack(struct sc * CMT fast recovery code */ /* - * if (sctp_cmt_on_off == 1 && - * net->fast_retran_loss_recovery && - * net->will_exit_fast_recovery == 0) { @@@ Do something } - * else if (sctp_cmt_on_off == 0 && + * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery + * && net->will_exit_fast_recovery == 0) { @@@ Do something + * } else if (sctp_cmt_on_off == 0 && * asoc->fast_retran_loss_recovery && will_exit == 0) { */ #endif @@ -905,7 +903,7 @@ sctp_hs_cwnd_update_after_sack(struct sc * moved. */ if (accum_moved || - ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { + ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { /* If the cumulative ack moved we can proceed */ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ @@ -1349,7 +1347,7 @@ sctp_htcp_cwnd_update_after_sack(struct * * Should we stop any running T3 timer here? */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; @@ -1369,10 +1367,9 @@ sctp_htcp_cwnd_update_after_sack(struct * CMT fast recovery code */ /* - * if (sctp_cmt_on_off == 1 && - * net->fast_retran_loss_recovery && - * net->will_exit_fast_recovery == 0) { @@@ Do something } - * else if (sctp_cmt_on_off == 0 && + * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery + * && net->will_exit_fast_recovery == 0) { @@@ Do something + * } else if (sctp_cmt_on_off == 0 && * asoc->fast_retran_loss_recovery && will_exit == 0) { */ #endif @@ -1391,7 +1388,7 @@ sctp_htcp_cwnd_update_after_sack(struct * moved. */ if (accum_moved || - ((asoc->sctp_cmt_on_off == 1) && net->new_pseudo_cumack)) { + ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { htcp_cong_avoid(stcb, net); measure_achieved_throughput(stcb, net); } else { @@ -1427,12 +1424,12 @@ sctp_htcp_cwnd_update_after_fr(struct sc struct sctp_nets *net; /* - * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off == 1) && + * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((asoc->fast_retran_loss_recovery == 0) || - (asoc->sctp_cmt_on_off == 1)) { + (asoc->sctp_cmt_on_off > 0)) { /* out of a RFC2582 Fast recovery window? */ if (net->net_ack > 0) { /* Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:19:36 2012 (r231352) @@ -2476,7 +2476,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i (stcb->asoc.data_pkts_seen >= stcb->asoc.sack_freq) /* hit limit of pkts */ ) { - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) && (stcb->asoc.send_sack == 0) && (stcb->asoc.numduptsns == 0) && @@ -3242,7 +3242,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t } /* CMT DAC algo: finding out if SACK is a mixed SACK */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if (net->saw_newack) @@ -3353,7 +3353,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->sent < SCTP_DATAGRAM_RESEND) { tp1->sent++; } - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /* * CMT DAC algorithm: If SACK flag is set to @@ -3419,7 +3419,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t tp1->sent++; } strike_flag = 1; - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /* * CMT DAC algorithm: If @@ -3480,7 +3480,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->sent < SCTP_DATAGRAM_RESEND) { tp1->sent++; } - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /* * CMT DAC algorithm: If SACK flag is set to @@ -3560,7 +3560,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t SCTP_STAT_INCR(sctps_sendmultfastretrans); } sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); - if (asoc->sctp_cmt_on_off == 1) { + if (asoc->sctp_cmt_on_off > 0) { /* * CMT: Using RTX_SSTHRESH policy for CMT. * If CMT is being used, then pick dest with @@ -4776,7 +4776,7 @@ sctp_handle_sack(struct mbuf *m, int off /*******************************************/ /* cancel ALL T3-send timer if accum moved */ /*******************************************/ - if (asoc->sctp_cmt_on_off == 1) { + if (asoc->sctp_cmt_on_off > 0) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if (net->new_pseudo_cumack) sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, @@ -4797,10 +4797,7 @@ sctp_handle_sack(struct mbuf *m, int off /********************************************/ asoc->last_acked_seq = cum_ack; - tp1 = TAILQ_FIRST(&asoc->sent_queue); - if (tp1 == NULL) - goto done_with_it; - do { + TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (compare_with_wrap(tp1->rec.data.TSN_seq, cum_ack, MAX_TSN)) { break; @@ -4810,26 +4807,17 @@ sctp_handle_sack(struct mbuf *m, int off printf("Warning, tp1->sent == %d and its now acked?\n", tp1->sent); } - tp2 = TAILQ_NEXT(tp1, sctp_next); TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (tp1->pr_sctp_on) { if (asoc->pr_sctp_cnt != 0) asoc->pr_sctp_cnt--; } - if (TAILQ_EMPTY(&asoc->sent_queue) && - (asoc->total_flight > 0)) { -#ifdef INVARIANTS - panic("Warning flight size is postive and should be 0"); -#else - SCTP_PRINTF("Warning flight size incorrect should be 0 is %d\n", - asoc->total_flight); -#endif - asoc->total_flight = 0; - } + asoc->sent_queue_cnt--; if (tp1->data) { /* sa_ignore NO_NULL_CHK */ sctp_free_bufspace(stcb, asoc, tp1, 1); sctp_m_freem(tp1->data); + tp1->data = NULL; if (asoc->peer_supports_prsctp && PR_SCTP_BUF_ENABLED(tp1->flags)) { asoc->sent_queue_cnt_removeable--; } @@ -4842,14 +4830,18 @@ sctp_handle_sack(struct mbuf *m, int off 0, SCTP_LOG_FREE_SENT); } - tp1->data = NULL; - asoc->sent_queue_cnt--; sctp_free_a_chunk(stcb, tp1); wake_him++; - tp1 = tp2; - } while (tp1 != NULL); - -done_with_it: + } + if (TAILQ_EMPTY(&asoc->sent_queue) && (asoc->total_flight > 0)) { +#ifdef INVARIANTS + panic("Warning flight size is postive and should be 0"); +#else + SCTP_PRINTF("Warning flight size incorrect should be 0 is %d\n", + asoc->total_flight); +#endif + asoc->total_flight = 0; + } /* sa_ignore NO_NULL_CHK */ if ((wake_him) && (stcb->sctp_socket)) { #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -5077,7 +5069,7 @@ done_with_it: * to be done. Setting this_sack_lowest_newack to the cum_ack will * automatically ensure that. */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac) && (cmt_dac_flag == 0)) { this_sack_lowest_newack = cum_ack; Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:19:36 2012 (r231352) @@ -623,7 +623,7 @@ sctp_handle_heartbeat_ack(struct sctp_he * timer is running, for the destination, stop the timer because a * PF-heartbeat was received. */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:19:36 2012 (r231352) @@ -3686,7 +3686,7 @@ sctp_lowlevel_chunk_output(struct sctp_i * Stop any running T3 * timers here? */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_OUTPUT1, "Destination %p moved from PF to unreachable.\n", @@ -7325,7 +7325,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb (net == stcb->asoc.primary_destination)) { /* ran dry for primary network net */ SCTP_STAT_INCR(sctps_primary_randry); - } else if (stcb->asoc.sctp_cmt_on_off == 1) { + } else if (stcb->asoc.sctp_cmt_on_off > 0) { /* ran dry with CMT on */ SCTP_STAT_INCR(sctps_cmt_randry); } @@ -7526,7 +7526,7 @@ sctp_med_chunk_output(struct sctp_inpcb *reason_code = 8; return (0); } - if (asoc->sctp_cmt_on_off == 1) { + if (asoc->sctp_cmt_on_off > 0) { /* get the last start point */ start_at = asoc->last_net_cmt_send_started; if (start_at == NULL) { @@ -8028,7 +8028,7 @@ again_one_more_time: } } /* JRI: if dest is in PF state, do not send data to it */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && (net->dest_state & SCTP_ADDR_PF)) { goto no_data_fill; @@ -8036,7 +8036,7 @@ again_one_more_time: if (net->flight_size >= net->cwnd) { goto no_data_fill; } - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (SCTP_BASE_SYSCTL(sctp_buffer_splitting) & SCTP_RECV_BUFFER_SPLITTING) && (net->flight_size > max_rwnd_per_dest)) { goto no_data_fill; @@ -8047,7 +8047,7 @@ again_one_more_time: * net. For now, this is better than nothing and it disabled * by default... */ - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && (SCTP_BASE_SYSCTL(sctp_buffer_splitting) & SCTP_SEND_BUFFER_SPLITTING) && (max_send_per_dest > 0) && (net->flight_size > max_send_per_dest)) { @@ -8268,7 +8268,7 @@ no_data_fill: * restart it. */ sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net); - } else if ((asoc->sctp_cmt_on_off == 1) && + } else if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && pf_hbflag && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) && @@ -9576,7 +9576,7 @@ sctp_chunk_output(struct sctp_inpcb *inp */ if (net->ref_count > 1) sctp_move_chunks_from_net(stcb, net); - } else if ((asoc->sctp_cmt_on_off == 1) && + } else if ((asoc->sctp_cmt_on_off > 0) && (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { /* @@ -10073,7 +10073,7 @@ sctp_send_sack(struct sctp_tcb *stcb) else flags = 0; - if ((asoc->sctp_cmt_on_off == 1) && + if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { /*- * CMT DAC algorithm: If 2 (i.e., 0x10) packets have been Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:19:36 2012 (r231352) @@ -325,9 +325,9 @@ struct sctp_sysctl { #define SCTPCTL_OUTGOING_STREAMS_DEFAULT SCTP_OSTREAM_INITIAL /* cmt_on_off: CMT on/off flag */ -#define SCTPCTL_CMT_ON_OFF_DESC "CMT on/off flag" +#define SCTPCTL_CMT_ON_OFF_DESC "CMT settings" #define SCTPCTL_CMT_ON_OFF_MIN 0 -#define SCTPCTL_CMT_ON_OFF_MAX 1 +#define SCTPCTL_CMT_ON_OFF_MAX 2 #define SCTPCTL_CMT_ON_OFF_DEFAULT 0 /* EY - nr_sack_on_off: NR_SACK on/off flag */ Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 07:19:36 2012 (r231352) @@ -215,7 +215,7 @@ sctp_threshold_management(struct sctp_in * not in PF state. */ /* Stop any running T3 timers here? */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", @@ -850,7 +850,7 @@ start_again: /* * CMT: Do not allow FRs on retransmitted TSNs. */ - if (stcb->asoc.sctp_cmt_on_off == 1) { + if (stcb->asoc.sctp_cmt_on_off > 0) { chk->no_fr_allowed = 1; } #ifdef THIS_SHOULD_NOT_BE_DONE @@ -1005,7 +1005,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * addition, find an alternate destination with PF-based * find_alt_net(). */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { if ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF) { net->dest_state |= SCTP_ADDR_PF; @@ -1014,7 +1014,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, net); } alt = sctp_find_alternate_net(stcb, net, 2); - } else if (stcb->asoc.sctp_cmt_on_off == 1) { + } else if (stcb->asoc.sctp_cmt_on_off > 0) { /* * CMT: Using RTX_SSTHRESH policy for CMT. If CMT is being * used, then pick dest with largest ssthresh for any @@ -1129,7 +1129,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, net->dest_state |= SCTP_ADDR_WAS_PRIMARY; } } - } else if ((stcb->asoc.sctp_cmt_on_off == 1) && + } else if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { /* Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:19:36 2012 (r231352) @@ -292,7 +292,7 @@ sctp_notify(struct sctp_inpcb *inp, * PF state. */ /* Stop any running T3 timers here? */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", @@ -2840,17 +2840,17 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); SCTP_FIND_STCB(inp, stcb, av->assoc_id); if (stcb) { - if (av->assoc_value != 0) - stcb->asoc.sctp_cmt_on_off = 1; - else - stcb->asoc.sctp_cmt_on_off = 0; + stcb->asoc.sctp_cmt_on_off = av->assoc_value; + if (stcb->asoc.sctp_cmt_on_off > 2) { + stcb->asoc.sctp_cmt_on_off = 2; + } SCTP_TCB_UNLOCK(stcb); } else { SCTP_INP_WLOCK(inp); - if (av->assoc_value != 0) - inp->sctp_cmt_on_off = 1; - else - inp->sctp_cmt_on_off = 0; + inp->sctp_cmt_on_off = av->assoc_value; + if (inp->sctp_cmt_on_off > 2) { + inp->sctp_cmt_on_off = 2; + } SCTP_INP_WUNLOCK(inp); } } else { Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 07:03:45 2012 (r231351) +++ stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 07:19:36 2012 (r231352) @@ -426,7 +426,7 @@ sctp6_notify(struct sctp_inpcb *inp, * PF state. */ /* Stop any running T3 timers here? */ - if ((stcb->asoc.sctp_cmt_on_off == 1) && + if ((stcb->asoc.sctp_cmt_on_off > 0) && (stcb->asoc.sctp_cmt_pf > 0)) { net->dest_state &= ~SCTP_ADDR_PF; SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:21:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B490106564A; Fri, 10 Feb 2012 07:21:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F350E8FC08; Fri, 10 Feb 2012 07:21:29 +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 q1A7LTIp059664; Fri, 10 Feb 2012 07:21:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7LTQt059661; Fri, 10 Feb 2012 07:21:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100721.q1A7LTQt059661@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231353 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:21:30 -0000 Author: tuexen Date: Fri Feb 10 07:21:29 2012 New Revision: 231353 URL: http://svn.freebsd.org/changeset/base/231353 Log: MFC r216672: Provide a possibility to configure the inital congestion window to the value defined in RFC 4960. Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:19:36 2012 (r231352) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:21:29 2012 (r231353) @@ -52,15 +52,19 @@ sctp_set_initial_cc_param(struct sctp_tc uint32_t cwnd_in_mtu; assoc = &stcb->asoc; - /* - * We take the minimum of the burst limit and the initial congestion - * window. The initial congestion window is at least two times the - * MTU. - */ cwnd_in_mtu = SCTP_BASE_SYSCTL(sctp_initial_cwnd); - if ((assoc->max_burst > 0) && (cwnd_in_mtu > assoc->max_burst)) - cwnd_in_mtu = assoc->max_burst; - net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + if (cwnd_in_mtu == 0) { + /* Using 0 means that the value of RFC 4960 is used. */ + net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); + } else { + /* + * We take the minimum of the burst limit and the initial + * congestion window. + */ + if ((assoc->max_burst > 0) && (cwnd_in_mtu > assoc->max_burst)) + cwnd_in_mtu = assoc->max_burst; + net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + } net->ssthresh = assoc->peers_rwnd; if (SCTP_BASE_SYSCTL(sctp_logging_level) & Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:19:36 2012 (r231352) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 07:21:29 2012 (r231353) @@ -500,7 +500,7 @@ struct sctp_sysctl { /* Initial congestion window in MTU */ #define SCTPCTL_INITIAL_CWND_DESC "Initial congestion window in MTUs" -#define SCTPCTL_INITIAL_CWND_MIN 1 +#define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:23:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E852D106566C; Fri, 10 Feb 2012 07:23:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC51D8FC0A; Fri, 10 Feb 2012 07:23:42 +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 q1A7NgiT059789; Fri, 10 Feb 2012 07:23:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7NgdR059785; Fri, 10 Feb 2012 07:23:42 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100723.q1A7NgdR059785@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:23:42 +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: r231354 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:23:43 -0000 Author: tuexen Date: Fri Feb 10 07:23:42 2012 New Revision: 231354 URL: http://svn.freebsd.org/changeset/base/231354 Log: MFC r216821: Fix three bugs related to the sequence number wrap-around affecting the processing of ECNE and ASCONF chunks. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:21:29 2012 (r231353) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:23:42 2012 (r231354) @@ -632,7 +632,7 @@ sctp_handle_asconf(struct mbuf *m, unsig asoc = &stcb->asoc; serial_num = ntohl(cp->serial_number); - if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_SEQ) || + if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_TSN) || serial_num == asoc->asconf_seq_in) { /* got a duplicate ASCONF */ SCTPDBG(SCTP_DEBUG_ASCONF1, Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:21:29 2012 (r231353) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:23:42 2012 (r231354) @@ -2946,7 +2946,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch net = lchk->whoTo; break; } - if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_SEQ)) + if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_TSN)) break; lchk = TAILQ_NEXT(lchk, sctp_next); } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:21:29 2012 (r231353) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:23:42 2012 (r231354) @@ -6477,7 +6477,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st if (chk->rec.chunk_id.id == SCTP_ASCONF) { if (chk->data) { acp = mtod(chk->data, struct sctp_asconf_chunk *); - if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_SEQ)) { + if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_TSN)) { /* Not Acked yet */ break; } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:26:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A778106564A; Fri, 10 Feb 2012 07:26:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB7A58FC0C; Fri, 10 Feb 2012 07:26: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 q1A7QjHr059931; Fri, 10 Feb 2012 07:26:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7Qj3P059925; Fri, 10 Feb 2012 07:26:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100726.q1A7Qj3P059925@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:26:45 +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: r231355 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:26:46 -0000 Author: tuexen Date: Fri Feb 10 07:26:45 2012 New Revision: 231355 URL: http://svn.freebsd.org/changeset/base/231355 Log: MFC r216822: Code cleanup: Use LIST_FOREACH, LIST_FOREACH_SAFE, TAILQ_FOREACH, TAILQ_FOREACH_SAFE where appropriate. No functional change. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:23:42 2012 (r231354) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:26:45 2012 (r231355) @@ -656,19 +656,16 @@ sctp_handle_asconf(struct mbuf *m, unsig /* delete old cache */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing firstASCONF. Try to delte old cache\n"); - ack = TAILQ_FIRST(&stcb->asoc.asconf_ack_sent); - while (ack != NULL) { - ack_next = TAILQ_NEXT(ack, next); + TAILQ_FOREACH_SAFE(ack, &asoc->asconf_ack_sent, next, ack_next) { if (ack->serial_number == serial_num) break; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: delete old(%u) < first(%u)\n", ack->serial_number, serial_num); - TAILQ_REMOVE(&stcb->asoc.asconf_ack_sent, ack, next); + TAILQ_REMOVE(&asoc->asconf_ack_sent, ack, next); if (ack->data != NULL) { sctp_m_freem(ack->data); } SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), ack); - ack = ack_next; } } m_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_ack_chunk), 0, @@ -1264,9 +1261,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * struct sockaddr *sa; /* make sure the request isn't already in the queue */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { /* address match? */ if (sctp_asconf_addr_match(aa, &ifa->address.sa) == 0) continue; @@ -1480,9 +1475,7 @@ sctp_asconf_queue_sa_delete(struct sctp_ return (-1); } /* make sure the request isn't already in the queue */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { /* address match? */ if (sctp_asconf_addr_match(aa, sa) == 0) continue; @@ -1836,9 +1829,7 @@ sctp_handle_asconf_ack(struct mbuf *m, i */ if (last_error_id == 0) last_error_id--;/* set to "max" value */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { if (aa->sent == 1) { /* * implicitly successful or failed if correlation_id @@ -2098,14 +2089,11 @@ sctp_asconf_iterator_ep_end(struct sctp_ } } } else if (l->action == SCTP_DEL_IP_ADDRESS) { - laddr = LIST_FIRST(&inp->sctp_addr_list); - while (laddr) { - nladdr = LIST_NEXT(laddr, sctp_nxt_addr); + LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, sctp_nxt_addr, nladdr) { /* remove only after all guys are done */ if (laddr->ifa == ifa) { sctp_del_local_addr_ep(inp, ifa); } - laddr = nladdr; } } } @@ -2285,12 +2273,10 @@ sctp_asconf_iterator_end(void *ptr, uint { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; - struct sctp_laddr *l, *l_next; + struct sctp_laddr *l, *nl; asc = (struct sctp_asconf_iterator *)ptr; - l = LIST_FIRST(&asc->list_of_work); - while (l != NULL) { - l_next = LIST_NEXT(l, sctp_nxt_addr); + LIST_FOREACH_SAFE(l, &asc->list_of_work, sctp_nxt_addr, nl) { ifa = l->ifa; if (l->action == SCTP_ADD_IP_ADDRESS) { /* Clear the defer use flag */ @@ -2299,7 +2285,6 @@ sctp_asconf_iterator_end(void *ptr, uint sctp_free_ifa(ifa); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), l); SCTP_DECR_LADDR_COUNT(); - l = l_next; } SCTP_FREE(asc, SCTP_M_ASC_IT); } @@ -2394,11 +2379,7 @@ sctp_is_addr_pending(struct sctp_tcb *st add_cnt = del_cnt = 0; last_param_type = 0; - for (chk = TAILQ_FIRST(&stcb->asoc.asconf_send_queue); chk != NULL; - chk = nchk) { - /* get next chk */ - nchk = TAILQ_NEXT(chk, sctp_next); - + TAILQ_FOREACH_SAFE(chk, &stcb->asoc.asconf_send_queue, sctp_next, nchk) { if (chk->data == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: No mbuf data?\n"); continue; Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 07:23:42 2012 (r231354) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 07:26:45 2012 (r231355) @@ -77,9 +77,9 @@ static int __sctp_thread_based_iterator_ static void sctp_cleanup_itqueue(void) { - struct sctp_iterator *it; + struct sctp_iterator *it, *nit; - while ((it = TAILQ_FIRST(&sctp_it_ctl.iteratorhead)) != NULL) { + TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { if (it->function_atend != NULL) { (*it->function_atend) (it->pointer, it->val); } Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:23:42 2012 (r231354) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:26:45 2012 (r231355) @@ -344,13 +344,12 @@ sctp_mark_non_revokable(struct sctp_asso static void sctp_service_reassembly(struct sctp_tcb *stcb, struct sctp_association *asoc) { - struct sctp_tmit_chunk *chk; + struct sctp_tmit_chunk *chk, *nchk; uint16_t nxt_todel; uint16_t stream_no; int end = 0; int cntDel; - - struct sctp_queued_to_read *control, *ctl, *ctlat; + struct sctp_queued_to_read *control, *ctl, *nctl; if (stcb == NULL) return; @@ -362,8 +361,7 @@ sctp_service_reassembly(struct sctp_tcb /* socket above is long gone or going.. */ abandon: asoc->fragmented_delivery_inprogress = 0; - chk = TAILQ_FIRST(&asoc->reasmqueue); - while (chk) { + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); asoc->size_on_reasm_queue -= chk->send_size; sctp_ucount_decr(asoc->cnt_on_reasm_queue); @@ -378,16 +376,11 @@ abandon: /* Now free the address and data */ sctp_free_a_chunk(stcb, chk); /* sa_ignore FREED_MEMORY */ - chk = TAILQ_FIRST(&asoc->reasmqueue); } return; } SCTP_TCB_LOCK_ASSERT(stcb); - do { - chk = TAILQ_FIRST(&asoc->reasmqueue); - if (chk == NULL) { - return; - } + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { if (chk->rec.data.TSN_seq != (asoc->tsn_last_delivered + 1)) { /* Can't deliver more :< */ return; @@ -496,33 +489,26 @@ abandon: strm = &asoc->strmin[stream_no]; nxt_todel = strm->last_sequence_delivered + 1; - ctl = TAILQ_FIRST(&strm->inqueue); - if (ctl && (nxt_todel == ctl->sinfo_ssn)) { - while (ctl != NULL) { - /* Deliver more if we can. */ - if (nxt_todel == ctl->sinfo_ssn) { - ctlat = TAILQ_NEXT(ctl, next); - TAILQ_REMOVE(&strm->inqueue, ctl, next); - asoc->size_on_all_streams -= ctl->length; - sctp_ucount_decr(asoc->cnt_on_all_streams); - strm->last_sequence_delivered++; - sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); - sctp_add_to_readq(stcb->sctp_ep, stcb, - ctl, - &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - ctl = ctlat; - } else { - break; - } - nxt_todel = strm->last_sequence_delivered + 1; + TAILQ_FOREACH_SAFE(ctl, &strm->inqueue, next, nctl) { + /* Deliver more if we can. */ + if (nxt_todel == ctl->sinfo_ssn) { + TAILQ_REMOVE(&strm->inqueue, ctl, next); + asoc->size_on_all_streams -= ctl->length; + sctp_ucount_decr(asoc->cnt_on_all_streams); + strm->last_sequence_delivered++; + sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); + sctp_add_to_readq(stcb->sctp_ep, stcb, + ctl, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + } else { + break; } + nxt_todel = strm->last_sequence_delivered + 1; } break; } - /* sa_ignore FREED_MEMORY */ - chk = TAILQ_FIRST(&asoc->reasmqueue); - } while (chk); + } } /* @@ -626,12 +612,10 @@ protocol_error: control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - control = TAILQ_FIRST(&strm->inqueue); - while (control != NULL) { + TAILQ_FOREACH_SAFE(control, &strm->inqueue, next, at) { /* all delivered */ nxt_todel = strm->last_sequence_delivered + 1; if (nxt_todel == control->sinfo_ssn) { - at = TAILQ_NEXT(control, next); TAILQ_REMOVE(&strm->inqueue, control, next); asoc->size_on_all_streams -= control->length; sctp_ucount_decr(asoc->cnt_on_all_streams); @@ -652,7 +636,6 @@ protocol_error: &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - control = at; continue; } break; @@ -756,7 +739,7 @@ sctp_is_all_msg_on_reasm(struct sctp_ass return (0); } tsn = chk->rec.data.TSN_seq; - while (chk) { + TAILQ_FOREACH(chk, &asoc->reasmqueue, sctp_next) { if (tsn != chk->rec.data.TSN_seq) { return (0); } @@ -765,7 +748,6 @@ sctp_is_all_msg_on_reasm(struct sctp_ass return (1); } tsn++; - chk = TAILQ_NEXT(chk, sctp_next); } return (0); } @@ -2090,14 +2072,14 @@ failed_pdapi_express_del: /* first one on */ TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next); } else { - struct sctp_queued_to_read *ctlOn; + struct sctp_queued_to_read *ctlOn, + *nctlOn; unsigned char inserted = 0; - ctlOn = TAILQ_FIRST(&asoc->pending_reply_queue); - while (ctlOn) { + TAILQ_FOREACH_SAFE(ctlOn, &asoc->pending_reply_queue, next, nctlOn) { if (compare_with_wrap(control->sinfo_tsn, ctlOn->sinfo_tsn, MAX_TSN)) { - ctlOn = TAILQ_NEXT(ctlOn, next); + continue; } else { /* found it */ TAILQ_INSERT_BEFORE(ctlOn, control, next); @@ -2166,27 +2148,27 @@ finish_express_del: * pending_reply space 3: distribute any chunks in * pending_reply_queue. */ - struct sctp_queued_to_read *ctl; + struct sctp_queued_to_read *ctl, *nctl; sctp_reset_in_stream(stcb, liste->number_entries, liste->req.list_of_streams); TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); SCTP_FREE(liste, SCTP_M_STRESET); /* sa_ignore FREED_MEMORY */ liste = TAILQ_FIRST(&asoc->resetHead); - ctl = TAILQ_FIRST(&asoc->pending_reply_queue); - if (ctl && (liste == NULL)) { + if (TAILQ_EMPTY(&asoc->resetHead)) { /* All can be removed */ - while (ctl) { + TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { TAILQ_REMOVE(&asoc->pending_reply_queue, ctl, next); sctp_queue_data_to_stream(stcb, asoc, ctl, abort_flag); if (*abort_flag) { return (0); } - ctl = TAILQ_FIRST(&asoc->pending_reply_queue); } - } else if (ctl) { - /* more than one in queue */ - while (!compare_with_wrap(ctl->sinfo_tsn, liste->tsn, MAX_TSN)) { + } else { + TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { + if (compare_with_wrap(ctl->sinfo_tsn, liste->tsn, MAX_TSN)) { + break; + } /* * if ctl->sinfo_tsn is <= liste->tsn we can * process it which is the NOT of @@ -2197,7 +2179,6 @@ finish_express_del: if (*abort_flag) { return (0); } - ctl = TAILQ_FIRST(&asoc->pending_reply_queue); } } /* @@ -3143,8 +3124,7 @@ sctp_check_for_revoked(struct sctp_tcb * struct sctp_tmit_chunk *tp1; int tot_revoked = 0; - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (compare_with_wrap(tp1->rec.data.TSN_seq, cumack, MAX_TSN)) { /* @@ -3196,7 +3176,6 @@ sctp_check_for_revoked(struct sctp_tcb * } if (tp1->sent == SCTP_DATAGRAM_UNSENT) break; - tp1 = TAILQ_NEXT(tp1, sctp_next); } if (tot_revoked > 0) { /* @@ -3252,12 +3231,10 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (stcb->asoc.peer_supports_prsctp) { (void)SCTP_GETTIME_TIMEVAL(&now); } - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { strike_flag = 0; if (tp1->no_fr_allowed) { /* this one had a timeout or something */ - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { @@ -3283,7 +3260,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), SCTP_SO_NOT_LOCKED); } - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } } @@ -3300,7 +3276,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t /* Continue strikin FWD-TSN chunks */ tp1->rec.data.fwd_tsn_cnt++; } - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } /* @@ -3313,7 +3288,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t * CMT, no data sent to this dest can be marked for * FR using this SACK. */ - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } else if (tp1->whoTo && compare_with_wrap(tp1->rec.data.TSN_seq, tp1->whoTo->this_sack_highest_newack, MAX_TSN)) { @@ -3325,7 +3299,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t * this SACK. This step covers part of the DAC algo * and the HTNA algo as well. */ - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } /* @@ -3546,7 +3519,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t } /* Make sure to flag we had a FR */ tp1->whoTo->net_ack++; - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } } @@ -3660,8 +3632,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t atomic_add_int(&alt->ref_count, 1); } } - tp1 = TAILQ_NEXT(tp1, sctp_next); - } /* while (tp1) */ + } if (tot_retrans > 0) { /* @@ -3686,8 +3657,7 @@ sctp_try_advance_peer_ack_point(struct s if (asoc->peer_supports_prsctp == 0) { return (NULL); } - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && tp1->sent != SCTP_DATAGRAM_RESEND) { /* no chance to advance, out of here */ @@ -3711,7 +3681,6 @@ sctp_try_advance_peer_ack_point(struct s (void)SCTP_GETTIME_TIMEVAL(&now); now_filled = 1; } - tp2 = TAILQ_NEXT(tp1, sctp_next); /* * now we got a chunk which is marked for another * retransmission to a PR-stream but has run out its chances @@ -3763,11 +3732,6 @@ sctp_try_advance_peer_ack_point(struct s */ break; } - /* - * If we hit here we just dumped tp1, move to next tsn on - * sent queue. - */ - tp1 = tp2; } return (a_adv); } @@ -3961,9 +3925,7 @@ sctp_express_handle_sack(struct sctp_tcb stcb->asoc.overall_error_count = 0; if (compare_with_wrap(cumack, asoc->last_acked_seq, MAX_TSN)) { /* process the new consecutive TSN first */ - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { - tp2 = TAILQ_NEXT(tp1, sctp_next); + TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (compare_with_wrap(cumack, tp1->rec.data.TSN_seq, MAX_TSN) || cumack == tp1->rec.data.TSN_seq) { @@ -4051,6 +4013,7 @@ sctp_express_handle_sack(struct sctp_tcb /* sa_ignore NO_NULL_CHK */ sctp_free_bufspace(stcb, asoc, tp1, 1); sctp_m_freem(tp1->data); + tp1->data = NULL; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SACK_LOGGING_ENABLE) { sctp_log_sack(asoc->last_acked_seq, @@ -4060,10 +4023,8 @@ sctp_express_handle_sack(struct sctp_tcb 0, SCTP_LOG_FREE_SENT); } - tp1->data = NULL; asoc->sent_queue_cnt--; sctp_free_a_chunk(stcb, tp1); - tp1 = tp2; } else { break; } @@ -4612,8 +4573,7 @@ sctp_handle_sack(struct mbuf *m, int off net->will_exit_fast_recovery = 0; } /* process the new consecutive TSN first */ - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (compare_with_wrap(last_tsn, tp1->rec.data.TSN_seq, MAX_TSN) || last_tsn == tp1->rec.data.TSN_seq) { @@ -4725,7 +4685,6 @@ sctp_handle_sack(struct mbuf *m, int off } else { break; } - tp1 = TAILQ_NEXT(tp1, sctp_next); } biggest_tsn_newly_acked = biggest_tsn_acked = last_tsn; /* always set this up to cum-ack */ @@ -4899,36 +4858,32 @@ sctp_handle_sack(struct mbuf *m, int off } else if (asoc->saw_sack_with_frags) { int cnt_revoked = 0; - tp1 = TAILQ_FIRST(&asoc->sent_queue); - if (tp1 != NULL) { - /* Peer revoked all dg's marked or acked */ - TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { - if (tp1->sent == SCTP_DATAGRAM_ACKED) { - tp1->sent = SCTP_DATAGRAM_SENT; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { - sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE, - tp1->whoTo->flight_size, - tp1->book_size, - (uintptr_t) tp1->whoTo, - tp1->rec.data.TSN_seq); - } - sctp_flight_size_increase(tp1); - sctp_total_flight_increase(stcb, tp1); - tp1->rec.data.chunk_was_revoked = 1; - /* - * To ensure that this increase in - * flightsize, which is artificial, - * does not throttle the sender, we - * also increase the cwnd - * artificially. - */ - tp1->whoTo->cwnd += tp1->book_size; - cnt_revoked++; + /* Peer revoked all dg's marked or acked */ + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { + if (tp1->sent == SCTP_DATAGRAM_ACKED) { + tp1->sent = SCTP_DATAGRAM_SENT; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { + sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE, + tp1->whoTo->flight_size, + tp1->book_size, + (uintptr_t) tp1->whoTo, + tp1->rec.data.TSN_seq); } + sctp_flight_size_increase(tp1); + sctp_total_flight_increase(stcb, tp1); + tp1->rec.data.chunk_was_revoked = 1; + /* + * To ensure that this increase in + * flightsize, which is artificial, does not + * throttle the sender, we also increase the + * cwnd artificially. + */ + tp1->whoTo->cwnd += tp1->book_size; + cnt_revoked++; } - if (cnt_revoked) { - reneged_all = 1; - } + } + if (cnt_revoked) { + reneged_all = 1; } asoc->saw_sack_with_frags = 0; } @@ -5346,9 +5301,7 @@ sctp_kick_prsctp_reorder_queue(struct sc * First deliver anything prior to and including the stream no that * came in */ - ctl = TAILQ_FIRST(&strmin->inqueue); - while (ctl) { - nctl = TAILQ_NEXT(ctl, next); + TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next, nctl) { if (compare_with_wrap(tt, ctl->sinfo_ssn, MAX_SEQ) || (tt == ctl->sinfo_ssn)) { /* this is deliverable now */ @@ -5367,16 +5320,13 @@ sctp_kick_prsctp_reorder_queue(struct sc /* no more delivery now. */ break; } - ctl = nctl; } /* * now we must deliver things in queue the normal way if any are * now ready. */ tt = strmin->last_sequence_delivered + 1; - ctl = TAILQ_FIRST(&strmin->inqueue); - while (ctl) { - nctl = TAILQ_NEXT(ctl, next); + TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next, nctl) { if (tt == ctl->sinfo_ssn) { /* this is deliverable now */ TAILQ_REMOVE(&strmin->inqueue, ctl, next); @@ -5396,7 +5346,6 @@ sctp_kick_prsctp_reorder_queue(struct sc } else { break; } - ctl = nctl; } } @@ -5405,87 +5354,73 @@ sctp_flush_reassm_for_str_seq(struct sct struct sctp_association *asoc, uint16_t stream, uint16_t seq) { - struct sctp_tmit_chunk *chk, *at; + struct sctp_tmit_chunk *chk, *nchk; - if (!TAILQ_EMPTY(&asoc->reasmqueue)) { - /* For each one on here see if we need to toss it */ + /* For each one on here see if we need to toss it */ + /* + * For now large messages held on the reasmqueue that are complete + * will be tossed too. We could in theory do more work to spin + * through and stop after dumping one msg aka seeing the start of a + * new msg at the head, and call the delivery function... to see if + * it can be delivered... But for now we just dump everything on the + * queue. + */ + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { /* - * For now large messages held on the reasmqueue that are - * complete will be tossed too. We could in theory do more - * work to spin through and stop after dumping one msg aka - * seeing the start of a new msg at the head, and call the - * delivery function... to see if it can be delivered... But - * for now we just dump everything on the queue. + * Do not toss it if on a different stream or marked for + * unordered delivery in which case the stream sequence + * number has no meaning. */ - chk = TAILQ_FIRST(&asoc->reasmqueue); - while (chk) { - at = TAILQ_NEXT(chk, sctp_next); - /* - * Do not toss it if on a different stream or marked - * for unordered delivery in which case the stream - * sequence number has no meaning. - */ - if ((chk->rec.data.stream_number != stream) || - ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)) { - chk = at; - continue; + if ((chk->rec.data.stream_number != stream) || + ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)) { + continue; + } + if (chk->rec.data.stream_seq == seq) { + /* It needs to be tossed */ + TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); + if (compare_with_wrap(chk->rec.data.TSN_seq, + asoc->tsn_last_delivered, MAX_TSN)) { + asoc->tsn_last_delivered = chk->rec.data.TSN_seq; + asoc->str_of_pdapi = chk->rec.data.stream_number; + asoc->ssn_of_pdapi = chk->rec.data.stream_seq; + asoc->fragment_flags = chk->rec.data.rcv_flags; } - if (chk->rec.data.stream_seq == seq) { - /* It needs to be tossed */ - TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { - asoc->tsn_last_delivered = - chk->rec.data.TSN_seq; - asoc->str_of_pdapi = - chk->rec.data.stream_number; - asoc->ssn_of_pdapi = - chk->rec.data.stream_seq; - asoc->fragment_flags = - chk->rec.data.rcv_flags; - } - asoc->size_on_reasm_queue -= chk->send_size; - sctp_ucount_decr(asoc->cnt_on_reasm_queue); - - /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { - /* - * We must dump forward this streams - * sequence number if the chunk is - * not unordered that is being - * skipped. There is a chance that - * if the peer does not include the - * last fragment in its FWD-TSN we - * WILL have a problem here since - * you would have a partial chunk in - * queue that may not be - * deliverable. Also if a Partial - * delivery API as started the user - * may get a partial chunk. The next - * read returning a new chunk... - * really ugly but I see no way - * around it! Maybe a notify?? - */ - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = - chk->rec.data.stream_seq; - } - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } - sctp_free_a_chunk(stcb, chk); - } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { - /* - * If the stream_seq is > than the purging - * one, we are done + asoc->size_on_reasm_queue -= chk->send_size; + sctp_ucount_decr(asoc->cnt_on_reasm_queue); + + /* Clear up any stream problem */ + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + SCTP_DATA_UNORDERED && + (compare_with_wrap(chk->rec.data.stream_seq, + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, + MAX_SEQ))) { + /* + * We must dump forward this streams + * sequence number if the chunk is not + * unordered that is being skipped. There is + * a chance that if the peer does not + * include the last fragment in its FWD-TSN + * we WILL have a problem here since you + * would have a partial chunk in queue that + * may not be deliverable. Also if a Partial + * delivery API as started the user may get + * a partial chunk. The next read returning + * a new chunk... really ugly but I see no + * way around it! Maybe a notify?? */ - break; + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq; + } + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; } - chk = at; + sctp_free_a_chunk(stcb, chk); + } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { + /* + * If the stream_seq is > than the purging one, we + * are done + */ + break; } } } @@ -5524,7 +5459,7 @@ sctp_handle_forward_tsn(struct sctp_tcb unsigned int i, fwd_sz, cumack_set_flag, m_size; uint32_t str_seq; struct sctp_stream_in *strm; - struct sctp_tmit_chunk *chk, *at; + struct sctp_tmit_chunk *chk, *nchk; struct sctp_queued_to_read *ctl, *sv; cumack_set_flag = 0; @@ -5618,77 +5553,64 @@ sctp_handle_forward_tsn(struct sctp_tcb if (asoc->fragmented_delivery_inprogress) { sctp_service_reassembly(stcb, asoc); } - if (!TAILQ_EMPTY(&asoc->reasmqueue)) { - /* For each one on here see if we need to toss it */ - /* - * For now large messages held on the reasmqueue that are - * complete will be tossed too. We could in theory do more - * work to spin through and stop after dumping one msg aka - * seeing the start of a new msg at the head, and call the - * delivery function... to see if it can be delivered... But - * for now we just dump everything on the queue. - */ - chk = TAILQ_FIRST(&asoc->reasmqueue); - while (chk) { - at = TAILQ_NEXT(chk, sctp_next); - if ((compare_with_wrap(new_cum_tsn, - chk->rec.data.TSN_seq, MAX_TSN)) || - (new_cum_tsn == chk->rec.data.TSN_seq)) { - /* It needs to be tossed */ - TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { - asoc->tsn_last_delivered = - chk->rec.data.TSN_seq; - asoc->str_of_pdapi = - chk->rec.data.stream_number; - asoc->ssn_of_pdapi = - chk->rec.data.stream_seq; - asoc->fragment_flags = - chk->rec.data.rcv_flags; - } - asoc->size_on_reasm_queue -= chk->send_size; - sctp_ucount_decr(asoc->cnt_on_reasm_queue); - - /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { - /* - * We must dump forward this streams - * sequence number if the chunk is - * not unordered that is being - * skipped. There is a chance that - * if the peer does not include the - * last fragment in its FWD-TSN we - * WILL have a problem here since - * you would have a partial chunk in - * queue that may not be - * deliverable. Also if a Partial - * delivery API as started the user - * may get a partial chunk. The next - * read returning a new chunk... - * really ugly but I see no way - * around it! Maybe a notify?? - */ - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = - chk->rec.data.stream_seq; - } - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } - sctp_free_a_chunk(stcb, chk); - } else { - /* - * Ok we have gone beyond the end of the - * fwd-tsn's mark. + /* For each one on here see if we need to toss it */ + /* + * For now large messages held on the reasmqueue that are complete + * will be tossed too. We could in theory do more work to spin + * through and stop after dumping one msg aka seeing the start of a + * new msg at the head, and call the delivery function... to see if + * it can be delivered... But for now we just dump everything on the + * queue. + */ + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { + if ((compare_with_wrap(new_cum_tsn, + chk->rec.data.TSN_seq, MAX_TSN)) || + (new_cum_tsn == chk->rec.data.TSN_seq)) { + /* It needs to be tossed */ + TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); + if (compare_with_wrap(chk->rec.data.TSN_seq, + asoc->tsn_last_delivered, MAX_TSN)) { + asoc->tsn_last_delivered = chk->rec.data.TSN_seq; + asoc->str_of_pdapi = chk->rec.data.stream_number; + asoc->ssn_of_pdapi = chk->rec.data.stream_seq; + asoc->fragment_flags = chk->rec.data.rcv_flags; + } + asoc->size_on_reasm_queue -= chk->send_size; + sctp_ucount_decr(asoc->cnt_on_reasm_queue); + + /* Clear up any stream problem */ + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + SCTP_DATA_UNORDERED && + (compare_with_wrap(chk->rec.data.stream_seq, + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, + MAX_SEQ))) { + /* + * We must dump forward this streams + * sequence number if the chunk is not + * unordered that is being skipped. There is + * a chance that if the peer does not + * include the last fragment in its FWD-TSN + * we WILL have a problem here since you + * would have a partial chunk in queue that + * may not be deliverable. Also if a Partial + * delivery API as started the user may get + * a partial chunk. The next read returning + * a new chunk... really ugly but I see no + * way around it! Maybe a notify?? */ - break; + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq; } - chk = at; + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } + sctp_free_a_chunk(stcb, chk); + } else { + /* + * Ok we have gone beyond the end of the fwd-tsn's + * mark. + */ + break; } } /*******************************************************/ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:23:42 2012 (r231354) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:26:45 2012 (r231355) @@ -193,7 +193,7 @@ int sctp_is_there_unsent_data(struct sctp_tcb *stcb) { int unsent_data = 0; - struct sctp_stream_queue_pending *sp; + struct sctp_stream_queue_pending *sp, *nsp; struct sctp_stream_out *strq; struct sctp_association *asoc; @@ -205,15 +205,9 @@ sctp_is_there_unsent_data(struct sctp_tc */ asoc = &stcb->asoc; SCTP_TCB_SEND_LOCK(stcb); - if (!TAILQ_EMPTY(&asoc->out_wheel)) { - /* Check to see if some data queued */ - TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) { - is_there_another: - /* sa_ignore FREED_MEMORY */ - sp = TAILQ_FIRST(&strq->outqueue); - if (sp == NULL) { - continue; - } + TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) { + /* sa_ignore FREED_MEMORY */ + TAILQ_FOREACH_SAFE(sp, &strq->outqueue, next, nsp) { if ((sp->msg_is_complete) && (sp->length == 0) && (sp->sender_all_done)) { @@ -230,7 +224,7 @@ sctp_is_there_unsent_data(struct sctp_tc sp->msg_is_complete, sp->put_last_out); } - atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); + atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); if (sp->net) { sctp_free_remote_addr(sp->net); @@ -241,10 +235,9 @@ sctp_is_there_unsent_data(struct sctp_tc sp->data = NULL; } sctp_free_a_strmoq(stcb, sp); - goto is_there_another; } else { unsent_data++; - continue; + break; } } } @@ -280,38 +273,32 @@ sctp_process_init(struct sctp_init_chunk if (asoc->pre_open_streams > ntohs(init->num_inbound_streams)) { unsigned int newcnt; struct sctp_stream_out *outs; - struct sctp_stream_queue_pending *sp; - struct sctp_tmit_chunk *chk, *chk_next; + struct sctp_stream_queue_pending *sp, *nsp; + struct sctp_tmit_chunk *chk, *nchk; /* abandon the upper streams */ newcnt = ntohs(init->num_inbound_streams); - if (!TAILQ_EMPTY(&asoc->send_queue)) { - chk = TAILQ_FIRST(&asoc->send_queue); - while (chk) { - chk_next = TAILQ_NEXT(chk, sctp_next); - if (chk->rec.data.stream_number >= newcnt) { - TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); - asoc->send_queue_cnt--; - if (chk->data != NULL) { - sctp_free_bufspace(stcb, asoc, chk, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED); - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } + TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { + if (chk->rec.data.stream_number >= newcnt) { + TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); + asoc->send_queue_cnt--; + if (chk->data != NULL) { + sctp_free_bufspace(stcb, asoc, chk, 1); + sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED); + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); - /* sa_ignore FREED_MEMORY */ } - chk = chk_next; + sctp_free_a_chunk(stcb, chk); + /* sa_ignore FREED_MEMORY */ } } if (asoc->strmout) { for (i = newcnt; i < asoc->pre_open_streams; i++) { outs = &asoc->strmout[i]; - sp = TAILQ_FIRST(&outs->outqueue); - while (sp) { + TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { TAILQ_REMOVE(&outs->outqueue, sp, next); asoc->stream_queue_cnt--; sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, @@ -328,7 +315,6 @@ sctp_process_init(struct sctp_init_chunk /* Free the chunk */ sctp_free_a_strmoq(stcb, sp); /* sa_ignore FREED_MEMORY */ - sp = TAILQ_FIRST(&outs->outqueue); } } } @@ -355,18 +341,16 @@ sctp_process_init(struct sctp_init_chunk if (asoc->strmin != NULL) { /* Free the old ones */ - struct sctp_queued_to_read *ctl; + struct sctp_queued_to_read *ctl, *nctl; for (i = 0; i < asoc->streamincnt; i++) { - ctl = TAILQ_FIRST(&asoc->strmin[i].inqueue); - while (ctl) { + TAILQ_FOREACH_SAFE(ctl, &asoc->strmin[i].inqueue, next, nctl) { TAILQ_REMOVE(&asoc->strmin[i].inqueue, ctl, next); sctp_free_remote_addr(ctl->whoFrom); ctl->whoFrom = NULL; sctp_m_freem(ctl->data); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:28:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98E10106564A; Fri, 10 Feb 2012 07:28:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856808FC0C; Fri, 10 Feb 2012 07:28:38 +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 q1A7ScP7060038; Fri, 10 Feb 2012 07:28:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7ScvS060030; Fri, 10 Feb 2012 07:28:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100728.q1A7ScvS060030@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:28:38 +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: r231356 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:28:38 -0000 Author: tuexen Date: Fri Feb 10 07:28:37 2012 New Revision: 231356 URL: http://svn.freebsd.org/changeset/base/231356 Log: MFC 216825: Define and use SCTP_SSN_GE, SCTP_SSN_GT, SCTP_TSN_GE, SCTP_TSN_GT macros and use them instead of the generic compare_with_wrap. Retire compare_with_wrap. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 07:28:37 2012 (r231356) @@ -632,8 +632,7 @@ sctp_handle_asconf(struct mbuf *m, unsig asoc = &stcb->asoc; serial_num = ntohl(cp->serial_number); - if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_TSN) || - serial_num == asoc->asconf_seq_in) { + if (SCTP_TSN_GE(asoc->asconf_seq_in, serial_num)) { /* got a duplicate ASCONF */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: got duplicate serial number = %xh\n", Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 07:28:37 2012 (r231356) @@ -322,7 +322,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_VERSION_NUMBER 0x3 #define MAX_TSN 0xffffffff -#define MAX_SEQ 0xffff /* how many executions every N tick's */ #define SCTP_ITERATOR_MAX_AT_ONCE 20 @@ -906,10 +905,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_MAX_DATA_BUNDLING 256 /* modular comparison */ -/* True if a > b (mod = M) */ -#define compare_with_wrap(a, b, M) (((a > b) && ((a - b) < ((M >> 1) + 1))) || \ - ((b > a) && ((b - a) > ((M >> 1) + 1)))) - +/* See RFC 1982 for details. */ +#define SCTP_SSN_GT(a, b) (((a < b) && ((b - a) > (1<<15))) || \ + ((a > b) && ((a - b) < (1<<15)))) +#define SCTP_SSN_GE(a, b) (SCTP_SSN_GT(a, b) || (a == b)) +#define SCTP_TSN_GT(a, b) (((a < b) && ((b - a) > (1<<31))) || \ + ((a > b) && ((a - b) < (1<<31)))) +#define SCTP_TSN_GE(a, b) (SCTP_TSN_GT(a, b) || (a == b)) /* Mapping array manipulation routines */ #define SCTP_IS_TSN_PRESENT(arry, gap) ((arry[(gap >> 3)] >> (gap & 0x07)) & 0x01) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 07:28:37 2012 (r231356) @@ -298,7 +298,7 @@ sctp_mark_non_revokable(struct sctp_asso return; } cumackp1 = asoc->cumulative_tsn + 1; - if (compare_with_wrap(cumackp1, tsn, MAX_TSN)) { + if (SCTP_TSN_GT(cumackp1, tsn)) { /* * this tsn is behind the cum ack and thus we don't need to * worry about it being moved from one to the other. @@ -315,13 +315,12 @@ sctp_mark_non_revokable(struct sctp_asso } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } if (tsn == asoc->highest_tsn_inside_map) { /* We must back down to see what the new highest is */ - for (i = tsn - 1; (compare_with_wrap(i, asoc->mapping_array_base_tsn, MAX_TSN) || - (i == asoc->mapping_array_base_tsn)); i--) { + for (i = tsn - 1; SCTP_TSN_GE(i, asoc->mapping_array_base_tsn); i--) { SCTP_CALC_TSN_TO_GAP(gap, i, asoc->mapping_array_base_tsn); if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { asoc->highest_tsn_inside_map = i; @@ -558,9 +557,7 @@ sctp_queue_data_to_stream(struct sctp_tc (uint32_t) control->sinfo_stream, (uint32_t) strm->last_sequence_delivered, (uint32_t) nxt_todel); - if (compare_with_wrap(strm->last_sequence_delivered, - control->sinfo_ssn, MAX_SEQ) || - (strm->last_sequence_delivered == control->sinfo_ssn)) { + if (SCTP_SSN_GE(strm->last_sequence_delivered, control->sinfo_ssn)) { /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n", control->sinfo_ssn, strm->last_sequence_delivered); @@ -646,9 +643,7 @@ protocol_error: * Ok, we did not deliver this guy, find the correct place * to put it on the queue. */ - if ((compare_with_wrap(asoc->cumulative_tsn, - control->sinfo_tsn, MAX_TSN)) || - (control->sinfo_tsn == asoc->cumulative_tsn)) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, control->sinfo_tsn)) { goto protocol_error; } if (TAILQ_EMPTY(&strm->inqueue)) { @@ -659,8 +654,7 @@ protocol_error: TAILQ_INSERT_HEAD(&strm->inqueue, control, next); } else { TAILQ_FOREACH(at, &strm->inqueue, next) { - if (compare_with_wrap(at->sinfo_ssn, - control->sinfo_ssn, MAX_SEQ)) { + if (SCTP_SSN_GT(at->sinfo_ssn, control->sinfo_ssn)) { /* * one in queue is bigger than the * new one, insert before this one @@ -991,8 +985,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } /* Find its place */ TAILQ_FOREACH(at, &asoc->reasmqueue, sctp_next) { - if (compare_with_wrap(at->rec.data.TSN_seq, - chk->rec.data.TSN_seq, MAX_TSN)) { + if (SCTP_TSN_GT(at->rec.data.TSN_seq, chk->rec.data.TSN_seq)) { /* * one in queue is bigger than the new one, insert * before this one @@ -1383,8 +1376,7 @@ sctp_does_tsn_belong_to_reasm(struct sct uint32_t tsn_est; TAILQ_FOREACH(at, &asoc->reasmqueue, sctp_next) { - if (compare_with_wrap(TSN_seq, - at->rec.data.TSN_seq, MAX_TSN)) { + if (SCTP_TSN_GT(TSN_seq, at->rec.data.TSN_seq)) { /* is it one bigger? */ tsn_est = at->rec.data.TSN_seq + 1; if (tsn_est == TSN_seq) { @@ -1467,8 +1459,7 @@ sctp_process_a_data_chunk(struct sctp_tc return (0); } SCTP_LTRACE_CHK(stcb->sctp_ep, stcb, ch->ch.chunk_type, tsn); - if (compare_with_wrap(asoc->cumulative_tsn, tsn, MAX_TSN) || - asoc->cumulative_tsn == tsn) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { /* It is a duplicate */ SCTP_STAT_INCR(sctps_recvdupdata); if (asoc->numduptsns < SCTP_MAX_DUP_TSNS) { @@ -1492,7 +1483,7 @@ sctp_process_a_data_chunk(struct sctp_tc return (0); } } - if (compare_with_wrap(tsn, *high_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, *high_tsn)) { *high_tsn = tsn; } /* See if we have received this one already */ @@ -1564,8 +1555,8 @@ sctp_process_a_data_chunk(struct sctp_tc #endif } /* now is it in the mapping array of what we have accepted? */ - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN) && - compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_map) && + SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { /* Nope not in the valid range dump it */ sctp_set_rwnd(stcb, asoc); if ((asoc->cnt_on_all_streams + @@ -1610,7 +1601,7 @@ sctp_process_a_data_chunk(struct sctp_tc SCTP_STAT_INCR(sctps_badsid); SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } if (tsn == (asoc->cumulative_tsn + 1)) { @@ -1646,9 +1637,7 @@ sctp_process_a_data_chunk(struct sctp_tc if ((chunk_flags & SCTP_DATA_FIRST_FRAG) && (TAILQ_EMPTY(&asoc->resetHead)) && (chunk_flags & SCTP_DATA_UNORDERED) == 0 && - (compare_with_wrap(asoc->strmin[strmno].last_sequence_delivered, - strmseq, MAX_SEQ) || - asoc->strmin[strmno].last_sequence_delivered == strmseq)) { + SCTP_SSN_GE(asoc->strmin[strmno].last_sequence_delivered, strmseq)) { /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ:%d delivered:%d from peer, Abort!\n", strmseq, asoc->strmin[strmno].last_sequence_delivered); @@ -1759,7 +1748,7 @@ sctp_process_a_data_chunk(struct sctp_tc goto failed_express_del; } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -1813,7 +1802,7 @@ failed_express_del: goto failed_pdapi_express_del; } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } SCTP_STAT_INCR(sctps_recvexpressm); @@ -1847,12 +1836,12 @@ failed_pdapi_express_del: control = NULL; if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } } else { SCTP_SET_TSN_PRESENT(asoc->mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_map)) { asoc->highest_tsn_inside_map = tsn; } } @@ -2062,8 +2051,7 @@ failed_pdapi_express_del: * singletons I must worry about. */ if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && - ((compare_with_wrap(tsn, liste->tsn, MAX_TSN))) - ) { + SCTP_TSN_GT(tsn, liste->tsn)) { /* * yep its past where we need to reset... go * ahead and queue it. @@ -2077,8 +2065,7 @@ failed_pdapi_express_del: unsigned char inserted = 0; TAILQ_FOREACH_SAFE(ctlOn, &asoc->pending_reply_queue, next, nctlOn) { - if (compare_with_wrap(control->sinfo_tsn, - ctlOn->sinfo_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(control->sinfo_tsn, ctlOn->sinfo_tsn)) { continue; } else { /* found it */ @@ -2139,9 +2126,7 @@ finish_express_del: } /* check the special flag for stream resets */ if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && - ((compare_with_wrap(asoc->cumulative_tsn, liste->tsn, MAX_TSN)) || - (asoc->cumulative_tsn == liste->tsn)) - ) { + SCTP_TSN_GE(asoc->cumulative_tsn, liste->tsn)) { /* * we have finished working through the backlogged TSN's now * time to reset streams. 1: call reset function. 2: free @@ -2166,7 +2151,7 @@ finish_express_del: } } else { TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { - if (compare_with_wrap(ctl->sinfo_tsn, liste->tsn, MAX_TSN)) { + if (SCTP_TSN_GT(ctl->sinfo_tsn, liste->tsn)) { break; } /* @@ -2275,8 +2260,8 @@ sctp_slide_mapping_arrays(struct sctp_tc } asoc->cumulative_tsn = asoc->mapping_array_base_tsn + (at - 1); - if (compare_with_wrap(asoc->cumulative_tsn, asoc->highest_tsn_inside_map, MAX_TSN) && - compare_with_wrap(asoc->cumulative_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->cumulative_tsn, asoc->highest_tsn_inside_map) && + SCTP_TSN_GT(asoc->cumulative_tsn, asoc->highest_tsn_inside_nr_map)) { #ifdef INVARIANTS panic("huh, cumack 0x%x greater than high-tsn 0x%x in map", asoc->cumulative_tsn, asoc->highest_tsn_inside_map); @@ -2291,9 +2276,7 @@ sctp_slide_mapping_arrays(struct sctp_tc asoc->highest_tsn_inside_nr_map = asoc->cumulative_tsn; #endif } - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, - asoc->highest_tsn_inside_map, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; @@ -2411,9 +2394,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i uint32_t highest_tsn; asoc = &stcb->asoc; - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, - asoc->highest_tsn_inside_map, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; @@ -2439,7 +2420,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i int is_a_gap; /* is there a gap now ? */ - is_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); + is_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); /* * CMT DAC algorithm: increase number of packets received @@ -2576,12 +2557,12 @@ sctp_process_data(struct mbuf **mm, int m = *mm; SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; } - was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); + was_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); /* * setup where we got the last DATA packet from for any SACK that * may need to go out. Don't bump the net. This is done ONLY when a @@ -2889,8 +2870,8 @@ sctp_process_segment_range(struct sctp_t * via previous Gap Ack Blocks... * i.e. ACKED or RESEND. */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, - *biggest_newly_acked_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + *biggest_newly_acked_tsn)) { *biggest_newly_acked_tsn = tp1->rec.data.TSN_seq; } /*- @@ -2903,9 +2884,8 @@ sctp_process_segment_range(struct sctp_t if (tp1->rec.data.chunk_was_revoked == 0) tp1->whoTo->saw_newack = 1; - if (compare_with_wrap(tp1->rec.data.TSN_seq, - tp1->whoTo->this_sack_highest_newack, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + tp1->whoTo->this_sack_highest_newack)) { tp1->whoTo->this_sack_highest_newack = tp1->rec.data.TSN_seq; } @@ -2989,9 +2969,8 @@ sctp_process_segment_range(struct sctp_t if (tp1->sent <= SCTP_DATAGRAM_RESEND) { (*ecn_seg_sums) += tp1->rec.data.ect_nonce; (*ecn_seg_sums) &= SCTP_SACK_NONCE_SUM; - if (compare_with_wrap(tp1->rec.data.TSN_seq, - stcb->asoc.this_sack_highest_gap, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + stcb->asoc.this_sack_highest_gap)) { stcb->asoc.this_sack_highest_gap = tp1->rec.data.TSN_seq; } @@ -3031,10 +3010,9 @@ sctp_process_segment_range(struct sctp_t } break; } /* if (tp1->TSN_seq == theTSN) */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, theTSN, - MAX_TSN)) + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, theTSN)) { break; - + } tp1 = TAILQ_NEXT(tp1, sctp_next); if ((tp1 == NULL) && (circled == 0)) { circled++; @@ -3092,7 +3070,7 @@ sctp_handle_segments(struct mbuf *m, int /* This gap report is not in order, so restart. */ tp1 = TAILQ_FIRST(&asoc->sent_queue); } - if (compare_with_wrap((last_tsn + frag_end), *biggest_tsn_acked, MAX_TSN)) { + if (SCTP_TSN_GT((last_tsn + frag_end), *biggest_tsn_acked)) { *biggest_tsn_acked = last_tsn + frag_end; } if (i < num_seg) { @@ -3125,19 +3103,16 @@ sctp_check_for_revoked(struct sctp_tcb * int tot_revoked = 0; TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { - if (compare_with_wrap(tp1->rec.data.TSN_seq, cumack, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cumack)) { /* * ok this guy is either ACK or MARKED. If it is * ACKED it has been previously acked but not this * time i.e. revoked. If it is MARKED it was ACK'ed * again. */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, biggest_tsn_acked, - MAX_TSN)) + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, biggest_tsn_acked)) { break; - - + } if (tp1->sent == SCTP_DATAGRAM_ACKED) { /* it has been revoked */ tp1->sent = SCTP_DATAGRAM_SENT; @@ -3244,8 +3219,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t tp1->sent, SCTP_FR_LOG_CHECK_STRIKE); } - if (compare_with_wrap(tp1->rec.data.TSN_seq, biggest_tsn_acked, - MAX_TSN) || + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, biggest_tsn_acked) || tp1->sent == SCTP_DATAGRAM_UNSENT) { /* done */ break; @@ -3264,8 +3238,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t } } } - if (compare_with_wrap(tp1->rec.data.TSN_seq, - asoc->this_sack_highest_gap, MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->this_sack_highest_gap)) { /* we are beyond the tsn in the sack */ break; } @@ -3289,8 +3262,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t * FR using this SACK. */ continue; - } else if (tp1->whoTo && compare_with_wrap(tp1->rec.data.TSN_seq, - tp1->whoTo->this_sack_highest_newack, MAX_TSN)) { + } else if (tp1->whoTo && SCTP_TSN_GT(tp1->rec.data.TSN_seq, + tp1->whoTo->this_sack_highest_newack)) { /* * CMT: New acks were receieved for data sent to * this dest. But no new acks were seen for data @@ -3341,7 +3314,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t * received after this missing TSN. */ if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (num_dests_sacked == 1) && - compare_with_wrap(this_sack_lowest_newack, tp1->rec.data.TSN_seq, MAX_TSN)) { + SCTP_TSN_GT(this_sack_lowest_newack, tp1->rec.data.TSN_seq)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(16 + num_dests_sacked, tp1->rec.data.TSN_seq, @@ -3373,9 +3346,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t #endif ) { - if ((compare_with_wrap(biggest_tsn_newly_acked, - tp1->rec.data.fast_retran_tsn, MAX_TSN)) || - (biggest_tsn_newly_acked == + if (SCTP_TSN_GE(biggest_tsn_newly_acked, tp1->rec.data.fast_retran_tsn)) { /* * Strike the TSN, since this ack is @@ -3415,8 +3386,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t */ if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (num_dests_sacked == 1) && - compare_with_wrap(this_sack_lowest_newack, - tp1->rec.data.TSN_seq, MAX_TSN)) { + SCTP_TSN_GT(this_sack_lowest_newack, + tp1->rec.data.TSN_seq)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(32 + num_dests_sacked, tp1->rec.data.TSN_seq, @@ -3434,8 +3405,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t * JRI: TODO: remove code for HTNA algo. CMT's SFR * algo covers HTNA. */ - } else if (compare_with_wrap(tp1->rec.data.TSN_seq, - biggest_tsn_newly_acked, MAX_TSN)) { + } else if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + biggest_tsn_newly_acked)) { /* * We don't strike these: This is the HTNA * algorithm i.e. we don't strike If our TSN is @@ -3468,7 +3439,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t * received after this missing TSN. */ if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (num_dests_sacked == 1) && - compare_with_wrap(this_sack_lowest_newack, tp1->rec.data.TSN_seq, MAX_TSN)) { + SCTP_TSN_GT(this_sack_lowest_newack, tp1->rec.data.TSN_seq)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(48 + num_dests_sacked, tp1->rec.data.TSN_seq, @@ -3715,10 +3686,7 @@ sctp_try_advance_peer_ack_point(struct s */ if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { /* advance PeerAckPoint goes forward */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, - asoc->advanced_peer_ack_point, - MAX_TSN)) { - + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = tp1->rec.data.TSN_seq; a_adv = tp1; } else if (tp1->rec.data.TSN_seq == asoc->advanced_peer_ack_point) { @@ -3843,7 +3811,7 @@ sctp_express_handle_sack(struct sctp_tcb #endif asoc = &stcb->asoc; old_rwnd = asoc->peers_rwnd; - if (compare_with_wrap(asoc->last_acked_seq, cumack, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, cumack)) { /* old ack */ return; } else if (asoc->last_acked_seq == cumack) { @@ -3882,8 +3850,7 @@ sctp_express_handle_sack(struct sctp_tcb } else { send_s = asoc->sending_seq; } - if ((cumack == send_s) || - compare_with_wrap(cumack, send_s, MAX_TSN)) { + if (SCTP_TSN_GE(cumack, send_s)) { #ifndef INVARIANTS struct mbuf *oper; @@ -3923,12 +3890,10 @@ sctp_express_handle_sack(struct sctp_tcb __LINE__); } stcb->asoc.overall_error_count = 0; - if (compare_with_wrap(cumack, asoc->last_acked_seq, MAX_TSN)) { + if (SCTP_TSN_GT(cumack, asoc->last_acked_seq)) { /* process the new consecutive TSN first */ TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { - if (compare_with_wrap(cumack, tp1->rec.data.TSN_seq, - MAX_TSN) || - cumack == tp1->rec.data.TSN_seq) { + if (SCTP_TSN_GE(cumack, tp1->rec.data.TSN_seq)) { if (tp1->sent == SCTP_DATAGRAM_UNSENT) { printf("Warning, an unsent is now acked?\n"); } @@ -4095,8 +4060,7 @@ sctp_express_handle_sack(struct sctp_tcb asoc->nonce_wait_tsn = asoc->sending_seq; } } else { - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_wait_tsn, MAX_TSN) || - (asoc->last_acked_seq == asoc->nonce_wait_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { /* * Misbehaving peer. We need * to react to this guy @@ -4108,7 +4072,7 @@ sctp_express_handle_sack(struct sctp_tcb } } else { /* See if Resynchronization Possible */ - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_resync_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { asoc->nonce_sum_check = 1; /* * Now we must calculate what the base is. @@ -4316,7 +4280,7 @@ again: /* (section 4.2) */ /*********************************************/ /* C1. update advancedPeerAckPoint */ - if (compare_with_wrap(cumack, asoc->advanced_peer_ack_point, MAX_TSN)) { + if (SCTP_TSN_GT(cumack, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = cumack; } /* PR-Sctp issues need to be addressed too */ @@ -4327,15 +4291,13 @@ again: old_adv_peer_ack_point = asoc->advanced_peer_ack_point; lchk = sctp_try_advance_peer_ack_point(stcb, asoc); /* C3. See if we need to send a Fwd-TSN */ - if (compare_with_wrap(asoc->advanced_peer_ack_point, cumack, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cumack)) { /* * ISSUE with ECN, see FWD-TSN processing for notes * on issues that will occur when the ECN NONCE * stuff is put into SCTP for cross checking. */ - if (compare_with_wrap(asoc->advanced_peer_ack_point, old_adv_peer_ack_point, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { send_forward_tsn(stcb, asoc); /* * ECN Nonce: Disable Nonce Sum check when @@ -4473,8 +4435,7 @@ sctp_handle_sack(struct mbuf *m, int off tp1 = NULL; send_s = asoc->sending_seq; } - if (cum_ack == send_s || - compare_with_wrap(cum_ack, send_s, MAX_TSN)) { + if (SCTP_TSN_GE(cum_ack, send_s)) { struct mbuf *oper; /* @@ -4512,7 +4473,7 @@ sctp_handle_sack(struct mbuf *m, int off /**********************/ /* 1) check the range */ /**********************/ - if (compare_with_wrap(asoc->last_acked_seq, last_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, last_tsn)) { /* acking something behind */ return; } @@ -4574,9 +4535,7 @@ sctp_handle_sack(struct mbuf *m, int off } /* process the new consecutive TSN first */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { - if (compare_with_wrap(last_tsn, tp1->rec.data.TSN_seq, - MAX_TSN) || - last_tsn == tp1->rec.data.TSN_seq) { + if (SCTP_TSN_GE(last_tsn, tp1->rec.data.TSN_seq)) { if (tp1->sent != SCTP_DATAGRAM_UNSENT) { /* * ECN Nonce: Add the nonce to the sender's @@ -4718,8 +4677,7 @@ sctp_handle_sack(struct mbuf *m, int off * validate the biggest_tsn_acked in the gap acks if * strict adherence is wanted. */ - if ((biggest_tsn_acked == send_s) || - (compare_with_wrap(biggest_tsn_acked, send_s, MAX_TSN))) { + if (SCTP_TSN_GE(biggest_tsn_acked, send_s)) { /* * peer is either confused or we are under * attack. We must abort. @@ -4757,8 +4715,7 @@ sctp_handle_sack(struct mbuf *m, int off asoc->last_acked_seq = cum_ack; TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { - if (compare_with_wrap(tp1->rec.data.TSN_seq, cum_ack, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cum_ack)) { break; } if (tp1->sent == SCTP_DATAGRAM_UNSENT) { @@ -4835,9 +4792,7 @@ sctp_handle_sack(struct mbuf *m, int off } if (asoc->fast_retran_loss_recovery && accum_moved) { - if (compare_with_wrap(asoc->last_acked_seq, - asoc->fast_recovery_tsn, MAX_TSN) || - asoc->last_acked_seq == asoc->fast_recovery_tsn) { + if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->fast_recovery_tsn)) { /* Setup so we will exit RFC2582 fast recovery */ will_exit_fast_recovery = 1; } @@ -5057,8 +5012,7 @@ sctp_handle_sack(struct mbuf *m, int off asoc->nonce_wait_tsn = asoc->sending_seq; } } else { - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_wait_tsn, MAX_TSN) || - (asoc->last_acked_seq == asoc->nonce_wait_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { /* * Misbehaving peer. We need * to react to this guy @@ -5070,7 +5024,7 @@ sctp_handle_sack(struct mbuf *m, int off } } else { /* See if Resynchronization Possible */ - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_resync_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { asoc->nonce_sum_check = 1; /* * now we must calculate what the base is. @@ -5097,9 +5051,7 @@ sctp_handle_sack(struct mbuf *m, int off asoc->fast_retran_loss_recovery = 0; } if ((asoc->sat_t3_loss_recovery) && - ((compare_with_wrap(asoc->last_acked_seq, asoc->sat_t3_recovery_tsn, - MAX_TSN) || - (asoc->last_acked_seq == asoc->sat_t3_recovery_tsn)))) { + SCTP_TSN_GE(asoc->last_acked_seq, asoc->sat_t3_recovery_tsn)) { /* end satellite t3 loss recovery */ asoc->sat_t3_loss_recovery = 0; } @@ -5217,7 +5169,7 @@ again: /* (section 4.2) */ /*********************************************/ /* C1. update advancedPeerAckPoint */ - if (compare_with_wrap(cum_ack, asoc->advanced_peer_ack_point, MAX_TSN)) { + if (SCTP_TSN_GT(cum_ack, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = cum_ack; } /* C2. try to further move advancedPeerAckPoint ahead */ @@ -5228,8 +5180,7 @@ again: old_adv_peer_ack_point = asoc->advanced_peer_ack_point; lchk = sctp_try_advance_peer_ack_point(stcb, asoc); /* C3. See if we need to send a Fwd-TSN */ - if (compare_with_wrap(asoc->advanced_peer_ack_point, cum_ack, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cum_ack)) { /* * ISSUE with ECN, see FWD-TSN processing for notes * on issues that will occur when the ECN NONCE @@ -5240,8 +5191,7 @@ again: 0xee, cum_ack, asoc->advanced_peer_ack_point, old_adv_peer_ack_point); } - if (compare_with_wrap(asoc->advanced_peer_ack_point, old_adv_peer_ack_point, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { send_forward_tsn(stcb, asoc); /* @@ -5302,8 +5252,7 @@ sctp_kick_prsctp_reorder_queue(struct sc * came in */ TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next, nctl) { - if (compare_with_wrap(tt, ctl->sinfo_ssn, MAX_SEQ) || - (tt == ctl->sinfo_ssn)) { + if (SCTP_SSN_GE(tt, ctl->sinfo_ssn)) { /* this is deliverable now */ TAILQ_REMOVE(&strmin->inqueue, ctl, next); /* subtract pending on streams */ @@ -5378,8 +5327,7 @@ sctp_flush_reassm_for_str_seq(struct sct if (chk->rec.data.stream_seq == seq) { /* It needs to be tossed */ TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { + if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) { asoc->tsn_last_delivered = chk->rec.data.TSN_seq; asoc->str_of_pdapi = chk->rec.data.stream_number; asoc->ssn_of_pdapi = chk->rec.data.stream_seq; @@ -5389,11 +5337,8 @@ sctp_flush_reassm_for_str_seq(struct sct sctp_ucount_decr(asoc->cnt_on_reasm_queue); /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED && + SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) { /* * We must dump forward this streams * sequence number if the chunk is not @@ -5415,7 +5360,7 @@ sctp_flush_reassm_for_str_seq(struct sct chk->data = NULL; } sctp_free_a_chunk(stcb, chk); - } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { + } else if (SCTP_SSN_GT(chk->rec.data.stream_seq, seq)) { /* * If the stream_seq is > than the purging one, we * are done @@ -5475,8 +5420,7 @@ sctp_handle_forward_tsn(struct sctp_tcb /*************************************************************/ new_cum_tsn = ntohl(fwd->new_cumulative_tsn); - if (compare_with_wrap(asoc->cumulative_tsn, new_cum_tsn, MAX_TSN) || - asoc->cumulative_tsn == new_cum_tsn) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, new_cum_tsn)) { /* Already got there ... */ return; } @@ -5537,7 +5481,7 @@ sctp_handle_forward_tsn(struct sctp_tcb if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, i) && !SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, i)) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i); - if (compare_with_wrap(asoc->mapping_array_base_tsn + i, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->mapping_array_base_tsn + i, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = asoc->mapping_array_base_tsn + i; } } @@ -5563,13 +5507,10 @@ sctp_handle_forward_tsn(struct sctp_tcb * queue. */ TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { - if ((compare_with_wrap(new_cum_tsn, - chk->rec.data.TSN_seq, MAX_TSN)) || - (new_cum_tsn == chk->rec.data.TSN_seq)) { + if (SCTP_TSN_GE(new_cum_tsn, chk->rec.data.TSN_seq)) { /* It needs to be tossed */ TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { + if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) { asoc->tsn_last_delivered = chk->rec.data.TSN_seq; asoc->str_of_pdapi = chk->rec.data.stream_number; asoc->ssn_of_pdapi = chk->rec.data.stream_seq; @@ -5579,11 +5520,8 @@ sctp_handle_forward_tsn(struct sctp_tcb sctp_ucount_decr(asoc->cnt_on_reasm_queue); /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED && + SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) { /* * We must dump forward this streams * sequence number if the chunk is not @@ -5681,17 +5619,15 @@ sctp_handle_forward_tsn(struct sctp_tcb stcb->asoc.control_pdapi = sv; break; } else if ((ctl->sinfo_stream == stseq->stream) && - (compare_with_wrap(ctl->sinfo_ssn, stseq->sequence, MAX_SEQ))) { + SCTP_SSN_GT(ctl->sinfo_ssn, stseq->sequence)) { /* We are past our victim SSN */ break; } } strm = &asoc->strmin[stseq->stream]; - if (compare_with_wrap(stseq->sequence, - strm->last_sequence_delivered, MAX_SEQ)) { + if (SCTP_SSN_GT(stseq->sequence, strm->last_sequence_delivered)) { /* Update the sequence number */ - strm->last_sequence_delivered = - stseq->sequence; + strm->last_sequence_delivered = stseq->sequence; } /* now kick the stream the new way */ /* sa_ignore NO_NULL_CHK */ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:28:37 2012 (r231356) @@ -2924,14 +2924,15 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch net = lchk->whoTo; break; } - if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_TSN)) + if (SCTP_TSN_GT(lchk->rec.data.TSN_seq, tsn)) { break; + } } if (net == NULL) /* default is we use the primary */ net = stcb->asoc.primary_destination; - if (compare_with_wrap(tsn, stcb->asoc.last_cwr_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, stcb->asoc.last_cwr_tsn)) { /* * JRS - Use the congestion control given in the pluggable * CC module @@ -2972,8 +2973,7 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun * don't need to worry about more than one! */ ecne = mtod(chk->data, struct sctp_ecne_chunk *); - if (compare_with_wrap(ntohl(cp->tsn), ntohl(ecne->tsn), - MAX_TSN) || (cp->tsn == ecne->tsn)) { + if (SCTP_TSN_GE(ntohl(cp->tsn), ntohl(ecne->tsn))) { /* this covers this ECNE, we can remove it */ stcb->asoc.ecn_echo_cnt_onq--; TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, @@ -3062,8 +3062,7 @@ process_chunk_drop(struct sctp_tcb *stcb /* found it */ break; } - if (compare_with_wrap(tp1->rec.data.TSN_seq, tsn, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, tsn)) { /* not found */ tp1 = NULL; break; @@ -3670,8 +3669,7 @@ sctp_handle_str_reset_request_out(struct if (trunc) { sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_DENIED); asoc->last_reset_action[0] = SCTP_STREAM_RESET_DENIED; - } else if ((tsn == asoc->cumulative_tsn) || - (compare_with_wrap(asoc->cumulative_tsn, tsn, MAX_TSN))) { + } else if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { /* we can do it now */ sctp_reset_in_stream(stcb, number_entries, req->list_of_streams); sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_PERFORMED); @@ -4615,8 +4613,7 @@ process_control_chunks: stcb->asoc.seen_a_sack_this_pkt = 1; if ((stcb->asoc.pr_sctp_cnt == 0) && (num_seg == 0) && - ((compare_with_wrap(cum_ack, stcb->asoc.last_acked_seq, MAX_TSN)) || - (cum_ack == stcb->asoc.last_acked_seq)) && + SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) && (stcb->asoc.saw_sack_with_frags == 0) && (stcb->asoc.saw_sack_with_nr_frags == 0) && (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) @@ -4709,8 +4706,7 @@ process_control_chunks: stcb->asoc.seen_a_sack_this_pkt = 1; if ((stcb->asoc.pr_sctp_cnt == 0) && (num_seg == 0) && (num_nr_seg == 0) && - ((compare_with_wrap(cum_ack, stcb->asoc.last_acked_seq, MAX_TSN)) || - (cum_ack == stcb->asoc.last_acked_seq)) && + SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) && (stcb->asoc.saw_sack_with_frags == 0) && (stcb->asoc.saw_sack_with_nr_frags == 0) && (!TAILQ_EMPTY(&stcb->asoc.sent_queue))) { @@ -5355,8 +5351,7 @@ sctp_process_ecn_marked_a(struct sctp_tc * don't want the point falling way behind by more than * 2^^31 and then having it be incorrect. */ - if (compare_with_wrap(stcb->asoc.cumulative_tsn, - stcb->asoc.last_echo_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; } } else if ((ecn_bits & SCTP_ECT0_BIT) == SCTP_ECT0_BIT) { @@ -5365,8 +5360,7 @@ sctp_process_ecn_marked_a(struct sctp_tc * don't want the point falling way behind by more than * 2^^31 and then having it be incorrect. */ - if (compare_with_wrap(stcb->asoc.cumulative_tsn, - stcb->asoc.last_echo_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; } } @@ -5383,8 +5377,7 @@ sctp_process_ecn_marked_b(struct sctp_tc * chunk to the output chunk queue. The incoming CWR will * remove this chunk. */ - if (compare_with_wrap(high_tsn, stcb->asoc.last_echo_tsn, - MAX_TSN)) { + if (SCTP_TSN_GT(high_tsn, stcb->asoc.last_echo_tsn)) { /* Yep, we need to add a ECNE */ sctp_send_ecn_echo(stcb, net, high_tsn); stcb->asoc.last_echo_tsn = high_tsn; @@ -5623,12 +5616,12 @@ sctp_common_input_processing(struct mbuf int was_a_gap; uint32_t highest_tsn; - if (compare_with_wrap(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map)) { highest_tsn = stcb->asoc.highest_tsn_inside_nr_map; } else { highest_tsn = stcb->asoc.highest_tsn_inside_map; } - was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); + was_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); stcb->asoc.send_sack = 1; sctp_sack_check(stcb, was_a_gap, &abort_flag); if (abort_flag) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 07:28:37 2012 (r231356) @@ -6468,7 +6468,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st if (chk->rec.chunk_id.id == SCTP_ASCONF) { if (chk->data) { acp = mtod(chk->data, struct sctp_asconf_chunk *); - if (compare_with_wrap(ntohl(acp->serial_number), asoc->asconf_seq_out_acked, MAX_TSN)) { + if (SCTP_TSN_GT(ntohl(acp->serial_number), asoc->asconf_seq_out_acked)) { /* Not Acked yet */ break; } @@ -6516,8 +6516,7 @@ sctp_clean_up_datalist(struct sctp_tcb * } /* on to the sent queue */ tp1 = TAILQ_LAST(&asoc->sent_queue, sctpchunk_listhead); - if ((tp1) && (compare_with_wrap(tp1->rec.data.TSN_seq, - data_list[i]->rec.data.TSN_seq, MAX_TSN))) { + if ((tp1) && SCTP_TSN_GT(tp1->rec.data.TSN_seq, data_list[i]->rec.data.TSN_seq)) { struct sctp_tmit_chunk *tpp; /* need to move back */ @@ -6528,8 +6527,7 @@ sctp_clean_up_datalist(struct sctp_tcb * goto all_done; } tp1 = tpp; - if (compare_with_wrap(tp1->rec.data.TSN_seq, - data_list[i]->rec.data.TSN_seq, MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, data_list[i]->rec.data.TSN_seq)) { goto back_up_more; } TAILQ_INSERT_AFTER(&asoc->sent_queue, tp1, data_list[i], sctp_next); @@ -10002,7 +10000,7 @@ sctp_send_sack(struct sctp_tcb *stcb) if (a_chk->whoTo) { atomic_add_int(&a_chk->whoTo->ref_count, 1); } - if (compare_with_wrap(asoc->highest_tsn_inside_map, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_map, asoc->highest_tsn_inside_nr_map)) { highest_tsn = asoc->highest_tsn_inside_map; } else { highest_tsn = asoc->highest_tsn_inside_nr_map; @@ -10097,15 +10095,15 @@ sctp_send_sack(struct sctp_tcb *stcb) } } - if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->mapping_array_base_tsn, asoc->cumulative_tsn)) { offset = 1; } else { offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn; } if (((type == SCTP_SELECTIVE_ACK) && - compare_with_wrap(highest_tsn, asoc->cumulative_tsn, MAX_TSN)) || + SCTP_TSN_GT(highest_tsn, asoc->cumulative_tsn)) || ((type == SCTP_NR_SELECTIVE_ACK) && - compare_with_wrap(asoc->highest_tsn_inside_map, asoc->cumulative_tsn, MAX_TSN))) { + SCTP_TSN_GT(asoc->highest_tsn_inside_map, asoc->cumulative_tsn))) { /* we have a gap .. maybe */ for (i = 0; i < siz; i++) { tsn_map = asoc->mapping_array[i]; @@ -10177,12 +10175,12 @@ sctp_send_sack(struct sctp_tcb *stcb) siz = (((MAX_TSN - asoc->mapping_array_base_tsn) + 1) + asoc->highest_tsn_inside_nr_map + 7) / 8; } - if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->mapping_array_base_tsn, asoc->cumulative_tsn)) { offset = 1; } else { offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn; } - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn)) { /* we have a gap .. maybe */ for (i = 0; i < siz; i++) { tsn_map = asoc->nr_mapping_array[i]; @@ -11075,8 +11073,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str if (chk->rec.chunk_id.id == SCTP_ECN_CWR) { /* found a previous ECN_CWR update it if needed */ cwr = mtod(chk->data, struct sctp_cwr_chunk *); - if (compare_with_wrap(high_tsn, ntohl(cwr->tsn), - MAX_TSN)) { + if (SCTP_TSN_GT(high_tsn, ntohl(cwr->tsn))) { cwr->tsn = htonl(high_tsn); } return; Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:26:45 2012 (r231355) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:28:37 2012 (r231356) @@ -6475,8 +6475,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, cnt = 0; /* First look in the re-assembly queue */ TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { - if (compare_with_wrap(chk->rec.data.TSN_seq, - cumulative_tsn_p1, MAX_TSN)) { + if (SCTP_TSN_GT(chk->rec.data.TSN_seq, cumulative_tsn_p1)) { /* Yep it is above cum-ack */ cnt++; SCTP_CALC_TSN_TO_GAP(gap, chk->rec.data.TSN_seq, asoc->mapping_array_base_tsn); @@ -6494,8 +6493,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, /* Ok that was fun, now we will drain all the inbound streams? */ for (strmat = 0; strmat < asoc->streamincnt; strmat++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:30:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4A3B106566C; Fri, 10 Feb 2012 07:30:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2F678FC23; Fri, 10 Feb 2012 07:30: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 q1A7UFBL060139; Fri, 10 Feb 2012 07:30:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7UFAE060137; Fri, 10 Feb 2012 07:30:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100730.q1A7UFAE060137@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:30:15 +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: r231357 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:30:15 -0000 Author: tuexen Date: Fri Feb 10 07:30:15 2012 New Revision: 231357 URL: http://svn.freebsd.org/changeset/base/231357 Log: MFC r216878: Fix a typo. Modified: stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:28:37 2012 (r231356) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:30:15 2012 (r231357) @@ -417,7 +417,7 @@ union sctp_notification { #define SCTP_AUTHENTICATION_EVENT 0x0008 #define SCTP_STREAM_RESET_EVENT 0x0009 #define SCTP_SENDER_DRY_EVENT 0x000a -#define SCTP__NOTIFICATIONS_STOPPED_EVENT 0x000b /* we don't send this */ +#define SCTP_NOTIFICATIONS_STOPPED_EVENT 0x000b /* we don't send this */ /* * socket option structs */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:31:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E45E3106566B; Fri, 10 Feb 2012 07:31:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B82188FC12; Fri, 10 Feb 2012 07:31:50 +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 q1A7Vo8S060230; Fri, 10 Feb 2012 07:31:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7Vo5P060228; Fri, 10 Feb 2012 07:31:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100731.q1A7Vo5P060228@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:31:50 +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: r231358 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:31:51 -0000 Author: tuexen Date: Fri Feb 10 07:31:50 2012 New Revision: 231358 URL: http://svn.freebsd.org/changeset/base/231358 Log: MFC r216887: Bugfix: Make sure that the COMM_UP notificatin is delivered first also on the passive side. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:30:15 2012 (r231357) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 07:31:50 2012 (r231358) @@ -2311,6 +2311,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int notification = 0; struct sctp_nets *netl; int had_a_existing_tcb = 0; + int send_int_conf = 0; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_cookie: handling COOKIE-ECHO\n"); @@ -2630,8 +2631,7 @@ sctp_handle_cookie_echo(struct mbuf *m, netl->dest_state &= ~SCTP_ADDR_UNCONFIRMED; (void)sctp_set_primary_addr((*stcb), (struct sockaddr *)NULL, netl); - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, - (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); + send_int_conf = 1; } } if (*stcb) { @@ -2655,6 +2655,10 @@ sctp_handle_cookie_echo(struct mbuf *m, * socket, no need to do anything. I THINK!! */ sctp_ulp_notify(notification, *stcb, 0, (void *)&sac_restart_id, SCTP_SO_NOT_LOCKED); + if (send_int_conf) { + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); + } return (m); } oso = (*inp_p)->sctp_socket; @@ -2768,7 +2772,10 @@ sctp_handle_cookie_echo(struct mbuf *m, /* Switch over to the new guy */ *inp_p = inp; sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - + if (send_int_conf) { + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); + } /* * Pull it from the incomplete queue and wake the * guy @@ -2787,8 +2794,14 @@ sctp_handle_cookie_echo(struct mbuf *m, return (m); } } - if ((notification) && ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE)) { - sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + if ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { + if (notification) { + sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + } + if (send_int_conf) { + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); + } } return (m); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:42:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03DE6106564A; Fri, 10 Feb 2012 07:42:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4D178FC0C; Fri, 10 Feb 2012 07:42:38 +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 q1A7gcDs060623; Fri, 10 Feb 2012 07:42:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7gcoE060617; Fri, 10 Feb 2012 07:42:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100742.q1A7gcoE060617@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:42:38 +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: r231359 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:42:39 -0000 Author: tuexen Date: Fri Feb 10 07:42:38 2012 New Revision: 231359 URL: http://svn.freebsd.org/changeset/base/231359 Log: MFC r215817: Adds new dtrace for cwnd functions and lay's groundwork for future dtrace points (rwnd flightsize etc). From rrs@. Added: stable/8/sys/netinet/sctp_dtrace_declare.h - copied unchanged from r215817, head/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h - copied unchanged from r215817, head/sys/netinet/sctp_dtrace_define.h Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:31:50 2012 (r231358) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:42:38 2012 (r231359) @@ -42,6 +42,7 @@ #include #include #include +#include #include __FBSDID("$FreeBSD$"); @@ -67,6 +68,9 @@ sctp_set_initial_cc_param(struct sctp_tc } net->ssthresh = assoc->peers_rwnd; + SDT_PROBE(sctp, cwnd, net, init, + stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, + 0, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { sctp_log_cwnd(stcb, net, 0, SCTP_CWND_INITIALIZATION); @@ -102,6 +106,9 @@ sctp_cwnd_update_after_fr(struct sctp_tc net->ssthresh = 2 * net->mtu; } net->cwnd = net->ssthresh; + SDT_PROBE(sctp, cwnd, net, fr, + stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_FR); @@ -159,6 +166,7 @@ sctp_cwnd_update_after_sack(struct sctp_ int accum_moved, int reneged_all, int will_exit) { struct sctp_nets *net; + int old_cwnd; /******************************/ /* update cwnd and Early FR */ @@ -250,7 +258,11 @@ sctp_cwnd_update_after_sack(struct sctp_ (asoc->sctp_cmt_pf > 0) && ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { net->dest_state &= ~SCTP_ADDR_PF; + old_cwnd = net->cwnd; net->cwnd = net->mtu * asoc->sctp_cmt_pf; + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, + old_cwnd, net->cwnd); SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", net, net->cwnd); /* @@ -293,13 +305,26 @@ sctp_cwnd_update_after_sack(struct sctp_ /* We are in slow start */ if (net->flight_size + net->net_ack >= net->cwnd) { if (net->net_ack > (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable))) { + old_cwnd = net->cwnd; net->cwnd += (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)); + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_SS); } } else { + old_cwnd = net->cwnd; net->cwnd += net->net_ack; + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, SCTP_CWND_LOG_FROM_SS); @@ -321,7 +346,13 @@ sctp_cwnd_update_after_sack(struct sctp_ if ((net->flight_size + net->net_ack >= net->cwnd) && (net->partial_bytes_acked >= net->cwnd)) { net->partial_bytes_acked -= net->cwnd; + old_cwnd = net->cwnd; net->cwnd += net->mtu; + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_CA); @@ -367,7 +398,11 @@ sctp_cwnd_update_after_timeout(struct sc net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); net->cwnd = net->mtu; net->partial_bytes_acked = 0; - + SDT_PROBE(sctp, cwnd, net, to, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->cwnd - old_cwnd, SCTP_CWND_LOG_FROM_RTX); } @@ -386,6 +421,11 @@ sctp_cwnd_update_after_ecn_echo(struct s net->RTO <<= 1; } net->cwnd = net->ssthresh; + SDT_PROBE(sctp, cwnd, net, ecn, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); } @@ -495,6 +535,11 @@ sctp_cwnd_update_after_packet_dropped(st } if (net->cwnd - old_cwnd != 0) { /* log only changes */ + SDT_PROBE(sctp, cwnd, net, pd, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); @@ -511,7 +556,11 @@ sctp_cwnd_update_after_output(struct sct if (net->ssthresh < net->cwnd) net->ssthresh = net->cwnd; net->cwnd = (net->flight_size + (burst_limit * net->mtu)); - + SDT_PROBE(sctp, cwnd, net, bl, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_BRST); } @@ -533,6 +582,11 @@ sctp_cwnd_update_after_fr_timer(struct s if (net->cwnd < net->ssthresh) /* still in SS move to CA */ net->ssthresh = net->cwnd - 1; + SDT_PROBE(sctp, cwnd, net, fr, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (old_cwnd - net->cwnd), SCTP_CWND_LOG_FROM_FR); } Copied: stable/8/sys/netinet/sctp_dtrace_declare.h (from r215817, head/sys/netinet/sctp_dtrace_declare.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 07:42:38 2012 (r231359, copy of r215817, head/sys/netinet/sctp_dtrace_declare.h) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * a) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * b) Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * c) Neither the name of Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); +#ifndef __sctp_dtrace_declare_h__ +#include "opt_kdtrace.h" +#include +#include + +/* Declare the SCTP provider */ +SDT_PROVIDER_DECLARE(sctp); + +/* The probes we have so far: */ + +/* One to track a net's cwnd */ +/* initial */ +SDT_PROBE_DECLARE(sctp, cwnd, net, init); +/* update at a ack -- increase */ +SDT_PROBE_DECLARE(sctp, cwnd, net, ack); +/* update at a fast retransmit -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, fr); +/* update at a time-out -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, to); +/* update at a burst-limit -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, bl); +/* update at a ECN -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, ecn); +/* update at a Packet-Drop -- decrease */ +SDT_PROBE_DECLARE(sctp, cwnd, net, pd); + +/* One to track an associations rwnd */ +SDT_PROBE_DECLARE(sctp, rwnd, assoc, val); + +/* One to track a net's flight size */ +SDT_PROBE_DECLARE(sctp, flightsize, net, val); + +/* One to track an associations flight size */ +SDT_PROBE_DECLARE(sctp, flightsize, assoc, val); + + + + + + +#endif Copied: stable/8/sys/netinet/sctp_dtrace_define.h (from r215817, head/sys/netinet/sctp_dtrace_define.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 07:42:38 2012 (r231359, copy of r215817, head/sys/netinet/sctp_dtrace_define.h) @@ -0,0 +1,201 @@ +/*- + * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * a) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * b) Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * c) Neither the name of Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); +#ifndef __sctp_dtrace_define_h__ +#include "opt_kdtrace.h" +#include +#include + +SDT_PROVIDER_DEFINE(sctp); + +/********************************************************/ +/* Cwnd probe - tracks changes in the congestion window on a netp */ +/********************************************************/ +/* Initial */ +SDT_PROBE_DEFINE(sctp, cwnd, net, init, init); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, init, 4, "int"); + + +/* ACK-INCREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, ack, ack); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 4, "int"); + +/* FastRetransmit-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, fr, fr); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, fr, 4, "int"); + + +/* TimeOut-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, to, to); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, to, 4, "int"); + + +/* BurstLimit-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, bl, bl); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, bl, 4, "int"); + + +/* ECN-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, ecn, ecn); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, ecn, 4, "int"); + + +/* PacketDrop-DECREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, pd, pd); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 2, "uintptr_t"); +/* The old value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, pd, 4, "int"); + + + +/********************************************************/ +/* Rwnd probe - tracks changes in the receiver window for an assoc */ +/********************************************************/ +SDT_PROBE_DEFINE(sctp, rwnd, assoc, val, val); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, rwnd, assoc, val, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, rwnd, assoc, val, 1, "uint32_t"); +/* The up/down amount */ +SDT_PROBE_ARGTYPE(sctp, rwnd, assoc, val, 2, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, rwnd, assoc, val, 3, "int"); + +/********************************************************/ +/* flight probe - tracks changes in the flight size on a net or assoc */ +/********************************************************/ +SDT_PROBE_DEFINE(sctp, flightsize, net, val, val); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 1, "uint32_t"); +/* The pointer to the struct sctp_nets * changing */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 2, "uintptr_t"); +/* The up/down amount */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 3, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, flightsize, net, val, 4, "int"); +/********************************************************/ +/* The total flight version */ +/********************************************************/ +SDT_PROBE_DEFINE(sctp, flightsize, assoc, val, val); +/* The Vtag for this end */ +SDT_PROBE_ARGTYPE(sctp, flightsize, assoc, val, 0, "uint32_t"); +/* The port number of the local side << 16 | port number of remote + * in network byte order. + */ +SDT_PROBE_ARGTYPE(sctp, flightsize, assoc, val, 1, "uint32_t"); +/* The up/down amount */ +SDT_PROBE_ARGTYPE(sctp, flightsize, assoc, val, 2, "int"); +/* The new value of the cwnd */ +SDT_PROBE_ARGTYPE(sctp, flightsize, assoc, val, 3, "int"); + +#endif Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:31:50 2012 (r231358) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:42:38 2012 (r231359) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:31:50 2012 (r231358) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:42:38 2012 (r231359) @@ -942,7 +942,7 @@ struct sctpstat { uint32_t sctps_wu_sacks_sent; /* Window Update only sacks sent */ uint32_t sctps_sends_with_flags; /* number of sends with * sinfo_flags !=0 */ - uint32_t sctps_sends_with_unord; /* number of unordered sends */ + uint32_t sctps_sends_with_unord; /* number of unordered sends */ uint32_t sctps_sends_with_eof; /* number of sends with EOF flag set */ uint32_t sctps_sends_with_abort; /* number of sends with ABORT * flag set */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:44:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25978106566B; Fri, 10 Feb 2012 07:44:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12FBC8FC14; Fri, 10 Feb 2012 07:44:04 +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 q1A7i3Ij060726; Fri, 10 Feb 2012 07:44:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7i3rC060724; Fri, 10 Feb 2012 07:44:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100744.q1A7i3rC060724@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:44:03 +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: r231360 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:44:04 -0000 Author: tuexen Date: Fri Feb 10 07:44:03 2012 New Revision: 231360 URL: http://svn.freebsd.org/changeset/base/231360 Log: MFC r217469: Add support for resource pooling to CMT. An original version of the patch was developed by Martin Becke and Thomas Dreibholz. Modified: stable/8/sys/netinet/sctp_cc_functions.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:42:38 2012 (r231359) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:44:03 2012 (r231360) @@ -66,6 +66,13 @@ sctp_set_initial_cc_param(struct sctp_tc cwnd_in_mtu = assoc->max_burst; net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; } + if (stcb->asoc.sctp_cmt_on_off == 2) { + /* In case of resource pooling initialize appropriately */ + net->cwnd /= assoc->numnets; + if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { + net->cwnd = net->mtu - sizeof(struct sctphdr); + } + } net->ssthresh = assoc->peers_rwnd; SDT_PROBE(sctp, cwnd, net, init, @@ -82,7 +89,17 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_association *asoc) { struct sctp_nets *net; + uint32_t t_ssthresh, t_cwnd; + /* MT FIXME: Don't compute this over and over again */ + t_ssthresh = 0; + t_cwnd = 0; + if (asoc->sctp_cmt_on_off == 2) { + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + t_ssthresh += net->ssthresh; + t_cwnd += net->cwnd; + } + } /*- * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) @@ -101,9 +118,23 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_tmit_chunk *lchk; int old_cwnd = net->cwnd; - net->ssthresh = net->cwnd / 2; - if (net->ssthresh < (net->mtu * 2)) { - net->ssthresh = 2 * net->mtu; + if (asoc->sctp_cmt_on_off == 2) { + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if ((net->cwnd > t_cwnd / 2) && + (net->ssthresh < net->cwnd - t_cwnd / 2)) { + net->ssthresh = net->cwnd - t_cwnd / 2; + } + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + } + } else { + net->ssthresh = net->cwnd / 2; + if (net->ssthresh < (net->mtu * 2)) { + net->ssthresh = 2 * net->mtu; + } } net->cwnd = net->ssthresh; SDT_PROBE(sctp, cwnd, net, fr, @@ -167,7 +198,17 @@ sctp_cwnd_update_after_sack(struct sctp_ { struct sctp_nets *net; int old_cwnd; + uint32_t t_ssthresh, t_cwnd, incr; + /* MT FIXME: Don't compute this over and over again */ + t_ssthresh = 0; + t_cwnd = 0; + if (stcb->asoc.sctp_cmt_on_off == 2) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + t_ssthresh += net->ssthresh; + t_cwnd += net->cwnd; + } + } /******************************/ /* update cwnd and Early FR */ /******************************/ @@ -178,11 +219,8 @@ sctp_cwnd_update_after_sack(struct sctp_ * CMT fast recovery code. Need to debug. */ if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { - if (compare_with_wrap(asoc->last_acked_seq, - net->fast_recovery_tsn, MAX_TSN) || - (asoc->last_acked_seq == net->fast_recovery_tsn) || - compare_with_wrap(net->pseudo_cumack, net->fast_recovery_tsn, MAX_TSN) || - (net->pseudo_cumack == net->fast_recovery_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || + SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { net->will_exit_fast_recovery = 1; } } @@ -304,32 +342,39 @@ sctp_cwnd_update_after_sack(struct sctp_ if (net->cwnd <= net->ssthresh) { /* We are in slow start */ if (net->flight_size + net->net_ack >= net->cwnd) { - if (net->net_ack > (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable))) { - old_cwnd = net->cwnd; - net->cwnd += (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)); - SDT_PROBE(sctp, cwnd, net, ack, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->mtu, - SCTP_CWND_LOG_FROM_SS); + old_cwnd = net->cwnd; + if (stcb->asoc.sctp_cmt_on_off == 2) { + uint32_t limit; + + limit = (uint32_t) (((uint64_t) net->mtu * + (uint64_t) SCTP_BASE_SYSCTL(sctp_L2_abc_variable) * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + incr = (uint32_t) (((uint64_t) net->net_ack * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if (incr > limit) { + incr = limit; + } + if (incr == 0) { + incr = 1; } } else { - old_cwnd = net->cwnd; - net->cwnd += net->net_ack; - SDT_PROBE(sctp, cwnd, net, ack, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->net_ack, - SCTP_CWND_LOG_FROM_SS); + incr = net->net_ack; + if (incr > net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)) { + incr = net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable); } } + net->cwnd += incr; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, incr, + SCTP_CWND_LOG_FROM_SS); + } + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, @@ -338,6 +383,8 @@ sctp_cwnd_update_after_sack(struct sctp_ } } else { /* We are in congestion avoidance */ + uint32_t incr; + /* * Add to pba */ @@ -347,7 +394,17 @@ sctp_cwnd_update_after_sack(struct sctp_ (net->partial_bytes_acked >= net->cwnd)) { net->partial_bytes_acked -= net->cwnd; old_cwnd = net->cwnd; - net->cwnd += net->mtu; + if (asoc->sctp_cmt_on_off == 2) { + incr = (uint32_t) (((uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if (incr == 0) { + incr = 1; + } + } else { + incr = net->mtu; + } + net->cwnd += incr; SDT_PROBE(sctp, cwnd, net, ack, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), @@ -394,8 +451,32 @@ void sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; + uint32_t t_ssthresh, t_cwnd; - net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); + /* MT FIXME: Don't compute this over and over again */ + t_ssthresh = 0; + t_cwnd = 0; + if (stcb->asoc.sctp_cmt_on_off == 2) { + struct sctp_nets *lnet; + + TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) { + t_ssthresh += lnet->ssthresh; + t_cwnd += lnet->cwnd; + } + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + if ((net->cwnd > t_cwnd / 2) && + (net->ssthresh < net->cwnd - t_cwnd / 2)) { + net->ssthresh = net->cwnd - t_cwnd / 2; + } + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + } + } else { + net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); + } net->cwnd = net->mtu; net->partial_bytes_acked = 0; SDT_PROBE(sctp, cwnd, net, to, @@ -844,11 +925,8 @@ sctp_hs_cwnd_update_after_sack(struct sc * CMT fast recovery code. Need to debug. */ if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { - if (compare_with_wrap(asoc->last_acked_seq, - net->fast_recovery_tsn, MAX_TSN) || - (asoc->last_acked_seq == net->fast_recovery_tsn) || - compare_with_wrap(net->pseudo_cumack, net->fast_recovery_tsn, MAX_TSN) || - (net->pseudo_cumack == net->fast_recovery_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || + SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { net->will_exit_fast_recovery = 1; } } @@ -1329,11 +1407,8 @@ sctp_htcp_cwnd_update_after_sack(struct * CMT fast recovery code. Need to debug. */ if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { - if (compare_with_wrap(asoc->last_acked_seq, - net->fast_recovery_tsn, MAX_TSN) || - (asoc->last_acked_seq == net->fast_recovery_tsn) || - compare_with_wrap(net->pseudo_cumack, net->fast_recovery_tsn, MAX_TSN) || - (net->pseudo_cumack == net->fast_recovery_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || + SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { net->will_exit_fast_recovery = 1; } } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:47:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 804C51065670; Fri, 10 Feb 2012 07:47:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D4A08FC08; Fri, 10 Feb 2012 07:47:34 +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 q1A7lYeF060888; Fri, 10 Feb 2012 07:47:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7lYeb060883; Fri, 10 Feb 2012 07:47:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100747.q1A7lYeb060883@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:47:34 +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: r231361 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:47:34 -0000 Author: tuexen Date: Fri Feb 10 07:47:34 2012 New Revision: 231361 URL: http://svn.freebsd.org/changeset/base/231361 Log: MFC r217611: Cleanup the management of CC functions. Deleted: stable/8/sys/netinet/sctp_cc_functions.h Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:44:03 2012 (r231360) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 07:47:34 2012 (r231361) @@ -41,12 +41,11 @@ #include #include #include -#include #include #include __FBSDID("$FreeBSD$"); -void +static void sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { struct sctp_association *assoc; @@ -84,7 +83,7 @@ sctp_set_initial_cc_param(struct sctp_tc } } -void +static void sctp_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_association *asoc) { @@ -191,7 +190,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } -void +static void sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -447,7 +446,7 @@ skip_cwnd_update: } } -void +static void sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; @@ -489,7 +488,7 @@ sctp_cwnd_update_after_timeout(struct sc } } -void +static void sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; @@ -512,7 +511,7 @@ sctp_cwnd_update_after_ecn_echo(struct s } } -void +static void sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_pktdrop_chunk *cp, uint32_t * bottle_bw, uint32_t * on_queue) @@ -628,7 +627,7 @@ sctp_cwnd_update_after_packet_dropped(st } } -void +static void sctp_cwnd_update_after_output(struct sctp_tcb *stcb, struct sctp_nets *net, int burst_limit) { @@ -647,7 +646,7 @@ sctp_cwnd_update_after_output(struct sct } } -void +static void sctp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -836,7 +835,7 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *s } } -void +static void sctp_hs_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_association *asoc) { @@ -908,7 +907,7 @@ sctp_hs_cwnd_update_after_fr(struct sctp } } -void +static void sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -1374,7 +1373,7 @@ htcp_init(struct sctp_tcb *stcb, struct net->htcp_ca.last_cong = sctp_get_tick_count(); } -void +static void sctp_htcp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { /* @@ -1390,7 +1389,7 @@ sctp_htcp_set_initial_cc_param(struct sc } } -void +static void sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -1550,7 +1549,7 @@ skip_cwnd_update: } } -void +static void sctp_htcp_cwnd_update_after_fr(struct sctp_tcb *stcb, struct sctp_association *asoc) { @@ -1629,7 +1628,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc } } -void +static void sctp_htcp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1645,7 +1644,7 @@ sctp_htcp_cwnd_update_after_timeout(stru } } -void +static void sctp_htcp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1669,7 +1668,7 @@ sctp_htcp_cwnd_update_after_fr_timer(str } } -void +static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1691,3 +1690,36 @@ sctp_htcp_cwnd_update_after_ecn_echo(str sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); } } + +struct sctp_cc_functions sctp_cc_functions[] = { + { + .sctp_set_initial_cc_param = sctp_set_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_cwnd_update_after_sack, + .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer + }, + { + .sctp_set_initial_cc_param = sctp_set_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_hs_cwnd_update_after_sack, + .sctp_cwnd_update_after_fr = sctp_hs_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer + }, + { + .sctp_set_initial_cc_param = sctp_htcp_set_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_htcp_cwnd_update_after_sack, + .sctp_cwnd_update_after_fr = sctp_htcp_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_htcp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_htcp_cwnd_update_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer + } +}; Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:44:03 2012 (r231360) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 07:47:34 2012 (r231361) @@ -2516,13 +2516,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_sws_sender = SCTP_SWS_SENDER_DEF; m->sctp_sws_receiver = SCTP_SWS_RECEIVER_DEF; m->max_burst = SCTP_BASE_SYSCTL(sctp_max_burst_default); - if ((SCTP_BASE_SYSCTL(sctp_default_cc_module) >= SCTP_CC_RFC2581) && - (SCTP_BASE_SYSCTL(sctp_default_cc_module) <= SCTP_CC_HTCP)) { - m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); - } else { - /* sysctl done with invalid value, set to 2581 */ - m->sctp_default_cc_module = SCTP_CC_RFC2581; - } + m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:44:03 2012 (r231360) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:47:34 2012 (r231361) @@ -48,11 +48,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +extern struct sctp_cc_functions sctp_cc_functions[]; void sctp_init(void) @@ -2867,75 +2867,26 @@ sctp_setopt(struct socket *so, int optna SCTP_FIND_STCB(inp, stcb, av->assoc_id); if (stcb) { switch (av->assoc_value) { - /* - * JRS - Standard TCP congestion - * control - */ case SCTP_CC_RFC2581: - { - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - SCTP_TCB_UNLOCK(stcb); - break; - } - /* - * JRS - High Speed TCP congestion - * control (Floyd) - */ case SCTP_CC_HSTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HSTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_hs_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_hs_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - SCTP_TCB_UNLOCK(stcb); - break; - } - /* JRS - HTCP congestion control */ case SCTP_CC_HTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_htcp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_htcp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_htcp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_htcp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_htcp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_htcp_cwnd_update_after_fr_timer; - SCTP_TCB_UNLOCK(stcb); - break; - } - /* - * JRS - All other values are - * invalid - */ + stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value]; + stcb->asoc.congestion_control_module = av->assoc_value; + break; default: - { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - error = EINVAL; - SCTP_TCB_UNLOCK(stcb); - break; - } + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + break; } + SCTP_TCB_UNLOCK(stcb); } else { switch (av->assoc_value) { case SCTP_CC_RFC2581: case SCTP_CC_HSTCP: case SCTP_CC_HTCP: + SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_cc_module = av->assoc_value; + SCTP_INP_WUNLOCK(inp); break; default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 07:44:03 2012 (r231360) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 07:47:34 2012 (r231361) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include /* for sctp_deliver_data() */ #include #include -#include #include @@ -55,6 +54,8 @@ __FBSDID("$FreeBSD$"); #define KTR_SCTP KTR_SUBSYS #endif +extern struct sctp_cc_functions sctp_cc_functions[]; + void sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr) @@ -1044,67 +1045,17 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_autoclose_ticks = m->sctp_ep.auto_close_time; - /* - * JRS - Pick the default congestion control module based on the - * sysctl. - */ switch (m->sctp_ep.sctp_default_cc_module) { - /* JRS - Standard TCP congestion control */ case SCTP_CC_RFC2581: - { - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - break; - } - /* JRS - High Speed TCP congestion control (Floyd) */ case SCTP_CC_HSTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HSTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_hs_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_hs_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - break; - } - /* JRS - HTCP congestion control */ case SCTP_CC_HTCP: - { - stcb->asoc.congestion_control_module = SCTP_CC_HTCP; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_htcp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_htcp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_htcp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_htcp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_htcp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_htcp_cwnd_update_after_fr_timer; - break; - } - /* JRS - By default, use RFC2581 */ + stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module; + stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module]; + break; default: - { - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param; - stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr; - stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo; - stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped; - stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output; - stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer; - break; - } + stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; + stcb->asoc.cc_functions = sctp_cc_functions[SCTP_CC_RFC2581]; + break; } /* From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:49:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5294106566B; Fri, 10 Feb 2012 07:49:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D33FB8FC0C; Fri, 10 Feb 2012 07:49:57 +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 q1A7nvsp061003; Fri, 10 Feb 2012 07:49:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7nvKg060999; Fri, 10 Feb 2012 07:49:57 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100749.q1A7nvKg060999@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:49:57 +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: r231362 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:49:58 -0000 Author: tuexen Date: Fri Feb 10 07:49:57 2012 New Revision: 231362 URL: http://svn.freebsd.org/changeset/base/231362 Log: MFC r217635: Fix it so we align with new socket API draft for state's in destination (i.e. ACTIVE/INACTIVE/UNCONFIRMED) From rrs@. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 07:47:34 2012 (r231361) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 07:49:57 2012 (r231362) @@ -506,8 +506,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_ADDR_UNCONFIRMED 0x200 #define SCTP_ADDR_REQ_PRIMARY 0x400 /* JRS 5/13/07 - Added potentially failed state for CMT PF */ -#define SCTP_ADDR_PF 0x800 -#define SCTP_REACHABLE_MASK 0x203 +#define SCTP_ADDR_PF 0x800 /* bound address types (e.g. valid address types to allow) */ #define SCTP_BOUND_V6 0x01 Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:47:34 2012 (r231361) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 07:49:57 2012 (r231362) @@ -233,31 +233,10 @@ struct sctp_paddr_change { #define SCTP_ADDR_MADE_PRIM 0x0005 #define SCTP_ADDR_CONFIRMED 0x0006 -/* - * CAUTION: these are user exposed SCTP addr reachability states must be - * compatible with SCTP_ADDR states in sctp_constants.h - */ -#ifdef SCTP_ACTIVE -#undef SCTP_ACTIVE -#endif #define SCTP_ACTIVE 0x0001 /* SCTP_ADDR_REACHABLE */ - -#ifdef SCTP_INACTIVE -#undef SCTP_INACTIVE -#endif #define SCTP_INACTIVE 0x0002 /* SCTP_ADDR_NOT_REACHABLE */ - -#ifdef SCTP_UNCONFIRMED -#undef SCTP_UNCONFIRMED -#endif #define SCTP_UNCONFIRMED 0x0200 /* SCTP_ADDR_UNCONFIRMED */ -#ifdef SCTP_NOHEARTBEAT -#undef SCTP_NOHEARTBEAT -#endif -#define SCTP_NOHEARTBEAT 0x0040 /* SCTP_ADDR_NOHB */ - - /* remote error events */ struct sctp_remote_error { uint16_t sre_type; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:47:34 2012 (r231361) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:49:57 2012 (r231362) @@ -2341,7 +2341,16 @@ flags_out: } if ((stcb) && (net)) { - paddri->spinfo_state = net->dest_state & (SCTP_REACHABLE_MASK | SCTP_ADDR_NOHB); + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* Its unconfirmed */ + paddri->spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* The Active */ + paddri->spinfo_state = SCTP_ACTIVE; + } else { + /* It's Inactive */ + paddri->spinfo_state = SCTP_INACTIVE; + } paddri->spinfo_cwnd = net->cwnd; paddri->spinfo_srtt = ((net->lastsa >> 2) + net->lastsv) >> 1; paddri->spinfo_rto = net->RTO; @@ -2409,7 +2418,16 @@ flags_out: * Again the user can get info from sctp_constants.h * for what the state of the network is. */ - sstat->sstat_primary.spinfo_state = net->dest_state & SCTP_REACHABLE_MASK; + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* It's unconfirmed */ + sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* Its active */ + sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; + } else { + /* It's Inactive */ + sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; + } sstat->sstat_primary.spinfo_cwnd = net->cwnd; sstat->sstat_primary.spinfo_srtt = net->lastsa; sstat->sstat_primary.spinfo_rto = net->RTO; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:51:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F029A106564A; Fri, 10 Feb 2012 07:51:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE79F8FC14; Fri, 10 Feb 2012 07:51:28 +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 q1A7pSKX061098; Fri, 10 Feb 2012 07:51:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7pS0V061096; Fri, 10 Feb 2012 07:51:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100751.q1A7pS0V061096@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:51:28 +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: r231363 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:51:29 -0000 Author: tuexen Date: Fri Feb 10 07:51:28 2012 New Revision: 231363 URL: http://svn.freebsd.org/changeset/base/231363 Log: MFC r217638: Improve comments. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:49:57 2012 (r231362) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 07:51:28 2012 (r231363) @@ -2342,13 +2342,13 @@ flags_out: if ((stcb) && (net)) { if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { - /* Its unconfirmed */ + /* It's unconfirmed */ paddri->spinfo_state = SCTP_UNCONFIRMED; } else if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* The Active */ + /* It's active */ paddri->spinfo_state = SCTP_ACTIVE; } else { - /* It's Inactive */ + /* It's inactive */ paddri->spinfo_state = SCTP_INACTIVE; } paddri->spinfo_cwnd = net->cwnd; @@ -2422,10 +2422,10 @@ flags_out: /* It's unconfirmed */ sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; } else if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* Its active */ + /* It's active */ sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; } else { - /* It's Inactive */ + /* It's inactive */ sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; } sstat->sstat_primary.spinfo_cwnd = net->cwnd; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 07:52:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 211AE106566C; Fri, 10 Feb 2012 07:52:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F4F08FC08; Fri, 10 Feb 2012 07:52: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 q1A7qpWC061190; Fri, 10 Feb 2012 07:52:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A7qpx4061188; Fri, 10 Feb 2012 07:52:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202100752.q1A7qpx4061188@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 07:52:51 +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: r231364 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:52:52 -0000 Author: tuexen Date: Fri Feb 10 07:52:51 2012 New Revision: 231364 URL: http://svn.freebsd.org/changeset/base/231364 Log: MFC r217742: Remove unnecessary checking of variable. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 07:51:28 2012 (r231363) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 07:52:51 2012 (r231364) @@ -1045,18 +1045,8 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_autoclose_ticks = m->sctp_ep.auto_close_time; - switch (m->sctp_ep.sctp_default_cc_module) { - case SCTP_CC_RFC2581: - case SCTP_CC_HSTCP: - case SCTP_CC_HTCP: - stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module; - stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module]; - break; - default: - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions = sctp_cc_functions[SCTP_CC_RFC2581]; - break; - } + stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module; + stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module]; /* * Now the stream parameters, here we allocate space for all streams From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 09:42:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 05519106564A; Fri, 10 Feb 2012 09:42:26 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 9286614E91E; Fri, 10 Feb 2012 09:42:25 +0000 (UTC) Message-ID: <4F34E681.3050105@FreeBSD.org> Date: Fri, 10 Feb 2012 01:42:25 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Baptiste Daroussin References: <201202091416.q19EGenl004705@svn.freebsd.org> In-Reply-To: <201202091416.q19EGenl004705@svn.freebsd.org> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231278 - in stable/8: etc/rc.d sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:42:26 -0000 ALWAYS ALWAYS ALWAYS merge things in /etc in foo/etc. You should have known this because you thoroughly read http://wiki.freebsd.org/SubversionPrimer, especially the section on merging. Your mentor should have told you this, and ensured that you were doing it right when he reviewed your diff. On 02/09/2012 06:16, Baptiste Daroussin wrote: > Author: bapt > Date: Thu Feb 9 14:16:40 2012 > New Revision: 231278 > URL: http://svn.freebsd.org/changeset/base/231278 > > Log: > MFH r226345, r226464, r226879: > Make dhclient use a pid file. Modify the rc script accordingly, fix some bugs > > Approved by: des (mentor) -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 09:46:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81AF0106564A; Fri, 10 Feb 2012 09:46:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55A438FC16; Fri, 10 Feb 2012 09:46:31 +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 q1A9kVAU065008; Fri, 10 Feb 2012 09:46:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A9kVOp065007; Fri, 10 Feb 2012 09:46:31 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202100946.q1A9kVOp065007@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 09:46:31 +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: r231365 - in stable/9/etc: . rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:46:31 -0000 Author: dougb Date: Fri Feb 10 09:46:30 2012 New Revision: 231365 URL: http://svn.freebsd.org/changeset/base/231365 Log: Pull up mergeinfo from r226345,226464,226879 to etc/ where it belongs Modified: Directory Properties: stable/9/etc/ (props changed) stable/9/etc/rc.d/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 09:47:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FCB01065670; Fri, 10 Feb 2012 09:47:00 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23DAE8FC0A; Fri, 10 Feb 2012 09:47:00 +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 q1A9kx2x065064; Fri, 10 Feb 2012 09:47:00 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A9kx6W065063; Fri, 10 Feb 2012 09:46:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202100946.q1A9kx6W065063@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 09:46:59 +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: r231366 - in stable/8/etc: . rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:47:00 -0000 Author: dougb Date: Fri Feb 10 09:46:59 2012 New Revision: 231366 URL: http://svn.freebsd.org/changeset/base/231366 Log: Pull up mergeinfo from r226345,226464,226879 to etc/ where it belongs Modified: Directory Properties: stable/8/etc/ (props changed) stable/8/etc/rc.d/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 09:55:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665FD106566C; Fri, 10 Feb 2012 09:55:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54ECE8FC12; Fri, 10 Feb 2012 09:55:19 +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 q1A9tJVS065378; Fri, 10 Feb 2012 09:55:19 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A9tJ8g065375; Fri, 10 Feb 2012 09:55:19 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100955.q1A9tJ8g065375@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 09:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231367 - in head/sys: geom/part sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:55:19 -0000 Author: ae Date: Fri Feb 10 09:55:18 2012 New Revision: 231367 URL: http://svn.freebsd.org/changeset/base/231367 Log: Add alias for the partition with type 0x42 to the MBR scheme. MFC after: 1 week Modified: head/sys/geom/part/g_part_mbr.c head/sys/sys/diskmbr.h Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Fri Feb 10 09:46:59 2012 (r231366) +++ head/sys/geom/part/g_part_mbr.c Fri Feb 10 09:55:18 2012 (r231367) @@ -119,6 +119,7 @@ static struct g_part_mbr_alias { { DOSPTYP_EXT, G_PART_ALIAS_EBR }, { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, + { DOSPTYP_LDM, G_PART_ALIAS_MS_LDM_DATA }, { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Fri Feb 10 09:46:59 2012 (r231366) +++ head/sys/sys/diskmbr.h Fri Feb 10 09:55:18 2012 (r231367) @@ -49,6 +49,7 @@ #define DOSPTYP_FAT32 0x0b /* FAT32 partition */ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ #define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ +#define DOSPTYP_LDM 0x42 /* Win2k dynamic extended partition */ #define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 09:58:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 622821065670; Fri, 10 Feb 2012 09:58:21 +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 458ED8FC12; Fri, 10 Feb 2012 09:58: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 q1A9wLqa065515; Fri, 10 Feb 2012 09:58:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A9wLNd065511; Fri, 10 Feb 2012 09:58:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202100958.q1A9wLNd065511@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 Feb 2012 09:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231368 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:58:21 -0000 Author: adrian Date: Fri Feb 10 09:58:20 2012 New Revision: 231368 URL: http://svn.freebsd.org/changeset/base/231368 Log: Extend the HAL code to allow the RX and TX chainmask to be overridden by capabilities. Add an ar5416SetCapability() function, which contains logic to override the chainmask and update the relevant stream. This is designed to be called after the attach function, which presets the TX/RX chainmask and stream. TODO: check the chainmask against the hardware chainmask so non-existing chains aren't enabled. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Feb 10 09:55:18 2012 (r231367) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Feb 10 09:58:20 2012 (r231368) @@ -207,6 +207,9 @@ extern HAL_STATUS ar5416SetQuiet(struct uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag); extern HAL_STATUS ar5416GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t *result); +extern HAL_BOOL ar5416SetCapability(struct ath_hal *ah, + HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t val, + HAL_STATUS *status); extern HAL_BOOL ar5416GetDiagState(struct ath_hal *ah, int request, const void *args, uint32_t argsize, void **result, uint32_t *resultsize); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Feb 10 09:55:18 2012 (r231367) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Feb 10 09:58:20 2012 (r231368) @@ -129,6 +129,7 @@ ar5416InitState(struct ath_hal_5416 *ahp /* Misc Functions */ ah->ah_getCapability = ar5416GetCapability; + ah->ah_setCapability = ar5416SetCapability; ah->ah_getDiagState = ar5416GetDiagState; ah->ah_setLedState = ar5416SetLedState; ah->ah_gpioCfgOutput = ar5416GpioCfgOutput; @@ -884,6 +885,7 @@ ar5416FillCapabilityInfo(struct ath_hal /* AR5416 may have 3 antennas but is a 2x2 stream device */ pCap->halTxStreams = 2; pCap->halRxStreams = 2; + /* * If the TX or RX chainmask has less than 2 chains active, * mark it as a 1-stream device for the relevant stream. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 10 09:55:18 2012 (r231367) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 10 09:58:20 2012 (r231368) @@ -27,6 +27,8 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +#include "ah_eeprom_v14.h" /* for owl_get_ntxchains() */ + /* * Return the wireless modes (a,b,g,n,t) supported by hardware. * @@ -430,6 +432,33 @@ ar5416GetCapability(struct ath_hal *ah, return ar5212GetCapability(ah, type, capability, result); } +HAL_BOOL +ar5416SetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, + u_int32_t capability, u_int32_t setting, HAL_STATUS *status) +{ + HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; + + switch (type) { + case HAL_CAP_RX_CHAINMASK: + pCap->halRxChainMask = setting; + if (owl_get_ntxchains(setting) > 2) + pCap->halRxStreams = 2; + else + pCap->halRxStreams = 1; + return HAL_OK; + case HAL_CAP_TX_CHAINMASK: + pCap->halTxChainMask = setting; + if (owl_get_ntxchains(setting) > 2) + pCap->halTxStreams = 2; + else + pCap->halTxStreams = 1; + return HAL_OK; + default: + break; + } + return ar5212SetCapability(ah, type, capability, setting, status); +} + static int ar5416DetectMacHang(struct ath_hal *ah); static int ar5416DetectBBHang(struct ath_hal *ah); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 10:01:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F79A106564A; Fri, 10 Feb 2012 10:01:10 +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 62B978FC13; Fri, 10 Feb 2012 10:01: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 q1AA1A1W065699; Fri, 10 Feb 2012 10:01:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AA1A7v065696; Fri, 10 Feb 2012 10:01:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202101001.q1AA1A7v065696@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 Feb 2012 10:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231369 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:01:10 -0000 Author: adrian Date: Fri Feb 10 10:01:09 2012 New Revision: 231369 URL: http://svn.freebsd.org/changeset/base/231369 Log: Add in a new driver feature to allow the TX and RX chainmask to be overridden at attach time. Some 802.11n NICs may only have one physical antenna connected. The radios will be very upset if you try enabling radios which aren't connected to antennas. This allows hints to override the TX and RX chainmask. These hints are: hint.ath.X.rx_chainmask hint.ath.X.tx_chainmask They can be set at either boot time or in kenv before the module is loaded. This and the previous HAL commit were sponsored in late 2011 by Hobnob, Inc. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 10 09:58:20 2012 (r231368) +++ head/sys/dev/ath/if_ath.c Fri Feb 10 10:01:09 2012 (r231369) @@ -284,6 +284,7 @@ ath_attach(u_int16_t devid, struct ath_s int error = 0, i; u_int wmodes; uint8_t macaddr[IEEE80211_ADDR_LEN]; + int rx_chainmask, tx_chainmask; DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); @@ -634,6 +635,29 @@ ath_attach(u_int16_t devid, struct ath_s #endif /* + * Allow the TX and RX chainmasks to be overridden by + * environment variables and/or device.hints. + * + * This must be done early - before the hardware is + * calibrated or before the 802.11n stream calculation + * is done. + */ + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), "rx_chainmask", + &rx_chainmask) == 0) { + device_printf(sc->sc_dev, "Setting RX chainmask to 0x%x\n", + rx_chainmask); + (void) ath_hal_setrxchainmask(sc->sc_ah, rx_chainmask); + } + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), "tx_chainmask", + &tx_chainmask) == 0) { + device_printf(sc->sc_dev, "Setting TX chainmask to 0x%x\n", + tx_chainmask); + (void) ath_hal_settxchainmask(sc->sc_ah, rx_chainmask); + } + + /* * The if_ath 11n support is completely not ready for normal use. * Enabling this option will likely break everything and everything. * Don't think of doing that unless you know what you're doing. Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Feb 10 09:58:20 2012 (r231368) +++ head/sys/dev/ath/if_athvar.h Fri Feb 10 10:01:09 2012 (r231369) @@ -888,6 +888,10 @@ void ath_intr(void *); (ath_hal_getcapability(_ah, HAL_CAP_RX_CHAINMASK, 0, _prxchainmask)) #define ath_hal_gettxchainmask(_ah, _ptxchainmask) \ (ath_hal_getcapability(_ah, HAL_CAP_TX_CHAINMASK, 0, _ptxchainmask)) +#define ath_hal_setrxchainmask(_ah, _rx) \ + (ath_hal_setcapability(_ah, HAL_CAP_RX_CHAINMASK, 1, _rx, NULL)) +#define ath_hal_settxchainmask(_ah, _tx) \ + (ath_hal_setcapability(_ah, HAL_CAP_TX_CHAINMASK, 1, _tx, NULL)) #define ath_hal_split4ktrans(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_SPLIT_4KB_TRANS, \ 0, NULL) == HAL_OK) From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 10:09:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A28BA106566B; Fri, 10 Feb 2012 10:09:17 +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 913338FC08; Fri, 10 Feb 2012 10:09: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 q1AA9HYZ065980; Fri, 10 Feb 2012 10:09:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AA9H7h065978; Fri, 10 Feb 2012 10:09:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202101009.q1AA9H7h065978@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 Feb 2012 10:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231370 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:09:17 -0000 Author: adrian Date: Fri Feb 10 10:09:16 2012 New Revision: 231370 URL: http://svn.freebsd.org/changeset/base/231370 Log: .. oops, use the right chainmask. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 10 10:01:09 2012 (r231369) +++ head/sys/dev/ath/if_ath.c Fri Feb 10 10:09:16 2012 (r231370) @@ -654,7 +654,7 @@ ath_attach(u_int16_t devid, struct ath_s &tx_chainmask) == 0) { device_printf(sc->sc_dev, "Setting TX chainmask to 0x%x\n", tx_chainmask); - (void) ath_hal_settxchainmask(sc->sc_ah, rx_chainmask); + (void) ath_hal_settxchainmask(sc->sc_ah, tx_chainmask); } /* From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 10:10:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0A38106564A; Fri, 10 Feb 2012 10:10:41 +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 CF3698FC0A; Fri, 10 Feb 2012 10:10:41 +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 q1AAAf2r066065; Fri, 10 Feb 2012 10:10:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AAAfal066063; Fri, 10 Feb 2012 10:10:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202101010.q1AAAfal066063@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 Feb 2012 10:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231371 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:10:42 -0000 Author: adrian Date: Fri Feb 10 10:10:41 2012 New Revision: 231371 URL: http://svn.freebsd.org/changeset/base/231371 Log: Enforce the hardware chainmask when allowing the user to override the chainmask. This way a disabled radio chain can't be enabled by a user. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 10 10:09:16 2012 (r231370) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 10 10:10:41 2012 (r231371) @@ -440,6 +440,7 @@ ar5416SetCapability(struct ath_hal *ah, switch (type) { case HAL_CAP_RX_CHAINMASK: + setting &= ath_hal_eepromGet(ah, AR_EEP_RXMASK, NULL); pCap->halRxChainMask = setting; if (owl_get_ntxchains(setting) > 2) pCap->halRxStreams = 2; @@ -447,6 +448,7 @@ ar5416SetCapability(struct ath_hal *ah, pCap->halRxStreams = 1; return HAL_OK; case HAL_CAP_TX_CHAINMASK: + setting &= ath_hal_eepromGet(ah, AR_EEP_TXMASK, NULL); pCap->halTxChainMask = setting; if (owl_get_ntxchains(setting) > 2) pCap->halTxStreams = 2; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 10:18:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6064C106564A; Fri, 10 Feb 2012 10:18:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DAAF8FC0C; Fri, 10 Feb 2012 10:18:31 +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 q1AAIVph066407; Fri, 10 Feb 2012 10:18:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AAIUTC066391; Fri, 10 Feb 2012 10:18:30 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202101018.q1AAIUTC066391@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 10:18: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: r231372 - stable/8/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:18:31 -0000 Author: dougb Date: Fri Feb 10 10:18:30 2012 New Revision: 231372 URL: http://svn.freebsd.org/changeset/base/231372 Log: MFC r208307: This change does the following for the scripts that run up through FILESYSTEMS (the default early_late_divider): 1. Move sysctl to run first 2. Move as many BEFOREs to REQUIREs as possible. 3. Minor effect, move hostid_save from right before mdconfig to right after. A lot of the early scripts make use of sysctl one way or another so running this first makes a lot of sense given that system-critical values are often placed in sysctl.conf. (More details in original log.) In addition to the changes from this revision, tweak a few other rcorder elements in order to minimize the differences between the order before and after this change, mostly related to scripts still in this branch that are no longer in HEAD. Modified: stable/8/etc/rc.d/SERVERS stable/8/etc/rc.d/addswap stable/8/etc/rc.d/auto_linklocal stable/8/etc/rc.d/cleanvar stable/8/etc/rc.d/ddb stable/8/etc/rc.d/dumpon stable/8/etc/rc.d/hostid stable/8/etc/rc.d/hostid_save stable/8/etc/rc.d/initrandom stable/8/etc/rc.d/mdconfig stable/8/etc/rc.d/mountcritlocal stable/8/etc/rc.d/netif stable/8/etc/rc.d/savecore stable/8/etc/rc.d/sysctl stable/8/etc/rc.d/zvol Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/SERVERS ============================================================================== --- stable/8/etc/rc.d/SERVERS Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/SERVERS Fri Feb 10 10:18:30 2012 (r231372) @@ -4,7 +4,7 @@ # # PROVIDE: SERVERS -# REQUIRE: mountcritremote abi ldconfig +# REQUIRE: mountcritremote abi ldconfig savecore # This is a dummy dependency, for early-start servers relying on # some basic configuration. Modified: stable/8/etc/rc.d/addswap ============================================================================== --- stable/8/etc/rc.d/addswap Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/addswap Fri Feb 10 10:18:30 2012 (r231372) @@ -7,7 +7,6 @@ # PROVIDE: addswap # REQUIRE: FILESYSTEMS -# BEFORE: sysctl # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/auto_linklocal ============================================================================== --- stable/8/etc/rc.d/auto_linklocal Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/auto_linklocal Fri Feb 10 10:18:30 2012 (r231372) @@ -5,7 +5,6 @@ # PROVIDE: auto_linklocal # REQUIRE: root -# BEFORE: sysctl # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/cleanvar ============================================================================== --- stable/8/etc/rc.d/cleanvar Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/cleanvar Fri Feb 10 10:18:30 2012 (r231372) @@ -4,7 +4,7 @@ # # PROVIDE: cleanvar -# REQUIRE: FILESYSTEMS var +# REQUIRE: FILESYSTEMS var addswap . /etc/rc.subr Modified: stable/8/etc/rc.d/ddb ============================================================================== --- stable/8/etc/rc.d/ddb Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/ddb Fri Feb 10 10:18:30 2012 (r231372) @@ -5,7 +5,7 @@ # PROVIDE: ddb # REQUIRE: dumpon -# BEFORE: disks savecore initrandom +# BEFORE: disks # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/dumpon ============================================================================== --- stable/8/etc/rc.d/dumpon Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/dumpon Fri Feb 10 10:18:30 2012 (r231372) @@ -4,7 +4,8 @@ # # PROVIDE: dumpon -# BEFORE: disks savecore initrandom +# REQUIRE: zvol +# BEFORE: disks # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/hostid ============================================================================== --- stable/8/etc/rc.d/hostid Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/hostid Fri Feb 10 10:18:30 2012 (r231372) @@ -28,7 +28,7 @@ # # PROVIDE: hostid -# BEFORE: fsck +# REQUIRE: sysctl # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/hostid_save ============================================================================== --- stable/8/etc/rc.d/hostid_save Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/hostid_save Fri Feb 10 10:18:30 2012 (r231372) @@ -5,7 +5,6 @@ # PROVIDE: hostid_save # REQUIRE: root -# BEFORE: mountcritlocal # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/initrandom ============================================================================== --- stable/8/etc/rc.d/initrandom Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/initrandom Fri Feb 10 10:18:30 2012 (r231372) @@ -4,6 +4,7 @@ # # PROVIDE: initrandom +# REQUIRE: dumpon ddb # BEFORE: disks # KEYWORD: nojail Modified: stable/8/etc/rc.d/mdconfig ============================================================================== --- stable/8/etc/rc.d/mdconfig Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/mdconfig Fri Feb 10 10:18:30 2012 (r231372) @@ -28,8 +28,7 @@ # # PROVIDE: mdconfig -# REQUIRE: localswap -# BEFORE: mountcritlocal +# REQUIRE: localswap root . /etc/rc.subr Modified: stable/8/etc/rc.d/mountcritlocal ============================================================================== --- stable/8/etc/rc.d/mountcritlocal Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/mountcritlocal Fri Feb 10 10:18:30 2012 (r231372) @@ -4,7 +4,7 @@ # # PROVIDE: mountcritlocal -# REQUIRE: root +# REQUIRE: root hostid_save mdconfig # KEYWORD: nojail shutdown . /etc/rc.subr Modified: stable/8/etc/rc.d/netif ============================================================================== --- stable/8/etc/rc.d/netif Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/netif Fri Feb 10 10:18:30 2012 (r231372) @@ -27,7 +27,7 @@ # PROVIDE: netif # REQUIRE: atm1 cleanvar FILESYSTEMS serial sppp sysctl -# REQUIRE: ipfilter ipfs +# REQUIRE: ipfilter ipfs auto_linklocal # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/savecore ============================================================================== --- stable/8/etc/rc.d/savecore Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/savecore Fri Feb 10 10:18:30 2012 (r231372) @@ -4,8 +4,7 @@ # # PROVIDE: savecore -# REQUIRE: syslogd -# BEFORE: SERVERS +# REQUIRE: dumpon ddb syslogd # KEYWORD: nojail . /etc/rc.subr Modified: stable/8/etc/rc.d/sysctl ============================================================================== --- stable/8/etc/rc.d/sysctl Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/sysctl Fri Feb 10 10:18:30 2012 (r231372) @@ -4,8 +4,6 @@ # # PROVIDE: sysctl -# REQUIRE: root -# BEFORE: DAEMON . /etc/rc.subr Modified: stable/8/etc/rc.d/zvol ============================================================================== --- stable/8/etc/rc.d/zvol Fri Feb 10 10:10:41 2012 (r231371) +++ stable/8/etc/rc.d/zvol Fri Feb 10 10:18:30 2012 (r231372) @@ -5,7 +5,6 @@ # PROVIDE: zvol # REQUIRE: hostid -# BEFORE: fsck # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 10:22:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 633C4106566C; Fri, 10 Feb 2012 10:22:43 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 515628FC08; Fri, 10 Feb 2012 10:22: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 q1AAMhdS066604; Fri, 10 Feb 2012 10:22:43 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AAMhWm066602; Fri, 10 Feb 2012 10:22:43 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202101022.q1AAMhWm066602@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 10:22:43 +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: r231373 - stable/9/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:22:43 -0000 Author: dougb Date: Fri Feb 10 10:22:42 2012 New Revision: 231373 URL: http://svn.freebsd.org/changeset/base/231373 Log: MFC r228191: Ensure kldxref is run first. Modified: stable/9/etc/rc.d/kld Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/kld ============================================================================== --- stable/9/etc/rc.d/kld Fri Feb 10 10:18:30 2012 (r231372) +++ stable/9/etc/rc.d/kld Fri Feb 10 10:22:42 2012 (r231373) @@ -27,7 +27,7 @@ # $FreeBSD$ # # PROVIDE: kld -# REQUIRE: FILESYSTEMS +# REQUIRE: kldxref # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 10:23:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D36F1065676; Fri, 10 Feb 2012 10:23:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B7558FC15; Fri, 10 Feb 2012 10: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 q1AANLq7066674; Fri, 10 Feb 2012 10:23:21 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AANL1B066672; Fri, 10 Feb 2012 10:23:21 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202101023.q1AANL1B066672@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 10:23: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: r231374 - stable/8/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:23:21 -0000 Author: dougb Date: Fri Feb 10 10:23:20 2012 New Revision: 231374 URL: http://svn.freebsd.org/changeset/base/231374 Log: MFC r228191: Ensure kldxref is run first. Modified: stable/8/etc/rc.d/kld Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/kld ============================================================================== --- stable/8/etc/rc.d/kld Fri Feb 10 10:22:42 2012 (r231373) +++ stable/8/etc/rc.d/kld Fri Feb 10 10:23:20 2012 (r231374) @@ -27,7 +27,7 @@ # $FreeBSD$ # # PROVIDE: kld -# REQUIRE: FILESYSTEMS +# REQUIRE: kldxref # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 10:23:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1979106566C; Fri, 10 Feb 2012 10:23:55 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFBD08FC1D; Fri, 10 Feb 2012 10:23:55 +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 q1AANtU2066739; Fri, 10 Feb 2012 10:23:55 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AANtGQ066737; Fri, 10 Feb 2012 10:23:55 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202101023.q1AANtGQ066737@svn.freebsd.org> From: Doug Barton Date: Fri, 10 Feb 2012 10:23:55 +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: r231375 - stable/7/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:23:56 -0000 Author: dougb Date: Fri Feb 10 10:23:55 2012 New Revision: 231375 URL: http://svn.freebsd.org/changeset/base/231375 Log: MFC r228191: Ensure kldxref is run first. Modified: stable/7/etc/rc.d/kld Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/rc.d/kld ============================================================================== --- stable/7/etc/rc.d/kld Fri Feb 10 10:23:20 2012 (r231374) +++ stable/7/etc/rc.d/kld Fri Feb 10 10:23:55 2012 (r231375) @@ -27,7 +27,7 @@ # $FreeBSD$ # # PROVIDE: kld -# REQUIRE: FILESYSTEMS +# REQUIRE: kldxref # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 10:48:04 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 5B9CC106566C; Fri, 10 Feb 2012 10:48:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 0459A14F41C; Fri, 10 Feb 2012 10:48:03 +0000 (UTC) Message-ID: <4F34F5E3.5010303@FreeBSD.org> Date: Fri, 10 Feb 2012 02:48:03 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Marcel Moolenaar References: <201202092044.q19KiLUT027539@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:48:04 -0000 On 02/09/2012 14:15, Marcel Moolenaar wrote: > > On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > >> Author: eadler >> Date: Thu Feb 9 20:44:20 2012 >> New Revision: 231298 >> URL: http://svn.freebsd.org/changeset/base/231298 >> >> Log: >> Make etc/Makefile more conflict resistant > > Nice. Question though: why not the less verbose > > BIN1 = \ > foo \ > bar \ > baz > > It's probably faster too, and friendlier when > running "make -dv" Just for fun I ran 'make INDEX' a bunch of times (which touches every category and subdir) the existing way, and after changing it from += to the same syntax as in src. There was no statistically significant difference in run time. Is there anything else that would be useful to test to see if there is a good reason to make this change in ports? Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 11:20:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92AB3106566C; Fri, 10 Feb 2012 11:20:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4D78FC16; Fri, 10 Feb 2012 11:20: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 q1ABKEjt071089; Fri, 10 Feb 2012 11:20:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ABKEDG071087; Fri, 10 Feb 2012 11:20:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101120.q1ABKEDG071087@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 11:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231376 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 11:20:14 -0000 Author: ed Date: Fri Feb 10 11:20:13 2012 New Revision: 231376 URL: http://svn.freebsd.org/changeset/base/231376 Log: Remove outdated piece of information. devtoname() always returns a pathname to the device. It will never return a #major/minor string. MFC after: 2 weeks Modified: head/share/man/man9/devtoname.9 Modified: head/share/man/man9/devtoname.9 ============================================================================== --- head/share/man/man9/devtoname.9 Fri Feb 10 10:23:55 2012 (r231375) +++ head/share/man/man9/devtoname.9 Fri Feb 10 11:20:13 2012 (r231376) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2012 +.Dd February 10, 2012 .Dt DEVTONAME 9 .Os .Sh NAME @@ -41,15 +41,6 @@ The function returns a pointer to the name of the device passed to it. The name is whatever was set to it in .Fn make_dev . -If no name is associated with -.Va dev , -a pointer to a string consisting of a -.Dq # -followed by -.Dq Va major Ns / Ns Va minor -as it applies to -.Va dev -is returned. .Sh HISTORY The .Fn devtoname From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 12:01:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02F1A10656DA; Fri, 10 Feb 2012 12:01:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E246C8FC25; Fri, 10 Feb 2012 12:01:19 +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 q1AC1JaJ072334; Fri, 10 Feb 2012 12:01:19 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AC1Jfr072331; Fri, 10 Feb 2012 12:01:19 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201202101201.q1AC1Jfr072331@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 10 Feb 2012 12:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231377 - head/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 12:01:20 -0000 Author: trasz Date: Fri Feb 10 12:01:19 2012 New Revision: 231377 URL: http://svn.freebsd.org/changeset/base/231377 Log: Be more helpful about alternate superblocks. Modified: head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Fri Feb 10 11:20:13 2012 (r231376) +++ head/sbin/fsck_ffs/fsck_ffs.8 Fri Feb 10 12:01:19 2012 (r231377) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 27, 2011 +.Dd February 10, 2012 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -193,6 +193,11 @@ Use the block specified immediately afte the super block for the file system. An alternate super block is usually located at block 32 for UFS1, and block 160 for UFS2. +.Pp +See the +.Fl N +flag of +.Xr newfs 8 . .It Fl C Check if file system was dismounted cleanly. If so, skip file system checks (like "preen"). Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Fri Feb 10 11:20:13 2012 (r231376) +++ head/sbin/fsck_ffs/setup.c Fri Feb 10 12:01:19 2012 (r231377) @@ -194,7 +194,7 @@ setup(char *dev) "-b OPTION TO FSCK TO SPECIFY THE", "LOCATION OF AN ALTERNATE", "SUPER-BLOCK TO SUPPLY NEEDED", - "INFORMATION; SEE fsck(8)."); + "INFORMATION; SEE fsck_ffs(8)."); bflag = 0; return(0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 12:35:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A351065673; Fri, 10 Feb 2012 12:35:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00BF08FC16; Fri, 10 Feb 2012 12:35: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 q1ACZv4W073432; Fri, 10 Feb 2012 12:35:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ACZv2I073419; Fri, 10 Feb 2012 12:35:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101235.q1ACZv2I073419@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 12:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231378 - in head/sys: compat/linux dev/iscsi/initiator dev/sound/pcm dev/usb dev/wtap netgraph security/mac_biba security/mac_lomac security/mac_mls vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 12:35:58 -0000 Author: ed Date: Fri Feb 10 12:35:57 2012 New Revision: 231378 URL: http://svn.freebsd.org/changeset/base/231378 Log: Remove direct access to si_name. Code should just use the devtoname() function to obtain the name of a character device. Also add const keywords to pieces of code that need it to build properly. MFC after: 2 weeks Modified: head/sys/compat/linux/linux_stats.c head/sys/compat/linux/linux_util.c head/sys/compat/linux/linux_util.h head/sys/dev/iscsi/initiator/isc_sm.c head/sys/dev/sound/pcm/mixer.c head/sys/dev/usb/usb_dev.c head/sys/dev/wtap/if_wtap.c head/sys/netgraph/ng_device.c head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_lomac/mac_lomac.c head/sys/security/mac_mls/mac_mls.c head/sys/vm/swap_pager.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/compat/linux/linux_stats.c Fri Feb 10 12:35:57 2012 (r231378) @@ -66,7 +66,7 @@ translate_vnhook_major_minor(struct vnod int major, minor; if (vp->v_type == VCHR && vp->v_rdev != NULL && - linux_driver_get_major_minor(vp->v_rdev->si_name, + linux_driver_get_major_minor(devtoname(vp->v_rdev), &major, &minor) == 0) { sb->st_rdev = (major << 8 | minor); } @@ -149,14 +149,14 @@ translate_fd_major_minor(struct thread * return; vp = fp->f_vnode; if (vp != NULL && vp->v_rdev != NULL && - linux_driver_get_major_minor(vp->v_rdev->si_name, + linux_driver_get_major_minor(devtoname(vp->v_rdev), &major, &minor) == 0) { buf->st_rdev = (major << 8 | minor); } else if (fp->f_type == DTYPE_PTS) { struct tty *tp = fp->f_data; /* Convert the numbers for the slave device. */ - if (linux_driver_get_major_minor(tp->t_dev->si_name, + if (linux_driver_get_major_minor(devtoname(tp->t_dev), &major, &minor) == 0) { buf->st_rdev = (major << 8 | minor); } Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/compat/linux/linux_util.c Fri Feb 10 12:35:57 2012 (r231378) @@ -124,7 +124,7 @@ linux_driver_get_name_dev(device_t dev) } int -linux_driver_get_major_minor(char *node, int *major, int *minor) +linux_driver_get_major_minor(const char *node, int *major, int *minor) { struct device_element *de; Modified: head/sys/compat/linux/linux_util.h ============================================================================== --- head/sys/compat/linux/linux_util.h Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/compat/linux/linux_util.h Fri Feb 10 12:35:57 2012 (r231378) @@ -97,7 +97,7 @@ struct linux_device_handler { int linux_device_register_handler(struct linux_device_handler *h); int linux_device_unregister_handler(struct linux_device_handler *h); char *linux_driver_get_name_dev(device_t dev); -int linux_driver_get_major_minor(char *node, int *major, int *minor); +int linux_driver_get_major_minor(const char *node, int *major, int *minor); char *linux_get_char_devices(void); void linux_free_get_char_devices(char *string); Modified: head/sys/dev/iscsi/initiator/isc_sm.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_sm.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/dev/iscsi/initiator/isc_sm.c Fri Feb 10 12:35:57 2012 (r231378) @@ -652,13 +652,13 @@ static void isc_add_sysctls(isc_session_t *sp) { debug_called(8); - sdebug(6, "sid=%d %s", sp->sid, sp->dev->si_name); + sdebug(6, "sid=%d %s", sp->sid, devtoname(sp->dev)); sysctl_ctx_init(&sp->clist); sp->oid = SYSCTL_ADD_NODE(&sp->clist, SYSCTL_CHILDREN(sp->isc->oid), OID_AUTO, - sp->dev->si_name+5, // iscsi0 + devtoname(sp->dev) + 5, // iscsi0 CTLFLAG_RD, 0, "initiator"); Modified: head/sys/dev/sound/pcm/mixer.c ============================================================================== --- head/sys/dev/sound/pcm/mixer.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/dev/sound/pcm/mixer.c Fri Feb 10 12:35:57 2012 (r231378) @@ -1463,7 +1463,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, * * XXX Described by Hannu@4Front, but not found in * soundcard.h. - strlcpy(mi->devnode, d->mixer_dev->si_name, + strlcpy(mi->devnode, devtoname(d->mixer_dev), sizeof(mi->devnode)); mi->legacy_device = i; */ Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/dev/usb/usb_dev.c Fri Feb 10 12:35:57 2012 (r231378) @@ -842,7 +842,7 @@ usb_open(struct cdev *dev, int fflags, i struct usb_cdev_privdata *cpd; int err, ep; - DPRINTFN(2, "%s fflags=0x%08x\n", dev->si_name, fflags); + DPRINTFN(2, "%s fflags=0x%08x\n", devtoname(dev), fflags); KASSERT(fflags & (FREAD|FWRITE), ("invalid open flags")); if (((fflags & FREAD) && !(pd->mode & FREAD)) || Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/dev/wtap/if_wtap.c Fri Feb 10 12:35:57 2012 (r231378) @@ -84,7 +84,7 @@ wtap_node_write(struct cdev *dev, struct uint8_t buf[1024]; int buf_len; - uprintf("write device %s \"echo.\"\n", dev->si_name); + uprintf("write device %s \"echo.\"\n", devtoname(dev)); buf_len = MIN(uio->uio_iov->iov_len, 1024); err = copyin(uio->uio_iov->iov_base, buf, buf_len); @@ -101,7 +101,7 @@ wtap_node_write(struct cdev *dev, struct TAILQ_FOREACH(ifp, &V_ifnet, if_link) { printf("ifp->if_xname = %s\n", ifp->if_xname); - if(strcmp(dev->si_name, ifp->if_xname) == 0){ + if(strcmp(devtoname(dev), ifp->if_xname) == 0){ printf("found match, correspoding wtap = %s\n", ifp->if_xname); sc = (struct wtap_softc *)ifp->if_softc; Modified: head/sys/netgraph/ng_device.c ============================================================================== --- head/sys/netgraph/ng_device.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/netgraph/ng_device.c Fri Feb 10 12:35:57 2012 (r231378) @@ -203,6 +203,7 @@ ng_device_rcvmsg(node_p node, item_p ite const priv_p priv = NG_NODE_PRIVATE(node); struct ng_mesg *msg; struct ng_mesg *resp = NULL; + const char *dn; int error = 0; NGI_GET_MSG(item, msg); @@ -217,8 +218,8 @@ ng_device_rcvmsg(node_p node, item_p ite if (resp == NULL) ERROUT(ENOMEM); - strlcpy((char *)resp->data, priv->ngddev->si_name, - strlen(priv->ngddev->si_name) + 1); + dn = devtoname(priv->ngddev); + strlcpy((char *)resp->data, dn, strlen(dn) + 1); break; default: Modified: head/sys/security/mac_biba/mac_biba.c ============================================================================== --- head/sys/security/mac_biba/mac_biba.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/security/mac_biba/mac_biba.c Fri Feb 10 12:35:57 2012 (r231378) @@ -948,18 +948,20 @@ biba_devfs_create_device(struct ucred *c struct cdev *dev, struct devfs_dirent *de, struct label *delabel) { struct mac_biba *mb; + const char *dn; int biba_type; mb = SLOT(delabel); - if (strcmp(dev->si_name, "null") == 0 || - strcmp(dev->si_name, "zero") == 0 || - strcmp(dev->si_name, "random") == 0 || - strncmp(dev->si_name, "fd/", strlen("fd/")) == 0) + dn = devtoname(dev); + if (strcmp(dn, "null") == 0 || + strcmp(dn, "zero") == 0 || + strcmp(dn, "random") == 0 || + strncmp(dn, "fd/", strlen("fd/")) == 0) biba_type = MAC_BIBA_TYPE_EQUAL; else if (ptys_equal && - (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || - strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || - strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) + (strncmp(dn, "ttyp", strlen("ttyp")) == 0 || + strncmp(dn, "pts/", strlen("pts/")) == 0 || + strncmp(dn, "ptyp", strlen("ptyp")) == 0)) biba_type = MAC_BIBA_TYPE_EQUAL; else biba_type = MAC_BIBA_TYPE_HIGH; Modified: head/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/security/mac_lomac/mac_lomac.c Fri Feb 10 12:35:57 2012 (r231378) @@ -1032,19 +1032,21 @@ lomac_devfs_create_device(struct ucred * struct cdev *dev, struct devfs_dirent *de, struct label *delabel) { struct mac_lomac *ml; + const char *dn; int lomac_type; ml = SLOT(delabel); - if (strcmp(dev->si_name, "null") == 0 || - strcmp(dev->si_name, "zero") == 0 || - strcmp(dev->si_name, "random") == 0 || - strncmp(dev->si_name, "fd/", strlen("fd/")) == 0 || - strncmp(dev->si_name, "ttyv", strlen("ttyv")) == 0) + dn = devtoname(dev); + if (strcmp(dn, "null") == 0 || + strcmp(dn, "zero") == 0 || + strcmp(dn, "random") == 0 || + strncmp(dn, "fd/", strlen("fd/")) == 0 || + strncmp(dn, "ttyv", strlen("ttyv")) == 0) lomac_type = MAC_LOMAC_TYPE_EQUAL; else if (ptys_equal && - (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || - strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || - strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) + (strncmp(dn, "ttyp", strlen("ttyp")) == 0 || + strncmp(dn, "pts/", strlen("pts/")) == 0 || + strncmp(dn, "ptyp", strlen("ptyp")) == 0)) lomac_type = MAC_LOMAC_TYPE_EQUAL; else lomac_type = MAC_LOMAC_TYPE_HIGH; Modified: head/sys/security/mac_mls/mac_mls.c ============================================================================== --- head/sys/security/mac_mls/mac_mls.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/security/mac_mls/mac_mls.c Fri Feb 10 12:35:57 2012 (r231378) @@ -908,21 +908,23 @@ mls_devfs_create_device(struct ucred *cr struct cdev *dev, struct devfs_dirent *de, struct label *delabel) { struct mac_mls *mm; + const char *dn; int mls_type; mm = SLOT(delabel); - if (strcmp(dev->si_name, "null") == 0 || - strcmp(dev->si_name, "zero") == 0 || - strcmp(dev->si_name, "random") == 0 || - strncmp(dev->si_name, "fd/", strlen("fd/")) == 0) + dn = devtoname(dev); + if (strcmp(dn, "null") == 0 || + strcmp(dn, "zero") == 0 || + strcmp(dn, "random") == 0 || + strncmp(dn, "fd/", strlen("fd/")) == 0) mls_type = MAC_MLS_TYPE_EQUAL; - else if (strcmp(dev->si_name, "kmem") == 0 || - strcmp(dev->si_name, "mem") == 0) + else if (strcmp(dn, "kmem") == 0 || + strcmp(dn, "mem") == 0) mls_type = MAC_MLS_TYPE_HIGH; else if (ptys_equal && - (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || - strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || - strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) + (strncmp(dn, "ttyp", strlen("ttyp")) == 0 || + strncmp(dn, "pts/", strlen("pts/")) == 0 || + strncmp(dn, "ptyp", strlen("ptyp")) == 0)) mls_type = MAC_MLS_TYPE_EQUAL; else mls_type = MAC_MLS_TYPE_LOW; Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/vm/swap_pager.c Fri Feb 10 12:35:57 2012 (r231378) @@ -2320,7 +2320,7 @@ swapoff_all(void) TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { mtx_unlock(&sw_dev_mtx); if (vn_isdisk(sp->sw_vp, NULL)) - devname = sp->sw_vp->v_rdev->si_name; + devname = devtoname(sp->sw_vp->v_rdev); else devname = "[file]"; error = swapoff_one(sp, thread0.td_ucred); @@ -2358,7 +2358,7 @@ int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len) { struct swdevt *sp; - char *tmp_devname; + const char *tmp_devname; int error, n; n = 0; @@ -2376,7 +2376,7 @@ swap_dev_info(int name, struct xswdev *x xs->xsw_used = sp->sw_used; if (devname != NULL) { if (vn_isdisk(sp->sw_vp, NULL)) - tmp_devname = sp->sw_vp->v_rdev->si_name; + tmp_devname = devtoname(sp->sw_vp->v_rdev); else tmp_devname = "[file]"; strncpy(devname, tmp_devname, len); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 12:40:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C5701065670; Fri, 10 Feb 2012 12:40:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C7778FC17; Fri, 10 Feb 2012 12:40:51 +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 q1ACeoxo073605; Fri, 10 Feb 2012 12:40:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ACeoKl073601; Fri, 10 Feb 2012 12:40:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101240.q1ACeoKl073601@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 12:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231379 - in head/sys: fs/devfs kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 12:40:51 -0000 Author: ed Date: Fri Feb 10 12:40:50 2012 New Revision: 231379 URL: http://svn.freebsd.org/changeset/base/231379 Log: Merge si_name and __si_namebuf. The si_name pointer always points to the __si_namebuf member inside the same object. Remove it and rename __si_namebuf to si_name. Modified: head/sys/fs/devfs/devfs_devs.c head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Fri Feb 10 12:35:57 2012 (r231378) +++ head/sys/fs/devfs/devfs_devs.c Fri Feb 10 12:40:50 2012 (r231379) @@ -133,7 +133,6 @@ devfs_alloc(int flags) cdev = &cdp->cdp_c; - cdev->si_name = cdev->__si_namebuf; LIST_INIT(&cdev->si_children); vfs_timestamp(&ts); cdev->si_atime = cdev->si_mtime = cdev->si_ctime = ts; Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Fri Feb 10 12:35:57 2012 (r231378) +++ head/sys/kern/kern_conf.c Fri Feb 10 12:40:50 2012 (r231379) @@ -690,16 +690,16 @@ prep_devname(struct cdev *dev, const cha mtx_assert(&devmtx, MA_OWNED); - len = vsnrprintf(dev->__si_namebuf, sizeof(dev->__si_namebuf), 32, + len = vsnrprintf(dev->si_name, sizeof(dev->si_name), 32, fmt, ap); - if (len > sizeof(dev->__si_namebuf) - 1) + if (len > sizeof(dev->si_name) - 1) return (ENAMETOOLONG); /* Strip leading slashes. */ - for (from = dev->__si_namebuf; *from == '/'; from++) + for (from = dev->si_name; *from == '/'; from++) ; - for (to = dev->__si_namebuf; *from != '\0'; from++, to++) { + for (to = dev->si_name; *from != '\0'; from++, to++) { /* Treat multiple sequential slashes as single. */ while (from[0] == '/' && from[1] == '/') from++; @@ -710,11 +710,11 @@ prep_devname(struct cdev *dev, const cha } *to = '\0'; - if (dev->__si_namebuf[0] == '\0') + if (dev->si_name[0] == '\0') return (EINVAL); /* Disallow "." and ".." components. */ - for (s = dev->__si_namebuf;;) { + for (s = dev->si_name;;) { for (q = s; *q != '/' && *q != '\0'; q++) ; if (q - s == 1 && s[0] == '.') @@ -726,7 +726,7 @@ prep_devname(struct cdev *dev, const cha s = q + 1; } - if (devfs_dev_exists(dev->__si_namebuf) != 0) + if (devfs_dev_exists(dev->si_name) != 0) return (EEXIST); return (0); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Fri Feb 10 12:35:57 2012 (r231378) +++ head/sys/sys/conf.h Fri Feb 10 12:40:50 2012 (r231379) @@ -78,7 +78,7 @@ struct cdev { LIST_HEAD(, cdev) si_children; LIST_ENTRY(cdev) si_siblings; struct cdev *si_parent; - char *si_name; + void *si_spare0; void *si_drv1, *si_drv2; struct cdevsw *si_devsw; int si_iosize_max; /* maximum I/O size (for physio &al) */ @@ -87,7 +87,7 @@ struct cdev { union { struct snapdata *__sid_snapdata; } __si_u; - char __si_namebuf[SPECNAMELEN + 1]; + char si_name[SPECNAMELEN + 1]; }; #define si_snapdata __si_u.__sid_snapdata From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 13:15:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE3FC106566B; Fri, 10 Feb 2012 13:15:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A56B18FC0A; Fri, 10 Feb 2012 13:15: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 q1ADFCCO074784; Fri, 10 Feb 2012 13:15:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADFBxS074767; Fri, 10 Feb 2012 13:15:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202101315.q1ADFBxS074767@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 13:15:11 +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: r231380 - in stable/8/sys: dev/iicbus dev/lmc dev/ppbus dev/usb/net net netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:15:12 -0000 Author: bz Date: Fri Feb 10 13:15:11 2012 New Revision: 231380 URL: http://svn.freebsd.org/changeset/base/231380 Log: MFC r223741: Tag mbufs of all incoming frames or packets with the interface's FIB setting (either default or if supported as set by SIOCSIFFIB, e.g. from ifconfig). Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) Reviewed by: julian Modified: stable/8/sys/dev/iicbus/if_ic.c stable/8/sys/dev/lmc/if_lmc.c stable/8/sys/dev/ppbus/if_plip.c stable/8/sys/dev/usb/net/uhso.c stable/8/sys/net/if_arcsubr.c stable/8/sys/net/if_atmsubr.c stable/8/sys/net/if_ethersubr.c stable/8/sys/net/if_fddisubr.c stable/8/sys/net/if_fwsubr.c stable/8/sys/net/if_gif.c stable/8/sys/net/if_iso88025subr.c stable/8/sys/net/if_spppfr.c stable/8/sys/net/if_spppsubr.c stable/8/sys/net/if_stf.c stable/8/sys/net/if_tun.c stable/8/sys/netgraph/ng_iface.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/iicbus/if_ic.c ============================================================================== --- stable/8/sys/dev/iicbus/if_ic.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/dev/iicbus/if_ic.c Fri Feb 10 13:15:11 2012 (r231380) @@ -311,6 +311,7 @@ icintr(device_t dev, int event, char *pt top = m_devget(sc->ic_ifbuf + ICHDRLEN, len, 0, sc->ic_ifp, 0); if (top) { mtx_unlock(&sc->ic_lock); + M_SETFIB(top, sc->ic_ifp->if_fib); netisr_dispatch(NETISR_IP, top); mtx_lock(&sc->ic_lock); } Modified: stable/8/sys/dev/lmc/if_lmc.c ============================================================================== --- stable/8/sys/dev/lmc/if_lmc.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/dev/lmc/if_lmc.c Fri Feb 10 13:15:11 2012 (r231380) @@ -2527,6 +2527,7 @@ lmc_raw_input(struct ifnet *ifp, struct { softc_t *sc = IFP2SC(ifp); + M_SETFIB(mbuf, ifp->if_fib); # if INET if (mbuf->m_data[0]>>4 == 4) netisr_dispatch(NETISR_IP, mbuf); Modified: stable/8/sys/dev/ppbus/if_plip.c ============================================================================== --- stable/8/sys/dev/ppbus/if_plip.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/dev/ppbus/if_plip.c Fri Feb 10 13:15:11 2012 (r231380) @@ -585,6 +585,8 @@ lp_intr(void *arg) if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); + M_SETFIB(top, sc->sc_ifp->if_fib); + /* mbuf is free'd on failure. */ netisr_queue(NETISR_IP, top); ppb_lock(ppbus); @@ -637,6 +639,8 @@ lp_intr(void *arg) if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); + M_SETFIB(top, sc->sc_ifp->if_fib); + /* mbuf is free'd on failure. */ netisr_queue(NETISR_IP, top); ppb_lock(ppbus); Modified: stable/8/sys/dev/usb/net/uhso.c ============================================================================== --- stable/8/sys/dev/usb/net/uhso.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/dev/usb/net/uhso.c Fri Feb 10 13:15:11 2012 (r231380) @@ -1756,6 +1756,7 @@ uhso_if_rxflush(void *arg) /* Dispatch to IP layer */ BPF_MTAP(sc->sc_ifp, m); + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); m = m0 != NULL ? m0 : NULL; mtx_lock(&sc->sc_mtx); Modified: stable/8/sys/net/if_arcsubr.c ============================================================================== --- stable/8/sys/net/if_arcsubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_arcsubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -608,6 +608,7 @@ arc_input(struct ifnet *ifp, struct mbuf m_freem(m); return; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/8/sys/net/if_atmsubr.c ============================================================================== --- stable/8/sys/net/if_atmsubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_atmsubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -332,6 +332,7 @@ atm_input(struct ifnet *ifp, struct atm_ return; } } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/8/sys/net/if_ethersubr.c ============================================================================== --- stable/8/sys/net/if_ethersubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_ethersubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -692,6 +692,8 @@ ether_input(struct ifnet *ifp, struct mb m_adj(m, ETHER_VLAN_ENCAP_LEN); } + M_SETFIB(m, ifp->if_fib); + /* Allow ng_ether(4) to claim this frame. */ if (IFP2AC(ifp)->ac_netgraph != NULL) { KASSERT(ng_ether_input_p != NULL, Modified: stable/8/sys/net/if_fddisubr.c ============================================================================== --- stable/8/sys/net/if_fddisubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_fddisubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -550,6 +550,7 @@ fddi_input(ifp, m) ifp->if_noproto++; goto dropanyway; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return; Modified: stable/8/sys/net/if_fwsubr.c ============================================================================== --- stable/8/sys/net/if_fwsubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_fwsubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -627,6 +627,7 @@ firewire_input(struct ifnet *ifp, struct return; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/8/sys/net/if_gif.c ============================================================================== --- stable/8/sys/net/if_gif.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_gif.c Fri Feb 10 13:15:11 2012 (r231380) @@ -609,6 +609,7 @@ gif_input(m, af, ifp) ifp->if_ipackets++; ifp->if_ibytes += m->m_pkthdr.len; + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/8/sys/net/if_iso88025subr.c ============================================================================== --- stable/8/sys/net/if_iso88025subr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_iso88025subr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -680,6 +680,7 @@ iso88025_input(ifp, m) break; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return; Modified: stable/8/sys/net/if_spppfr.c ============================================================================== --- stable/8/sys/net/if_spppfr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_spppfr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -280,6 +280,8 @@ drop: ++ifp->if_ierrors; if (! (ifp->if_flags & IFF_UP)) goto drop; + M_SETFIB(m, ifp->if_fib); + /* Check queue. */ if (netisr_queue(isr, m)) { /* (0) on success. */ if (debug) Modified: stable/8/sys/net/if_spppsubr.c ============================================================================== --- stable/8/sys/net/if_spppsubr.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_spppsubr.c Fri Feb 10 13:15:11 2012 (r231380) @@ -737,6 +737,7 @@ sppp_input(struct ifnet *ifp, struct mbu goto drop; SPPP_UNLOCK(sp); + M_SETFIB(m, ifp->if_fib); /* Check queue. */ if (netisr_queue(isr, m)) { /* (0) on success. */ if (debug) Modified: stable/8/sys/net/if_stf.c ============================================================================== --- stable/8/sys/net/if_stf.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_stf.c Fri Feb 10 13:15:11 2012 (r231380) @@ -781,6 +781,7 @@ in_stf_input(m, off) */ ifp->if_ipackets++; ifp->if_ibytes += m->m_pkthdr.len; + M_SETFIB(m, ifp->if_fib); netisr_dispatch(NETISR_IPV6, m); } Modified: stable/8/sys/net/if_tun.c ============================================================================== --- stable/8/sys/net/if_tun.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/net/if_tun.c Fri Feb 10 13:15:11 2012 (r231380) @@ -930,6 +930,7 @@ tunwrite(struct cdev *dev, struct uio *u ifp->if_ibytes += m->m_pkthdr.len; ifp->if_ipackets++; CURVNET_SET(ifp->if_vnet); + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); CURVNET_RESTORE(); return (0); Modified: stable/8/sys/netgraph/ng_iface.c ============================================================================== --- stable/8/sys/netgraph/ng_iface.c Fri Feb 10 12:40:50 2012 (r231379) +++ stable/8/sys/netgraph/ng_iface.c Fri Feb 10 13:15:11 2012 (r231380) @@ -781,6 +781,7 @@ ng_iface_rcvdata(hook_p hook, item_p ite /* First chunk of an mbuf contains good junk */ if (harvest.point_to_point) random_harvest(m, 16, 3, 0, RANDOM_NET); + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 13:35:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43DD7106564A; Fri, 10 Feb 2012 13:35:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8888FC14; Fri, 10 Feb 2012 13:35:50 +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 q1ADZoHI076176; Fri, 10 Feb 2012 13:35:50 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADZnri076174; Fri, 10 Feb 2012 13:35:49 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202101335.q1ADZnri076174@svn.freebsd.org> From: Martin Matuska Date: Fri, 10 Feb 2012 13:35:49 +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: r231381 - stable/9/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:35:50 -0000 Author: mm Date: Fri Feb 10 13:35:49 2012 New Revision: 231381 URL: http://svn.freebsd.org/changeset/base/231381 Log: MFC r231144: Merge illumos revision 13594: uninitialized variables in zfs(8) may make snapshots undestroyable [1] References: https://www.illumos.org/issues/2067 [1] Obtained from: illumos (issue #2067) PR: bin/164802 Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Feb 10 13:15:11 2012 (r231380) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Feb 10 13:35:49 2012 (r231381) @@ -590,7 +590,7 @@ zfs_do_clone(int argc, char **argv) zfs_handle_t *zhp = NULL; boolean_t parents = B_FALSE; nvlist_t *props; - int ret; + int ret = 0; int c; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) @@ -1052,7 +1052,7 @@ destroy_print_cb(zfs_handle_t *zhp, void static int destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb) { - int err; + int err = 0; assert(cb->cb_firstsnap == NULL); assert(cb->cb_prevsnap == NULL); err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb); @@ -1130,7 +1130,7 @@ destroy_clones(destroy_cbdata_t *cb) ZFS_TYPE_SNAPSHOT); if (zhp != NULL) { boolean_t defer = cb->cb_defer_destroy; - int err; + int err = 0; /* * We can't defer destroy non-snapshots, so set it to @@ -1207,7 +1207,7 @@ zfs_do_destroy(int argc, char **argv) at = strchr(argv[0], '@'); if (at != NULL) { - int err; + int err = 0; /* Build the list of snaps to destroy in cb_nvl. */ if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) @@ -1474,7 +1474,7 @@ zfs_do_get(int argc, char **argv) zprop_get_cbdata_t cb = { 0 }; int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; char *value, *fields; - int ret; + int ret = 0; int limit = 0; zprop_list_t fake_name = { 0 }; @@ -1711,7 +1711,7 @@ zfs_do_inherit(int argc, char **argv) zfs_prop_t prop; inherit_cbdata_t cb = { 0 }; char *propname; - int ret; + int ret = 0; int flags = 0; boolean_t received = B_FALSE; @@ -1917,7 +1917,7 @@ zfs_do_upgrade(int argc, char **argv) { boolean_t all = B_FALSE; boolean_t showversions = B_FALSE; - int ret; + int ret = 0; upgrade_cbdata_t cb = { 0 }; char c; int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -2206,7 +2206,7 @@ userspace_cb(void *arg, const char *doma uid_t id; uint64_t classes; #ifdef sun - int err; + int err = 0; directory_error_t e; #endif @@ -2562,7 +2562,7 @@ zfs_do_userspace(int argc, char **argv) boolean_t prtnum = B_FALSE; boolean_t parseable = B_FALSE; boolean_t sid2posix = B_FALSE; - int error; + int error = 0; int c; zfs_sort_column_t *default_sortcol = NULL; zfs_sort_column_t *sortcol = NULL; @@ -2920,7 +2920,7 @@ zfs_do_list(int argc, char **argv) list_cbdata_t cb = { 0 }; char *value; int limit = 0; - int ret; + int ret = 0; zfs_sort_column_t *sortcol = NULL; int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -3050,7 +3050,9 @@ zfs_do_rename(int argc, char **argv) { zfs_handle_t *zhp; renameflags_t flags = { 0 }; - int c, ret, types; + int c; + int ret = 0; + int types; boolean_t parents = B_FALSE; /* check options */ @@ -3143,7 +3145,7 @@ static int zfs_do_promote(int argc, char **argv) { zfs_handle_t *zhp; - int ret; + int ret = 0; /* check options */ if (argc > 1 && argv[1][0] == '-') { @@ -3264,7 +3266,7 @@ rollback_check(zfs_handle_t *zhp, void * static int zfs_do_rollback(int argc, char **argv) { - int ret; + int ret = 0; int c; boolean_t force = B_FALSE; rollback_cbdata_t cb = { 0 }; @@ -3382,7 +3384,7 @@ static int zfs_do_set(int argc, char **argv) { set_cbdata_t cb; - int ret; + int ret = 0; /* check for options */ if (argc > 1 && argv[1][0] == '-') { @@ -3436,7 +3438,7 @@ static int zfs_do_snapshot(int argc, char **argv) { boolean_t recursive = B_FALSE; - int ret; + int ret = 0; char c; nvlist_t *props; @@ -5274,7 +5276,7 @@ zfs_do_holds(int argc, char **argv) holds_cbdata_t cb = { 0 }; int limit = 0; - int ret; + int ret = 0; int flags = 0; /* check options */ @@ -5851,7 +5853,7 @@ static int unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual) { zfs_handle_t *zhp; - int ret; + int ret = 0; struct stat64 statbuf; struct extmnttab entry; const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount"; @@ -6319,7 +6321,7 @@ manual_mount(int argc, char **argv) zfs_handle_t *zhp; char mountpoint[ZFS_MAXPROPLEN]; char mntopts[MNT_LINE_MAX] = { '\0' }; - int ret; + int ret = 0; int c; int flags = 0; char *dataset, *path; @@ -6469,7 +6471,7 @@ zfs_do_diff(int argc, char **argv) char *tosnap = NULL; char *fromsnap = NULL; char *atp, *copy; - int err; + int err = 0; int c; while ((c = getopt(argc, argv, "FHt")) != -1) { @@ -6539,7 +6541,7 @@ zfs_do_diff(int argc, char **argv) int main(int argc, char **argv) { - int ret; + int ret = 0; int i; char *progname; char *cmdname; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 13:36:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3465C1065672; Fri, 10 Feb 2012 13:36:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB778FC13; Fri, 10 Feb 2012 13:36: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 q1ADad9D076270; Fri, 10 Feb 2012 13:36:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADadDT076268; Fri, 10 Feb 2012 13:36:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202101336.q1ADadDT076268@svn.freebsd.org> From: Martin Matuska Date: Fri, 10 Feb 2012 13:36:39 +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: r231382 - stable/8/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:36:40 -0000 Author: mm Date: Fri Feb 10 13:36:39 2012 New Revision: 231382 URL: http://svn.freebsd.org/changeset/base/231382 Log: MFC r231144: Merge illumos revision 13594: uninitialized variables in zfs(8) may make snapshots undestroyable [1] References: https://www.illumos.org/issues/2067 [1] Obtained from: illumos (issue #2067) PR: bin/164802 Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Feb 10 13:35:49 2012 (r231381) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Feb 10 13:36:39 2012 (r231382) @@ -590,7 +590,7 @@ zfs_do_clone(int argc, char **argv) zfs_handle_t *zhp = NULL; boolean_t parents = B_FALSE; nvlist_t *props; - int ret; + int ret = 0; int c; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) @@ -1052,7 +1052,7 @@ destroy_print_cb(zfs_handle_t *zhp, void static int destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb) { - int err; + int err = 0; assert(cb->cb_firstsnap == NULL); assert(cb->cb_prevsnap == NULL); err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb); @@ -1130,7 +1130,7 @@ destroy_clones(destroy_cbdata_t *cb) ZFS_TYPE_SNAPSHOT); if (zhp != NULL) { boolean_t defer = cb->cb_defer_destroy; - int err; + int err = 0; /* * We can't defer destroy non-snapshots, so set it to @@ -1207,7 +1207,7 @@ zfs_do_destroy(int argc, char **argv) at = strchr(argv[0], '@'); if (at != NULL) { - int err; + int err = 0; /* Build the list of snaps to destroy in cb_nvl. */ if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) @@ -1474,7 +1474,7 @@ zfs_do_get(int argc, char **argv) zprop_get_cbdata_t cb = { 0 }; int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; char *value, *fields; - int ret; + int ret = 0; int limit = 0; zprop_list_t fake_name = { 0 }; @@ -1711,7 +1711,7 @@ zfs_do_inherit(int argc, char **argv) zfs_prop_t prop; inherit_cbdata_t cb = { 0 }; char *propname; - int ret; + int ret = 0; int flags = 0; boolean_t received = B_FALSE; @@ -1917,7 +1917,7 @@ zfs_do_upgrade(int argc, char **argv) { boolean_t all = B_FALSE; boolean_t showversions = B_FALSE; - int ret; + int ret = 0; upgrade_cbdata_t cb = { 0 }; char c; int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -2206,7 +2206,7 @@ userspace_cb(void *arg, const char *doma uid_t id; uint64_t classes; #ifdef sun - int err; + int err = 0; directory_error_t e; #endif @@ -2562,7 +2562,7 @@ zfs_do_userspace(int argc, char **argv) boolean_t prtnum = B_FALSE; boolean_t parseable = B_FALSE; boolean_t sid2posix = B_FALSE; - int error; + int error = 0; int c; zfs_sort_column_t *default_sortcol = NULL; zfs_sort_column_t *sortcol = NULL; @@ -2920,7 +2920,7 @@ zfs_do_list(int argc, char **argv) list_cbdata_t cb = { 0 }; char *value; int limit = 0; - int ret; + int ret = 0; zfs_sort_column_t *sortcol = NULL; int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -3050,7 +3050,9 @@ zfs_do_rename(int argc, char **argv) { zfs_handle_t *zhp; renameflags_t flags = { 0 }; - int c, ret, types; + int c; + int ret = 0; + int types; boolean_t parents = B_FALSE; /* check options */ @@ -3143,7 +3145,7 @@ static int zfs_do_promote(int argc, char **argv) { zfs_handle_t *zhp; - int ret; + int ret = 0; /* check options */ if (argc > 1 && argv[1][0] == '-') { @@ -3264,7 +3266,7 @@ rollback_check(zfs_handle_t *zhp, void * static int zfs_do_rollback(int argc, char **argv) { - int ret; + int ret = 0; int c; boolean_t force = B_FALSE; rollback_cbdata_t cb = { 0 }; @@ -3382,7 +3384,7 @@ static int zfs_do_set(int argc, char **argv) { set_cbdata_t cb; - int ret; + int ret = 0; /* check for options */ if (argc > 1 && argv[1][0] == '-') { @@ -3436,7 +3438,7 @@ static int zfs_do_snapshot(int argc, char **argv) { boolean_t recursive = B_FALSE; - int ret; + int ret = 0; char c; nvlist_t *props; @@ -5274,7 +5276,7 @@ zfs_do_holds(int argc, char **argv) holds_cbdata_t cb = { 0 }; int limit = 0; - int ret; + int ret = 0; int flags = 0; /* check options */ @@ -5851,7 +5853,7 @@ static int unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual) { zfs_handle_t *zhp; - int ret; + int ret = 0; struct stat64 statbuf; struct extmnttab entry; const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount"; @@ -6319,7 +6321,7 @@ manual_mount(int argc, char **argv) zfs_handle_t *zhp; char mountpoint[ZFS_MAXPROPLEN]; char mntopts[MNT_LINE_MAX] = { '\0' }; - int ret; + int ret = 0; int c; int flags = 0; char *dataset, *path; @@ -6469,7 +6471,7 @@ zfs_do_diff(int argc, char **argv) char *tosnap = NULL; char *fromsnap = NULL; char *atp, *copy; - int err; + int err = 0; int c; while ((c = getopt(argc, argv, "FHt")) != -1) { @@ -6539,7 +6541,7 @@ zfs_do_diff(int argc, char **argv) int main(int argc, char **argv) { - int ret; + int ret = 0; int i; char *progname; char *cmdname; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 13:40:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3ED31065670; Fri, 10 Feb 2012 13:40:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EDDC8FC0C; Fri, 10 Feb 2012 13:40: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 q1ADeWH7076599; Fri, 10 Feb 2012 13:40:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADeWDj076596; Fri, 10 Feb 2012 13:40:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101340.q1ADeWDj076596@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 13:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:40:32 -0000 Author: ed Date: Fri Feb 10 13:40:32 2012 New Revision: 231383 URL: http://svn.freebsd.org/changeset/base/231383 Log: Detect file modification properly by using tv_nsec. POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond precision to detect file modification. MFC after: 2 weeks Modified: head/lib/libutil/pw_util.c head/usr.sbin/vipw/vipw.8 Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Fri Feb 10 13:36:39 2012 (r231382) +++ head/lib/libutil/pw_util.c Fri Feb 10 13:40:32 2012 (r231383) @@ -347,7 +347,8 @@ pw_edit(int notsetuid) sigprocmask(SIG_SETMASK, &oldsigset, NULL); if (stat(tempname, &st2) == -1) return (-1); - return (st1.st_mtime != st2.st_mtime); + return (st1.st_mtim.tv_sec != st2.st_mtim.tv_sec || + st1.st_mtim.tv_nsec != st2.st_mtim.tv_nsec); } /* Modified: head/usr.sbin/vipw/vipw.8 ============================================================================== --- head/usr.sbin/vipw/vipw.8 Fri Feb 10 13:36:39 2012 (r231382) +++ head/usr.sbin/vipw/vipw.8 Fri Feb 10 13:40:32 2012 (r231383) @@ -28,7 +28,7 @@ .\" @(#)vipw.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd February 10, 2011 .Dt VIPW 8 .Os .Sh NAME @@ -110,10 +110,3 @@ The .Nm utility appeared in .Bx 4.0 . -.Sh BUGS -The mechanism for checking for password file modifications requires that -.Ev EDITOR -run for at least one second. -Non-interactive editor scripts should invoke -.Xr sleep 1 -or equivalent to ensure this happens. From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 13:47:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 941FE1065670; Fri, 10 Feb 2012 13:47:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4ED8FC12; Fri, 10 Feb 2012 13:47:41 +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 q1ADlfld077213; Fri, 10 Feb 2012 13:47:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADlfi9077211; Fri, 10 Feb 2012 13:47:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101347.q1ADlfi9077211@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 13:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231384 - head/lib/libprocstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:47:41 -0000 Author: ed Date: Fri Feb 10 13:47:40 2012 New Revision: 231384 URL: http://svn.freebsd.org/changeset/base/231384 Log: Unbreak build. libprocstat still uses __si_namebuf. Modified: head/lib/libprocstat/common_kvm.c Modified: head/lib/libprocstat/common_kvm.c ============================================================================== --- head/lib/libprocstat/common_kvm.c Fri Feb 10 13:40:32 2012 (r231383) +++ head/lib/libprocstat/common_kvm.c Fri Feb 10 13:47:40 2012 (r231384) @@ -80,7 +80,7 @@ kdevtoname(kvm_t *kd, struct cdev *dev, assert(buf); if (!kvm_read_all(kd, (unsigned long)dev, &si, sizeof(si))) return (1); - strlcpy(buf, si.__si_namebuf, SPECNAMELEN + 1); + strlcpy(buf, si.si_name, SPECNAMELEN + 1); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 13:51:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12421106564A; Fri, 10 Feb 2012 13:51:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7D208FC0A; Fri, 10 Feb 2012 13:51: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 q1ADp2R6077508; Fri, 10 Feb 2012 13:51:02 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADp26B077506; Fri, 10 Feb 2012 13:51:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101351.q1ADp26B077506@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 13:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231385 - head/usr.sbin/vipw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:51:03 -0000 Author: ed Date: Fri Feb 10 13:51:02 2012 New Revision: 231385 URL: http://svn.freebsd.org/changeset/base/231385 Log: Correct date. It seems to be 2012. Modified: head/usr.sbin/vipw/vipw.8 Modified: head/usr.sbin/vipw/vipw.8 ============================================================================== --- head/usr.sbin/vipw/vipw.8 Fri Feb 10 13:47:40 2012 (r231384) +++ head/usr.sbin/vipw/vipw.8 Fri Feb 10 13:51:02 2012 (r231385) @@ -28,7 +28,7 @@ .\" @(#)vipw.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 10, 2011 +.Dd February 10, 2012 .Dt VIPW 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 14:55:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4051106564A; Fri, 10 Feb 2012 14:55:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB8318FC16; Fri, 10 Feb 2012 14:55:47 +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 q1AEtlgE080239; Fri, 10 Feb 2012 14:55:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AEtlbX080237; Fri, 10 Feb 2012 14:55:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101455.q1AEtlbX080237@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 14:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231386 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 14:55:48 -0000 Author: ed Date: Fri Feb 10 14:55:47 2012 New Revision: 231386 URL: http://svn.freebsd.org/changeset/base/231386 Log: Remove unneeded newline. It fits in 80 columns now. Pointed out by: jh Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Fri Feb 10 13:51:02 2012 (r231385) +++ head/sys/kern/kern_conf.c Fri Feb 10 14:55:47 2012 (r231386) @@ -690,8 +690,7 @@ prep_devname(struct cdev *dev, const cha mtx_assert(&devmtx, MA_OWNED); - len = vsnrprintf(dev->si_name, sizeof(dev->si_name), 32, - fmt, ap); + len = vsnrprintf(dev->si_name, sizeof(dev->si_name), 32, fmt, ap); if (len > sizeof(dev->si_name) - 1) return (ENAMETOOLONG); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 15:34:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB0AF106567D; Fri, 10 Feb 2012 15:34:36 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA78C8FC18; Fri, 10 Feb 2012 15:34:36 +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 q1AFYaiq081459; Fri, 10 Feb 2012 15:34:36 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AFYaP5081457; Fri, 10 Feb 2012 15:34:36 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201202101534.q1AFYaP5081457@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 10 Feb 2012 15:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231387 - head/sys/boot/pc98/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 15:34:37 -0000 Author: nyan Date: Fri Feb 10 15:34:36 2012 New Revision: 231387 URL: http://svn.freebsd.org/changeset/base/231387 Log: Reduce diffs against i386. MFC after: 1 week Modified: head/sys/boot/pc98/loader/Makefile Modified: head/sys/boot/pc98/loader/Makefile ============================================================================== --- head/sys/boot/pc98/loader/Makefile Fri Feb 10 14:55:47 2012 (r231386) +++ head/sys/boot/pc98/loader/Makefile Fri Feb 10 15:34:36 2012 (r231387) @@ -3,7 +3,8 @@ .include MK_SSP= no -PROG= loader.sym +LOADER?= loader +PROG= ${LOADER}.sym INTERNALPROG= NEWVERSWHAT= "bootstrap loader" pc98 @@ -39,14 +40,14 @@ CFLAGS+= -DLOADER_BZIP2_SUPPORT CFLAGS+= -DLOADER_GZIP_SUPPORT .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../i386 CFLAGS+= -I. -CLEANFILES= vers.c loader loader.bin loader.help +CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -68,36 +69,37 @@ CFLAGS+= -I${.CURDIR}/../btx/lib vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT} -loader: loader.bin ${BTXLDR} ${BTXKERN} +${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ - -b ${BTXKERN} loader.bin + -b ${BTXKERN} ${LOADER}.bin -loader.bin: loader.sym +${LOADER}.bin: ${LOADER}.sym cp ${.ALLSRC} ${.TARGET} strip -R .comment -R .note ${.TARGET} loader.help: help.common help.pc98 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} -.PATH: ${.CURDIR}/../../forth -FILES= loader loader.help loader.4th support.4th loader.conf +FILES= ${LOADER} +# XXX INSTALLFLAGS_loader= -b +FILESMODE_${LOADER}= ${BINMODE} -b + +.PATH: ${.CURDIR}/../../forth +FILES+= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th beastie.4th FILES+= brand.4th check-password.4th color.4th delay.4th FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th -# XXX INSTALLFLAGS_loader= -b -FILESMODE_loader= ${BINMODE} -b FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) FILES+= ${.CURDIR}/../../i386/loader/loader.rc .endif - .if !exists(${DESTDIR}/boot/menu.rc) FILES+= menu.rc .endif # XXX crt0.o needs to be first for pxeboot(8) to work -OBJS= ${BTXCRT} +OBJS= ${BTXCRT} DPADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND} From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 15:54:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 452BD1065672; Fri, 10 Feb 2012 15:54:18 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F19A8FC08; Fri, 10 Feb 2012 15:54: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 q1AFsILR082088; Fri, 10 Feb 2012 15:54:18 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AFsHfh082086; Fri, 10 Feb 2012 15:54:17 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201202101554.q1AFsHfh082086@svn.freebsd.org> From: Brooks Davis Date: Fri, 10 Feb 2012 15:54:17 +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: r231388 - stable/9/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 15:54:18 -0000 Author: brooks Date: Fri Feb 10 15:54:17 2012 New Revision: 231388 URL: http://svn.freebsd.org/changeset/base/231388 Log: MFC r230403. When creating the jails /dev/log symlink, do it by full path to avoid creating stray "log" symlinks if the mount fails. That apparently happens in some ezjail configs. PR: conf/143084 Submitted by: Dirk Engling Modified: stable/9/etc/rc.d/jail Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/jail ============================================================================== --- stable/9/etc/rc.d/jail Fri Feb 10 15:34:36 2012 (r231387) +++ stable/9/etc/rc.d/jail Fri Feb 10 15:54:17 2012 (r231388) @@ -601,10 +601,7 @@ jail_start() devfs_mount_jail "${_devdir}" ${_ruleset} # Transitional symlink for old binaries if [ ! -L "${_devdir}/log" ]; then - __pwd="`pwd`" - cd "${_devdir}" - ln -sf ../var/run/log log - cd "$__pwd" + ln -sf ../var/run/log "${_devdir}/log" fi fi From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 15:54:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC7F106566B; Fri, 10 Feb 2012 15:54:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1595F8FC1B; Fri, 10 Feb 2012 15:54: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 q1AFsdg0082140; Fri, 10 Feb 2012 15:54:39 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AFsdgK082138; Fri, 10 Feb 2012 15:54:39 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201202101554.q1AFsdgK082138@svn.freebsd.org> From: Brooks Davis Date: Fri, 10 Feb 2012 15:54:39 +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: r231389 - stable/8/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 15:54:40 -0000 Author: brooks Date: Fri Feb 10 15:54:39 2012 New Revision: 231389 URL: http://svn.freebsd.org/changeset/base/231389 Log: MFC r230403. When creating the jails /dev/log symlink, do it by full path to avoid creating stray "log" symlinks if the mount fails. That apparently happens in some ezjail configs. PR: conf/143084 Submitted by: Dirk Engling Modified: stable/8/etc/rc.d/jail Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/jail ============================================================================== --- stable/8/etc/rc.d/jail Fri Feb 10 15:54:17 2012 (r231388) +++ stable/8/etc/rc.d/jail Fri Feb 10 15:54:39 2012 (r231389) @@ -592,10 +592,7 @@ jail_start() devfs_mount_jail "${_devdir}" ${_ruleset} # Transitional symlink for old binaries if [ ! -L "${_devdir}/log" ]; then - __pwd="`pwd`" - cd "${_devdir}" - ln -sf ../var/run/log log - cd "$__pwd" + ln -sf ../var/run/log "${_devdir}/log" fi fi From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 16:05:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D41871065680; Fri, 10 Feb 2012 16:05:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC76A8FC12; Fri, 10 Feb 2012 16:05:34 +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 q1AG5YnT082595; Fri, 10 Feb 2012 16:05:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AG5YPw082579; Fri, 10 Feb 2012 16:05:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202101605.q1AG5YPw082579@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Feb 2012 16:05:34 +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: r231390 - in stable/7/sys: dev/iicbus dev/lmc dev/ppbus net netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 16:05:35 -0000 Author: bz Date: Fri Feb 10 16:05:33 2012 New Revision: 231390 URL: http://svn.freebsd.org/changeset/base/231390 Log: MFC r223741: Tag mbufs of all incoming frames or packets with the interface's FIB setting (either default or if supported as set by SIOCSIFFIB, e.g. from ifconfig). Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) Reviewed by: julian Modified: stable/7/sys/dev/iicbus/if_ic.c stable/7/sys/dev/lmc/if_lmc.c stable/7/sys/dev/ppbus/if_plip.c stable/7/sys/net/if_arcsubr.c stable/7/sys/net/if_atmsubr.c stable/7/sys/net/if_ethersubr.c stable/7/sys/net/if_fddisubr.c stable/7/sys/net/if_fwsubr.c stable/7/sys/net/if_gif.c stable/7/sys/net/if_iso88025subr.c stable/7/sys/net/if_spppfr.c stable/7/sys/net/if_spppsubr.c stable/7/sys/net/if_stf.c stable/7/sys/net/if_tun.c stable/7/sys/netgraph/ng_iface.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/iicbus/if_ic.c ============================================================================== --- stable/7/sys/dev/iicbus/if_ic.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/dev/iicbus/if_ic.c Fri Feb 10 16:05:33 2012 (r231390) @@ -300,6 +300,7 @@ icintr(device_t dev, int event, char *pt BPF_TAP(sc->ic_ifp, sc->ic_ifbuf, len + ICHDRLEN); top = m_devget(sc->ic_ifbuf + ICHDRLEN, len, 0, sc->ic_ifp, 0); if (top) + M_SETFIB(top, sc->ic_ifp->if_fib); netisr_dispatch(NETISR_IP, top); break; err: Modified: stable/7/sys/dev/lmc/if_lmc.c ============================================================================== --- stable/7/sys/dev/lmc/if_lmc.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/dev/lmc/if_lmc.c Fri Feb 10 16:05:33 2012 (r231390) @@ -2526,6 +2526,7 @@ lmc_raw_input(struct ifnet *ifp, struct { softc_t *sc = IFP2SC(ifp); + M_SETFIB(mbuf, ifp->if_fib); # if INET if (mbuf->m_data[0]>>4 == 4) netisr_dispatch(NETISR_IP, mbuf); Modified: stable/7/sys/dev/ppbus/if_plip.c ============================================================================== --- stable/7/sys/dev/ppbus/if_plip.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/dev/ppbus/if_plip.c Fri Feb 10 16:05:33 2012 (r231390) @@ -516,6 +516,9 @@ lp_intr (void *arg) if (top) { if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); + + M_SETFIB(top, sc->sc_ifp->if_fib); + netisr_queue(NETISR_IP, top); /* mbuf is free'd on failure. */ } goto done; @@ -561,6 +564,9 @@ lp_intr (void *arg) if (top) { if (bpf_peers_present(sc->sc_ifp->if_bpf)) lptap(sc->sc_ifp, top); + + M_SETFIB(top, sc->sc_ifp->if_fib); + netisr_queue(NETISR_IP, top); /* mbuf is free'd on failure. */ } } Modified: stable/7/sys/net/if_arcsubr.c ============================================================================== --- stable/7/sys/net/if_arcsubr.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_arcsubr.c Fri Feb 10 16:05:33 2012 (r231390) @@ -603,6 +603,7 @@ arc_input(struct ifnet *ifp, struct mbuf m_freem(m); return; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/7/sys/net/if_atmsubr.c ============================================================================== --- stable/7/sys/net/if_atmsubr.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_atmsubr.c Fri Feb 10 16:05:33 2012 (r231390) @@ -344,6 +344,7 @@ atm_input(struct ifnet *ifp, struct atm_ return; } } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/7/sys/net/if_ethersubr.c ============================================================================== --- stable/7/sys/net/if_ethersubr.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_ethersubr.c Fri Feb 10 16:05:33 2012 (r231390) @@ -635,6 +635,8 @@ ether_input(struct ifnet *ifp, struct mb m_adj(m, ETHER_VLAN_ENCAP_LEN); } + M_SETFIB(m, ifp->if_fib); + /* Allow ng_ether(4) to claim this frame. */ if (IFP2AC(ifp)->ac_netgraph != NULL) { KASSERT(ng_ether_input_p != NULL, Modified: stable/7/sys/net/if_fddisubr.c ============================================================================== --- stable/7/sys/net/if_fddisubr.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_fddisubr.c Fri Feb 10 16:05:33 2012 (r231390) @@ -543,6 +543,7 @@ fddi_input(ifp, m) ifp->if_noproto++; goto dropanyway; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return; Modified: stable/7/sys/net/if_fwsubr.c ============================================================================== --- stable/7/sys/net/if_fwsubr.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_fwsubr.c Fri Feb 10 16:05:33 2012 (r231390) @@ -632,6 +632,7 @@ firewire_input(struct ifnet *ifp, struct return; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/7/sys/net/if_gif.c ============================================================================== --- stable/7/sys/net/if_gif.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_gif.c Fri Feb 10 16:05:33 2012 (r231390) @@ -603,6 +603,7 @@ gif_input(m, af, ifp) ifp->if_ipackets++; ifp->if_ibytes += m->m_pkthdr.len; + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); } Modified: stable/7/sys/net/if_iso88025subr.c ============================================================================== --- stable/7/sys/net/if_iso88025subr.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_iso88025subr.c Fri Feb 10 16:05:33 2012 (r231390) @@ -680,6 +680,7 @@ iso88025_input(ifp, m) break; } + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return; Modified: stable/7/sys/net/if_spppfr.c ============================================================================== --- stable/7/sys/net/if_spppfr.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_spppfr.c Fri Feb 10 16:05:33 2012 (r231390) @@ -280,6 +280,8 @@ drop: ++ifp->if_ierrors; if (! (ifp->if_flags & IFF_UP)) goto drop; + M_SETFIB(m, ifp->if_fib); + /* Check queue. */ if (netisr_queue(isr, m)) { /* (0) on success. */ if (debug) Modified: stable/7/sys/net/if_spppsubr.c ============================================================================== --- stable/7/sys/net/if_spppsubr.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_spppsubr.c Fri Feb 10 16:05:33 2012 (r231390) @@ -779,6 +779,7 @@ sppp_input(struct ifnet *ifp, struct mbu goto drop; SPPP_UNLOCK(sp); + M_SETFIB(m, ifp->if_fib); /* Check queue. */ if (netisr_queue(isr, m)) { /* (0) on success. */ if (debug) Modified: stable/7/sys/net/if_stf.c ============================================================================== --- stable/7/sys/net/if_stf.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_stf.c Fri Feb 10 16:05:33 2012 (r231390) @@ -766,6 +766,7 @@ in_stf_input(m, off) */ ifp->if_ipackets++; ifp->if_ibytes += m->m_pkthdr.len; + M_SETFIB(m, ifp->if_fib); netisr_dispatch(NETISR_IPV6, m); } Modified: stable/7/sys/net/if_tun.c ============================================================================== --- stable/7/sys/net/if_tun.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/net/if_tun.c Fri Feb 10 16:05:33 2012 (r231390) @@ -921,6 +921,7 @@ tunwrite(struct cdev *dev, struct uio *u random_harvest(m, 16, 3, 0, RANDOM_NET); ifp->if_ibytes += m->m_pkthdr.len; ifp->if_ipackets++; + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return (0); } Modified: stable/7/sys/netgraph/ng_iface.c ============================================================================== --- stable/7/sys/netgraph/ng_iface.c Fri Feb 10 15:54:39 2012 (r231389) +++ stable/7/sys/netgraph/ng_iface.c Fri Feb 10 16:05:33 2012 (r231390) @@ -774,6 +774,7 @@ ng_iface_rcvdata(hook_p hook, item_p ite /* First chunk of an mbuf contains good junk */ if (harvest.point_to_point) random_harvest(m, 16, 3, 0, RANDOM_NET); + M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 16:27:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA9111065673; Fri, 10 Feb 2012 16:27:45 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9DF3D8FC12; Fri, 10 Feb 2012 16:27:44 +0000 (UTC) Received: by lagz14 with SMTP id z14so3769068lag.13 for ; Fri, 10 Feb 2012 08:27:43 -0800 (PST) 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 :content-transfer-encoding; bh=RB9+d3n156XSBc5R5DDIUl0dCh768XdMUD0CANDwxiA=; b=TE/pGgz9z/IrimRmUWKqCBA158meMlPvaUddRPW0SYO05QDlAVfFf97S2LF8kqe2Sh Mdxc6ttHx09sO77odLorszIGWGRuJwzvsttkiN3kvO+zfgCsly9YNr7ow2XGeNzW6gjn H6XlfY33gmTJBmjOEtJhTerbKCgxQQrOzUZ/4= MIME-Version: 1.0 Received: by 10.112.87.225 with SMTP id bb1mr2239675lbb.59.1328891263407; Fri, 10 Feb 2012 08:27:43 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.18.4 with HTTP; Fri, 10 Feb 2012 08:27:43 -0800 (PST) In-Reply-To: <201202101340.q1ADeWDj076596@svn.freebsd.org> References: <201202101340.q1ADeWDj076596@svn.freebsd.org> Date: Fri, 10 Feb 2012 19:27:43 +0300 X-Google-Sender-Auth: lOsGX3o2s_ci87pKwhNdPMCw9E0 Message-ID: From: Sergey Kandaurov To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 16:27:45 -0000 On 10 February 2012 17:40, Ed Schouten wrote: > Author: ed > Date: Fri Feb 10 13:40:32 2012 > New Revision: 231383 > URL: http://svn.freebsd.org/changeset/base/231383 > > Log: > =A0Detect file modification properly by using tv_nsec. > > =A0POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond > =A0precision to detect file modification. > I am not sure we can use subsecond precision there with currently set sysctl vfs.timestamp_precision=3D0. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 16:36:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDCCB106566B; Fri, 10 Feb 2012 16:36:33 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 543188FC12; Fri, 10 Feb 2012 16:36:32 +0000 (UTC) Received: by yenl12 with SMTP id l12so2040498yen.13 for ; Fri, 10 Feb 2012 08:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=yB0zCyWs7610VDrTvxQFB6s+iQp5T0n4RccoGhS6tWw=; b=MGy6GMngBdE7cVWBZq0WPObXpI0nQVlD1bjpiRDS/B9i5AyZzhqqC+GCo25CaBZlXc pGr4anjxGw9+eszpz4eJbCtIfMNOdwSAZ+lk/exbfEfr3ONRm7gIalH+3HlGOCHSU84e g1MTGLfQdMsQcFbWqSO2ADf6P7OPCM8JfrMMk= Received: by 10.50.170.41 with SMTP id aj9mr12377940igc.0.1328891792266; Fri, 10 Feb 2012 08:36:32 -0800 (PST) Received: from DataIX.net (adsl-99-19-42-38.dsl.klmzmi.sbcglobal.net. [99.19.42.38]) by mx.google.com with ESMTPS id va6sm3203627igc.4.2012.02.10.08.36.25 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Feb 2012 08:36:29 -0800 (PST) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q1AGaNcY083751 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Feb 2012 11:36:23 -0500 (EST) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q1AGaM6l082841; Fri, 10 Feb 2012 11:36:22 -0500 (EST) (envelope-from jhell@DataIX.net) Date: Fri, 10 Feb 2012 11:36:22 -0500 From: Jason Hellenthal To: "Bjoern A. Zeeb" Message-ID: <20120210163622.GA43164@DataIX.net> References: <201202100642.q1A6g1PI058085@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202100642.q1A6g1PI058085@svn.freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231346 - in stable/8: sbin/ifconfig share/man/man9 sys/kern sys/net sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 16:36:34 -0000 Not quite sure if this is a problem with the kernel not being updated prior building this but the following errors are present without the build as I know for the mean time. Building the kernel now to test. /usr/src/sbin/ifconfig/iffib.c: In function 'fib_status': /usr/src/sbin/ifconfig/iffib.c:54: error: 'SIOCGIFFIB' undeclared (first use in this function) /usr/src/sbin/ifconfig/iffib.c:54: error: (Each undeclared identifier is reported only once /usr/src/sbin/ifconfig/iffib.c:54: error: for each function it appears in.) /usr/src/sbin/ifconfig/iffib.c:58: error: 'struct ifreq' has no member named 'ifr_fib' /usr/src/sbin/ifconfig/iffib.c:61: error: 'struct ifreq' has no member named 'ifr_fib' /usr/src/sbin/ifconfig/iffib.c: In function 'setiffib': /usr/src/sbin/ifconfig/iffib.c:78: error: 'struct ifreq' has no member named 'ifr_fib' /usr/src/sbin/ifconfig/iffib.c:79: error: 'SIOCSIFFIB' undeclared (first use in this function) *** Error code 1 On Fri, Feb 10, 2012 at 06:42:01AM +0000, Bjoern A. Zeeb wrote: > Author: bz > Date: Fri Feb 10 06:42:00 2012 > New Revision: 231346 > URL: http://svn.freebsd.org/changeset/base/231346 > > Log: > MFC r223735: > > Add infrastructure to allow all frames/packets received on an interface > to be assigned to a non-default FIB instance. > > Submitted by: cjsp > Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) > (original versions) > Reviewed by: julian > Reviewed by: Alexander V. Chernikov (melifaro ipfw.ru) > > Reviewed by: melifaro > > Added: > stable/8/sbin/ifconfig/iffib.c > - copied unchanged from r223735, head/sbin/ifconfig/iffib.c > Modified: > stable/8/sbin/ifconfig/Makefile > stable/8/sbin/ifconfig/ifconfig.8 > stable/8/share/man/man9/ifnet.9 > stable/8/sys/kern/kern_jail.c > stable/8/sys/net/if.c > stable/8/sys/net/if.h > stable/8/sys/net/if_debug.c > stable/8/sys/net/if_var.h > stable/8/sys/sys/priv.h > stable/8/sys/sys/sockio.h > Directory Properties: > stable/8/sbin/ifconfig/ (props changed) > stable/8/share/man/man9/ (props changed) > stable/8/sys/ (props changed) > > Modified: stable/8/sbin/ifconfig/Makefile > ============================================================================== > --- stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:42:00 2012 (r231346) > @@ -23,6 +23,7 @@ SRCS+= af_nd6.c # ND6 support > SRCS+= ifclone.c # clone device support > SRCS+= ifmac.c # MAC support > SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support > +SRCS+= iffib.c # non-default FIB support > SRCS+= ifvlan.c # SIOC[GS]ETVLAN support > SRCS+= ifgre.c # GRE keys etc > SRCS+= ifgif.c # GIF reversed header workaround > > Modified: stable/8/sbin/ifconfig/ifconfig.8 > ============================================================================== > --- stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:42:00 2012 (r231346) > @@ -294,6 +294,19 @@ Remove the interface from the given > Fill interface index > (lowermost 64bit of an IPv6 address) > automatically. > +.It Cm fib Ar fib_number > +Specify interface FIB. > +A FIB > +.Ar fib_number > +is assigned to all frames or packets received on that interface. > +The FIB is not inherited, e.g. vlans or other sub-interfaces will use > +the default FIB (0) irrespective of the parent interface's FIB. > +The kernel needs to be tuned to support more than the default FIB > +using the > +.Va ROUTETABLES > +kernel configuration option, or the > +.Va net.fibs > +tunable. > .It Cm ipdst > This is used to specify an Internet host who is willing to receive > IP packets encapsulating IPX packets bound for a remote network. > > Copied: stable/8/sbin/ifconfig/iffib.c (from r223735, head/sbin/ifconfig/iffib.c) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/sbin/ifconfig/iffib.c Fri Feb 10 06:42:00 2012 (r231346, copy of r223735, head/sbin/ifconfig/iffib.c) > @@ -0,0 +1,103 @@ > +/*- > + * Copyright (c) 2011 Alexander V. Chernikov > + * Copyright (c) 2011 Christian S.J. Peron > + * Copyright (c) 2011 Bjoern A. Zeeb > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include "ifconfig.h" > + > +static void > +fib_status(int s) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(ifr)); > + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + > + if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) < 0) > + return; > + > + /* Ignore if it is the default. */ > + if (ifr.ifr_fib == 0) > + return; > + > + printf("\tfib: %u\n", ifr.ifr_fib); > +} > + > +static void > +setiffib(const char *val, int dummy __unused, int s, > + const struct afswtch *afp) > +{ > + unsigned long fib; > + char *ep; > + > + fib = strtoul(val, &ep, 0); > + if (*ep != '\0' || fib > UINT_MAX) { > + warn("fib %s not valid", val); > + return; > + } > + > + strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); > + ifr.ifr_fib = fib; > + if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) > + warn("ioctl (SIOCSIFFIB)"); > +} > + > +static struct cmd fib_cmds[] = { > + DEF_CMD_ARG("fib", setiffib), > +}; > + > +static struct afswtch af_fib = { > + .af_name = "af_fib", > + .af_af = AF_UNSPEC, > + .af_other_status = fib_status, > +}; > + > +static __constructor void > +fib_ctor(void) > +{ > +#define N(a) (sizeof(a) / sizeof(a[0])) > + size_t i; > + > + for (i = 0; i < N(fib_cmds); i++) > + cmd_register(&fib_cmds[i]); > + af_register(&af_fib); > +#undef N > +} > > Modified: stable/8/share/man/man9/ifnet.9 > ============================================================================== > --- stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:42:00 2012 (r231346) > @@ -28,7 +28,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 14, 2007 > +.Dd July 3, 2011 > .Dt IFNET 9 > .Os > .Sh NAME > @@ -1156,11 +1156,12 @@ list. > Caller must have appropriate privilege. > (No call-down to driver.) > .It Dv SIOCGIFCAP > +.It Dv SIOCGIFFIB > .It Dv SIOCGIFFLAGS > .It Dv SIOCGIFMETRIC > .It Dv SIOCGIFMTU > .It Dv SIOCGIFPHYS > -Get interface capabilities, flags, metric, MTU, medium selection. > +Get interface capabilities, FIB, flags, metric, MTU, medium selection. > (No call-down to driver.) > .Pp > .It Dv SIOCSIFCAP > @@ -1179,6 +1180,12 @@ and > .Va if_data.ifi_hwassist > appropriately. > .Pp > +.It Dv SIOCSIFFIB > +Sets interface FIB. > +Caller must have appropriate privilege. > +FIB values start at 0 and values greater or equals than > +.Va net.fibs > +are considered invalid. > .It Dv SIOCSIFFLAGS > Change interface flags. > Caller must have appropriate privilege. > > Modified: stable/8/sys/kern/kern_jail.c > ============================================================================== > --- stable/8/sys/kern/kern_jail.c Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/kern/kern_jail.c Fri Feb 10 06:42:00 2012 (r231346) > @@ -3620,6 +3620,7 @@ prison_priv_check(struct ucred *cred, in > case PRIV_NET_LAGG: > case PRIV_NET_GIF: > case PRIV_NET_SETIFVNET: > + case PRIV_NET_SETIFFIB: > > /* > * 802.11-related privileges. > > Modified: stable/8/sys/net/if.c > ============================================================================== > --- stable/8/sys/net/if.c Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/net/if.c Fri Feb 10 06:42:00 2012 (r231346) > @@ -58,6 +58,8 @@ > #include > #include > #include > +#include > + > #include > #include > > @@ -2195,6 +2197,20 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, > free(odescrbuf, M_IFDESCR); > break; > > + case SIOCGIFFIB: > + ifr->ifr_fib = ifp->if_fib; > + break; > + > + case SIOCSIFFIB: > + error = priv_check(td, PRIV_NET_SETIFFIB); > + if (error) > + return (error); > + if (ifr->ifr_fib >= rt_numfibs) > + return (EINVAL); > + > + ifp->if_fib = ifr->ifr_fib; > + break; > + > case SIOCSIFFLAGS: > error = priv_check(td, PRIV_NET_SETIFFLAGS); > if (error) > > Modified: stable/8/sys/net/if.h > ============================================================================== > --- stable/8/sys/net/if.h Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/net/if.h Fri Feb 10 06:42:00 2012 (r231346) > @@ -315,6 +315,7 @@ struct ifreq { > int ifru_media; > caddr_t ifru_data; > int ifru_cap[2]; > + u_int ifru_fib; > } ifr_ifru; > #define ifr_addr ifr_ifru.ifru_addr /* address */ > #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ > @@ -331,6 +332,7 @@ struct ifreq { > #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ > #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ > #define ifr_index ifr_ifru.ifru_index /* interface index */ > +#define ifr_fib ifr_ifru.ifru_fib /* interface fib */ > }; > > #define _SIZEOF_ADDR_IFREQ(ifr) \ > > Modified: stable/8/sys/net/if_debug.c > ============================================================================== > --- stable/8/sys/net/if_debug.c Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/net/if_debug.c Fri Feb 10 06:42:00 2012 (r231346) > @@ -86,6 +86,7 @@ if_show_ifnet(struct ifnet *ifp) > IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); > IF_DB_PRINTF("%d", if_snd.altq_type); > IF_DB_PRINTF("%x", if_snd.altq_flags); > + IF_DB_PRINTF("%u", if_fib); > #undef IF_DB_PRINTF > } > > > Modified: stable/8/sys/net/if_var.h > ============================================================================== > --- stable/8/sys/net/if_var.h Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/net/if_var.h Fri Feb 10 06:42:00 2012 (r231346) > @@ -207,7 +207,8 @@ struct ifnet { > char if_cspare[3]; > char *if_description; /* interface description */ > void *if_pspare[7]; > - int if_ispare[4]; > + int if_ispare[3]; > + u_int if_fib; /* interface FIB */ > }; > > typedef void if_init_f_t(void *); > > Modified: stable/8/sys/sys/priv.h > ============================================================================== > --- stable/8/sys/sys/priv.h Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/sys/priv.h Fri Feb 10 06:42:00 2012 (r231346) > @@ -336,6 +336,7 @@ > #define PRIV_NET_GIF 416 /* Administer gif interface. */ > #define PRIV_NET_SETIFVNET 417 /* Move interface to vnet. */ > #define PRIV_NET_SETIFDESCR 418 /* Set interface description. */ > +#define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ > > /* > * 802.11-related privileges. > > Modified: stable/8/sys/sys/sockio.h > ============================================================================== > --- stable/8/sys/sys/sockio.h Fri Feb 10 06:38:57 2012 (r231345) > +++ stable/8/sys/sys/sockio.h Fri Feb 10 06:42:00 2012 (r231346) > @@ -110,6 +110,9 @@ > #define SIOCSIFVNET _IOWR('i', 90, struct ifreq) /* move IF jail/vnet */ > #define SIOCSIFRVNET _IOWR('i', 91, struct ifreq) /* reclaim vnet IF */ > > +#define SIOCGIFFIB _IOWR('i', 92, struct ifreq) /* get IF fib */ > +#define SIOCSIFFIB _IOW('i', 93, struct ifreq) /* set IF fib */ > + > #define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific > parameters */ > #define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" -- ;s =; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 16:41:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 296EC106564A; Fri, 10 Feb 2012 16:41:24 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id AE1798FC15; Fri, 10 Feb 2012 16:41:23 +0000 (UTC) Received: by iaeo4 with SMTP id o4so681537iae.13 for ; Fri, 10 Feb 2012 08:41:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=EUiZXKwXvl2cv0riQUtmZMp5l/+MJr3s2WmbiYRLJDE=; b=n1c1mtzah1LfHjBgVMsGZJXHP0xmZ046P1fmhqzO0prXmvkN7F9wfBNFL9BVXFBSbq vHVW0k+g46+yFvh0G3IJB7suMBFKLKdatQfdlLXg6nU+JCp/wZBazjN51EqhQN9q2nbK KtAFQItMdYwWsVDkjRmVqxcRiT8YMVKpqbp6k= Received: by 10.42.157.133 with SMTP id d5mr10096597icx.46.1328892083105; Fri, 10 Feb 2012 08:41:23 -0800 (PST) Received: from DataIX.net (adsl-99-19-42-38.dsl.klmzmi.sbcglobal.net. [99.19.42.38]) by mx.google.com with ESMTPS id wn6sm3226106igb.3.2012.02.10.08.41.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Feb 2012 08:41:21 -0800 (PST) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q1AGfBBb077403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Feb 2012 11:41:11 -0500 (EST) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q1AGfB3q076736; Fri, 10 Feb 2012 11:41:11 -0500 (EST) (envelope-from jhell@DataIX.net) Date: Fri, 10 Feb 2012 11:41:11 -0500 From: Jason Hellenthal To: "Bjoern A. Zeeb" Message-ID: <20120210164111.GB43164@DataIX.net> References: <201202100642.q1A6g1PI058085@svn.freebsd.org> <20120210163622.GA43164@DataIX.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120210163622.GA43164@DataIX.net> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r231346 - in stable/8: sbin/ifconfig share/man/man9 sys/kern sys/net sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 16:41:24 -0000 Ignore this please. I have not been feeling that great and missed the header updates :( On Fri, Feb 10, 2012 at 11:36:22AM -0500, Jason Hellenthal wrote: > > Not quite sure if this is a problem with the kernel not being updated > prior building this but the following errors are present without the > build as I know for the mean time. Building the kernel now to test. > > /usr/src/sbin/ifconfig/iffib.c: In function 'fib_status': > /usr/src/sbin/ifconfig/iffib.c:54: error: 'SIOCGIFFIB' undeclared (first > use in this function) > /usr/src/sbin/ifconfig/iffib.c:54: error: (Each undeclared identifier is > reported only once > /usr/src/sbin/ifconfig/iffib.c:54: error: for each function it appears > in.) > /usr/src/sbin/ifconfig/iffib.c:58: error: 'struct ifreq' has no member > named 'ifr_fib' > /usr/src/sbin/ifconfig/iffib.c:61: error: 'struct ifreq' has no member > named 'ifr_fib' > /usr/src/sbin/ifconfig/iffib.c: In function 'setiffib': > /usr/src/sbin/ifconfig/iffib.c:78: error: 'struct ifreq' has no member > named 'ifr_fib' > /usr/src/sbin/ifconfig/iffib.c:79: error: 'SIOCSIFFIB' undeclared (first > use in this function) > *** Error code 1 > > On Fri, Feb 10, 2012 at 06:42:01AM +0000, Bjoern A. Zeeb wrote: > > Author: bz > > Date: Fri Feb 10 06:42:00 2012 > > New Revision: 231346 > > URL: http://svn.freebsd.org/changeset/base/231346 > > > > Log: > > MFC r223735: > > > > Add infrastructure to allow all frames/packets received on an interface > > to be assigned to a non-default FIB instance. > > > > Submitted by: cjsp > > Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) > > (original versions) > > Reviewed by: julian > > Reviewed by: Alexander V. Chernikov (melifaro ipfw.ru) > > > > Reviewed by: melifaro > > > > Added: > > stable/8/sbin/ifconfig/iffib.c > > - copied unchanged from r223735, head/sbin/ifconfig/iffib.c > > Modified: > > stable/8/sbin/ifconfig/Makefile > > stable/8/sbin/ifconfig/ifconfig.8 > > stable/8/share/man/man9/ifnet.9 > > stable/8/sys/kern/kern_jail.c > > stable/8/sys/net/if.c > > stable/8/sys/net/if.h > > stable/8/sys/net/if_debug.c > > stable/8/sys/net/if_var.h > > stable/8/sys/sys/priv.h > > stable/8/sys/sys/sockio.h > > Directory Properties: > > stable/8/sbin/ifconfig/ (props changed) > > stable/8/share/man/man9/ (props changed) > > stable/8/sys/ (props changed) > > > > Modified: stable/8/sbin/ifconfig/Makefile > > ============================================================================== > > --- stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sbin/ifconfig/Makefile Fri Feb 10 06:42:00 2012 (r231346) > > @@ -23,6 +23,7 @@ SRCS+= af_nd6.c # ND6 support > > SRCS+= ifclone.c # clone device support > > SRCS+= ifmac.c # MAC support > > SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support > > +SRCS+= iffib.c # non-default FIB support > > SRCS+= ifvlan.c # SIOC[GS]ETVLAN support > > SRCS+= ifgre.c # GRE keys etc > > SRCS+= ifgif.c # GIF reversed header workaround > > > > Modified: stable/8/sbin/ifconfig/ifconfig.8 > > ============================================================================== > > --- stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sbin/ifconfig/ifconfig.8 Fri Feb 10 06:42:00 2012 (r231346) > > @@ -294,6 +294,19 @@ Remove the interface from the given > > Fill interface index > > (lowermost 64bit of an IPv6 address) > > automatically. > > +.It Cm fib Ar fib_number > > +Specify interface FIB. > > +A FIB > > +.Ar fib_number > > +is assigned to all frames or packets received on that interface. > > +The FIB is not inherited, e.g. vlans or other sub-interfaces will use > > +the default FIB (0) irrespective of the parent interface's FIB. > > +The kernel needs to be tuned to support more than the default FIB > > +using the > > +.Va ROUTETABLES > > +kernel configuration option, or the > > +.Va net.fibs > > +tunable. > > .It Cm ipdst > > This is used to specify an Internet host who is willing to receive > > IP packets encapsulating IPX packets bound for a remote network. > > > > Copied: stable/8/sbin/ifconfig/iffib.c (from r223735, head/sbin/ifconfig/iffib.c) > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ stable/8/sbin/ifconfig/iffib.c Fri Feb 10 06:42:00 2012 (r231346, copy of r223735, head/sbin/ifconfig/iffib.c) > > @@ -0,0 +1,103 @@ > > +/*- > > + * Copyright (c) 2011 Alexander V. Chernikov > > + * Copyright (c) 2011 Christian S.J. Peron > > + * Copyright (c) 2011 Bjoern A. Zeeb > > + * All rights reserved. > > + * > > + * Redistribution and use in source and binary forms, with or without > > + * modification, are permitted provided that the following conditions > > + * are met: > > + * 1. Redistributions of source code must retain the above copyright > > + * notice, this list of conditions and the following disclaimer. > > + * 2. Redistributions in binary form must reproduce the above copyright > > + * notice, this list of conditions and the following disclaimer in the > > + * documentation and/or other materials provided with the distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > > + * SUCH DAMAGE. > > + * > > + * $FreeBSD$ > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > + > > +#include "ifconfig.h" > > + > > +static void > > +fib_status(int s) > > +{ > > + struct ifreq ifr; > > + > > + memset(&ifr, 0, sizeof(ifr)); > > + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > > + > > + if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) < 0) > > + return; > > + > > + /* Ignore if it is the default. */ > > + if (ifr.ifr_fib == 0) > > + return; > > + > > + printf("\tfib: %u\n", ifr.ifr_fib); > > +} > > + > > +static void > > +setiffib(const char *val, int dummy __unused, int s, > > + const struct afswtch *afp) > > +{ > > + unsigned long fib; > > + char *ep; > > + > > + fib = strtoul(val, &ep, 0); > > + if (*ep != '\0' || fib > UINT_MAX) { > > + warn("fib %s not valid", val); > > + return; > > + } > > + > > + strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); > > + ifr.ifr_fib = fib; > > + if (ioctl(s, SIOCSIFFIB, (caddr_t)&ifr) < 0) > > + warn("ioctl (SIOCSIFFIB)"); > > +} > > + > > +static struct cmd fib_cmds[] = { > > + DEF_CMD_ARG("fib", setiffib), > > +}; > > + > > +static struct afswtch af_fib = { > > + .af_name = "af_fib", > > + .af_af = AF_UNSPEC, > > + .af_other_status = fib_status, > > +}; > > + > > +static __constructor void > > +fib_ctor(void) > > +{ > > +#define N(a) (sizeof(a) / sizeof(a[0])) > > + size_t i; > > + > > + for (i = 0; i < N(fib_cmds); i++) > > + cmd_register(&fib_cmds[i]); > > + af_register(&af_fib); > > +#undef N > > +} > > > > Modified: stable/8/share/man/man9/ifnet.9 > > ============================================================================== > > --- stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/share/man/man9/ifnet.9 Fri Feb 10 06:42:00 2012 (r231346) > > @@ -28,7 +28,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd March 14, 2007 > > +.Dd July 3, 2011 > > .Dt IFNET 9 > > .Os > > .Sh NAME > > @@ -1156,11 +1156,12 @@ list. > > Caller must have appropriate privilege. > > (No call-down to driver.) > > .It Dv SIOCGIFCAP > > +.It Dv SIOCGIFFIB > > .It Dv SIOCGIFFLAGS > > .It Dv SIOCGIFMETRIC > > .It Dv SIOCGIFMTU > > .It Dv SIOCGIFPHYS > > -Get interface capabilities, flags, metric, MTU, medium selection. > > +Get interface capabilities, FIB, flags, metric, MTU, medium selection. > > (No call-down to driver.) > > .Pp > > .It Dv SIOCSIFCAP > > @@ -1179,6 +1180,12 @@ and > > .Va if_data.ifi_hwassist > > appropriately. > > .Pp > > +.It Dv SIOCSIFFIB > > +Sets interface FIB. > > +Caller must have appropriate privilege. > > +FIB values start at 0 and values greater or equals than > > +.Va net.fibs > > +are considered invalid. > > .It Dv SIOCSIFFLAGS > > Change interface flags. > > Caller must have appropriate privilege. > > > > Modified: stable/8/sys/kern/kern_jail.c > > ============================================================================== > > --- stable/8/sys/kern/kern_jail.c Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/kern/kern_jail.c Fri Feb 10 06:42:00 2012 (r231346) > > @@ -3620,6 +3620,7 @@ prison_priv_check(struct ucred *cred, in > > case PRIV_NET_LAGG: > > case PRIV_NET_GIF: > > case PRIV_NET_SETIFVNET: > > + case PRIV_NET_SETIFFIB: > > > > /* > > * 802.11-related privileges. > > > > Modified: stable/8/sys/net/if.c > > ============================================================================== > > --- stable/8/sys/net/if.c Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/net/if.c Fri Feb 10 06:42:00 2012 (r231346) > > @@ -58,6 +58,8 @@ > > #include > > #include > > #include > > +#include > > + > > #include > > #include > > > > @@ -2195,6 +2197,20 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, > > free(odescrbuf, M_IFDESCR); > > break; > > > > + case SIOCGIFFIB: > > + ifr->ifr_fib = ifp->if_fib; > > + break; > > + > > + case SIOCSIFFIB: > > + error = priv_check(td, PRIV_NET_SETIFFIB); > > + if (error) > > + return (error); > > + if (ifr->ifr_fib >= rt_numfibs) > > + return (EINVAL); > > + > > + ifp->if_fib = ifr->ifr_fib; > > + break; > > + > > case SIOCSIFFLAGS: > > error = priv_check(td, PRIV_NET_SETIFFLAGS); > > if (error) > > > > Modified: stable/8/sys/net/if.h > > ============================================================================== > > --- stable/8/sys/net/if.h Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/net/if.h Fri Feb 10 06:42:00 2012 (r231346) > > @@ -315,6 +315,7 @@ struct ifreq { > > int ifru_media; > > caddr_t ifru_data; > > int ifru_cap[2]; > > + u_int ifru_fib; > > } ifr_ifru; > > #define ifr_addr ifr_ifru.ifru_addr /* address */ > > #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ > > @@ -331,6 +332,7 @@ struct ifreq { > > #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ > > #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ > > #define ifr_index ifr_ifru.ifru_index /* interface index */ > > +#define ifr_fib ifr_ifru.ifru_fib /* interface fib */ > > }; > > > > #define _SIZEOF_ADDR_IFREQ(ifr) \ > > > > Modified: stable/8/sys/net/if_debug.c > > ============================================================================== > > --- stable/8/sys/net/if_debug.c Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/net/if_debug.c Fri Feb 10 06:42:00 2012 (r231346) > > @@ -86,6 +86,7 @@ if_show_ifnet(struct ifnet *ifp) > > IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); > > IF_DB_PRINTF("%d", if_snd.altq_type); > > IF_DB_PRINTF("%x", if_snd.altq_flags); > > + IF_DB_PRINTF("%u", if_fib); > > #undef IF_DB_PRINTF > > } > > > > > > Modified: stable/8/sys/net/if_var.h > > ============================================================================== > > --- stable/8/sys/net/if_var.h Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/net/if_var.h Fri Feb 10 06:42:00 2012 (r231346) > > @@ -207,7 +207,8 @@ struct ifnet { > > char if_cspare[3]; > > char *if_description; /* interface description */ > > void *if_pspare[7]; > > - int if_ispare[4]; > > + int if_ispare[3]; > > + u_int if_fib; /* interface FIB */ > > }; > > > > typedef void if_init_f_t(void *); > > > > Modified: stable/8/sys/sys/priv.h > > ============================================================================== > > --- stable/8/sys/sys/priv.h Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/sys/priv.h Fri Feb 10 06:42:00 2012 (r231346) > > @@ -336,6 +336,7 @@ > > #define PRIV_NET_GIF 416 /* Administer gif interface. */ > > #define PRIV_NET_SETIFVNET 417 /* Move interface to vnet. */ > > #define PRIV_NET_SETIFDESCR 418 /* Set interface description. */ > > +#define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ > > > > /* > > * 802.11-related privileges. > > > > Modified: stable/8/sys/sys/sockio.h > > ============================================================================== > > --- stable/8/sys/sys/sockio.h Fri Feb 10 06:38:57 2012 (r231345) > > +++ stable/8/sys/sys/sockio.h Fri Feb 10 06:42:00 2012 (r231346) > > @@ -110,6 +110,9 @@ > > #define SIOCSIFVNET _IOWR('i', 90, struct ifreq) /* move IF jail/vnet */ > > #define SIOCSIFRVNET _IOWR('i', 91, struct ifreq) /* reclaim vnet IF */ > > > > +#define SIOCGIFFIB _IOWR('i', 92, struct ifreq) /* get IF fib */ > > +#define SIOCSIFFIB _IOW('i', 93, struct ifreq) /* set IF fib */ > > + > > #define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific > > parameters */ > > #define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific > > _______________________________________________ > > svn-src-stable-8@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" > > -- > ;s =; -- ;s =; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 17:20:26 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D216106564A; Fri, 10 Feb 2012 17:20:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id CA9C18FC12; Fri, 10 Feb 2012 17:20:25 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1AHKM5x016407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 11 Feb 2012 04:20:24 +1100 Date: Sat, 11 Feb 2012 04:20:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sergey Kandaurov In-Reply-To: Message-ID: <20120211041345.Q3573@besplex.bde.org> References: <201202101340.q1ADeWDj076596@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-267995700-1328894422=:3573" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten Subject: Re: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 17:20:26 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-267995700-1328894422=:3573 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 10 Feb 2012, Sergey Kandaurov wrote: > On 10 February 2012 17:40, Ed Schouten wrote: >> Log: >> =A0Detect file modification properly by using tv_nsec. >> >> =A0POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond >> =A0precision to detect file modification. > > I am not sure we can use subsecond precision there with currently set > sysctl vfs.timestamp_precision=3D0. Also, not all file systems support even seconds precision. So the deleted BUGS section applies irrespective of vfs.timestamp_precision, except it doesn't describe the full extent of the problem. Sleeping for just 1 second is not enough if the timestamp precision is large. The BUGS section also applies respective of vfs.timestamp_precision, when the user uses the supported setting vfs.timestamp_precision=3D0. Of course, important databases that need POSIX semantics shouldn't be put on file systems without POSIX times, but you need a BUGS section somewhere to tell you not to do that. Bruce --0-267995700-1328894422=:3573-- From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 17:49:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF6881065673; Fri, 10 Feb 2012 17:49:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D79598FC1B; Fri, 10 Feb 2012 17: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 q1AHnE1g085828; Fri, 10 Feb 2012 17:49:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AHnEtO085820; Fri, 10 Feb 2012 17:49:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101749.q1AHnEtO085820@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 17: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: r231391 - in stable/8/sys: net80211 netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 17:49:15 -0000 Author: tuexen Date: Fri Feb 10 17:49:14 2012 New Revision: 231391 URL: http://svn.freebsd.org/changeset/base/231391 Log: MFC r217554: Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need to rely on the format string. For SYSCTL_PROC instances that I noticed a discrepancy between the CTLTYPE and the format specifier, fix the CTLTYPE. The commit is from mdf@ and the MFC has been discussed with him. Modified: stable/8/sys/net80211/ieee80211_freebsd.c stable/8/sys/netinet/ip_divert.c stable/8/sys/netinet/raw_ip.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/tcp_reass.c stable/8/sys/netinet/tcp_subr.c stable/8/sys/netinet/udp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/net80211/ieee80211_freebsd.c ============================================================================== --- stable/8/sys/net80211/ieee80211_freebsd.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/net80211/ieee80211_freebsd.c Fri Feb 10 17:49:14 2012 (r231391) @@ -233,7 +233,7 @@ ieee80211_sysctl_vattach(struct ieee8021 oid = SYSCTL_ADD_NODE(ctx, &SYSCTL_NODE_CHILDREN(_net, wlan), OID_AUTO, num, CTLFLAG_RD, NULL, ""); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "%parent", CTLFLAG_RD, vap->iv_ic, 0, + "%parent", CTLTYPE_STRING | CTLFLAG_RD, vap->iv_ic, 0, ieee80211_sysctl_parent, "A", "parent device"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "driver_caps", CTLFLAG_RW, &vap->iv_caps, 0, Modified: stable/8/sys/netinet/ip_divert.c ============================================================================== --- stable/8/sys/netinet/ip_divert.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/ip_divert.c Fri Feb 10 17:49:14 2012 (r231391) @@ -708,8 +708,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS) #ifdef SYSCTL_NODE SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, divert, CTLFLAG_RW, 0, "IPDIVERT"); -SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLFLAG_RD, 0, 0, - div_pcblist, "S,xinpcb", "List of active divert sockets"); +SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD, + NULL, 0, div_pcblist, "S,xinpcb", "List of active divert sockets"); #endif struct pr_usrreqs div_usrreqs = { Modified: stable/8/sys/netinet/raw_ip.c ============================================================================== --- stable/8/sys/netinet/raw_ip.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/raw_ip.c Fri Feb 10 17:49:14 2012 (r231391) @@ -1103,7 +1103,8 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, CTLFLAG_RD, 0, 0, +SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, rip_pcblist, "S,xinpcb", "List of active raw IP sockets"); struct pr_usrreqs rip_usrreqs = { Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 17:49:14 2012 (r231391) @@ -810,230 +810,230 @@ sysctl_sctp_cleartrace(SYSCTL_HANDLER_AR * sysctl definitions */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXDGRAM_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, "IU", SCTPCTL_RECVSPACE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTOASCONF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_ECN_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_nonce, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_nonce, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_ecn_nonce), 0, sysctl_sctp_check, "IU", SCTPCTL_ECN_NONCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); #if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_INIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", SCTPCTL_PEER_CHKOH_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXCHUNKS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_TCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_PCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_SPLIT_POINT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, "IU", SCTPCTL_CHUNKSCALE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_DELAYED_SACK_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_FREQ_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_SYS_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ASOC_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, "IU", SCTPCTL_HEARTBEAT_INTERVAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PMTU_RAISE_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SECRET_LIFETIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_INITIAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, "IU", SCTPCTL_VALID_COOKIE_LIFE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_ASSOC_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PATH_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_ON_OFF_DESC); /* EY */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_NR_SACK_ON_OFF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_USE_DAC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_pf), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_PF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_CWND_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr_msec), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_MSEC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), 0, sysctl_sctp_check, "IU", SCTPCTL_ASCONF_AUTH_NOCHK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTH_DISABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, "IU", SCTPCTL_ABC_L_VAR_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_CHAINED_MBUFS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, "IU", SCTPCTL_DO_SCTP_DRAIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_HB_MAX_BURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ABORT_AT_LIMIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_DATA_ORDER_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_RESIDUAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_RETRAN_CHUNK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, "IU", SCTPCTL_LOGGING_LEVEL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_CC_MODULE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_BASE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_FASTHANDOFF_DESC); @@ -1042,7 +1042,7 @@ SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, &SCTP_BASE_SYSCTL(sctp_log), sctp_log, "SCTP logging (struct sctp_log)"); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_OPAQUE | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_log), 0, sysctl_sctp_cleartrace, "IU", "Clear SCTP Logging buffer"); @@ -1050,43 +1050,43 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cl #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_INITS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", SCTPCTL_TIME_WAIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", SCTPCTL_BUFFER_SPLITTING_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", SCTPCTL_INITIAL_CWND_DESC); #ifdef SCTP_DEBUG -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", SCTPCTL_DEBUG_DESC); #endif /* SCTP_DEBUG */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); #endif @@ -1101,6 +1101,6 @@ SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, "SCTP statistics (struct sctp_stat)"); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLFLAG_RD, +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, 0, 0, sctp_assoclist, "S,xassoc", "List of active SCTP associations"); Modified: stable/8/sys/netinet/tcp_reass.c ============================================================================== --- stable/8/sys/netinet/tcp_reass.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/tcp_reass.c Fri Feb 10 17:49:14 2012 (r231391) @@ -82,19 +82,22 @@ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rea static VNET_DEFINE(int, tcp_reass_maxseg) = 0; #define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, +SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, + CTLTYPE_INT | CTLFLAG_RDTUN, &VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I", "Global maximum number of TCP Segments in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_qsize) = 0; #define V_tcp_reass_qsize VNET(tcp_reass_qsize) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, +SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, + CTLTYPE_INT | CTLFLAG_RD, &VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I", "Global number of TCP Segments currently in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_overflows) = 0; #define V_tcp_reass_overflows VNET(tcp_reass_overflows) -SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, CTLFLAG_RD, +SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, + CTLTYPE_INT | CTLFLAG_RD, &VNET_NAME(tcp_reass_overflows), 0, "Global number of TCP Segment Reassembly Queue Overflows"); Modified: stable/8/sys/netinet/tcp_subr.c ============================================================================== --- stable/8/sys/netinet/tcp_subr.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/tcp_subr.c Fri Feb 10 17:49:14 2012 (r231391) @@ -1246,7 +1246,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0, +SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, tcp_pcblist, "S,xtcpcb", "List of active TCP connections"); static int Modified: stable/8/sys/netinet/udp_usrreq.c ============================================================================== --- stable/8/sys/netinet/udp_usrreq.c Fri Feb 10 16:05:33 2012 (r231390) +++ stable/8/sys/netinet/udp_usrreq.c Fri Feb 10 17:49:14 2012 (r231391) @@ -820,7 +820,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0, +SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, udp_pcblist, "S,xinpcb", "List of active UDP sockets"); static int From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 18:14:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD027106566B; Fri, 10 Feb 2012 18:14:25 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACDE18FC08; Fri, 10 Feb 2012 18:14: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 q1AIEPMh086717; Fri, 10 Feb 2012 18:14:25 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIEPIx086715; Fri, 10 Feb 2012 18:14:25 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202101814.q1AIEPIx086715@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 10 Feb 2012 18:14: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: r231392 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:14:25 -0000 Author: ken Date: Fri Feb 10 18:14:25 2012 New Revision: 231392 URL: http://svn.freebsd.org/changeset/base/231392 Log: MFC 231170 Update the mps(4) man page for the changes in the new LSI-supported driver. This should have been included in change 230592. The supported hardware section still needs some updating to reflect the current reality. Modified: stable/9/share/man/man4/mps.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/mps.4 ============================================================================== --- stable/9/share/man/man4/mps.4 Fri Feb 10 17:49:14 2012 (r231391) +++ stable/9/share/man/man4/mps.4 Fri Feb 10 18:14:25 2012 (r231392) @@ -31,10 +31,10 @@ .\" .\" Author: Ken Merry .\" -.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#4 $ +.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd September 13, 2010 +.Dd February 7, 2012 .Dt MPS 4 .Os .Sh NAME @@ -58,7 +58,7 @@ The .Nm driver provides support for LSI Logic Fusion-MPT 2 .Tn SAS -controllers. +controllers and WarpDrive solid state storage cards. .Sh HARDWARE The .Nm @@ -90,6 +90,16 @@ driver instances, set the following tuna hw.mps.disable_msi=1 .Ed .Pp +To disable MSI interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.disable_msi=1 +.Ed +.Pp +where X is the adapter number. +.Pp To disable MSI-X interrupts for all .Nm driver instances, set the following tunable value in @@ -98,19 +108,51 @@ driver instances, set the following tuna hw.mps.disable_msix=1 .Ed .Pp -To allow the driver to send multiple task management commands (like abort, -LUN reset, etc.), set the following variable: +To disable MSI-X interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : .Bd -literal -offset indent -hw.mps.X.allow_multiple_tm_cmds=1 +dev.mps.X.disable_msix=1 .Ed .Pp -via -.Xr loader.conf 5 -or -.Xr sysctl 8 , -where X is the adapter number. -By default the driver only sends one task management command at a time, to -avoid causing a potential controller lock-up. +To set the maximum number of DMA chains allocated for all adapters, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mps.max_chains=NNNN +.Ed +.Pp +To set the maximum number of DMA chains allocated for a specific adapter, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.max_chains=NNNN +.Ed +.Pp +This variable may also be viewed via +.Xr sysctl 8 +to see the maximum set for a given adapter. +.Pp +The current number of free chain frames may be seen via the +dev.mps.X.chain_free +.Xr sysctl 8 +variable. +.Pp +The lowest number of free chain frames may be seen via the +dev.mps.X.chain_free_lowwater +.Xr sysctl 8 +variable. +.Pp +The current number of active I/O commands is shown in the +dev.mps.X.io_cmds_active +.Xr sysctl 8 +variable. +.Pp +The maximum number of active I/O command seen since boot is shown in the +dev.mps.X.io_cmds_highwater +.Xr sysctl 8 +variable. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -142,7 +184,9 @@ Enable prints for controller events. .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , -.Xr targ 4 +.Xr targ 4 , +.Xr loader.conf 5 , +.Xr sysctl 8 .Sh HISTORY The .Nm @@ -154,20 +198,19 @@ The .Nm driver was originally written by .An Scott Long Aq scottl@FreeBSD.org . +It has been improved and tested by LSI Logic Corporation. This man page was written by .An Ken Merry Aq ken@FreeBSD.org . .Sh BUGS -This driver is still in development, it has only been tested on the amd64 -architecture and has some known shortcomings: +This driver has a couple of known shortcomings: .Bl -bullet -compact .It -No IR (Integrated RAID) support. +Not endian safe. +It only works on little endian machines (e.g. amd64 and i386). .It -No userland utility support (e.g. -.Xr mptutil 8). -.It -Sometimes the driver gets into a state where devices arrive and depart multiple -times, without user intervention. +No userland utility available (e.g. +.Xr mptutil 8) .It -The error recovery code isn't complete. +The driver probes devices sequentially. +If your system has a large number of devices, the probe will take a while. .El From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 18:15:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19FAD1065674; Fri, 10 Feb 2012 18:15:46 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED2FF8FC14; Fri, 10 Feb 2012 18:15: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 q1AIFjA2086801; Fri, 10 Feb 2012 18:15:45 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIFjio086799; Fri, 10 Feb 2012 18:15:45 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202101815.q1AIFjio086799@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 10 Feb 2012 18:15:45 +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: r231393 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:15:46 -0000 Author: ken Date: Fri Feb 10 18:15:45 2012 New Revision: 231393 URL: http://svn.freebsd.org/changeset/base/231393 Log: MFC 231170 Update the mps(4) man page for the changes in the new LSI-supported driver. This should have been included in change 230592. The supported hardware section still needs some updating to reflect the current reality. Modified: stable/8/share/man/man4/mps.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/mps.4 ============================================================================== --- stable/8/share/man/man4/mps.4 Fri Feb 10 18:14:25 2012 (r231392) +++ stable/8/share/man/man4/mps.4 Fri Feb 10 18:15:45 2012 (r231393) @@ -31,10 +31,10 @@ .\" .\" Author: Ken Merry .\" -.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#4 $ +.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd September 13, 2010 +.Dd February 7, 2012 .Dt MPS 4 .Os .Sh NAME @@ -58,7 +58,7 @@ The .Nm driver provides support for LSI Logic Fusion-MPT 2 .Tn SAS -controllers. +controllers and WarpDrive solid state storage cards. .Sh HARDWARE The .Nm @@ -90,6 +90,16 @@ driver instances, set the following tuna hw.mps.disable_msi=1 .Ed .Pp +To disable MSI interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.disable_msi=1 +.Ed +.Pp +where X is the adapter number. +.Pp To disable MSI-X interrupts for all .Nm driver instances, set the following tunable value in @@ -98,19 +108,51 @@ driver instances, set the following tuna hw.mps.disable_msix=1 .Ed .Pp -To allow the driver to send multiple task management commands (like abort, -LUN reset, etc.), set the following variable: +To disable MSI-X interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.disable_msix=1 +.Ed +.Pp +To set the maximum number of DMA chains allocated for all adapters, +set the following variable in +.Xr loader.conf 5 : .Bd -literal -offset indent -hw.mps.X.allow_multiple_tm_cmds=1 +hw.mps.max_chains=NNNN .Ed .Pp -via -.Xr loader.conf 5 -or -.Xr sysctl 8 , -where X is the adapter number. -By default the driver only sends one task management command at a time, to -avoid causing a potential controller lock-up. +To set the maximum number of DMA chains allocated for a specific adapter, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.max_chains=NNNN +.Ed +.Pp +This variable may also be viewed via +.Xr sysctl 8 +to see the maximum set for a given adapter. +.Pp +The current number of free chain frames may be seen via the +dev.mps.X.chain_free +.Xr sysctl 8 +variable. +.Pp +The lowest number of free chain frames may be seen via the +dev.mps.X.chain_free_lowwater +.Xr sysctl 8 +variable. +.Pp +The current number of active I/O commands is shown in the +dev.mps.X.io_cmds_active +.Xr sysctl 8 +variable. +.Pp +The maximum number of active I/O command seen since boot is shown in the +dev.mps.X.io_cmds_highwater +.Xr sysctl 8 +variable. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -142,22 +184,9 @@ Enable prints for controller events. .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , -.Xr targ 4 -.Sh BUGS -This driver is still in development, it has only been tested on the amd64 -architecture and has some known shortcomings: -.Bl -bullet -compact -.It -No IR (Integrated RAID) support. -.It -No userland utility support (e.g. -.Xr mptutil 8). -.It -Sometimes the driver gets into a state where devices arrive and depart multiple -times, without user intervention. -.It -The error recovery code isn't complete. -.El +.Xr targ 4 , +.Xr loader.conf 5 , +.Xr sysctl 8 .Sh HISTORY The .Nm @@ -169,5 +198,19 @@ The .Nm driver was originally written by .An Scott Long Aq scottl@FreeBSD.org . +It has been improved and tested by LSI Logic Corporation. This man page was written by .An Ken Merry Aq ken@FreeBSD.org . +.Sh BUGS +This driver has a couple of known shortcomings: +.Bl -bullet -compact +.It +Not endian safe. +It only works on little endian machines (e.g. amd64 and i386). +.It +No userland utility available (e.g. +.Xr mptutil 8) +.It +The driver probes devices sequentially. +If your system has a large number of devices, the probe will take a while. +.El From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 18:43:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51E641065675; Fri, 10 Feb 2012 18:43:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 399448FC1D; Fri, 10 Feb 2012 18:43: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 q1AIh5J5087811; Fri, 10 Feb 2012 18:43:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIh49T087801; Fri, 10 Feb 2012 18:43:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101843.q1AIh49T087801@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:43:04 +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: r231395 - in stable/8/sys: conf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:43:05 -0000 Author: tuexen Date: Fri Feb 10 18:43:04 2012 New Revision: 231395 URL: http://svn.freebsd.org/changeset/base/231395 Log: MFC r217760: Add stream scheduling support. This work is based on a patch received from Robin Seggelmann. Added: stable/8/sys/netinet/sctp_ss_functions.c - copied unchanged from r217760, head/sys/netinet/sctp_ss_functions.c Modified: stable/8/sys/conf/files stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/conf/files Fri Feb 10 18:43:04 2012 (r231395) @@ -2617,6 +2617,7 @@ netinet/sctp_input.c optional inet sctp netinet/sctp_output.c optional inet sctp netinet/sctp_pcb.c optional inet sctp netinet/sctp_peeloff.c optional inet sctp +netinet/sctp_ss_functions.c optional inet sctp netinet/sctp_sysctl.c optional inet sctp netinet/sctp_timer.c optional inet sctp netinet/sctp_usrreq.c optional inet sctp Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 18:43:04 2012 (r231395) @@ -158,6 +158,9 @@ struct sctp_paramhdr { #define SCTP_CMT_USE_DAC 0x00001201 /* JRS - Pluggable Congestion Control Socket option */ #define SCTP_PLUGGABLE_CC 0x00001202 +/* RS - Pluggable Stream Scheduling Socket option */ +#define SCTP_PLUGGABLE_SS 0x00001203 +#define SCTP_SS_VALUE 0x00001204 /* read only */ #define SCTP_GET_SNDBUF_USE 0x00001101 @@ -253,6 +256,22 @@ struct sctp_paramhdr { /* HTCP Congestion Control */ #define SCTP_CC_HTCP 0x00000002 +/* RS - Supported stream scheduling modules for pluggable + * stream scheduling + */ +/* Default simple round-robin */ +#define SCTP_SS_DEFAULT 0x00000000 +/* Real round-robin */ +#define SCTP_SS_ROUND_ROBIN 0x00000001 +/* Real round-robin per packet */ +#define SCTP_SS_ROUND_ROBIN_PACKET 0x00000002 +/* Priority */ +#define SCTP_SS_PRIORITY 0x00000003 +/* Fair Bandwidth */ +#define SCTP_SS_FAIR_BANDWITH 0x00000004 +/* First-come, first-serve */ +#define SCTP_SS_FIRST_COME 0x00000005 + /* fragment interleave constants * setting must be one of these or Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 18:43:04 2012 (r231395) @@ -193,8 +193,8 @@ int sctp_is_there_unsent_data(struct sctp_tcb *stcb) { int unsent_data = 0; - struct sctp_stream_queue_pending *sp, *nsp; - struct sctp_stream_out *strq; + unsigned int i; + struct sctp_stream_queue_pending *sp; struct sctp_association *asoc; /* @@ -205,9 +205,14 @@ sctp_is_there_unsent_data(struct sctp_tc */ asoc = &stcb->asoc; SCTP_TCB_SEND_LOCK(stcb); - TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) { - /* sa_ignore FREED_MEMORY */ - TAILQ_FOREACH_SAFE(sp, &strq->outqueue, next, nsp) { + if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + /* Check to see if some data queued */ + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + /* sa_ignore FREED_MEMORY */ + sp = TAILQ_FIRST(&stcb->asoc.strmout[i].outqueue); + if (sp == NULL) { + continue; + } if ((sp->msg_is_complete) && (sp->length == 0) && (sp->sender_all_done)) { @@ -224,8 +229,8 @@ sctp_is_there_unsent_data(struct sctp_tc sp->msg_is_complete, sp->put_last_out); } - atomic_subtract_int(&asoc->stream_queue_cnt, 1); - TAILQ_REMOVE(&strq->outqueue, sp, next); + atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); + TAILQ_REMOVE(&stcb->asoc.strmout[i].outqueue, sp, next); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -957,7 +962,7 @@ sctp_handle_shutdown_ack(struct sctp_shu /* are the queues empty? */ if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || - !TAILQ_EMPTY(&asoc->out_wheel)) { + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); } /* stop the timer */ @@ -3033,7 +3038,7 @@ sctp_handle_shutdown_complete(struct sct /* are the queues empty? they should be */ if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || - !TAILQ_EMPTY(&asoc->out_wheel)) { + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); } } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:43:04 2012 (r231395) @@ -5616,52 +5616,6 @@ do_a_abort: } -void -sctp_insert_on_wheel(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_stream_out *strq, int holds_lock) -{ - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - if ((strq->next_spoke.tqe_next == NULL) && - (strq->next_spoke.tqe_prev == NULL)) { - TAILQ_INSERT_TAIL(&asoc->out_wheel, strq, next_spoke); - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } -} - -void -sctp_remove_from_wheel(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_stream_out *strq, - int holds_lock) -{ - /* take off and then setup so we know it is not on the wheel */ - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - if (TAILQ_EMPTY(&strq->outqueue)) { - if (asoc->last_out_stream == strq) { - asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, next_spoke); - if (asoc->last_out_stream == NULL) { - asoc->last_out_stream = TAILQ_LAST(&asoc->out_wheel, sctpwheel_listhead); - } - if (asoc->last_out_stream == strq) { - asoc->last_out_stream = NULL; - } - } - TAILQ_REMOVE(&asoc->out_wheel, strq, next_spoke); - strq->next_spoke.tqe_next = NULL; - strq->next_spoke.tqe_prev = NULL; - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } -} - static void sctp_prune_prsctp(struct sctp_tcb *stcb, struct sctp_association *asoc, @@ -5924,11 +5878,7 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->strseq = strm->next_sequence_sent; strm->next_sequence_sent++; } - if ((strm->next_spoke.tqe_next == NULL) && - (strm->next_spoke.tqe_prev == NULL)) { - /* Not on wheel, insert */ - sctp_insert_on_wheel(stcb, &stcb->asoc, strm, 1); - } + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp, 1); m = NULL; SCTP_TCB_SEND_UNLOCK(stcb); out_now: @@ -6743,6 +6693,7 @@ one_more_time: } atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7152,6 +7103,7 @@ dont_do_it: send_lock_up = 1; } TAILQ_REMOVE(&strq->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7181,24 +7133,6 @@ out_of: } -static struct sctp_stream_out * -sctp_select_a_stream(struct sctp_tcb *stcb, struct sctp_association *asoc) -{ - struct sctp_stream_out *strq; - - /* Find the next stream to use */ - if (asoc->last_out_stream == NULL) { - strq = TAILQ_FIRST(&asoc->out_wheel); - } else { - strq = TAILQ_NEXT(asoc->last_out_stream, next_spoke); - if (strq == NULL) { - strq = TAILQ_FIRST(&asoc->out_wheel); - } - } - return (strq); -} - - static void sctp_fill_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now) @@ -7207,7 +7141,6 @@ sctp_fill_outqueue(struct sctp_tcb *stcb struct sctp_stream_out *strq, *strqn; int goal_mtu, moved_how_much, total_moved = 0, bail = 0; int locked, giveup; - struct sctp_stream_queue_pending *sp; SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; @@ -7231,46 +7164,17 @@ sctp_fill_outqueue(struct sctp_tcb *stcb strq = asoc->locked_on_sending; locked = 1; } else { - strq = sctp_select_a_stream(stcb, asoc); + strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); locked = 0; } strqn = strq; while ((goal_mtu > 0) && strq) { - sp = TAILQ_FIRST(&strq->outqueue); - if (sp == NULL) { - break; - } - /** - * Honor the users' choice if given. If not given, - * pull it only to the primary path in case of not using - * CMT. - */ - if (((sp->net != NULL) && - (sp->net != net)) || - ((sp->net == NULL) && - (asoc->sctp_cmt_on_off == 0) && - (asoc->primary_destination != net))) { - /* Do not pull to this network */ - if (locked) { - break; - } else { - strq = sctp_select_a_stream(stcb, asoc); - if (strq == NULL) - /* none left */ - break; - if (strqn == strq) { - /* I have circled */ - break; - } - continue; - } - } giveup = 0; bail = 0; moved_how_much = sctp_move_to_outqueue(stcb, strq, goal_mtu, frag_point, &locked, &giveup, eeor_mode, &bail); if (moved_how_much) - asoc->last_out_stream = strq; + stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, moved_how_much); if (locked) { asoc->locked_on_sending = strq; @@ -7279,23 +7183,10 @@ sctp_fill_outqueue(struct sctp_tcb *stcb break; } else { asoc->locked_on_sending = NULL; - if (TAILQ_EMPTY(&strq->outqueue)) { - if (strq == strqn) { - /* Must move start to next one */ - strqn = TAILQ_NEXT(strq, next_spoke); - if (strqn == NULL) { - strqn = TAILQ_FIRST(&asoc->out_wheel); - if (strqn == NULL) { - break; - } - } - } - sctp_remove_from_wheel(stcb, asoc, strq, 0); - } if ((giveup) || bail) { break; } - strq = sctp_select_a_stream(stcb, asoc); + strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); if (strq == NULL) { break; } @@ -7307,6 +7198,8 @@ sctp_fill_outqueue(struct sctp_tcb *stcb if (bail) *quit_now = 1; + stcb->asoc.ss_functions.sctp_ss_packet_done(stcb, net, asoc); + if (total_moved == 0) { if ((stcb->asoc.sctp_cmt_on_off == 0) && (net == stcb->asoc.primary_destination)) { @@ -7335,16 +7228,16 @@ void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net) { struct sctp_association *asoc; - struct sctp_stream_out *outs; struct sctp_tmit_chunk *chk; struct sctp_stream_queue_pending *sp; + unsigned int i; if (net == NULL) { return; } asoc = &stcb->asoc; - TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) { - TAILQ_FOREACH(sp, &outs->outqueue, next) { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + TAILQ_FOREACH(sp, &stcb->asoc.strmout[i].outqueue, next) { if (sp->net == net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7437,7 +7330,7 @@ sctp_med_chunk_output(struct sctp_inpcb if (TAILQ_EMPTY(&asoc->control_send_queue) && TAILQ_EMPTY(&asoc->asconf_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && - TAILQ_EMPTY(&asoc->out_wheel)) { + stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { *reason_code = 9; return (0); } @@ -7454,7 +7347,8 @@ sctp_med_chunk_output(struct sctp_inpcb max_send_per_dest = SCTP_SB_LIMIT_SND(stcb->sctp_socket) / asoc->numnets; else max_send_per_dest = 0; - if ((no_data_chunks == 0) && (!TAILQ_EMPTY(&asoc->out_wheel))) { + if ((no_data_chunks == 0) && + (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc))) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { /* * This for loop we are in takes in each net, if @@ -9638,7 +9532,7 @@ sctp_chunk_output(struct sctp_inpcb *inp } if (TAILQ_EMPTY(&asoc->control_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && - TAILQ_EMPTY(&asoc->out_wheel)) { + stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { /* Nothing left to send */ break; } @@ -12447,8 +12341,7 @@ sctp_lower_sosend(struct socket *so, TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; - asoc->strmout[i].next_spoke.tqe_next = 0; - asoc->strmout[i].next_spoke.tqe_prev = 0; + asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i]); } } } @@ -12841,11 +12734,7 @@ skip_preblock: SCTP_STAT_INCR(sctps_sends_with_unord); } TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); - if ((strm->next_spoke.tqe_next == NULL) && - (strm->next_spoke.tqe_prev == NULL)) { - /* Not on wheel, insert */ - sctp_insert_on_wheel(stcb, asoc, strm, 1); - } + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, asoc, strm, sp, 1); SCTP_TCB_SEND_UNLOCK(stcb); } else { SCTP_TCB_SEND_LOCK(stcb); Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 18:43:04 2012 (r231395) @@ -135,11 +135,6 @@ int sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int); -void -sctp_insert_on_wheel(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_stream_out *strq, int holdslock); - void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 18:43:04 2012 (r231395) @@ -2517,6 +2517,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_sws_receiver = SCTP_SWS_RECEIVER_DEF; m->max_burst = SCTP_BASE_SYSCTL(sctp_max_burst_default); m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); + m->sctp_default_ss_module = SCTP_BASE_SYSCTL(sctp_default_ss_module); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 18:31:35 2012 (r231394) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 18:43:04 2012 (r231395) @@ -276,6 +276,7 @@ struct sctp_pcb { uint32_t sctp_sws_receiver; uint32_t sctp_default_cc_module; + uint32_t sctp_default_ss_module; /* authentication related fields */ struct sctp_keyhead shared_keys; sctp_auth_chklist_t *local_auth_chunks; Copied: stable/8/sys/netinet/sctp_ss_functions.c (from r217760, head/sys/netinet/sctp_ss_functions.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 18:43:04 2012 (r231395, copy of r217760, head/sys/netinet/sctp_ss_functions.c) @@ -0,0 +1,914 @@ +/*- + * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * a) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * b) Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * c) Neither the name of Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +/* + * Default simple round-robin algorithm. + * Just interates the streams in the order they appear. + */ + +static void +sctp_ss_default_add(struct sctp_tcb *, struct sctp_association *, + struct sctp_stream_out *, + struct sctp_stream_queue_pending *, int); + +static void +sctp_ss_default_remove(struct sctp_tcb *, struct sctp_association *, + struct sctp_stream_out *, + struct sctp_stream_queue_pending *, int); + +static void +sctp_ss_default_init(struct sctp_tcb *stcb, struct sctp_association *asoc, + int holds_lock) +{ + uint16_t i; + + TAILQ_INIT(&asoc->ss_data.out_wheel); + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + sctp_ss_default_add(stcb, &stcb->asoc, + &stcb->asoc.strmout[i], + NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_default_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, + int clear_values, int holds_lock) +{ + uint16_t i; + + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + sctp_ss_default_remove(stcb, &stcb->asoc, + &stcb->asoc.strmout[i], + NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_default_init_stream(struct sctp_stream_out *strq) +{ + strq->ss_params.rr.next_spoke.tqe_next = NULL; + strq->ss_params.rr.next_spoke.tqe_prev = NULL; + return; +} + +static void +sctp_ss_default_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, + strq, ss_params.rr.next_spoke); + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static int +sctp_ss_default_is_empty(struct sctp_tcb *stcb, struct sctp_association *asoc) +{ + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + return (1); + } else { + return (0); + } +} + +static void +sctp_ss_default_remove(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + /* take off and then setup so we know it is not on the wheel */ + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if (TAILQ_EMPTY(&strq->outqueue)) { + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, + sctpwheel_listhead, + ss_params.rr.next_spoke); + if (asoc->last_out_stream == NULL) { + asoc->last_out_stream = TAILQ_LAST(&asoc->ss_data.out_wheel, + sctpwheel_listhead); + } + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = NULL; + } + } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + strq->ss_params.rr.next_spoke.tqe_next = NULL; + strq->ss_params.rr.next_spoke.tqe_prev = NULL; + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + + +static struct sctp_stream_out * +sctp_ss_default_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt; + + strqt = asoc->last_out_stream; +default_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if (net != NULL && strq != NULL && + SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (TAILQ_FIRST(&strq->outqueue) && + TAILQ_FIRST(&strq->outqueue)->net != NULL && + TAILQ_FIRST(&strq->outqueue)->net != net) { + if (strq == asoc->last_out_stream) { + return (NULL); + } else { + strqt = strq; + goto default_again; + } + } + } + return (strq); +} + +static void +sctp_ss_default_scheduled(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc, + struct sctp_stream_out *strq, int moved_how_much) +{ + asoc->last_out_stream = strq; + return; +} + +static void +sctp_ss_default_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + /* Nothing to be done here */ + return; +} + +static int +sctp_ss_default_get_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t * value) +{ + /* Nothing to be done here */ + return (-1); +} + +static int +sctp_ss_default_set_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t value) +{ + /* Nothing to be done here */ + return (-1); +} + +/* + * Real round-robin algorithm. + * Always interates the streams in ascending order. + */ +static void +sctp_ss_rr_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + struct sctp_stream_out *strqt; + + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } else { + strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); + while (strqt != NULL && (strqt->stream_no < strq->stream_no)) { + strqt = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + } + if (strqt != NULL) { + TAILQ_INSERT_BEFORE(strqt, strq, ss_params.rr.next_spoke); + } else { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } + } + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +/* + * Real round-robin per packet algorithm. + * Always interates the streams in ascending order and + * only fills messages of the same stream in a packet. + */ +static void +sctp_ss_rrp_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + struct sctp_stream_out *strqt; + + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { + + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } else { + strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); + while (strqt != NULL && strqt->stream_no < strq->stream_no) { + strqt = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + } + if (strqt != NULL) { + TAILQ_INSERT_BEFORE(strqt, strq, ss_params.rr.next_spoke); + } else { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } + } + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static struct sctp_stream_out * +sctp_ss_rrp_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt; + + strqt = asoc->last_out_stream; + if (strqt != NULL && !TAILQ_EMPTY(&strqt->outqueue)) { + return (strqt); + } +rrp_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if (net != NULL && strq != NULL && + SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (TAILQ_FIRST(&strq->outqueue) && + TAILQ_FIRST(&strq->outqueue)->net != NULL && + TAILQ_FIRST(&strq->outqueue)->net != net) { + if (strq == asoc->last_out_stream) { + return (NULL); + } else { + strqt = strq; + goto rrp_again; + } + } + } + return (strq); +} + +static void +sctp_ss_rrp_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt; + + strqt = asoc->last_out_stream; +rrp_pd_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if ((strq != NULL) && TAILQ_FIRST(&strq->outqueue) && + (net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) && + (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { + if (strq == asoc->last_out_stream) { + strq = NULL; + } else { + strqt = strq; + goto rrp_pd_again; + } + } + asoc->last_out_stream = strq; + return; +} + + +/* + * Priority algorithm. + * Always prefers streams based on their priority id. + */ +static void +sctp_ss_prio_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, + int clear_values, int holds_lock) +{ + uint16_t i; + + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + if (clear_values) + stcb->asoc.strmout[i].ss_params.prio.priority = 0; + sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_prio_init_stream(struct sctp_stream_out *strq) +{ + strq->ss_params.prio.next_spoke.tqe_next = NULL; + strq->ss_params.prio.next_spoke.tqe_prev = NULL; + strq->ss_params.prio.priority = 0; + return; +} + +static void +sctp_ss_prio_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, + int holds_lock) +{ + struct sctp_stream_out *strqt; + + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.prio.next_spoke.tqe_next == NULL) && + (strq->ss_params.prio.next_spoke.tqe_prev == NULL)) { + + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); + } else { + strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); + while (strqt != NULL && strqt->ss_params.prio.priority < strq->ss_params.prio.priority) { + strqt = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + } + if (strqt != NULL) { + TAILQ_INSERT_BEFORE(strqt, strq, ss_params.prio.next_spoke); + } else { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); + } + } + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static void +sctp_ss_prio_remove(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, + int holds_lock) +{ + /* take off and then setup so we know it is not on the wheel */ + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if (TAILQ_EMPTY(&strq->outqueue)) { + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, + ss_params.prio.next_spoke); + if (asoc->last_out_stream == NULL) { + asoc->last_out_stream = TAILQ_LAST(&asoc->ss_data.out_wheel, + sctpwheel_listhead); + } + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = NULL; + } + } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + strq->ss_params.prio.next_spoke.tqe_next = NULL; + strq->ss_params.prio.next_spoke.tqe_prev = NULL; + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static struct sctp_stream_out * +sctp_ss_prio_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt, *strqn; + + strqt = asoc->last_out_stream; +prio_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strqn = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + if (strqn != NULL && + strqn->ss_params.prio.priority == strqt->ss_params.prio.priority) { + strq = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + } else { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if (net != NULL && strq != NULL && + SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (TAILQ_FIRST(&strq->outqueue) && + TAILQ_FIRST(&strq->outqueue)->net != NULL && + TAILQ_FIRST(&strq->outqueue)->net != net) { + if (strq == asoc->last_out_stream) { + return (NULL); + } else { + strqt = strq; + goto prio_again; + } + } + } + return (strq); +} + +static int +sctp_ss_prio_get_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t * value) +{ + if (strq == NULL) { + return (-1); + } + *value = strq->ss_params.prio.priority; + return (1); +} + +static int +sctp_ss_prio_set_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t value) +{ + if (strq == NULL) { + return (-1); + } + strq->ss_params.prio.priority = value; + sctp_ss_prio_remove(stcb, asoc, strq, NULL, 1); + sctp_ss_prio_add(stcb, asoc, strq, NULL, 1); + return (1); +} + +/* + * Fair bandwidth algorithm. + * Maintains an equal troughput per stream. + */ +static void +sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, + int clear_values, int holds_lock) +{ + uint16_t i; + + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + if (clear_values) { + stcb->asoc.strmout[i].ss_params.fb.rounds = -1; + } + sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_fb_init_stream(struct sctp_stream_out *strq) +{ + strq->ss_params.fb.next_spoke.tqe_next = NULL; + strq->ss_params.fb.next_spoke.tqe_prev = NULL; + strq->ss_params.fb.rounds = -1; + return; +} + +static void +sctp_ss_fb_add(struct sctp_tcb *stcb, struct sctp_association *asoc, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 18:49:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 910AB1065672; Fri, 10 Feb 2012 18:49:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79FAD8FC13; Fri, 10 Feb 2012 18:49:29 +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 q1AInTws088070; Fri, 10 Feb 2012 18:49:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AInTa3088063; Fri, 10 Feb 2012 18:49:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101849.q1AInTa3088063@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231396 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:49:29 -0000 Author: tuexen Date: Fri Feb 10 18:49:28 2012 New Revision: 231396 URL: http://svn.freebsd.org/changeset/base/231396 Log: MFC r217894: Change infrastructure for SCTP_MAX_BURST to allow compliance with the latest socket API ID. Especially it can be disabled. Full compliance needs changing the structure used in the socket option. Since this breaks the API, it will be a seperate commit which will not be MFCed to stable/8. Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 18:49:28 2012 (r231396) @@ -601,8 +601,11 @@ sctp_cwnd_update_after_packet_dropped(st * Take 1/4 of the space left or max burst up .. whichever * is less. */ - incr = min((bw_avail - *on_queue) >> 2, - stcb->asoc.max_burst * net->mtu); + incr = (bw_avail - *on_queue) >> 2; + if ((stcb->asoc.max_burst > 0) && + (stcb->asoc.max_burst * net->mtu < incr)) { + incr = stcb->asoc.max_burst * net->mtu; + } net->cwnd += incr; } if (net->cwnd > bw_avail) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:49:28 2012 (r231396) @@ -9322,7 +9322,7 @@ sctp_chunk_output(struct sctp_inpcb *inp struct sctp_association *asoc; struct sctp_nets *net; int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0, - burst_cnt = 0, burst_limit = 0; + burst_cnt = 0; struct timeval now; int now_filled = 0; int nagle_on = 0; @@ -9425,12 +9425,11 @@ sctp_chunk_output(struct sctp_inpcb *inp &now, &now_filled, frag_point, so_locked); return; } - if (tot_frs > asoc->max_burst) { + if ((asoc->max_burst > 0) && (tot_frs > asoc->max_burst)) { /* Hit FR burst limit */ return; } if ((num_out == 0) && (ret == 0)) { - /* No more retrans to send */ break; } @@ -9439,7 +9438,6 @@ sctp_chunk_output(struct sctp_inpcb *inp sctp_auditing(12, inp, stcb, NULL); #endif /* Check for bad destinations, if they exist move chunks around. */ - burst_limit = asoc->max_burst; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == SCTP_ADDR_NOT_REACHABLE) { @@ -9468,24 +9466,29 @@ sctp_chunk_output(struct sctp_inpcb *inp * { burst_limit = asoc->max_burst * * SCTP_SAT_NETWORK_BURST_INCR; } */ - if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) { - if ((net->flight_size + (burst_limit * net->mtu)) < net->cwnd) { - /* - * JRS - Use the congestion control - * given in the congestion control - * module - */ - asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, burst_limit); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { - sctp_log_maxburst(stcb, net, 0, burst_limit, SCTP_MAX_BURST_APPLIED); + if (asoc->max_burst > 0) { + if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) { + if ((net->flight_size + (asoc->max_burst * net->mtu)) < net->cwnd) { + /* + * JRS - Use the congestion + * control given in the + * congestion control module + */ + asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, asoc->max_burst); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { + sctp_log_maxburst(stcb, net, 0, asoc->max_burst, SCTP_MAX_BURST_APPLIED); + } + SCTP_STAT_INCR(sctps_maxburstqueued); + } + net->fast_retran_ip = 0; + } else { + if (net->flight_size == 0) { + /* + * Should be decaying the + * cwnd here + */ + ; } - SCTP_STAT_INCR(sctps_maxburstqueued); - } - net->fast_retran_ip = 0; - } else { - if (net->flight_size == 0) { - /* Should be decaying the cwnd here */ - ; } } } @@ -9540,11 +9543,13 @@ sctp_chunk_output(struct sctp_inpcb *inp /* Nothing left to send */ break; } - } while (num_out && (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) || - (burst_cnt < burst_limit))); + } while (num_out && + ((asoc->max_burst == 0) || + SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) || + (burst_cnt < asoc->max_burst))); if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) == 0) { - if (burst_cnt >= burst_limit) { + if ((asoc->max_burst > 0) && (burst_cnt >= asoc->max_burst)) { SCTP_STAT_INCR(sctps_maxburstqueued); asoc->burst_limit_applied = 1; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 18:49:28 2012 (r231396) @@ -317,7 +317,7 @@ struct sctp_pcb { uint32_t initial_sequence_debug; uint32_t adaptation_layer_indicator; uint32_t store_at; - uint8_t max_burst; + uint32_t max_burst; char current_secret_number; char last_secret_number; }; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:49:28 2012 (r231396) @@ -1058,7 +1058,7 @@ struct sctp_association { uint8_t send_sack; /* max burst after fast retransmit completes */ - uint8_t max_burst; + uint32_t max_burst; uint8_t sat_network; /* RTT is in range of sat net or greater */ uint8_t sat_network_lockout; /* lockout code */ Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 18:49:28 2012 (r231396) @@ -184,7 +184,7 @@ struct sctp_sysctl { /* maxburst: Default max burst for sctp endpoints */ #define SCTPCTL_MAXBURST_DESC "Default max burst for sctp endpoints" -#define SCTPCTL_MAXBURST_MIN 1 +#define SCTPCTL_MAXBURST_MIN 0 #define SCTPCTL_MAXBURST_MAX 0xFFFFFFFF #define SCTPCTL_MAXBURST_DEFAULT SCTP_DEF_MAX_BURST Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 18:43:04 2012 (r231395) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 18:49:28 2012 (r231396) @@ -1972,7 +1972,11 @@ flags_out: SCTP_CHECK_AND_CAST(value, optval, uint8_t, *optsize); SCTP_INP_RLOCK(inp); - *value = inp->sctp_ep.max_burst; + if (inp->sctp_ep.max_burst < 256) { + *value = inp->sctp_ep.max_burst; + } else { + *value = 255; + } SCTP_INP_RUNLOCK(inp); *optsize = sizeof(uint8_t); } @@ -3591,9 +3595,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(burst, optval, uint8_t, optsize); SCTP_INP_WLOCK(inp); - if (*burst) { - inp->sctp_ep.max_burst = *burst; - } + inp->sctp_ep.max_burst = *burst; SCTP_INP_WUNLOCK(inp); } break; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 18:53:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A53A106564A; Fri, 10 Feb 2012 18:53:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43D788FC0C; Fri, 10 Feb 2012 18:53: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 q1AIrepE088245; Fri, 10 Feb 2012 18:53:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIreuY088243; Fri, 10 Feb 2012 18:53:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101853.q1AIreuY088243@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:53:40 +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: r231397 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:53:40 -0000 Author: tuexen Date: Fri Feb 10 18:53:39 2012 New Revision: 231397 URL: http://svn.freebsd.org/changeset/base/231397 Log: MFC r217913: * Use 300 ms as the default for RTO_MIN. * Disable burst mitigation by default. * Remove unused constant. Discussed with rrs. Modified: stable/8/sys/netinet/sctp_constants.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 18:49:28 2012 (r231396) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 18:53:39 2012 (r231397) @@ -343,8 +343,8 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_NO_FR_UNLESS_SEGMENT_SMALLER 1 -/* default max I can burst out after a fast retransmit */ -#define SCTP_DEF_MAX_BURST 4 +/* default max I can burst out after a fast retransmit, 0 disables it */ +#define SCTP_DEF_MAX_BURST 0 /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ #define SCTP_FIRST_MBUF_RESV 68 /* Packet transmit states in the sent field */ @@ -642,8 +642,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEFAULT_SECRET_LIFE_SEC 3600 #define SCTP_RTO_UPPER_BOUND (60000) /* 60 sec in ms */ -#define SCTP_RTO_UPPER_BOUND_SEC 60 /* for the init timer */ -#define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec in ms */ +#define SCTP_RTO_LOWER_BOUND (300) /* 0.3 sec is ms */ #define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 18:55:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05CCD106564A; Fri, 10 Feb 2012 18:55:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAB3D8FC13; Fri, 10 Feb 2012 18:55:50 +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 q1AItoBg088370; Fri, 10 Feb 2012 18:55:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AItoxl088367; Fri, 10 Feb 2012 18:55:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101855.q1AItoxl088367@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:55:50 +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: r231398 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:55:51 -0000 Author: tuexen Date: Fri Feb 10 18:55:50 2012 New Revision: 231398 URL: http://svn.freebsd.org/changeset/base/231398 Log: MFC r218037: Fix a bug in the way ECN-Echo chunk sends were being accounted for. The counting was such that we counted only when we queued a chunk, not when we sent it. Now keep an additional counter for queuing and one for sending. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:53:39 2012 (r231397) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:55:50 2012 (r231398) @@ -7809,6 +7809,20 @@ again_one_more_time: if (chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) { cookie = 1; no_out_cnt = 1; + } else if (chk->rec.chunk_id.id == SCTP_ECN_ECHO) { + /* + * Increment ecne send count + * here this means we may be + * over-zealous in our + * counting if the send + * fails, but its the best + * place to do it (we used + * to do it in the queue of + * the chunk, but that did + * not tell how many times + * it was sent. + */ + SCTP_STAT_INCR(sctps_sendecne); } chk->sent = SCTP_DATAGRAM_SENT; chk->snd_count++; @@ -10751,6 +10765,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb /* found a previous ECN_ECHO update it if needed */ ecne = mtod(chk->data, struct sctp_ecne_chunk *); ecne->tsn = htonl(high_tsn); + SCTP_STAT_INCR(sctps_queue_upd_ecne); return; } } @@ -10760,7 +10775,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb return; } chk->copy_by_ref = 0; - SCTP_STAT_INCR(sctps_sendecne); + SCTP_STAT_INCR(sctps_queue_upd_ecne); chk->rec.chunk_id.id = SCTP_ECN_ECHO; chk->rec.chunk_id.can_take_data = 0; chk->asoc = &stcb->asoc; Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 18:53:39 2012 (r231397) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 18:55:50 2012 (r231398) @@ -946,8 +946,9 @@ struct sctpstat { * max burst inflight to net */ uint32_t sctps_fwdtsn_map_over; /* number of map array over-runs via * fwd-tsn's */ - - uint32_t sctps_reserved[32]; /* Future ABI compat - remove int's + uint32_t sctps_queue_upd_ecne; /* Number of times we queued or + * updated an ECN chunk on send queue */ + uint32_t sctps_reserved[31]; /* Future ABI compat - remove int's * from here when adding new */ }; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 18:58:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CAE6106564A; Fri, 10 Feb 2012 18:58:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 168548FC0C; Fri, 10 Feb 2012 18:58:37 +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 q1AIwa0Q088507; Fri, 10 Feb 2012 18:58:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AIwaSd088504; Fri, 10 Feb 2012 18:58:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101858.q1AIwaSd088504@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 18:58:36 +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: r231399 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 18:58:37 -0000 Author: tuexen Date: Fri Feb 10 18:58:36 2012 New Revision: 231399 URL: http://svn.freebsd.org/changeset/base/231399 Log: MFC r218039: Keep track of the real last RTT on each net. This will be used for Data Center congestion control, we won't want to engage it in the ECN code unless we KNOW that the RTT is less than 500us. From rrs@ Modified: stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:55:50 2012 (r231398) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:58:36 2012 (r231399) @@ -266,7 +266,7 @@ struct sctp_nets { uint32_t tos_flowlabel; struct timeval start_time; /* time when this net was created */ - + struct timeval last_measured_rtt; uint32_t marked_retrans;/* number or DATA chunks marked for timer * based retransmissions */ uint32_t marked_fastretrans; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 18:55:50 2012 (r231398) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 18:58:36 2012 (r231399) @@ -2500,6 +2500,13 @@ sctp_calculate_rto(struct sctp_tcb *stcb /************************/ /* get the current time */ (void)SCTP_GETTIME_TIMEVAL(&now); + + /* + * Record the real time of the last RTT for use in DC-CC. + */ + net->last_measured_rtt = now; + timevalsub(&net->last_measured_rtt, old); + /* compute the RTT value */ if ((u_long)now.tv_sec > (u_long)old->tv_sec) { calc_time = ((u_long)now.tv_sec - (u_long)old->tv_sec) * 1000; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:02:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53B44106566C; Fri, 10 Feb 2012 19:02:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C7318FC16; Fri, 10 Feb 2012 19:02:08 +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 q1AJ28Bg088685; Fri, 10 Feb 2012 19:02:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJ27cG088675; Fri, 10 Feb 2012 19:02:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101902.q1AJ27cG088675@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:02: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: r231400 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:02:08 -0000 Author: tuexen Date: Fri Feb 10 19:02:07 2012 New Revision: 231400 URL: http://svn.freebsd.org/changeset/base/231400 Log: MFC r218072: Fixes to ECN in SCTP. 1) ECN was on an association basis, this is incorrect and will not work with CMT or for that matter if the user is sending to multiple addresses. This commit makes ECN on a per path basis. 2) Adopt the new format for the ECN internet draft. This also maintains compatability with old format chunks as well. 3) Keep track of the real time of a RTT down to micro seconds. For some future conditional features (for like a data center this is good information to have). From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 19:02:07 2012 (r231400) @@ -417,6 +417,10 @@ struct sctp_error_unrecognized_chunk { #define SCTP_BADCRC 0x02 #define SCTP_PACKET_TRUNCATED 0x04 +/* Flag for ECN -CWR */ +#define SCTP_CWR_REDUCE_OVERRIDE 0x01 +#define SCTP_CWR_IN_SAME_WINDOW 0x02 + #define SCTP_SAT_NETWORK_MIN 400 /* min ms for RTT to set satellite * time */ #define SCTP_SAT_NETWORK_BURST_INCR 2 /* how many times to multiply maxburst Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:02:07 2012 (r231400) @@ -360,9 +360,15 @@ struct sctp_cookie_ack_chunk { } SCTP_PACKED; /* Explicit Congestion Notification Echo (ECNE) */ +struct old_sctp_ecne_chunk { + struct sctp_chunkhdr ch; + uint32_t tsn; +} SCTP_PACKED; + struct sctp_ecne_chunk { struct sctp_chunkhdr ch; uint32_t tsn; + uint32_t num_pkts_since_cwr; } SCTP_PACKED; /* Congestion Window Reduced (CWR) */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:02:07 2012 (r231400) @@ -3829,6 +3829,10 @@ sctp_express_handle_sack(struct sctp_tcb } /* First setup for CC stuff */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (SCTP_TSN_GT(cumack, net->cwr_window_tsn)) { + /* Drag along the window_tsn for cwr's */ + net->cwr_window_tsn = cumack; + } net->prev_cwnd = net->cwnd; net->net_ack = 0; net->net_ack2 = 0; @@ -4522,6 +4526,10 @@ sctp_handle_sack(struct mbuf *m, int off * destination address basis. */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (SCTP_TSN_GT(cum_ack, net->cwr_window_tsn)) { + /* Drag along the window_tsn for cwr's */ + net->cwr_window_tsn = cum_ack; + } net->prev_cwnd = net->cwnd; net->net_ack = 0; net->net_ack2 = 0; Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:02:07 2012 (r231400) @@ -1678,8 +1678,6 @@ sctp_process_cookie_existing(struct mbuf asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); - /* Note last_cwr_tsn? where is this used? */ - asoc->last_cwr_tsn = asoc->init_seq_number - 1; if (ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) { /* * Ok the peer probably discarded our data (if we @@ -1835,7 +1833,6 @@ sctp_process_cookie_existing(struct mbuf asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number; asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1; - asoc->last_cwr_tsn = asoc->init_seq_number - 1; asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1; asoc->str_reset_seq_in = asoc->init_seq_number; @@ -2073,7 +2070,6 @@ sctp_process_cookie_new(struct mbuf *m, asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn); asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number; asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1; - asoc->last_cwr_tsn = asoc->init_seq_number - 1; asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1; asoc->str_reset_seq_in = asoc->init_seq_number; @@ -2917,25 +2913,38 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch { struct sctp_nets *net; struct sctp_tmit_chunk *lchk; - uint32_t tsn; - - if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_ecne_chunk)) { + struct sctp_ecne_chunk bkup; + uint8_t override_bit = 0; + uint32_t tsn, window_data_tsn; + int len; + int pkt_cnt; + + len = ntohs(cp->ch.chunk_length); + if ((len != sizeof(struct sctp_ecne_chunk)) && + (len != sizeof(struct old_sctp_ecne_chunk))) { return; } + if (len == sizeof(struct old_sctp_ecne_chunk)) { + /* Its the old format */ + memcpy(&bkup, cp, sizeof(struct old_sctp_ecne_chunk)); + bkup.num_pkts_since_cwr = htonl(1); + cp = &bkup; + } SCTP_STAT_INCR(sctps_recvecne); tsn = ntohl(cp->tsn); + pkt_cnt = ntohl(cp->num_pkts_since_cwr); /* ECN Nonce stuff: need a resync and disable the nonce sum check */ /* Also we make sure we disable the nonce_wait */ - lchk = TAILQ_FIRST(&stcb->asoc.send_queue); + lchk = TAILQ_LAST(&stcb->asoc.send_queue, sctpchunk_listhead); if (lchk == NULL) { - stcb->asoc.nonce_resync_tsn = stcb->asoc.sending_seq; + window_data_tsn = stcb->asoc.nonce_resync_tsn = stcb->asoc.sending_seq - 1; } else { - stcb->asoc.nonce_resync_tsn = lchk->rec.data.TSN_seq; + window_data_tsn = stcb->asoc.nonce_resync_tsn = lchk->rec.data.TSN_seq; } stcb->asoc.nonce_wait_for_ecne = 0; stcb->asoc.nonce_sum_check = 0; - /* Find where it was sent, if possible */ + /* Find where it was sent to if possible. */ net = NULL; TAILQ_FOREACH(lchk, &stcb->asoc.sent_queue, sctp_next) { if (lchk->rec.data.TSN_seq == tsn) { @@ -2946,32 +2955,71 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch break; } } - if (net == NULL) - /* default is we use the primary */ - net = stcb->asoc.primary_destination; - - if (SCTP_TSN_GT(tsn, stcb->asoc.last_cwr_tsn)) { + if (net == NULL) { + /* + * What to do. A previous send of a CWR was possibly lost. + * See how old it is, we may have it marked on the actual + * net. + */ + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + if (tsn == net->last_cwr_tsn) { + /* Found him, send it off */ + goto out; + } + } + /* + * If we reach here, we need to send a special CWR that says + * hey, we did this a long time ago and you lost the + * response. + */ + net = TAILQ_FIRST(&stcb->asoc.nets); + override_bit = SCTP_CWR_REDUCE_OVERRIDE; + } +out: + if (SCTP_TSN_GT(tsn, net->cwr_window_tsn)) { /* * JRS - Use the congestion control given in the pluggable * CC module */ + int ocwnd; + + ocwnd = net->cwnd; stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net); /* - * we reduce once every RTT. So we will only lower cwnd at - * the next sending seq i.e. the resync_tsn. + * We reduce once every RTT. So we will only lower cwnd at + * the next sending seq i.e. the window_data_tsn */ - stcb->asoc.last_cwr_tsn = stcb->asoc.nonce_resync_tsn; + net->cwr_window_tsn = window_data_tsn; + net->ecn_ce_pkt_cnt += pkt_cnt; + net->lost_cnt = pkt_cnt; + net->last_cwr_tsn = tsn; + } else { + override_bit |= SCTP_CWR_IN_SAME_WINDOW; + if (SCTP_TSN_GT(tsn, net->last_cwr_tsn)) { + /* + * Another loss in the same window update how man + * marks we have had + */ + + if (pkt_cnt > net->lost_cnt) { + /* Should be the case */ + net->ecn_ce_pkt_cnt += (pkt_cnt - net->lost_cnt); + net->lost_cnt = pkt_cnt; + } + net->last_cwr_tsn = tsn; + } } /* * We always send a CWR this way if our previous one was lost our * peer will get an update, or if it is not time again to reduce we - * still get the cwr to the peer. + * still get the cwr to the peer. Note we set the override when we + * could not find the TSN on the chunk or the destination network. */ - sctp_send_cwr(stcb, net, tsn); + sctp_send_cwr(stcb, net, net->last_cwr_tsn, override_bit); } static void -sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct sctp_tcb *stcb) +sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net) { /* * Here we get a CWR from the peer. We must look in the outqueue and @@ -2980,18 +3028,22 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun */ struct sctp_tmit_chunk *chk; struct sctp_ecne_chunk *ecne; + int override; + uint32_t cwr_tsn; + + cwr_tsn = ntohl(cp->tsn); + override = cp->ch.chunk_flags & SCTP_CWR_REDUCE_OVERRIDE; TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { if (chk->rec.chunk_id.id != SCTP_ECN_ECHO) { continue; } - /* - * Look for and remove if it is the right TSN. Since there - * is only ONE ECNE on the control queue at any one time we - * don't need to worry about more than one! - */ + if ((override == 0) && (chk->whoTo != net)) { + /* Must be from the right src unless override is set */ + continue; + } ecne = mtod(chk->data, struct sctp_ecne_chunk *); - if (SCTP_TSN_GE(ntohl(cp->tsn), ntohl(ecne->tsn))) { + if (SCTP_TSN_GE(cwr_tsn, ntohl(ecne->tsn))) { /* this covers this ECNE, we can remove it */ stcb->asoc.ecn_echo_cnt_onq--; TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, @@ -3002,7 +3054,9 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun } stcb->asoc.ctrl_queue_cnt--; sctp_free_a_chunk(stcb, chk); - break; + if (override == 0) { + break; + } } } } @@ -5043,7 +5097,7 @@ process_control_chunks: __LINE__); } stcb->asoc.overall_error_count = 0; - sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb); + sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp); } break; case SCTP_SHUTDOWN_COMPLETE: Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:02:07 2012 (r231400) @@ -7274,7 +7274,7 @@ sctp_med_chunk_output(struct sctp_inpcb * fomulate and send the low level chunks. Making sure to combine * any control in the control chunk queue also. */ - struct sctp_nets *net, *start_at, *old_start_at = NULL; + struct sctp_nets *net, *start_at, *sack_goes_to = NULL, *old_start_at = NULL; struct mbuf *outchain, *endoutchain; struct sctp_tmit_chunk *chk, *nchk; @@ -7327,10 +7327,12 @@ sctp_med_chunk_output(struct sctp_inpcb no_data_chunks = 0; /* Nothing to possible to send? */ - if (TAILQ_EMPTY(&asoc->control_send_queue) && + if ((TAILQ_EMPTY(&asoc->control_send_queue) || + (asoc->ctrl_queue_cnt == stcb->asoc.ecn_echo_cnt_onq)) && TAILQ_EMPTY(&asoc->asconf_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { +nothing_to_send: *reason_code = 9; return (0); } @@ -7342,6 +7344,21 @@ sctp_med_chunk_output(struct sctp_inpcb no_data_chunks = 1; } } + if (stcb->asoc.ecn_echo_cnt_onq) { + /* Record where a sack goes, if any */ + if (no_data_chunks && + (asoc->ctrl_queue_cnt == stcb->asoc.ecn_echo_cnt_onq)) { + /* Nothing but ECNe to send - we don't do that */ + goto nothing_to_send; + } + TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { + if ((chk->rec.chunk_id.id == SCTP_SELECTIVE_ACK) || + (chk->rec.chunk_id.id == SCTP_NR_SELECTIVE_ACK)) { + sack_goes_to = chk->whoTo; + break; + } + } + } max_rwnd_per_dest = ((asoc->peers_rwnd + asoc->total_flight) / asoc->numnets); if (stcb->sctp_socket) max_send_per_dest = SCTP_SB_LIMIT_SND(stcb->sctp_socket) / asoc->numnets; @@ -7685,6 +7702,28 @@ again_one_more_time: /************************/ /* Now first lets go through the control queue */ TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) { + if ((sack_goes_to) && + (chk->rec.chunk_id.id == SCTP_ECN_ECHO) && + (chk->whoTo != sack_goes_to)) { + /* + * if we have a sack in queue, and we are + * looking at an ecn echo that is NOT queued + * to where the sack is going.. + */ + if (chk->whoTo == net) { + /* + * Don't transmit it to where its + * going (current net) + */ + continue; + } else if (sack_goes_to == net) { + /* + * But do transmit it to this + * address + */ + goto skip_net_check; + } + } if (chk->whoTo != net) { /* * No, not sent to the network we are @@ -7692,6 +7731,7 @@ again_one_more_time: */ continue; } + skip_net_check: if (chk->data == NULL) { continue; } @@ -10761,11 +10801,19 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { - if (chk->rec.chunk_id.id == SCTP_ECN_ECHO) { + if ((chk->rec.chunk_id.id == SCTP_ECN_ECHO) && (net == chk->whoTo)) { /* found a previous ECN_ECHO update it if needed */ + uint32_t cnt, ctsn; + ecne = mtod(chk->data, struct sctp_ecne_chunk *); - ecne->tsn = htonl(high_tsn); - SCTP_STAT_INCR(sctps_queue_upd_ecne); + ctsn = ntohl(ecne->tsn); + if (SCTP_TSN_GT(high_tsn, ctsn)) { + ecne->tsn = htonl(high_tsn); + cnt = ntohl(ecne->num_pkts_since_cwr); + cnt++; + ecne->num_pkts_since_cwr = htonl(cnt); + SCTP_STAT_INCR(sctps_queue_upd_ecne); + } return; } } @@ -10797,7 +10845,8 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb ecne->ch.chunk_flags = 0; ecne->ch.chunk_length = htons(sizeof(struct sctp_ecne_chunk)); ecne->tsn = htonl(high_tsn); - TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); + ecne->num_pkts_since_cwr = htonl(1); + TAILQ_INSERT_HEAD(&stcb->asoc.control_send_queue, chk, sctp_next); asoc->ctrl_queue_cnt++; } @@ -10975,7 +11024,7 @@ jump_out: } void -sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn) +sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, uint8_t override) { struct sctp_association *asoc; struct sctp_cwr_chunk *cwr; @@ -10983,17 +11032,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); - TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { - if (chk->rec.chunk_id.id == SCTP_ECN_CWR) { - /* found a previous ECN_CWR update it if needed */ - cwr = mtod(chk->data, struct sctp_cwr_chunk *); - if (SCTP_TSN_GT(high_tsn, ntohl(cwr->tsn))) { - cwr->tsn = htonl(high_tsn); - } - return; - } - } - /* nope could not find one to update so we must build one */ + sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { return; @@ -11016,7 +11055,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str atomic_add_int(&chk->whoTo->ref_count, 1); cwr = mtod(chk->data, struct sctp_cwr_chunk *); cwr->ch.chunk_type = SCTP_ECN_CWR; - cwr->ch.chunk_flags = 0; + cwr->ch.chunk_flags = override; cwr->ch.chunk_length = htons(sizeof(struct sctp_cwr_chunk)); cwr->tsn = htonl(high_tsn); TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 19:02:07 2012 (r231400) @@ -163,7 +163,7 @@ sctp_send_packet_dropped(struct sctp_tcb -void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t); +void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t); void Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:02:07 2012 (r231400) @@ -3854,6 +3854,7 @@ sctp_add_remote_addr(struct sctp_tcb *st net->RTO_measured = 0; stcb->asoc.numnets++; *(&net->ref_count) = 1; + net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; net->tos_flowlabel = 0; if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:02:07 2012 (r231400) @@ -211,7 +211,10 @@ struct sctp_nets { /* mtu discovered so far */ uint32_t mtu; uint32_t ssthresh; /* not sure about this one for split */ - + uint32_t last_cwr_tsn; + uint32_t cwr_window_tsn; + uint32_t ecn_ce_pkt_cnt; + uint32_t lost_cnt; /* smoothed average things for RTT and RTO itself */ int lastsa; int lastsv; @@ -864,7 +867,6 @@ struct sctp_association { uint32_t highest_tsn_inside_nr_map; uint32_t last_echo_tsn; - uint32_t last_cwr_tsn; uint32_t fast_recovery_tsn; uint32_t sat_t3_recovery_tsn; uint32_t tsn_last_delivered; @@ -1048,7 +1050,6 @@ struct sctp_association { uint16_t ecn_echo_cnt_onq; uint16_t free_chunk_cnt; - uint8_t stream_locked; uint8_t authenticated; /* packet authenticated ok */ /* Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 18:58:36 2012 (r231399) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:02:07 2012 (r231400) @@ -971,7 +971,6 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->last_net_cmt_send_started = NULL; /* This will need to be adjusted */ - asoc->last_cwr_tsn = asoc->init_seq_number - 1; asoc->last_acked_seq = asoc->init_seq_number - 1; asoc->advanced_peer_ack_point = asoc->last_acked_seq; asoc->asconf_seq_in = asoc->last_acked_seq; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:04:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D29BF106564A; Fri, 10 Feb 2012 19:04:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB2E58FC14; Fri, 10 Feb 2012 19:04: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 q1AJ4R0R088806; Fri, 10 Feb 2012 19:04:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJ4RRh088795; Fri, 10 Feb 2012 19:04:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101904.q1AJ4RRh088795@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:04:27 +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: r231401 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:04:28 -0000 Author: tuexen Date: Fri Feb 10 19:04:26 2012 New Revision: 231401 URL: http://svn.freebsd.org/changeset/base/231401 Log: MFC r218129: More ECN fixes: 1) We now remove ECN-Nonce since it will no longer continue as a I-D 2) Eliminate last_tsn_echo, this tied us to an assoc not the net and thus we were not doing m-homing on the ECN-Echo senders side right. 3) Increment the count going out even if the TSN in lower in the pending ECN-Echo, this way the receiver knows exactly how many packets were marked even with network re-ordering 4) Fix so we DO NOT stop doing delayed sack if a ECN Echo is in queue Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:04:26 2012 (r231401) @@ -168,13 +168,6 @@ sctp_cwnd_update_after_fr(struct sctp_tc net->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; } - /* - * Disable Nonce Sum Checking and store the - * resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->fast_recovery_tsn + 1; - sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); sctp_timer_start(SCTP_TIMER_TYPE_SEND, @@ -489,25 +482,28 @@ sctp_cwnd_update_after_timeout(struct sc } static void -sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net) +sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost) { int old_cwnd = net->cwnd; - SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = net->cwnd / 2; - if (net->ssthresh < net->mtu) { - net->ssthresh = net->mtu; - /* here back off the timer as well, to slow us down */ - net->RTO <<= 1; - } - net->cwnd = net->ssthresh; - SDT_PROBE(sctp, cwnd, net, ecn, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + if (in_window == 0) { + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + net->ssthresh = net->cwnd / 2; + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + /* here back off the timer as well, to slow us down */ + net->RTO <<= 1; + } + net->cwnd = net->ssthresh; + SDT_PROBE(sctp, cwnd, net, ecn, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } } @@ -888,13 +884,6 @@ sctp_hs_cwnd_update_after_fr(struct sctp net->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; } - /* - * Disable Nonce Sum Checking and store the - * resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->fast_recovery_tsn + 1; - sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); sctp_timer_start(SCTP_TIMER_TYPE_SEND, @@ -1609,13 +1598,6 @@ sctp_htcp_cwnd_update_after_fr(struct sc net->fast_recovery_tsn = lchk->rec.data.TSN_seq - 1; } - /* - * Disable Nonce Sum Checking and store the - * resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->fast_recovery_tsn + 1; - sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_32); sctp_timer_start(SCTP_TIMER_TYPE_SEND, @@ -1673,24 +1655,26 @@ sctp_htcp_cwnd_update_after_fr_timer(str static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, - struct sctp_nets *net) + struct sctp_nets *net, int in_window, int num_pkt_lost) { int old_cwnd; old_cwnd = net->cwnd; /* JRS - reset hctp as if state changed */ - htcp_reset(&net->htcp_ca); - SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); - if (net->ssthresh < net->mtu) { - net->ssthresh = net->mtu; - /* here back off the timer as well, to slow us down */ - net->RTO <<= 1; - } - net->cwnd = net->ssthresh; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + if (in_window == 0) { + htcp_reset(&net->htcp_ca); + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + net->ssthresh = htcp_recalc_ssthresh(stcb, net); + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + /* here back off the timer as well, to slow us down */ + net->RTO <<= 1; + } + net->cwnd = net->ssthresh; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } } Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:04:26 2012 (r231401) @@ -411,8 +411,7 @@ __FBSDID("$FreeBSD$"); /*************0x8000 series*************/ #define SCTP_ECN_CAPABLE 0x8000 -/* ECN Nonce: draft-ladha-sctp-ecn-nonce */ -#define SCTP_ECN_NONCE_SUPPORTED 0x8001 + /* draft-ietf-tsvwg-auth-xxx */ #define SCTP_RANDOM 0x8002 #define SCTP_CHUNK_LIST 0x8003 Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:04:26 2012 (r231401) @@ -142,12 +142,6 @@ struct sctp_supported_chunk_types_param } SCTP_PACKED; -/* ECN Nonce: draft-ladha-sctp-ecn-nonce */ -struct sctp_ecn_nonce_supported_param { - struct sctp_paramhdr ph;/* type = 0x8001 len = 4 */ -} SCTP_PACKED; - - /* * Structures for DATA chunks */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:04:26 2012 (r231401) @@ -2386,7 +2386,6 @@ sctp_slide_mapping_arrays(struct sctp_tc } } - void sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap, int *abort_flag) { @@ -2857,11 +2856,6 @@ sctp_process_segment_range(struct sctp_t * must be held until * cum-ack passes */ - /*- - * ECN Nonce: Add the nonce - * value to the sender's - * nonce sum - */ if (tp1->sent < SCTP_DATAGRAM_RESEND) { /*- * If it is less than RESEND, it is @@ -2967,8 +2961,6 @@ sctp_process_segment_range(struct sctp_t } } if (tp1->sent <= SCTP_DATAGRAM_RESEND) { - (*ecn_seg_sums) += tp1->rec.data.ect_nonce; - (*ecn_seg_sums) &= SCTP_SACK_NONCE_SUM; if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, stcb->asoc.this_sack_highest_gap)) { stcb->asoc.this_sack_highest_gap = @@ -3152,23 +3144,6 @@ sctp_check_for_revoked(struct sctp_tcb * if (tp1->sent == SCTP_DATAGRAM_UNSENT) break; } - if (tot_revoked > 0) { - /* - * Setup the ecn nonce re-sync point. We do this since once - * data is revoked we begin to retransmit things, which do - * NOT have the ECN bits set. This means we are now out of - * sync and must wait until we get back in sync with the - * peer to check ECN bits. - */ - tp1 = TAILQ_FIRST(&asoc->send_queue); - if (tp1 == NULL) { - asoc->nonce_resync_tsn = asoc->sending_seq; - } else { - asoc->nonce_resync_tsn = tp1->rec.data.TSN_seq; - } - asoc->nonce_wait_for_ecne = 0; - asoc->nonce_sum_check = 0; - } } @@ -3604,17 +3579,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t } } } - - if (tot_retrans > 0) { - /* - * Setup the ecn nonce re-sync point. We do this since once - * we go to FR something we introduce a Karn's rule scenario - * and won't know the totals for the ECN bits. - */ - asoc->nonce_resync_tsn = sending_seq; - asoc->nonce_wait_for_ecne = 0; - asoc->nonce_sum_check = 0; - } } struct sctp_tmit_chunk * @@ -3787,7 +3751,7 @@ sctp_window_probe_recovery(struct sctp_t void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, - uint32_t rwnd, int nonce_sum_flag, int *abort_now) + uint32_t rwnd, int *abort_now) { struct sctp_nets *net; struct sctp_association *asoc; @@ -3901,11 +3865,6 @@ sctp_express_handle_sack(struct sctp_tcb if (tp1->sent == SCTP_DATAGRAM_UNSENT) { printf("Warning, an unsent is now acked?\n"); } - /* - * ECN Nonce: Add the nonce to the sender's - * nonce sum - */ - asoc->nonce_sum_expect_base += tp1->rec.data.ect_nonce; if (tp1->sent < SCTP_DATAGRAM_ACKED) { /* * If it is less than ACKED, it is @@ -4049,53 +4008,6 @@ sctp_express_handle_sack(struct sctp_tcb asoc->total_flight = 0; asoc->total_flight_count = 0; } - /* ECN Nonce updates */ - if (asoc->ecn_nonce_allowed) { - if (asoc->nonce_sum_check) { - if (nonce_sum_flag != ((asoc->nonce_sum_expect_base) & SCTP_SACK_NONCE_SUM)) { - if (asoc->nonce_wait_for_ecne == 0) { - struct sctp_tmit_chunk *lchk; - - lchk = TAILQ_FIRST(&asoc->send_queue); - asoc->nonce_wait_for_ecne = 1; - if (lchk) { - asoc->nonce_wait_tsn = lchk->rec.data.TSN_seq; - } else { - asoc->nonce_wait_tsn = asoc->sending_seq; - } - } else { - if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { - /* - * Misbehaving peer. We need - * to react to this guy - */ - asoc->ecn_allowed = 0; - asoc->ecn_nonce_allowed = 0; - } - } - } - } else { - /* See if Resynchronization Possible */ - if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { - asoc->nonce_sum_check = 1; - /* - * Now we must calculate what the base is. - * We do this based on two things, we know - * the total's for all the segments - * gap-acked in the SACK (none). We also - * know the SACK's nonce sum, its in - * nonce_sum_flag. So we can build a truth - * table to back-calculate the new value of - * asoc->nonce_sum_expect_base: - * - * SACK-flag-Value Seg-Sums Base 0 0 0 - * 1 0 1 0 1 1 1 - * 1 0 - */ - asoc->nonce_sum_expect_base = (0 ^ nonce_sum_flag) & SCTP_SACK_NONCE_SUM; - } - } - } /* RWND update */ asoc->peers_rwnd = sctp_sbspace_sub(rwnd, (uint32_t) (asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))); @@ -4297,18 +4209,10 @@ again: /* C3. See if we need to send a Fwd-TSN */ if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cumack)) { /* - * ISSUE with ECN, see FWD-TSN processing for notes - * on issues that will occur when the ECN NONCE - * stuff is put into SCTP for cross checking. + * ISSUE with ECN, see FWD-TSN processing. */ if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { send_forward_tsn(stcb, asoc); - /* - * ECN Nonce: Disable Nonce Sum check when - * FWD TSN is sent and store resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->advanced_peer_ack_point; } else if (lchk) { /* try to FR fwd-tsn's that get lost too */ if (lchk->rec.data.fwd_tsn_cnt >= 3) { @@ -4351,7 +4255,7 @@ sctp_handle_sack(struct mbuf *m, int off int win_probe_recovery = 0; int win_probe_recovered = 0; struct sctp_nets *net = NULL; - int nonce_sum_flag, ecn_seg_sums = 0; + int ecn_seg_sums = 0; int done_once; uint8_t reneged_all = 0; uint8_t cmt_dac_flag; @@ -4383,7 +4287,6 @@ sctp_handle_sack(struct mbuf *m, int off j = 0; SCTP_STAT_INCR(sctps_slowpath_sack); last_tsn = cum_ack; - nonce_sum_flag = flags & SCTP_SACK_NONCE_SUM; cmt_dac_flag = flags & SCTP_SACK_CMT_DAC; #ifdef SCTP_ASOCLOG_OF_TSNS stcb->asoc.cumack_log[stcb->asoc.cumack_log_at] = cum_ack; @@ -4545,11 +4448,6 @@ sctp_handle_sack(struct mbuf *m, int off TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (SCTP_TSN_GE(last_tsn, tp1->rec.data.TSN_seq)) { if (tp1->sent != SCTP_DATAGRAM_UNSENT) { - /* - * ECN Nonce: Add the nonce to the sender's - * nonce sum - */ - asoc->nonce_sum_expect_base += tp1->rec.data.ect_nonce; accum_moved = 1; if (tp1->sent < SCTP_DATAGRAM_ACKED) { /* @@ -4999,60 +4897,6 @@ sctp_handle_sack(struct mbuf *m, int off /* JRS - Use the congestion control given in the CC module */ asoc->cc_functions.sctp_cwnd_update_after_fr(stcb, asoc); - /****************************************************************** - * Here we do the stuff with ECN Nonce checking. - * We basically check to see if the nonce sum flag was incorrect - * or if resynchronization needs to be done. Also if we catch a - * misbehaving receiver we give him the kick. - ******************************************************************/ - - if (asoc->ecn_nonce_allowed) { - if (asoc->nonce_sum_check) { - if (nonce_sum_flag != ((asoc->nonce_sum_expect_base + ecn_seg_sums) & SCTP_SACK_NONCE_SUM)) { - if (asoc->nonce_wait_for_ecne == 0) { - struct sctp_tmit_chunk *lchk; - - lchk = TAILQ_FIRST(&asoc->send_queue); - asoc->nonce_wait_for_ecne = 1; - if (lchk) { - asoc->nonce_wait_tsn = lchk->rec.data.TSN_seq; - } else { - asoc->nonce_wait_tsn = asoc->sending_seq; - } - } else { - if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { - /* - * Misbehaving peer. We need - * to react to this guy - */ - asoc->ecn_allowed = 0; - asoc->ecn_nonce_allowed = 0; - } - } - } - } else { - /* See if Resynchronization Possible */ - if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { - asoc->nonce_sum_check = 1; - /* - * now we must calculate what the base is. - * We do this based on two things, we know - * the total's for all the segments - * gap-acked in the SACK, its stored in - * ecn_seg_sums. We also know the SACK's - * nonce sum, its in nonce_sum_flag. So we - * can build a truth table to back-calculate - * the new value of - * asoc->nonce_sum_expect_base: - * - * SACK-flag-Value Seg-Sums Base 0 0 0 - * 1 0 1 0 1 1 1 - * 1 0 - */ - asoc->nonce_sum_expect_base = (ecn_seg_sums ^ nonce_sum_flag) & SCTP_SACK_NONCE_SUM; - } - } - } /* Now are we exiting loss recovery ? */ if (will_exit_fast_recovery) { /* Ok, we must exit fast recovery */ @@ -5190,9 +5034,7 @@ again: /* C3. See if we need to send a Fwd-TSN */ if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cum_ack)) { /* - * ISSUE with ECN, see FWD-TSN processing for notes - * on issues that will occur when the ECN NONCE - * stuff is put into SCTP for cross checking. + * ISSUE with ECN, see FWD-TSN processing. */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { sctp_misc_ints(SCTP_FWD_TSN_CHECK, @@ -5200,14 +5042,7 @@ again: old_adv_peer_ack_point); } if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { - send_forward_tsn(stcb, asoc); - /* - * ECN Nonce: Disable Nonce Sum check when - * FWD TSN is sent and store resync tsn - */ - asoc->nonce_sum_check = 0; - asoc->nonce_resync_tsn = asoc->advanced_peer_ack_point; } else if (lchk) { /* try to FR fwd-tsn's that get lost too */ if (lchk->rec.data.fwd_tsn_cnt >= 3) { @@ -5242,7 +5077,7 @@ sctp_update_acked(struct sctp_tcb *stcb, a_rwnd = stcb->asoc.peers_rwnd + stcb->asoc.total_flight; /* Now call the express sack handling */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, 0, abort_flag); + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, abort_flag); } static void @@ -5384,17 +5219,6 @@ sctp_handle_forward_tsn(struct sctp_tcb struct sctp_forward_tsn_chunk *fwd, int *abort_flag, struct mbuf *m, int offset) { - /* - * ISSUES that MUST be fixed for ECN! When we are the sender of the - * forward TSN, when the SACK comes back that acknowledges the - * FWD-TSN we must reset the NONCE sum to match correctly. This will - * get quite tricky since we may have sent more data interveneing - * and must carefully account for what the SACK says on the nonce - * and any gaps that are reported. This work will NOT be done here, - * but I note it here since it is really related to PR-SCTP and - * FWD-TSN's - */ - /* The pr-sctp fwd tsn */ /* * here we will perform all the data receiver side steps for @@ -5482,7 +5306,6 @@ sctp_handle_forward_tsn(struct sctp_tcb if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { sctp_log_map(0, 3, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); } - asoc->last_echo_tsn = asoc->highest_tsn_inside_map; } else { SCTP_TCB_LOCK_ASSERT(stcb); for (i = 0; i <= gap; i++) { Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:04:26 2012 (r231401) @@ -93,7 +93,7 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, - uint32_t rwnd, int nonce_sum_flag, int *abort_now); + uint32_t rwnd, int *abort_now); void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:04:26 2012 (r231401) @@ -264,11 +264,13 @@ sctp_process_init(struct sctp_init_chunk /* save off parameters */ asoc->peer_vtag = ntohl(init->initiate_tag); asoc->peers_rwnd = ntohl(init->a_rwnd); + /* init tsn's */ + asoc->highest_tsn_inside_map = asoc->asconf_seq_in = ntohl(init->initial_tsn) - 1; + if (!TAILQ_EMPTY(&asoc->nets)) { /* update any ssthresh's that may have a default */ TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) { lnet->ssthresh = asoc->peers_rwnd; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { sctp_log_cwnd(stcb, lnet, 0, SCTP_CWND_INITIALIZATION); } @@ -328,8 +330,7 @@ sctp_process_init(struct sctp_init_chunk } SCTP_TCB_SEND_UNLOCK(stcb); asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams; - /* init tsn's */ - asoc->highest_tsn_inside_map = asoc->asconf_seq_in = ntohl(init->initial_tsn) - 1; + /* EY - nr_sack: initialize highest tsn in nr_mapping_array */ asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { @@ -340,7 +341,7 @@ sctp_process_init(struct sctp_init_chunk asoc->mapping_array_base_tsn = ntohl(init->initial_tsn); asoc->tsn_last_delivered = asoc->cumulative_tsn = asoc->asconf_seq_in; - asoc->last_echo_tsn = asoc->asconf_seq_in; + asoc->advanced_peer_ack_point = asoc->last_acked_seq; /* open the requested streams */ @@ -1044,11 +1045,6 @@ sctp_process_unrecog_param(struct sctp_t case SCTP_HAS_NAT_SUPPORT: stcb->asoc.peer_supports_nat = 0; break; - case SCTP_ECN_NONCE_SUPPORTED: - stcb->asoc.peer_supports_ecn_nonce = 0; - stcb->asoc.ecn_nonce_allowed = 0; - stcb->asoc.ecn_allowed = 0; - break; case SCTP_ADD_IP_ADDRESS: case SCTP_DEL_IP_ADDRESS: case SCTP_SET_PRIM_ADDR: @@ -2933,16 +2929,12 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch SCTP_STAT_INCR(sctps_recvecne); tsn = ntohl(cp->tsn); pkt_cnt = ntohl(cp->num_pkts_since_cwr); - /* ECN Nonce stuff: need a resync and disable the nonce sum check */ - /* Also we make sure we disable the nonce_wait */ lchk = TAILQ_LAST(&stcb->asoc.send_queue, sctpchunk_listhead); if (lchk == NULL) { - window_data_tsn = stcb->asoc.nonce_resync_tsn = stcb->asoc.sending_seq - 1; + window_data_tsn = stcb->asoc.sending_seq - 1; } else { - window_data_tsn = stcb->asoc.nonce_resync_tsn = lchk->rec.data.TSN_seq; + window_data_tsn = lchk->rec.data.TSN_seq; } - stcb->asoc.nonce_wait_for_ecne = 0; - stcb->asoc.nonce_sum_check = 0; /* Find where it was sent to if possible. */ net = NULL; @@ -2976,7 +2968,8 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch override_bit = SCTP_CWR_REDUCE_OVERRIDE; } out: - if (SCTP_TSN_GT(tsn, net->cwr_window_tsn)) { + if (SCTP_TSN_GT(tsn, net->cwr_window_tsn) && + ((override_bit & SCTP_CWR_REDUCE_OVERRIDE) == 0)) { /* * JRS - Use the congestion control given in the pluggable * CC module @@ -2984,7 +2977,7 @@ out: int ocwnd; ocwnd = net->cwnd; - stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net); + stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 0, pkt_cnt); /* * We reduce once every RTT. So we will only lower cwnd at * the next sending seq i.e. the window_data_tsn @@ -2995,18 +2988,26 @@ out: net->last_cwr_tsn = tsn; } else { override_bit |= SCTP_CWR_IN_SAME_WINDOW; - if (SCTP_TSN_GT(tsn, net->last_cwr_tsn)) { + if (SCTP_TSN_GT(tsn, net->last_cwr_tsn) && + ((override_bit & SCTP_CWR_REDUCE_OVERRIDE) == 0)) { /* - * Another loss in the same window update how man - * marks we have had + * Another loss in the same window update how many + * marks/packets lost we have had. */ + int cnt = 1; if (pkt_cnt > net->lost_cnt) { /* Should be the case */ - net->ecn_ce_pkt_cnt += (pkt_cnt - net->lost_cnt); - net->lost_cnt = pkt_cnt; + cnt = (pkt_cnt - net->lost_cnt); + net->ecn_ce_pkt_cnt += cnt; } + net->lost_cnt = pkt_cnt; net->last_cwr_tsn = tsn; + /* + * Most CC functions will ignore this call, since we + * are in-window yet of the initial CE the peer saw. + */ + stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 1, cnt); } } /* @@ -3186,11 +3187,6 @@ process_chunk_drop(struct sctp_tcb *stcb } } } - /* - * We zero out the nonce so resync not - * needed - */ - tp1->rec.data.ect_nonce = 0; if (tp1->do_rtt) { /* @@ -4645,7 +4641,6 @@ process_control_chunks: uint16_t num_seg, num_dup; uint8_t flags; int offset_seg, offset_dup; - int nonce_sum_flag; SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n"); SCTP_STAT_INCR(sctps_recvsacks); @@ -4667,7 +4662,6 @@ process_control_chunks: } sack = (struct sctp_sack_chunk *)ch; flags = ch->chunk_flags; - nonce_sum_flag = flags & SCTP_SACK_NONCE_SUM; cum_ack = ntohl(sack->sack.cum_tsn_ack); num_seg = ntohs(sack->sack.num_gap_ack_blks); num_dup = ntohs(sack->sack.num_dup_tsns); @@ -4699,8 +4693,7 @@ process_control_chunks: * with no missing segments to go * this way too. */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, nonce_sum_flag, - &abort_now); + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now); } else { if (netp && *netp) sctp_handle_sack(m, offset_seg, offset_dup, @@ -4732,7 +4725,6 @@ process_control_chunks: uint16_t num_seg, num_nr_seg, num_dup; uint8_t flags; int offset_seg, offset_dup; - int nonce_sum_flag; SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n"); SCTP_STAT_INCR(sctps_recvsacks); @@ -4758,8 +4750,6 @@ process_control_chunks: } nr_sack = (struct sctp_nr_sack_chunk *)ch; flags = ch->chunk_flags; - nonce_sum_flag = flags & SCTP_SACK_NONCE_SUM; - cum_ack = ntohl(nr_sack->nr_sack.cum_tsn_ack); num_seg = ntohs(nr_sack->nr_sack.num_gap_ack_blks); num_nr_seg = ntohs(nr_sack->nr_sack.num_nr_gap_ack_blks); @@ -4791,7 +4781,7 @@ process_control_chunks: * missing segments to go this way * too. */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, nonce_sum_flag, + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now); } else { if (netp && *netp) @@ -5397,66 +5387,6 @@ next_chunk: } -/* - * Process the ECN bits we have something set so we must look to see if it is - * ECN(0) or ECN(1) or CE - */ -static void -sctp_process_ecn_marked_a(struct sctp_tcb *stcb, struct sctp_nets *net, - uint8_t ecn_bits) -{ - if ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS) { - ; - } else if ((ecn_bits & SCTP_ECT1_BIT) == SCTP_ECT1_BIT) { - /* - * we only add to the nonce sum for ECT1, ECT0 does not - * change the NS bit (that we have yet to find a way to send - * it yet). - */ - - /* ECN Nonce stuff */ - stcb->asoc.receiver_nonce_sum++; - stcb->asoc.receiver_nonce_sum &= SCTP_SACK_NONCE_SUM; - - /* - * Drag up the last_echo point if cumack is larger since we - * don't want the point falling way behind by more than - * 2^^31 and then having it be incorrect. - */ - if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { - stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; - } - } else if ((ecn_bits & SCTP_ECT0_BIT) == SCTP_ECT0_BIT) { - /* - * Drag up the last_echo point if cumack is larger since we - * don't want the point falling way behind by more than - * 2^^31 and then having it be incorrect. - */ - if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { - stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; - } - } -} - -static void -sctp_process_ecn_marked_b(struct sctp_tcb *stcb, struct sctp_nets *net, - uint32_t high_tsn, uint8_t ecn_bits) -{ - if ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS) { - /* - * we possibly must notify the sender that a congestion - * window reduction is in order. We do this by adding a ECNE - * chunk to the output chunk queue. The incoming CWR will - * remove this chunk. - */ - if (SCTP_TSN_GT(high_tsn, stcb->asoc.last_echo_tsn)) { - /* Yep, we need to add a ECNE */ - sctp_send_ecn_echo(stcb, net, high_tsn); - stcb->asoc.last_echo_tsn = high_tsn; - } - } -} - #ifdef INVARIANTS #ifdef __GNUC__ __attribute__((noinline)) @@ -5498,6 +5428,7 @@ sctp_common_input_processing(struct mbuf struct mbuf *m = *mm; int abort_flag = 0; int un_sent; + int cnt_ctrl_ready = 0; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED @@ -5655,11 +5586,6 @@ sctp_common_input_processing(struct mbuf case SCTP_STATE_SHUTDOWN_SENT: break; } - /* take care of ECN, part 1. */ - if (stcb->asoc.ecn_allowed && - (ecn_bits & (SCTP_ECT0_BIT | SCTP_ECT1_BIT))) { - sctp_process_ecn_marked_a(stcb, net, ecn_bits); - } /* plow through the data chunks while length > offset */ retval = sctp_process_data(mm, iphlen, &offset, length, sh, inp, stcb, net, &high_tsn); @@ -5671,19 +5597,16 @@ sctp_common_input_processing(struct mbuf goto out_now; } data_processed = 1; - if (retval == 0) { - /* take care of ecn part 2. */ - if (stcb->asoc.ecn_allowed && - (ecn_bits & (SCTP_ECT0_BIT | SCTP_ECT1_BIT))) { - sctp_process_ecn_marked_b(stcb, net, high_tsn, - ecn_bits); - } - } /* * Anything important needs to have been m_copy'ed in * process_data */ } + /* take care of ecn */ + if (stcb->asoc.ecn_allowed && ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS)) { + /* Yep, we need to add a ECNE */ + sctp_send_ecn_echo(stcb, net, high_tsn); + } if ((data_processed == 0) && (fwd_tsn_seen)) { int was_a_gap; uint32_t highest_tsn; @@ -5715,8 +5638,10 @@ trigger_send: TAILQ_EMPTY(&stcb->asoc.control_send_queue), stcb->asoc.total_flight); un_sent = (stcb->asoc.total_output_queue_size - stcb->asoc.total_flight); - - if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue) || + if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue)) { + cnt_ctrl_ready = stcb->asoc.ctrl_queue_cnt - stcb->asoc.ecn_echo_cnt_onq; + } + if (cnt_ctrl_ready || ((un_sent) && (stcb->asoc.peers_rwnd > 0 || (stcb->asoc.peers_rwnd <= 0 && stcb->asoc.total_flight == 0)))) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:04:26 2012 (r231401) @@ -3389,55 +3389,10 @@ static uint8_t sctp_get_ect(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk) { - uint8_t this_random; - - /* Huh? */ if (SCTP_BASE_SYSCTL(sctp_ecn_enable) == 0) return (0); - if (SCTP_BASE_SYSCTL(sctp_ecn_nonce) == 0) - /* no nonce, always return ECT0 */ - return (SCTP_ECT0_BIT); - - if (stcb->asoc.peer_supports_ecn_nonce == 0) { - /* Peer does NOT support it, so we send a ECT0 only */ - return (SCTP_ECT0_BIT); - } - if (chk == NULL) - return (SCTP_ECT0_BIT); - - if ((stcb->asoc.hb_random_idx > 3) || - ((stcb->asoc.hb_random_idx == 3) && - (stcb->asoc.hb_ect_randombit > 7))) { - uint32_t rndval; - -warp_drive_sa: - rndval = sctp_select_initial_TSN(&stcb->sctp_ep->sctp_ep); - memcpy(stcb->asoc.hb_random_values, &rndval, - sizeof(stcb->asoc.hb_random_values)); - this_random = stcb->asoc.hb_random_values[0]; - stcb->asoc.hb_random_idx = 0; - stcb->asoc.hb_ect_randombit = 0; - } else { - if (stcb->asoc.hb_ect_randombit > 7) { - stcb->asoc.hb_ect_randombit = 0; - stcb->asoc.hb_random_idx++; - if (stcb->asoc.hb_random_idx > 3) { - goto warp_drive_sa; - } - } - this_random = stcb->asoc.hb_random_values[stcb->asoc.hb_random_idx]; - } - if ((this_random >> stcb->asoc.hb_ect_randombit) & 0x01) { - if (chk != NULL) - /* ECN Nonce stuff */ - chk->rec.data.ect_nonce = SCTP_ECT1_BIT; - stcb->asoc.hb_ect_randombit++; - return (SCTP_ECT1_BIT); - } else { - stcb->asoc.hb_ect_randombit++; - return (SCTP_ECT0_BIT); - } + return (SCTP_ECT0_BIT); } static int @@ -4167,7 +4122,6 @@ sctp_send_initiate(struct sctp_inpcb *in struct sctp_adaptation_layer_indication *ali; struct sctp_ecn_supported_param *ecn; struct sctp_prsctp_supported_param *prsctp; - struct sctp_ecn_nonce_supported_param *ecn_nonce; struct sctp_supported_chunk_types_param *pr_supported; int cnt_inits_to = 0; int padval, ret; @@ -4326,14 +4280,6 @@ sctp_send_initiate(struct sctp_inpcb *in SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); - /* ECN nonce: And now tell the peer we support ECN nonce */ - if (SCTP_BASE_SYSCTL(sctp_ecn_nonce)) { - ecn_nonce = (struct sctp_ecn_nonce_supported_param *) - ((caddr_t)pr_supported + SCTP_SIZE32(p_len)); - ecn_nonce->ph.param_type = htons(SCTP_ECN_NONCE_SUPPORTED); - ecn_nonce->ph.param_length = htons(sizeof(*ecn_nonce)); - SCTP_BUF_LEN(m) += sizeof(*ecn_nonce); - } /* add authentication parameters */ if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { struct sctp_auth_random *randp; @@ -4555,11 +4501,10 @@ sctp_arethere_unrecognized_parameters(st case SCTP_HAS_NAT_SUPPORT: *nat_friendly = 1; /* fall through */ - case SCTP_ECN_NONCE_SUPPORTED: case SCTP_PRSCTP_SUPPORTED: if (padded_size != sizeof(struct sctp_paramhdr)) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error ecnnonce/prsctp/nat support %d\n", plen); + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error prsctp/nat support %d\n", plen); goto invalid_size; } at += padded_size; @@ -4960,7 +4905,6 @@ sctp_send_initiate_ack(struct sctp_inpcb struct sctp_adaptation_layer_indication *ali; struct sctp_ecn_supported_param *ecn; struct sctp_prsctp_supported_param *prsctp; - struct sctp_ecn_nonce_supported_param *ecn_nonce; struct sctp_supported_chunk_types_param *pr_supported; union sctp_sockstore store, store1, *over_addr; struct sockaddr_in *sin, *to_sin; @@ -5444,14 +5388,6 @@ do_a_abort: bzero((caddr_t)pr_supported + p_len, SCTP_SIZE32(p_len) - p_len); SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); - /* ECN nonce: And now tell the peer we support ECN nonce */ - if (SCTP_BASE_SYSCTL(sctp_ecn_nonce)) { - ecn_nonce = (struct sctp_ecn_nonce_supported_param *) - ((caddr_t)pr_supported + SCTP_SIZE32(p_len)); - ecn_nonce->ph.param_type = htons(SCTP_ECN_NONCE_SUPPORTED); - ecn_nonce->ph.param_length = htons(sizeof(*ecn_nonce)); - SCTP_BUF_LEN(m) += sizeof(*ecn_nonce); - } /* add authentication parameters */ if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { struct sctp_auth_random *randp; @@ -7009,7 +6945,6 @@ dont_do_it: chk->rec.data.payloadtype = sp->ppid; chk->rec.data.context = sp->context; chk->rec.data.doing_fast_retransmit = 0; - chk->rec.data.ect_nonce = 0; /* ECN Nonce */ chk->rec.data.timetodrop = sp->ts; chk->flags = sp->act_flags; @@ -10000,13 +9935,7 @@ sctp_send_sack(struct sctp_tcb *stcb) limit = mtod(a_chk->data, caddr_t); limit += space; - /* 0x01 is used by nonce for ecn */ - if ((SCTP_BASE_SYSCTL(sctp_ecn_enable)) && - (SCTP_BASE_SYSCTL(sctp_ecn_nonce)) && - (asoc->peer_supports_ecn_nonce)) - flags = (asoc->receiver_nonce_sum & SCTP_SACK_NONCE_SUM); - else - flags = 0; + flags = 0; if ((asoc->sctp_cmt_on_off > 0) && SCTP_BASE_SYSCTL(sctp_cmt_use_dac)) { @@ -10809,11 +10738,11 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb ctsn = ntohl(ecne->tsn); if (SCTP_TSN_GT(high_tsn, ctsn)) { ecne->tsn = htonl(high_tsn); - cnt = ntohl(ecne->num_pkts_since_cwr); - cnt++; - ecne->num_pkts_since_cwr = htonl(cnt); SCTP_STAT_INCR(sctps_queue_upd_ecne); } + cnt = ntohl(ecne->num_pkts_since_cwr); + cnt++; + ecne->num_pkts_since_cwr = htonl(cnt); return; } } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:04:26 2012 (r231401) @@ -6139,10 +6139,6 @@ sctp_load_addresses_from_init(struct sct } } - } else if (ptype == SCTP_ECN_NONCE_SUPPORTED) { - /* Peer supports ECN-nonce */ - stcb->asoc.peer_supports_ecn_nonce = 1; - stcb->asoc.ecn_nonce_allowed = 1; } else if (ptype == SCTP_RANDOM) { if (plen > sizeof(random_store)) break; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:02:07 2012 (r231400) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:04:26 2012 (r231401) @@ -330,8 +330,6 @@ struct sctp_data_chunkrec { uint32_t payloadtype; uint32_t context; /* from send */ - /* ECN Nonce: Nonce Value for this chunk */ - uint8_t ect_nonce; uint8_t fwd_tsn_cnt; /* * part of the Highest sacked algorithm to be able to stroke counts @@ -607,7 +605,7 @@ struct sctp_cc_functions { void (*sctp_cwnd_update_after_timeout) (struct sctp_tcb *stcb, struct sctp_nets *net); void (*sctp_cwnd_update_after_ecn_echo) (struct sctp_tcb *stcb, - struct sctp_nets *net); + struct sctp_nets *net, int in_window, int num_pkt_lost); void (*sctp_cwnd_update_after_packet_dropped) (struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_pktdrop_chunk *cp, uint32_t * bottle_bw, uint32_t * on_queue); @@ -866,7 +864,6 @@ struct sctp_association { uint8_t *nr_mapping_array; uint32_t highest_tsn_inside_nr_map; - uint32_t last_echo_tsn; uint32_t fast_recovery_tsn; uint32_t sat_t3_recovery_tsn; uint32_t tsn_last_delivered; @@ -921,12 +918,9 @@ struct sctp_association { uint32_t sb_send_resv; /* amount reserved on a send */ uint32_t my_rwnd_control_len; /* shadow of sb_mbcnt used for rwnd * control */ - /* 32 bit nonce stuff */ - uint32_t nonce_resync_tsn; - uint32_t nonce_wait_tsn; uint32_t default_flowlabel; uint32_t pr_sctp_cnt; - int ctrl_queue_cnt; /* could be removed REM */ + int ctrl_queue_cnt; /* could be removed REM - NO IT CAN'T!! RRS */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:07:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 290ED106566B; Fri, 10 Feb 2012 19:07:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1280E8FC0A; Fri, 10 Feb 2012 19:07:33 +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 q1AJ7Xc1088959; Fri, 10 Feb 2012 19:07:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJ7WMB088944; Fri, 10 Feb 2012 19:07:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101907.q1AJ7WMB088944@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:07: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: r231402 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:07:33 -0000 Author: tuexen Date: Fri Feb 10 19:07:32 2012 New Revision: 231402 URL: http://svn.freebsd.org/changeset/base/231402 Log: MFC r218186: 1) Allow a chunk to track the cwnd it was at when sent. 2) Add separate max-bursts for retransmit and hb. These are set to sysctlable values but not settable via the socket api. This makes sure we don't blast out HB's or fast-retransmits. 3) Determine on the first data transmission on a net if its local-lan (by being under or over a RTT). This can later be used to think about different algorithms based on locallan vs big-i (experimental) 4) The cwnd should NOT be allowed to grow when an ECNEcho is seen (TCP has this same bug). We fix this in SCTP so an ECNe being seen prevents an advance of cwnd. 5) CWR's should not be sent multiple times to the same network, instead just updating the TSN being transmitted if needed. From rrs@. Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:07:32 2012 (r231402) @@ -481,6 +481,7 @@ sctp_cwnd_update_after_timeout(struct sc } } + static void sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:07:32 2012 (r231402) @@ -345,6 +345,16 @@ __FBSDID("$FreeBSD$"); /* default max I can burst out after a fast retransmit, 0 disables it */ #define SCTP_DEF_MAX_BURST 0 +#define SCTP_DEF_HBMAX_BURST 4 +#define SCTP_DEF_FRMAX_BURST 4 + +/* RTO calculation flag to say if it + * is safe to determine local lan or not. + */ +#define SCTP_DETERMINE_LL_NOTOK 0 +#define SCTP_DETERMINE_LL_OK 1 + + /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ #define SCTP_FIRST_MBUF_RESV 68 /* Packet transmit states in the sent field */ @@ -947,6 +957,18 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_TIME_WAIT 60 +/* How many micro seconds is the cutoff from + * local lan type rtt's + */ + /* + * We allow 500us for the rtt and another 500us for the cookie processing + * since we measure this on the first rtt. + */ +#define SCTP_LOCAL_LAN_RTT 1100 +#define SCTP_LAN_UNKNOWN 0 +#define SCTP_LAN_LOCAL 1 +#define SCTP_LAN_INTERNET 2 + #define SCTP_SEND_BUFFER_SPLITTING 0x00000001 #define SCTP_RECV_BUFFER_SPLITTING 0x00000002 @@ -994,6 +1016,7 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) +#define SCTP_GETTIME_TIMESPEC(x) (getnanouptime(x)) #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) #define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) #endif Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:07:32 2012 (r231402) @@ -2955,7 +2955,8 @@ sctp_process_segment_range(struct sctp_t &stcb->asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy); + sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_OK); tp1->do_rtt = 0; } } @@ -3751,7 +3752,7 @@ sctp_window_probe_recovery(struct sctp_t void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, - uint32_t rwnd, int *abort_now) + uint32_t rwnd, int *abort_now, int ecne_seen) { struct sctp_nets *net; struct sctp_association *asoc; @@ -3902,7 +3903,8 @@ sctp_express_handle_sack(struct sctp_tcb sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy); + sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_OK); tp1->do_rtt = 0; } } @@ -3994,7 +3996,7 @@ sctp_express_handle_sack(struct sctp_tcb } /* JRS - Use the congestion control given in the CC module */ - if (asoc->last_acked_seq != cumack) + if ((asoc->last_acked_seq != cumack) && (ecne_seen == 0)) asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, 1, 0, 0); asoc->last_acked_seq = cumack; @@ -4240,7 +4242,7 @@ sctp_handle_sack(struct mbuf *m, int off struct sctp_tcb *stcb, struct sctp_nets *net_from, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, - uint32_t cum_ack, uint32_t rwnd) + uint32_t cum_ack, uint32_t rwnd, int ecne_seen) { struct sctp_association *asoc; struct sctp_tmit_chunk *tp1, *tp2; @@ -4500,7 +4502,8 @@ sctp_handle_sack(struct mbuf *m, int off sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy); + sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_OK); tp1->do_rtt = 0; } } @@ -4754,7 +4757,8 @@ sctp_handle_sack(struct mbuf *m, int off asoc->saw_sack_with_nr_frags = 0; /* JRS - Use the congestion control given in the CC module */ - asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, accum_moved, reneged_all, will_exit_fast_recovery); + if (ecne_seen == 0) + asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, accum_moved, reneged_all, will_exit_fast_recovery); if (TAILQ_EMPTY(&asoc->sent_queue)) { /* nothing left in-flight */ @@ -5077,7 +5081,7 @@ sctp_update_acked(struct sctp_tcb *stcb, a_rwnd = stcb->asoc.peers_rwnd + stcb->asoc.total_flight; /* Now call the express sack handling */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, abort_flag); + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, abort_flag, 0); } static void Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:07:32 2012 (r231402) @@ -93,14 +93,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, - uint32_t rwnd, int *abort_now); + uint32_t rwnd, int *abort_now, int ecne_seen); void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, struct sctp_tcb *stcb, struct sctp_nets *net_from, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, - uint32_t cum_ack, uint32_t rwnd); + uint32_t cum_ack, uint32_t rwnd, int ecne_seen); /* draft-ietf-tsvwg-usctp */ void Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:07:32 2012 (r231402) @@ -481,7 +481,8 @@ sctp_process_init_ack(struct mbuf *m, in asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_4); /* calculate the RTO */ - net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy); + net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_NOTOK); retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { @@ -625,7 +626,8 @@ sctp_handle_heartbeat_ack(struct sctp_he net, net->cwnd); } /* Now lets do a RTO with this */ - r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy); + r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_OK); /* Mobility adaptation */ if (req_prim) { if ((sctp_is_mobility_feature_on(stcb->sctp_ep, @@ -1540,7 +1542,9 @@ sctp_process_cookie_existing(struct mbuf */ net->hb_responded = 1; net->RTO = sctp_calculate_rto(stcb, asoc, net, - &cookie->time_entered, sctp_align_unsafe_makecopy); + &cookie->time_entered, + sctp_align_unsafe_makecopy, + SCTP_DETERMINE_LL_NOTOK); if (stcb->asoc.sctp_autoclose_ticks && (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE))) { @@ -2243,7 +2247,8 @@ sctp_process_cookie_new(struct mbuf *m, (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); if ((netp) && (*netp)) { (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, - &cookie->time_entered, sctp_align_unsafe_makecopy); + &cookie->time_entered, sctp_align_unsafe_makecopy, + SCTP_DETERMINE_LL_NOTOK); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2833,7 +2838,8 @@ sctp_handle_cookie_ack(struct sctp_cooki SCTP_STAT_INCR_GAUGE32(sctps_currestab); if (asoc->overall_error_count == 0) { net->RTO = sctp_calculate_rto(stcb, asoc, net, - &asoc->time_entered, sctp_align_safe_nocopy); + &asoc->time_entered, sctp_align_safe_nocopy, + SCTP_DETERMINE_LL_NOTOK); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); @@ -2941,6 +2947,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch TAILQ_FOREACH(lchk, &stcb->asoc.sent_queue, sctp_next) { if (lchk->rec.data.TSN_seq == tsn) { net = lchk->whoTo; + net->ecn_prev_cwnd = lchk->rec.data.cwnd_at_send; break; } if (SCTP_TSN_GT(lchk->rec.data.TSN_seq, tsn)) { @@ -4198,6 +4205,7 @@ __attribute__((noinline)) uint32_t chk_length; int ret; int abort_no_unlock = 0; + int ecne_seen = 0; /* * How big should this be, and should it be alloc'd? Lets try the @@ -4693,13 +4701,13 @@ process_control_chunks: * with no missing segments to go * this way too. */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now); + sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now, ecne_seen); } else { if (netp && *netp) sctp_handle_sack(m, offset_seg, offset_dup, stcb, *netp, num_seg, 0, num_dup, &abort_now, flags, - cum_ack, a_rwnd); + cum_ack, a_rwnd, ecne_seen); } if (abort_now) { /* ABORT signal from sack processing */ @@ -4782,13 +4790,13 @@ process_control_chunks: * too. */ sctp_express_handle_sack(stcb, cum_ack, a_rwnd, - &abort_now); + &abort_now, ecne_seen); } else { if (netp && *netp) sctp_handle_sack(m, offset_seg, offset_dup, stcb, *netp, num_seg, num_nr_seg, num_dup, &abort_now, flags, - cum_ack, a_rwnd); + cum_ack, a_rwnd, ecne_seen); } if (abort_now) { /* ABORT signal from sack processing */ @@ -5065,6 +5073,7 @@ process_control_chunks: stcb->asoc.overall_error_count = 0; sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, stcb); + ecne_seen = 1; } break; case SCTP_ECN_CWR: Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:07:32 2012 (r231402) @@ -6395,6 +6395,7 @@ sctp_clean_up_datalist(struct sctp_tcb * } /* record time */ data_list[i]->sent_rcv_time = net->last_sent_time; + data_list[i]->rec.data.cwnd_at_send = net->cwnd; data_list[i]->rec.data.fast_retran_tsn = data_list[i]->rec.data.TSN_seq; if (data_list[i]->whoTo == NULL) { data_list[i]->whoTo = net; @@ -9414,7 +9415,7 @@ sctp_chunk_output(struct sctp_inpcb *inp &now, &now_filled, frag_point, so_locked); return; } - if ((asoc->max_burst > 0) && (tot_frs > asoc->max_burst)) { + if ((asoc->fr_max_burst > 0) && (tot_frs >= asoc->fr_max_burst)) { /* Hit FR burst limit */ return; } @@ -10962,6 +10963,27 @@ sctp_send_cwr(struct sctp_tcb *stcb, str asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); + + TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { + if ((chk->rec.chunk_id.id == SCTP_ECN_CWR) && (net == chk->whoTo)) { + /* + * found a previous CWR queued to same destination + * update it if needed + */ + uint32_t ctsn; + + cwr = mtod(chk->data, struct sctp_cwr_chunk *); + ctsn = ntohl(cwr->tsn); + if (SCTP_TSN_GT(high_tsn, ctsn)) { + cwr->tsn = htonl(high_tsn); + } + if (override & SCTP_CWR_REDUCE_OVERRIDE) { + /* Make sure override is carried */ + cwr->ch.chunk_flags |= SCTP_CWR_REDUCE_OVERRIDE; + } + return; + } + } sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { return; Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:07:32 2012 (r231402) @@ -2516,6 +2516,8 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_sws_sender = SCTP_SWS_SENDER_DEF; m->sctp_sws_receiver = SCTP_SWS_RECEIVER_DEF; m->max_burst = SCTP_BASE_SYSCTL(sctp_max_burst_default); + m->fr_max_burst = SCTP_BASE_SYSCTL(sctp_fr_max_burst_default); + m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); m->sctp_default_ss_module = SCTP_BASE_SYSCTL(sctp_default_ss_module); /* number of streams to pre-open on a association */ Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:07:32 2012 (r231402) @@ -318,6 +318,7 @@ struct sctp_pcb { uint32_t adaptation_layer_indicator; uint32_t store_at; uint32_t max_burst; + uint32_t fr_max_burst; char current_secret_number; char last_secret_number; }; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:07:32 2012 (r231402) @@ -237,6 +237,8 @@ struct sctp_nets { uint32_t flight_size; uint32_t cwnd; /* actual cwnd */ uint32_t prev_cwnd; /* cwnd before any processing */ + uint32_t ecn_prev_cwnd; /* ECN prev cwnd at first ecn_echo seen in new + * window */ uint32_t partial_bytes_acked; /* in CA tracks when to incr a MTU */ uint32_t prev_rtt; /* tracking variables to avoid the aloc/free in sack processing */ @@ -318,6 +320,7 @@ struct sctp_nets { uint8_t window_probe; /* Doing a window probe? */ uint8_t RTO_measured; /* Have we done the first measure */ uint8_t last_hs_used; /* index into the last HS table entry we used */ + uint8_t lan_type; /* JRS - struct used in HTCP algorithm */ struct htcp htcp_ca; }; @@ -329,8 +332,7 @@ struct sctp_data_chunkrec { uint16_t stream_number; /* the stream number of this guy */ uint32_t payloadtype; uint32_t context; /* from send */ - - uint8_t fwd_tsn_cnt; + uint32_t cwnd_at_send; /* * part of the Highest sacked algorithm to be able to stroke counts * on ones that are FR'd. @@ -342,6 +344,7 @@ struct sctp_data_chunkrec { * outbound holds sending flags for PR-SCTP. */ uint8_t state_flags; uint8_t chunk_was_revoked; + uint8_t fwd_tsn_cnt; }; TAILQ_HEAD(sctpchunk_listhead, sctp_tmit_chunk); @@ -1052,8 +1055,10 @@ struct sctp_association { */ uint8_t send_sack; - /* max burst after fast retransmit completes */ + /* max burst of new packets into the network */ uint32_t max_burst; + /* max burst of fast retransmit packets */ + uint32_t fr_max_burst; uint8_t sat_network; /* RTT is in range of sat net or greater */ uint8_t sat_network_lockout; /* lockout code */ Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:07:32 2012 (r231402) @@ -59,6 +59,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_strict_init) = SCTPCTL_STRICT_INIT_DEFAULT; SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; + SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue) = SCTPCTL_MAXCHUNKS_DEFAULT; SCTP_BASE_SYSCTL(sctp_hashtblsize) = SCTPCTL_TCBHASHSIZE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pcbtblsize) = SCTPCTL_PCBHASHSIZE_DEFAULT; @@ -576,6 +577,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_init), SCTPCTL_STRICT_INIT_MIN, SCTPCTL_STRICT_INIT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), SCTPCTL_MAXCHUNKS_MIN, SCTPCTL_MAXCHUNKS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_hashtblsize), SCTPCTL_TCBHASHSIZE_MIN, SCTPCTL_TCBHASHSIZE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_pcbtblsize), SCTPCTL_PCBHASHSIZE_MIN, SCTPCTL_PCBHASHSIZE_MAX); @@ -849,6 +851,10 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ma &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXBURST_DESC); +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, "IU", + SCTPCTL_FRMAXBURST_DESC); + SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXCHUNKS_DESC); Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 19:07:32 2012 (r231402) @@ -43,7 +43,7 @@ struct sctp_sysctl { uint32_t sctp_auto_asconf; uint32_t sctp_multiple_asconfs; uint32_t sctp_ecn_enable; - uint32_t sctp_not_used; + uint32_t sctp_fr_max_burst_default; uint32_t sctp_strict_sacks; #if !defined(SCTP_WITH_NO_CSUM) uint32_t sctp_no_csum_on_loopback; @@ -182,6 +182,13 @@ struct sctp_sysctl { #define SCTPCTL_MAXBURST_MAX 0xFFFFFFFF #define SCTPCTL_MAXBURST_DEFAULT SCTP_DEF_MAX_BURST +/* fr_maxburst: Default max burst for sctp endpoints when fast retransmitting */ +#define SCTPCTL_FRMAXBURST_DESC "Default fr max burst for sctp endpoints" +#define SCTPCTL_FRMAXBURST_MIN 0 +#define SCTPCTL_FRMAXBURST_MAX 0xFFFFFFFF +#define SCTPCTL_FRMAXBURST_DEFAULT SCTP_DEF_FRMAX_BURST + + /* maxchunks: Default max chunks on queue per asoc */ #define SCTPCTL_MAXCHUNKS_DESC "Default max chunks on queue per asoc" #define SCTPCTL_MAXCHUNKS_MIN 0 @@ -402,7 +409,7 @@ struct sctp_sysctl { #define SCTPCTL_HB_MAX_BURST_DESC "Confirmation Heartbeat max burst" #define SCTPCTL_HB_MAX_BURST_MIN 1 #define SCTPCTL_HB_MAX_BURST_MAX 0xFFFFFFFF -#define SCTPCTL_HB_MAX_BURST_DEFAULT SCTP_DEF_MAX_BURST +#define SCTPCTL_HB_MAX_BURST_DEFAULT SCTP_DEF_HBMAX_BURST /* abort_at_limit: When one-2-one hits qlimit abort */ #define SCTPCTL_ABORT_AT_LIMIT_DESC "When one-2-one hits qlimit abort" Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:07:32 2012 (r231402) @@ -1630,7 +1630,8 @@ sctp_heartbeat_timer(struct sctp_inpcb * else if (ret == 0) { break; } - if (cnt_sent >= SCTP_BASE_SYSCTL(sctp_hb_maxburst)) + if (SCTP_BASE_SYSCTL(sctp_hb_maxburst) && + (cnt_sent >= SCTP_BASE_SYSCTL(sctp_hb_maxburst))) break; } } Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:07:32 2012 (r231402) @@ -913,6 +913,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str /* init all variables to a known value. */ SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_INUSE); asoc->max_burst = m->sctp_ep.max_burst; + asoc->fr_max_burst = m->sctp_ep.fr_max_burst; asoc->heart_beat_delay = TICKS_TO_MSEC(m->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]); asoc->cookie_life = m->sctp_ep.def_cookie_life; asoc->sctp_cmt_on_off = m->sctp_cmt_on_off; @@ -2459,12 +2460,13 @@ sctp_mtu_size_reset(struct sctp_inpcb *i * given an association and starting time of the current RTT period return * RTO in number of msecs net should point to the current network */ + uint32_t sctp_calculate_rto(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_nets *net, struct timeval *told, - int safe) + int safe, int local_lan_determine) { /*- * given an association and the starting time of the current RTT @@ -2492,13 +2494,21 @@ sctp_calculate_rto(struct sctp_tcb *stcb /************************/ /* get the current time */ (void)SCTP_GETTIME_TIMEVAL(&now); - /* * Record the real time of the last RTT for use in DC-CC. */ net->last_measured_rtt = now; timevalsub(&net->last_measured_rtt, old); + /* Do we need to determine the lan type? */ + if ((local_lan_determine == SCTP_DETERMINE_LL_OK) && (net->lan_type == SCTP_LAN_UNKNOWN)) { + if ((net->last_measured_rtt.tv_sec) || + (net->last_measured_rtt.tv_usec > SCTP_LOCAL_LAN_RTT)) { + net->lan_type = SCTP_LAN_INTERNET; + } else { + net->lan_type = SCTP_LAN_LOCAL; + } + } /* compute the RTT value */ if ((u_long)now.tv_sec > (u_long)old->tv_sec) { calc_time = ((u_long)now.tv_sec - (u_long)old->tv_sec) * 1000; Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Fri Feb 10 19:04:26 2012 (r231401) +++ stable/8/sys/netinet/sctputil.h Fri Feb 10 19:07:32 2012 (r231402) @@ -132,7 +132,7 @@ void uint32_t sctp_calculate_rto(struct sctp_tcb *, struct sctp_association *, - struct sctp_nets *, struct timeval *, int); + struct sctp_nets *, struct timeval *, int, int); uint32_t sctp_calculate_len(struct mbuf *); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:10:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F4191065677; Fri, 10 Feb 2012 19:10:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC8D8FC14; Fri, 10 Feb 2012 19:10: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 q1AJAApA089091; Fri, 10 Feb 2012 19:10:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJAA9C089081; Fri, 10 Feb 2012 19:10:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101910.q1AJAA9C089081@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231403 - in stable/8/sys: conf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:10:11 -0000 Author: tuexen Date: Fri Feb 10 19:10:09 2012 New Revision: 231403 URL: http://svn.freebsd.org/changeset/base/231403 Log: MFC r218211: Adds an experimental option to create a pool of threads. These serve as input threads and are queued packets based on the V-tag number. This is similar to what a modern card can do with queue's for TCP... but alas modern cards know nothing about SCTP. From rrs@. Modified: stable/8/sys/conf/options stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_lock_bsd.h stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/conf/options Fri Feb 10 19:10:09 2012 (r231403) @@ -438,6 +438,7 @@ SCTP_PACKET_LOGGING opt_sctp.h # Log to SCTP_LTRACE_CHUNKS opt_sctp.h # Log to KTR chunks processed SCTP_LTRACE_ERRORS opt_sctp.h # Log to KTR error returns. SCTP_USE_PERCPU_STAT opt_sctp.h # Use per cpu stats. +SCTP_MCORE_INPUT opt_sctp.h # Have multiple input threads for input mbufs # # # Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 19:10:09 2012 (r231403) @@ -68,6 +68,7 @@ MALLOC_DEFINE(SCTP_M_TIMW, "sctp_timw", MALLOC_DEFINE(SCTP_M_MVRF, "sctp_mvrf", "sctp mvrf pcb list"); MALLOC_DEFINE(SCTP_M_ITER, "sctp_iter", "sctp iterator control"); MALLOC_DEFINE(SCTP_M_SOCKOPT, "sctp_socko", "sctp socket option"); +MALLOC_DEFINE(SCTP_M_MCORE, "sctp_mcore", "sctp mcore queue"); /* Global NON-VNET structure that controls the iterator */ struct iterator_control sctp_it_ctl; Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:10:09 2012 (r231403) @@ -91,6 +91,8 @@ __FBSDID("$FreeBSD$"); #define SCTP_KTRHEAD_NAME "sctp_iterator" #define SCTP_KTHREAD_PAGES 0 +#define SCTP_MCORE_NAME "sctp_core_worker" + /* If you support Multi-VRF how big to * make the initial array of VRF's to. Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:10:09 2012 (r231403) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include @@ -5923,10 +5924,32 @@ bad: } return; } + + void -sctp_input(i_pak, off) - struct mbuf *i_pak; - int off; +sctp_input(struct mbuf *m, int off) { - sctp_input_with_port(i_pak, off, 0); +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) + struct ip *ip; + struct sctphdr *sh; + int offset; + int cpu_to_use; + + if (mp_ncpus > 1) { + ip = mtod(m, struct ip *); + offset = off + sizeof(*sh); + if (SCTP_BUF_LEN(m) < offset) { + if ((m = m_pullup(m, offset)) == 0) { + SCTP_STAT_INCR(sctps_hdrops); + return; + } + ip = mtod(m, struct ip *); + } + sh = (struct sctphdr *)((caddr_t)ip + off); + cpu_to_use = ntohl(sh->v_tag) % mp_ncpus; + sctp_queue_to_mcore(m, off, cpu_to_use); + return; + } +#endif + sctp_input_with_port(m, off, 0); } Modified: stable/8/sys/netinet/sctp_lock_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_lock_bsd.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_lock_bsd.h Fri Feb 10 19:10:09 2012 (r231403) @@ -97,6 +97,48 @@ extern int sctp_logoff_stuff; rw_rlock(&SCTP_BASE_INFO(ipi_ep_mtx)); \ } while (0) +#define SCTP_MCORE_QLOCK_INIT(cpstr) do { \ + mtx_init(&(cpstr)->que_mtx, \ + "sctp-mcore_queue","queue_lock", \ + MTX_DEF|MTX_DUPOK); \ +} while (0) + +#define SCTP_MCORE_QLOCK(cpstr) do { \ + mtx_lock(&(cpstr)->que_mtx); \ +} while (0) + +#define SCTP_MCORE_QUNLOCK(cpstr) do { \ + mtx_unlock(&(cpstr)->que_mtx); \ +} while (0) + +#define SCTP_MCORE_QDESTROY(cpstr) do { \ + if(mtx_owned(&(cpstr)->core_mtx)) { \ + mtx_unlock(&(cpstr)->que_mtx); \ + } \ + mtx_destroy(&(cpstr)->que_mtx); \ +} while (0) + + +#define SCTP_MCORE_LOCK_INIT(cpstr) do { \ + mtx_init(&(cpstr)->core_mtx, \ + "sctp-cpulck","cpu_proc_lock", \ + MTX_DEF|MTX_DUPOK); \ +} while (0) + +#define SCTP_MCORE_LOCK(cpstr) do { \ + mtx_lock(&(cpstr)->core_mtx); \ +} while (0) + +#define SCTP_MCORE_UNLOCK(cpstr) do { \ + mtx_unlock(&(cpstr)->core_mtx); \ +} while (0) + +#define SCTP_MCORE_DESTROY(cpstr) do { \ + if(mtx_owned(&(cpstr)->core_mtx)) { \ + mtx_unlock(&(cpstr)->core_mtx); \ + } \ + mtx_destroy(&(cpstr)->core_mtx); \ +} while (0) #define SCTP_INP_INFO_WLOCK() do { \ rw_wlock(&SCTP_BASE_INFO(ipi_ep_mtx)); \ Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 19:10:09 2012 (r231403) @@ -123,6 +123,7 @@ MALLOC_DECLARE(SCTP_M_TIMW); MALLOC_DECLARE(SCTP_M_MVRF); MALLOC_DECLARE(SCTP_M_ITER); MALLOC_DECLARE(SCTP_M_SOCKOPT); +MALLOC_DECLARE(SCTP_M_MCORE); #if defined(SCTP_LOCAL_TRACE_BUF) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:10:09 2012 (r231403) @@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include VNET_DEFINE(struct sctp_base_info, system_base_info); @@ -5435,6 +5438,148 @@ sctp_del_local_addr_restricted(struct sc static int sctp_max_number_of_assoc = SCTP_MAX_NUM_OF_ASOC; static int sctp_scale_up_for_address = SCTP_SCALE_FOR_ADDR; + + +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +struct sctp_mcore_ctrl *sctp_mcore_workers = NULL; + +void +sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use) +{ + /* Queue a packet to a processor for the specified core */ + struct sctp_mcore_queue *qent; + struct sctp_mcore_ctrl *wkq; + int need_wake = 0; + + if (sctp_mcore_workers == NULL) { + /* Something went way bad during setup */ + sctp_input_with_port(m, off, 0); + return; + } + SCTP_MALLOC(qent, struct sctp_mcore_queue *, + (sizeof(struct sctp_mcore_queue)), + SCTP_M_MCORE); + if (qent == NULL) { + /* This is trouble */ + sctp_input_with_port(m, off, 0); + return; + } + qent->vn = curvnet; + qent->m = m; + qent->off = off; + qent->v6 = 0; + wkq = &sctp_mcore_workers[cpu_to_use]; + SCTP_MCORE_QLOCK(wkq); + + TAILQ_INSERT_TAIL(&wkq->que, qent, next); + if (wkq->running == 0) { + need_wake = 1; + } + SCTP_MCORE_QUNLOCK(wkq); + if (need_wake) { + wakeup(&wkq->running); + } +} + +static void +sctp_mcore_thread(void *arg) +{ + + struct sctp_mcore_ctrl *wkq; + struct sctp_mcore_queue *qent; + + wkq = (struct sctp_mcore_ctrl *)arg; + struct mbuf *m; + int off, v6; + + /* Wait for first tickle */ + SCTP_MCORE_LOCK(wkq); + wkq->running = 0; + msleep(&wkq->running, + &wkq->core_mtx, + 0, "wait for pkt", 0); + SCTP_MCORE_UNLOCK(wkq); + + /* Bind to our cpu */ + thread_lock(curthread); + sched_bind(curthread, wkq->cpuid); + thread_unlock(curthread); + + /* Now lets start working */ + SCTP_MCORE_LOCK(wkq); + /* Now grab lock and go */ + while (1) { + SCTP_MCORE_QLOCK(wkq); +skip_sleep: + wkq->running = 1; + qent = TAILQ_FIRST(&wkq->que); + if (qent) { + TAILQ_REMOVE(&wkq->que, qent, next); + SCTP_MCORE_QUNLOCK(wkq); + CURVNET_SET(qent->vn); + m = qent->m; + off = qent->off; + v6 = qent->v6; + SCTP_FREE(qent, SCTP_M_MCORE); + if (v6 == 0) { + sctp_input_with_port(m, off, 0); + } else { + printf("V6 not yet supported\n"); + sctp_m_freem(m); + } + CURVNET_RESTORE(); + SCTP_MCORE_QLOCK(wkq); + } + wkq->running = 0; + if (!TAILQ_EMPTY(&wkq->que)) { + goto skip_sleep; + } + SCTP_MCORE_QUNLOCK(wkq); + msleep(&wkq->running, + &wkq->core_mtx, + 0, "wait for pkt", 0); + }; +} + +static void +sctp_startup_mcore_threads(void) +{ + int i; + + if (mp_ncpus == 1) + return; + + SCTP_MALLOC(sctp_mcore_workers, struct sctp_mcore_ctrl *, + (mp_ncpus * sizeof(struct sctp_mcore_ctrl)), + SCTP_M_MCORE); + if (sctp_mcore_workers == NULL) { + /* TSNH I hope */ + return; + } + memset(sctp_mcore_workers, 0, (mp_ncpus * + sizeof(struct sctp_mcore_ctrl))); + /* Init the structures */ + for (i = 0; i < mp_ncpus; i++) { + TAILQ_INIT(&sctp_mcore_workers[i].que); + SCTP_MCORE_LOCK_INIT(&sctp_mcore_workers[i]); + SCTP_MCORE_QLOCK_INIT(&sctp_mcore_workers[i]); + sctp_mcore_workers[i].cpuid = i; + } + /* Now start them all */ + for (i = 0; i < mp_ncpus; i++) { + (void)kproc_create(sctp_mcore_thread, + (void *)&sctp_mcore_workers[i], + &sctp_mcore_workers[i].thread_proc, + RFPROC, + SCTP_KTHREAD_PAGES, + SCTP_MCORE_NAME); + + } +} + +#endif + + void sctp_pcb_init() { @@ -5565,6 +5710,10 @@ sctp_pcb_init() sctp_startup_iterator(); +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) + sctp_startup_mcore_threads(); +#endif + /* * INIT the default VRF which for BSD is the only one, other O/S's * may have more. But initially they must start with one and then Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:10:09 2012 (r231403) @@ -624,6 +624,12 @@ sctp_initiate_iterator(inp_func inpf, struct sctp_inpcb *, uint8_t co_off); +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +void + sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use); + +#endif + #ifdef INVARIANTS void sctp_validate_no_locks(struct sctp_inpcb *inp); Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:07:32 2012 (r231402) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:10:09 2012 (r231403) @@ -106,6 +106,31 @@ typedef void (*asoc_func) (struct sctp_i typedef int (*inp_func) (struct sctp_inpcb *, void *ptr, uint32_t val); typedef void (*end_func) (void *ptr, uint32_t val); +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +/* whats on the mcore control struct */ +struct sctp_mcore_queue { + TAILQ_ENTRY(sctp_mcore_queue) next; + struct vnet *vn; + struct mbuf *m; + int off; + int v6; +}; + +TAILQ_HEAD(sctp_mcore_qhead, sctp_mcore_queue); + +struct sctp_mcore_ctrl { + SCTP_PROCESS_STRUCT thread_proc; + struct sctp_mcore_qhead que; + struct mtx core_mtx; + struct mtx que_mtx; + int running; + int cpuid; +}; + + +#endif + + struct sctp_iterator { TAILQ_ENTRY(sctp_iterator) sctp_nxt_itr; struct vnet *vn; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:12:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C58C51065674; Fri, 10 Feb 2012 19:12:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEE238FC16; Fri, 10 Feb 2012 19:12: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 q1AJCNcQ089220; Fri, 10 Feb 2012 19:12:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJCNu0089215; Fri, 10 Feb 2012 19:12:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101912.q1AJCNu0089215@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231404 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:12:23 -0000 Author: tuexen Date: Fri Feb 10 19:12:23 2012 New Revision: 231404 URL: http://svn.freebsd.org/changeset/base/231404 Log: MFC r218219: Fix the per CPU stats so that: 1) They don't use the giant "MAX_CPU" define and instead are allocated dynamically based on mp_ncpus 2) Will zero with the netstat -z -s -p sctp 3) Will be properly handled by both the sctp_init and finish (the multi-net stuff was incorrectly bzero'ing in sctp_init the wrong size.. the bzero is now moved to the right places). And of course the free is put in at the very end. From rrs@. Modified: stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:10:09 2012 (r231403) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:12:23 2012 (r231404) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -5599,11 +5602,18 @@ sctp_pcb_init() #if defined(SCTP_LOCAL_TRACE_BUF) bzero(&SCTP_BASE_SYSCTL(sctp_log), sizeof(struct sctp_log)); #endif +#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *, + (mp_ncpus * sizeof(struct sctpstat)), + SCTP_M_MCORE); +#endif (void)SCTP_GETTIME_TIMEVAL(&tv); #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_ncpus)); SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t) tv.tv_sec; SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t) tv.tv_usec; #else + bzero(&SCTP_BASE_STATS, sizeof(struct sctpstat)); SCTP_BASE_STAT(sctps_discontinuitytime).tv_sec = (uint32_t) tv.tv_sec; SCTP_BASE_STAT(sctps_discontinuitytime).tv_usec = (uint32_t) tv.tv_usec; #endif @@ -5846,7 +5856,9 @@ sctp_pcb_finish(void) SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_ephash), SCTP_BASE_INFO(hashmark)); if (SCTP_BASE_INFO(sctp_tcpephash) != NULL) SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_tcpephash), SCTP_BASE_INFO(hashtcpmark)); - +#if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) + SCTP_FREE(SCTP_BASE_STATS, SCTP_M_MCORE); +#endif } Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:10:09 2012 (r231403) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:12:23 2012 (r231404) @@ -1,6 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -240,7 +242,7 @@ struct sctp_base_info { */ struct sctp_epinfo sctppcbinfo; #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - struct sctpstat sctpstat[MAXCPU]; + struct sctpstat *sctpstat; #else struct sctpstat sctpstat; #endif Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:10:09 2012 (r231403) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:12:23 2012 (r231404) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -648,8 +651,18 @@ static int sysctl_stat_get(SYSCTL_HANDLER_ARGS) { int cpu, error; - struct sctpstat sb, *sarry; + struct sctpstat sb, *sarry, *cpin = NULL; + if ((req->newptr) && (req->newlen == sizeof(struct sctpstat))) { + /* + * User wants us to clear or at least reset the counters to + * the specified values. + */ + cpin = (struct sctpstat *)req->newptr; + } else if (req->newptr) { + /* Must be a stat structure */ + return (EINVAL); + } memset(&sb, 0, sizeof(sb)); for (cpu = 0; cpu < mp_ncpus; cpu++) { sarry = &SCTP_BASE_STATS[cpu]; @@ -789,6 +802,9 @@ sysctl_stat_get(SYSCTL_HANDLER_ARGS) sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid; sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid; sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over; + if (cpin) { + memcpy(sarry, cpin, sizeof(struct sctpstat)); + } } error = SYSCTL_OUT(req, &sb, sizeof(sb)); return (error); @@ -1099,7 +1115,7 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ou #endif #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SYSCTL_PROC(_net_inet_sctp, OID_AUTO, stats, - CTLTYPE_STRUCT | CTLFLAG_RD, + CTLTYPE_STRUCT | CTLFLAG_RW, 0, 0, sysctl_stat_get, "S,sctpstat", "SCTP statistics (struct sctp_stat)"); #else Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:10:09 2012 (r231403) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:12:23 2012 (r231404) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -60,8 +63,6 @@ sctp_init(void) { u_long sb_max_adj; - bzero(&SCTP_BASE_STATS, sizeof(struct sctpstat)); - /* Initialize and modify the sysctled variables */ sctp_init_sysctls(); if ((nmbclusters / 8) > SCTP_ASOC_MAX_CHUNKS_ON_QUEUE) From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:15:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA73106564A; Fri, 10 Feb 2012 19:15:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFF648FC0A; Fri, 10 Feb 2012 19:15: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 q1AJF5ru089354; Fri, 10 Feb 2012 19:15:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJF5Cb089347; Fri, 10 Feb 2012 19:15:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101915.q1AJF5Cb089347@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:15:05 +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: r231405 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:15:06 -0000 Author: tuexen Date: Fri Feb 10 19:15:05 2012 New Revision: 231405 URL: http://svn.freebsd.org/changeset/base/231405 Log: MFC r218232: 1) Move per John Baldwin to mp_maxid 2) Some signed/unsigned errors found by Mac OS compiler (from Michael) 3) a couple of copyright updates on the effected files. From rrs@. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_sysctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -1348,7 +1351,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * TAILQ_INSERT_TAIL(&stcb->asoc.asconf_queue, aa, next); #ifdef SCTP_DEBUG - if (SCTP_BASE_SYSCTL(sctp_debug_on) && SCTP_DEBUG_ASCONF2) { + if (SCTP_BASE_SYSCTL(sctp_debug_on) & SCTP_DEBUG_ASCONF2) { if (type == SCTP_ADD_IP_ADDRESS) { SCTP_PRINTF("asconf_queue_mgmt: inserted asconf ADD_IP_ADDRESS: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF2, sa); Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -375,8 +378,6 @@ sctp_cwnd_update_after_sack(struct sctp_ } } else { /* We are in congestion avoidance */ - uint32_t incr; - /* * Add to pba */ @@ -514,7 +515,8 @@ sctp_cwnd_update_after_packet_dropped(st uint32_t * bottle_bw, uint32_t * on_queue) { uint32_t bw_avail; - int rtt, incr; + int rtt; + unsigned int incr; int old_cwnd = net->cwnd; /* need real RTT for this calc */ Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -915,11 +918,11 @@ __FBSDID("$FreeBSD$"); /* modular comparison */ /* See RFC 1982 for details. */ -#define SCTP_SSN_GT(a, b) (((a < b) && ((b - a) > (1<<15))) || \ - ((a > b) && ((a - b) < (1<<15)))) +#define SCTP_SSN_GT(a, b) (((a < b) && ((uint16_t)(b - a) > (1U<<15))) || \ + ((a > b) && ((uint16_t)(a - b) < (1U<<15)))) #define SCTP_SSN_GE(a, b) (SCTP_SSN_GT(a, b) || (a == b)) -#define SCTP_TSN_GT(a, b) (((a < b) && ((b - a) > (1<<31))) || \ - ((a > b) && ((a - b) < (1<<31)))) +#define SCTP_TSN_GT(a, b) (((a < b) && ((uint32_t)(b - a) > (1U<<31))) || \ + ((a > b) && ((uint32_t)(a - b) < (1U<<31)))) #define SCTP_TSN_GE(a, b) (SCTP_TSN_GT(a, b) || (a == b)) /* Mapping array manipulation routines */ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -2920,7 +2923,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch uint8_t override_bit = 0; uint32_t tsn, window_data_tsn; int len; - int pkt_cnt; + unsigned int pkt_cnt; len = ntohs(cp->ch.chunk_length); if ((len != sizeof(struct sctp_ecne_chunk)) && @@ -5935,7 +5938,7 @@ sctp_input(struct mbuf *m, int off) int offset; int cpu_to_use; - if (mp_ncpus > 1) { + if (mp_maxid > 1) { ip = mtod(m, struct ip *); offset = off + sizeof(*sh); if (SCTP_BUF_LEN(m) < offset) { @@ -5946,7 +5949,7 @@ sctp_input(struct mbuf *m, int off) ip = mtod(m, struct ip *); } sh = (struct sctphdr *)((caddr_t)ip + off); - cpu_to_use = ntohl(sh->v_tag) % mp_ncpus; + cpu_to_use = ntohl(sh->v_tag) % mp_maxid; sctp_queue_to_mcore(m, off, cpu_to_use); return; } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:15:05 2012 (r231405) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -9311,14 +9314,15 @@ sctp_chunk_output(struct sctp_inpcb *inp */ struct sctp_association *asoc; struct sctp_nets *net; - int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0, - burst_cnt = 0; + int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0; + unsigned int burst_cnt = 0; struct timeval now; int now_filled = 0; int nagle_on = 0; int frag_point = sctp_get_frag_point(stcb, &stcb->asoc); int un_sent = 0; - int fr_done, tot_frs = 0; + int fr_done; + unsigned int tot_frs = 0; asoc = &stcb->asoc; if (from_where == SCTP_OUTPUT_FROM_USR_SEND) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:15:05 2012 (r231405) @@ -5549,27 +5549,27 @@ sctp_startup_mcore_threads(void) { int i; - if (mp_ncpus == 1) + if (mp_maxid == 1) return; SCTP_MALLOC(sctp_mcore_workers, struct sctp_mcore_ctrl *, - (mp_ncpus * sizeof(struct sctp_mcore_ctrl)), + (mp_maxid * sizeof(struct sctp_mcore_ctrl)), SCTP_M_MCORE); if (sctp_mcore_workers == NULL) { /* TSNH I hope */ return; } - memset(sctp_mcore_workers, 0, (mp_ncpus * + memset(sctp_mcore_workers, 0, (mp_maxid * sizeof(struct sctp_mcore_ctrl))); /* Init the structures */ - for (i = 0; i < mp_ncpus; i++) { + for (i = 0; i < mp_maxid; i++) { TAILQ_INIT(&sctp_mcore_workers[i].que); SCTP_MCORE_LOCK_INIT(&sctp_mcore_workers[i]); SCTP_MCORE_QLOCK_INIT(&sctp_mcore_workers[i]); sctp_mcore_workers[i].cpuid = i; } /* Now start them all */ - for (i = 0; i < mp_ncpus; i++) { + for (i = 0; i < mp_maxid; i++) { (void)kproc_create(sctp_mcore_thread, (void *)&sctp_mcore_workers[i], &sctp_mcore_workers[i].thread_proc, @@ -5604,12 +5604,12 @@ sctp_pcb_init() #endif #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *, - (mp_ncpus * sizeof(struct sctpstat)), + (mp_maxid * sizeof(struct sctpstat)), SCTP_M_MCORE); #endif (void)SCTP_GETTIME_TIMEVAL(&tv); #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_ncpus)); + bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_maxid)); SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t) tv.tv_sec; SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t) tv.tv_usec; #else Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:12:23 2012 (r231404) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:15:05 2012 (r231405) @@ -664,7 +664,7 @@ sysctl_stat_get(SYSCTL_HANDLER_ARGS) return (EINVAL); } memset(&sb, 0, sizeof(sb)); - for (cpu = 0; cpu < mp_ncpus; cpu++) { + for (cpu = 0; cpu < mp_maxid; cpu++) { sarry = &SCTP_BASE_STATS[cpu]; if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { sb.sctps_discontinuitytime.tv_sec = sarry->sctps_discontinuitytime.tv_sec; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:17:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDC1C106566B; Fri, 10 Feb 2012 19:17:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C87018FC0C; Fri, 10 Feb 2012 19:17: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 q1AJHE3Z089467; Fri, 10 Feb 2012 19:17:14 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJHEGl089465; Fri, 10 Feb 2012 19:17:14 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202101917.q1AJHEGl089465@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 19:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231406 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:17:15 -0000 Author: gonzo Date: Fri Feb 10 19:17:14 2012 New Revision: 231406 URL: http://svn.freebsd.org/changeset/base/231406 Log: - Fix spelling of R_MIPS_RELGOT - Add R_MIPS_JALR relocation - Add TLS relocation types Obtained from: NetBSD Modified: head/sys/mips/include/elf.h Modified: head/sys/mips/include/elf.h ============================================================================== --- head/sys/mips/include/elf.h Fri Feb 10 19:15:05 2012 (r231405) +++ head/sys/mips/include/elf.h Fri Feb 10 19:17:14 2012 (r231406) @@ -189,9 +189,27 @@ typedef struct { #define R_MIPS_REL16 33 #define R_MIPS_ADD_IMMEDIATE 34 #define R_MIPS_PJUMP 35 -#define R_MIPS_ERLGOT 36 +#define R_MIPS_RELGOT 36 +#define R_MIPS_JALR 37 -#define R_MIPS_max 37 +/* + * TLS relocations + */ +#define R_MIPS_TLS_DTPMOD32 38 /* Module number 32 bit */ +#define R_MIPS_TLS_DTPREL32 39 /* Module-relative offset 32 bit */ +#define R_MIPS_TLS_DTPMOD64 40 /* Module number 64 bit */ +#define R_MIPS_TLS_DTPREL64 41 /* Module-relative offset 64 bit */ +#define R_MIPS_TLS_GD 42 /* 16 bit GOT offset for GD */ +#define R_MIPS_TLS_LDM 43 /* 16 bit GOT offset for LDM */ +#define R_MIPS_TLS_DTPREL_HI16 44 /* Module-relative offset, high 16 bits */ +#define R_MIPS_TLS_DTPREL_LO16 45 /* Module-relative offset, low 16 bits */ +#define R_MIPS_TLS_GOTTPREL 46 /* 16 bit GOT offset for IE */ +#define R_MIPS_TLS_TPREL32 47 /* TP-relative offset, 32 bit */ +#define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */ +#define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */ +#define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */ + +#define R_MIPS_max 51 #define R_TYPE(name) __CONCAT(R_MIPS_,name) /* Define "machine" characteristics */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:19:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D11A106564A; Fri, 10 Feb 2012 19:19:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2789C8FC0C; Fri, 10 Feb 2012 19:19: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 q1AJJGOM089568; Fri, 10 Feb 2012 19:19:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJJFE6089560; Fri, 10 Feb 2012 19:19:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101919.q1AJJFE6089560@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:19:15 +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: r231407 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:19:16 -0000 Author: tuexen Date: Fri Feb 10 19:19:15 2012 New Revision: 231407 URL: http://svn.freebsd.org/changeset/base/231407 Log: MFC r218235: Make sure that changing the ECN sysctl does not affect exisiting associations and endpoints. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_peeloff.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:19:15 2012 (r231407) @@ -2721,6 +2721,7 @@ sctp_handle_cookie_echo(struct mbuf *m, inp->sctp_socket = so; inp->sctp_frag_point = (*inp_p)->sctp_frag_point; inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off; + inp->sctp_ecn_enable = (*inp_p)->sctp_ecn_enable; inp->partial_delivery_point = (*inp_p)->partial_delivery_point; inp->sctp_context = (*inp_p)->sctp_context; inp->inp_starting_point_for_iterator = NULL; @@ -5616,7 +5617,8 @@ sctp_common_input_processing(struct mbuf */ } /* take care of ecn */ - if (stcb->asoc.ecn_allowed && ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS)) { + if ((stcb->asoc.ecn_allowed == 1) && + ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS)) { /* Yep, we need to add a ECNE */ sctp_send_ecn_echo(stcb, net, high_tsn); } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:19:15 2012 (r231407) @@ -3392,10 +3392,11 @@ static uint8_t sctp_get_ect(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk) { - if (SCTP_BASE_SYSCTL(sctp_ecn_enable) == 0) + if ((stcb != NULL) && (stcb->asoc.ecn_allowed == 1)) { + return (SCTP_ECT0_BIT); + } else { return (0); - - return (SCTP_ECT0_BIT); + } } static int @@ -3502,17 +3503,9 @@ sctp_lowlevel_chunk_output(struct sctp_i ip->ip_ttl = inp->ip_inp.inp.inp_ip_ttl; ip->ip_len = packet_length; - if (stcb) { - if ((stcb->asoc.ecn_allowed) && ecn_ok) { - /* Enable ECN */ - ip->ip_tos = ((u_char)(tos_value & 0xfc) | sctp_get_ect(stcb, chk)); - } else { - /* No ECN */ - ip->ip_tos = (u_char)(tos_value & 0xfc); - } - } else { - /* no association at all */ - ip->ip_tos = (tos_value & 0xfc); + ip->ip_tos = tos_value & 0xfc; + if (ecn_ok) { + ip->ip_tos |= sctp_get_ect(stcb, chk); } if (port) { ip->ip_p = IPPROTO_UDP; @@ -3839,18 +3832,11 @@ sctp_lowlevel_chunk_output(struct sctp_i } else { ro = (sctp_route_t *) & net->ro; } - if (stcb != NULL) { - if ((stcb->asoc.ecn_allowed) && ecn_ok) { - /* Enable ECN */ - tosBottom = (((((struct in6pcb *)inp)->in6p_flowinfo & 0x0c) | sctp_get_ect(stcb, chk)) << 4); - } else { - /* No ECN */ - tosBottom = ((((struct in6pcb *)inp)->in6p_flowinfo & 0x0c) << 4); - } - } else { - /* we could get no asoc if it is a O-O-T-B packet */ - tosBottom = ((((struct in6pcb *)inp)->in6p_flowinfo & 0x0c) << 4); + tosBottom = (((struct in6pcb *)inp)->in6p_flowinfo & 0x0c); + if (ecn_ok) { + tosBottom |= sctp_get_ect(stcb, chk); } + tosBottom <<= 4; ip6h->ip6_flow = htonl(((tosTop << 24) | ((tosBottom | flowTop) << 16) | flowBottom)); if (port) { ip6h->ip6_nxt = IPPROTO_UDP; @@ -4247,7 +4233,7 @@ sctp_send_initiate(struct sctp_inpcb *in stcb->asoc.cookie_preserve_req = 0; } /* ECN parameter */ - if (SCTP_BASE_SYSCTL(sctp_ecn_enable) == 1) { + if (stcb->asoc.ecn_allowed == 1) { ecn->ph.param_type = htons(SCTP_ECN_CAPABLE); ecn->ph.param_length = htons(sizeof(*ecn)); SCTP_BUF_LEN(m) += sizeof(*ecn); @@ -5350,7 +5336,8 @@ do_a_abort: ecn = (struct sctp_ecn_supported_param *)((caddr_t)ali + sizeof(*ali)); /* ECN parameter */ - if (SCTP_BASE_SYSCTL(sctp_ecn_enable) == 1) { + if (((asoc != NULL) && (asoc->ecn_allowed == 1)) || + (inp->sctp_ecn_enable == 1)) { ecn->ph.param_type = htons(SCTP_ECN_CAPABLE); ecn->ph.param_length = htons(sizeof(*ecn)); SCTP_BUF_LEN(m) += sizeof(*ecn); Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:19:15 2012 (r231407) @@ -2399,6 +2399,7 @@ sctp_inpcb_alloc(struct socket *so, uint inp->partial_delivery_point = SCTP_SB_LIMIT_RCV(so) >> SCTP_PARTIAL_DELIVERY_SHIFT; inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT; inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); + inp->sctp_ecn_enable = SCTP_BASE_SYSCTL(sctp_ecn_enable); /* init the small hash table we use to track asocid <-> tcb */ inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark); if (inp->sctp_asocidhash == NULL) { @@ -5899,6 +5900,7 @@ sctp_load_addresses_from_init(struct sct sctp_key_t *new_key; uint32_t keylen; int got_random = 0, got_hmacs = 0, got_chklist = 0; + uint8_t ecn_allowed; /* First get the destination address setup too. */ memset(&sin, 0, sizeof(sin)); @@ -5959,7 +5961,7 @@ sctp_load_addresses_from_init(struct sct sa = altsa; } /* Turn off ECN until we get through all params */ - stcb->asoc.ecn_allowed = 0; + ecn_allowed = 0; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { /* mark all addresses that we have currently on the list */ net->dest_state |= SCTP_ADDR_NOT_IN_ASSOC; @@ -6192,7 +6194,7 @@ sctp_load_addresses_from_init(struct sct } } } else if (ptype == SCTP_ECN_CAPABLE) { - stcb->asoc.ecn_allowed = 1; + ecn_allowed = 1; } else if (ptype == SCTP_ULP_ADAPTATION) { if (stcb->asoc.state != SCTP_STATE_OPEN) { struct sctp_adaptation_layer_indication ai, @@ -6431,6 +6433,9 @@ next_param: } } } + if (ecn_allowed == 0) { + stcb->asoc.ecn_allowed = 0; + } /* validate authentication required parameters */ if (got_random && got_hmacs) { stcb->asoc.peer_supports_auth = 1; Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:19:15 2012 (r231407) @@ -394,6 +394,7 @@ struct sctp_inpcb { uint32_t partial_delivery_point; uint32_t sctp_context; uint32_t sctp_cmt_on_off; + uint32_t sctp_ecn_enable; struct sctp_nonpad_sndrcvinfo def_send; /*- * These three are here for the sosend_dgram Modified: stable/8/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctp_peeloff.c Fri Feb 10 19:19:15 2012 (r231407) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -113,6 +116,7 @@ sctp_do_peeloff(struct socket *head, str n_inp->sctp_mobility_features = inp->sctp_mobility_features; n_inp->sctp_frag_point = inp->sctp_frag_point; n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; + n_inp->sctp_ecn_enable = inp->sctp_ecn_enable; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; n_inp->inp_starting_point_for_iterator = NULL; @@ -187,6 +191,7 @@ sctp_get_peeloff(struct socket *head, sc n_inp->sctp_features = inp->sctp_features; n_inp->sctp_frag_point = inp->sctp_frag_point; n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; + n_inp->sctp_ecn_enable = inp->sctp_ecn_enable; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; n_inp->inp_starting_point_for_iterator = NULL; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 19:17:14 2012 (r231406) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:19:15 2012 (r231407) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -917,6 +920,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->heart_beat_delay = TICKS_TO_MSEC(m->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]); asoc->cookie_life = m->sctp_ep.def_cookie_life; asoc->sctp_cmt_on_off = m->sctp_cmt_on_off; + asoc->ecn_allowed = m->sctp_ecn_enable; asoc->sctp_nr_sack_on_off = (uint8_t) SCTP_BASE_SYSCTL(sctp_nr_sack_on_off); asoc->sctp_cmt_pf = (uint8_t) SCTP_BASE_SYSCTL(sctp_cmt_pf); asoc->sctp_frag_point = m->sctp_frag_point; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:22:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1200C106564A; Fri, 10 Feb 2012 19:22:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E746A8FC16; Fri, 10 Feb 2012 19:22: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 q1AJMLUF089725; Fri, 10 Feb 2012 19:22:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJML9v089718; Fri, 10 Feb 2012 19:22:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101922.q1AJML9v089718@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:22: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: r231408 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:22:22 -0000 Author: tuexen Date: Fri Feb 10 19:22:21 2012 New Revision: 231408 URL: http://svn.freebsd.org/changeset/base/231408 Log: MFC r218241: Fix several bugs in the stream schedulers. From Robin Seggelmann. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_ss_functions.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:22:21 2012 (r231408) @@ -12342,7 +12342,7 @@ sctp_lower_sosend(struct socket *so, TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; - asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i]); + asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL); } } } Modified: stable/8/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:22:21 2012 (r231408) @@ -1,6 +1,7 @@ /*- - * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, - * All rights reserved. + * Copyright (c) 2010-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -56,6 +57,11 @@ sctp_ss_default_init(struct sctp_tcb *st uint16_t i; TAILQ_INIT(&asoc->ss_data.out_wheel); + /* + * If there is data in the stream queues already, the scheduler of + * an existing association has been changed. We need to add all + * stream queues to the wheel. + */ for (i = 0; i < stcb->asoc.streamoutcnt; i++) { if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { sctp_ss_default_add(stcb, &stcb->asoc, @@ -83,7 +89,7 @@ sctp_ss_default_clear(struct sctp_tcb *s } static void -sctp_ss_default_init_stream(struct sctp_stream_out *strq) +sctp_ss_default_init_stream(struct sctp_stream_out *strq, struct sctp_stream_out *with_strq) { strq->ss_params.rr.next_spoke.tqe_next = NULL; strq->ss_params.rr.next_spoke.tqe_prev = NULL; @@ -411,11 +417,15 @@ sctp_ss_prio_clear(struct sctp_tcb *stcb } static void -sctp_ss_prio_init_stream(struct sctp_stream_out *strq) +sctp_ss_prio_init_stream(struct sctp_stream_out *strq, struct sctp_stream_out *with_strq) { strq->ss_params.prio.next_spoke.tqe_next = NULL; strq->ss_params.prio.next_spoke.tqe_prev = NULL; - strq->ss_params.prio.priority = 0; + if (with_strq != NULL) { + strq->ss_params.prio.priority = with_strq->ss_params.prio.priority; + } else { + strq->ss_params.prio.priority = 0; + } return; } @@ -575,11 +585,15 @@ sctp_ss_fb_clear(struct sctp_tcb *stcb, } static void -sctp_ss_fb_init_stream(struct sctp_stream_out *strq) +sctp_ss_fb_init_stream(struct sctp_stream_out *strq, struct sctp_stream_out *with_strq) { strq->ss_params.fb.next_spoke.tqe_next = NULL; strq->ss_params.fb.next_spoke.tqe_prev = NULL; - strq->ss_params.fb.rounds = -1; + if (with_strq != NULL) { + strq->ss_params.fb.rounds = with_strq->ss_params.fb.rounds; + } else { + strq->ss_params.fb.rounds = -1; + } return; } @@ -697,28 +711,40 @@ sctp_ss_fb_scheduled(struct sctp_tcb *st * Maintains the order provided by the application. */ static void +sctp_ss_fcfs_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, + int holds_lock); + +static void sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_association *asoc, int holds_lock) { - int x, element = 0, add_more = 1; + uint32_t x, n = 0, add_more = 1; struct sctp_stream_queue_pending *sp; uint16_t i; TAILQ_INIT(&asoc->ss_data.out_list); + /* + * If there is data in the stream queues already, the scheduler of + * an existing association has been changed. We can only cycle + * through the stream queues and add everything to the FCFS queue. + */ while (add_more) { add_more = 0; for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - sp = TAILQ_FIRST(&asoc->ss_data.out_list); - x = element; - while (sp != NULL && x > 0) { + sp = TAILQ_FIRST(&stcb->asoc.strmout[i].outqueue); + x = 0; + /* Find n. message in current stream queue */ + while (sp != NULL && x < n) { sp = TAILQ_NEXT(sp, next); + x++; } if (sp != NULL) { - sctp_ss_default_add(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + sctp_ss_fcfs_add(stcb, &stcb->asoc, &stcb->asoc.strmout[i], sp, holds_lock); add_more = 1; } } - element++; + n++; } return; } @@ -729,14 +755,14 @@ sctp_ss_fcfs_clear(struct sctp_tcb *stcb { if (clear_values) { while (!TAILQ_EMPTY(&asoc->ss_data.out_list)) { - TAILQ_REMOVE(&asoc->ss_data.out_list, TAILQ_FIRST(&asoc->ss_data.out_list), next); + TAILQ_REMOVE(&asoc->ss_data.out_list, TAILQ_FIRST(&asoc->ss_data.out_list), ss_next); } } return; } static void -sctp_ss_fcfs_init_stream(struct sctp_stream_out *strq) +sctp_ss_fcfs_init_stream(struct sctp_stream_out *strq, struct sctp_stream_out *with_strq) { /* Nothing to be done here */ return; @@ -750,9 +776,9 @@ sctp_ss_fcfs_add(struct sctp_tcb *stcb, if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (sp && (sp->next.tqe_next == NULL) && - (sp->next.tqe_prev == NULL)) { - TAILQ_INSERT_TAIL(&asoc->ss_data.out_list, sp, next); + if (sp && (sp->ss_next.tqe_next == NULL) && + (sp->ss_next.tqe_prev == NULL)) { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_list, sp, ss_next); } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -779,9 +805,9 @@ sctp_ss_fcfs_remove(struct sctp_tcb *stc SCTP_TCB_SEND_LOCK(stcb); } if (sp && - ((sp->next.tqe_next != NULL) || - (sp->next.tqe_prev != NULL))) { - TAILQ_REMOVE(&asoc->ss_data.out_list, sp, next); + ((sp->ss_next.tqe_next != NULL) || + (sp->ss_next.tqe_prev != NULL))) { + TAILQ_REMOVE(&asoc->ss_data.out_list, sp, ss_next); } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -819,7 +845,7 @@ default_again: if (TAILQ_FIRST(&strq->outqueue) && TAILQ_FIRST(&strq->outqueue)->net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) { - sp = TAILQ_NEXT(sp, next); + sp = TAILQ_NEXT(sp, ss_next); goto default_again; } } Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:22:21 2012 (r231408) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -475,6 +478,7 @@ struct sctp_stream_queue_pending { struct timeval ts; struct sctp_nets *net; TAILQ_ENTRY(sctp_stream_queue_pending) next; + TAILQ_ENTRY(sctp_stream_queue_pending) ss_next; uint32_t length; uint32_t timetolive; uint32_t ppid; @@ -652,7 +656,7 @@ struct sctp_ss_functions { int holds_lock); void (*sctp_ss_clear) (struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock); - void (*sctp_ss_init_stream) (struct sctp_stream_out *strq); + void (*sctp_ss_init_stream) (struct sctp_stream_out *strq, struct sctp_stream_out *with_strq); void (*sctp_ss_add_to_stream) (struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock); int (*sctp_ss_is_empty) (struct sctp_tcb *stcb, struct sctp_association *asoc); @@ -751,12 +755,7 @@ struct sctp_association { /* re-assembly queue for fragmented chunks on the inbound path */ struct sctpchunk_listhead reasmqueue; - /* - * this queue is used when we reach a condition that we can NOT put - * data into the socket buffer. We track the size of this queue and - * set our rwnd to the space in the socket minus also the - * size_on_delivery_queue. - */ + /* Scheduling queues */ union scheduling_data ss_data; /* Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:22:21 2012 (r231408) @@ -1,5 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and + * Michael Tuexen, tuexen@fh-muenster.de + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -1510,32 +1513,17 @@ sctp_audit_stream_queues_for_size(struct stcb->asoc.sent_queue_retran_cnt); stcb->asoc.sent_queue_retran_cnt = 0; } - SCTP_TCB_SEND_LOCK(stcb); if (stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) { - int cnt = 0; - - /* Check to see if a spoke fell off the wheel */ - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, - &stcb->asoc, - &stcb->asoc.strmout[i], - NULL, - 1); - cnt++; - } - } - if (cnt) { - /* yep, we lost a spoke or two */ - SCTP_PRINTF("Found an additional %d streams NOT on outwheel, corrected\n", cnt); + /* No stream scheduler information, initialize scheduler */ + stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 0); + if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) { + /* yep, we lost a stream or two */ + SCTP_PRINTF("Found additional streams NOT managed by scheduler, corrected\n"); } else { - /* no spokes lost, */ + /* no streams lost */ stcb->asoc.total_output_queue_size = 0; } - SCTP_TCB_SEND_UNLOCK(stcb); - return; } - SCTP_TCB_SEND_UNLOCK(stcb); /* Check to see if some data queued, if so report it */ for (i = 0; i < stcb->asoc.streamoutcnt; i++) { if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:22:21 2012 (r231408) @@ -3445,7 +3445,7 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.strmout[i].next_sequence_sent = oldstream[i].next_sequence_sent; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; stcb->asoc.strmout[i].stream_no = i; - stcb->asoc.ss_functions.sctp_ss_init_stream(&oldstream[i]); + stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], &oldstream[i]); /* * now anything on those * queues? @@ -3472,7 +3472,7 @@ sctp_setopt(struct socket *so, int optna TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; - stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i]); + stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); } stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt + addstrmcnt; SCTP_FREE(oldstream, SCTP_M_STRMO); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 19:19:15 2012 (r231407) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:22:21 2012 (r231408) @@ -1076,7 +1076,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; - asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i]); + asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL); } asoc->ss_functions.sctp_ss_init(stcb, asoc, 0); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:27:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF1B8106566C; Fri, 10 Feb 2012 19:27:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98CAF8FC0A; Fri, 10 Feb 2012 19:27:03 +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 q1AJR3rx089905; Fri, 10 Feb 2012 19:27:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJR3FS089902; Fri, 10 Feb 2012 19:27:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101927.q1AJR3FS089902@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:27:03 +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: r231409 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:27:03 -0000 Author: tuexen Date: Fri Feb 10 19:27:03 2012 New Revision: 231409 URL: http://svn.freebsd.org/changeset/base/231409 Log: MFC r218269: 1) Fix cpu mapping per JB's suggestions 2) Fix it so INIT's don't always end up on CPU0 From rrs@. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:22:21 2012 (r231408) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:27:03 2012 (r231409) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -5930,6 +5929,10 @@ bad: return; } +#if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) +extern int *sctp_cpuarry; + +#endif void sctp_input(struct mbuf *m, int off) @@ -5939,8 +5942,9 @@ sctp_input(struct mbuf *m, int off) struct sctphdr *sh; int offset; int cpu_to_use; + uint32_t tag; - if (mp_maxid > 1) { + if (mp_ncpus > 1) { ip = mtod(m, struct ip *); offset = off + sizeof(*sh); if (SCTP_BUF_LEN(m) < offset) { @@ -5951,7 +5955,19 @@ sctp_input(struct mbuf *m, int off) ip = mtod(m, struct ip *); } sh = (struct sctphdr *)((caddr_t)ip + off); - cpu_to_use = ntohl(sh->v_tag) % mp_maxid; + if (sh->v_tag) { + tag = htonl(sh->v_tag); + } else { + /* + * Distribute new INIT's to all CPU's don't just + * pick on 0. + */ + struct timeval tv; + + (void)SCTP_GETTIME_TIMEVAL(&tv); + tag = (uint32_t) tv.tv_usec; + } + cpu_to_use = sctp_cpuarry[tag % mp_ncpus]; sctp_queue_to_mcore(m, off, cpu_to_use); return; } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:22:21 2012 (r231408) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:27:03 2012 (r231409) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -5446,7 +5445,7 @@ static int sctp_scale_up_for_address = S #if defined(__FreeBSD__) && defined(SCTP_MCORE_INPUT) && defined(SMP) struct sctp_mcore_ctrl *sctp_mcore_workers = NULL; - +int *sctp_cpuarry = NULL; void sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use) { @@ -5548,32 +5547,48 @@ skip_sleep: static void sctp_startup_mcore_threads(void) { - int i; + int i, cpu; - if (mp_maxid == 1) + if (mp_ncpus == 1) return; + if (sctp_mcore_workers != NULL) { + /* + * Already been here in some previous vnet? + */ + return; + } SCTP_MALLOC(sctp_mcore_workers, struct sctp_mcore_ctrl *, - (mp_maxid * sizeof(struct sctp_mcore_ctrl)), + ((mp_maxid + 1) * sizeof(struct sctp_mcore_ctrl)), SCTP_M_MCORE); if (sctp_mcore_workers == NULL) { /* TSNH I hope */ return; } - memset(sctp_mcore_workers, 0, (mp_maxid * + memset(sctp_mcore_workers, 0, ((mp_maxid + 1) * sizeof(struct sctp_mcore_ctrl))); /* Init the structures */ - for (i = 0; i < mp_maxid; i++) { + for (i = 0; i <= mp_maxid; i++) { TAILQ_INIT(&sctp_mcore_workers[i].que); SCTP_MCORE_LOCK_INIT(&sctp_mcore_workers[i]); SCTP_MCORE_QLOCK_INIT(&sctp_mcore_workers[i]); sctp_mcore_workers[i].cpuid = i; } + if (sctp_cpuarry == NULL) { + SCTP_MALLOC(sctp_cpuarry, int *, + (mp_ncpus * sizeof(int)), + SCTP_M_MCORE); + i = 0; + CPU_FOREACH(cpu) { + sctp_cpuarry[i] = cpu; + i++; + } + } /* Now start them all */ - for (i = 0; i < mp_maxid; i++) { + CPU_FOREACH(cpu) { (void)kproc_create(sctp_mcore_thread, - (void *)&sctp_mcore_workers[i], - &sctp_mcore_workers[i].thread_proc, + (void *)&sctp_mcore_workers[cpu], + &sctp_mcore_workers[cpu].thread_proc, RFPROC, SCTP_KTHREAD_PAGES, SCTP_MCORE_NAME); @@ -5605,12 +5620,12 @@ sctp_pcb_init() #endif #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *, - (mp_maxid * sizeof(struct sctpstat)), + ((mp_maxid + 1) * sizeof(struct sctpstat)), SCTP_M_MCORE); #endif (void)SCTP_GETTIME_TIMEVAL(&tv); #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * mp_maxid)); + bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * (mp_maxid + 1))); SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t) tv.tv_sec; SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t) tv.tv_usec; #else From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:29:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49D30106566B; Fri, 10 Feb 2012 19:29:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 316DB8FC16; Fri, 10 Feb 2012 19:29:39 +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 q1AJTdOC090063; Fri, 10 Feb 2012 19:29:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJTcgU090024; Fri, 10 Feb 2012 19:29:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101929.q1AJTcgU090024@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:29:38 +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: r231410 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:29:39 -0000 Author: tuexen Date: Fri Feb 10 19:29:38 2012 New Revision: 231410 URL: http://svn.freebsd.org/changeset/base/231410 Log: MFC r218319: 1) Typo correction in comments and one spacing change. 2) Mass update to all copyrights. From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_asconf.h stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_auth.h stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_bsd_addr.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_crc32.c stable/8/sys/netinet/sctp_crc32.h stable/8/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_lock_bsd.h stable/8/sys/netinet/sctp_os.h stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_peeloff.c stable/8/sys/netinet/sctp_peeloff.h stable/8/sys/netinet/sctp_ss_functions.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_timer.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c stable/8/sys/netinet6/sctp6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_asconf.h ============================================================================== --- stable/8/sys/netinet/sctp_asconf.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_asconf.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_auth.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_auth.h ============================================================================== --- stable/8/sys/netinet/sctp_auth.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_auth.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_bsd_addr.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_crc32.c ============================================================================== --- stable/8/sys/netinet/sctp_crc32.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_crc32.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_crc32.h ============================================================================== --- stable/8/sys/netinet/sctp_crc32.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_crc32.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_indata.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_input.h ============================================================================== --- stable/8/sys/netinet/sctp_input.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_input.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_lock_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_lock_bsd.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_lock_bsd.h Fri Feb 10 19:29:38 2012 (r231410) @@ -2,6 +2,8 @@ #define __sctp_lock_bsd_h__ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_os.h ============================================================================== --- stable/8/sys/netinet/sctp_os.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_os.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Modified: stable/8/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_peeloff.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_peeloff.h ============================================================================== --- stable/8/sys/netinet/sctp_peeloff.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_peeloff.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,7 +1,7 @@ /*- - * Copyright (c) 2010-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2010-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2010-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2010-2011, by Robin Seggelmann. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -13,10 +13,6 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the distribution. * - * c) Neither the name of Cisco Systems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -178,7 +174,7 @@ default_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's @@ -287,7 +283,6 @@ sctp_ss_rrp_add(struct sctp_tcb *stcb, s } if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { - if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); } else { @@ -331,7 +326,7 @@ rrp_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's @@ -374,7 +369,7 @@ rrp_pd_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's @@ -441,7 +436,6 @@ sctp_ss_prio_add(struct sctp_tcb *stcb, } if ((strq->ss_params.prio.next_spoke.tqe_next == NULL) && (strq->ss_params.prio.next_spoke.tqe_prev == NULL)) { - if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); } else { @@ -516,7 +510,7 @@ prio_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's @@ -833,7 +827,7 @@ default_again: /* * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destionation requested + * the first item pointed towards are network destination requested * by the caller. Note that if we turn out to be locked to a stream * (assigning TSN's then we must stop, since we cannot look for * another stream with data to send to that destination). In CMT's Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_timer.h ============================================================================== --- stable/8/sys/netinet/sctp_timer.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_timer.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctp_var.h ============================================================================== --- stable/8/sys/netinet/sctp_var.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctp_var.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,8 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart, rrs@lakerest.net and - * Michael Tuexen, tuexen@fh-muenster.de - * All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet/sctputil.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: stable/8/sys/netinet6/sctp6_var.h ============================================================================== --- stable/8/sys/netinet6/sctp6_var.h Fri Feb 10 19:27:03 2012 (r231409) +++ stable/8/sys/netinet6/sctp6_var.h Fri Feb 10 19:29:38 2012 (r231410) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:37:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACD87106566C; Fri, 10 Feb 2012 19:37:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 969B98FC13; Fri, 10 Feb 2012 19:37: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 q1AJbOSV090353; Fri, 10 Feb 2012 19:37:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJbOe2090348; Fri, 10 Feb 2012 19:37:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101937.q1AJbOe2090348@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:37:24 +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: r231411 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:37:24 -0000 Author: tuexen Date: Fri Feb 10 19:37:23 2012 New Revision: 231411 URL: http://svn.freebsd.org/changeset/base/231411 Log: MFC r218335: Add support for M_FLOWID. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:29:38 2012 (r231410) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:37:23 2012 (r231411) @@ -2615,6 +2615,9 @@ sctp_handle_cookie_echo(struct mbuf *m, /* still no TCB... must be bad cookie-echo */ return (NULL); } + if ((*netp != NULL) && (m->m_flags & M_FLOWID)) { + (*netp)->flowid = m->m_pkthdr.flowid; + } /* * Ok, we built an association so confirm the address we sent the * INIT-ACK to. @@ -5842,6 +5845,9 @@ sctp_skip_csum_4: } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; + } /* inp's ref-count increased && stcb locked */ if (inp == NULL) { struct sctp_init_chunk *init_chk, chunk_buf; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:29:38 2012 (r231410) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:37:23 2012 (r231411) @@ -3419,7 +3419,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif - union sctp_sockstore *over_addr + union sctp_sockstore *over_addr, + struct mbuf *init ) /* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ { @@ -3483,6 +3484,15 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_LEN(newm) = len; SCTP_BUF_NEXT(newm) = m; m = newm; + if (net != NULL) { + m->m_pkthdr.flowid = net->flowid; + m->m_flags |= M_FLOWID; + } else { + if ((init != NULL) && (init->m_flags & M_FLOWID)) { + m->m_pkthdr.flowid = init->m_pkthdr.flowid; + m->m_flags |= M_FLOWID; + } + } packet_length = sctp_calculate_len(m); ip = mtod(m, struct ip *); ip->ip_v = IPVERSION; @@ -3804,6 +3814,15 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_LEN(newm) = len; SCTP_BUF_NEXT(newm) = m; m = newm; + if (net != NULL) { + m->m_pkthdr.flowid = net->flowid; + m->m_flags |= M_FLOWID; + } else { + if ((init != NULL) && (init->m_flags & M_FLOWID)) { + m->m_pkthdr.flowid = init->m_pkthdr.flowid; + m->m_flags |= M_FLOWID; + } + } packet_length = sctp_calculate_len(m); ip6h = mtod(m, struct ip6_hdr *); @@ -4365,7 +4384,7 @@ sctp_send_initiate(struct sctp_inpcb *in (struct sockaddr *)&net->ro._l_addr, m, 0, NULL, 0, 0, 0, NULL, 0, inp->sctp_lport, stcb->rport, htonl(0), - net->port, so_locked, NULL); + net->port, so_locked, NULL, NULL); SCTPDBG(SCTP_DEBUG_OUTPUT4, "lowlevel_output - %d\n", ret); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); @@ -5536,7 +5555,7 @@ do_a_abort: (void)sctp_lowlevel_chunk_output(inp, NULL, NULL, to, m, 0, NULL, 0, 0, 0, NULL, 0, inp->sctp_lport, sh->src_port, init_chk->init.initiate_tag, - port, SCTP_SO_NOT_LOCKED, over_addr); + port, SCTP_SO_NOT_LOCKED, over_addr, init_pkt); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -7564,7 +7583,7 @@ again_one_more_time: no_fragmentflg, 0, NULL, asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL))) { + net->port, so_locked, NULL, NULL))) { if (error == ENOBUFS) { asoc->ifp_had_enobuf = 1; SCTP_STAT_INCR(sctps_lowlevelerr); @@ -7820,7 +7839,7 @@ again_one_more_time: no_fragmentflg, 0, NULL, asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL))) { + net->port, so_locked, NULL, NULL))) { if (error == ENOBUFS) { asoc->ifp_had_enobuf = 1; SCTP_STAT_INCR(sctps_lowlevelerr); @@ -8151,7 +8170,7 @@ no_data_fill: asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL))) { + net->port, so_locked, NULL, NULL))) { /* error, we could not output */ if (error == ENOBUFS) { SCTP_STAT_INCR(sctps_lowlevelerr); @@ -8861,7 +8880,7 @@ sctp_chunk_retransmission(struct sctp_in auth_offset, auth, stcb->asoc.authinfo.active_keyid, no_fragmentflg, 0, NULL, 0, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - chk->whoTo->port, so_locked, NULL))) { + chk->whoTo->port, so_locked, NULL, NULL))) { SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } @@ -9119,7 +9138,7 @@ one_chunk_around: auth_offset, auth, auth_keyid, no_fragmentflg, 0, NULL, 0, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL))) { + net->port, so_locked, NULL, NULL))) { /* error, we could not output */ SCTP_STAT_INCR(sctps_lowlevelerr); return (error); @@ -10232,7 +10251,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc (struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, NULL, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - stcb->asoc.primary_destination->port, so_locked, NULL); + stcb->asoc.primary_destination->port, so_locked, NULL, NULL); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -10269,7 +10288,7 @@ sctp_send_shutdown_complete(struct sctp_ m_shutdown_comp, 0, NULL, 0, 1, 0, NULL, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), - net->port, SCTP_SO_NOT_LOCKED, NULL); + net->port, SCTP_SO_NOT_LOCKED, NULL, NULL); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); return; } @@ -10314,6 +10333,10 @@ sctp_send_shutdown_complete2(struct mbuf SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; SCTP_BUF_NEXT(mout) = NULL; + if (m->m_flags & M_FLOWID) { + mout->m_pkthdr.flowid = m->m_pkthdr.flowid; + mout->m_flags |= M_FLOWID; + } iph_out = NULL; #ifdef INET6 ip6_out = NULL; @@ -11378,6 +11401,10 @@ sctp_send_abort(struct mbuf *m, int iphl SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; SCTP_BUF_NEXT(mout) = err_cause; + if (m->m_flags & M_FLOWID) { + mout->m_pkthdr.flowid = m->m_pkthdr.flowid; + mout->m_flags |= M_FLOWID; + } iph_out = NULL; #ifdef INET6 ip6_out = NULL; @@ -11623,6 +11650,10 @@ sctp_send_operr_to(struct mbuf *m, int i SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; SCTP_BUF_NEXT(mout) = scm; + if (m->m_flags & M_FLOWID) { + mout->m_pkthdr.flowid = m->m_pkthdr.flowid; + mout->m_flags |= M_FLOWID; + } iph_out = NULL; #ifdef INET6 ip6_out = NULL; Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:29:38 2012 (r231410) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:37:23 2012 (r231411) @@ -4035,6 +4035,10 @@ sctp_add_remote_addr(struct sctp_tcb *st TAILQ_INSERT_HEAD(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next); } + /* Choose an initial flowid. */ + net->flowid = stcb->asoc.my_vtag ^ + ntohs(stcb->rport) ^ + ntohs(stcb->sctp_ep->sctp_lport); return (0); } Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:29:38 2012 (r231410) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:37:23 2012 (r231411) @@ -350,6 +350,7 @@ struct sctp_nets { uint8_t lan_type; /* JRS - struct used in HTCP algorithm */ struct htcp htcp_ca; + uint32_t flowid; }; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:40:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C0281065743; Fri, 10 Feb 2012 19:40:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBD68FC12; Fri, 10 Feb 2012 19:40: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 q1AJeKBH090479; Fri, 10 Feb 2012 19:40:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJeJOh090476; Fri, 10 Feb 2012 19:40:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101940.q1AJeJOh090476@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231412 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:40:20 -0000 Author: tuexen Date: Fri Feb 10 19:40:19 2012 New Revision: 231412 URL: http://svn.freebsd.org/changeset/base/231412 Log: MFC r218371: 1) Use same scheme Michael and I discussed for a selected for a flowid 2) If flowid is not set, arrange so it is stored. 3) If flowid is set by lower layer, use it. From rrs@. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:37:23 2012 (r231411) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:40:19 2012 (r231412) @@ -5948,32 +5948,32 @@ sctp_input(struct mbuf *m, int off) struct sctphdr *sh; int offset; int cpu_to_use; - uint32_t tag; + uint32_t flowid, tag; if (mp_ncpus > 1) { - ip = mtod(m, struct ip *); - offset = off + sizeof(*sh); - if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { - SCTP_STAT_INCR(sctps_hdrops); - return; - } - ip = mtod(m, struct ip *); - } - sh = (struct sctphdr *)((caddr_t)ip + off); - if (sh->v_tag) { - tag = htonl(sh->v_tag); + if (m->m_flags & M_FLOWID) { + flowid = m->m_pkthdr.flowid; } else { /* - * Distribute new INIT's to all CPU's don't just - * pick on 0. + * No flow id built by lower layers fix it so we + * create one. */ - struct timeval tv; - - (void)SCTP_GETTIME_TIMEVAL(&tv); - tag = (uint32_t) tv.tv_usec; + ip = mtod(m, struct ip *); + offset = off + sizeof(*sh); + if (SCTP_BUF_LEN(m) < offset) { + if ((m = m_pullup(m, offset)) == 0) { + SCTP_STAT_INCR(sctps_hdrops); + return; + } + ip = mtod(m, struct ip *); + } + sh = (struct sctphdr *)((caddr_t)ip + off); + tag = htonl(sh->v_tag); + flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); + m->m_pkthdr.flowid = flowid; + m->m_flags |= M_FLOWID; } - cpu_to_use = sctp_cpuarry[tag % mp_ncpus]; + cpu_to_use = sctp_cpuarry[flowid % mp_ncpus]; sctp_queue_to_mcore(m, off, cpu_to_use); return; } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:47:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C75191065675; Fri, 10 Feb 2012 19:47:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971CD8FC0C; Fri, 10 Feb 2012 19:47: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 q1AJlFXP090747; Fri, 10 Feb 2012 19:47:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJlFSt090743; Fri, 10 Feb 2012 19:47:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101947.q1AJlFSt090743@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:47:15 +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: r231413 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:47:15 -0000 Author: tuexen Date: Fri Feb 10 19:47:15 2012 New Revision: 231413 URL: http://svn.freebsd.org/changeset/base/231413 Log: MFC r218392: 1) Track when flowid does get set. From rrs@. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:40:19 2012 (r231412) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:47:15 2012 (r231413) @@ -2617,6 +2617,7 @@ sctp_handle_cookie_echo(struct mbuf *m, } if ((*netp != NULL) && (m->m_flags & M_FLOWID)) { (*netp)->flowid = m->m_pkthdr.flowid; + (*netp)->flowidset = 1; } /* * Ok, we built an association so confirm the address we sent the @@ -5847,6 +5848,7 @@ sctp_skip_csum_4: } if ((net != NULL) && (m->m_flags & M_FLOWID)) { net->flowid = m->m_pkthdr.flowid; + net->flowidset = 1; } /* inp's ref-count increased && stcb locked */ if (inp == NULL) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:40:19 2012 (r231412) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:47:15 2012 (r231413) @@ -4039,6 +4039,7 @@ sctp_add_remote_addr(struct sctp_tcb *st net->flowid = stcb->asoc.my_vtag ^ ntohs(stcb->rport) ^ ntohs(stcb->sctp_ep->sctp_lport); + net->flowidset = 1; return (0); } @@ -5602,7 +5603,6 @@ sctp_startup_mcore_threads(void) #endif - void sctp_pcb_init() { @@ -5750,7 +5750,6 @@ sctp_pcb_init() * add the VRF's as addresses are added. */ sctp_init_vrf_list(SCTP_DEFAULT_VRF); - } /* Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:40:19 2012 (r231412) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:47:15 2012 (r231413) @@ -351,6 +351,7 @@ struct sctp_nets { /* JRS - struct used in HTCP algorithm */ struct htcp htcp_ca; uint32_t flowid; + uint8_t flowidset; }; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:49:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15CB11065673; Fri, 10 Feb 2012 19:49:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 001308FC1B; Fri, 10 Feb 2012 19:49: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 q1AJnZjd090857; Fri, 10 Feb 2012 19:49:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJnZls090855; Fri, 10 Feb 2012 19:49:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101949.q1AJnZls090855@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:49: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: r231414 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:49:36 -0000 Author: tuexen Date: Fri Feb 10 19:49:35 2012 New Revision: 231414 URL: http://svn.freebsd.org/changeset/base/231414 Log: MFC r218393: If not set (due to some error Michael is working on fixing) set it for the net. From rrs@. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:47:15 2012 (r231413) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:49:35 2012 (r231414) @@ -3485,6 +3485,12 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { + if (net->flowidset == 0) { + net->flowid = stcb->asoc.my_vtag ^ + ntohs(stcb->rport) ^ + ntohs(stcb->sctp_ep->sctp_lport); + net->flowidset = 1; + } m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { @@ -3815,6 +3821,12 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { + if (net->flowidset == 0) { + net->flowid = stcb->asoc.my_vtag ^ + ntohs(stcb->rport) ^ + ntohs(stcb->sctp_ep->sctp_lport); + net->flowidset = 1; + } m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:52:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D21D1065670; Fri, 10 Feb 2012 19:52:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 264AB8FC08; Fri, 10 Feb 2012 19:52:19 +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 q1AJqJim090993; Fri, 10 Feb 2012 19:52:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJqIJ2090987; Fri, 10 Feb 2012 19:52:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101952.q1AJqIJ2090987@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231415 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:52:19 -0000 Author: tuexen Date: Fri Feb 10 19:52:18 2012 New Revision: 231415 URL: http://svn.freebsd.org/changeset/base/231415 Log: MFC r218400: Fix bugs related to M_FLOWID: * Store the flowid when receiving an SCTP/IPv6 packet. * Store the flowid when receiving an SCTP packet with wrong CRC. * Initilize flowid correctly. * Put test code under INVARIANTS. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:52:18 2012 (r231415) @@ -2617,7 +2617,9 @@ sctp_handle_cookie_echo(struct mbuf *m, } if ((*netp != NULL) && (m->m_flags & M_FLOWID)) { (*netp)->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS (*netp)->flowidset = 1; +#endif } /* * Ok, we built an association so confirm the address we sent the @@ -5817,6 +5819,12 @@ sctp_input_with_port(struct mbuf *i_pak, } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } if ((inp) && (stcb)) { sctp_send_packet_dropped(stcb, net, m, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); @@ -5848,7 +5856,9 @@ sctp_skip_csum_4: } if ((net != NULL) && (m->m_flags & M_FLOWID)) { net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS net->flowidset = 1; +#endif } /* inp's ref-count increased && stcb locked */ if (inp == NULL) { Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 19:52:18 2012 (r231415) @@ -3485,12 +3485,11 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { +#ifdef INVARIANTS if (net->flowidset == 0) { - net->flowid = stcb->asoc.my_vtag ^ - ntohs(stcb->rport) ^ - ntohs(stcb->sctp_ep->sctp_lport); - net->flowidset = 1; + panic("Flow ID not set"); } +#endif m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { @@ -3821,12 +3820,11 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { +#ifdef INVARIANTS if (net->flowidset == 0) { - net->flowid = stcb->asoc.my_vtag ^ - ntohs(stcb->rport) ^ - ntohs(stcb->sctp_ep->sctp_lport); - net->flowidset = 1; + panic("Flow ID not set"); } +#endif m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 19:52:18 2012 (r231415) @@ -3962,6 +3962,13 @@ sctp_add_remote_addr(struct sctp_tcb *st net->find_pseudo_cumack = 1; net->find_rtx_pseudo_cumack = 1; net->src_addr_selected = 0; + /* Choose an initial flowid. */ + net->flowid = stcb->asoc.my_vtag ^ + ntohs(stcb->rport) ^ + ntohs(stcb->sctp_ep->sctp_lport); +#ifdef INVARIANTS + net->flowidset = 1; +#endif netfirst = TAILQ_FIRST(&stcb->asoc.nets); if (net->ro.ro_rt == NULL) { /* Since we have no route put it at the back */ @@ -4035,11 +4042,6 @@ sctp_add_remote_addr(struct sctp_tcb *st TAILQ_INSERT_HEAD(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next); } - /* Choose an initial flowid. */ - net->flowid = stcb->asoc.my_vtag ^ - ntohs(stcb->rport) ^ - ntohs(stcb->sctp_ep->sctp_lport); - net->flowidset = 1; return (0); } Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 19:52:18 2012 (r231415) @@ -351,7 +351,9 @@ struct sctp_nets { /* JRS - struct used in HTCP algorithm */ struct htcp htcp_ca; uint32_t flowid; +#ifdef INVARIANTS uint8_t flowidset; +#endif }; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 19:49:35 2012 (r231414) +++ stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 19:52:18 2012 (r231415) @@ -170,6 +170,12 @@ sctp6_input(struct mbuf **i_pak, int *of } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } /* in6p's ref-count increased && stcb locked */ if ((in6p) && (stcb)) { sctp_send_packet_dropped(stcb, net, m, iphlen, 1); @@ -198,6 +204,12 @@ sctp_skip_csum: } net->port = port; } + if ((net != NULL) && (m->m_flags & M_FLOWID)) { + net->flowid = m->m_pkthdr.flowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } /* in6p's ref-count increased */ if (in6p == NULL) { struct sctp_init_chunk *init_chk, chunk_buf; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:54:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8E92106564A; Fri, 10 Feb 2012 19:54:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A97E38FC15; Fri, 10 Feb 2012 19:54: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 q1AJsIkN091098; Fri, 10 Feb 2012 19:54:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJsI29091096; Fri, 10 Feb 2012 19:54:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101954.q1AJsI29091096@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231416 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:54:19 -0000 Author: tuexen Date: Fri Feb 10 19:54:18 2012 New Revision: 231416 URL: http://svn.freebsd.org/changeset/base/231416 Log: MFC r218521: Remove addresses from endpoint when there are no associations. This fixes a bug reported by brucec@. Modified: stable/8/sys/netinet/sctp_asconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:52:18 2012 (r231415) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 19:54:18 2012 (r231416) @@ -3104,6 +3104,7 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * uint32_t type, uint32_t vrf_id, struct sctp_ifa *sctp_ifap) { struct sctp_ifa *ifa; + struct sctp_laddr *laddr, *nladdr; if (sa->sa_len == 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, EINVAL); @@ -3124,8 +3125,6 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * if (type == SCTP_ADD_IP_ADDRESS) { sctp_add_local_addr_ep(inp, ifa, type); } else if (type == SCTP_DEL_IP_ADDRESS) { - struct sctp_laddr *laddr; - if (inp->laddr_count < 2) { /* can't delete the last local address */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_ASCONF, EINVAL); @@ -3139,11 +3138,19 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb * } } } - if (!LIST_EMPTY(&inp->sctp_asoc_list)) { + if (LIST_EMPTY(&inp->sctp_asoc_list)) { /* * There is no need to start the iterator if the inp * has no associations. */ + if (type == SCTP_DEL_IP_ADDRESS) { + LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, sctp_nxt_addr, nladdr) { + if (laddr->ifa == ifa) { + sctp_del_local_addr_ep(inp, ifa); + } + } + } + } else { struct sctp_asconf_iterator *asc; struct sctp_laddr *wi; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:56:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 813FC106566B; Fri, 10 Feb 2012 19:56:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 693438FC13; Fri, 10 Feb 2012 19:56: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 q1AJu2Dj091209; Fri, 10 Feb 2012 19:56:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJu28J091206; Fri, 10 Feb 2012 19:56:02 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101956.q1AJu28J091206@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:56:02 +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: r231417 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:56:02 -0000 Author: tuexen Date: Fri Feb 10 19:56:02 2012 New Revision: 231417 URL: http://svn.freebsd.org/changeset/base/231417 Log: MFC r218639: Fix several bugs related to stream scheduling. Obtained from: Robin Seggelmann Modified: stable/8/sys/netinet/sctp_ss_functions.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:54:18 2012 (r231416) +++ stable/8/sys/netinet/sctp_ss_functions.c Fri Feb 10 19:56:02 2012 (r231417) @@ -59,11 +59,9 @@ sctp_ss_default_init(struct sctp_tcb *st * stream queues to the wheel. */ for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - sctp_ss_default_add(stcb, &stcb->asoc, - &stcb->asoc.strmout[i], - NULL, holds_lock); - } + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, + &stcb->asoc.strmout[i], + NULL, holds_lock); } return; } @@ -72,14 +70,19 @@ static void sctp_ss_default_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { - uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - sctp_ss_default_remove(stcb, &stcb->asoc, - &stcb->asoc.strmout[i], - NULL, holds_lock); - } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, TAILQ_FIRST(&asoc->ss_data.out_wheel), ss_params.rr.next_spoke); + strq->ss_params.rr.next_spoke.tqe_next = NULL; + strq->ss_params.rr.next_spoke.tqe_prev = NULL; + } + asoc->last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } @@ -100,7 +103,9 @@ sctp_ss_default_add(struct sctp_tcb *stc if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + /* Add to wheel if not already on it and stream queue not empty */ + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.rr.next_spoke.tqe_next == NULL) && (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); @@ -126,11 +131,16 @@ sctp_ss_default_remove(struct sctp_tcb * struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock) { - /* take off and then setup so we know it is not on the wheel */ if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (TAILQ_EMPTY(&strq->outqueue)) { + /* + * Remove from wheel if stream queue is empty and actually is on the + * wheel + */ + if (TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.rr.next_spoke.tqe_next != NULL || + strq->ss_params.rr.next_spoke.tqe_prev != NULL)) { if (asoc->last_out_stream == strq) { asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, @@ -244,7 +254,8 @@ sctp_ss_rr_add(struct sctp_tcb *stcb, st if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.rr.next_spoke.tqe_next == NULL) && (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); @@ -271,48 +282,20 @@ sctp_ss_rr_add(struct sctp_tcb *stcb, st * Always interates the streams in ascending order and * only fills messages of the same stream in a packet. */ -static void -sctp_ss_rrp_add(struct sctp_tcb *stcb, struct sctp_association *asoc, - struct sctp_stream_out *strq, - struct sctp_stream_queue_pending *sp, int holds_lock) +static struct sctp_stream_out * +sctp_ss_rrp_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) { - struct sctp_stream_out *strqt; - - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && - (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { - if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { - TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); - } else { - strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); - while (strqt != NULL && strqt->stream_no < strq->stream_no) { - strqt = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); - } - if (strqt != NULL) { - TAILQ_INSERT_BEFORE(strqt, strq, ss_params.rr.next_spoke); - } else { - TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); - } - } - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } - return; + return asoc->last_out_stream; } -static struct sctp_stream_out * -sctp_ss_rrp_select(struct sctp_tcb *stcb, struct sctp_nets *net, +static void +sctp_ss_rrp_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_association *asoc) { struct sctp_stream_out *strq, *strqt; strqt = asoc->last_out_stream; - if (strqt != NULL && !TAILQ_EMPTY(&strqt->outqueue)) { - return (strqt); - } rrp_again: /* Find the next stream to use */ if (strqt == NULL) { @@ -339,53 +322,13 @@ rrp_again: TAILQ_FIRST(&strq->outqueue)->net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) { if (strq == asoc->last_out_stream) { - return (NULL); + strq = NULL; } else { strqt = strq; goto rrp_again; } } } - return (strq); -} - -static void -sctp_ss_rrp_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, - struct sctp_association *asoc) -{ - struct sctp_stream_out *strq, *strqt; - - strqt = asoc->last_out_stream; -rrp_pd_again: - /* Find the next stream to use */ - if (strqt == NULL) { - strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - } else { - strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); - if (strq == NULL) { - strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - } - } - - /* - * If CMT is off, we must validate that the stream in question has - * the first item pointed towards are network destination requested - * by the caller. Note that if we turn out to be locked to a stream - * (assigning TSN's then we must stop, since we cannot look for - * another stream with data to send to that destination). In CMT's - * case, by skipping this check, we will send one data packet - * towards the requested net. - */ - if ((strq != NULL) && TAILQ_FIRST(&strq->outqueue) && - (net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) && - (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { - if (strq == asoc->last_out_stream) { - strq = NULL; - } else { - strqt = strq; - goto rrp_pd_again; - } - } asoc->last_out_stream = strq; return; } @@ -399,14 +342,23 @@ static void sctp_ss_prio_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { - uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - if (clear_values) - stcb->asoc.strmout[i].ss_params.prio.priority = 0; - sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + if (clear_values) { + strq->ss_params.prio.priority = 0; } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, TAILQ_FIRST(&asoc->ss_data.out_wheel), ss_params.prio.next_spoke); + strq->ss_params.prio.next_spoke.tqe_next = NULL; + strq->ss_params.prio.next_spoke.tqe_prev = NULL; + + } + asoc->last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } @@ -434,7 +386,9 @@ sctp_ss_prio_add(struct sctp_tcb *stcb, if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.prio.next_spoke.tqe_next == NULL) && + /* Add to wheel if not already on it and stream queue not empty */ + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.prio.next_spoke.tqe_next == NULL) && (strq->ss_params.prio.next_spoke.tqe_prev == NULL)) { if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); @@ -461,11 +415,16 @@ sctp_ss_prio_remove(struct sctp_tcb *stc struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock) { - /* take off and then setup so we know it is not on the wheel */ if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (TAILQ_EMPTY(&strq->outqueue)) { + /* + * Remove from wheel if stream queue is empty and actually is on the + * wheel + */ + if (TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.prio.next_spoke.tqe_next != NULL || + strq->ss_params.prio.next_spoke.tqe_prev != NULL)) { if (asoc->last_out_stream == strq) { asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, ss_params.prio.next_spoke); @@ -477,7 +436,7 @@ sctp_ss_prio_remove(struct sctp_tcb *stc asoc->last_out_stream = NULL; } } - TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); strq->ss_params.prio.next_spoke.tqe_next = NULL; strq->ss_params.prio.next_spoke.tqe_prev = NULL; } @@ -502,7 +461,7 @@ prio_again: strqn = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); if (strqn != NULL && strqn->ss_params.prio.priority == strqt->ss_params.prio.priority) { - strq = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + strq = strqn; } else { strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); } @@ -565,15 +524,22 @@ static void sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { - uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { - if (clear_values) { - stcb->asoc.strmout[i].ss_params.fb.rounds = -1; - } - sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + if (clear_values) { + strq->ss_params.fb.rounds = -1; } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, TAILQ_FIRST(&asoc->ss_data.out_wheel), ss_params.fb.next_spoke); + strq->ss_params.fb.next_spoke.tqe_next = NULL; + strq->ss_params.fb.next_spoke.tqe_prev = NULL; + } + asoc->last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } @@ -599,11 +565,12 @@ sctp_ss_fb_add(struct sctp_tcb *stcb, st if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && - (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { - if (!TAILQ_EMPTY(&strq->outqueue) && strq->ss_params.fb.rounds < 0) + if (!TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.fb.next_spoke.tqe_next == NULL) && + (strq->ss_params.fb.next_spoke.tqe_prev == NULL)) { + if (strq->ss_params.fb.rounds < 0) strq->ss_params.fb.rounds = TAILQ_FIRST(&strq->outqueue)->length; - TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.fb.next_spoke); } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -616,11 +583,16 @@ sctp_ss_fb_remove(struct sctp_tcb *stcb, struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, int holds_lock) { - /* take off and then setup so we know it is not on the wheel */ if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } - if (TAILQ_EMPTY(&strq->outqueue)) { + /* + * Remove from wheel if stream queue is empty and actually is on the + * wheel + */ + if (TAILQ_EMPTY(&strq->outqueue) && + (strq->ss_params.fb.next_spoke.tqe_next != NULL || + strq->ss_params.fb.next_spoke.tqe_prev != NULL)) { if (asoc->last_out_stream == strq) { asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, ss_params.fb.next_spoke); @@ -632,7 +604,6 @@ sctp_ss_fb_remove(struct sctp_tcb *stcb, asoc->last_out_stream = NULL; } } - strq->ss_params.fb.rounds = -1; TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.fb.next_spoke); strq->ss_params.fb.next_spoke.tqe_next = NULL; strq->ss_params.fb.next_spoke.tqe_prev = NULL; @@ -649,20 +620,19 @@ sctp_ss_fb_select(struct sctp_tcb *stcb, { struct sctp_stream_out *strq = NULL, *strqt; - if (TAILQ_FIRST(&asoc->ss_data.out_wheel) == TAILQ_LAST(&asoc->ss_data.out_wheel, sctpwheel_listhead)) { + if (asoc->last_out_stream == NULL || + TAILQ_FIRST(&asoc->ss_data.out_wheel) == TAILQ_LAST(&asoc->ss_data.out_wheel, sctpwheel_listhead)) { strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); } else { - if (asoc->last_out_stream != NULL) { - strqt = TAILQ_NEXT(asoc->last_out_stream, ss_params.fb.next_spoke); - } else { - strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); - } + strqt = TAILQ_NEXT(asoc->last_out_stream, ss_params.fb.next_spoke); } do { - if ((strqt != NULL) && TAILQ_FIRST(&strqt->outqueue) && - TAILQ_FIRST(&strqt->outqueue)->net != NULL && - ((net == NULL || TAILQ_FIRST(&strqt->outqueue)->net == net) || - (SCTP_BASE_SYSCTL(sctp_cmt_on_off) > 0))) { + if ((strqt != NULL) && + ((SCTP_BASE_SYSCTL(sctp_cmt_on_off) > 0) || + (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0 && + (net == NULL || (TAILQ_FIRST(&strqt->outqueue) && TAILQ_FIRST(&strqt->outqueue)->net == NULL) || + (net != NULL && TAILQ_FIRST(&strqt->outqueue) && TAILQ_FIRST(&strqt->outqueue)->net != NULL && + TAILQ_FIRST(&strqt->outqueue)->net == net))))) { if ((strqt->ss_params.fb.rounds >= 0) && (strq == NULL || strqt->ss_params.fb.rounds < strq->ss_params.fb.rounds)) { strq = strqt; @@ -748,9 +718,15 @@ sctp_ss_fcfs_clear(struct sctp_tcb *stcb int clear_values, int holds_lock) { if (clear_values) { + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } while (!TAILQ_EMPTY(&asoc->ss_data.out_list)) { TAILQ_REMOVE(&asoc->ss_data.out_list, TAILQ_FIRST(&asoc->ss_data.out_list), ss_next); } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } } return; } @@ -880,7 +856,7 @@ struct sctp_ss_functions sctp_ss_functio .sctp_ss_init = sctp_ss_default_init, .sctp_ss_clear = sctp_ss_default_clear, .sctp_ss_init_stream = sctp_ss_default_init_stream, - .sctp_ss_add_to_stream = sctp_ss_rrp_add, + .sctp_ss_add_to_stream = sctp_ss_rr_add, .sctp_ss_is_empty = sctp_ss_default_is_empty, .sctp_ss_remove_from_stream = sctp_ss_default_remove, .sctp_ss_select_stream = sctp_ss_rrp_select, From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:57:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E19821065675; Fri, 10 Feb 2012 19:57:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0D428FC16; Fri, 10 Feb 2012 19:57: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 q1AJvwFX091312; Fri, 10 Feb 2012 19:57:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJvwdp091310; Fri, 10 Feb 2012 19:57:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202101957.q1AJvwdp091310@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 19:57:58 +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: r231418 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:57:59 -0000 Author: tuexen Date: Fri Feb 10 19:57:58 2012 New Revision: 231418 URL: http://svn.freebsd.org/changeset/base/231418 Log: MFC r218641: Fix a bug reported by Jonathan Leighton in his web-sctp testing at the Univ-of-Del. Basically when a 1-to-1 socket did a socket/bind/send(data)/close. If the timing was right we would dereference a socket that is NULL. From rrs@. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:56:02 2012 (r231417) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 19:57:58 2012 (r231418) @@ -2867,24 +2867,31 @@ sctp_handle_cookie_ack(struct sctp_cooki SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return; - } #endif - soisconnected(stcb->sctp_socket); + if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) { + soisconnected(stcb->sctp_socket); + } #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, - stcb, net); /* * since we did not send a HB make sure we don't double * things */ net->hb_responded = 1; + if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { + /* + * We don't need to do the asconf thing, nor hb or + * autoclose if the socket is closed. + */ + goto closed_socket; + } + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, + stcb, net); + + if (stcb->asoc.sctp_autoclose_ticks && sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_AUTOCLOSE)) { sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, @@ -2908,6 +2915,7 @@ sctp_handle_cookie_ack(struct sctp_cooki #endif } } +closed_socket: /* Toss the cookie if I can */ sctp_toss_old_cookies(stcb, asoc); if (!TAILQ_EMPTY(&asoc->sent_queue)) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 19:58:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1638106578A; Fri, 10 Feb 2012 19:58:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF5158FC1B; Fri, 10 Feb 2012 19:58:04 +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 q1AJw47o091354; Fri, 10 Feb 2012 19:58:04 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJw4ZB091352; Fri, 10 Feb 2012 19:58:04 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202101958.q1AJw4ZB091352@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 19:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231419 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:58:07 -0000 Author: gonzo Date: Fri Feb 10 19:58:04 2012 New Revision: 231419 URL: http://svn.freebsd.org/changeset/base/231419 Log: Remove debug output Modified: head/libexec/rtld-elf/mips/reloc.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 19:57:58 2012 (r231418) +++ head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 19:58:04 2012 (r231419) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include "debug.h" #include "rtld.h" -#include "rtld_printf.h" #ifdef __mips_n64 #define GOT1_MASK 0x8000000000000000UL @@ -544,7 +543,6 @@ allocate_initial_tls(Obj_Entry *objs) + TLS_TP_OFFSET + TLS_TCB_SIZE); sysarch(MIPS_SET_TLS, tls); - rtld_printf("allocate_initial_tls -> %p(%p)\n", tls, tls - TLS_TP_OFFSET - TLS_TCB_SIZE); } void * From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:00:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34A821065676; Fri, 10 Feb 2012 20:00:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CFB08FC08; Fri, 10 Feb 2012 20:00: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 q1AK0Otk091490; Fri, 10 Feb 2012 20:00:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AK0N0m091489; Fri, 10 Feb 2012 20:00:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102000.q1AK0N0m091489@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231420 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:00:30 -0000 Author: tuexen Date: Fri Feb 10 20:00:21 2012 New Revision: 231420 URL: http://svn.freebsd.org/changeset/base/231420 Log: MFC r218818: Bugfix: Get per vnet sysctl variables and statistics working. Modified: stable/8/sys/netinet/sctp_sysctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 19:58:04 2012 (r231419) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:00:21 2012 (r231420) @@ -566,7 +566,11 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) { int error; +#ifdef VIMAGE + error = vnet_sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); +#else error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); +#endif if (error == 0) { RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX); @@ -828,301 +832,298 @@ sysctl_sctp_cleartrace(SYSCTL_HANDLER_AR * sysctl definitions */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXDGRAM_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, "IU", SCTPCTL_RECVSPACE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTOASCONF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_ECN_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); #if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_INIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", SCTPCTL_PEER_CHKOH_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, "IU", SCTPCTL_FRMAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", SCTPCTL_MAXCHUNKS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_TCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, "IU", SCTPCTL_PCBHASHSIZE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_SPLIT_POINT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, "IU", SCTPCTL_CHUNKSCALE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_DELAYED_SACK_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_FREQ_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_SYS_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ASOC_RESOURCE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, "IU", SCTPCTL_HEARTBEAT_INTERVAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PMTU_RAISE_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, "IU", SCTPCTL_SECRET_LIFETIME_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_MIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, "IU", SCTPCTL_RTO_INITIAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTO_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, "IU", SCTPCTL_VALID_COOKIE_LIFE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_INIT_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_ASSOC_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, "IU", SCTPCTL_PATH_RTX_MAX_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_ON_OFF_DESC); -/* EY */ -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, "IU", SCTPCTL_NR_SACK_ON_OFF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_USE_DAC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_cmt_pf), 0, sysctl_sctp_check, "IU", SCTPCTL_CMT_PF_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_CWND_MAXBURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_early_fr_msec), 0, sysctl_sctp_check, "IU", SCTPCTL_EARLY_FAST_RETRAN_MSEC_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), 0, sysctl_sctp_check, "IU", SCTPCTL_ASCONF_AUTH_NOCHK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, "IU", SCTPCTL_AUTH_DISABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, "IU", SCTPCTL_ABC_L_VAR_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_CHAINED_MBUFS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, "IU", SCTPCTL_DO_SCTP_DRAIN_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, "IU", SCTPCTL_HB_MAX_BURST_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, "IU", SCTPCTL_ABORT_AT_LIMIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_DATA_ORDER_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, "IU", SCTPCTL_MIN_RESIDUAL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, "IU", SCTPCTL_MAX_RETRAN_CHUNK_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, "IU", SCTPCTL_LOGGING_LEVEL_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_CC_MODULE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_ss_module, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_ss_module, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_ss_module), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_SS_MODULE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, "IU", SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_BASE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", SCTPCTL_MOBILITY_FASTHANDOFF_DESC); #if defined(SCTP_LOCAL_TRACE_BUF) -SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, log, CTLFLAG_RD, +SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, log, CTLFLAG_RD, &SCTP_BASE_SYSCTL(sctp_log), sctp_log, "SCTP logging (struct sctp_log)"); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_log), 0, sysctl_sctp_cleartrace, "IU", "Clear SCTP Logging buffer"); - - - #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), 0, sysctl_sctp_check, "IU", SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_INITS_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", SCTPCTL_TIME_WAIT_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", SCTPCTL_BUFFER_SPLITTING_DESC); -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", SCTPCTL_INITIAL_CWND_DESC); #ifdef SCTP_DEBUG -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", SCTPCTL_DEBUG_DESC); -#endif /* SCTP_DEBUG */ +#endif #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); #endif + #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, stats, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, stats, CTLTYPE_STRUCT | CTLFLAG_RW, 0, 0, sysctl_stat_get, "S,sctpstat", "SCTP statistics (struct sctp_stat)"); #else -SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, +SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, &SCTP_BASE_STATS_SYSCTL, sctpstat, "SCTP statistics (struct sctp_stat)"); #endif -SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, 0, 0, sctp_assoclist, "S,xassoc", "List of active SCTP associations"); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:07:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0237106564A; Fri, 10 Feb 2012 20:07:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B96468FC12; Fri, 10 Feb 2012 20:07: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 q1AK7152091750; Fri, 10 Feb 2012 20:07:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AK71TA091746; Fri, 10 Feb 2012 20:07:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102007.q1AK71TA091746@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:07:01 +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: r231421 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:07:01 -0000 Author: tuexen Date: Fri Feb 10 20:07:01 2012 New Revision: 231421 URL: http://svn.freebsd.org/changeset/base/231421 Log: MFC r219013: * Cleanup the code computing the retransmission timeout. * Fix an initialization bug for the scaled variance of the RTO. Modified: stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:00:21 2012 (r231420) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:07:01 2012 (r231421) @@ -245,7 +245,7 @@ struct sctp_nets { /* smoothed average things for RTT and RTO itself */ int lastsa; int lastsv; - int rtt; /* last measured rtt value in ms */ + uint64_t rtt; /* last measured rtt value in us */ unsigned int RTO; /* This is used for SHUTDOWN/SHUTDOWN-ACK/SEND or INIT timers */ @@ -254,6 +254,10 @@ struct sctp_nets { /* last time in seconds I sent to it */ struct timeval last_sent_time; + + /* JRS - struct used in HTCP algorithm */ + struct htcp htcp_ca; + int ref_count; /* Congestion stats per destination */ @@ -267,7 +271,6 @@ struct sctp_nets { uint32_t ecn_prev_cwnd; /* ECN prev cwnd at first ecn_echo seen in new * window */ uint32_t partial_bytes_acked; /* in CA tracks when to incr a MTU */ - uint32_t prev_rtt; /* tracking variables to avoid the aloc/free in sack processing */ unsigned int net_ack; unsigned int net_ack2; @@ -298,7 +301,6 @@ struct sctp_nets { uint32_t tos_flowlabel; struct timeval start_time; /* time when this net was created */ - struct timeval last_measured_rtt; uint32_t marked_retrans;/* number or DATA chunks marked for timer * based retransmissions */ uint32_t marked_fastretrans; @@ -348,8 +350,6 @@ struct sctp_nets { uint8_t RTO_measured; /* Have we done the first measure */ uint8_t last_hs_used; /* index into the last HS table entry we used */ uint8_t lan_type; - /* JRS - struct used in HTCP algorithm */ - struct htcp htcp_ca; uint32_t flowid; #ifdef INVARIANTS uint8_t flowidset; Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:00:21 2012 (r231420) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:07:01 2012 (r231421) @@ -477,7 +477,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xraddr.cwnd = net->cwnd; xraddr.flight_size = net->flight_size; xraddr.mtu = net->mtu; - xraddr.rtt = net->rtt; + xraddr.rtt = net->rtt / 1000; xraddr.start_time.tv_sec = (uint32_t) net->start_time.tv_sec; xraddr.start_time.tv_usec = (uint32_t) net->start_time.tv_usec; SCTP_INP_RUNLOCK(inp); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:00:21 2012 (r231420) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:07:01 2012 (r231421) @@ -113,7 +113,7 @@ rto_logging(struct sctp_nets *net, int f memset(&sctp_clog, 0, sizeof(sctp_clog)); sctp_clog.x.rto.net = (void *)net; - sctp_clog.x.rto.rtt = net->prev_rtt; + sctp_clog.x.rto.rtt = net->rtt / 1000; SCTP_CTR6(KTR_SCTP, "SCTP:%d[%d]:%x-%x-%x-%x", SCTP_LOG_EVENT_RTT, from, @@ -2475,9 +2475,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb * given an association and the starting time of the current RTT * period (in value1/value2) return RTO in number of msecs. */ - int calc_time = 0; - int o_calctime; - uint32_t new_rto = 0; + int32_t rtt; /* RTT in ms */ + uint32_t new_rto; int first_measure = 0; struct timeval now, then, *old; @@ -2497,95 +2496,58 @@ sctp_calculate_rto(struct sctp_tcb *stcb /************************/ /* get the current time */ (void)SCTP_GETTIME_TIMEVAL(&now); - /* - * Record the real time of the last RTT for use in DC-CC. - */ - net->last_measured_rtt = now; - timevalsub(&net->last_measured_rtt, old); + timevalsub(&now, old); + /* store the current RTT in us */ + net->rtt = (uint64_t) 10000000 *(uint64_t) now.tv_sec + + (uint64_t) now.tv_usec; + + /* computer rtt in ms */ + rtt = net->rtt / 1000; /* Do we need to determine the lan type? */ - if ((local_lan_determine == SCTP_DETERMINE_LL_OK) && (net->lan_type == SCTP_LAN_UNKNOWN)) { - if ((net->last_measured_rtt.tv_sec) || - (net->last_measured_rtt.tv_usec > SCTP_LOCAL_LAN_RTT)) { + if ((local_lan_determine == SCTP_DETERMINE_LL_OK) && + (net->lan_type == SCTP_LAN_UNKNOWN)) { + if (net->rtt > SCTP_LOCAL_LAN_RTT) { net->lan_type = SCTP_LAN_INTERNET; } else { net->lan_type = SCTP_LAN_LOCAL; } } - /* compute the RTT value */ - if ((u_long)now.tv_sec > (u_long)old->tv_sec) { - calc_time = ((u_long)now.tv_sec - (u_long)old->tv_sec) * 1000; - if ((u_long)now.tv_usec > (u_long)old->tv_usec) { - calc_time += (((u_long)now.tv_usec - - (u_long)old->tv_usec) / 1000); - } else if ((u_long)now.tv_usec < (u_long)old->tv_usec) { - /* Borrow 1,000ms from current calculation */ - calc_time -= 1000; - /* Add in the slop over */ - calc_time += ((int)now.tv_usec / 1000); - /* Add in the pre-second ms's */ - calc_time += (((int)1000000 - (int)old->tv_usec) / 1000); - } - } else if ((u_long)now.tv_sec == (u_long)old->tv_sec) { - if ((u_long)now.tv_usec > (u_long)old->tv_usec) { - calc_time = ((u_long)now.tv_usec - - (u_long)old->tv_usec) / 1000; - } else if ((u_long)now.tv_usec < (u_long)old->tv_usec) { - /* impossible .. garbage in nothing out */ - goto calc_rto; - } else if ((u_long)now.tv_usec == (u_long)old->tv_usec) { - /* - * We have to have 1 usec :-D this must be the - * loopback. - */ - calc_time = 1; - } else { - /* impossible .. garbage in nothing out */ - goto calc_rto; - } - } else { - /* Clock wrapped? */ - goto calc_rto; - } /***************************/ /* 2. update RTTVAR & SRTT */ /***************************/ - net->rtt = o_calctime = calc_time; - /* this is Van Jacobson's integer version */ + /*- + * Compute the scaled average lastsa and the + * scaled variance lastsv as described in van Jacobson + * Paper "Congestion Avoidance and Control", Annex A. + * + * (net->lastsa >> SCTP_RTT_SHIFT) is the srtt + * (net->lastsa >> SCTP_RTT_VAR_SHIFT) is the rttvar + */ if (net->RTO_measured) { - calc_time -= (net->lastsa >> SCTP_RTT_SHIFT); /* take away 1/8th when - * shift=3 */ + rtt -= (net->lastsa >> SCTP_RTT_SHIFT); + net->lastsa += rtt; + if (rtt < 0) { + rtt = -rtt; + } + rtt -= (net->lastsv >> SCTP_RTT_VAR_SHIFT); + net->lastsv += rtt; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RTTVAR_LOGGING_ENABLE) { rto_logging(net, SCTP_LOG_RTTVAR); } - net->prev_rtt = o_calctime; - net->lastsa += calc_time; /* add 7/8th into sa when - * shift=3 */ - if (calc_time < 0) { - calc_time = -calc_time; - } - calc_time -= (net->lastsv >> SCTP_RTT_VAR_SHIFT); /* take away 1/4 when - * VAR shift=2 */ - net->lastsv += calc_time; - if (net->lastsv == 0) { - net->lastsv = SCTP_CLOCK_GRANULARITY; - } } else { /* First RTO measurment */ net->RTO_measured = 1; - net->lastsa = calc_time << SCTP_RTT_SHIFT; /* Multiply by 8 when - * shift=3 */ - net->lastsv = calc_time; - if (net->lastsv == 0) { - net->lastsv = SCTP_CLOCK_GRANULARITY; - } first_measure = 1; - net->prev_rtt = o_calctime; + net->lastsa = rtt << SCTP_RTT_SHIFT; + net->lastsv = (rtt / 2) << SCTP_RTT_VAR_SHIFT; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RTTVAR_LOGGING_ENABLE) { rto_logging(net, SCTP_LOG_INITIAL_RTT); } } -calc_rto: + if (net->lastsv == 0) { + net->lastsv = SCTP_CLOCK_GRANULARITY; + } new_rto = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if ((new_rto > SCTP_SAT_NETWORK_MIN) && (stcb->asoc.sat_network_lockout == 0)) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:09:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52A8C1065672; Fri, 10 Feb 2012 20:09:08 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id DF7848FC0C; Fri, 10 Feb 2012 20:09:07 +0000 (UTC) Received: by iaeo4 with SMTP id o4so971625iae.13 for ; Fri, 10 Feb 2012 12:09:07 -0800 (PST) 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=WPcdAhb4/M4TTi/bw9aIaPXrzYtoL2JGn4k66D85sig=; b=w+dQkPE6LvUFX76d4fU0HMg1YGE3CLg8i7fiAojHYx8DqU57yt6LV9XagYJlPhFYqi WOQCsOkGFyQVN7cP0LBLdQ3Gmwre88cdTboZpMWDUG0vef0eu/SiJW5sc5Ca8TFHKhhj Vx5a08suJSWKwNxf1EJAceD38Jdo9WHjKauRk= MIME-Version: 1.0 Received: by 10.42.131.136 with SMTP id z8mr11564397ics.5.1328902958026; Fri, 10 Feb 2012 11:42:38 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.43.130.201 with HTTP; Fri, 10 Feb 2012 11:42:37 -0800 (PST) In-Reply-To: References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> Date: Fri, 10 Feb 2012 20:42:37 +0100 X-Google-Sender-Auth: UU-i77hd5ttlewZrBuImpQbAXH8 Message-ID: From: Robert Millan To: "Bjoern A. Zeeb" Content-Type: multipart/mixed; boundary=90e6ba6e81ccc1113d04b8a15409 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Adrian Chadd Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:09:08 -0000 --90e6ba6e81ccc1113d04b8a15409 Content-Type: text/plain; charset=UTF-8 Hi all, Sorry for the late reply. I can't keep up with mail during the week. 2012/2/4, Bjoern A. Zeeb : > And can you please include GENERIC at least in these kernel configs? They > are not building and this breaks a make universe and I guess eventually the > tinderbox as well... Including GENERIC sounds problematic because if both WITHOUT_* files are included, then GENERIC is included twice! As discussed on -arch, the idea was that users would never build WITHOUT_* directly, but rather include them in their custom kernel config. These files weren't intended to be picked up by "make universe" either [1]. It just didn't occur to me that the universe target would pick them up. Here's a possible solution to this patch (untested). In case it looks fine to everyone (and my mentors approve it), I'll definitely test with "make universe" before commit. [1] shame on me for not testing lasest version of my patch with "make universe" -- I only tested the first one which didn't add WITHOUT_* files. -- Robert Millan --90e6ba6e81ccc1113d04b8a15409 Content-Type: text/plain; charset=US-ASCII; name="exclude_without_files.diff" Content-Disposition: attachment; filename="exclude_without_files.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 SW5kZXg6IE1ha2VmaWxlCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIE1ha2VmaWxlCShyZXZpc2lvbiAyMzA5NzEp CisrKyBNYWtlZmlsZQkod29ya2luZyBjb3B5KQpAQCAtNDA0LDcgKzQwNCw3IEBACiAuZW5kaWYK IEtFUk5DT05GUyE9CWNkICR7S0VSTlNSQ0RJUn0vJHtUQVJHRVR9L2NvbmYgJiYgXAogCQlmaW5k IFtBLVowLTldKltBLVowLTldIC10eXBlIGYgLW1heGRlcHRoIDAgXAotCQkhIC1uYW1lIERFRkFV TFRTICEgLW5hbWUgTk9URVMKKwkJISAtbmFtZSBERUZBVUxUUyAhIC1uYW1lIE5PVEVTICEgLW5h bWUgV0lUSE9VVF9cKgogdW5pdmVyc2Vfa2VybmNvbmZzOgogLmZvciBrZXJuZWwgaW4gJHtLRVJO Q09ORlN9CiBUQVJHRVRfQVJDSF8ke2tlcm5lbH0hPQljZCAke0tFUk5TUkNESVJ9LyR7VEFSR0VU fS9jb25mICYmIFwK --90e6ba6e81ccc1113d04b8a15409-- From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:09:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07BE7106566B; Fri, 10 Feb 2012 20:09:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4F0E8FC08; Fri, 10 Feb 2012 20:09: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 q1AK9NtP091928; Fri, 10 Feb 2012 20:09:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AK9NxY091924; Fri, 10 Feb 2012 20:09:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102009.q1AK9NxY091924@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231422 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:09:24 -0000 Author: tuexen Date: Fri Feb 10 20:09:23 2012 New Revision: 231422 URL: http://svn.freebsd.org/changeset/base/231422 Log: MFC r219014: * Fix several bugs where the scaled versions of srtt and rttvar where used incorrectly. * Use appropriate variable names for RTO instead of RTT. Modified: stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:07:01 2012 (r231421) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:09:23 2012 (r231422) @@ -428,7 +428,7 @@ skip_cwnd_update: */ if (net->net_ack2) { /* restore any doubled timers */ - net->RTO = ((net->lastsa >> 2) + net->lastsv) >> 1; + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if (net->RTO < stcb->asoc.minrto) { net->RTO = stcb->asoc.minrto; } @@ -518,8 +518,8 @@ sctp_cwnd_update_after_packet_dropped(st unsigned int incr; int old_cwnd = net->cwnd; - /* need real RTT for this calc */ - rtt = ((net->lastsa >> 2) + net->lastsv) >> 1; + /* need real RTT in msd for this calc */ + rtt = net->rtt / 1000; /* get bottle neck bw */ *bottle_bw = ntohl(cp->bottle_bw); /* and whats on queue */ @@ -1079,7 +1079,7 @@ skip_cwnd_update: */ if (net->net_ack2) { /* restore any doubled timers */ - net->RTO = ((net->lastsa >> 2) + net->lastsv) >> 1; + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if (net->RTO < stcb->asoc.minrto) { net->RTO = stcb->asoc.minrto; } @@ -1146,7 +1146,7 @@ htcp_cwnd_undo(struct sctp_tcb *stcb, st static inline void measure_rtt(struct sctp_tcb *stcb, struct sctp_nets *net) { - uint32_t srtt = net->lastsa >> 3; + uint32_t srtt = net->lastsa >> SCTP_RTT_SHIFT; /* keep track of minimum RTT seen so far, minRTT is zero at first */ if (net->htcp_ca.minRTT > srtt || !net->htcp_ca.minRTT) @@ -1532,7 +1532,7 @@ skip_cwnd_update: */ if (net->net_ack2) { /* restore any doubled timers */ - net->RTO = ((net->lastsa >> 2) + net->lastsv) >> 1; + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; if (net->RTO < stcb->asoc.minrto) { net->RTO = stcb->asoc.minrto; } Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:07:01 2012 (r231421) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:09:23 2012 (r231422) @@ -61,24 +61,24 @@ sctp_early_fr_timer(struct sctp_inpcb *i { struct sctp_tmit_chunk *chk, *pchk; struct timeval now, min_wait, tv; - unsigned int cur_rtt, cnt = 0, cnt_resend = 0; + unsigned int cur_rto, cnt = 0, cnt_resend = 0; /* an early FR is occuring. */ (void)SCTP_GETTIME_TIMEVAL(&now); /* get cur rto in micro-seconds */ if (net->lastsa == 0) { /* Hmm no rtt estimate yet? */ - cur_rtt = stcb->asoc.initial_rto >> 2; + cur_rto = stcb->asoc.initial_rto >> 2; } else { - cur_rtt = ((net->lastsa >> 2) + net->lastsv) >> 1; + cur_rto = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; } - if (cur_rtt < SCTP_BASE_SYSCTL(sctp_early_fr_msec)) { - cur_rtt = SCTP_BASE_SYSCTL(sctp_early_fr_msec); + if (cur_rto < SCTP_BASE_SYSCTL(sctp_early_fr_msec)) { + cur_rto = SCTP_BASE_SYSCTL(sctp_early_fr_msec); } - cur_rtt *= 1000; - tv.tv_sec = cur_rtt / 1000000; - tv.tv_usec = cur_rtt % 1000000; + cur_rto *= 1000; + tv.tv_sec = cur_rto / 1000000; + tv.tv_usec = cur_rto % 1000000; min_wait = now; timevalsub(&min_wait, &tv); if (min_wait.tv_sec < 0 || min_wait.tv_usec < 0) { @@ -626,7 +626,7 @@ sctp_mark_all_for_resend(struct sctp_tcb struct sctp_tmit_chunk *chk, *nchk; struct sctp_nets *lnets; struct timeval now, min_wait, tv; - int cur_rtt; + int cur_rto; int cnt_abandoned; int audit_tf, num_mk, fir; unsigned int cnt_mk; @@ -644,10 +644,10 @@ sctp_mark_all_for_resend(struct sctp_tcb */ (void)SCTP_GETTIME_TIMEVAL(&now); /* get cur rto in micro-seconds */ - cur_rtt = (((net->lastsa >> 2) + net->lastsv) >> 1); - cur_rtt *= 1000; + cur_rto = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; + cur_rto *= 1000; if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_EARLYFR_LOGGING_ENABLE | SCTP_FR_LOGGING_ENABLE)) { - sctp_log_fr(cur_rtt, + sctp_log_fr(cur_rto, stcb->asoc.peers_rwnd, window_probe, SCTP_FR_T3_MARK_TIME); @@ -657,8 +657,8 @@ sctp_mark_all_for_resend(struct sctp_tcb SCTP_FR_CWND_REPORT); sctp_log_fr(net->flight_size, net->cwnd, stcb->asoc.total_flight, SCTP_FR_CWND_REPORT); } - tv.tv_sec = cur_rtt / 1000000; - tv.tv_usec = cur_rtt % 1000000; + tv.tv_sec = cur_rto / 1000000; + tv.tv_usec = cur_rto % 1000000; min_wait = now; timevalsub(&min_wait, &tv); if (min_wait.tv_sec < 0 || min_wait.tv_usec < 0) { @@ -671,7 +671,7 @@ sctp_mark_all_for_resend(struct sctp_tcb min_wait.tv_sec = min_wait.tv_usec = 0; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_EARLYFR_LOGGING_ENABLE | SCTP_FR_LOGGING_ENABLE)) { - sctp_log_fr(cur_rtt, now.tv_sec, now.tv_usec, SCTP_FR_T3_MARK_TIME); + sctp_log_fr(cur_rto, now.tv_sec, now.tv_usec, SCTP_FR_T3_MARK_TIME); sctp_log_fr(0, min_wait.tv_sec, min_wait.tv_usec, SCTP_FR_T3_MARK_TIME); } /* Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:07:01 2012 (r231421) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:09:23 2012 (r231422) @@ -2398,7 +2398,7 @@ flags_out: paddri->spinfo_state = SCTP_INACTIVE; } paddri->spinfo_cwnd = net->cwnd; - paddri->spinfo_srtt = ((net->lastsa >> 2) + net->lastsv) >> 1; + paddri->spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; paddri->spinfo_rto = net->RTO; paddri->spinfo_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); @@ -2475,7 +2475,7 @@ flags_out: sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; } sstat->sstat_primary.spinfo_cwnd = net->cwnd; - sstat->sstat_primary.spinfo_srtt = net->lastsa; + sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; sstat->sstat_primary.spinfo_rto = net->RTO; sstat->sstat_primary.spinfo_mtu = net->mtu; sstat->sstat_primary.spinfo_assoc_id = sctp_get_associd(stcb); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:17:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AC531065670; Fri, 10 Feb 2012 20:17:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23B7B8FC13; Fri, 10 Feb 2012 20:17:29 +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 q1AKHT4L092240; Fri, 10 Feb 2012 20:17:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKHSch092225; Fri, 10 Feb 2012 20:17:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102017.q1AKHSch092225@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:17:28 +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: r231423 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:17:29 -0000 Author: tuexen Date: Fri Feb 10 20:17:28 2012 New Revision: 231423 URL: http://svn.freebsd.org/changeset/base/231423 Log: MFC r219057: Improvements to CC modules: 1) Add four new points that allow you to get more information to cc algo's 2) Fix the case where user changes module on a existing TCB, in such a case, the initialization module needs to be called on all nets. 3) Move htcp_cc structure to a union that other modules can use. 4) Add 5th point for get/set socket options for cc_module specific options From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 20:17:28 2012 (r231423) @@ -161,9 +161,10 @@ struct sctp_paramhdr { /* JRS - Pluggable Congestion Control Socket option */ #define SCTP_PLUGGABLE_CC 0x00001202 /* RS - Pluggable Stream Scheduling Socket option */ -#define SCTP_PLUGGABLE_SS 0x00001203 -#define SCTP_SS_VALUE 0x00001204 - +#define SCTP_PLUGGABLE_SS 0x00001203 +#define SCTP_SS_VALUE 0x00001204 +#define SCTP_CC_OPTION 0x00001205 /* Options for CC + * modules */ /* read only */ #define SCTP_GET_SNDBUF_USE 0x00001101 #define SCTP_GET_STAT_LOG 0x00001103 Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:17:28 2012 (r231423) @@ -1135,10 +1135,10 @@ htcp_reset(struct htcp *ca) static uint32_t htcp_cwnd_undo(struct sctp_tcb *stcb, struct sctp_nets *net) { - net->htcp_ca.last_cong = net->htcp_ca.undo_last_cong; - net->htcp_ca.maxRTT = net->htcp_ca.undo_maxRTT; - net->htcp_ca.old_maxB = net->htcp_ca.undo_old_maxB; - return max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->htcp_ca.beta) * net->mtu); + net->cc_mod.htcp_ca.last_cong = net->cc_mod.htcp_ca.undo_last_cong; + net->cc_mod.htcp_ca.maxRTT = net->cc_mod.htcp_ca.undo_maxRTT; + net->cc_mod.htcp_ca.old_maxB = net->cc_mod.htcp_ca.undo_old_maxB; + return max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->cc_mod.htcp_ca.beta) * net->mtu); } #endif @@ -1149,15 +1149,15 @@ measure_rtt(struct sctp_tcb *stcb, struc uint32_t srtt = net->lastsa >> SCTP_RTT_SHIFT; /* keep track of minimum RTT seen so far, minRTT is zero at first */ - if (net->htcp_ca.minRTT > srtt || !net->htcp_ca.minRTT) - net->htcp_ca.minRTT = srtt; + if (net->cc_mod.htcp_ca.minRTT > srtt || !net->cc_mod.htcp_ca.minRTT) + net->cc_mod.htcp_ca.minRTT = srtt; /* max RTT */ - if (net->fast_retran_ip == 0 && net->ssthresh < 0xFFFF && htcp_ccount(&net->htcp_ca) > 3) { - if (net->htcp_ca.maxRTT < net->htcp_ca.minRTT) - net->htcp_ca.maxRTT = net->htcp_ca.minRTT; - if (net->htcp_ca.maxRTT < srtt && srtt <= net->htcp_ca.maxRTT + MSEC_TO_TICKS(20)) - net->htcp_ca.maxRTT = srtt; + if (net->fast_retran_ip == 0 && net->ssthresh < 0xFFFF && htcp_ccount(&net->cc_mod.htcp_ca) > 3) { + if (net->cc_mod.htcp_ca.maxRTT < net->cc_mod.htcp_ca.minRTT) + net->cc_mod.htcp_ca.maxRTT = net->cc_mod.htcp_ca.minRTT; + if (net->cc_mod.htcp_ca.maxRTT < srtt && srtt <= net->cc_mod.htcp_ca.maxRTT + MSEC_TO_TICKS(20)) + net->cc_mod.htcp_ca.maxRTT = srtt; } } @@ -1167,7 +1167,7 @@ measure_achieved_throughput(struct sctp_ uint32_t now = sctp_get_tick_count(); if (net->fast_retran_ip == 0) - net->htcp_ca.bytes_acked = net->net_ack; + net->cc_mod.htcp_ca.bytes_acked = net->net_ack; if (!use_bandwidth_switch) return; @@ -1175,29 +1175,29 @@ measure_achieved_throughput(struct sctp_ /* achieved throughput calculations */ /* JRS - not 100% sure of this statement */ if (net->fast_retran_ip == 1) { - net->htcp_ca.bytecount = 0; - net->htcp_ca.lasttime = now; + net->cc_mod.htcp_ca.bytecount = 0; + net->cc_mod.htcp_ca.lasttime = now; return; } - net->htcp_ca.bytecount += net->net_ack; + net->cc_mod.htcp_ca.bytecount += net->net_ack; - if (net->htcp_ca.bytecount >= net->cwnd - ((net->htcp_ca.alpha >> 7 ? : 1) * net->mtu) - && now - net->htcp_ca.lasttime >= net->htcp_ca.minRTT - && net->htcp_ca.minRTT > 0) { - uint32_t cur_Bi = net->htcp_ca.bytecount / net->mtu * hz / (now - net->htcp_ca.lasttime); + if (net->cc_mod.htcp_ca.bytecount >= net->cwnd - ((net->cc_mod.htcp_ca.alpha >> 7 ? : 1) * net->mtu) + && now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT + && net->cc_mod.htcp_ca.minRTT > 0) { + uint32_t cur_Bi = net->cc_mod.htcp_ca.bytecount / net->mtu * hz / (now - net->cc_mod.htcp_ca.lasttime); - if (htcp_ccount(&net->htcp_ca) <= 3) { + if (htcp_ccount(&net->cc_mod.htcp_ca) <= 3) { /* just after backoff */ - net->htcp_ca.minB = net->htcp_ca.maxB = net->htcp_ca.Bi = cur_Bi; + net->cc_mod.htcp_ca.minB = net->cc_mod.htcp_ca.maxB = net->cc_mod.htcp_ca.Bi = cur_Bi; } else { - net->htcp_ca.Bi = (3 * net->htcp_ca.Bi + cur_Bi) / 4; - if (net->htcp_ca.Bi > net->htcp_ca.maxB) - net->htcp_ca.maxB = net->htcp_ca.Bi; - if (net->htcp_ca.minB > net->htcp_ca.maxB) - net->htcp_ca.minB = net->htcp_ca.maxB; + net->cc_mod.htcp_ca.Bi = (3 * net->cc_mod.htcp_ca.Bi + cur_Bi) / 4; + if (net->cc_mod.htcp_ca.Bi > net->cc_mod.htcp_ca.maxB) + net->cc_mod.htcp_ca.maxB = net->cc_mod.htcp_ca.Bi; + if (net->cc_mod.htcp_ca.minB > net->cc_mod.htcp_ca.maxB) + net->cc_mod.htcp_ca.minB = net->cc_mod.htcp_ca.maxB; } - net->htcp_ca.bytecount = 0; - net->htcp_ca.lasttime = now; + net->cc_mod.htcp_ca.bytecount = 0; + net->cc_mod.htcp_ca.lasttime = now; } } @@ -1264,25 +1264,25 @@ htcp_alpha_update(struct htcp *ca) static void htcp_param_update(struct sctp_tcb *stcb, struct sctp_nets *net) { - uint32_t minRTT = net->htcp_ca.minRTT; - uint32_t maxRTT = net->htcp_ca.maxRTT; + uint32_t minRTT = net->cc_mod.htcp_ca.minRTT; + uint32_t maxRTT = net->cc_mod.htcp_ca.maxRTT; - htcp_beta_update(&net->htcp_ca, minRTT, maxRTT); - htcp_alpha_update(&net->htcp_ca); + htcp_beta_update(&net->cc_mod.htcp_ca, minRTT, maxRTT); + htcp_alpha_update(&net->cc_mod.htcp_ca); /* * add slowly fading memory for maxRTT to accommodate routing * changes etc */ if (minRTT > 0 && maxRTT > minRTT) - net->htcp_ca.maxRTT = minRTT + ((maxRTT - minRTT) * 95) / 100; + net->cc_mod.htcp_ca.maxRTT = minRTT + ((maxRTT - minRTT) * 95) / 100; } static uint32_t htcp_recalc_ssthresh(struct sctp_tcb *stcb, struct sctp_nets *net) { htcp_param_update(stcb, net); - return max(((net->cwnd / net->mtu * net->htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu); + return max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu); } static void @@ -1323,14 +1323,14 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s * net->cwnd += alpha / net->cwnd */ /* What is snd_cwnd_cnt?? */ - if (((net->partial_bytes_acked / net->mtu * net->htcp_ca.alpha) >> 7) * net->mtu >= net->cwnd) { + if (((net->partial_bytes_acked / net->mtu * net->cc_mod.htcp_ca.alpha) >> 7) * net->mtu >= net->cwnd) { /*- * Does SCTP have a cwnd clamp? * if (net->snd_cwnd < net->snd_cwnd_clamp) - Nope (RRS). */ net->cwnd += net->mtu; net->partial_bytes_acked = 0; - htcp_alpha_update(&net->htcp_ca); + htcp_alpha_update(&net->cc_mod.htcp_ca); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_CA); @@ -1343,7 +1343,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s } } - net->htcp_ca.bytes_acked = net->mtu; + net->cc_mod.htcp_ca.bytes_acked = net->mtu; } } @@ -1360,11 +1360,11 @@ htcp_min_cwnd(struct sctp_tcb *stcb, str static void htcp_init(struct sctp_tcb *stcb, struct sctp_nets *net) { - memset(&net->htcp_ca, 0, sizeof(struct htcp)); - net->htcp_ca.alpha = ALPHA_BASE; - net->htcp_ca.beta = BETA_MIN; - net->htcp_ca.bytes_acked = net->mtu; - net->htcp_ca.last_cong = sctp_get_tick_count(); + memset(&net->cc_mod.htcp_ca, 0, sizeof(struct htcp)); + net->cc_mod.htcp_ca.alpha = ALPHA_BASE; + net->cc_mod.htcp_ca.beta = BETA_MIN; + net->cc_mod.htcp_ca.bytes_acked = net->mtu; + net->cc_mod.htcp_ca.last_cong = sctp_get_tick_count(); } static void @@ -1568,7 +1568,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc int old_cwnd = net->cwnd; /* JRS - reset as if state were changed */ - htcp_reset(&net->htcp_ca); + htcp_reset(&net->cc_mod.htcp_ca); net->ssthresh = htcp_recalc_ssthresh(stcb, net); net->cwnd = net->ssthresh; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { @@ -1622,7 +1622,7 @@ sctp_htcp_cwnd_update_after_timeout(stru int old_cwnd = net->cwnd; /* JRS - reset as if the state were being changed to timeout */ - htcp_reset(&net->htcp_ca); + htcp_reset(&net->cc_mod.htcp_ca); net->ssthresh = htcp_recalc_ssthresh(stcb, net); net->cwnd = net->mtu; net->partial_bytes_acked = 0; @@ -1640,7 +1640,7 @@ sctp_htcp_cwnd_update_after_fr_timer(str old_cwnd = net->cwnd; sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_EARLY_FR_TMR, SCTP_SO_NOT_LOCKED); - net->htcp_ca.last_cong = sctp_get_tick_count(); + net->cc_mod.htcp_ca.last_cong = sctp_get_tick_count(); /* * make a small adjustment to cwnd and force to CA. */ @@ -1665,7 +1665,7 @@ sctp_htcp_cwnd_update_after_ecn_echo(str /* JRS - reset hctp as if state changed */ if (in_window == 0) { - htcp_reset(&net->htcp_ca); + htcp_reset(&net->cc_mod.htcp_ca); SCTP_STAT_INCR(sctps_ecnereducedcwnd); net->ssthresh = htcp_recalc_ssthresh(stcb, net); if (net->ssthresh < net->mtu) { Modified: stable/8/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 20:17:28 2012 (r231423) @@ -55,6 +55,8 @@ SDT_PROBE_DECLARE(sctp, cwnd, net, bl); SDT_PROBE_DECLARE(sctp, cwnd, net, ecn); /* update at a Packet-Drop -- decrease */ SDT_PROBE_DECLARE(sctp, cwnd, net, pd); +/* Rttvar probe declaration */ +SDT_PROBE_DECLARE(sctp, cwnd, net, rttvar); /* One to track an associations rwnd */ SDT_PROBE_DECLARE(sctp, rwnd, assoc, val); Modified: stable/8/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 20:17:28 2012 (r231423) @@ -71,6 +71,21 @@ SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, /* The new value of the cwnd */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, ack, 4, "int"); + +/* ACK-INCREASE */ +SDT_PROBE_DEFINE(sctp, cwnd, net, rttvar, rttvar); +/* The Vtag << 32 | localport << 16 | remoteport */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 0, "uint64_t"); +/* obw | nbw */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 1, "uint64_t"); +/* newrtt */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 2, "uint64_t"); +/* bwrtt */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 3, "uint64_t"); +/* (cwnd << 32) | point << 16 | retval(0/1) */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 4, "uint64_t"); + + /* FastRetransmit-DECREASE */ SDT_PROBE_DEFINE(sctp, cwnd, net, fr, fr); /* The Vtag for this end */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:17:28 2012 (r231423) @@ -2939,6 +2939,10 @@ sctp_process_segment_range(struct sctp_t tp1->rec.data.TSN_seq); } sctp_flight_size_decrease(tp1); + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } sctp_total_flight_decrease(stcb, tp1); tp1->whoTo->net_ack += tp1->send_size; @@ -3442,6 +3446,10 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->whoTo) { tp1->whoTo->net_ack++; sctp_flight_size_decrease(tp1); + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) { sctp_log_rwnd(SCTP_INCREASE_PEER_RWND, @@ -3737,6 +3745,10 @@ sctp_window_probe_recovery(struct sctp_t return; } /* First setup this by shrinking flight */ + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } sctp_flight_size_decrease(tp1); sctp_total_flight_decrease(stcb, tp1); /* Now mark for resend */ @@ -3810,6 +3822,9 @@ sctp_express_handle_sack(struct sctp_tcb */ net->new_pseudo_cumack = 0; net->will_exit_fast_recovery = 0; + if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) { + (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); + } } if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { uint32_t send_s; @@ -3883,6 +3898,10 @@ sctp_express_handle_sack(struct sctp_tcb tp1->rec.data.TSN_seq); } sctp_flight_size_decrease(tp1); + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } /* sa_ignore NO_NULL_CHK */ sctp_total_flight_decrease(stcb, tp1); } @@ -4447,6 +4466,9 @@ sctp_handle_sack(struct mbuf *m, int off */ net->new_pseudo_cumack = 0; net->will_exit_fast_recovery = 0; + if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) { + (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); + } } /* process the new consecutive TSN first */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { @@ -4483,6 +4505,10 @@ sctp_handle_sack(struct mbuf *m, int off } sctp_flight_size_decrease(tp1); sctp_total_flight_decrease(stcb, tp1); + if (stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) { + (*stcb->asoc.cc_functions.sctp_cwnd_update_tsn_acknowledged) (tp1->whoTo, + tp1); + } } tp1->whoTo->net_ack += tp1->send_size; Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:17:28 2012 (r231423) @@ -6476,6 +6476,9 @@ all_done: asoc->peers_rwnd = 0; } } + if (asoc->cc_functions.sctp_cwnd_update_packet_transmitted) { + (*asoc->cc_functions.sctp_cwnd_update_packet_transmitted) (stcb, net); + } } static void @@ -7341,6 +7344,10 @@ nothing_to_send: } continue; } + if ((stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) && + (net->flight_size == 0)) { + (*stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) (stcb, net); + } if ((asoc->sctp_cmt_on_off == 0) && (asoc->primary_destination != net) && (net->ref_count < 2)) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:17:28 2012 (r231423) @@ -3953,7 +3953,8 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->asoc.smallest_mtu = net->mtu; } /* JRS - Use the congestion control given in the CC module */ - stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net); + if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) + (*stcb->asoc.cc_functions.sctp_set_initial_cc_param) (stcb, net); /* * CMT: CUC algo - set find_pseudo_cumack to TRUE (1) at beginning Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:17:28 2012 (r231423) @@ -219,7 +219,6 @@ struct htcp { uint32_t lasttime; }; - struct sctp_nets { TAILQ_ENTRY(sctp_nets) sctp_next; /* next link */ @@ -254,10 +253,9 @@ struct sctp_nets { /* last time in seconds I sent to it */ struct timeval last_sent_time; - - /* JRS - struct used in HTCP algorithm */ - struct htcp htcp_ca; - + union cc_control_data { + struct htcp htcp_ca; /* JRS - struct used in HTCP algorithm */ + } cc_mod; int ref_count; /* Congestion stats per destination */ @@ -648,6 +646,15 @@ struct sctp_cc_functions { struct sctp_nets *net, int burst_limit); void (*sctp_cwnd_update_after_fr_timer) (struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net); + void (*sctp_cwnd_update_packet_transmitted) (struct sctp_tcb *stcb, + struct sctp_nets *net); + void (*sctp_cwnd_update_tsn_acknowledged) (struct sctp_nets *net, + struct sctp_tmit_chunk *); + void (*sctp_cwnd_new_transmission_begins) (struct sctp_tcb *stcb, + struct sctp_nets *net); + void (*sctp_cwnd_prepare_net_for_sack) (struct sctp_tcb *stcb, + struct sctp_nets *net); + int (*sctp_cwnd_socket_option) (struct sctp_tcb *stcb, int set, struct sctp_cc_option *); }; /* @@ -1166,6 +1173,7 @@ struct sctp_association { uint8_t sctp_nr_sack_on_off; /* JRS 5/21/07 - CMT PF variable */ uint8_t sctp_cmt_pf; + uint8_t use_precise_time; /* * The mapping array is used to track out of order sequences above * last_acked_seq. 0 indicates packet missing 1 indicates packet Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:17:28 2012 (r231423) @@ -115,6 +115,9 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT; SCTP_BASE_SYSCTL(sctp_buffer_splitting) = SCTPCTL_BUFFER_SPLITTING_DEFAULT; SCTP_BASE_SYSCTL(sctp_initial_cwnd) = SCTPCTL_INITIAL_CWND_DEFAULT; + SCTP_BASE_SYSCTL(sctp_rttvar_bw) = SCTPCTL_RTTVAR_BW_DEFAULT; + SCTP_BASE_SYSCTL(sctp_rttvar_rtt) = SCTPCTL_RTTVAR_RTT_DEFAULT; + SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif @@ -633,6 +636,9 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_bw), SCTPCTL_RTTVAR_BW_MIN, SCTPCTL_RTTVAR_BW_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_rtt), SCTPCTL_RTTVAR_RTT_MIN, SCTPCTL_RTTVAR_RTT_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_eqret), SCTPCTL_RTTVAR_EQRET_MIN, SCTPCTL_RTTVAR_EQRET_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); @@ -1100,6 +1106,18 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", SCTPCTL_INITIAL_CWND_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_bw, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_rttvar_bw), 0, sysctl_sctp_check, "IU", + SCTPCTL_RTTVAR_BW_DESC); + +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_rtt, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_rttvar_rtt), 0, sysctl_sctp_check, "IU", + SCTPCTL_RTTVAR_RTT_DESC); + +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_eqret, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_rttvar_eqret), 0, sysctl_sctp_check, "IU", + SCTPCTL_RTTVAR_EQRET_DESC); + #ifdef SCTP_DEBUG SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:17:28 2012 (r231423) @@ -104,6 +104,11 @@ struct sctp_sysctl { uint32_t sctp_mobility_base; uint32_t sctp_mobility_fasthandoff; uint32_t sctp_inits_include_nat_friendly; +#ifdef SCTP_HAS_RTTCC + uint32_t sctp_rttvar_bw; + uint32_t sctp_rttvar_rtt; + uint32_t sctp_rttvar_eqret; +#endif #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_log sctp_log; #endif @@ -514,6 +519,25 @@ struct sctp_sysctl { #define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 +#ifdef SCTP_HAS_RTTCC + +/* rttvar smooth avg for bw calc */ +#define SCTPCTL_RTTVAR_BW_DESC "Shift amount for bw smothing on rtt calc" +#define SCTPCTL_RTTVAR_BW_MIN 0 +#define SCTPCTL_RTTVAR_BW_MAX 32 +#define SCTPCTL_RTTVAR_BW_DEFAULT 4 + +/* rttvar smooth avg for bw calc */ +#define SCTPCTL_RTTVAR_RTT_DESC "Shift amount for rtt smothing on rtt calc" +#define SCTPCTL_RTTVAR_RTT_MIN 0 +#define SCTPCTL_RTTVAR_RTT_MAX 32 +#define SCTPCTL_RTTVAR_RTT_DEFAULT 5 + +#define SCTPCTL_RTTVAR_EQRET_DESC "When rtt and bw are unchanged return what" +#define SCTPCTL_RTTVAR_EQRET_MIN 0 +#define SCTPCTL_RTTVAR_EQRET_MAX 1 +#define SCTPCTL_RTTVAR_EQRET_DEFAULT 0 +#endif #if defined(SCTP_DEBUG) /* debug: Configure debug output */ Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:17:28 2012 (r231423) @@ -1015,7 +1015,10 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, /* CMT FR loss recovery ended with the T3 */ net->fast_retran_loss_recovery = 0; - + if ((stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) && + (net->flight_size == 0)) { + (*stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) (stcb, net); + } /* * setup the sat loss recovery that prevents satellite cwnd advance. */ Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 20:17:28 2012 (r231423) @@ -533,6 +533,11 @@ struct sctp_assoc_value { uint32_t assoc_value; }; +struct sctp_cc_option { + int option; + struct sctp_assoc_value aid_value; +}; + struct sctp_stream_value { sctp_assoc_t assoc_id; uint16_t stream_id; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:17:28 2012 (r231423) @@ -1758,6 +1758,25 @@ flags_out: *optsize = sizeof(*av); } break; + case SCTP_CC_OPTION: + { + struct sctp_cc_option *cc_opt; + + SCTP_CHECK_AND_CAST(cc_opt, optval, struct sctp_cc_option, *optsize); + SCTP_FIND_STCB(inp, stcb, cc_opt->aid_value.assoc_id); + if (stcb == NULL) { + error = EINVAL; + } else { + if (stcb->asoc.cc_functions.sctp_cwnd_socket_option == NULL) { + error = ENOTSUP; + } else { + error = (*stcb->asoc.cc_functions.sctp_cwnd_socket_option) (stcb, 0, + cc_opt); + *optsize = sizeof(*cc_opt); + } + SCTP_TCB_UNLOCK(stcb); + } + } /* RS - Get socket option for pluggable stream scheduling */ case SCTP_PLUGGABLE_SS: { @@ -2926,6 +2945,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_PLUGGABLE_CC: { struct sctp_assoc_value *av; + struct sctp_nets *net; SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); SCTP_FIND_STCB(inp, stcb, av->assoc_id); @@ -2936,6 +2956,11 @@ sctp_setopt(struct socket *so, int optna case SCTP_CC_HTCP: stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value]; stcb->asoc.congestion_control_module = av->assoc_value; + if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net); + } + } break; default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -2959,6 +2984,24 @@ sctp_setopt(struct socket *so, int optna } } } + case SCTP_CC_OPTION: + { + struct sctp_cc_option *cc_opt; + + SCTP_CHECK_AND_CAST(cc_opt, optval, struct sctp_cc_option, optsize); + SCTP_FIND_STCB(inp, stcb, cc_opt->aid_value.assoc_id); + if (stcb == NULL) { + error = EINVAL; + } else { + if (stcb->asoc.cc_functions.sctp_cwnd_socket_option == NULL) { + error = ENOTSUP; + } else { + error = (*stcb->asoc.cc_functions.sctp_cwnd_socket_option) (stcb, 1, + cc_opt); + } + SCTP_TCB_UNLOCK(stcb); + } + } break; /* RS - Set socket option for pluggable stream scheduling */ case SCTP_PLUGGABLE_SS: Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:09:23 2012 (r231422) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:17:28 2012 (r231423) @@ -2495,7 +2495,11 @@ sctp_calculate_rto(struct sctp_tcb *stcb /* 1. calculate new RTT */ /************************/ /* get the current time */ - (void)SCTP_GETTIME_TIMEVAL(&now); + if (stcb->asoc.use_precise_time) { + (void)SCTP_GETPTIME_TIMEVAL(&now); + } else { + (void)SCTP_GETTIME_TIMEVAL(&now); + } timevalsub(&now, old); /* store the current RTT in us */ net->rtt = (uint64_t) 10000000 *(uint64_t) now.tv_sec + From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:19:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68F271065675; Fri, 10 Feb 2012 20:19:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51AFA8FC15; Fri, 10 Feb 2012 20:19:39 +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 q1AKJd0v092354; Fri, 10 Feb 2012 20:19:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKJdMJ092347; Fri, 10 Feb 2012 20:19:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102019.q1AKJdMJ092347@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:19:39 +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: r231424 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:19:39 -0000 Author: tuexen Date: Fri Feb 10 20:19:38 2012 New Revision: 231424 URL: http://svn.freebsd.org/changeset/base/231424 Log: MFC r219120: Adds a new Congestion Control that helps reduce the RTT that a flow will build up in buffers in transit. It is a slight modification to RFC2581 but is more friendly i.e. less aggressive. From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 20:19:38 2012 (r231424) @@ -258,6 +258,11 @@ struct sctp_paramhdr { #define SCTP_CC_HSTCP 0x00000001 /* HTCP Congestion Control */ #define SCTP_CC_HTCP 0x00000002 +/* RTCC Congestion Control - RFC2581 plus */ +#define SCTP_CC_RTCC 0x00000003 + +#define SCTP_CC_OPT_RTCC_SETMODE 0x00002000 +#define SCTP_CC_OPT_USE_DCCC_ECN 0x00002001 /* RS - Supported stream scheduling modules for pluggable * stream scheduling Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:19:38 2012 (r231424) @@ -185,10 +185,203 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } + +/* RTCC Algoritm to limit growth of cwnd, return + * true if you want to NOT allow cwnd growth + */ +static int +cc_bw_limit(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw) +{ + uint64_t bw_offset, rtt_offset, rtt, vtag, probepoint; + + /*- + * Here we need to see if we want + * to limit cwnd growth due to increase + * in overall rtt but no increase in bw. + * We use the following table to figure + * out what we should do. When we return + * 0, cc update goes on as planned. If we + * return 1, then no cc update happens and cwnd + * stays where it is at. + * ---------------------------------- + * BW | RTT | Action + * ********************************* + * INC | INC | return 0 + * ---------------------------------- + * INC | SAME | return 0 + * ---------------------------------- + * INC | DECR | return 0 + * ---------------------------------- + * SAME | INC | return 1 + * ---------------------------------- + * SAME | SAME | return 1 + * ---------------------------------- + * SAME | DECR | return 0 + * ---------------------------------- + * DECR | INC | return 0 or 1 based on if we caused. + * ---------------------------------- + * DECR | SAME | return 0 + * ---------------------------------- + * DECR | DECR | return 0 + * ---------------------------------- + * + * We are a bit fuzz on what an increase or + * decrease is. For BW it is the same if + * it did not change within 1/64th. For + * RTT it stayed the same if it did not + * change within 1/32nd + */ + rtt = stcb->asoc.my_vtag; + vtag = (rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); + probepoint = (((uint64_t) net->cwnd) << 32); + rtt = net->rtt; + bw_offset = net->cc_mod.rtcc.lbw >> SCTP_BASE_SYSCTL(sctp_rttvar_bw); + if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { + /* + * BW increased, so update and return 0, since all actions + * in our table say to do the normal CC update + */ + /* PROBE POINT 0 */ + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } + rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); + if (nbw < net->cc_mod.rtcc.lbw - bw_offset) { + /* Bandwidth decreased. */ + if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* rtt increased */ + /* Did we add more */ + if (net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) { + /* We caused it maybe.. back off */ + /* PROBE POINT 1 */ + probepoint |= ((1 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cwnd = net->cc_mod.rtcc.cwnd_at_bw_set; + if (net->cc_mod.rtcc.ret_from_eq) { + /* + * Switch over to CA if we are less + * aggressive + */ + net->ssthresh = net->cwnd - 1; + net->partial_bytes_acked = 0; + } + return (1); + } + /* Probe point 2 */ + probepoint |= ((2 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + + /* Someone else - fight for more? */ + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } else if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* rtt decreased */ + /* Probe point 3 */ + probepoint |= ((3 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } + /* The bw decreased but rtt stayed the same */ + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + /* Probe point 4 */ + probepoint |= ((4 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + return (0); + } + /* + * If we reach here then we are in a situation where the bw stayed + * the same. + */ + if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* + * rtt increased we don't update bw.. so we don't update the + * rtt either. + */ + /* Probe point 5 */ + probepoint |= ((5 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + return (1); + } + if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* + * rtt decreased, there could be more room. we update both + * the bw and the rtt here. + */ + /* Probe point 6 */ + probepoint |= ((6 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } + /* + * Ok bw and rtt remained the same .. no update to any but save the + * latest cwnd. + */ + /* Probe point 7 */ + probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + return ((int)net->cc_mod.rtcc.ret_from_eq); +} + static void -sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, +sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit) + int accum_moved, int reneged_all, int will_exit, int use_rtcc) { struct sctp_nets *net; int old_cwnd; @@ -327,6 +520,48 @@ sctp_cwnd_update_after_sack(struct sctp_ goto skip_cwnd_update; } /* + * Did any measurements go on for this network? + */ + if (use_rtcc && (net->cc_mod.rtcc.tls_needs_set > 0)) { + uint64_t nbw; + + /* + * At this point our bw_bytes has been updated by + * incoming sack information. + * + * But our bw may not yet be set. + * + */ + if ((net->cc_mod.rtcc.new_tot_time / 1000) > 0) { + nbw = net->cc_mod.rtcc.bw_bytes / (net->cc_mod.rtcc.new_tot_time / 1000); + } else { + nbw = net->cc_mod.rtcc.bw_bytes; + } + if (net->cc_mod.rtcc.lbw) { + if (cc_bw_limit(stcb, net, nbw)) { + /* Hold here, no update */ + goto skip_cwnd_update; + } + } else { + uint64_t vtag, probepoint; + + probepoint = (((uint64_t) net->cwnd) << 32); + probepoint |= ((0xa << 16) | 0); + vtag = (net->rtt << 32) | + (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | + (stcb->rport); + + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + nbw, + 0, + net->rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + } + } + /* * CMT: CUC algorithm. Update cwnd if pseudo-cumack has * moved. */ @@ -481,31 +716,67 @@ sctp_cwnd_update_after_timeout(struct sc } } - static void -sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, - int in_window, int num_pkt_lost) +sctp_cwnd_update_after_ecn_echo_common(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost, int use_rtcc) { int old_cwnd = net->cwnd; - if (in_window == 0) { - SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = net->cwnd / 2; - if (net->ssthresh < net->mtu) { - net->ssthresh = net->mtu; - /* here back off the timer as well, to slow us down */ - net->RTO <<= 1; + if ((use_rtcc) && (net->lan_type == SCTP_LAN_LOCAL) && (net->cc_mod.rtcc.use_dccc_ecn)) { + /* Data center Congestion Control */ + if (in_window == 0) { + /* + * Go to CA with the cwnd at the point we sent the + * TSN that was marked with a CE. + */ + if (net->ecn_prev_cwnd < net->cwnd) { + /* Restore to prev cwnd */ + net->cwnd = net->ecn_prev_cwnd - (net->mtu * num_pkt_lost); + } else { + /* Just cut in 1/2 */ + net->cwnd /= 2; + } + /* Drop to CA */ + net->ssthresh = net->cwnd - (num_pkt_lost * net->mtu); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } + } else { + /* + * Further tuning down required over the drastic + * orginal cut + */ + net->ssthresh -= (net->mtu * num_pkt_lost); + net->cwnd -= (net->mtu * num_pkt_lost); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } - net->cwnd = net->ssthresh; - SDT_PROBE(sctp, cwnd, net, ecn, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + } else { + if (in_window == 0) { + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + net->ssthresh = net->cwnd / 2; + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + /* + * here back off the timer as well, to slow + * us down + */ + net->RTO <<= 1; + } + net->cwnd = net->ssthresh; + SDT_PROBE(sctp, cwnd, net, ecn, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } } + } static void @@ -636,14 +907,16 @@ sctp_cwnd_update_after_output(struct sct if (net->ssthresh < net->cwnd) net->ssthresh = net->cwnd; - net->cwnd = (net->flight_size + (burst_limit * net->mtu)); - SDT_PROBE(sctp, cwnd, net, bl, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_BRST); + if (burst_limit) { + net->cwnd = (net->flight_size + (burst_limit * net->mtu)); + SDT_PROBE(sctp, cwnd, net, bl, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_BRST); + } } } @@ -673,6 +946,212 @@ sctp_cwnd_update_after_fr_timer(struct s } } +static void +sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, + struct sctp_association *asoc, + int accum_moved, int reneged_all, int will_exit) +{ + /* Passing a zero argument in last disables the rtcc algoritm */ + sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 0); +} + +static void +sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost) +{ + /* Passing a zero argument in last disables the rtcc algoritm */ + sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 0); +} + +/* Here starts the RTCCVAR type CC invented by RRS which + * is a slight mod to RFC2581. We reuse a common routine or + * two since these algoritms are so close and need to + * remain the same. + */ +static void +sctp_cwnd_update_rtcc_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost) +{ + sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 1); +} + + +static +void +sctp_cwnd_update_rtcc_tsn_acknowledged(struct sctp_nets *net, + struct sctp_tmit_chunk *tp1) +{ + net->cc_mod.rtcc.bw_bytes += tp1->send_size; +} + +static void +sctp_cwnd_prepare_rtcc_net_for_sack(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + if (net->cc_mod.rtcc.tls_needs_set > 0) { + /* We had a bw measurment going on */ + struct timeval ltls; + + SCTP_GETPTIME_TIMEVAL(<ls); + timevalsub(<ls, &net->cc_mod.rtcc.tls); + net->cc_mod.rtcc.new_tot_time = (ltls.tv_sec * 1000000) + ltls.tv_usec; + } +} + +static void +sctp_cwnd_new_rtcc_transmission_begins(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + uint64_t vtag, probepoint; + + if (net->cc_mod.rtcc.lbw) { + /* Clear the old bw.. we went to 0 in-flight */ + vtag = (net->rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | + (stcb->rport); + probepoint = (((uint64_t) net->cwnd) << 32); + /* Probe point 8 */ + probepoint |= ((8 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | 0), + net->cc_mod.rtcc.lbw_rtt, + 0, + probepoint); + net->cc_mod.rtcc.lbw_rtt = 0; + net->cc_mod.rtcc.cwnd_at_bw_set = 0; + net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.bw_tot_time = 0; + net->cc_mod.rtcc.bw_bytes = 0; + net->cc_mod.rtcc.tls_needs_set = 0; + if (net->cc_mod.rtcc.ret_from_eq) { + /* less aggressive one - reset cwnd too */ + uint32_t cwnd_in_mtu, cwnd; + + cwnd_in_mtu = SCTP_BASE_SYSCTL(sctp_initial_cwnd); + if (cwnd_in_mtu == 0) { + /* + * Using 0 means that the value of RFC 4960 + * is used. + */ + cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); + } else { + /* + * We take the minimum of the burst limit + * and the initial congestion window. + */ + if ((stcb->asoc.max_burst > 0) && (cwnd_in_mtu > stcb->asoc.max_burst)) + cwnd_in_mtu = stcb->asoc.max_burst; + cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + } + if (net->cwnd > cwnd) { + /* + * Only set if we are not a timeout (i.e. + * down to 1 mtu) + */ + net->cwnd = cwnd; + } + } + } +} + +static void +sctp_set_rtcc_initial_cc_param(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + uint64_t vtag, probepoint; + + sctp_set_initial_cc_param(stcb, net); + stcb->asoc.use_precise_time = 1; + probepoint = (((uint64_t) net->cwnd) << 32); + probepoint |= ((9 << 16) | 0); + vtag = (net->rtt << 32) | + (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | + (stcb->rport); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + 0, + 0, + 0, + probepoint); + net->cc_mod.rtcc.lbw_rtt = 0; + net->cc_mod.rtcc.cwnd_at_bw_set = 0; + net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.bw_tot_time = 0; + net->cc_mod.rtcc.bw_bytes = 0; + net->cc_mod.rtcc.tls_needs_set = 0; + net->cc_mod.rtcc.ret_from_eq = SCTP_BASE_SYSCTL(sctp_rttvar_eqret); +} + +static int +sctp_cwnd_rtcc_socket_option(struct sctp_tcb *stcb, int setorget, + struct sctp_cc_option *cc_opt) +{ + struct sctp_nets *net; + + if (setorget == 1) { + /* a set */ + if (cc_opt->option == SCTP_CC_OPT_RTCC_SETMODE) { + if ((cc_opt->aid_value.assoc_value != 0) && + (cc_opt->aid_value.assoc_value != 1)) { + return (EINVAL); + } + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->cc_mod.rtcc.ret_from_eq = cc_opt->aid_value.assoc_value; + } + } else if (cc_opt->option == SCTP_CC_OPT_USE_DCCC_ECN) { + if ((cc_opt->aid_value.assoc_value != 0) && + (cc_opt->aid_value.assoc_value != 1)) { + return (EINVAL); + } + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->cc_mod.rtcc.use_dccc_ecn = cc_opt->aid_value.assoc_value; + } + } else { + return (EINVAL); + } + } else { + /* a get */ + if (cc_opt->option == SCTP_CC_OPT_RTCC_SETMODE) { + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + return (EFAULT); + } + cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.ret_from_eq; + } else if (cc_opt->option == SCTP_CC_OPT_USE_DCCC_ECN) { + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + return (EFAULT); + } + cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.use_dccc_ecn; + } else { + return (EINVAL); + } + } + return (0); +} + +static void +sctp_cwnd_update_rtcc_packet_transmitted(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + if (net->cc_mod.rtcc.tls_needs_set == 0) { + SCTP_GETPTIME_TIMEVAL(&net->cc_mod.rtcc.tls); + net->cc_mod.rtcc.tls_needs_set = 2; + } +} + +static void +sctp_cwnd_update_rtcc_after_sack(struct sctp_tcb *stcb, + struct sctp_association *asoc, + int accum_moved, int reneged_all, int will_exit) +{ + /* Passing a one argument at the last enables the rtcc algoritm */ + sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 1); +} + + +/* Here starts Sally Floyds HS-TCP */ + struct sctp_hs_raise_drop { int32_t cwnd; int32_t increase; @@ -1710,5 +2189,20 @@ struct sctp_cc_functions sctp_cc_functio .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, .sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer + }, + { + .sctp_set_initial_cc_param = sctp_set_rtcc_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_cwnd_update_rtcc_after_sack, + .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_rtcc_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer, + .sctp_cwnd_update_packet_transmitted = sctp_cwnd_update_rtcc_packet_transmitted, + .sctp_cwnd_update_tsn_acknowledged = sctp_cwnd_update_rtcc_tsn_acknowledged, + .sctp_cwnd_new_transmission_begins = sctp_cwnd_new_rtcc_transmission_begins, + .sctp_cwnd_prepare_net_for_sack = sctp_cwnd_prepare_rtcc_net_for_sack, + .sctp_cwnd_socket_option = sctp_cwnd_rtcc_socket_option } }; Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 20:19:38 2012 (r231424) @@ -965,10 +965,9 @@ __FBSDID("$FreeBSD$"); * local lan type rtt's */ /* - * We allow 500us for the rtt and another 500us for the cookie processing - * since we measure this on the first rtt. + * We allow 900us for the rtt. */ -#define SCTP_LOCAL_LAN_RTT 1100 +#define SCTP_LOCAL_LAN_RTT 900 #define SCTP_LAN_UNKNOWN 0 #define SCTP_LAN_LOCAL 1 #define SCTP_LAN_INTERNET 2 Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:19:38 2012 (r231424) @@ -219,6 +219,21 @@ struct htcp { uint32_t lasttime; }; +struct rtcc_cc { + struct timeval tls; /* The time we started the sending */ + uint64_t lbw; /* Our last estimated bw */ + uint64_t lbw_rtt; /* RTT at bw estimate */ + uint64_t bw_bytes; /* The total bytes since this sending began */ + uint64_t bw_tot_time; /* The total time since sending began */ + uint64_t new_tot_time; /* temp holding the new value */ + uint32_t cwnd_at_bw_set; + uint8_t ret_from_eq; + uint8_t use_dccc_ecn; + uint8_t tls_needs_set; /* Flag to indicate we need to set tls 0 or 1 + * means set at send 2 not */ +}; + + struct sctp_nets { TAILQ_ENTRY(sctp_nets) sctp_next; /* next link */ @@ -255,6 +270,7 @@ struct sctp_nets { struct timeval last_sent_time; union cc_control_data { struct htcp htcp_ca; /* JRS - struct used in HTCP algorithm */ + struct rtcc_cc rtcc; /* rtcc module cc stuff */ } cc_mod; int ref_count; Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:19:38 2012 (r231424) @@ -104,11 +104,9 @@ struct sctp_sysctl { uint32_t sctp_mobility_base; uint32_t sctp_mobility_fasthandoff; uint32_t sctp_inits_include_nat_friendly; -#ifdef SCTP_HAS_RTTCC uint32_t sctp_rttvar_bw; uint32_t sctp_rttvar_rtt; uint32_t sctp_rttvar_eqret; -#endif #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_log sctp_log; #endif @@ -519,7 +517,6 @@ struct sctp_sysctl { #define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 -#ifdef SCTP_HAS_RTTCC /* rttvar smooth avg for bw calc */ #define SCTPCTL_RTTVAR_BW_DESC "Shift amount for bw smothing on rtt calc" @@ -537,7 +534,6 @@ struct sctp_sysctl { #define SCTPCTL_RTTVAR_EQRET_MIN 0 #define SCTPCTL_RTTVAR_EQRET_MAX 1 #define SCTPCTL_RTTVAR_EQRET_DEFAULT 0 -#endif #if defined(SCTP_DEBUG) /* debug: Configure debug output */ Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:17:28 2012 (r231423) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:19:38 2012 (r231424) @@ -1777,6 +1777,7 @@ flags_out: SCTP_TCB_UNLOCK(stcb); } } + break; /* RS - Get socket option for pluggable stream scheduling */ case SCTP_PLUGGABLE_SS: { @@ -2954,6 +2955,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_CC_RFC2581: case SCTP_CC_HSTCP: case SCTP_CC_HTCP: + case SCTP_CC_RTCC: stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value]; stcb->asoc.congestion_control_module = av->assoc_value; if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) { @@ -2973,6 +2975,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_CC_RFC2581: case SCTP_CC_HSTCP: case SCTP_CC_HTCP: + case SCTP_CC_RTCC: SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_cc_module = av->assoc_value; SCTP_INP_WUNLOCK(inp); @@ -2984,6 +2987,7 @@ sctp_setopt(struct socket *so, int optna } } } + break; case SCTP_CC_OPTION: { struct sctp_cc_option *cc_opt; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:22:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D2631065673; Fri, 10 Feb 2012 20:22:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 164F68FC14; Fri, 10 Feb 2012 20:22:46 +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 q1AKMkFB092521; Fri, 10 Feb 2012 20:22:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKMjcs092508; Fri, 10 Feb 2012 20:22:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102022.q1AKMjcs092508@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:22:45 +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: r231425 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:22:46 -0000 Author: tuexen Date: Fri Feb 10 20:22:45 2012 New Revision: 231425 URL: http://svn.freebsd.org/changeset/base/231425 Log: MFC r219397: Tunes and fixes the new DC-CC to seem to hit the right mix. Still may need some tweaks but it appears to almost not give away too much to an RFC2581 flow, but can really minimize the amount of buffers used in the net. From rrs@. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 20:22:45 2012 (r231425) @@ -263,6 +263,7 @@ struct sctp_paramhdr { #define SCTP_CC_OPT_RTCC_SETMODE 0x00002000 #define SCTP_CC_OPT_USE_DCCC_ECN 0x00002001 +#define SCTP_CC_OPT_STEADY_STEP 0x00002002 /* RS - Supported stream scheduling modules for pluggable * stream scheduling Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:22:45 2012 (r231425) @@ -185,6 +185,328 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } +/* Defines for instantaneous bw decisions */ +#define SCTP_INST_LOOSING 1 /* Loosing to other flows */ +#define SCTP_INST_NEUTRAL 2 /* Neutral, no indication */ +#define SCTP_INST_GAINING 3 /* Gaining, step down possible */ + + +static int +cc_bw_same(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, + uint64_t rtt_offset, uint64_t vtag, uint8_t inst_ind) +{ + uint64_t oth, probepoint; + + probepoint = (((uint64_t) net->cwnd) << 32); + if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* + * rtt increased we don't update bw.. so we don't update the + * rtt either. + */ + /* Probe point 5 */ + probepoint |= ((5 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if ((net->cc_mod.rtcc.steady_step) && (inst_ind != SCTP_INST_LOOSING)) { + if (net->cc_mod.rtcc.last_step_state == 5) + net->cc_mod.rtcc.step_cnt++; + else + net->cc_mod.rtcc.step_cnt = 1; + net->cc_mod.rtcc.last_step_state = 5; + if ((net->cc_mod.rtcc.step_cnt == net->cc_mod.rtcc.steady_step) || + ((net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step) && + ((net->cc_mod.rtcc.step_cnt % net->cc_mod.rtcc.steady_step) == 0))) { + /* Try a step down */ + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if (net->cwnd > (4 * net->mtu)) { + net->cwnd -= net->mtu; + net->cc_mod.rtcc.vol_reduce++; + } else { + net->cc_mod.rtcc.step_cnt = 0; + } + } + } + return (1); + } + if (net->rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* + * rtt decreased, there could be more room. we update both + * the bw and the rtt here to lock this in as a good step + * down. + */ + /* Probe point 6 */ + probepoint |= ((6 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if ((net->cc_mod.rtcc.last_step_state == 5) && + (net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step)) { + /* Step down worked */ + net->cc_mod.rtcc.step_cnt = 0; + return (1); + } else { + net->cc_mod.rtcc.last_step_state = 6; + net->cc_mod.rtcc.step_cnt = 0; + } + } + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + if (inst_ind == SCTP_INST_GAINING) + return (1); + else if (inst_ind == SCTP_INST_NEUTRAL) + return (1); + else + return (0); + } + /* + * Ok bw and rtt remained the same .. no update to any + */ + /* Probe point 7 */ + probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + + if ((net->cc_mod.rtcc.steady_step) && (inst_ind != SCTP_INST_LOOSING)) { + if (net->cc_mod.rtcc.last_step_state == 5) + net->cc_mod.rtcc.step_cnt++; + else + net->cc_mod.rtcc.step_cnt = 1; + net->cc_mod.rtcc.last_step_state = 5; + if ((net->cc_mod.rtcc.step_cnt == net->cc_mod.rtcc.steady_step) || + ((net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step) && + ((net->cc_mod.rtcc.step_cnt % net->cc_mod.rtcc.steady_step) == 0))) { + /* Try a step down */ + if (net->cwnd > (4 * net->mtu)) { + net->cwnd -= net->mtu; + net->cc_mod.rtcc.vol_reduce++; + return (1); + } else { + net->cc_mod.rtcc.step_cnt = 0; + } + } + } + if (inst_ind == SCTP_INST_GAINING) + return (1); + else if (inst_ind == SCTP_INST_NEUTRAL) + return (1); + else + return ((int)net->cc_mod.rtcc.ret_from_eq); +} + +static int +cc_bw_decrease(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t rtt_offset, + uint64_t vtag, uint8_t inst_ind) +{ + uint64_t oth, probepoint; + + /* Bandwidth decreased. */ + probepoint = (((uint64_t) net->cwnd) << 32); + if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* rtt increased */ + /* Did we add more */ + if ((net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) && + (inst_ind != SCTP_INST_LOOSING)) { + /* We caused it maybe.. back off? */ + /* PROBE POINT 1 */ + probepoint |= ((1 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + + if (net->cc_mod.rtcc.ret_from_eq) { + /* + * Switch over to CA if we are less + * aggressive + */ + net->ssthresh = net->cwnd - 1; + net->partial_bytes_acked = 0; + } + return (1); + } + /* Probe point 2 */ + probepoint |= ((2 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + + /* Someone else - fight for more? */ + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + /* + * Did we voluntarily give up some? if so take one + * back please + */ + if ((net->cc_mod.rtcc.vol_reduce) && + (inst_ind != SCTP_INST_GAINING)) { + net->cwnd += net->mtu; + net->cc_mod.rtcc.vol_reduce--; + } + net->cc_mod.rtcc.last_step_state = 2; + net->cc_mod.rtcc.step_cnt = 0; + } + goto out_decision; + } else if (net->rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* bw & rtt decreased */ + /* Probe point 3 */ + probepoint |= ((3 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if ((net->cc_mod.rtcc.vol_reduce) && + (inst_ind != SCTP_INST_GAINING)) { + net->cwnd += net->mtu; + net->cc_mod.rtcc.vol_reduce--; + } + net->cc_mod.rtcc.last_step_state = 3; + net->cc_mod.rtcc.step_cnt = 0; + } + goto out_decision; + } + /* The bw decreased but rtt stayed the same */ + /* Probe point 4 */ + probepoint |= ((4 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + if ((net->cc_mod.rtcc.vol_reduce) && + (inst_ind != SCTP_INST_GAINING)) { + net->cwnd += net->mtu; + net->cc_mod.rtcc.vol_reduce--; + } + net->cc_mod.rtcc.last_step_state = 4; + net->cc_mod.rtcc.step_cnt = 0; + } +out_decision: + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + if (inst_ind == SCTP_INST_GAINING) { + return (1); + } else { + return (0); + } +} + +static int +cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, + uint64_t vtag, uint8_t inst_ind) +{ + uint64_t oth, probepoint; + + /* + * BW increased, so update and return 0, since all actions in our + * table say to do the normal CC update. Note that we pay no + * attention to the inst_ind since our overall sum is increasing. + */ + /* PROBE POINT 0 */ + probepoint = (((uint64_t) net->cwnd) << 32); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, + probepoint); + if (net->cc_mod.rtcc.steady_step) { + oth = net->cc_mod.rtcc.vol_reduce; + oth <<= 16; + oth |= net->cc_mod.rtcc.step_cnt; + oth <<= 16; + oth |= net->cc_mod.rtcc.last_step_state; + SDT_PROBE(sctp, cwnd, net, rttstep, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + oth, + probepoint); + net->cc_mod.rtcc.last_step_state = 0; + net->cc_mod.rtcc.step_cnt = 0; + net->cc_mod.rtcc.vol_reduce = 0; + } + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); +} /* RTCC Algoritm to limit growth of cwnd, return * true if you want to NOT allow cwnd growth @@ -193,6 +515,11 @@ static int cc_bw_limit(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw) { uint64_t bw_offset, rtt_offset, rtt, vtag, probepoint; + uint64_t bytes_for_this_rtt, inst_bw; + uint64_t div, inst_off; + int bw_shift; + uint8_t inst_ind; + int ret; /*- * Here we need to see if we want @@ -231,151 +558,67 @@ cc_bw_limit(struct sctp_tcb *stcb, struc * RTT it stayed the same if it did not * change within 1/32nd */ + bw_shift = SCTP_BASE_SYSCTL(sctp_rttvar_bw); rtt = stcb->asoc.my_vtag; vtag = (rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); probepoint = (((uint64_t) net->cwnd) << 32); rtt = net->rtt; - bw_offset = net->cc_mod.rtcc.lbw >> SCTP_BASE_SYSCTL(sctp_rttvar_bw); - if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { - /* - * BW increased, so update and return 0, since all actions - * in our table say to do the normal CC update - */ - /* PROBE POINT 0 */ + if (net->cc_mod.rtcc.rtt_set_this_sack) { + net->cc_mod.rtcc.rtt_set_this_sack = 0; + bytes_for_this_rtt = net->cc_mod.rtcc.bw_bytes - net->cc_mod.rtcc.bw_bytes_at_last_rttc; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = net->cc_mod.rtcc.bw_bytes; + if (net->rtt) { + div = net->rtt / 1000; + if (div) { + inst_bw = bytes_for_this_rtt / div; + inst_off = inst_bw >> bw_shift; + if (inst_bw > nbw) + inst_ind = SCTP_INST_GAINING; + else if ((inst_bw + inst_off) < nbw) + inst_ind = SCTP_INST_LOOSING; + else + inst_ind = SCTP_INST_NEUTRAL; + probepoint |= ((0xb << 16) | inst_ind); + } else { + inst_bw = bytes_for_this_rtt / (uint64_t) (net->rtt); + /* Can't determine do not change */ + inst_ind = net->cc_mod.rtcc.last_inst_ind; + probepoint |= ((0xc << 16) | inst_ind); + } + } else { + inst_bw = bytes_for_this_rtt; + /* Can't determine do not change */ + inst_ind = net->cc_mod.rtcc.last_inst_ind; + probepoint |= ((0xd << 16) | inst_ind); + } SDT_PROBE(sctp, cwnd, net, rttvar, vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, + ((nbw << 32) | inst_bw), + ((net->cc_mod.rtcc.lbw_rtt << 32) | rtt), + net->flight_size, probepoint); - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); + } else { + /* No rtt measurement, use last one */ + inst_ind = net->cc_mod.rtcc.last_inst_ind; + } + bw_offset = net->cc_mod.rtcc.lbw >> bw_shift; + if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { + ret = cc_bw_increase(stcb, net, nbw, vtag, inst_ind); + goto out; } rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); if (nbw < net->cc_mod.rtcc.lbw - bw_offset) { - /* Bandwidth decreased. */ - if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { - /* rtt increased */ - /* Did we add more */ - if (net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) { - /* We caused it maybe.. back off */ - /* PROBE POINT 1 */ - probepoint |= ((1 << 16) | 1); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cwnd = net->cc_mod.rtcc.cwnd_at_bw_set; - if (net->cc_mod.rtcc.ret_from_eq) { - /* - * Switch over to CA if we are less - * aggressive - */ - net->ssthresh = net->cwnd - 1; - net->partial_bytes_acked = 0; - } - return (1); - } - /* Probe point 2 */ - probepoint |= ((2 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - - /* Someone else - fight for more? */ - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); - } else if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { - /* rtt decreased */ - /* Probe point 3 */ - probepoint |= ((3 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); - } - /* The bw decreased but rtt stayed the same */ - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - /* Probe point 4 */ - probepoint |= ((4 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - return (0); + ret = cc_bw_decrease(stcb, net, nbw, rtt_offset, vtag, inst_ind); + goto out; } /* * If we reach here then we are in a situation where the bw stayed * the same. */ - if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { - /* - * rtt increased we don't update bw.. so we don't update the - * rtt either. - */ - /* Probe point 5 */ - probepoint |= ((5 << 16) | 1); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - return (1); - } - if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { - /* - * rtt decreased, there could be more room. we update both - * the bw and the rtt here. - */ - /* Probe point 6 */ - probepoint |= ((6 << 16) | 0); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - net->cc_mod.rtcc.lbw = nbw; - net->cc_mod.rtcc.lbw_rtt = rtt; - net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; - return (0); - } - /* - * Ok bw and rtt remained the same .. no update to any but save the - * latest cwnd. - */ - /* Probe point 7 */ - probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); - SDT_PROBE(sctp, cwnd, net, rttvar, - vtag, - ((net->cc_mod.rtcc.lbw << 32) | nbw), - net->cc_mod.rtcc.lbw_rtt, - rtt, - probepoint); - return ((int)net->cc_mod.rtcc.ret_from_eq); + ret = cc_bw_same(stcb, net, nbw, rtt_offset, vtag, inst_ind); +out: + net->cc_mod.rtcc.last_inst_ind = inst_ind; + return (ret); } static void @@ -554,11 +797,15 @@ sctp_cwnd_update_after_sack_common(struc SDT_PROBE(sctp, cwnd, net, rttvar, vtag, nbw, - 0, - net->rtt, + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, probepoint); net->cc_mod.rtcc.lbw = nbw; net->cc_mod.rtcc.lbw_rtt = net->rtt; + if (net->cc_mod.rtcc.rtt_set_this_sack) { + net->cc_mod.rtcc.rtt_set_this_sack = 0; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = net->cc_mod.rtcc.bw_bytes; + } } } /* @@ -1014,15 +1261,22 @@ sctp_cwnd_new_rtcc_transmission_begins(s SDT_PROBE(sctp, cwnd, net, rttvar, vtag, ((net->cc_mod.rtcc.lbw << 32) | 0), - net->cc_mod.rtcc.lbw_rtt, - 0, + ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), + net->flight_size, probepoint); net->cc_mod.rtcc.lbw_rtt = 0; net->cc_mod.rtcc.cwnd_at_bw_set = 0; net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = 0; + net->cc_mod.rtcc.vol_reduce = 0; net->cc_mod.rtcc.bw_tot_time = 0; net->cc_mod.rtcc.bw_bytes = 0; net->cc_mod.rtcc.tls_needs_set = 0; + if (net->cc_mod.rtcc.steady_step) { + net->cc_mod.rtcc.vol_reduce = 0; + net->cc_mod.rtcc.step_cnt = 0; + net->cc_mod.rtcc.last_step_state = 0; + } if (net->cc_mod.rtcc.ret_from_eq) { /* less aggressive one - reset cwnd too */ uint32_t cwnd_in_mtu, cwnd; @@ -1075,11 +1329,20 @@ sctp_set_rtcc_initial_cc_param(struct sc probepoint); net->cc_mod.rtcc.lbw_rtt = 0; net->cc_mod.rtcc.cwnd_at_bw_set = 0; + net->cc_mod.rtcc.vol_reduce = 0; net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.vol_reduce = 0; + net->cc_mod.rtcc.bw_bytes_at_last_rttc = 0; net->cc_mod.rtcc.bw_tot_time = 0; net->cc_mod.rtcc.bw_bytes = 0; net->cc_mod.rtcc.tls_needs_set = 0; net->cc_mod.rtcc.ret_from_eq = SCTP_BASE_SYSCTL(sctp_rttvar_eqret); + net->cc_mod.rtcc.steady_step = SCTP_BASE_SYSCTL(sctp_steady_step); + net->cc_mod.rtcc.use_dccc_ecn = SCTP_BASE_SYSCTL(sctp_use_dccc_ecn); + net->cc_mod.rtcc.step_cnt = 0; + net->cc_mod.rtcc.last_step_state = 0; + + } static int @@ -1106,6 +1369,10 @@ sctp_cwnd_rtcc_socket_option(struct sctp TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { net->cc_mod.rtcc.use_dccc_ecn = cc_opt->aid_value.assoc_value; } + } else if (cc_opt->option == SCTP_CC_OPT_STEADY_STEP) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->cc_mod.rtcc.steady_step = cc_opt->aid_value.assoc_value; + } } else { return (EINVAL); } @@ -1123,6 +1390,12 @@ sctp_cwnd_rtcc_socket_option(struct sctp return (EFAULT); } cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.use_dccc_ecn; + } else if (cc_opt->option == SCTP_CC_OPT_STEADY_STEP) { + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + return (EFAULT); + } + cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.steady_step; } else { return (EINVAL); } @@ -1149,6 +1422,12 @@ sctp_cwnd_update_rtcc_after_sack(struct sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 1); } +static void +sctp_rtt_rtcc_calculated(struct sctp_tcb *stcb, + struct sctp_nets *net, struct timeval *now) +{ + net->cc_mod.rtcc.rtt_set_this_sack = 1; +} /* Here starts Sally Floyds HS-TCP */ @@ -2203,6 +2482,7 @@ struct sctp_cc_functions sctp_cc_functio .sctp_cwnd_update_tsn_acknowledged = sctp_cwnd_update_rtcc_tsn_acknowledged, .sctp_cwnd_new_transmission_begins = sctp_cwnd_new_rtcc_transmission_begins, .sctp_cwnd_prepare_net_for_sack = sctp_cwnd_prepare_rtcc_net_for_sack, - .sctp_cwnd_socket_option = sctp_cwnd_rtcc_socket_option + .sctp_cwnd_socket_option = sctp_cwnd_rtcc_socket_option, + .sctp_rtt_calculated = sctp_rtt_rtcc_calculated } }; Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 20:22:45 2012 (r231425) @@ -355,8 +355,8 @@ __FBSDID("$FreeBSD$"); /* RTO calculation flag to say if it * is safe to determine local lan or not. */ -#define SCTP_DETERMINE_LL_NOTOK 0 -#define SCTP_DETERMINE_LL_OK 1 +#define SCTP_RTT_FROM_NON_DATA 0 +#define SCTP_RTT_FROM_DATA 1 /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ Modified: stable/8/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Fri Feb 10 20:22:45 2012 (r231425) @@ -57,6 +57,7 @@ SDT_PROBE_DECLARE(sctp, cwnd, net, ecn); SDT_PROBE_DECLARE(sctp, cwnd, net, pd); /* Rttvar probe declaration */ SDT_PROBE_DECLARE(sctp, cwnd, net, rttvar); +SDT_PROBE_DECLARE(sctp, cwnd, net, rttstep); /* One to track an associations rwnd */ SDT_PROBE_DECLARE(sctp, rwnd, assoc, val); Modified: stable/8/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_dtrace_define.h Fri Feb 10 20:22:45 2012 (r231425) @@ -78,14 +78,27 @@ SDT_PROBE_DEFINE(sctp, cwnd, net, rttvar SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 0, "uint64_t"); /* obw | nbw */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 1, "uint64_t"); -/* newrtt */ +/* bwrtt | newrtt */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 2, "uint64_t"); -/* bwrtt */ +/* flight */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 3, "uint64_t"); /* (cwnd << 32) | point << 16 | retval(0/1) */ SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttvar, 4, "uint64_t"); +SDT_PROBE_DEFINE(sctp, cwnd, net, rttstep, rttstep); +/* The Vtag << 32 | localport << 16 | remoteport */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 0, "uint64_t"); +/* obw | nbw */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 1, "uint64_t"); +/* bwrtt | nrtt */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 2, "uint64_t"); +/* cwnd_saved | stepcnt << 16 | oldstep */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 3, "uint64_t"); +/* (cwnd << 32) | point << 16 | retval(0/1) */ +SDT_PROBE_ARGTYPE(sctp, cwnd, net, rttstep, 4, "uint64_t"); + + /* FastRetransmit-DECREASE */ SDT_PROBE_DEFINE(sctp, cwnd, net, fr, fr); /* The Vtag for this end */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:22:45 2012 (r231425) @@ -2817,7 +2817,7 @@ sctp_process_segment_range(struct sctp_t int *num_frs, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int *ecn_seg_sums) + int *ecn_seg_sums, int *rto_ok) { struct sctp_tmit_chunk *tp1; unsigned int theTSN; @@ -2956,13 +2956,19 @@ sctp_process_segment_range(struct sctp_t * update RTO too ? */ if (tp1->do_rtt) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - &stcb->asoc, - tp1->whoTo, - &tp1->sent_rcv_time, - sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + if (*rto_ok) { + tp1->whoTo->RTO = + sctp_calculate_rto(stcb, + &stcb->asoc, + tp1->whoTo, + &tp1->sent_rcv_time, + sctp_align_safe_nocopy, + SCTP_RTT_FROM_DATA); + *rto_ok = 0; + } + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } } @@ -3033,7 +3039,8 @@ static int sctp_handle_segments(struct mbuf *m, int *offset, struct sctp_tcb *stcb, struct sctp_association *asoc, uint32_t last_tsn, uint32_t * biggest_tsn_acked, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int num_seg, int num_nr_seg, int *ecn_seg_sums) + int num_seg, int num_nr_seg, int *ecn_seg_sums, + int *rto_ok) { struct sctp_gap_ack_block *frag, block; struct sctp_tmit_chunk *tp1; @@ -3079,7 +3086,7 @@ sctp_handle_segments(struct mbuf *m, int } if (sctp_process_segment_range(stcb, &tp1, last_tsn, frag_strt, frag_end, non_revocable, &num_frs, biggest_newly_acked_tsn, - this_sack_lowest_newack, ecn_seg_sums)) { + this_sack_lowest_newack, ecn_seg_sums, rto_ok)) { chunk_freed = 1; } prev_frag_end = frag_end; @@ -3579,6 +3586,9 @@ sctp_strike_gap_ack_chunks(struct sctp_t * this guy had a RTO calculation pending on * it, cancel it */ + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } if (alt != tp1->whoTo) { @@ -3775,6 +3785,7 @@ sctp_express_handle_sack(struct sctp_tcb int win_probe_recovery = 0; int win_probe_recovered = 0; int j, done_once = 0; + int rto_ok = 1; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_SACK_ARRIVALS_ENABLE) { sctp_misc_ints(SCTP_SACK_LOG_EXPRESS, cumack, @@ -3916,16 +3927,23 @@ sctp_express_handle_sack(struct sctp_tcb /* update RTO too? */ if (tp1->do_rtt) { - tp1->whoTo->RTO = - /* - * sa_ignore - * NO_NULL_CHK - */ - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + if (rto_ok) { + tp1->whoTo->RTO = + /* + * sa_ignore + * NO_NULL_CH + * K + */ + sctp_calculate_rto(stcb, + asoc, tp1->whoTo, + &tp1->sent_rcv_time, + sctp_align_safe_nocopy, + SCTP_RTT_FROM_DATA); + rto_ok = 0; + } + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } } @@ -4280,6 +4298,7 @@ sctp_handle_sack(struct mbuf *m, int off struct sctp_nets *net = NULL; int ecn_seg_sums = 0; int done_once; + int rto_ok = 1; uint8_t reneged_all = 0; uint8_t cmt_dac_flag; @@ -4526,12 +4545,18 @@ sctp_handle_sack(struct mbuf *m, int off /* update RTO too? */ if (tp1->do_rtt) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + if (rto_ok) { + tp1->whoTo->RTO = + sctp_calculate_rto(stcb, + asoc, tp1->whoTo, + &tp1->sent_rcv_time, + sctp_align_safe_nocopy, + SCTP_RTT_FROM_DATA); + rto_ok = 0; + } + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } } @@ -4606,7 +4631,8 @@ sctp_handle_sack(struct mbuf *m, int off */ if (sctp_handle_segments(m, &offset_seg, stcb, asoc, last_tsn, &biggest_tsn_acked, &biggest_tsn_newly_acked, &this_sack_lowest_newack, - num_seg, num_nr_seg, &ecn_seg_sums)) { + num_seg, num_nr_seg, &ecn_seg_sums, + &rto_ok)) { wake_him++; } if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 20:22:45 2012 (r231425) @@ -485,7 +485,7 @@ sctp_process_init_ack(struct mbuf *m, in /* calculate the RTO */ net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { @@ -630,7 +630,7 @@ sctp_handle_heartbeat_ack(struct sctp_he } /* Now lets do a RTO with this */ r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_OK); + SCTP_RTT_FROM_NON_DATA); /* Mobility adaptation */ if (req_prim) { if ((sctp_is_mobility_feature_on(stcb->sctp_ep, @@ -1547,7 +1547,7 @@ sctp_process_cookie_existing(struct mbuf net->RTO = sctp_calculate_rto(stcb, asoc, net, &cookie->time_entered, sctp_align_unsafe_makecopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); if (stcb->asoc.sctp_autoclose_ticks && (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE))) { @@ -2251,7 +2251,7 @@ sctp_process_cookie_new(struct mbuf *m, if ((netp) && (*netp)) { (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, &cookie->time_entered, sctp_align_unsafe_makecopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2849,7 +2849,7 @@ sctp_handle_cookie_ack(struct sctp_cooki if (asoc->overall_error_count == 0) { net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, - SCTP_DETERMINE_LL_NOTOK); + SCTP_RTT_FROM_NON_DATA); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); @@ -3218,6 +3218,9 @@ process_chunk_drop(struct sctp_tcb *stcb * this guy had a RTO calculation * pending on it, cancel it */ + if (tp1->whoTo->rto_needed == 0) { + tp1->whoTo->rto_needed = 1; + } tp1->do_rtt = 0; } SCTP_STAT_INCR(sctps_pdrpmark); Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:22:45 2012 (r231425) @@ -8254,7 +8254,10 @@ no_data_fill: } else { asoc->time_last_sent = *now; } - data_list[0]->do_rtt = 1; + if (net->rto_needed) { + data_list[0]->do_rtt = 1; + net->rto_needed = 0; + } SCTP_STAT_INCR_BY(sctps_senddata, bundle_at); sctp_clean_up_datalist(stcb, asoc, data_list, bundle_at, net); if (SCTP_BASE_SYSCTL(sctp_early_fr)) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:22:45 2012 (r231425) @@ -3858,6 +3858,7 @@ sctp_add_remote_addr(struct sctp_tcb *st * We set this to 0, the timer code knows that this means its an * initial value */ + net->rto_needed = 1; net->RTO = 0; net->RTO_measured = 0; stcb->asoc.numnets++; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 20:22:45 2012 (r231425) @@ -226,11 +226,20 @@ struct rtcc_cc { uint64_t bw_bytes; /* The total bytes since this sending began */ uint64_t bw_tot_time; /* The total time since sending began */ uint64_t new_tot_time; /* temp holding the new value */ - uint32_t cwnd_at_bw_set; - uint8_t ret_from_eq; - uint8_t use_dccc_ecn; + uint64_t bw_bytes_at_last_rttc; /* What bw_bytes was at last rtt calc */ + uint32_t cwnd_at_bw_set;/* Cwnd at last bw saved - lbw */ + uint32_t vol_reduce; /* cnt of voluntary reductions */ + uint16_t steady_step; /* The number required to be in steady state */ + uint16_t step_cnt; /* The current number */ + uint8_t ret_from_eq; /* When all things are equal what do I return + * 0/1 - 1 no cc advance */ + uint8_t use_dccc_ecn; /* Flag to enable DCCC ECN */ uint8_t tls_needs_set; /* Flag to indicate we need to set tls 0 or 1 * means set at send 2 not */ + uint8_t last_step_state;/* Last state if steady state stepdown is on */ + uint8_t rtt_set_this_sack; /* Flag saying this sack had RTT calc + * on it */ + uint8_t last_inst_ind; /* Last saved inst indication */ }; @@ -364,6 +373,7 @@ struct sctp_nets { uint8_t RTO_measured; /* Have we done the first measure */ uint8_t last_hs_used; /* index into the last HS table entry we used */ uint8_t lan_type; + uint8_t rto_needed; uint32_t flowid; #ifdef INVARIANTS uint8_t flowidset; @@ -671,6 +681,7 @@ struct sctp_cc_functions { void (*sctp_cwnd_prepare_net_for_sack) (struct sctp_tcb *stcb, struct sctp_nets *net); int (*sctp_cwnd_socket_option) (struct sctp_tcb *stcb, int set, struct sctp_cc_option *); + void (*sctp_rtt_calculated) (struct sctp_tcb *, struct sctp_nets *, struct timeval *); }; /* Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:19:38 2012 (r231424) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 20:22:45 2012 (r231425) @@ -118,6 +118,9 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_rttvar_bw) = SCTPCTL_RTTVAR_BW_DEFAULT; SCTP_BASE_SYSCTL(sctp_rttvar_rtt) = SCTPCTL_RTTVAR_RTT_DEFAULT; SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; + SCTP_BASE_SYSCTL(sctp_steady_step) = SCTPCTL_RTTVAR_STEADYS_DEFAULT; + SCTP_BASE_SYSCTL(sctp_use_dccc_ecn) = SCTPCTL_RTTVAR_DCCCECN_DEFAULT; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:27:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8A2F106566B; Fri, 10 Feb 2012 20:27:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D05CC8FC08; Fri, 10 Feb 2012 20:27: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 q1AKRwNR092717; Fri, 10 Feb 2012 20:27:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKRwGS092714; Fri, 10 Feb 2012 20:27:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102027.q1AKRwGS092714@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:27:58 +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: r231426 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:27:59 -0000 Author: tuexen Date: Fri Feb 10 20:27:58 2012 New Revision: 231426 URL: http://svn.freebsd.org/changeset/base/231426 Log: MFC r221249: Improve compilation of SCTP code without INET support. Some bugs where fixed while doing this: * ASCONF-ACK messages might use wrong port number when using IPv6. * Checking for additional addresses takes the correct address into account and also does not do more comparisons than necessary. This patch is based on one received from bz@ who was sponsored by The FreeBSD Foundation and iXsystems. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:22:45 2012 (r231425) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:27:58 2012 (r231426) @@ -57,41 +57,51 @@ static void sctp_asconf_get_source_ip(struct mbuf *m, struct sockaddr *sa) { struct ip *iph; + +#ifdef INET struct sockaddr_in *sin; +#endif #ifdef INET6 struct sockaddr_in6 *sin6; #endif iph = mtod(m, struct ip *); - if (iph->ip_v == IPVERSION) { - /* IPv4 source */ - sin = (struct sockaddr_in *)sa; - bzero(sin, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(struct sockaddr_in); - sin->sin_port = 0; - sin->sin_addr.s_addr = iph->ip_src.s_addr; - return; - } + switch (iph->ip_v) { +#ifdef INET + case IPVERSION: + { + /* IPv4 source */ + sin = (struct sockaddr_in *)sa; + bzero(sin, sizeof(*sin)); + sin->sin_family = AF_INET; + sin->sin_len = sizeof(struct sockaddr_in); + sin->sin_port = 0; + sin->sin_addr.s_addr = iph->ip_src.s_addr; + break; + } +#endif #ifdef INET6 - else if (iph->ip_v == (IPV6_VERSION >> 4)) { - /* IPv6 source */ - struct ip6_hdr *ip6; + case (IPV6_VERSION >> 4): + { + /* IPv6 source */ + struct ip6_hdr *ip6; - sin6 = (struct sockaddr_in6 *)sa; - bzero(sin6, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(struct sockaddr_in6); - sin6->sin6_port = 0; - ip6 = mtod(m, struct ip6_hdr *); - sin6->sin6_addr = ip6->ip6_src; - return; - } + sin6 = (struct sockaddr_in6 *)sa; + bzero(sin6, sizeof(*sin6)); + sin6->sin6_family = AF_INET6; + sin6->sin6_len = sizeof(struct sockaddr_in6); + sin6->sin6_port = 0; + ip6 = mtod(m, struct ip6_hdr *); + sin6->sin6_addr = ip6->ip6_src; + break; + } #endif /* INET6 */ - else - return; + default: + break; + } + return; } /* @@ -192,33 +202,36 @@ sctp_process_asconf_add_ip(struct mbuf * { struct mbuf *m_reply = NULL; struct sockaddr_storage sa_source, sa_store; - struct sctp_ipv4addr_param *v4addr; + struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; - struct sockaddr_in *sin; int zero_address = 0; +#ifdef INET + struct sockaddr_in *sin; + struct sctp_ipv4addr_param *v4addr; + +#endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *v6addr; -#endif /* INET6 */ +#endif aparam_length = ntohs(aph->ph.param_length); - v4addr = (struct sctp_ipv4addr_param *)(aph + 1); -#ifdef INET6 - v6addr = (struct sctp_ipv6addr_param *)(aph + 1); -#endif /* INET6 */ - param_type = ntohs(v4addr->ph.param_type); - param_length = ntohs(v4addr->ph.param_length); + ph = (struct sctp_paramhdr *)(aph + 1); + param_type = ntohs(ph->param_type); + param_length = ntohs(ph->param_length); sa = (struct sockaddr *)&sa_store; switch (param_type) { +#ifdef INET case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ return NULL; } + v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; @@ -230,12 +243,14 @@ sctp_process_asconf_add_ip(struct mbuf * SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); break; - case SCTP_IPV6_ADDRESS: +#endif #ifdef INET6 + case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ return NULL; } + v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; @@ -247,18 +262,13 @@ sctp_process_asconf_add_ip(struct mbuf * zero_address = 1; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); -#else - /* IPv6 not enabled! */ - /* FIX ME: currently sends back an invalid param error */ - m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, aparam_length); - SCTPDBG(SCTP_DEBUG_ASCONF1, - "process_asconf_add_ip: v6 disabled- skipping "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); - return m_reply; -#endif break; +#endif default: + /* + * XXX: Is this the correct error cause? Maybe + * SCTP_CAUSE_INVALID_PARAM is a better choice. + */ m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, aparam_length); @@ -293,7 +303,6 @@ sctp_process_asconf_add_ip(struct mbuf * sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, NULL); } - return m_reply; } @@ -331,37 +340,40 @@ sctp_process_asconf_delete_ip(struct mbu { struct mbuf *m_reply = NULL; struct sockaddr_storage sa_source, sa_store; - struct sctp_ipv4addr_param *v4addr; + struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; - struct sockaddr_in *sin; int zero_address = 0; int result; +#ifdef INET + struct sockaddr_in *sin; + struct sctp_ipv4addr_param *v4addr; + +#endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *v6addr; -#endif /* INET6 */ +#endif /* get the source IP address for src and 0.0.0.0/::0 delete checks */ sctp_asconf_get_source_ip(m, (struct sockaddr *)&sa_source); aparam_length = ntohs(aph->ph.param_length); - v4addr = (struct sctp_ipv4addr_param *)(aph + 1); -#ifdef INET6 - v6addr = (struct sctp_ipv6addr_param *)(aph + 1); -#endif /* INET6 */ - param_type = ntohs(v4addr->ph.param_type); - param_length = ntohs(v4addr->ph.param_length); + ph = (struct sctp_paramhdr *)(aph + 1); + param_type = ntohs(ph->param_type); + param_length = ntohs(ph->param_length); sa = (struct sockaddr *)&sa_store; switch (param_type) { +#ifdef INET case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ return NULL; } + v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; @@ -374,12 +386,14 @@ sctp_process_asconf_delete_ip(struct mbu "process_asconf_delete_ip: deleting "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); break; +#endif +#ifdef INET6 case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ return NULL; } -#ifdef INET6 + v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; @@ -392,15 +406,8 @@ sctp_process_asconf_delete_ip(struct mbu SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: deleting "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); -#else - /* IPv6 not enabled! No "action" needed; just ack it */ - SCTPDBG(SCTP_DEBUG_ASCONF1, - "process_asconf_delete_ip: v6 disabled- ignoring: "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); - /* just respond with a "success" ASCONF-ACK */ - return NULL; -#endif break; +#endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, @@ -466,33 +473,36 @@ sctp_process_asconf_set_primary(struct m { struct mbuf *m_reply = NULL; struct sockaddr_storage sa_source, sa_store; - struct sctp_ipv4addr_param *v4addr; + struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; - struct sockaddr_in *sin; int zero_address = 0; +#ifdef INET + struct sockaddr_in *sin; + struct sctp_ipv4addr_param *v4addr; + +#endif #ifdef INET6 struct sockaddr_in6 *sin6; struct sctp_ipv6addr_param *v6addr; -#endif /* INET6 */ +#endif aparam_length = ntohs(aph->ph.param_length); - v4addr = (struct sctp_ipv4addr_param *)(aph + 1); -#ifdef INET6 - v6addr = (struct sctp_ipv6addr_param *)(aph + 1); -#endif /* INET6 */ - param_type = ntohs(v4addr->ph.param_type); - param_length = ntohs(v4addr->ph.param_length); + ph = (struct sctp_paramhdr *)(aph + 1); + param_type = ntohs(ph->param_type); + param_length = ntohs(ph->param_length); sa = (struct sockaddr *)&sa_store; switch (param_type) { +#ifdef INET case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ return NULL; } + v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; bzero(sin, sizeof(*sin)); sin->sin_family = AF_INET; @@ -503,12 +513,14 @@ sctp_process_asconf_set_primary(struct m SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); break; +#endif +#ifdef INET6 case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ return NULL; } -#ifdef INET6 + v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; bzero(sin6, sizeof(*sin6)); sin6->sin6_family = AF_INET6; @@ -519,15 +531,8 @@ sctp_process_asconf_set_primary(struct m zero_address = 1; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); -#else - /* IPv6 not enabled! No "action" needed; just ack it */ - SCTPDBG(SCTP_DEBUG_ASCONF1, - "process_asconf_set_primary: v6 disabled- ignoring: "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); - /* just respond with a "success" ASCONF-ACK */ - return NULL; -#endif break; +#endif default: m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, @@ -655,7 +660,7 @@ sctp_handle_asconf(struct mbuf *m, unsig if (first) { /* delete old cache */ - SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing firstASCONF. Try to delte old cache\n"); + SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing first ASCONF. Try to delete old cache\n"); TAILQ_FOREACH_SAFE(ack, &asoc->asconf_ack_sent, next, ack_next) { if (ack->serial_number == serial_num) @@ -825,10 +830,8 @@ send_reply: ack->last_sent_to = NULL; ack->data = m_ack; ack->len = 0; - n = m_ack; - while (n) { + for (n = m_ack; n != NULL; n = SCTP_BUF_NEXT(n)) { ack->len += SCTP_BUF_LEN(n); - n = SCTP_BUF_NEXT(n); } TAILQ_INSERT_TAIL(&stcb->asoc.asconf_ack_sent, ack, next); @@ -846,12 +849,13 @@ send_reply: SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n"); /* pullup already done, IP options already stripped */ iph = mtod(m, struct ip *); - sh = (struct sctphdr *)((caddr_t)iph + sizeof(*iph)); switch (iph->ip_v) { +#ifdef INET case IPVERSION: { struct sockaddr_in *from4; + sh = (struct sctphdr *)((caddr_t)iph + sizeof(*iph)); from4 = (struct sockaddr_in *)&from_store; bzero(from4, sizeof(*from4)); from4->sin_family = AF_INET; @@ -860,6 +864,7 @@ send_reply: from4->sin_port = sh->src_port; break; } +#endif #ifdef INET6 case IPV6_VERSION >> 4: { @@ -867,6 +872,7 @@ send_reply: struct sockaddr_in6 *from6; ip6 = mtod(m, struct ip6_hdr *); + sh = (struct sctphdr *)((caddr_t)ip6 + sizeof(*ip6)); from6 = (struct sockaddr_in6 *)&from_store; bzero(from6, sizeof(*from6)); from6->sin6_family = AF_INET6; @@ -908,28 +914,36 @@ send_reply: static uint32_t sctp_asconf_addr_match(struct sctp_asconf_addr *aa, struct sockaddr *sa) { + switch (sa->sa_family) { #ifdef INET6 - if (sa->sa_family == AF_INET6) { - /* IPv6 sa address */ - /* XXX scopeid */ - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - - if ((aa->ap.addrp.ph.param_type == SCTP_IPV6_ADDRESS) && - (memcmp(&aa->ap.addrp.addr, &sin6->sin6_addr, - sizeof(struct in6_addr)) == 0)) { - return (1); + case AF_INET6: + { + /* XXX scopeid */ + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + + if ((aa->ap.addrp.ph.param_type == SCTP_IPV6_ADDRESS) && + (memcmp(&aa->ap.addrp.addr, &sin6->sin6_addr, + sizeof(struct in6_addr)) == 0)) { + return (1); + } + break; } - } else -#endif /* INET6 */ - if (sa->sa_family == AF_INET) { - /* IPv4 sa address */ - struct sockaddr_in *sin = (struct sockaddr_in *)sa; - - if ((aa->ap.addrp.ph.param_type == SCTP_IPV4_ADDRESS) && - (memcmp(&aa->ap.addrp.addr, &sin->sin_addr, - sizeof(struct in_addr)) == 0)) { - return (1); +#endif +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin = (struct sockaddr_in *)sa; + + if ((aa->ap.addrp.ph.param_type == SCTP_IPV4_ADDRESS) && + (memcmp(&aa->ap.addrp.addr, &sin->sin_addr, + sizeof(struct in_addr)) == 0)) { + return (1); + } + break; } +#endif + default: + break; } return (0); } @@ -938,43 +952,48 @@ sctp_asconf_addr_match(struct sctp_ascon * does the address match? returns 0 if not, 1 if so */ static uint32_t -sctp_addr_match( - struct sctp_ipv6addr_param *v6addr, - struct sockaddr *sa) +sctp_addr_match(struct sctp_paramhdr *ph, struct sockaddr *sa) { uint16_t param_type, param_length; - struct sctp_ipv4addr_param *v4addr = (struct sctp_ipv4addr_param *)v6addr; + param_type = ntohs(ph->param_type); + param_length = ntohs(ph->param_length); + switch (sa->sa_family) { #ifdef INET6 - if (sa->sa_family == AF_INET6) { - /* IPv6 sa address */ - /* XXX scopeid */ - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; - - param_type = ntohs(v6addr->ph.param_type); - param_length = ntohs(v6addr->ph.param_length); - - if ((param_type == SCTP_IPV6_ADDRESS) && - param_length == sizeof(struct sctp_ipv6addr_param) && - (memcmp(&v6addr->addr, &sin6->sin6_addr, - sizeof(struct in6_addr)) == 0)) { - return (1); + case AF_INET6: + { + /* XXX scopeid */ + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + struct sctp_ipv6addr_param *v6addr; + + v6addr = (struct sctp_ipv6addr_param *)ph; + if ((param_type == SCTP_IPV6_ADDRESS) && + param_length == sizeof(struct sctp_ipv6addr_param) && + (memcmp(&v6addr->addr, &sin6->sin6_addr, + sizeof(struct in6_addr)) == 0)) { + return (1); + } + break; } - } #endif - if (sa->sa_family == AF_INET) { - /* IPv4 sa address */ - struct sockaddr_in *sin = (struct sockaddr_in *)sa; - - param_type = ntohs(v4addr->ph.param_type); - param_length = ntohs(v4addr->ph.param_length); - - if ((param_type == SCTP_IPV4_ADDRESS) && - param_length == sizeof(struct sctp_ipv4addr_param) && - (memcmp(&v4addr->addr, &sin->sin_addr, - sizeof(struct in_addr)) == 0)) { - return (1); +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin = (struct sockaddr_in *)sa; + struct sctp_ipv4addr_param *v4addr; + + v4addr = (struct sctp_ipv4addr_param *)ph; + if ((param_type == SCTP_IPV4_ADDRESS) && + param_length == sizeof(struct sctp_ipv4addr_param) && + (memcmp(&v4addr->addr, &sin->sin_addr, + sizeof(struct in_addr)) == 0)) { + return (1); + } + break; } +#endif + default: + break; } return (0); } @@ -1179,17 +1198,25 @@ sctp_path_check_and_react(struct sctp_tc continue; changed = 0; - if (net->ro._l_addr.sa.sa_family == AF_INET) { - if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *) & net->ro)) + switch (net->ro._l_addr.sa.sa_family) { +#ifdef INET + case AF_INET: + if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *) & net->ro)) { changed = 1; - } + } + break; +#endif #ifdef INET6 - if (net->ro._l_addr.sa.sa_family == AF_INET6) { + case AF_INET6: if (sctp_v6src_match_nexthop( - &newifa->address.sin6, (sctp_route_t *) & net->ro)) + &newifa->address.sin6, (sctp_route_t *) & net->ro)) { changed = 1; - } + } + break; #endif + default: + break; + } /* * if the newly added address does not relate routing * information, we skip. @@ -1316,31 +1343,40 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * aa->ifa = ifa; atomic_add_int(&ifa->refcount, 1); /* correlation_id filled in during send routine later... */ - if (ifa->address.sa.sa_family == AF_INET6) { - /* IPv6 address */ - struct sockaddr_in6 *sin6; + switch (ifa->address.sa.sa_family) { +#ifdef INET6 + case AF_INET6: + { + struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&ifa->address.sa; - sa = (struct sockaddr *)sin6; - aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; - aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); - aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + - sizeof(struct sctp_ipv6addr_param); - memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr, - sizeof(struct in6_addr)); - } else if (ifa->address.sa.sa_family == AF_INET) { - /* IPv4 address */ - struct sockaddr_in *sin; + sin6 = (struct sockaddr_in6 *)&ifa->address.sa; + sa = (struct sockaddr *)sin6; + aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; + aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); + aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + + sizeof(struct sctp_ipv6addr_param); + memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr, + sizeof(struct in6_addr)); + break; + } +#endif +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&ifa->address.sa; - sa = (struct sockaddr *)sin; - aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; - aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); - aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + - sizeof(struct sctp_ipv4addr_param); - memcpy(&aa->ap.addrp.addr, &sin->sin_addr, - sizeof(struct in_addr)); - } else { + sin = (struct sockaddr_in *)&ifa->address.sa; + sa = (struct sockaddr *)sin; + aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; + aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); + aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + + sizeof(struct sctp_ipv4addr_param); + memcpy(&aa->ap.addrp.addr, &sin->sin_addr, + sizeof(struct in_addr)); + break; + } +#endif + default: /* invalid family! */ SCTP_FREE(aa, SCTP_M_ASC_ADDR); sctp_free_ifa(ifa); @@ -1522,26 +1558,37 @@ sctp_asconf_queue_sa_delete(struct sctp_ if (ifa) atomic_add_int(&ifa->refcount, 1); /* correlation_id filled in during send routine later... */ - if (sa->sa_family == AF_INET6) { - /* IPv6 address */ - struct sockaddr_in6 *sin6; + switch (sa->sa_family) { +#ifdef INET6 + case AF_INET6: + { + /* IPv6 address */ + struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; - aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; - aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); - aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv6addr_param); - memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr, - sizeof(struct in6_addr)); - } else if (sa->sa_family == AF_INET) { - /* IPv4 address */ - struct sockaddr_in *sin = (struct sockaddr_in *)sa; + sin6 = (struct sockaddr_in6 *)sa; + aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS; + aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param)); + aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv6addr_param); + memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr, + sizeof(struct in6_addr)); + break; + } +#endif +#ifdef INET + case AF_INET: + { + /* IPv4 address */ + struct sockaddr_in *sin = (struct sockaddr_in *)sa; - aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; - aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); - aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv4addr_param); - memcpy(&aa->ap.addrp.addr, &sin->sin_addr, - sizeof(struct in_addr)); - } else { + aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS; + aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param)); + aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv4addr_param); + memcpy(&aa->ap.addrp.addr, &sin->sin_addr, + sizeof(struct in_addr)); + break; + } +#endif + default: /* invalid family! */ SCTP_FREE(aa, SCTP_M_ASC_ADDR); if (ifa) @@ -1923,10 +1970,19 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * */ /* first, make sure it's a good address family */ - if (ifa->address.sa.sa_family != AF_INET6 && - ifa->address.sa.sa_family != AF_INET) { + switch (ifa->address.sa.sa_family) { +#ifdef INET6 + case AF_INET6: + break; +#endif +#ifdef INET + case AF_INET: + break; +#endif + default: return; } +#ifdef INET6 /* make sure we're "allowed" to add this type of addr */ if (ifa->address.sa.sa_family == AF_INET6) { /* invalid if we're not a v6 endpoint */ @@ -1937,6 +1993,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * return; } } +#endif /* put this address on the "pending/do not use yet" list */ sctp_add_local_addr_restricted(stcb, ifa); /* @@ -1971,6 +2028,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * break; } #endif +#ifdef INET case AF_INET: { struct sockaddr_in *sin; @@ -1993,6 +2051,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * } break; } +#endif default: /* else, not AF_INET or AF_INET6, so skip */ return; @@ -2036,35 +2095,38 @@ sctp_asconf_iterator_ep(struct sctp_inpc asc = (struct sctp_asconf_iterator *)ptr; LIST_FOREACH(l, &asc->list_of_work, sctp_nxt_addr) { ifa = l->ifa; - if (ifa->address.sa.sa_family == AF_INET6) { + switch (ifa->address.sa.sa_family) { +#ifdef INET6 + case AF_INET6: /* invalid if we're not a v6 endpoint */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) { cnt_invalid++; if (asc->cnt == cnt_invalid) return (1); - else - continue; } - } else if (ifa->address.sa.sa_family == AF_INET) { - /* invalid if we are a v6 only endpoint */ - struct in6pcb *inp6; + break; +#endif +#ifdef INET + case AF_INET: + { + /* invalid if we are a v6 only endpoint */ + struct in6pcb *inp6; - inp6 = (struct in6pcb *)&inp->ip_inp.inp; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && - SCTP_IPV6_V6ONLY(inp6)) { - cnt_invalid++; - if (asc->cnt == cnt_invalid) - return (1); - else - continue; + inp6 = (struct in6pcb *)&inp->ip_inp.inp; + if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && + SCTP_IPV6_V6ONLY(inp6)) { + cnt_invalid++; + if (asc->cnt == cnt_invalid) + return (1); + } + break; } - } else { +#endif + default: /* invalid address family */ cnt_invalid++; if (asc->cnt == cnt_invalid) return (1); - else - continue; } } return (0); @@ -2153,6 +2215,7 @@ sctp_asconf_iterator_stcb(struct sctp_in break; } #endif +#ifdef INET case AF_INET: { /* invalid if we are a v6 only endpoint */ @@ -2184,6 +2247,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } break; } +#endif default: /* invalid address family */ cnt_invalid++; @@ -2374,7 +2438,7 @@ sctp_is_addr_pending(struct sctp_tcb *st struct sctp_asconf_chunk *acp; struct sctp_asconf_paramhdr *aph; uint8_t aparam_buf[SCTP_PARAM_BUFFER_SIZE]; - struct sctp_ipv6addr_param *p_addr; + struct sctp_paramhdr *ph; int add_cnt, del_cnt; uint16_t last_param_type; @@ -2389,12 +2453,12 @@ sctp_is_addr_pending(struct sctp_tcb *st acp = mtod(chk->data, struct sctp_asconf_chunk *); offset += sizeof(struct sctp_asconf_chunk); asconf_limit = ntohs(acp->ch.chunk_length); - p_addr = (struct sctp_ipv6addr_param *)sctp_m_getptr(chk->data, offset, sizeof(struct sctp_paramhdr), aparam_buf); - if (p_addr == NULL) { + ph = (struct sctp_paramhdr *)sctp_m_getptr(chk->data, offset, sizeof(struct sctp_paramhdr), aparam_buf); + if (ph == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: couldn't get lookup addr!\n"); continue; } - offset += ntohs(p_addr->ph.param_length); + offset += ntohs(ph->param_length); aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(chk->data, offset, sizeof(struct sctp_asconf_paramhdr), aparam_buf); if (aph == NULL) { @@ -2423,8 +2487,8 @@ sctp_is_addr_pending(struct sctp_tcb *st SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: couldn't get entire param\n"); break; } - p_addr = (struct sctp_ipv6addr_param *)(aph + 1); - if (sctp_addr_match(p_addr, &sctp_ifa->address.sa) != 0) { + ph = (struct sctp_paramhdr *)(aph + 1); + if (sctp_addr_match(ph, &sctp_ifa->address.sa) != 0) { switch (param_type) { case SCTP_ADD_IP_ADDRESS: add_cnt++; @@ -2480,52 +2544,72 @@ sctp_find_valid_localaddr(struct sctp_tc continue; } LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { - if (sctp_ifa->address.sa.sa_family == AF_INET && - stcb->asoc.ipv4_addr_legal) { - struct sockaddr_in *sin; + switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + if (stcb->asoc.ipv4_addr_legal) { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)&sctp_ifa->address.sa; + if (sin->sin_addr.s_addr == 0) { + /* skip unspecifed addresses */ + continue; + } + if (stcb->asoc.ipv4_local_scope == 0 && + IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) + continue; - sin = (struct sockaddr_in *)&sctp_ifa->address.sa; - if (sin->sin_addr.s_addr == 0) { - /* skip unspecifed addresses */ - continue; + if (sctp_is_addr_restricted(stcb, sctp_ifa) && + (!sctp_is_addr_pending(stcb, sctp_ifa))) + continue; + /* + * found a valid local v4 address to + * use + */ + if (addr_locked == SCTP_ADDR_NOT_LOCKED) + SCTP_IPI_ADDR_RUNLOCK(); + return (&sctp_ifa->address.sa); } - if (stcb->asoc.ipv4_local_scope == 0 && - IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) - continue; + break; +#endif +#ifdef INET6 + case AF_INET6: + if (stcb->asoc.ipv6_addr_legal) { + struct sockaddr_in6 *sin6; - if (sctp_is_addr_restricted(stcb, sctp_ifa) && - (!sctp_is_addr_pending(stcb, sctp_ifa))) - continue; - /* found a valid local v4 address to use */ - if (addr_locked == SCTP_ADDR_NOT_LOCKED) - SCTP_IPI_ADDR_RUNLOCK(); - return (&sctp_ifa->address.sa); - } else if (sctp_ifa->address.sa.sa_family == AF_INET6 && - stcb->asoc.ipv6_addr_legal) { - struct sockaddr_in6 *sin6; + if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { + continue; + } + sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; + if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + /* + * we skip unspecifed + * addresses + */ + continue; + } + if (stcb->asoc.local_scope == 0 && + IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) + continue; + if (stcb->asoc.site_scope == 0 && + IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) + continue; - if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { - continue; - } - sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; - if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { - /* we skip unspecifed addresses */ - continue; + if (sctp_is_addr_restricted(stcb, sctp_ifa) && + (!sctp_is_addr_pending(stcb, sctp_ifa))) + continue; + /* + * found a valid local v6 address to + * use + */ + if (addr_locked == SCTP_ADDR_NOT_LOCKED) + SCTP_IPI_ADDR_RUNLOCK(); + return (&sctp_ifa->address.sa); } - if (stcb->asoc.local_scope == 0 && - IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) - continue; - if (stcb->asoc.site_scope == 0 && - IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) - continue; - - if (sctp_is_addr_restricted(stcb, sctp_ifa) && - (!sctp_is_addr_pending(stcb, sctp_ifa))) - continue; - /* found a valid local v6 address to use */ - if (addr_locked == SCTP_ADDR_NOT_LOCKED) - SCTP_IPI_ADDR_RUNLOCK(); - return (&sctp_ifa->address.sa); + break; +#endif + default: + break; } } } @@ -2697,7 +2781,9 @@ sctp_compose_asconf(struct sctp_tcb *stc lookup = (struct sctp_ipv6addr_param *)lookup_ptr; if (found_addr != NULL) { - if (found_addr->sa_family == AF_INET6) { + switch (found_addr->sa_family) { +#ifdef INET6 + case AF_INET6: /* copy IPv6 address */ lookup->ph.param_type = htons(SCTP_IPV6_ADDRESS); @@ -2705,7 +2791,10 @@ sctp_compose_asconf(struct sctp_tcb *stc addr_size = sizeof(struct in6_addr); addr_ptr = (caddr_t)&((struct sockaddr_in6 *) found_addr)->sin6_addr; - } else { + break; +#endif +#ifdef INET + case AF_INET: /* copy IPv4 address */ lookup->ph.param_type = htons(SCTP_IPV4_ADDRESS); @@ -2713,6 +2802,13 @@ sctp_compose_asconf(struct sctp_tcb *stc addr_size = sizeof(struct in_addr); addr_ptr = (caddr_t)&((struct sockaddr_in *) found_addr)->sin_addr; + break; +#endif + default: + p_size = 0; + addr_size = 0; + addr_ptr = NULL; + break; } lookup->ph.param_length = htons(SCTP_SIZE32(p_size)); memcpy(lookup->addr, addr_ptr, addr_size); @@ -2722,7 +2818,7 @@ sctp_compose_asconf(struct sctp_tcb *stc /* uh oh... don't have any address?? */ SCTPDBG(SCTP_DEBUG_ASCONF1, "compose_asconf: no lookup addr!\n"); - /* for now, we send a IPv4 address of 0.0.0.0 */ + /* XXX for now, we send a IPv4 address of 0.0.0.0 */ lookup->ph.param_type = htons(SCTP_IPV4_ADDRESS); lookup->ph.param_length = htons(SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param))); bzero(lookup->addr, sizeof(struct in_addr)); @@ -2754,8 +2850,15 @@ sctp_process_initack_addresses(struct sc uint16_t plen, ptype; struct sctp_ifa *sctp_ifa; struct sctp_ipv6addr_param addr_store; + +#ifdef INET6 struct sockaddr_in6 sin6; + +#endif +#ifdef INET struct sockaddr_in sin; + +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:29:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC623106564A; Fri, 10 Feb 2012 20:29:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D58128FC15; Fri, 10 Feb 2012 20:29:55 +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 q1AKTtxp092822; Fri, 10 Feb 2012 20:29:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKTtZI092820; Fri, 10 Feb 2012 20:29:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102029.q1AKTtZI092820@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:29:55 +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: r231427 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:29:56 -0000 Author: tuexen Date: Fri Feb 10 20:29:55 2012 New Revision: 231427 URL: http://svn.freebsd.org/changeset/base/231427 Log: MFC r221251: Remove some leftover debug code. Modified: stable/8/sys/netinet/sctp_os_bsd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 20:27:58 2012 (r231426) +++ stable/8/sys/netinet/sctp_os_bsd.h Fri Feb 10 20:29:55 2012 (r231427) @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" #include "opt_compat.h" #include "opt_inet6.h" -#if 1 #include "opt_inet.h" -#endif #include "opt_sctp.h" #include From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:32:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BE5E106566C; Fri, 10 Feb 2012 20:32:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 248E18FC13; Fri, 10 Feb 2012 20:32:00 +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 q1AKW0qI092936; Fri, 10 Feb 2012 20:32:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKVxLw092933; Fri, 10 Feb 2012 20:31:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102031.q1AKVxLw092933@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:31:59 +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: r231428 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:32:00 -0000 Author: tuexen Date: Fri Feb 10 20:31:59 2012 New Revision: 231428 URL: http://svn.freebsd.org/changeset/base/231428 Log: MFC r221328: Some more cleanups related to an kernel without INET. Modified: stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:29:55 2012 (r231427) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:31:59 2012 (r231428) @@ -2844,9 +2844,11 @@ sctp_notify_peer_addr_change(struct sctp spc->spc_flags = 0; spc->spc_length = sizeof(struct sctp_paddr_change); switch (sa->sa_family) { +#ifdef INET case AF_INET: memcpy(&spc->spc_aaddr, sa, sizeof(struct sockaddr_in)); break; +#endif #ifdef INET6 case AF_INET6: { @@ -4084,6 +4086,7 @@ sctp_cmpaddr(struct sockaddr *sa1, struc sin6_2)); } #endif +#ifdef INET case AF_INET: { /* IPv4 addresses */ @@ -4093,6 +4096,7 @@ sctp_cmpaddr(struct sockaddr *sa1, struc sin_2 = (struct sockaddr_in *)sa2; return (sin_1->sin_addr.s_addr == sin_2->sin_addr.s_addr); } +#endif default: /* we don't do these... */ return (0); @@ -4122,6 +4126,7 @@ sctp_print_address(struct sockaddr *sa) break; } #endif +#ifdef INET case AF_INET: { struct sockaddr_in *sin; @@ -4133,6 +4138,7 @@ sctp_print_address(struct sockaddr *sa) p[0], p[1], p[2], p[3], ntohs(sin->sin_port)); break; } +#endif default: SCTP_PRINTF("?\n"); break; @@ -4143,6 +4149,7 @@ void sctp_print_address_pkt(struct ip *iph, struct sctphdr *sh) { switch (iph->ip_v) { +#ifdef INET case IPVERSION: { struct sockaddr_in lsa, fsa; @@ -4163,6 +4170,7 @@ sctp_print_address_pkt(struct ip *iph, s sctp_print_address((struct sockaddr *)&fsa); break; } +#endif #ifdef INET6 case IPV6_VERSION >> 4: { @@ -4862,22 +4870,33 @@ sctp_find_ifa_in_ep(struct sctp_inpcb *i uint32_t sctp_get_ifa_hash_val(struct sockaddr *addr) { - if (addr->sa_family == AF_INET) { - struct sockaddr_in *sin; + switch (addr->sa_family) { +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin; - sin = (struct sockaddr_in *)addr; - return (sin->sin_addr.s_addr ^ (sin->sin_addr.s_addr >> 16)); - } else if (addr->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6; - uint32_t hash_of_addr; + sin = (struct sockaddr_in *)addr; + return (sin->sin_addr.s_addr ^ (sin->sin_addr.s_addr >> 16)); + } +#endif +#ifdef INET6 + case INET6: + { + struct sockaddr_in6 *sin6; + uint32_t hash_of_addr; - sin6 = (struct sockaddr_in6 *)addr; - hash_of_addr = (sin6->sin6_addr.s6_addr32[0] + - sin6->sin6_addr.s6_addr32[1] + - sin6->sin6_addr.s6_addr32[2] + - sin6->sin6_addr.s6_addr32[3]); - hash_of_addr = (hash_of_addr ^ (hash_of_addr >> 16)); - return (hash_of_addr); + sin6 = (struct sockaddr_in6 *)addr; + hash_of_addr = (sin6->sin6_addr.s6_addr32[0] + + sin6->sin6_addr.s6_addr32[1] + + sin6->sin6_addr.s6_addr32[2] + + sin6->sin6_addr.s6_addr32[3]); + hash_of_addr = (hash_of_addr ^ (hash_of_addr >> 16)); + return (hash_of_addr); + } +#endif + default: + break; } return (0); } @@ -6250,7 +6269,9 @@ sctp_connectx_helper_add(struct sctp_tcb inp = stcb->sctp_ep; *error = 0; for (i = 0; i < totaddr; i++) { - if (sa->sa_family == AF_INET) { + switch (sa->sa_family) { +#ifdef INET + case AF_INET: incr = sizeof(struct sockaddr_in); if (sctp_add_remote_addr(stcb, sa, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ @@ -6260,7 +6281,10 @@ sctp_connectx_helper_add(struct sctp_tcb goto out_now; } added++; - } else if (sa->sa_family == AF_INET6) { + break; +#endif +#ifdef INET6 + case AF_INET6: incr = sizeof(struct sockaddr_in6); if (sctp_add_remote_addr(stcb, sa, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ @@ -6270,6 +6294,10 @@ sctp_connectx_helper_add(struct sctp_tcb goto out_now; } added++; + break; +#endif + default: + break; } sa = (struct sockaddr *)((caddr_t)sa + incr); } @@ -6288,10 +6316,13 @@ sctp_connectx_helper_find(struct sctp_in at = incr = 0; sa = addr; + *error = *num_v6 = *num_v4 = 0; /* account and validate addresses */ for (i = 0; i < (size_t)*totaddr; i++) { - if (sa->sa_family == AF_INET) { + switch (sa->sa_family) { +#ifdef INET + case AF_INET: (*num_v4) += 1; incr = sizeof(struct sockaddr_in); if (sa->sa_len != incr) { @@ -6300,30 +6331,40 @@ sctp_connectx_helper_find(struct sctp_in *bad_addr = 1; return (NULL); } - } else if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6; - - sin6 = (struct sockaddr_in6 *)sa; - if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - /* Must be non-mapped for connectx */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); - } - (*num_v6) += 1; - incr = sizeof(struct sockaddr_in6); - if (sa->sa_len != incr) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - *error = EINVAL; - *bad_addr = 1; - return (NULL); + break; +#endif +#ifdef INET6 + case AF_INET6: + { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + /* Must be non-mapped for connectx */ + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + *error = EINVAL; + *bad_addr = 1; + return (NULL); + } + (*num_v6) += 1; + incr = sizeof(struct sockaddr_in6); + if (sa->sa_len != incr) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + *error = EINVAL; + *bad_addr = 1; + return (NULL); + } + break; } - } else { +#endif + default: *totaddr = i; /* we are done */ break; } + if (i == (size_t)*totaddr) { + break; + } SCTP_INP_INCR_REF(inp); stcb = sctp_findassociation_ep_addr(&inp, sa, NULL, NULL, NULL); if (stcb != NULL) { @@ -6364,7 +6405,7 @@ sctp_bindx_add_address(struct socket *so return; } addr_touse = sa; -#if defined(INET6) && !defined(__Userspace__) /* TODO port in6_sin6_2_sin */ +#ifdef INET6 if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; @@ -6393,6 +6434,7 @@ sctp_bindx_add_address(struct socket *so } } #endif +#ifdef INET if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); @@ -6407,6 +6449,7 @@ sctp_bindx_add_address(struct socket *so return; } } +#endif if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { if (p == NULL) { /* Can't get proc for Net/Open BSD */ @@ -6519,6 +6562,7 @@ sctp_bindx_delete_address(struct socket } } #endif +#ifdef INET if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); @@ -6533,6 +6577,7 @@ sctp_bindx_delete_address(struct socket return; } } +#endif /* * No lock required mgmt_ep_sa does its own locking. If the FIX: * below is ever changed we may need to lock before calling @@ -6599,6 +6644,7 @@ sctp_local_addr_count(struct sctp_tcb *s if (sctp_is_addr_restricted(stcb, sctp_ifa)) continue; switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET case AF_INET: if (ipv4_addr_legal) { struct sockaddr_in *sin; @@ -6621,6 +6667,7 @@ sctp_local_addr_count(struct sctp_tcb *s continue; } break; +#endif #ifdef INET6 case AF_INET6: if (ipv6_addr_legal) { @@ -6715,6 +6762,8 @@ sctp_log_trace(uint32_t subsys, const ch } #endif +/* XXX: Remove the #ifdef after tunneling over IPv6 works also on FreeBSD. */ +#ifdef INET /* We will need to add support * to bind the ports and such here * so we can do UDP tunneling. In @@ -6816,7 +6865,7 @@ out: m_freem(m); } -void +void sctp_over_udp_stop(void) { struct socket *sop; @@ -6833,7 +6882,8 @@ sctp_over_udp_stop(void) soclose(sop); SCTP_BASE_INFO(udp_tun_socket) = NULL; } -int + +int sctp_over_udp_start(void) { uint16_t port; @@ -6886,3 +6936,5 @@ exit_stage_left: */ return (0); } + +#endif Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Fri Feb 10 20:29:55 2012 (r231427) +++ stable/8/sys/netinet/sctputil.h Fri Feb 10 20:31:59 2012 (r231428) @@ -313,10 +313,14 @@ do { \ } \ } while (0) -/* new functions to start/stop udp tunneling */ +/* functions to start/stop udp tunneling */ +/* XXX: Remove the #ifdef after tunneling over IPv6 works also on FreeBSD. */ +#ifdef INET void sctp_over_udp_stop(void); int sctp_over_udp_start(void); +#endif + int sctp_soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:34:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CC8E1065672; Fri, 10 Feb 2012 20:34:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 475B58FC0A; Fri, 10 Feb 2012 20:34: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 q1AKYLL1093067; Fri, 10 Feb 2012 20:34:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKYLcw093065; Fri, 10 Feb 2012 20:34:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102034.q1AKYLcw093065@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:34: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: r231429 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:34:21 -0000 Author: tuexen Date: Fri Feb 10 20:34:20 2012 New Revision: 231429 URL: http://svn.freebsd.org/changeset/base/231429 Log: MFC r221410: Add a missing break. This bug was introduced in r221249. Modified: stable/8/sys/netinet/sctp_asconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:31:59 2012 (r231428) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:34:20 2012 (r231429) @@ -2930,6 +2930,7 @@ sctp_process_initack_addresses(struct sc } sin.sin_addr.s_addr = a4p->addr; sa = (struct sockaddr *)&sin; + break; } #endif default: From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:36:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9926106566B; Fri, 10 Feb 2012 20:36:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3A8D8FC13; Fri, 10 Feb 2012 20:36: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 q1AKaHk9093176; Fri, 10 Feb 2012 20:36:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKaHIN093171; Fri, 10 Feb 2012 20:36:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102036.q1AKaHIN093171@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:36:17 +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: r231430 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:36:17 -0000 Author: tuexen Date: Fri Feb 10 20:36:17 2012 New Revision: 231430 URL: http://svn.freebsd.org/changeset/base/231430 Log: MFC r221411: Remove code with any effect. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:34:20 2012 (r231429) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 20:36:17 2012 (r231430) @@ -2813,7 +2813,6 @@ sctp_compose_asconf(struct sctp_tcb *stc lookup->ph.param_length = htons(SCTP_SIZE32(p_size)); memcpy(lookup->addr, addr_ptr, addr_size); SCTP_BUF_LEN(m_asconf_chk) += SCTP_SIZE32(p_size); - lookup_used = 1; } else { /* uh oh... don't have any address?? */ SCTPDBG(SCTP_DEBUG_ASCONF1, @@ -2823,7 +2822,6 @@ sctp_compose_asconf(struct sctp_tcb *stc lookup->ph.param_length = htons(SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param))); bzero(lookup->addr, sizeof(struct in_addr)); SCTP_BUF_LEN(m_asconf_chk) += SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param)); - lookup_used = 1; } } /* chain it all together */ Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Feb 10 20:34:20 2012 (r231429) +++ stable/8/sys/netinet/sctp_auth.c Fri Feb 10 20:36:17 2012 (r231430) @@ -1949,9 +1949,6 @@ sctp_validate_init_auth_params(struct mb case SCTP_ASCONF_ACK: peer_supports_asconf = 1; break; - case SCTP_AUTHENTICATION: - peer_supports_auth = 1; - break; default: /* one we don't care about */ break; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:34:20 2012 (r231429) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:36:17 2012 (r231430) @@ -3850,8 +3850,6 @@ sctp_abort_an_association(struct sctp_in #endif ) { - uint32_t vtag; - #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; @@ -3872,7 +3870,6 @@ sctp_abort_an_association(struct sctp_in } else { stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } - vtag = stcb->asoc.peer_vtag; /* notify the ulp */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) sctp_abort_notification(stcb, error, so_locked); Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 20:34:20 2012 (r231429) +++ stable/8/sys/netinet6/sctp6_usrreq.c Fri Feb 10 20:36:17 2012 (r231430) @@ -1066,10 +1066,8 @@ sctp6_connect(struct socket *so, struct SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); return EINVAL; } - } else + } #endif /* INET */ - addr = addr; /* for true v6 address case */ - /* Now do we connect? */ if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) { stcb = LIST_FIRST(&inp->sctp_asoc_list); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:38:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BFFB1065670; Fri, 10 Feb 2012 20:38:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 658CC8FC08; Fri, 10 Feb 2012 20:38: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 q1AKcj40093298; Fri, 10 Feb 2012 20:38:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKcjdY093293; Fri, 10 Feb 2012 20:38:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102038.q1AKcjdY093293@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:38:45 +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: r231431 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:38:45 -0000 Author: tuexen Date: Fri Feb 10 20:38:44 2012 New Revision: 231431 URL: http://svn.freebsd.org/changeset/base/231431 Log: MFC r221460: Implement Resource Pooling V2 and an MPTCP like congestion control. Based on a patch received from Martin Becke. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 20:36:17 2012 (r231430) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 20:38:44 2012 (r231431) @@ -265,6 +265,13 @@ struct sctp_paramhdr { #define SCTP_CC_OPT_USE_DCCC_ECN 0x00002001 #define SCTP_CC_OPT_STEADY_STEP 0x00002002 +#define SCTP_CMT_OFF 0 +#define SCTP_CMT_BASE 1 +#define SCTP_CMT_RPV1 2 +#define SCTP_CMT_RPV2 3 +#define SCTP_CMT_MPTCP 4 +#define SCTP_CMT_MAX SCTP_CMT_MPTCP + /* RS - Supported stream scheduling modules for pluggable * stream scheduling */ Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:36:17 2012 (r231430) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 20:38:44 2012 (r231431) @@ -47,6 +47,10 @@ #include __FBSDID("$FreeBSD$"); +#define SHIFT_MPTCP_MULTI_N 40 +#define SHIFT_MPTCP_MULTI_Z 16 +#define SHIFT_MPTCP_MULTI 8 + static void sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -67,7 +71,8 @@ sctp_set_initial_cc_param(struct sctp_tc cwnd_in_mtu = assoc->max_burst; net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; } - if (stcb->asoc.sctp_cmt_on_off == 2) { + if ((stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV1) || + (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV2)) { /* In case of resource pooling initialize appropriately */ net->cwnd /= assoc->numnets; if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { @@ -91,14 +96,23 @@ sctp_cwnd_update_after_fr(struct sctp_tc { struct sctp_nets *net; uint32_t t_ssthresh, t_cwnd; + uint64_t t_ucwnd_sbw; /* MT FIXME: Don't compute this over and over again */ t_ssthresh = 0; t_cwnd = 0; - if (asoc->sctp_cmt_on_off == 2) { + t_ucwnd_sbw = 0; + if ((asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) || + (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2)) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { t_ssthresh += net->ssthresh; t_cwnd += net->cwnd; + if (net->lastsa > 0) { + t_ucwnd_sbw += (uint64_t) net->cwnd / (uint64_t) net->lastsa; + } + } + if (t_ucwnd_sbw == 0) { + t_ucwnd_sbw = 1; } } /*- @@ -119,11 +133,37 @@ sctp_cwnd_update_after_fr(struct sctp_tc struct sctp_tmit_chunk *lchk; int old_cwnd = net->cwnd; - if (asoc->sctp_cmt_on_off == 2) { - net->ssthresh = (uint32_t) (((uint64_t) 4 * - (uint64_t) net->mtu * - (uint64_t) net->ssthresh) / - (uint64_t) t_ssthresh); + if ((asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) || + (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2)) { + if (asoc->sctp_cmt_on_off == SCTP_CMT_RPV1) { + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + + } + if (asoc->sctp_cmt_on_off == SCTP_CMT_RPV2) { + uint32_t srtt; + + srtt = net->lastsa; + /* + * lastsa>>3; we don't need + * to devide ... + */ + if (srtt == 0) { + srtt = 1; + } + /* + * Short Version => Equal to + * Contel Version MBe + */ + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->cwnd) / + ((uint64_t) srtt * + t_ucwnd_sbw)); + /* INCREASE FACTOR */ ; + } if ((net->cwnd > t_cwnd / 2) && (net->ssthresh < net->cwnd - t_cwnd / 2)) { net->ssthresh = net->cwnd - t_cwnd / 2; @@ -629,14 +669,47 @@ sctp_cwnd_update_after_sack_common(struc struct sctp_nets *net; int old_cwnd; uint32_t t_ssthresh, t_cwnd, incr; + uint64_t t_ucwnd_sbw; + uint64_t t_path_mptcp; + uint64_t mptcp_like_alpha; + uint32_t srtt; + uint64_t max_path; /* MT FIXME: Don't compute this over and over again */ t_ssthresh = 0; t_cwnd = 0; - if (stcb->asoc.sctp_cmt_on_off == 2) { + t_ucwnd_sbw = 0; + t_path_mptcp = 0; + mptcp_like_alpha = 1; + if ((stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV1) || + (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV2) || + (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_MPTCP)) { + max_path = 0; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { t_ssthresh += net->ssthresh; t_cwnd += net->cwnd; + /* lastsa>>3; we don't need to devide ... */ + srtt = net->lastsa; + if (srtt > 0) { + uint64_t tmp; + + t_ucwnd_sbw += (uint64_t) net->cwnd / (uint64_t) srtt; + t_path_mptcp += (((uint64_t) net->cwnd) << SHIFT_MPTCP_MULTI_Z) / + (((uint64_t) net->mtu) * (uint64_t) srtt); + tmp = (((uint64_t) net->cwnd) << SHIFT_MPTCP_MULTI_N) / + ((uint64_t) net->mtu * (uint64_t) (srtt * srtt)); + if (tmp > max_path) { + max_path = tmp; + } + } + } + if (t_ucwnd_sbw == 0) { + t_ucwnd_sbw = 1; + } + if (t_path_mptcp > 0) { + mptcp_like_alpha = max_path / (t_path_mptcp * t_path_mptcp); + } else { + mptcp_like_alpha = 1; } } /******************************/ @@ -818,10 +891,11 @@ sctp_cwnd_update_after_sack_common(struc if (net->cwnd <= net->ssthresh) { /* We are in slow start */ if (net->flight_size + net->net_ack >= net->cwnd) { - old_cwnd = net->cwnd; - if (stcb->asoc.sctp_cmt_on_off == 2) { - uint32_t limit; + uint32_t limit; + old_cwnd = net->cwnd; + switch (asoc->sctp_cmt_on_off) { + case SCTP_CMT_RPV1: limit = (uint32_t) (((uint64_t) net->mtu * (uint64_t) SCTP_BASE_SYSCTL(sctp_L2_abc_variable) * (uint64_t) net->ssthresh) / @@ -835,11 +909,56 @@ sctp_cwnd_update_after_sack_common(struc if (incr == 0) { incr = 1; } - } else { + break; + case SCTP_CMT_RPV2: + /* + * lastsa>>3; we don't need + * to divide ... + */ + srtt = net->lastsa; + if (srtt == 0) { + srtt = 1; + } + limit = (uint32_t) (((uint64_t) net->mtu * + (uint64_t) SCTP_BASE_SYSCTL(sctp_L2_abc_variable) * + (uint64_t) net->cwnd) / + ((uint64_t) srtt * t_ucwnd_sbw)); + /* INCREASE FACTOR */ + incr = (uint32_t) (((uint64_t) net->net_ack * + (uint64_t) net->cwnd) / + ((uint64_t) srtt * t_ucwnd_sbw)); + /* INCREASE FACTOR */ + if (incr > limit) { + incr = limit; + } + if (incr == 0) { + incr = 1; + } + break; + case SCTP_CMT_MPTCP: + limit = (uint32_t) (((uint64_t) net->mtu * + mptcp_like_alpha * + (uint64_t) SCTP_BASE_SYSCTL(sctp_L2_abc_variable)) >> + SHIFT_MPTCP_MULTI); + incr = (uint32_t) (((uint64_t) net->net_ack * + mptcp_like_alpha) >> + SHIFT_MPTCP_MULTI); + if (incr > limit) { + incr = limit; + } + if (incr > net->net_ack) { + incr = net->net_ack; + } + if (incr > net->mtu) { + incr = net->mtu; + } + break; + default: incr = net->net_ack; if (incr > net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)) { incr = net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable); } + break; } net->cwnd += incr; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { @@ -868,15 +987,44 @@ sctp_cwnd_update_after_sack_common(struc (net->partial_bytes_acked >= net->cwnd)) { net->partial_bytes_acked -= net->cwnd; old_cwnd = net->cwnd; - if (asoc->sctp_cmt_on_off == 2) { + switch (asoc->sctp_cmt_on_off) { + case SCTP_CMT_RPV1: incr = (uint32_t) (((uint64_t) net->mtu * (uint64_t) net->ssthresh) / (uint64_t) t_ssthresh); if (incr == 0) { incr = 1; } - } else { + break; + case SCTP_CMT_RPV2: + /* + * lastsa>>3; we don't need + * to divide ... + */ + srtt = net->lastsa; + if (srtt == 0) { + srtt = 1; + } + incr = (uint32_t) ((uint64_t) net->mtu * + (uint64_t) net->cwnd / + ((uint64_t) srtt * + t_ucwnd_sbw)); + /* INCREASE FACTOR */ + if (incr == 0) { + incr = 1; + } + break; + case SCTP_CMT_MPTCP: + incr = (uint32_t) ((mptcp_like_alpha * + (uint64_t) net->cwnd) >> + SHIFT_MPTCP_MULTI); + if (incr > net->mtu) { + incr = net->mtu; + } + break; + default: incr = net->mtu; + break; } net->cwnd += incr; SDT_PROBE(sctp, cwnd, net, ack, @@ -926,21 +1074,49 @@ sctp_cwnd_update_after_timeout(struct sc { int old_cwnd = net->cwnd; uint32_t t_ssthresh, t_cwnd; + uint64_t t_ucwnd_sbw; /* MT FIXME: Don't compute this over and over again */ t_ssthresh = 0; t_cwnd = 0; - if (stcb->asoc.sctp_cmt_on_off == 2) { + if ((stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV1) || + (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV2)) { struct sctp_nets *lnet; + uint32_t srtt; + t_ucwnd_sbw = 0; TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) { t_ssthresh += lnet->ssthresh; t_cwnd += lnet->cwnd; + srtt = lnet->lastsa; + /* lastsa>>3; we don't need to divide ... */ + if (srtt > 0) { + t_ucwnd_sbw += (uint64_t) lnet->cwnd / (uint64_t) srtt; + } + } + if (t_ucwnd_sbw < 1) { + t_ucwnd_sbw = 1; + } + if (stcb->asoc.sctp_cmt_on_off == SCTP_CMT_RPV1) { + net->ssthresh = (uint32_t) (((uint64_t) 4 * + (uint64_t) net->mtu * + (uint64_t) net->ssthresh) / + (uint64_t) t_ssthresh); + } else { + uint64_t cc_delta; + + srtt = net->lastsa; + /* lastsa>>3; we don't need to divide ... */ + if (srtt == 0) { + srtt = 1; + } + cc_delta = t_ucwnd_sbw * (uint64_t) srtt / 2; + if (cc_delta < t_cwnd) { + net->ssthresh = (uint32_t) ((uint64_t) t_cwnd - cc_delta); + } else { + net->ssthresh = net->mtu; + } } - net->ssthresh = (uint32_t) (((uint64_t) 4 * - (uint64_t) net->mtu * - (uint64_t) net->ssthresh) / - (uint64_t) t_ssthresh); if ((net->cwnd > t_cwnd / 2) && (net->ssthresh < net->cwnd - t_cwnd / 2)) { net->ssthresh = net->cwnd - t_cwnd / 2; Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:36:17 2012 (r231430) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 20:38:44 2012 (r231431) @@ -336,9 +336,9 @@ struct sctp_sysctl { /* cmt_on_off: CMT on/off flag */ #define SCTPCTL_CMT_ON_OFF_DESC "CMT settings" -#define SCTPCTL_CMT_ON_OFF_MIN 0 -#define SCTPCTL_CMT_ON_OFF_MAX 2 -#define SCTPCTL_CMT_ON_OFF_DEFAULT 0 +#define SCTPCTL_CMT_ON_OFF_MIN SCTP_CMT_OFF +#define SCTPCTL_CMT_ON_OFF_MAX SCTP_CMT_MAX +#define SCTPCTL_CMT_ON_OFF_DEFAULT SCTP_CMT_OFF /* EY - nr_sack_on_off: NR_SACK on/off flag */ #define SCTPCTL_NR_SACK_ON_OFF_DESC "NR_SACK on/off flag" Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:36:17 2012 (r231430) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:38:44 2012 (r231431) @@ -2989,18 +2989,22 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); SCTP_FIND_STCB(inp, stcb, av->assoc_id); if (stcb) { - stcb->asoc.sctp_cmt_on_off = av->assoc_value; - if (stcb->asoc.sctp_cmt_on_off > 2) { - stcb->asoc.sctp_cmt_on_off = 2; + if (av->assoc_value > SCTP_CMT_MAX) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } else { + stcb->asoc.sctp_cmt_on_off = av->assoc_value; } SCTP_TCB_UNLOCK(stcb); } else { - SCTP_INP_WLOCK(inp); - inp->sctp_cmt_on_off = av->assoc_value; - if (inp->sctp_cmt_on_off > 2) { - inp->sctp_cmt_on_off = 2; + if (av->assoc_value > SCTP_CMT_MAX) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } else { + SCTP_INP_WLOCK(inp); + inp->sctp_cmt_on_off = av->assoc_value; + SCTP_INP_WUNLOCK(inp); } - SCTP_INP_WUNLOCK(inp); } } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:45:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0F3C1065670; Fri, 10 Feb 2012 20:45:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA1C28FC12; Fri, 10 Feb 2012 20: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 q1AKjHLS093553; Fri, 10 Feb 2012 20:45:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKjHKv093550; Fri, 10 Feb 2012 20:45:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102045.q1AKjHKv093550@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:45:17 +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: r231432 - in stable/8/lib: libc/net libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:45:18 -0000 Author: tuexen Date: Fri Feb 10 20:45:17 2012 New Revision: 231432 URL: http://svn.freebsd.org/changeset/base/231432 Log: MFC r221512: * Update copyright notice. * Cleanup usage of iov's. * Add support for SCTP_TIMEOUTS socketoption. * Fix a bug in sctp_recvmsg(): return the msg_flags in case of an error. * Fix a bug in the error handling of sctp_peeloff(): return the -1. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 20:38:44 2012 (r231431) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 20:45:17 2012 (r231432) @@ -1,33 +1,35 @@ -/* $KAME: sctp_sys_calls.c,v 1.9 2004/08/17 06:08:53 itojun Exp $ */ - -/* - * Copyright (C) 2002-2007 Cisco Systems Inc, - * All rights reserved. +/*- + * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * modification, are permitted provided that the following conditions are met: + * + * a) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * b) Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * c) Neither the name of Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); #include @@ -58,7 +60,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_CONTROL_VEC_SIZE_SND 8192 #define SCTP_CONTROL_VEC_SIZE_RCV 16384 #define SCTP_STACK_BUF_SIZE 2048 -#define SCTP_SMALL_IOVEC_SIZE 2 #ifdef SCTP_DEBUG_PRINT_ADDRESS @@ -398,6 +399,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_LOCAL_AUTH_CHUNKS: ((struct sctp_authchunks *)arg)->gauth_assoc_id = id; break; + case SCTP_TIMEOUTS: + ((struct sctp_timeouts *)arg)->stimo_assoc_id = id; + break; default: break; } @@ -551,11 +555,10 @@ sctp_sendmsg(int s, return (syscall(SYS_sctp_generic_sendmsg, s, data, len, to, tolen, &sinfo, 0)); #else - ssize_t sz; struct msghdr msg; struct sctp_sndrcvinfo *s_info; - struct iovec iov[SCTP_SMALL_IOVEC_SIZE]; + struct iovec iov; char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; struct cmsghdr *cmsg; struct sockaddr *who = NULL; @@ -564,20 +567,8 @@ sctp_sendmsg(int s, struct sockaddr_in6 in6; } addr; -/* - fprintf(io, "sctp_sendmsg(sd:%d, data:%x, len:%d, to:%x, tolen:%d, ppid:%x, flags:%x str:%d ttl:%d ctx:%x\n", - s, - (u_int)data, - (int)len, - (u_int)to, - (int)tolen, - ppid, flags, - (int)stream_no, - (int)timetolive, - (u_int)context); - fflush(io); -*/ - if ((tolen > 0) && ((to == NULL) || (tolen < sizeof(struct sockaddr)))) { + if ((tolen > 0) && + ((to == NULL) || (tolen < sizeof(struct sockaddr)))) { errno = EINVAL; return -1; } @@ -587,7 +578,8 @@ sctp_sendmsg(int s, errno = EINVAL; return -1; } - if ((to->sa_len > 0) && (to->sa_len != sizeof(struct sockaddr_in))) { + if ((to->sa_len > 0) && + (to->sa_len != sizeof(struct sockaddr_in))) { errno = EINVAL; return -1; } @@ -598,7 +590,8 @@ sctp_sendmsg(int s, errno = EINVAL; return -1; } - if ((to->sa_len > 0) && (to->sa_len != sizeof(struct sockaddr_in6))) { + if ((to->sa_len > 0) && + (to->sa_len != sizeof(struct sockaddr_in6))) { errno = EINVAL; return -1; } @@ -610,10 +603,8 @@ sctp_sendmsg(int s, } who = (struct sockaddr *)&addr; } - iov[0].iov_base = (char *)data; - iov[0].iov_len = len; - iov[1].iov_base = NULL; - iov[1].iov_len = 0; + iov.iov_base = (char *)data; + iov.iov_len = len; if (who) { msg.msg_name = (caddr_t)who; @@ -622,7 +613,7 @@ sctp_sendmsg(int s, msg.msg_name = (caddr_t)NULL; msg.msg_namelen = 0; } - msg.msg_iov = iov; + msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = (caddr_t)controlVector; @@ -681,7 +672,7 @@ sctp_send(int sd, const void *data, size #else ssize_t sz; struct msghdr msg; - struct iovec iov[SCTP_SMALL_IOVEC_SIZE]; + struct iovec iov; struct sctp_sndrcvinfo *s_info; char controlVector[SCTP_CONTROL_VEC_SIZE_SND]; struct cmsghdr *cmsg; @@ -690,14 +681,12 @@ sctp_send(int sd, const void *data, size errno = EINVAL; return (-1); } - iov[0].iov_base = (char *)data; - iov[0].iov_len = len; - iov[1].iov_base = NULL; - iov[1].iov_len = 0; + iov.iov_base = (char *)data; + iov.iov_len = len; msg.msg_name = 0; msg.msg_namelen = 0; - msg.msg_iov = iov; + msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = (caddr_t)controlVector; @@ -736,7 +725,7 @@ sctp_sendx(int sd, const void *msg, size return (-1); } #ifdef SYS_sctp_generic_sendmsg - if (addrcnt < SCTP_SMALL_IOVEC_SIZE) { + if (addrcnt == 1) { socklen_t l; /* @@ -846,18 +835,18 @@ sctp_recvmsg(int s, int *msg_flags) { #ifdef SYS_sctp_generic_recvmsg - struct iovec iov[SCTP_SMALL_IOVEC_SIZE]; + struct iovec iov; - iov[0].iov_base = dbuf; - iov[0].iov_len = len; + iov.iov_base = dbuf; + iov.iov_len = len; return (syscall(SYS_sctp_generic_recvmsg, s, - iov, 1, from, fromlen, sinfo, msg_flags)); + &iov, 1, from, fromlen, sinfo, msg_flags)); #else struct sctp_sndrcvinfo *s_info; ssize_t sz; int sinfo_found = 0; struct msghdr msg; - struct iovec iov[SCTP_SMALL_IOVEC_SIZE]; + struct iovec iov; char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; struct cmsghdr *cmsg; @@ -866,30 +855,28 @@ sctp_recvmsg(int s, return (-1); } msg.msg_flags = 0; - iov[0].iov_base = dbuf; - iov[0].iov_len = len; - iov[1].iov_base = NULL; - iov[1].iov_len = 0; + iov.iov_base = dbuf; + iov.iov_len = len; msg.msg_name = (caddr_t)from; if (fromlen == NULL) msg.msg_namelen = 0; else msg.msg_namelen = *fromlen; - msg.msg_iov = iov; + msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = (caddr_t)controlVector; msg.msg_controllen = sizeof(controlVector); errno = 0; sz = recvmsg(s, &msg, *msg_flags); - if (sz <= 0) + *msg_flags = msg.msg_flags; + if (sz <= 0) { return (sz); - + } s_info = NULL; len = sz; - *msg_flags = msg.msg_flags; - if (sinfo) + if (sinfo) { sinfo->sinfo_assoc_id = 0; - + } if ((msg.msg_controllen) && sinfo) { /* * parse through and see if we find the sctp_sndrcvinfo (if @@ -940,7 +927,7 @@ int sctp_peeloff(int sd, sctp_assoc_t assoc_id) { struct sctp_peeloff_opt peeloff; - int error; + int result; socklen_t optlen; /* set in the socket option params */ @@ -948,10 +935,9 @@ sctp_peeloff(int sd, sctp_assoc_t assoc_ peeloff.s = sd; peeloff.assoc_id = assoc_id; optlen = sizeof(peeloff); - error = getsockopt(sd, IPPROTO_SCTP, SCTP_PEELOFF, (void *)&peeloff, - &optlen); - if (error) { - errno = error; + result = getsockopt(sd, IPPROTO_SCTP, SCTP_PEELOFF, (void *)&peeloff, &optlen); + + if (result < 0) { return (-1); } else { return (peeloff.new_sd); @@ -984,4 +970,3 @@ sctp_peeloff(int sd, sctp_assoc_t assoc_ #undef SCTP_CONTROL_VEC_SIZE_SND #undef SCTP_CONTROL_VEC_SIZE_RCV #undef SCTP_STACK_BUF_SIZE -#undef SCTP_SMALL_IOVEC_SIZE From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:49:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5326106566B; Fri, 10 Feb 2012 20:49:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F41C8FC16; Fri, 10 Feb 2012 20:49: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 q1AKnIA3093721; Fri, 10 Feb 2012 20:49:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKnI32093719; Fri, 10 Feb 2012 20:49:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102049.q1AKnI32093719@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231433 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:49:18 -0000 Author: tuexen Date: Fri Feb 10 20:49:18 2012 New Revision: 231433 URL: http://svn.freebsd.org/changeset/base/231433 Log: MFC r221549: Change the name of an internal structure, since the name is used by a structure of the (new) SCTP API. Modified: stable/8/sys/netinet/sctp_auth.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_auth.h ============================================================================== --- stable/8/sys/netinet/sctp_auth.h Fri Feb 10 20:45:17 2012 (r231432) +++ stable/8/sys/netinet/sctp_auth.h Fri Feb 10 20:49:18 2012 (r231433) @@ -89,7 +89,7 @@ typedef struct sctp_hmaclist { } sctp_hmaclist_t; /* authentication info */ -typedef struct sctp_authinfo { +typedef struct sctp_authinformation { sctp_key_t *random; /* local random key (concatenated) */ uint32_t random_len; /* local random number length for param */ sctp_key_t *peer_random;/* peer's random key (concatenated) */ @@ -98,7 +98,7 @@ typedef struct sctp_authinfo { uint16_t active_keyid; /* active send keyid */ uint16_t assoc_keyid; /* current send keyid (cached) */ uint16_t recv_keyid; /* last recv keyid (cached) */ -} sctp_authinfo_t; +} sctp_authinfo_t; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:54:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 939BA106566B; Fri, 10 Feb 2012 20:54:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CBE48FC0C; Fri, 10 Feb 2012 20:54: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 q1AKsLf2093946; Fri, 10 Feb 2012 20:54:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKsLNR093932; Fri, 10 Feb 2012 20:54:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102054.q1AKsLNR093932@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:54: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: r231434 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:54:21 -0000 Author: tuexen Date: Fri Feb 10 20:54:20 2012 New Revision: 231434 URL: http://svn.freebsd.org/changeset/base/231434 Log: MFC r221627: Fix a locking issue showing up on Mac OS X when subscribing to authentication events. DTLS/SCTP renegotiations trigger the bug. Modified: stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_auth.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_auth.c Fri Feb 10 20:54:20 2012 (r231434) @@ -598,7 +598,11 @@ sctp_auth_key_acquire(struct sctp_tcb *s } void -sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id) +sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { sctp_sharedkey_t *skey; @@ -616,7 +620,7 @@ sctp_auth_key_release(struct sctp_tcb *s if ((skey->refcount <= 1) && (skey->deactivated)) { /* notify ULP that key is no longer used */ sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, - key_id, 0, SCTP_SO_LOCKED); + key_id, 0, so_locked); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u no longer used, %d\n", __FUNCTION__, stcb, key_id, skey->refcount); Modified: stable/8/sys/netinet/sctp_auth.h ============================================================================== --- stable/8/sys/netinet/sctp_auth.h Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_auth.h Fri Feb 10 20:54:20 2012 (r231434) @@ -156,7 +156,9 @@ sctp_copy_skeylist(const struct sctp_key /* ref counts on shared keys, by key id */ extern void sctp_auth_key_acquire(struct sctp_tcb *stcb, uint16_t keyid); -extern void sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid); +extern void +sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid, + int so_locked); /* hmac list handling */ Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 20:54:20 2012 (r231434) @@ -375,7 +375,7 @@ abandon: chk->data = NULL; } /* Now free the address and data */ - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } return; @@ -479,7 +479,7 @@ abandon: sctp_ucount_decr(asoc->cnt_on_reasm_queue); /* free up the chk */ chk->data = NULL; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); if (asoc->fragmented_delivery_inprogress == 0) { /* @@ -1011,7 +1011,7 @@ sctp_queue_data_for_reasm(struct sctp_tc sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } else { last_flags = at->rec.data.rcv_flags; @@ -2416,7 +2416,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_INDATA + SCTP_LOC_18); } sctp_send_shutdown(stcb, stcb->asoc.primary_destination); - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } else { int is_a_gap; @@ -2466,7 +2466,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i * there are gaps or duplicates. */ (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } } else { if (!SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { @@ -3993,7 +3993,7 @@ sctp_express_handle_sack(struct sctp_tcb SCTP_LOG_FREE_SENT); } asoc->sent_queue_cnt--; - sctp_free_a_chunk(stcb, tp1); + sctp_free_a_chunk(stcb, tp1, SCTP_SO_NOT_LOCKED); } else { break; } @@ -4709,7 +4709,7 @@ sctp_handle_sack(struct mbuf *m, int off 0, SCTP_LOG_FREE_SENT); } - sctp_free_a_chunk(stcb, tp1); + sctp_free_a_chunk(stcb, tp1, SCTP_SO_NOT_LOCKED); wake_him++; } if (TAILQ_EMPTY(&asoc->sent_queue) && (asoc->total_flight > 0)) { @@ -5260,7 +5260,7 @@ sctp_flush_reassm_for_str_seq(struct sct sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } else if (SCTP_SSN_GT(chk->rec.data.stream_seq, seq)) { /* * If the stream_seq is > than the purging one, we @@ -5431,7 +5431,7 @@ sctp_handle_forward_tsn(struct sctp_tcb sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } else { /* * Ok we have gone beyond the end of the fwd-tsn's Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_input.c Fri Feb 10 20:54:20 2012 (r231434) @@ -193,7 +193,11 @@ outnow: */ int -sctp_is_there_unsent_data(struct sctp_tcb *stcb) +sctp_is_there_unsent_data(struct sctp_tcb *stcb, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { int unsent_data = 0; unsigned int i; @@ -242,7 +246,7 @@ sctp_is_there_unsent_data(struct sctp_tc sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); } else { unsent_data++; break; @@ -301,7 +305,7 @@ sctp_process_init(struct sctp_init_chunk chk->data = NULL; } } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } } @@ -323,7 +327,7 @@ sctp_process_init(struct sctp_init_chunk sp->net = NULL; } /* Free the chunk */ - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } } @@ -902,7 +906,7 @@ sctp_handle_shutdown(struct sctp_shutdow sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8); } /* Now is there unsent data on a stream somewhere? */ - some_on_streamwheel = sctp_is_there_unsent_data(stcb); + some_on_streamwheel = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED); if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || @@ -3127,7 +3131,7 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun chk->data = NULL; } stcb->asoc.ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); if (override == 0) { break; } @@ -3367,7 +3371,7 @@ process_chunk_drop(struct sctp_tcb *stcb case SCTP_SELECTIVE_ACK: case SCTP_NR_SELECTIVE_ACK: /* resend the sack */ - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); break; case SCTP_HEARTBEAT_REQUEST: /* resend a demand HB */ @@ -3376,7 +3380,7 @@ process_chunk_drop(struct sctp_tcb *stcb * Only retransmit if we KNOW we wont destroy the * tcb */ - (void)sctp_send_hb(stcb, 1, net); + (void)sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED); } break; case SCTP_SHUTDOWN: @@ -3547,7 +3551,7 @@ sctp_clean_up_stream_reset(struct sctp_t chk->data = NULL; } asoc->ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); /* sa_ignore NO_NULL_CHK */ stcb->asoc.str_reset = NULL; } @@ -3987,7 +3991,7 @@ strres_nochunk: sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return (ret_code); } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); Modified: stable/8/sys/netinet/sctp_input.h ============================================================================== --- stable/8/sys/netinet/sctp_input.h Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_input.h Fri Feb 10 20:54:20 2012 (r231434) @@ -53,7 +53,7 @@ sctp_reset_in_stream(struct sctp_tcb *st uint16_t * list); -int sctp_is_there_unsent_data(struct sctp_tcb *stcb); +int sctp_is_there_unsent_data(struct sctp_tcb *stcb, int so_locked); #endif #endif Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:54:20 2012 (r231434) @@ -6178,7 +6178,7 @@ sctp_sendall_iterator(struct sctp_inpcb /* shutdown this assoc */ int cnt; - cnt = sctp_is_there_unsent_data(stcb); + cnt = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && @@ -6425,7 +6425,7 @@ sctp_toss_old_cookies(struct sctp_tcb *s chk->data = NULL; } asoc->ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } } @@ -6454,7 +6454,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st chk->data = NULL; } asoc->ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } } @@ -6553,7 +6553,11 @@ all_done: } static void -sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_association *asoc) +sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_association *asoc, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct sctp_tmit_chunk *chk, *nchk; @@ -6580,7 +6584,7 @@ sctp_clean_up_ctl(struct sctp_tcb *stcb, asoc->ctrl_queue_cnt--; if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) asoc->fwd_tsn_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); } else if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { /* special handling, we must look into the param */ if (chk != asoc->str_reset) { @@ -6660,7 +6664,12 @@ sctp_move_to_outqueue(struct sctp_tcb *s int *locked, int *giveup, int eeor_mode, - int *bail) + int *bail, + int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { /* Move from the stream to the send_queue keeping track of the total */ struct sctp_association *asoc; @@ -6731,7 +6740,7 @@ one_more_time: sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); /* we can't be locked to it */ *locked = 0; stcb->asoc.locked_on_sending = NULL; @@ -6897,7 +6906,7 @@ dont_do_it: chk->last_mbuf = NULL; if (chk->data == NULL) { sp->some_taken = some_taken; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); *bail = 1; to_move = 0; goto out_of; @@ -7001,7 +7010,7 @@ dont_do_it: atomic_add_int(&sp->length, to_move); chk->data = NULL; *bail = 1; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); to_move = 0; goto out_of; } else { @@ -7018,7 +7027,7 @@ dont_do_it: panic("prepend failes HELP?"); #else SCTP_PRINTF("prepend fails HELP?\n"); - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); #endif *bail = 1; to_move = 0; @@ -7140,7 +7149,7 @@ dont_do_it: sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); /* we can't be locked to it */ *locked = 0; @@ -7163,7 +7172,11 @@ out_of: static void sctp_fill_outqueue(struct sctp_tcb *stcb, - struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now) + struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct sctp_association *asoc; struct sctp_stream_out *strq, *strqn; @@ -7200,7 +7213,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb giveup = 0; bail = 0; moved_how_much = sctp_move_to_outqueue(stcb, strq, goal_mtu, frag_point, &locked, - &giveup, eeor_mode, &bail); + &giveup, eeor_mode, &bail, so_locked); if (moved_how_much) stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, moved_how_much); @@ -7440,7 +7453,7 @@ nothing_to_send: if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, 4, SCTP_CWND_LOG_FILL_OUTQ_CALLED); } - sctp_fill_outqueue(stcb, net, frag_point, eeor_mode, &quit_now); + sctp_fill_outqueue(stcb, net, frag_point, eeor_mode, &quit_now, so_locked); if (quit_now) { /* memory alloc failure */ no_data_chunks = 1; @@ -8378,7 +8391,7 @@ no_data_fill: } else { *reason_code = 5; } - sctp_clean_up_ctl(stcb, asoc); + sctp_clean_up_ctl(stcb, asoc, so_locked); return (0); } @@ -8403,7 +8416,7 @@ sctp_queue_op_err(struct sctp_tcb *stcb, chk->copy_by_ref = 0; SCTP_BUF_PREPEND(op_err, sizeof(struct sctp_chunkhdr), M_DONTWAIT); if (op_err == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } chk->send_size = 0; @@ -8992,7 +9005,7 @@ sctp_chunk_retransmission(struct sctp_in return (0); } else { /* Clean up the fwd-tsn list */ - sctp_clean_up_ctl(stcb, asoc); + sctp_clean_up_ctl(stcb, asoc, so_locked); return (0); } } @@ -9446,7 +9459,7 @@ sctp_chunk_output(struct sctp_inpcb *inp * running, if so piggy-back the sack. */ if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { - sctp_send_sack(stcb); + sctp_send_sack(stcb, so_locked); (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); } while (asoc->sent_queue_retran_cnt) { @@ -9730,7 +9743,7 @@ send_forward_tsn(struct sctp_tcb *stcb, chk->whoTo = NULL; chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -9875,7 +9888,11 @@ sctp_fill_in_rest: } void -sctp_send_sack(struct sctp_tcb *stcb) +sctp_send_sack(struct sctp_tcb *stcb, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { /*- * Queue up a SACK or NR-SACK in the control queue. @@ -10017,7 +10034,7 @@ sctp_send_sack(struct sctp_tcb *stcb) sctp_m_freem(a_chk->data); a_chk->data = NULL; } - sctp_free_a_chunk(stcb, a_chk); + sctp_free_a_chunk(stcb, a_chk, so_locked); /* sa_ignore NO_NULL_CHK */ if (stcb->asoc.delayed_ack) { sctp_timer_stop(SCTP_TIMER_TYPE_RECV, @@ -10691,7 +10708,11 @@ sctp_select_hb_destination(struct sctp_t } int -sctp_send_hb(struct sctp_tcb *stcb, int user_req, struct sctp_nets *u_net) +sctp_send_hb(struct sctp_tcb *stcb, int user_req, struct sctp_nets *u_net, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct sctp_tmit_chunk *chk; struct sctp_nets *net; @@ -10747,7 +10768,7 @@ sctp_send_hb(struct sctp_tcb *stcb, int chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); return (0); } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -10836,7 +10857,7 @@ sctp_send_hb(struct sctp_tcb *stcb, int sctp_free_remote_addr(chk->whoTo); chk->whoTo = NULL; } - sctp_free_a_chunk((struct sctp_tcb *)NULL, chk); + sctp_free_a_chunk((struct sctp_tcb *)NULL, chk, so_locked); return (-1); } } @@ -10892,7 +10913,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb chk->send_size = sizeof(struct sctp_ecne_chunk); chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -10955,7 +10976,7 @@ sctp_send_packet_dropped(struct sctp_tcb chk->copy_by_ref = 0; iph = mtod(m, struct ip *); if (iph == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } switch (iph->ip_v) { @@ -10995,7 +11016,7 @@ sctp_send_packet_dropped(struct sctp_tcb * INIT-ACK, because we can't know if the initiation * tag is correct or not. */ - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; default: break; @@ -11018,7 +11039,7 @@ sctp_send_packet_dropped(struct sctp_tcb chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); if (chk->data == NULL) { jump_out: - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -11129,7 +11150,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str chk->send_size = sizeof(struct sctp_cwr_chunk); chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -11418,7 +11439,7 @@ sctp_send_str_reset_req(struct sctp_tcb chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } @@ -12108,7 +12129,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, *error = sctp_copy_one(sp, uio, resv_in_first); skip_copy: if (*error) { - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); sp = NULL; } else { if (sp->sinfo_flags & SCTP_ADDR_OVER) { @@ -13206,7 +13227,7 @@ dataless_eof: SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - cnt = sctp_is_there_unsent_data(stcb); + cnt = sctp_is_there_unsent_data(stcb, SCTP_SO_LOCKED); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (cnt == 0)) { Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 20:54:20 2012 (r231434) @@ -152,9 +152,9 @@ sctp_send_abort_tcb(struct sctp_tcb *, s void send_forward_tsn(struct sctp_tcb *, struct sctp_association *); -void sctp_send_sack(struct sctp_tcb *); +void sctp_send_sack(struct sctp_tcb *, int); -int sctp_send_hb(struct sctp_tcb *, int, struct sctp_nets *); +int sctp_send_hb(struct sctp_tcb *, int, struct sctp_nets *, int); void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t); Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 20:54:20 2012 (r231434) @@ -4988,7 +4988,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } sctp_free_spbufspace(stcb, asoc, sp); if (sp->holds_key_ref) - sctp_auth_key_release(stcb, sp->auth_keyid); + sctp_auth_key_release(stcb, sp->auth_keyid, SCTP_SO_LOCKED); /* Free the zone stuff */ SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_strmoq), sp); SCTP_DECR_STRMOQ_COUNT(); @@ -5021,7 +5021,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); atomic_subtract_int(&SCTP_BASE_INFO(ipi_free_chunks), 1); @@ -5043,7 +5043,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); if (chk->whoTo) { sctp_free_remote_addr(chk->whoTo); chk->whoTo = NULL; @@ -5067,7 +5067,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -5081,7 +5081,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -5095,7 +5095,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -5108,7 +5108,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -6895,7 +6895,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } /* Ok that was fun, now we will drain all the inbound streams? */ @@ -6958,7 +6958,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, asoc->last_revoke_count = cnt; (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); /* sa_ignore NO_NULL_CHK */ - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_DRAIN, SCTP_SO_NOT_LOCKED); reneged_asoc_ids[reneged_at] = sctp_get_associd(stcb); reneged_at++; Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_timer.c Fri Feb 10 20:54:20 2012 (r231434) @@ -597,7 +597,7 @@ sctp_recover_sent_list(struct sctp_tcb * } } asoc->sent_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } SCTP_PRINTF("after recover order is as follows\n"); @@ -1056,7 +1056,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * no recent feed back in an RTO or * more, request a RTT update */ - if (sctp_send_hb(stcb, 1, net) < 0) + if (sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED) < 0) /* * Less than 0 means we lost * the assoc @@ -1120,7 +1120,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * but is in PF state, a PF-heartbeat needs to be sent * manually. */ - if (sctp_send_hb(stcb, 1, net) < 0) + if (sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED) < 0) /* Return less than 0 means we lost the association */ return (1); } @@ -1598,7 +1598,7 @@ sctp_heartbeat_timer(struct sctp_inpcb * } /* Send a new HB, this will do threshold managment, pick a new dest */ if (cnt_of_unconf == 0) { - if (sctp_send_hb(stcb, 0, NULL) < 0) { + if (sctp_send_hb(stcb, 0, NULL, SCTP_SO_NOT_LOCKED) < 0) { return (1); } } else { @@ -1620,7 +1620,7 @@ sctp_heartbeat_timer(struct sctp_inpcb * net->src_addr_selected = 0; } } - ret = sctp_send_hb(stcb, 1, net); + ret = sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED); if (ret < 0) return 1; else if (ret == 0) { Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 20:54:20 2012 (r231434) @@ -3988,7 +3988,7 @@ sctp_setopt(struct socket *so, int optna /************************NET SPECIFIC SET ******************/ if (paddrp->spp_flags & SPP_HB_DEMAND) { /* on demand HB */ - if (sctp_send_hb(stcb, 1, net) < 0) { + if (sctp_send_hb(stcb, 1, net, SCTP_SO_LOCKED) < 0) { /* asoc destroyed */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; Modified: stable/8/sys/netinet/sctp_var.h ============================================================================== --- stable/8/sys/netinet/sctp_var.h Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctp_var.h Fri Feb 10 20:54:20 2012 (r231434) @@ -87,9 +87,9 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } -#define sctp_free_a_strmoq(_stcb, _strmoq) { \ +#define sctp_free_a_strmoq(_stcb, _strmoq, _so_locked) { \ if ((_strmoq)->holds_key_ref) { \ - sctp_auth_key_release(stcb, sp->auth_keyid); \ + sctp_auth_key_release(stcb, sp->auth_keyid, _so_locked); \ (_strmoq)->holds_key_ref = 0; \ } \ SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_strmoq), (_strmoq)); \ @@ -105,9 +105,9 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } -#define sctp_free_a_chunk(_stcb, _chk) { \ +#define sctp_free_a_chunk(_stcb, _chk, _so_locked) { \ if ((_chk)->holds_key_ref) {\ - sctp_auth_key_release((_stcb), (_chk)->auth_keyid); \ + sctp_auth_key_release((_stcb), (_chk)->auth_keyid, _so_locked); \ (_chk)->holds_key_ref = 0; \ } \ if (_stcb) { \ Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 20:49:18 2012 (r231433) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 20:54:20 2012 (r231434) @@ -1634,7 +1634,7 @@ sctp_timeout_handler(void *t) } { SCTP_STAT_INCR(sctps_timosack); stcb->asoc.timosack++; - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } #ifdef SCTP_AUDITING_ENABLED sctp_auditing(4, inp, stcb, net); @@ -3656,7 +3656,7 @@ sctp_report_all_outbound(struct sctp_tcb chk->data = NULL; } } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); /* sa_ignore FREED_MEMORY */ } /* pending send queue SHOULD be empty */ @@ -3672,7 +3672,7 @@ sctp_report_all_outbound(struct sctp_tcb chk->data = NULL; } } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); /* sa_ignore FREED_MEMORY */ } for (i = 0; i < asoc->streamoutcnt; i++) { @@ -3697,7 +3697,7 @@ sctp_report_all_outbound(struct sctp_tcb sp->net = NULL; } /* Free the chunk */ - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); /* sa_ignore FREED_MEMORY */ } } @@ -5033,7 +5033,7 @@ sctp_user_rcvd(struct sctp_tcb *stcb, ui goto out; } SCTP_STAT_INCR(sctps_wu_sacks_sent); - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_LOCKED); sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_USR_RCVD, SCTP_SO_LOCKED); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 20:57:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2C69106566B; Fri, 10 Feb 2012 20:57:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B257D8FC0A; Fri, 10 Feb 2012 20:57:46 +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 q1AKvkxs094106; Fri, 10 Feb 2012 20:57:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AKvkBt094103; Fri, 10 Feb 2012 20:57:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102057.q1AKvkBt094103@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 20:57:46 +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: r231435 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:57:47 -0000 Author: tuexen Date: Fri Feb 10 20:57:46 2012 New Revision: 231435 URL: http://svn.freebsd.org/changeset/base/231435 Log: MFC r221904: Fix the source address selection for boundall sockets when sending INITs to a global IPv4 address having only private IPv4 address. Allow the usage of a private address and make sure that no other private address will be used by the association. Initial work was done by rrs@. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:54:20 2012 (r231434) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:57:46 2012 (r231435) @@ -2022,7 +2022,8 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct mbuf * -sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_scoping *scope, +sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_tcb *stcb, + struct sctp_scoping *scope, struct mbuf *m_at, int cnt_inits_to) { struct sctp_vrf *vrf = NULL; @@ -2056,6 +2057,9 @@ sctp_add_addresses_to_i_ia(struct sctp_i continue; } LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) { + if (sctp_is_addr_restricted(stcb, sctp_ifap)) { + continue; + } if (sctp_is_address_in_scope(sctp_ifap, scope->ipv4_addr_legal, scope->ipv6_addr_legal, @@ -2088,6 +2092,9 @@ skip_count: continue; } LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) { + if (sctp_is_addr_restricted(stcb, sctp_ifap)) { + continue; + } if (sctp_is_address_in_scope(sctp_ifap, scope->ipv4_addr_legal, scope->ipv6_addr_legal, @@ -2295,32 +2302,46 @@ sctp_is_ifa_addr_acceptable(struct sctp_ { uint8_t dest_is_global = 0; - /* + /** * Here we determine if its a acceptable address. A acceptable * address means it is the same scope or higher scope but we can * allow for NAT which means its ok to have a global dest and a * private src. - * + * * L = loopback, P = private, G = global - * ----------------------------------------- src | dest | result - * ----------------------------------------- L | L | yes - * ----------------------------------------- P | L | - * yes-v4 no-v6 ----------------------------------------- G | - * L | yes ----------------------------------------- L | - * P | no ----------------------------------------- P | P - * | yes ----------------------------------------- G | P - * | yes - May not work ----------------------------------------- - * L | G | no ----------------------------------------- P - * | G | yes - May not work - * ----------------------------------------- G | G | yes + * ----------------------------------------- + * src | dest | result + * ----------------------------------------- + * L | L | yes + * ----------------------------------------- + * P | L | yes-v4 no-v6 + * ----------------------------------------- + * G | L | yes + * ----------------------------------------- + * L | P | no + * ----------------------------------------- + * P | P | yes + * ----------------------------------------- + * G | P | yes - May not work + * ----------------------------------------- + * L | G | no + * ----------------------------------------- + * P | G | yes - May not work + * ----------------------------------------- + * G | G | yes * ----------------------------------------- */ if (ifa->address.sa.sa_family != fam) { /* forget non matching family */ + SCTPDBG(SCTP_DEBUG_OUTPUT3, "ifa_fam:%d fam:%d\n", + ifa->address.sa.sa_family, fam); return (NULL); } /* Ok the address may be ok */ + SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT3, &ifa->address.sa); + SCTPDBG(SCTP_DEBUG_OUTPUT3, "dst_is_loop:%d dest_is_priv:%d\n", + dest_is_loop, dest_is_priv); if ((dest_is_loop == 0) && (dest_is_priv == 0)) { dest_is_global = 1; } @@ -2342,12 +2363,19 @@ sctp_is_ifa_addr_acceptable(struct sctp_ * theory be done slicker (it used to be), but this is * straightforward and easier to validate :-) */ + SCTPDBG(SCTP_DEBUG_OUTPUT3, "ifa->src_is_loop:%d dest_is_priv:%d\n", + ifa->src_is_loop, + dest_is_priv); if ((ifa->src_is_loop == 1) && (dest_is_priv)) { return (NULL); } + SCTPDBG(SCTP_DEBUG_OUTPUT3, "ifa->src_is_loop:%d dest_is_glob:%d\n", + ifa->src_is_loop, + dest_is_global); if ((ifa->src_is_loop == 1) && (dest_is_global)) { return (NULL); } + SCTPDBG(SCTP_DEBUG_OUTPUT3, "address is acceptable\n"); /* its an acceptable address */ return (ifa); } @@ -2854,6 +2882,10 @@ sctp_choose_boundall(struct sctp_inpcb * uint32_t ifn_index; struct sctp_vrf *vrf; +#ifdef INET + int retried = 0; + +#endif /*- * For boundall we can use any address in the association. * If non_asoc_addr_ok is set we can use any address (at least in @@ -2874,6 +2906,7 @@ sctp_choose_boundall(struct sctp_inpcb * ifn = SCTP_GET_IFN_VOID_FROM_ROUTE(ro); ifn_index = SCTP_GET_IF_INDEX_FROM_ROUTE(ro); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifn from route:%p ifn_index:%d\n", ifn, ifn_index); emit_ifn = looked_at = sctp_ifn = sctp_find_ifn(ifn, ifn_index); if (sctp_ifn == NULL) { /* ?? We don't have this guy ?? */ @@ -2982,22 +3015,30 @@ bound_all_plan_b: } atomic_add_int(&sifa->refcount, 1); return (sifa); - } - +#ifdef INET +again_with_private_addresses_allowed: +#endif /* plan_c: do we have an acceptable address on the emit interface */ + sifa = NULL; SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan C: find acceptable on interface\n"); if (emit_ifn == NULL) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jump to Plan D - no emit_ifn\n"); goto plan_d; } LIST_FOREACH(sctp_ifa, &emit_ifn->ifalist, next_ifa) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", sctp_ifa); if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && - (non_asoc_addr_ok == 0)) + (non_asoc_addr_ok == 0)) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Defer\n"); continue; + } sifa = sctp_is_ifa_addr_acceptable(sctp_ifa, dest_is_loop, dest_is_priv, fam); - if (sifa == NULL) + if (sifa == NULL) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "IFA not acceptable\n"); continue; + } if (stcb) { if (sctp_is_address_in_scope(sifa, stcb->asoc.ipv4_addr_legal, @@ -3006,6 +3047,8 @@ bound_all_plan_b: stcb->asoc.ipv4_local_scope, stcb->asoc.local_scope, stcb->asoc.site_scope, 0) == 0) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "NOT in scope\n"); + sifa = NULL; continue; } if (((non_asoc_addr_ok == 0) && @@ -3017,11 +3060,15 @@ bound_all_plan_b: * It is restricted for some reason.. * probably not yet added. */ + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Its resticted\n"); + sifa = NULL; continue; } + } else { + printf("Stcb is null - no print\n"); } atomic_add_int(&sifa->refcount, 1); - return (sifa); + goto out; } plan_d: /* @@ -3030,16 +3077,12 @@ plan_d: * out and see if we can find an acceptable address somewhere * amongst all interfaces. */ - SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D\n"); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D looked_at is %p\n", looked_at); LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { /* wrong base scope */ continue; } - if ((sctp_ifn == looked_at) && looked_at) - /* already looked at this guy */ - continue; - LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) @@ -3057,6 +3100,7 @@ plan_d: stcb->asoc.ipv4_local_scope, stcb->asoc.local_scope, stcb->asoc.site_scope, 0) == 0) { + sifa = NULL; continue; } if (((non_asoc_addr_ok == 0) && @@ -3068,19 +3112,81 @@ plan_d: * It is restricted for some * reason.. probably not yet added. */ + sifa = NULL; continue; } } - atomic_add_int(&sifa->refcount, 1); - return (sifa); + goto out; } } - /* - * Ok we can find NO address to source from that is not on our - * restricted list and non_asoc_address is NOT ok, or it is on our - * restricted list. We can't source to it :-( - */ - return (NULL); +#ifdef INET + if ((retried == 0) && (stcb->asoc.ipv4_local_scope == 0)) { + stcb->asoc.ipv4_local_scope = 1; + retried = 1; + goto again_with_private_addresses_allowed; + } else if (retried == 1) { + stcb->asoc.ipv4_local_scope = 0; + } +#endif +out: + if (sifa) { +#ifdef INET + if (retried == 1) { + LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { + if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { + /* wrong base scope */ + continue; + } + LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { + struct sctp_ifa *tmp_sifa; + + if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && + (non_asoc_addr_ok == 0)) + continue; + tmp_sifa = sctp_is_ifa_addr_acceptable(sctp_ifa, + dest_is_loop, + dest_is_priv, fam); + if (tmp_sifa == NULL) { + continue; + } + if (tmp_sifa == sifa) { + continue; + } + if (stcb) { + if (sctp_is_address_in_scope(tmp_sifa, + stcb->asoc.ipv4_addr_legal, + stcb->asoc.ipv6_addr_legal, + stcb->asoc.loopback_scope, + stcb->asoc.ipv4_local_scope, + stcb->asoc.local_scope, + stcb->asoc.site_scope, 0) == 0) { + continue; + } + if (((non_asoc_addr_ok == 0) && + (sctp_is_addr_restricted(stcb, tmp_sifa))) || + (non_asoc_addr_ok && + (sctp_is_addr_restricted(stcb, tmp_sifa)) && + (!sctp_is_addr_pending(stcb, tmp_sifa)))) { + /* + * It is restricted + * for some reason.. + * probably not yet + * added. + */ + continue; + } + } + if ((tmp_sifa->address.sin.sin_family == AF_INET) && + (IN4_ISPRIVATE_ADDRESS(&(tmp_sifa->address.sin.sin_addr)))) { + sctp_add_local_addr_restricted(stcb, tmp_sifa); + } + } + } + } + atomic_add_int(&sifa->refcount, 1); + } +#endif + return (sifa); } @@ -3106,7 +3212,7 @@ sctp_source_address_selection(struct sct #endif - /*- + /** * Rules: - Find the route if needed, cache if I can. - Look at * interface address in route, Is it in the bound list. If so we * have the best source. - If not we must rotate amongst the @@ -3509,15 +3615,17 @@ sctp_lowlevel_chunk_output(struct sctp_i ) /* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ { - /* - * Given a mbuf chain (via SCTP_BUF_NEXT()) that holds a packet - * header WITH an SCTPHDR but no IP header, endpoint inp and sa - * structure: - fill in the HMAC digest of any AUTH chunk in the - * packet. - calculate and fill in the SCTP checksum. - prepend an - * IP address header. - if boundall use INADDR_ANY. - if - * boundspecific do source address selection. - set fragmentation - * option for ipV4. - On return from IP output, check/adjust mtu - * size of output interface and smallest_mtu size as well. + /** + * Given a mbuf chain (via SCTP_BUF_NEXT()) that holds a packet header + * WITH an SCTPHDR but no IP header, endpoint inp and sa structure: + * - fill in the HMAC digest of any AUTH chunk in the packet. + * - calculate and fill in the SCTP checksum. + * - prepend an IP address header. + * - if boundall use INADDR_ANY. + * - if boundspecific do source address selection. + * - set fragmentation option for ipV4. + * - On return from IP output, check/adjust mtu size of output + * interface and smallest_mtu size as well. */ /* Will need ifdefs around this */ struct mbuf *o_pak; @@ -4409,7 +4517,7 @@ sctp_send_initiate(struct sctp_inpcb *in scp.local_scope = stcb->asoc.local_scope; scp.site_scope = stcb->asoc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, &scp, m_at, cnt_inits_to); + m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); } /* calulate the size and update pkt header and chunk header */ @@ -5538,7 +5646,7 @@ do_a_abort: scp.ipv4_local_scope = stc.ipv4_scope; scp.local_scope = stc.local_scope; scp.site_scope = stc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, &scp, m_at, cnt_inits_to); + m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); } /* tack on the operational error if present */ Modified: stable/8/sys/netinet/sctp_output.h ============================================================================== --- stable/8/sys/netinet/sctp_output.h Fri Feb 10 20:54:20 2012 (r231434) +++ stable/8/sys/netinet/sctp_output.h Fri Feb 10 20:57:46 2012 (r231435) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); struct mbuf * sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, + struct sctp_tcb *stcb, struct sctp_scoping *scope, struct mbuf *m_at, int cnt_inits_to); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 21:01:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E0EC106566B; Fri, 10 Feb 2012 21:01:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0AA08FC08; Fri, 10 Feb 2012 21:01: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 q1AL163x094288; Fri, 10 Feb 2012 21:01:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL16Pm094286; Fri, 10 Feb 2012 21:01:06 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102101.q1AL16Pm094286@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:01:06 +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: r231436 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:01:07 -0000 Author: tuexen Date: Fri Feb 10 21:01:06 2012 New Revision: 231436 URL: http://svn.freebsd.org/changeset/base/231436 Log: MFC r222028: Fix whitespacing. Reported by scf@ Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 20:57:46 2012 (r231435) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:01:06 2012 (r231436) @@ -2210,26 +2210,26 @@ sctp_is_ifa_addr_preferred(struct sctp_i * means it is the same scope or higher scope then the destination. * L = loopback, P = private, G = global * ----------------------------------------- - * src | dest | result - * ---------------------------------------- - * L | L | yes - * ----------------------------------------- - * P | L | yes-v4 no-v6 - * ----------------------------------------- - * G | L | yes-v4 no-v6 - * ----------------------------------------- - * L | P | no - * ----------------------------------------- - * P | P | yes - * ----------------------------------------- - * G | P | no - * ----------------------------------------- - * L | G | no - * ----------------------------------------- - * P | G | no - * ----------------------------------------- - * G | G | yes - * ----------------------------------------- + * src | dest | result + * ---------------------------------------- + * L | L | yes + * ----------------------------------------- + * P | L | yes-v4 no-v6 + * ----------------------------------------- + * G | L | yes-v4 no-v6 + * ----------------------------------------- + * L | P | no + * ----------------------------------------- + * P | P | yes + * ----------------------------------------- + * G | P | no + * ----------------------------------------- + * L | G | no + * ----------------------------------------- + * P | G | no + * ----------------------------------------- + * G | G | yes + * ----------------------------------------- */ if (ifa->address.sa.sa_family != fam) { @@ -2310,14 +2310,14 @@ sctp_is_ifa_addr_acceptable(struct sctp_ * * L = loopback, P = private, G = global * ----------------------------------------- - * src | dest | result + * src | dest | result * ----------------------------------------- * L | L | yes * ----------------------------------------- * P | L | yes-v4 no-v6 * ----------------------------------------- * G | L | yes - * ----------------------------------------- + * ----------------------------------------- * L | P | no * ----------------------------------------- * P | P | yes @@ -2325,7 +2325,7 @@ sctp_is_ifa_addr_acceptable(struct sctp_ * G | P | yes - May not work * ----------------------------------------- * L | G | no - * ----------------------------------------- + * ----------------------------------------- * P | G | yes - May not work * ----------------------------------------- * G | G | yes From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 21:03:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF4581065672; Fri, 10 Feb 2012 21:03:04 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A80698FC08; Fri, 10 Feb 2012 21:03:04 +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 q1AL34UT094422; Fri, 10 Feb 2012 21:03:04 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL34XZ094418; Fri, 10 Feb 2012 21:03:04 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202102103.q1AL34XZ094418@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 10 Feb 2012 21:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231437 - in head/sys: conf dev/oce modules modules/oce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:03:04 -0000 Author: luigi Date: Fri Feb 10 21:03:04 2012 New Revision: 231437 URL: http://svn.freebsd.org/changeset/base/231437 Log: Add a driver for Emulex OneConnect ethernet cards (10 Gbit PCIe) A manpage will come in a future commit. Submitted by: Naresh Raju Gottumukkala (emulex) Added: head/sys/dev/oce/ head/sys/dev/oce/oce_hw.c (contents, props changed) head/sys/dev/oce/oce_hw.h (contents, props changed) head/sys/dev/oce/oce_if.c (contents, props changed) head/sys/dev/oce/oce_if.h (contents, props changed) head/sys/dev/oce/oce_mbox.c (contents, props changed) head/sys/dev/oce/oce_queue.c (contents, props changed) head/sys/dev/oce/oce_sysctl.c (contents, props changed) head/sys/dev/oce/oce_util.c (contents, props changed) head/sys/modules/oce/ head/sys/modules/oce/Makefile (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Feb 10 21:01:06 2012 (r231436) +++ head/sys/conf/NOTES Fri Feb 10 21:03:04 2012 (r231437) @@ -1972,6 +1972,7 @@ device xmphy # XaQti XMAC II # SMC EZ Card 1000 (SMC9462TX), D-Link DGE-500T, Asante FriendlyNet # GigaNIX 1000TA and 1000TPC, the Addtron AEG320T, the Surecom # EP-320G-TX and the Netgear GA622T. +# oce: Emulex 10 Gbit adapters (OneConnect Ethernet) # pcn: Support for PCI fast ethernet adapters based on the AMD Am79c97x # PCnet-FAST, PCnet-FAST+, PCnet-FAST III, PCnet-PRO and PCnet-Home # chipsets. These can also be handled by the le(4) driver if the @@ -2112,6 +2113,7 @@ device ixgbe # Intel Pro/10Gbe PCIE Et device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device nxge # Neterion Xframe 10GbE Server/Storage Adapter +device oce # Emulex 10 GbE (OneConnect Ethernet) device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Feb 10 21:01:06 2012 (r231436) +++ head/sys/conf/files Fri Feb 10 21:03:04 2012 (r231437) @@ -1068,6 +1068,12 @@ dev/e1000/e1000_mbx.c optional em | igb compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_osdep.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/oce/oce_hw.c optional oce pci +dev/oce/oce_if.c optional oce pci +dev/oce/oce_mbox.c optional oce pci +dev/oce/oce_queue.c optional oce pci +dev/oce/oce_sysctl.c optional oce pci +dev/oce/oce_util.c optional oce pci dev/et/if_et.c optional et dev/en/if_en_pci.c optional en pci dev/en/midway.c optional en Added: head/sys/dev/oce/oce_hw.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/oce/oce_hw.c Fri Feb 10 21:03:04 2012 (r231437) @@ -0,0 +1,588 @@ +/*- + * Copyright (C) 2012 Emulex + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the Emulex Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Contact Information: + * freebsd-drivers@emulex.com + * + * Emulex + * 3333 Susan Street + * Costa Mesa, CA 92626 + */ + +/* $FreeBSD$ */ + +#include "oce_if.h" + +static int oce_POST(POCE_SOFTC sc); + +/** + * @brief Function to post status + * @param sc software handle to the device + */ +static int +oce_POST(POCE_SOFTC sc) +{ + mpu_ep_semaphore_t post_status; + int tmo = 60000; + + /* read semaphore CSR */ + post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + + /* if host is ready then wait for fw ready else send POST */ + if (post_status.bits.stage <= POST_STAGE_AWAITING_HOST_RDY) { + post_status.bits.stage = POST_STAGE_CHIP_RESET; + OCE_WRITE_REG32(sc, csr, MPU_EP_SEMAPHORE(sc), post_status.dw0); + } + + /* wait for FW ready */ + for (;;) { + if (--tmo == 0) + break; + + DELAY(1000); + + post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + if (post_status.bits.error) { + device_printf(sc->dev, + "POST failed: %x\n", post_status.dw0); + return ENXIO; + } + if (post_status.bits.stage == POST_STAGE_ARMFW_READY) + return 0; + } + + device_printf(sc->dev, "POST timed out: %x\n", post_status.dw0); + + return ENXIO; +} + +/** + * @brief Function for hardware initialization + * @param sc software handle to the device + */ +int +oce_hw_init(POCE_SOFTC sc) +{ + int rc = 0; + + rc = oce_POST(sc); + if (rc) + return rc; + + /* create the bootstrap mailbox */ + rc = oce_dma_alloc(sc, sizeof(struct oce_bmbx), &sc->bsmbx, 0); + if (rc) { + device_printf(sc->dev, "Mailbox alloc failed\n"); + return rc; + } + + rc = oce_reset_fun(sc); + if (rc) + goto error; + + + rc = oce_mbox_init(sc); + if (rc) + goto error; + + + rc = oce_get_fw_version(sc); + if (rc) + goto error; + + + rc = oce_get_fw_config(sc); + if (rc) + goto error; + + + sc->macaddr.size_of_struct = 6; + rc = oce_read_mac_addr(sc, 0, 1, MAC_ADDRESS_TYPE_NETWORK, + &sc->macaddr); + if (rc) + goto error; + + if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE3)) { + rc = oce_mbox_check_native_mode(sc); + if (rc) + goto error; + } else + sc->be3_native = 0; + + return rc; + +error: + oce_dma_free(sc, &sc->bsmbx); + device_printf(sc->dev, "Hardware initialisation failed\n"); + return rc; +} + + + +/** + * @brief Releases the obtained pci resources + * @param sc software handle to the device + */ +void +oce_hw_pci_free(POCE_SOFTC sc) +{ + int pci_cfg_barnum = 0; + + if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE2)) + pci_cfg_barnum = OCE_DEV_BE2_CFG_BAR; + else + pci_cfg_barnum = OCE_DEV_CFG_BAR; + + if (sc->devcfg_res != NULL) { + bus_release_resource(sc->dev, + SYS_RES_MEMORY, + PCIR_BAR(pci_cfg_barnum), sc->devcfg_res); + sc->devcfg_res = (struct resource *)NULL; + sc->devcfg_btag = (bus_space_tag_t) 0; + sc->devcfg_bhandle = (bus_space_handle_t)0; + sc->devcfg_vhandle = (void *)NULL; + } + + if (sc->csr_res != NULL) { + bus_release_resource(sc->dev, + SYS_RES_MEMORY, + PCIR_BAR(OCE_PCI_CSR_BAR), sc->csr_res); + sc->csr_res = (struct resource *)NULL; + sc->csr_btag = (bus_space_tag_t)0; + sc->csr_bhandle = (bus_space_handle_t)0; + sc->csr_vhandle = (void *)NULL; + } + + if (sc->db_res != NULL) { + bus_release_resource(sc->dev, + SYS_RES_MEMORY, + PCIR_BAR(OCE_PCI_DB_BAR), sc->db_res); + sc->db_res = (struct resource *)NULL; + sc->db_btag = (bus_space_tag_t)0; + sc->db_bhandle = (bus_space_handle_t)0; + sc->db_vhandle = (void *)NULL; + } +} + + + + +/** + * @brief Function to get the PCI capabilities + * @param sc software handle to the device + */ +static +void oce_get_pci_capabilities(POCE_SOFTC sc) +{ + uint32_t val; + + if (pci_find_extcap(sc->dev, PCIY_PCIX, &val) == 0) { + if (val != 0) + sc->flags |= OCE_FLAGS_PCIX; + } + + if (pci_find_extcap(sc->dev, PCIY_EXPRESS, &val) == 0) { + if (val != 0) { + uint16_t link_status = + pci_read_config(sc->dev, val + 0x12, 2); + + sc->flags |= OCE_FLAGS_PCIE; + sc->pcie_link_speed = link_status & 0xf; + sc->pcie_link_width = (link_status >> 4) & 0x3f; + } + } + + if (pci_find_extcap(sc->dev, PCIY_MSI, &val) == 0) { + if (val != 0) + sc->flags |= OCE_FLAGS_MSI_CAPABLE; + } + + if (pci_find_extcap(sc->dev, PCIY_MSIX, &val) == 0) { + if (val != 0) { + val = pci_msix_count(sc->dev); + sc->flags |= OCE_FLAGS_MSIX_CAPABLE; + } + } +} + +/** + * @brief Allocate PCI resources. + * + * @param sc software handle to the device + * @returns 0 if successful, or error + */ +int +oce_hw_pci_alloc(POCE_SOFTC sc) +{ + int rr, pci_cfg_barnum = 0; + pci_sli_intf_t intf; + + pci_enable_busmaster(sc->dev); + + oce_get_pci_capabilities(sc); + + sc->fn = pci_get_function(sc->dev); + + /* setup the device config region */ + if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE2)) + pci_cfg_barnum = OCE_DEV_BE2_CFG_BAR; + else + pci_cfg_barnum = OCE_DEV_CFG_BAR; + + rr = PCIR_BAR(pci_cfg_barnum); + + if (IS_BE(sc)) + sc->devcfg_res = bus_alloc_resource_any(sc->dev, + SYS_RES_MEMORY, &rr, + RF_ACTIVE|RF_SHAREABLE); + else + sc->devcfg_res = bus_alloc_resource(sc->dev, + SYS_RES_MEMORY, &rr, + 0ul, ~0ul, 32768, + RF_ACTIVE|RF_SHAREABLE); + + if (!sc->devcfg_res) + goto error; + + sc->devcfg_btag = rman_get_bustag(sc->devcfg_res); + sc->devcfg_bhandle = rman_get_bushandle(sc->devcfg_res); + sc->devcfg_vhandle = rman_get_virtual(sc->devcfg_res); + + /* Read the SLI_INTF register and determine whether we + * can use this port and its features + */ + intf.dw0 = pci_read_config((sc)->dev,OCE_INTF_REG_OFFSET,4); + + if (intf.bits.sli_valid != OCE_INTF_VALID_SIG) + goto error; + + if (intf.bits.sli_rev != OCE_INTF_SLI_REV4) { + device_printf(sc->dev, "Adapter doesnt support SLI4\n"); + goto error; + } + + if (intf.bits.sli_if_type == OCE_INTF_IF_TYPE_1) + sc->flags |= OCE_FLAGS_MBOX_ENDIAN_RQD; + + if (intf.bits.sli_hint1 == OCE_INTF_FUNC_RESET_REQD) + sc->flags |= OCE_FLAGS_FUNCRESET_RQD; + + if (intf.bits.sli_func_type == OCE_INTF_VIRT_FUNC) + sc->flags |= OCE_FLAGS_VIRTUAL_PORT; + + /* Lancer has one BAR (CFG) but BE3 has three (CFG, CSR, DB) */ + if (IS_BE(sc)) { + /* set up CSR region */ + rr = PCIR_BAR(OCE_PCI_CSR_BAR); + sc->csr_res = bus_alloc_resource_any(sc->dev, + SYS_RES_MEMORY, &rr, RF_ACTIVE|RF_SHAREABLE); + if (!sc->csr_res) + goto error; + sc->csr_btag = rman_get_bustag(sc->csr_res); + sc->csr_bhandle = rman_get_bushandle(sc->csr_res); + sc->csr_vhandle = rman_get_virtual(sc->csr_res); + + /* set up DB doorbell region */ + rr = PCIR_BAR(OCE_PCI_DB_BAR); + sc->db_res = bus_alloc_resource_any(sc->dev, + SYS_RES_MEMORY, &rr, RF_ACTIVE|RF_SHAREABLE); + if (!sc->db_res) + goto error; + sc->db_btag = rman_get_bustag(sc->db_res); + sc->db_bhandle = rman_get_bushandle(sc->db_res); + sc->db_vhandle = rman_get_virtual(sc->db_res); + } + + return 0; + +error: + oce_hw_pci_free(sc); + return ENXIO; +} + + +/** + * @brief Function for device shutdown + * @param sc software handle to the device + * @returns 0 on success, error otherwise + */ +void +oce_hw_shutdown(POCE_SOFTC sc) +{ + + oce_stats_free(sc); + /* disable hardware interrupts */ + oce_hw_intr_disable(sc); + /* Free LRO resources */ + oce_free_lro(sc); + /* Release queue*/ + oce_queue_release_all(sc); + /*Delete Network Interface*/ + oce_delete_nw_interface(sc); + /* After fw clean we dont send any cmds to fw.*/ + oce_fw_clean(sc); + /* release intr resources */ + oce_intr_free(sc); + /* release PCI resources */ + oce_hw_pci_free(sc); + /* free mbox specific resources */ + LOCK_DESTROY(&sc->bmbx_lock); + LOCK_DESTROY(&sc->dev_lock); + + oce_dma_free(sc, &sc->bsmbx); +} + + +/** + * @brief Function for creating nw interface. + * @param sc software handle to the device + * @returns 0 on success, error otherwise + */ +int +oce_create_nw_interface(POCE_SOFTC sc) +{ + int rc; + uint32_t capab_flags; + uint32_t capab_en_flags; + + /* interface capabilities to give device when creating interface */ + capab_flags = OCE_CAPAB_FLAGS; + + /* capabilities to enable by default (others set dynamically) */ + capab_en_flags = OCE_CAPAB_ENABLE; + + if (IS_XE201(sc)) { + /* LANCER A0 workaround */ + capab_en_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR; + capab_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR; + } + + /* enable capabilities controlled via driver startup parameters */ + if (sc->rss_enable) + capab_en_flags |= MBX_RX_IFACE_FLAGS_RSS; + else { + capab_en_flags &= ~MBX_RX_IFACE_FLAGS_RSS; + capab_flags &= ~MBX_RX_IFACE_FLAGS_RSS; + } + + rc = oce_if_create(sc, + capab_flags, + capab_en_flags, + 0, &sc->macaddr.mac_addr[0], &sc->if_id); + if (rc) + return rc; + + atomic_inc_32(&sc->nifs); + + sc->if_cap_flags = capab_en_flags; + + /* Enable VLAN Promisc on HW */ + rc = oce_config_vlan(sc, (uint8_t) sc->if_id, NULL, 0, 1, 1); + if (rc) + goto error; + + /* set default flow control */ + rc = oce_set_flow_control(sc, sc->flow_control); + if (rc) + goto error; + + rc = oce_rxf_set_promiscuous(sc, sc->promisc); + if (rc) + goto error; + + return rc; + +error: + oce_delete_nw_interface(sc); + return rc; + +} + +/** + * @brief Function to delete a nw interface. + * @param sc software handle to the device + */ +void +oce_delete_nw_interface(POCE_SOFTC sc) +{ + /* currently only single interface is implmeneted */ + if (sc->nifs > 0) { + oce_if_del(sc, sc->if_id); + atomic_dec_32(&sc->nifs); + } +} + +/** + * @brief Soft reset. + * @param sc software handle to the device + * @returns 0 on success, error otherwise + */ +int +oce_pci_soft_reset(POCE_SOFTC sc) +{ + int rc; + mpu_ep_control_t ctrl; + + ctrl.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_CONTROL); + ctrl.bits.cpu_reset = 1; + OCE_WRITE_REG32(sc, csr, MPU_EP_CONTROL, ctrl.dw0); + DELAY(50); + rc=oce_POST(sc); + + return rc; +} + +/** + * @brief Function for hardware start + * @param sc software handle to the device + * @returns 0 on success, error otherwise + */ +int +oce_hw_start(POCE_SOFTC sc) +{ + struct link_status link = { 0 }; + int rc = 0; + + rc = oce_get_link_status(sc, &link); + if (rc) + return 1; + + if (link.logical_link_status == NTWK_LOGICAL_LINK_UP) { + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->link_status = NTWK_LOGICAL_LINK_UP; + if_link_state_change(sc->ifp, LINK_STATE_UP); + } else { + sc->ifp->if_drv_flags &= + ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->link_status = NTWK_LOGICAL_LINK_DOWN; + if_link_state_change(sc->ifp, LINK_STATE_DOWN); + } + + if (link.mac_speed > 0 && link.mac_speed < 5) + sc->link_speed = link.mac_speed; + else + sc->link_speed = 0; + + sc->qos_link_speed = (uint32_t )link.qos_link_speed * 10; + + rc = oce_start_mq(sc->mq); + + /* we need to get MCC aync events. + So enable intrs and also arm first EQ + */ + oce_hw_intr_enable(sc); + oce_arm_eq(sc, sc->eq[0]->eq_id, 0, TRUE, FALSE); + + return rc; +} + + +/** + * @brief Function for hardware enable interupts. + * @param sc software handle to the device + */ +void +oce_hw_intr_enable(POCE_SOFTC sc) +{ + uint32_t reg; + + reg = OCE_READ_REG32(sc, devcfg, PCICFG_INTR_CTRL); + reg |= HOSTINTR_MASK; + OCE_WRITE_REG32(sc, devcfg, PCICFG_INTR_CTRL, reg); + +} + + +/** + * @brief Function for hardware disable interupts + * @param sc software handle to the device + */ +void +oce_hw_intr_disable(POCE_SOFTC sc) +{ + uint32_t reg; + + reg = OCE_READ_REG32(sc, devcfg, PCICFG_INTR_CTRL); + reg &= ~HOSTINTR_MASK; + OCE_WRITE_REG32(sc, devcfg, PCICFG_INTR_CTRL, reg); +} + + + +/** + * @brief Function for hardware update multicast filter + * @param sc software handle to the device + */ +int +oce_hw_update_multicast(POCE_SOFTC sc) +{ + struct ifnet *ifp = sc->ifp; + struct ifmultiaddr *ifma; + struct mbx_set_common_iface_multicast *req = NULL; + OCE_DMA_MEM dma; + int rc = 0; + + /* Allocate DMA mem*/ + if (oce_dma_alloc(sc, sizeof(struct mbx_set_common_iface_multicast), + &dma, 0)) + return ENOMEM; + + req = OCE_DMAPTR(&dma, struct mbx_set_common_iface_multicast); + bzero(req, sizeof(struct mbx_set_common_iface_multicast)); + +#if __FreeBSD_version > 800000 + IF_ADDR_LOCK(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + + if (req->params.req.num_mac == OCE_MAX_MC_FILTER_SIZE) { + /*More multicast addresses than our hardware table + So Enable multicast promiscus in our hardware to + accept all multicat packets + */ + req->params.req.promiscuous = 1; + break; + } + bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), + &req->params.req.mac[req->params.req.num_mac], + ETH_ADDR_LEN); + req->params.req.num_mac = req->params.req.num_mac + 1; + } +#if __FreeBSD_version > 800000 +IF_ADDR_UNLOCK(ifp); +#endif + req->params.req.if_id = sc->if_id; + rc = oce_update_multicast(sc, &dma); + oce_dma_free(sc, &dma); + return rc; +} + Added: head/sys/dev/oce/oce_hw.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/oce/oce_hw.h Fri Feb 10 21:03:04 2012 (r231437) @@ -0,0 +1,3381 @@ +/*- + * Copyright (C) 2012 Emulex + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the Emulex Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Contact Information: + * freebsd-drivers@emulex.com + * + * Emulex + * 3333 Susan Street + * Costa Mesa, CA 92626 + */ + +/* $FreeBSD$ */ + +#include + +#undef _BIG_ENDIAN /* TODO */ +#pragma pack(1) + +#define OC_CNA_GEN2 0x2 +#define OC_CNA_GEN3 0x3 +#define DEVID_TIGERSHARK 0x700 +#define DEVID_TOMCAT 0x710 + +/* PCI CSR offsets */ +#define PCICFG_F1_CSR 0x0 /* F1 for NIC */ +#define PCICFG_SEMAPHORE 0xbc +#define PCICFG_SOFT_RESET 0x5c +#define PCICFG_UE_STATUS_HI_MASK 0xac +#define PCICFG_UE_STATUS_LO_MASK 0xa8 +#define PCICFG_ONLINE0 0xb0 +#define PCICFG_ONLINE1 0xb4 +#define INTR_EN 0x20000000 +#define IMAGE_TRANSFER_SIZE (32 * 1024) /* 32K at a time */ + +/* CSR register offsets */ +#define MPU_EP_CONTROL 0 +#define MPU_EP_SEMAPHORE_BE3 0xac +#define MPU_EP_SEMAPHORE_XE201 0x400 +#define MPU_EP_SEMAPHORE(sc) \ + ((IS_BE(sc)) ? MPU_EP_SEMAPHORE_BE3 : MPU_EP_SEMAPHORE_XE201) +#define PCICFG_INTR_CTRL 0xfc +#define HOSTINTR_MASK (1 << 29) +#define HOSTINTR_PFUNC_SHIFT 26 +#define HOSTINTR_PFUNC_MASK 7 + +/* POST status reg struct */ +#define POST_STAGE_POWER_ON_RESET 0x00 +#define POST_STAGE_AWAITING_HOST_RDY 0x01 +#define POST_STAGE_HOST_RDY 0x02 +#define POST_STAGE_CHIP_RESET 0x03 +#define POST_STAGE_ARMFW_READY 0xc000 +#define POST_STAGE_ARMFW_UE 0xf000 + +/* DOORBELL registers */ +#define PD_RXULP_DB 0x0100 +#define PD_TXULP_DB 0x0060 +#define DB_RQ_ID_MASK 0x3FF + +#define PD_CQ_DB 0x0120 +#define PD_EQ_DB PD_CQ_DB +#define PD_MPU_MBOX_DB 0x0160 +#define PD_MQ_DB 0x0140 + +/* EQE completion types */ +#define EQ_MINOR_CODE_COMPLETION 0x00 +#define EQ_MINOR_CODE_OTHER 0x01 +#define EQ_MAJOR_CODE_COMPLETION 0x00 + +/* Link Status field values */ +#define PHY_LINK_FAULT_NONE 0x0 +#define PHY_LINK_FAULT_LOCAL 0x01 +#define PHY_LINK_FAULT_REMOTE 0x02 + +#define PHY_LINK_SPEED_ZERO 0x0 /* No link */ +#define PHY_LINK_SPEED_10MBPS 0x1 /* (10 Mbps) */ +#define PHY_LINK_SPEED_100MBPS 0x2 /* (100 Mbps) */ +#define PHY_LINK_SPEED_1GBPS 0x3 /* (1 Gbps) */ +#define PHY_LINK_SPEED_10GBPS 0x4 /* (10 Gbps) */ + +#define PHY_LINK_DUPLEX_NONE 0x0 +#define PHY_LINK_DUPLEX_HALF 0x1 +#define PHY_LINK_DUPLEX_FULL 0x2 + +#define NTWK_PORT_A 0x0 /* (Port A) */ +#define NTWK_PORT_B 0x1 /* (Port B) */ + +#define PHY_LINK_SPEED_ZERO 0x0 /* (No link.) */ +#define PHY_LINK_SPEED_10MBPS 0x1 /* (10 Mbps) */ +#define PHY_LINK_SPEED_100MBPS 0x2 /* (100 Mbps) */ +#define PHY_LINK_SPEED_1GBPS 0x3 /* (1 Gbps) */ +#define PHY_LINK_SPEED_10GBPS 0x4 /* (10 Gbps) */ + +/* Hardware Address types */ +#define MAC_ADDRESS_TYPE_STORAGE 0x0 /* (Storage MAC Address) */ +#define MAC_ADDRESS_TYPE_NETWORK 0x1 /* (Network MAC Address) */ +#define MAC_ADDRESS_TYPE_PD 0x2 /* (Protection Domain MAC Addr) */ +#define MAC_ADDRESS_TYPE_MANAGEMENT 0x3 /* (Management MAC Address) */ +#define MAC_ADDRESS_TYPE_FCOE 0x4 /* (FCoE MAC Address) */ + +/* CREATE_IFACE capability and cap_en flags */ +#define MBX_RX_IFACE_FLAGS_RSS 0x4 +#define MBX_RX_IFACE_FLAGS_PROMISCUOUS 0x8 +#define MBX_RX_IFACE_FLAGS_BROADCAST 0x10 +#define MBX_RX_IFACE_FLAGS_UNTAGGED 0x20 +#define MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS 0x80 +#define MBX_RX_IFACE_FLAGS_VLAN 0x100 +#define MBX_RX_IFACE_FLAGS_MCAST_PROMISCUOUS 0x200 +#define MBX_RX_IFACE_FLAGS_PASS_L2_ERR 0x400 +#define MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR 0x800 +#define MBX_RX_IFACE_FLAGS_MULTICAST 0x1000 +#define MBX_RX_IFACE_RX_FILTER_IF_MULTICAST_HASH 0x2000 +#define MBX_RX_IFACE_FLAGS_HDS 0x4000 +#define MBX_RX_IFACE_FLAGS_DIRECTED 0x8000 +#define MBX_RX_IFACE_FLAGS_VMQ 0x10000 +#define MBX_RX_IFACE_FLAGS_NETQ 0x20000 +#define MBX_RX_IFACE_FLAGS_QGROUPS 0x40000 +#define MBX_RX_IFACE_FLAGS_LSO 0x80000 +#define MBX_RX_IFACE_FLAGS_LRO 0x100000 + +#define MQ_RING_CONTEXT_SIZE_16 0x5 /* (16 entries) */ +#define MQ_RING_CONTEXT_SIZE_32 0x6 /* (32 entries) */ +#define MQ_RING_CONTEXT_SIZE_64 0x7 /* (64 entries) */ +#define MQ_RING_CONTEXT_SIZE_128 0x8 /* (128 entries) */ + +#define MBX_DB_READY_BIT 0x1 +#define MBX_DB_HI_BIT 0x2 +#define ASYNC_EVENT_CODE_LINK_STATE 0x1 +#define ASYNC_EVENT_LINK_UP 0x1 +#define ASYNC_EVENT_LINK_DOWN 0x0 + +/* port link_status */ +#define ASYNC_EVENT_LOGICAL 0x02 + +/* Logical Link Status */ +#define NTWK_LOGICAL_LINK_DOWN 0 +#define NTWK_LOGICAL_LINK_UP 1 + +/* Rx filter bits */ +#define NTWK_RX_FILTER_IP_CKSUM 0x1 +#define NTWK_RX_FILTER_TCP_CKSUM 0x2 +#define NTWK_RX_FILTER_UDP_CKSUM 0x4 +#define NTWK_RX_FILTER_STRIP_CRC 0x8 + +/* max SGE per mbx */ +#define MAX_MBX_SGE 19 + +/* Max multicast filter size*/ +#define OCE_MAX_MC_FILTER_SIZE 64 + +/* PCI SLI (Service Level Interface) capabilities register */ +#define OCE_INTF_REG_OFFSET 0x58 +#define OCE_INTF_VALID_SIG 6 /* register's signature */ +#define OCE_INTF_FUNC_RESET_REQD 1 +#define OCE_INTF_HINT1_NOHINT 0 +#define OCE_INTF_HINT1_SEMAINIT 1 +#define OCE_INTF_HINT1_STATCTRL 2 +#define OCE_INTF_IF_TYPE_0 0 +#define OCE_INTF_IF_TYPE_1 1 +#define OCE_INTF_IF_TYPE_2 2 +#define OCE_INTF_IF_TYPE_3 3 +#define OCE_INTF_SLI_REV3 3 /* not supported by driver */ +#define OCE_INTF_SLI_REV4 4 /* driver supports SLI-4 */ +#define OCE_INTF_PHYS_FUNC 0 +#define OCE_INTF_VIRT_FUNC 1 +#define OCE_INTF_FAMILY_BE2 0 /* not supported by driver */ +#define OCE_INTF_FAMILY_BE3 1 /* driver supports BE3 */ +#define OCE_INTF_FAMILY_A0_CHIP 0xA /* Lancer A0 chip (supported) */ +#define OCE_INTF_FAMILY_B0_CHIP 0xB /* Lancer B0 chip (future) */ + +#define NIC_WQE_SIZE 16 +#define NIC_UNICAST 0x00 +#define NIC_MULTICAST 0x01 +#define NIC_BROADCAST 0x02 + +#define NIC_HDS_NO_SPLIT 0x00 +#define NIC_HDS_SPLIT_L3PL 0x01 +#define NIC_HDS_SPLIT_L4PL 0x02 + +#define NIC_WQ_TYPE_FORWARDING 0x01 +#define NIC_WQ_TYPE_STANDARD 0x02 +#define NIC_WQ_TYPE_LOW_LATENCY 0x04 + +#define OCE_RESET_STATS 1 +#define OCE_RETAIN_STATS 0 +#define OCE_TXP_SW_SZ 48 + +typedef union pci_sli_intf_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t sli_valid:3; + uint32_t sli_hint2:5; + uint32_t sli_hint1:8; + uint32_t sli_if_type:4; + uint32_t sli_family:4; + uint32_t sli_rev:4; + uint32_t rsv0:3; + uint32_t sli_func_type:1; +#else + uint32_t sli_func_type:1; + uint32_t rsv0:3; + uint32_t sli_rev:4; + uint32_t sli_family:4; + uint32_t sli_if_type:4; + uint32_t sli_hint1:8; + uint32_t sli_hint2:5; + uint32_t sli_valid:3; +#endif + } bits; +} pci_sli_intf_t; + + + +/* physical address structure to be used in MBX */ +struct phys_addr { + /* dw0 */ + uint32_t lo; + /* dw1 */ + uint32_t hi; +}; + + + +typedef union pcicfg_intr_ctl_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t winselect:2; + uint32_t hostintr:1; + uint32_t pfnum:3; + uint32_t vf_cev_int_line_en:1; + uint32_t winaddr:23; + uint32_t membarwinen:1; +#else + uint32_t membarwinen:1; + uint32_t winaddr:23; + uint32_t vf_cev_int_line_en:1; + uint32_t pfnum:3; + uint32_t hostintr:1; + uint32_t winselect:2; +#endif + } bits; +} pcicfg_intr_ctl_t; + + + + +typedef union pcicfg_semaphore_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t rsvd:31; + uint32_t lock:1; +#else + uint32_t lock:1; + uint32_t rsvd:31; +#endif + } bits; +} pcicfg_semaphore_t; + + + + +typedef union pcicfg_soft_reset_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t nec_ll_rcvdetect:8; + uint32_t dbg_all_reqs_62_49:14; + uint32_t scratchpad0:1; + uint32_t exception_oe:1; + uint32_t soft_reset:1; + uint32_t rsvd0:7; +#else + uint32_t rsvd0:7; + uint32_t soft_reset:1; + uint32_t exception_oe:1; + uint32_t scratchpad0:1; + uint32_t dbg_all_reqs_62_49:14; + uint32_t nec_ll_rcvdetect:8; +#endif + } bits; +} pcicfg_soft_reset_t; + + + + +typedef union pcicfg_online1_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t host8_online:1; + uint32_t host7_online:1; + uint32_t host6_online:1; + uint32_t host5_online:1; + uint32_t host4_online:1; + uint32_t host3_online:1; + uint32_t host2_online:1; + uint32_t ipc_online:1; + uint32_t arm_online:1; + uint32_t txp_online:1; + uint32_t xaui_online:1; + uint32_t rxpp_online:1; + uint32_t txpb_online:1; + uint32_t rr_online:1; + uint32_t pmem_online:1; + uint32_t pctl1_online:1; + uint32_t pctl0_online:1; + uint32_t pcs1online_online:1; + uint32_t mpu_iram_online:1; + uint32_t pcs0online_online:1; + uint32_t mgmt_mac_online:1; + uint32_t lpcmemhost_online:1; +#else + uint32_t lpcmemhost_online:1; + uint32_t mgmt_mac_online:1; + uint32_t pcs0online_online:1; + uint32_t mpu_iram_online:1; + uint32_t pcs1online_online:1; + uint32_t pctl0_online:1; + uint32_t pctl1_online:1; + uint32_t pmem_online:1; + uint32_t rr_online:1; + uint32_t txpb_online:1; + uint32_t rxpp_online:1; + uint32_t xaui_online:1; + uint32_t txp_online:1; + uint32_t arm_online:1; + uint32_t ipc_online:1; + uint32_t host2_online:1; + uint32_t host3_online:1; + uint32_t host4_online:1; + uint32_t host5_online:1; + uint32_t host6_online:1; + uint32_t host7_online:1; + uint32_t host8_online:1; +#endif + } bits; +} pcicfg_online1_t; + + + +typedef union mpu_ep_semaphore_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 21:03:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80AFC10656F3; Fri, 10 Feb 2012 21:03:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3BC8FC0C; Fri, 10 Feb 2012 21:03: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 q1AL3IOG094456; Fri, 10 Feb 2012 21:03:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL3IWD094454; Fri, 10 Feb 2012 21:03:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102103.q1AL3IWD094454@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231438 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:03:18 -0000 Author: tuexen Date: Fri Feb 10 21:03:17 2012 New Revision: 231438 URL: http://svn.freebsd.org/changeset/base/231438 Log: MFC r222029: Copy out the mtu when calling getsockopt() with SCTP_GET_PEER_ADDR_INFO. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 21:03:04 2012 (r231437) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 21:03:17 2012 (r231438) @@ -2486,6 +2486,7 @@ flags_out: paddri->spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; paddri->spinfo_rto = net->RTO; paddri->spinfo_assoc_id = sctp_get_associd(stcb); + paddri->spinfo_mtu = net->mtu; SCTP_TCB_UNLOCK(stcb); } else { if (stcb) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 21:05:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D918A106566B; Fri, 10 Feb 2012 21:05:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3D4C8FC08; Fri, 10 Feb 2012 21:05:34 +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 q1AL5YK6094575; Fri, 10 Feb 2012 21:05:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL5YZ8094573; Fri, 10 Feb 2012 21:05:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102105.q1AL5YZ8094573@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:05:34 +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: r231439 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:05:35 -0000 Author: tuexen Date: Fri Feb 10 21:05:34 2012 New Revision: 231439 URL: http://svn.freebsd.org/changeset/base/231439 Log: MFC r222077: Unbreak INET-less build. Reported by bz@ Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:03:17 2012 (r231438) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:05:34 2012 (r231439) @@ -3129,8 +3129,8 @@ plan_d: } #endif out: - if (sifa) { #ifdef INET + if (sifa) { if (retried == 1) { LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 21:07:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A287106566C; Fri, 10 Feb 2012 21:07:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73EBA8FC08; Fri, 10 Feb 2012 21:07: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 q1AL7rOS094697; Fri, 10 Feb 2012 21:07:53 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL7rHD094692; Fri, 10 Feb 2012 21:07:53 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102107.q1AL7rHD094692@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:07:53 +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: r231440 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:07:53 -0000 Author: tuexen Date: Fri Feb 10 21:07:52 2012 New Revision: 231440 URL: http://svn.freebsd.org/changeset/base/231440 Log: MFC r222459: Get rid of unused functions. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 21:05:34 2012 (r231439) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 21:07:52 2012 (r231440) @@ -247,49 +247,6 @@ sctp_build_ctl_nchunk(struct sctp_inpcb } -char * -sctp_build_ctl_cchunk(struct sctp_inpcb *inp, - int *control_len, - struct sctp_sndrcvinfo *sinfo) -{ - struct sctp_sndrcvinfo *outinfo; - struct cmsghdr *cmh; - char *buf; - int len; - int use_extended = 0; - - if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { - /* user does not want the sndrcv ctl */ - return (NULL); - } - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) { - use_extended = 1; - len = CMSG_LEN(sizeof(struct sctp_extrcvinfo)); - } else { - len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); - } - SCTP_MALLOC(buf, char *, len, SCTP_M_CMSG); - if (buf == NULL) { - /* No space */ - return (buf); - } - /* We need a CMSG header followed by the struct */ - cmh = (struct cmsghdr *)buf; - outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh); - cmh->cmsg_level = IPPROTO_SCTP; - if (use_extended) { - cmh->cmsg_type = SCTP_EXTRCV; - cmh->cmsg_len = len; - memcpy(outinfo, sinfo, len); - } else { - cmh->cmsg_type = SCTP_SNDRCV; - cmh->cmsg_len = len; - *outinfo = *sinfo; - } - *control_len = len; - return (buf); -} - static void sctp_mark_non_revokable(struct sctp_association *asoc, uint32_t tsn) { Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Fri Feb 10 21:05:34 2012 (r231439) +++ stable/8/sys/netinet/sctp_indata.h Fri Feb 10 21:07:52 2012 (r231440) @@ -83,11 +83,6 @@ struct mbuf * sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo); -char * -sctp_build_ctl_cchunk(struct sctp_inpcb *inp, - int *control_len, - struct sctp_sndrcvinfo *sinfo); - void sctp_set_rwnd(struct sctp_tcb *, struct sctp_association *); uint32_t Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 21:05:34 2012 (r231439) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 21:07:52 2012 (r231440) @@ -6184,71 +6184,6 @@ sctp_soreceive(struct socket *so, } -int -sctp_l_soreceive(struct socket *so, - struct sockaddr **name, - struct uio *uio, - char **controlp, - int *controllen, - int *flag) -{ - int error, fromlen; - uint8_t sockbuf[256]; - struct sockaddr *from; - struct sctp_extrcvinfo sinfo; - int filling_sinfo = 1; - struct sctp_inpcb *inp; - - inp = (struct sctp_inpcb *)so->so_pcb; - /* pickup the assoc we are reading from */ - if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); - return (EINVAL); - } - if ((sctp_is_feature_off(inp, - SCTP_PCB_FLAGS_RECVDATAIOEVNT)) || - (controlp == NULL)) { - /* user does not want the sndrcv ctl */ - filling_sinfo = 0; - } - if (name) { - from = (struct sockaddr *)sockbuf; - fromlen = sizeof(sockbuf); - from->sa_len = 0; - } else { - from = NULL; - fromlen = 0; - } - - error = sctp_sorecvmsg(so, uio, - (struct mbuf **)NULL, - from, fromlen, flag, - (struct sctp_sndrcvinfo *)&sinfo, - filling_sinfo); - if ((controlp) && (filling_sinfo)) { - /* - * copy back the sinfo in a CMSG format note that the caller - * has reponsibility for freeing the memory. - */ - if (filling_sinfo) - *controlp = sctp_build_ctl_cchunk(inp, - controllen, - (struct sctp_sndrcvinfo *)&sinfo); - } - if (name) { - /* copy back the address info */ - if (from && from->sa_len) { - *name = sodupsockaddr(from, M_WAIT); - } else { - *name = NULL; - } - } - return (error); -} - - - - Modified: stable/8/sys/netinet/sctputil.h ============================================================================== --- stable/8/sys/netinet/sctputil.h Fri Feb 10 21:05:34 2012 (r231439) +++ stable/8/sys/netinet/sctputil.h Fri Feb 10 21:07:52 2012 (r231440) @@ -328,20 +328,6 @@ sctp_soreceive(struct socket *so, struct struct mbuf **controlp, int *flagsp); - -/* For those not passing mbufs, this does the - * translations for you. Caller owns memory - * of size controllen returned in controlp. - */ -int -sctp_l_soreceive(struct socket *so, - struct sockaddr **name, - struct uio *uio, - char **controlp, - int *controllen, - int *flag); - - void sctp_misc_ints(uint8_t from, uint32_t a, uint32_t b, uint32_t c, uint32_t d); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 21:26:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62C50106566B; Fri, 10 Feb 2012 21:26:26 +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 4D6288FC15; Fri, 10 Feb 2012 21:26: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 q1ALQQYK095513; Fri, 10 Feb 2012 21:26:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ALQQvI095511; Fri, 10 Feb 2012 21:26:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202102126.q1ALQQvI095511@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Feb 2012 21:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231441 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:26:26 -0000 Author: kib Date: Fri Feb 10 21:26:25 2012 New Revision: 231441 URL: http://svn.freebsd.org/changeset/base/231441 Log: In cpu_set_user_tls(), consistently set PCB_FULL_IRET pcb flag for both 64bit and 32bit binaries, not for 64bit only. The set of the flag is not neccessary there, because the only current user of the cpu_set_user_tls() is create_thread(), which calls cpu_set_upcall() before and cpu_set_upcall() itself sets PCB_FULL_IRET. Change the function for consistency and preserve existing KPI for now. MFC after: 1 week Modified: head/sys/amd64/amd64/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Fri Feb 10 21:07:52 2012 (r231440) +++ head/sys/amd64/amd64/vm_machdep.c Fri Feb 10 21:26:25 2012 (r231441) @@ -552,6 +552,7 @@ cpu_set_user_tls(struct thread *td, void return (EINVAL); pcb = td->td_pcb; + set_pcb_flags(pcb, PCB_FULL_IRET); #ifdef COMPAT_FREEBSD32 if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { pcb->pcb_gsbase = (register_t)tls_base; @@ -559,7 +560,6 @@ cpu_set_user_tls(struct thread *td, void } #endif pcb->pcb_fsbase = (register_t)tls_base; - set_pcb_flags(pcb, PCB_FULL_IRET); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 21:28:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D5661065678; Fri, 10 Feb 2012 21:28:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73FC18FC13; Fri, 10 Feb 2012 21:28:39 +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 q1ALSdmc095632; Fri, 10 Feb 2012 21:28:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ALSd6B095624; Fri, 10 Feb 2012 21:28:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102128.q1ALSd6B095624@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 21:28:39 +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: r231442 - in stable/8: . contrib/bsnmp/snmpd contrib/top contrib/xz gnu/usr.bin lib lib/libc/net lib/liblzma lib/librtld_db lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/s... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:28:39 -0000 Author: tuexen Date: Fri Feb 10 21:28:38 2012 New Revision: 231442 URL: http://svn.freebsd.org/changeset/base/231442 Log: MFC r223132: Add support for the newly added SCTP API. In particular add support for: * SCTP_SNDINFO, SCTP_PRINFO, SCTP_AUTHINFO, SCTP_DSTADDRV4, and SCTP_DSTADDRV6 cmsgs. * SCTP_NXTINFO and SCTP_RCVINFO cmgs. * SCTP_EVENT, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO and SCTP_DEFAULT_SNDINFO socket option. * Special association ids (SCTP_FUTURE_ASSOC, ...) * sctp_recvv() and sctp_sendv() functions. Modified because SCTP_MAXBURST was not backported. Modified: stable/8/lib/libc/net/sctp_sys_calls.c stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/README (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/df/ (props changed) stable/8/bin/echo/ (props changed) stable/8/bin/ed/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kenv/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/stty/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/dtracetoolkit/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/gperf/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/libarchive/ (props changed) stable/8/contrib/libarchive/cpio/ (props changed) stable/8/contrib/libarchive/libarchive/ (props changed) stable/8/contrib/libarchive/libarchive_fe/ (props changed) stable/8/contrib/libarchive/tar/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/smbfs/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/etc/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) stable/8/gnu/usr.bin/cc/include/ (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/gperf/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/comsat/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rshd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/conscontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/md5/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mdmfs/ (props changed) stable/8/sbin/mknod/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/mount_unionfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/quotacheck/ (props changed) stable/8/sbin/rcorder/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/shutdown/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/doc/ (props changed) stable/8/share/doc/papers/devfs/ (props changed) stable/8/share/doc/papers/jail/ (props changed) stable/8/share/doc/smm/01.setup/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/misc/bsd-family-tree (props changed) stable/8/share/mk/ (props changed) stable/8/share/skel/ (props changed) stable/8/share/syscons/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acct/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/date/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/bin/test/ (props changed) stable/8/tools/regression/doat/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/netinet/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/sockets/unix_gc/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/test/malloc/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/bluetooth/l2control/ (props changed) stable/8/usr.sbin/bluetooth/l2ping/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/cron/crontab/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/fwcontrol/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/ifmcstat/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/kbdmap/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mixer/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfsd/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/nfsuserd/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/portsnap/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/pw/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.statd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rpcbind/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/tcpdrop/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/tzsetup/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/usbdump/ (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 21:28:38 2012 (r231442) @@ -141,7 +141,7 @@ in6_sin6_2_sin(struct sockaddr_in *sin, int sctp_getaddrlen(sa_family_t family) { - int error, sd; + int ret, sd; socklen_t siz; struct sctp_assoc_value av; @@ -151,13 +151,15 @@ sctp_getaddrlen(sa_family_t family) sd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); #elif defined(AF_INET6) sd = socket(AF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP); +#else + sd = -1; #endif if (sd == -1) { return (-1); } - error = getsockopt(sd, IPPROTO_SCTP, SCTP_GET_ADDR_LEN, &av, &siz); + ret = getsockopt(sd, IPPROTO_SCTP, SCTP_GET_ADDR_LEN, &av, &siz); close(sd); - if (error == 0) { + if (ret == 0) { return ((int)av.assoc_value); } else { return (-1); @@ -402,6 +404,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_TIMEOUTS: ((struct sctp_timeouts *)arg)->stimo_assoc_id = id; break; + case SCTP_EVENT: + ((struct sctp_event *)arg)->se_assoc_id = id; + break; default: break; } @@ -919,32 +924,259 @@ sctp_recvmsg(int s, #endif } +ssize_t +sctp_recvv(int sd, + const struct iovec *iov, + int iovlen, + struct sockaddr *from, + socklen_t * fromlen, + void *info, + socklen_t * infolen, + unsigned int *infotype, + int *flags) +{ + char ctlbuf[SCTP_CONTROL_VEC_SIZE_RCV]; + struct msghdr msg; + struct cmsghdr *cmsg; + ssize_t n; + struct sctp_rcvinfo *rcvinfo; + struct sctp_nxtinfo *nxtinfo; -#if defined(HAVE_SCTP_PEELOFF_SOCKOPT) -#include + if (infotype) { + *infotype = SCTP_RECVV_NOINFO; + } + msg.msg_name = from; + if (fromlen == NULL) { + msg.msg_namelen = 0; + } else { + msg.msg_namelen = *fromlen; + } + msg.msg_iov = (struct iovec *)iov; + msg.msg_iovlen = iovlen; + msg.msg_control = ctlbuf; + msg.msg_controllen = sizeof(ctlbuf); + errno = 0; + n = recvmsg(sd, &msg, *flags); + *flags = msg.msg_flags; + if ((n > 0) && + (msg.msg_controllen > 0) && + (infotype != NULL) && + (infolen != NULL) && + (*infolen > 0)) { + rcvinfo = NULL; + nxtinfo = NULL; + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level != IPPROTO_SCTP) { + continue; + } + if (cmsg->cmsg_type == SCTP_RCVINFO) { + rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmsg); + } + if (cmsg->cmsg_type == SCTP_NXTINFO) { + nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmsg); + } + if (rcvinfo && nxtinfo) { + break; + } + } + if (rcvinfo) { + if (nxtinfo) { + if (*infolen >= sizeof(struct sctp_recvv_rn)) { + struct sctp_recvv_rn *rn_info; + + rn_info = (struct sctp_recvv_rn *)info; + rn_info->recvv_rcvinfo = *rcvinfo; + rn_info->recvv_nxtinfo = *nxtinfo; + *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); + *infotype = SCTP_RECVV_RN; + } + } else { + if (*infolen >= sizeof(struct sctp_rcvinfo)) { + memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); + *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); + *infotype = SCTP_RECVV_RCVINFO; + } + } + } else if (nxtinfo) { + if (*infolen >= sizeof(struct sctp_rcvinfo)) { + memcpy(info, nxtinfo, sizeof(struct sctp_nxtinfo)); + *infolen = (socklen_t) sizeof(struct sctp_nxtinfo); + *infotype = SCTP_RECVV_NXTINFO; + } + } + } + return (n); +} -int -sctp_peeloff(int sd, sctp_assoc_t assoc_id) +ssize_t +sctp_sendv(int sd, + const struct iovec *iov, int iovcnt, + struct sockaddr *addrs, int addrcnt, + void *info, socklen_t infolen, unsigned int infotype, + int flags) { - struct sctp_peeloff_opt peeloff; - int result; - socklen_t optlen; - - /* set in the socket option params */ - memset(&peeloff, 0, sizeof(peeloff)); - peeloff.s = sd; - peeloff.assoc_id = assoc_id; - optlen = sizeof(peeloff); - result = getsockopt(sd, IPPROTO_SCTP, SCTP_PEELOFF, (void *)&peeloff, &optlen); + ssize_t ret; + int i; + size_t addr_len; + struct sctp_sendv_spa *spa_info; + struct msghdr msg; + struct cmsghdr *cmsg; + char *cmsgbuf; + struct sockaddr *addr; + struct sockaddr_in *addr_in; + struct sockaddr_in6 *addr_in6; - if (result < 0) { + if ((addrcnt < 0) || (iovcnt < 0)) { + errno = EINVAL; + return (-1); + } + cmsgbuf = malloc(CMSG_SPACE(sizeof(struct sctp_sndinfo)) + + CMSG_SPACE(sizeof(struct sctp_prinfo)) + + CMSG_SPACE(sizeof(struct sctp_authinfo)) + + addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); + if (cmsgbuf == NULL) { + errno = ENOBUFS; return (-1); + } + msg.msg_control = cmsgbuf; + msg.msg_controllen = 0; + cmsg = (struct cmsghdr *)cmsgbuf; + switch (infotype) { + case SCTP_SENDV_SNDINFO: + if (infolen < sizeof(struct sctp_sndinfo)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_SNDINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndinfo)); + memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_sndinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + break; + case SCTP_SENDV_PRINFO: + if (infolen < sizeof(struct sctp_prinfo)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_PRINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_prinfo)); + memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_prinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_prinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); + break; + case SCTP_SENDV_AUTHINFO: + if (infolen < sizeof(struct sctp_authinfo)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_AUTHINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_authinfo)); + memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_authinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_authinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo))); + break; + case SCTP_SENDV_SPA: + if (infolen < sizeof(struct sctp_sendv_spa)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + spa_info = (struct sctp_sendv_spa *)info; + if (spa_info->sendv_flags & SCTP_SEND_SNDINFO_VALID) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_SNDINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndinfo)); + memcpy(CMSG_DATA(cmsg), &spa_info->sendv_sndinfo, sizeof(struct sctp_sndinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + } + if (spa_info->sendv_flags & SCTP_SEND_PRINFO_VALID) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_PRINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_prinfo)); + memcpy(CMSG_DATA(cmsg), &spa_info->sendv_prinfo, sizeof(struct sctp_prinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_prinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); + } + if (spa_info->sendv_flags & SCTP_SEND_AUTHINFO_VALID) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_AUTHINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_authinfo)); + memcpy(CMSG_DATA(cmsg), &spa_info->sendv_authinfo, sizeof(struct sctp_authinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_authinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo))); + } + break; + default: + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + addr = addrs; + if (addrcnt == 1) { + msg.msg_name = addr; + switch (addr->sa_family) { + case AF_INET: + msg.msg_namelen = sizeof(struct sockaddr_in); + break; + case AF_INET6: + msg.msg_namelen = sizeof(struct sockaddr_in6); + break; + default: + free(cmsgbuf); + errno = EINVAL; + return (-1); + } } else { - return (peeloff.new_sd); + msg.msg_name = NULL; + msg.msg_namelen = 0; + for (i = 0; i < addrcnt; i++) { + switch (addr->sa_family) { + case AF_INET: + addr_len = sizeof(struct sockaddr_in); + addr_in = (struct sockaddr_in *)addr; + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV4; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); + break; + case AF_INET6: + addr_len = sizeof(struct sockaddr_in6); + addr_in6 = (struct sockaddr_in6 *)addr; + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV6; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr))); + break; + default: + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + addr = (struct sockaddr *)((caddr_t)addr + addr_len); + } } + if (msg.msg_controllen == 0) { + msg.msg_control = NULL; + } + msg.msg_iov = (struct iovec *)iov; + msg.msg_iovlen = iovcnt; + msg.msg_flags = 0; + ret = sendmsg(sd, &msg, flags); + free(cmsgbuf); + return (ret); } -#endif #if !defined(SYS_sctp_peeloff) && !defined(HAVE_SCTP_PEELOFF_SOCKOPT) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 21:28:38 2012 (r231442) @@ -91,7 +91,7 @@ struct sctp_paramhdr { #define SCTP_PEER_ADDR_PARAMS 0x0000000a #define SCTP_DEFAULT_SEND_PARAM 0x0000000b /* ancillary data/notification interest options */ -#define SCTP_EVENTS 0x0000000c +#define SCTP_EVENTS 0x0000000c /* deprecated */ /* Without this applied we will give V4 and V6 addresses on a V6 socket */ #define SCTP_I_WANT_MAPPED_V4_ADDR 0x0000000d #define SCTP_MAXSEG 0x0000000e @@ -114,6 +114,10 @@ struct sctp_paramhdr { #define SCTP_EXPLICIT_EOR 0x0000001b #define SCTP_REUSE_PORT 0x0000001c /* rw */ #define SCTP_AUTH_DEACTIVATE_KEY 0x0000001d +#define SCTP_EVENT 0x0000001e +#define SCTP_RECVRCVINFO 0x0000001f +#define SCTP_RECVNXTINFO 0x00000020 +#define SCTP_DEFAULT_SNDINFO 0x00000021 /* * read-only options @@ -490,7 +494,7 @@ struct sctp_error_unrecognized_chunk { /* * PCB Features (in sctp_features bitmask) */ -#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002 +#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002 /* deprecated */ #define SCTP_PCB_FLAGS_DONOT_HEARTBEAT 0x00000004 #define SCTP_PCB_FLAGS_FRAG_INTERLEAVE 0x00000008 #define SCTP_PCB_FLAGS_INTERLEAVE_STRMS 0x00000010 @@ -500,7 +504,7 @@ struct sctp_error_unrecognized_chunk { /* socket options */ #define SCTP_PCB_FLAGS_NODELAY 0x00000100 #define SCTP_PCB_FLAGS_AUTOCLOSE 0x00000200 -#define SCTP_PCB_FLAGS_RECVDATAIOEVNT 0x00000400 +#define SCTP_PCB_FLAGS_RECVDATAIOEVNT 0x00000400 /* deprecated */ #define SCTP_PCB_FLAGS_RECVASSOCEVNT 0x00000800 #define SCTP_PCB_FLAGS_RECVPADDREVNT 0x00001000 #define SCTP_PCB_FLAGS_RECVPEERERR 0x00002000 @@ -516,6 +520,9 @@ struct sctp_error_unrecognized_chunk { #define SCTP_PCB_FLAGS_MULTIPLE_ASCONFS 0x01000000 #define SCTP_PCB_FLAGS_PORTREUSE 0x02000000 #define SCTP_PCB_FLAGS_DRYEVNT 0x04000000 +#define SCTP_PCB_FLAGS_RECVRCVINFO 0x08000000 +#define SCTP_PCB_FLAGS_RECVNXTINFO 0x10000000 + /*- * mobility_features parameters (by micchie).Note * these features are applied against the Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/sys/netinet/sctp_auth.c Fri Feb 10 21:28:38 2012 (r231442) @@ -1866,7 +1866,7 @@ sctp_notify_authentication(struct sctp_t /* If the socket is gone we are out of here */ return; } - if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_AUTHEVNT)) + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_AUTHEVNT)) /* event not enabled */ return; Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 21:28:38 2012 (r231442) @@ -201,48 +201,110 @@ failed_build: struct mbuf * -sctp_build_ctl_nchunk(struct sctp_inpcb *inp, - struct sctp_sndrcvinfo *sinfo) +sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo) { + struct sctp_extrcvinfo *seinfo; struct sctp_sndrcvinfo *outinfo; + struct sctp_rcvinfo *rcvinfo; + struct sctp_nxtinfo *nxtinfo; struct cmsghdr *cmh; struct mbuf *ret; int len; - int use_extended = 0; + int use_extended; + int provide_nxt; - if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { - /* user does not want the sndrcv ctl */ + if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT) && + sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVRCVINFO) && + sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVNXTINFO)) { + /* user does not want any ancillary data */ return (NULL); } - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) { - use_extended = 1; - len = CMSG_LEN(sizeof(struct sctp_extrcvinfo)); + len = 0; + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) { + len += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); + } + seinfo = (struct sctp_extrcvinfo *)sinfo; + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO) && + (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_AVAIL)) { + provide_nxt = 1; + len += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); } else { - len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); + provide_nxt = 0; + } + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) { + use_extended = 1; + len += CMSG_SPACE(sizeof(struct sctp_extrcvinfo)); + } else { + use_extended = 0; + len += CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + } + } else { + use_extended = 0; } - - ret = sctp_get_mbuf_for_msg(len, - 0, M_DONTWAIT, 1, MT_DATA); - + ret = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); if (ret == NULL) { /* No space */ return (ret); } - /* We need a CMSG header followed by the struct */ + SCTP_BUF_LEN(ret) = 0; + + /* We need a CMSG header followed by the struct */ cmh = mtod(ret, struct cmsghdr *); - outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh); - cmh->cmsg_level = IPPROTO_SCTP; - if (use_extended) { - cmh->cmsg_type = SCTP_EXTRCV; - cmh->cmsg_len = len; - memcpy(outinfo, sinfo, len); - } else { - cmh->cmsg_type = SCTP_SNDRCV; - cmh->cmsg_len = len; - *outinfo = *sinfo; + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) { + cmh->cmsg_level = IPPROTO_SCTP; + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_rcvinfo)); + cmh->cmsg_type = SCTP_RCVINFO; + rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmh); + rcvinfo->rcv_sid = sinfo->sinfo_stream; + rcvinfo->rcv_ssn = sinfo->sinfo_ssn; + rcvinfo->rcv_flags = sinfo->sinfo_flags; + rcvinfo->rcv_ppid = sinfo->sinfo_ppid; + rcvinfo->rcv_tsn = sinfo->sinfo_tsn; + rcvinfo->rcv_cumtsn = sinfo->sinfo_cumtsn; + rcvinfo->rcv_context = sinfo->sinfo_context; + rcvinfo->rcv_assoc_id = sinfo->sinfo_assoc_id; + cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_rcvinfo))); + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); + } + if (provide_nxt) { + cmh->cmsg_level = IPPROTO_SCTP; + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_nxtinfo)); + cmh->cmsg_type = SCTP_NXTINFO; + nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmh); + nxtinfo->nxt_sid = seinfo->sreinfo_next_stream; + nxtinfo->nxt_flags = 0; + if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_UNORDERED) { + nxtinfo->nxt_flags |= SCTP_UNORDERED; + } + if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_NOTIFICATION) { + nxtinfo->nxt_flags |= SCTP_NOTIFICATION; + } + if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_ISCOMPLETE) { + nxtinfo->nxt_flags |= SCTP_COMPLETE; + } + nxtinfo->nxt_ppid = seinfo->sreinfo_next_ppid; + nxtinfo->nxt_length = seinfo->sreinfo_next_length; + nxtinfo->nxt_assoc_id = seinfo->sreinfo_next_aid; + cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_nxtinfo))); + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_nxtinfo)); + } + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { + cmh->cmsg_level = IPPROTO_SCTP; + outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh); + if (use_extended) { + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_extrcvinfo)); + cmh->cmsg_type = SCTP_EXTRCV; + memcpy(outinfo, sinfo, sizeof(struct sctp_extrcvinfo)); + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_extrcvinfo)); + } else { + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); + cmh->cmsg_type = SCTP_SNDRCV; + *outinfo = *sinfo; + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + } } - SCTP_BUF_LEN(ret) = cmh->cmsg_len; return (ret); } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:26:25 2012 (r231441) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 21:28:38 2012 (r231442) @@ -3355,54 +3355,338 @@ sctp_source_address_selection(struct sct } static int -sctp_find_cmsg(int c_type, void *data, struct mbuf *control, int cpsize) +sctp_find_cmsg(int c_type, void *data, struct mbuf *control, size_t cpsize) { struct cmsghdr cmh; - int tlen, at; + int tlen, at, found; + struct sctp_sndinfo sndinfo; + struct sctp_prinfo prinfo; + struct sctp_authinfo authinfo; tlen = SCTP_BUF_LEN(control); at = 0; + found = 0; /* * Independent of how many mbufs, find the c_type inside the control * structure and copy out the data. */ while (at < tlen) { if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { - /* not enough room for one more we are done. */ - return (0); + /* There is not enough room for one more. */ + return (found); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + /* We dont't have a complete CMSG header. */ + return (found); + } if (((int)cmh.cmsg_len + at) > tlen) { - /* - * this is real messed up since there is not enough - * data here to cover the cmsg header. We are done. - */ - return (0); + /* We don't have the complete CMSG. */ + return (found); } if ((cmh.cmsg_level == IPPROTO_SCTP) && - (c_type == cmh.cmsg_type)) { - /* found the one we want, copy it out */ - at += CMSG_ALIGN(sizeof(struct cmsghdr)); - if ((int)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) { - /* - * space of cmsg_len after header not big - * enough - */ - return (0); + ((c_type == cmh.cmsg_type) || + ((c_type == SCTP_SNDRCV) && + ((cmh.cmsg_type == SCTP_SNDINFO) || + (cmh.cmsg_type == SCTP_PRINFO) || + (cmh.cmsg_type == SCTP_AUTHINFO))))) { + if (c_type == cmh.cmsg_type) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) { + return (found); + } + /* It is exactly what we want. Copy it out. */ + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), cpsize, (caddr_t)data); + return (1); + } else { + struct sctp_sndrcvinfo *sndrcvinfo; + + sndrcvinfo = (struct sctp_sndrcvinfo *)data; + if (found == 0) { + if (cpsize < sizeof(struct sctp_sndrcvinfo)) { + return (found); + } + memset(sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo)); + } + switch (cmh.cmsg_type) { + case SCTP_SNDINFO: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_sndinfo)) { + return (found); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); + sndrcvinfo->sinfo_stream = sndinfo.snd_sid; + sndrcvinfo->sinfo_flags = sndinfo.snd_flags; + sndrcvinfo->sinfo_ppid = sndinfo.snd_ppid; + sndrcvinfo->sinfo_context = sndinfo.snd_context; + sndrcvinfo->sinfo_assoc_id = sndinfo.snd_assoc_id; + break; + case SCTP_PRINFO: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_prinfo)) { + return (found); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); + sndrcvinfo->sinfo_timetolive = prinfo.pr_value; + sndrcvinfo->sinfo_flags |= prinfo.pr_policy; + break; + case SCTP_AUTHINFO: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_authinfo)) { + return (found); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); + sndrcvinfo->sinfo_keynumber_valid = 1; + sndrcvinfo->sinfo_keynumber = authinfo.auth_keyid; + break; + default: + return (found); + } + found = 1; } - m_copydata(control, at, cpsize, data); + } + at += CMSG_ALIGN(cmh.cmsg_len); + } + return (found); +} + +static int +sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *error) +{ + struct cmsghdr cmh; + int tlen, at; + struct sctp_initmsg initmsg; + +#ifdef INET + struct sockaddr_in sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; + +#endif + + tlen = SCTP_BUF_LEN(control); + at = 0; + while (at < tlen) { + if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { + /* There is not enough room for one more. */ + *error = EINVAL; return (1); - } else { - at += CMSG_ALIGN(cmh.cmsg_len); - if (cmh.cmsg_len == 0) { + } + m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + /* We dont't have a complete CMSG header. */ + *error = EINVAL; + return (1); + } + if (((int)cmh.cmsg_len + at) > tlen) { + /* We don't have the complete CMSG. */ + *error = EINVAL; + return (1); + } + if (cmh.cmsg_level == IPPROTO_SCTP) { + switch (cmh.cmsg_type) { + case SCTP_INIT: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_initmsg)) { + *error = EINVAL; + return (1); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg); + if (initmsg.sinit_max_attempts) + stcb->asoc.max_init_times = initmsg.sinit_max_attempts; + if (initmsg.sinit_num_ostreams) + stcb->asoc.pre_open_streams = initmsg.sinit_num_ostreams; + if (initmsg.sinit_max_instreams) + stcb->asoc.max_inbound_streams = initmsg.sinit_max_instreams; + if (initmsg.sinit_max_init_timeo) + stcb->asoc.initial_init_rto_max = initmsg.sinit_max_init_timeo; + if (stcb->asoc.streamoutcnt < stcb->asoc.pre_open_streams) { + struct sctp_stream_out *tmp_str; + unsigned int i; + + /* Default is NOT correct */ + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Ok, default:%d pre_open:%d\n", + stcb->asoc.streamoutcnt, stcb->asoc.pre_open_streams); + SCTP_TCB_UNLOCK(stcb); + SCTP_MALLOC(tmp_str, + struct sctp_stream_out *, + (stcb->asoc.pre_open_streams * sizeof(struct sctp_stream_out)), + SCTP_M_STRMO); + SCTP_TCB_LOCK(stcb); + if (tmp_str != NULL) { + SCTP_FREE(stcb->asoc.strmout, SCTP_M_STRMO); + stcb->asoc.strmout = tmp_str; + stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt = stcb->asoc.pre_open_streams; + } else { + stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt; + } + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].next_sequence_sent = 0; + TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].stream_no = i; + stcb->asoc.strmout[i].last_msg_incomplete = 0; + stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); + } + } + break; +#ifdef INET + case SCTP_DSTADDRV4: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + *error = EINVAL; + return (1); + } + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_port = stcb->rport; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + if ((sin.sin_addr.s_addr == INADDR_ANY) || + (sin.sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { + *error = EINVAL; + return (-1); + } + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + *error = ENOBUFS; + return (1); + } + break; +#endif +#ifdef INET6 + case SCTP_DSTADDRV6: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + *error = EINVAL; + return (1); + } + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_port = stcb->rport; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); + if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr) || + IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) { + *error = EINVAL; + return (-1); + } +#ifdef INET + if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { + in6_sin6_2_sin(&sin, &sin6); + if ((sin.sin_addr.s_addr == INADDR_ANY) || + (sin.sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { + *error = EINVAL; + return (-1); + } + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + *error = ENOBUFS; + return (1); + } + } else +#endif + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin6, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + *error = ENOBUFS; + return (1); + } + break; +#endif + default: break; } } + at += CMSG_ALIGN(cmh.cmsg_len); } - /* not found */ return (0); } +static struct sctp_tcb * +sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p, + in_port_t port, + struct mbuf *control, + struct sctp_nets **net_p, + int *error) +{ + struct cmsghdr cmh; + int tlen, at; + struct sctp_tcb *stcb; + struct sockaddr *addr; + +#ifdef INET + struct sockaddr_in sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; + +#endif + + tlen = SCTP_BUF_LEN(control); + at = 0; + while (at < tlen) { + if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { + /* There is not enough room for one more. */ + *error = EINVAL; + return (NULL); + } + m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + /* We dont't have a complete CMSG header. */ + *error = EINVAL; + return (NULL); + } + if (((int)cmh.cmsg_len + at) > tlen) { + /* We don't have the complete CMSG. */ + *error = EINVAL; + return (NULL); + } + if (cmh.cmsg_level == IPPROTO_SCTP) { + switch (cmh.cmsg_type) { +#ifdef INET + case SCTP_DSTADDRV4: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + *error = EINVAL; + return (NULL); + } + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_port = port; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + addr = (struct sockaddr *)&sin; + break; +#endif +#ifdef INET6 + case SCTP_DSTADDRV6: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + *error = EINVAL; + return (NULL); + } + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_port = port; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); +#ifdef INET + if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { + in6_sin6_2_sin(&sin, &sin6); + addr = (struct sockaddr *)&sin; + } else +#endif + addr = (struct sockaddr *)&sin6; + break; +#endif + default: + addr = NULL; + break; + } + if (addr) { + stcb = sctp_findassociation_ep_addr(inp_p, addr, net_p, NULL, NULL); + if (stcb != NULL) { + return (stcb); + } + } + } + at += CMSG_ALIGN(cmh.cmsg_len); + } + return (NULL); +} + static struct mbuf * sctp_add_cookie(struct sctp_inpcb *inp, struct mbuf *init, int init_offset, struct mbuf *initack, int initack_offset, struct sctp_state_cookie *stc_in, uint8_t ** signature) @@ -5989,19 +6273,26 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->some_taken = 0; sp->data = m; sp->tail_mbuf = NULL; - sp->length = 0; - at = m; sctp_set_prsctp_policy(sp); /* * We could in theory (for sendall) sifa the length in, but we would * still have to hunt through the chain since we need to setup the * tail_mbuf */ - while (at) { + sp->length = 0; + for (at = m; at; at = SCTP_BUF_NEXT(at)) { if (SCTP_BUF_NEXT(at) == NULL) sp->tail_mbuf = at; sp->length += SCTP_BUF_LEN(at); - at = SCTP_BUF_NEXT(at); + } + if (srcv->sinfo_keynumber_valid) { + sp->auth_keyid = srcv->sinfo_keynumber; + } else { + sp->auth_keyid = stcb->asoc.authinfo.active_keyid; + } + if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { + sctp_auth_key_acquire(stcb, sp->auth_keyid); + sp->holds_key_ref = 1; } SCTP_TCB_SEND_LOCK(stcb); sctp_snd_sb_alloc(stcb, sp->length); @@ -6478,7 +6769,9 @@ sctp_sendall(struct sctp_inpcb *inp, str memset(ca, 0, sizeof(struct sctp_copy_all)); ca->inp = inp; - memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); + if (srcv) { + memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); + } /* * take off the sendall flag, it would be bad if we failed to do * this :-0 @@ -12229,9 +12522,13 @@ sctp_copy_it_in(struct sctp_tcb *stcb, *error = 0; goto skip_copy; } - sp->auth_keyid = stcb->asoc.authinfo.active_keyid; + if (srcv->sinfo_keynumber_valid) { + sp->auth_keyid = srcv->sinfo_keynumber; + } else { + sp->auth_keyid = stcb->asoc.authinfo.active_keyid; + } if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { - sctp_auth_key_acquire(stcb, stcb->asoc.authinfo.active_keyid); + sctp_auth_key_acquire(stcb, sp->auth_keyid); sp->holds_key_ref = 1; } *error = sctp_copy_one(sp, uio, resv_in_first); @@ -12263,8 +12560,8 @@ sctp_sosend(struct socket *so, struct thread *p ) { - int error, use_rcvinfo = 0; - struct sctp_sndrcvinfo srcv; + int error, use_sndinfo = 0; + struct sctp_sndrcvinfo sndrcvninfo; struct sockaddr *addr_to_use; #if defined(INET) && defined(INET6) @@ -12274,10 +12571,10 @@ sctp_sosend(struct socket *so, if (control) { /* process cmsg snd/rcv info (maybe a assoc-id) */ - if (sctp_find_cmsg(SCTP_SNDRCV, (void *)&srcv, control, - sizeof(srcv))) { + if (sctp_find_cmsg(SCTP_SNDRCV, (void *)&sndrcvninfo, control, + sizeof(sndrcvninfo))) { /* got one */ - use_rcvinfo = 1; + use_sndinfo = 1; } } addr_to_use = addr; @@ -12295,7 +12592,7 @@ sctp_sosend(struct socket *so, error = sctp_lower_sosend(so, addr_to_use, uio, top, control, flags, - use_rcvinfo ? &srcv : NULL + use_sndinfo ? &sndrcvninfo : NULL ,p ); return (error); @@ -12500,6 +12797,9 @@ sctp_lower_sosend(struct socket *so, SCTP_INP_WUNLOCK(inp); /* With the lock applied look again */ stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL); + if ((stcb == NULL) && (control != NULL) && (port > 0)) { + stcb = sctp_findassociation_cmsgs(&t_inp, port, control, &net, &error); + } if (stcb == NULL) { SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); @@ -12507,6 +12807,9 @@ sctp_lower_sosend(struct socket *so, } else { hold_tcblock = 1; } + if (error) { + goto out_unlocked; + } if (t_inp != inp) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); error = ENOTCONN; @@ -12555,6 +12858,7 @@ sctp_lower_sosend(struct socket *so, /* Error is setup for us in the call */ goto out_unlocked; } + hold_tcblock = 1; if (create_lock_applied) { SCTP_ASOC_CREATE_UNLOCK(inp); create_lock_applied = 0; @@ -12574,84 +12878,13 @@ sctp_lower_sosend(struct socket *so, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 21:33:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E46C1065679; Fri, 10 Feb 2012 21:33:13 +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 07C528FC26; Fri, 10 Feb 2012 21:33:13 +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 q1ALXCLc095965; Fri, 10 Feb 2012 21:33:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ALXCu7095963; Fri, 10 Feb 2012 21:33:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202102133.q1ALXCu7095963@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Feb 2012 21:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231443 - head/tools/test/ptrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:33:13 -0000 Author: kib Date: Fri Feb 10 21:33:12 2012 New Revision: 231443 URL: http://svn.freebsd.org/changeset/base/231443 Log: Add a test program for recently added ptrace(2) interfaces. MFC after: 1 week Added: head/tools/test/ptrace/ head/tools/test/ptrace/Makefile (contents, props changed) head/tools/test/ptrace/scescx.c (contents, props changed) Added: head/tools/test/ptrace/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/ptrace/Makefile Fri Feb 10 21:33:12 2012 (r231443) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= scescx +NO_MAN= +WARNS?= 6 + +.include Added: head/tools/test/ptrace/scescx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/ptrace/scescx.c Fri Feb 10 21:33:12 2012 (r231443) @@ -0,0 +1,406 @@ +/*- + * Copyright (c) 2011, 2012 Konstantin Belousov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TRACE ">>>> " + +static const char * +decode_wait_status(int status) +{ + static char c[128]; + char b[32]; + int first; + + c[0] = '\0'; + first = 1; + if (WIFCONTINUED(status)) { + first = 0; + strlcat(c, "CONT", sizeof(c)); + } + if (WIFEXITED(status)) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + snprintf(b, sizeof(b), "EXIT(%d)", WEXITSTATUS(status)); + strlcat(c, b, sizeof(c)); + } + if (WIFSIGNALED(status)) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + snprintf(b, sizeof(b), "SIG(%s)", strsignal(WTERMSIG(status))); + strlcat(c, b, sizeof(c)); + if (WCOREDUMP(status)) + strlcat(c, ",CORE", sizeof(c)); + } + if (WIFSTOPPED(status)) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + snprintf(b, sizeof(b), "SIG(%s)", strsignal(WSTOPSIG(status))); + strlcat(c, b, sizeof(c)); + } + return (c); +} + +static const char * +decode_pl_flags(struct ptrace_lwpinfo *lwpinfo) +{ + static char c[128]; + static struct decode_tag { + int flag; + const char *desc; + } decode[] = { + { PL_FLAG_SA, "SA" }, + { PL_FLAG_BOUND, "BOUND" }, + { PL_FLAG_SCE, "SCE" }, + { PL_FLAG_SCX, "SCX" }, + { PL_FLAG_EXEC, "EXEC" }, + { PL_FLAG_SI, "SI" }, + { PL_FLAG_FORKED, "FORKED" }, + }; + char de[32]; + unsigned first, flags, i; + + c[0] = '\0'; + first = 1; + flags = lwpinfo->pl_flags; + for (i = 0; i < sizeof(decode) / sizeof(decode[0]); i++) { + if ((flags & decode[i].flag) != 0) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + strlcat(c, decode[i].desc, sizeof(c)); + flags &= ~decode[i].flag; + } + } + for (i = 0; i < sizeof(flags) * NBBY; i++) { + if ((flags & (1 << i)) != 0) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + snprintf(de, sizeof(de), "<%d>", i); + strlcat(c, de, sizeof(c)); + } + } + return (c); +} + +static const char * +decode_pl_event(struct ptrace_lwpinfo *lwpinfo) +{ + + switch (lwpinfo->pl_event) { + case PL_EVENT_NONE: + return ("NONE"); + + case PL_EVENT_SIGNAL: + return ("SIG"); + + default: + return ("UNKNOWN"); + } +} + +static void +get_pathname(pid_t pid) +{ + char pathname[PATH_MAX]; + int error, name[4]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PATHNAME; + name[3] = pid; + + len = sizeof(pathname); + error = sysctl(name, 4, pathname, &len, NULL, 0); + if (error < 0) { + if (errno != ESRCH) { + fprintf(stderr, "sysctl kern.proc.pathname.%d: %s\n", + pid, strerror(errno)); + return; + } + fprintf(stderr, "pid %d exited\n", pid); + return; + } + if (len == 0 || strlen(pathname) == 0) { + fprintf(stderr, "No cached pathname for process %d\n", pid); + return; + } + printf(TRACE "pid %d path %s\n", pid, pathname); +} + +static void +wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) +{ + + printf(TRACE "pid %d wait %s", pid, + decode_wait_status(status)); + if (lwpinfo != NULL) { + printf(" event %s flags %s", + decode_pl_event(lwpinfo), decode_pl_flags(lwpinfo)); + } + printf("\n"); +} + +static int +trace_sc(int pid) +{ + struct ptrace_lwpinfo lwpinfo; + int status; + + if (ptrace(PT_TO_SCE, pid, (caddr_t)1, 0) < 0) { + perror("PT_TO_SCE"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + if (WIFEXITED(status) || WIFSIGNALED(status)) { + wait_info(pid, status, NULL); + return (-1); + } + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGTRAP); + + if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + wait_info(pid, status, &lwpinfo); + assert(lwpinfo.pl_flags & PL_FLAG_SCE); + + if (ptrace(PT_TO_SCX, pid, (caddr_t)1, 0) < 0) { + perror("PT_TO_SCX"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + if (WIFEXITED(status) || WIFSIGNALED(status)) { + wait_info(pid, status, NULL); + return (-1); + } + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGTRAP); + + if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + wait_info(pid, status, &lwpinfo); + assert(lwpinfo.pl_flags & PL_FLAG_SCX); + + if (lwpinfo.pl_flags & PL_FLAG_EXEC) + get_pathname(pid); + + if (lwpinfo.pl_flags & PL_FLAG_FORKED) { + printf(TRACE "forked child %d\n", lwpinfo.pl_child_pid); + return (lwpinfo.pl_child_pid); + } + return (0); +} + +static int +trace_cont(int pid) +{ + struct ptrace_lwpinfo lwpinfo; + int status; + + if (ptrace(PT_CONTINUE, pid, (caddr_t)1, 0) < 0) { + perror("PT_CONTINUE"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + if (WIFEXITED(status) || WIFSIGNALED(status)) { + wait_info(pid, status, NULL); + return (-1); + } + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGTRAP); + + if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + wait_info(pid, status, &lwpinfo); + + if ((lwpinfo.pl_flags & (PL_FLAG_EXEC | PL_FLAG_SCX)) == + (PL_FLAG_EXEC | PL_FLAG_SCX)) + get_pathname(pid); + + if ((lwpinfo.pl_flags & (PL_FLAG_FORKED | PL_FLAG_SCX)) == + (PL_FLAG_FORKED | PL_FLAG_SCX)) { + printf(TRACE "forked child %d\n", lwpinfo.pl_child_pid); + return (lwpinfo.pl_child_pid); + } + + return (0); +} + +static int trace_syscalls = 1; + +static int +trace(pid_t pid) +{ + + return (trace_syscalls ? trace_sc(pid) : trace_cont(pid)); +} + + +int +main(int argc, char *argv[]) +{ + struct ptrace_lwpinfo lwpinfo; + int c, status, use_vfork; + pid_t pid, pid1; + + trace_syscalls = 1; + use_vfork = 0; + while ((c = getopt(argc, argv, "csv")) != -1) { + switch (c) { + case 'c': + trace_syscalls = 0; + break; + case 's': + trace_syscalls = 1; + break; + case 'v': + use_vfork = 1; + break; + default: + case '?': + fprintf(stderr, "Usage: %s [-c] [-s] [-v]\n", argv[0]); + return (2); + } + } + + if ((pid = fork()) < 0) { + perror("fork"); + return 1; + } + else if (pid == 0) { + if (ptrace(PT_TRACE_ME, 0, NULL, 0) < 0) { + perror("PT_TRACE_ME"); + _exit(1); + } + kill(getpid(), SIGSTOP); + getpid(); + if ((pid1 = use_vfork ? vfork() : fork()) < 0) { + perror("fork1"); + return (1); + } else if (pid1 == 0) { + printf("Hi from child %d\n", getpid()); + execl("/bin/ls", "ls", "/", (char *)NULL); + } + } + else { /* parent */ + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGSTOP); + + if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, + sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + wait_info(pid, status, &lwpinfo); + + if (ptrace(PT_FOLLOW_FORK, pid, 0, 1) < 0) { + perror("PT_FOLLOW_FORK"); + ptrace(PT_KILL, pid, NULL, 0); + return (2); + } + + while ((pid1 = trace(pid)) >= 0) { + if (pid1 != 0) { + printf(TRACE "attached to pid %d\n", pid1); +#if 0 + kill(pid1, SIGCONT); +#endif + if (waitpid(pid1, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + printf(TRACE "nested loop, pid %d status %s\n", + pid1, decode_wait_status(status)); + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGSTOP); + if (ptrace(PT_LWPINFO, pid1, (caddr_t)&lwpinfo, + sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid1, NULL, 0); + return (-1); + } + wait_info(pid1, status, &lwpinfo); + + while (trace(pid1) >= 0) + ; + } + } + + ptrace(PT_CONTINUE, pid, (caddr_t)1, 0); + } + return (0); +} From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:06:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 543951065670; Fri, 10 Feb 2012 22:06:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0318FC08; Fri, 10 Feb 2012 22:06: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 q1AM697j097586; Fri, 10 Feb 2012 22:06:09 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AM68Km097583; Fri, 10 Feb 2012 22:06:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102206.q1AM68Km097583@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:06:08 +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: r231444 - in stable/8: . contrib/bsnmp/snmpd contrib/top contrib/xz gnu/usr.bin lib lib/libc/net lib/liblzma lib/librtld_db lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/s... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:06:09 -0000 Author: tuexen Date: Fri Feb 10 22:06:08 2012 New Revision: 231444 URL: http://svn.freebsd.org/changeset/base/231444 Log: MFC r223152: * Fix the handling of addresses in sctp_sendv(). * Add support for SCTP_SENDV_NOINFO. * Improve the error handling of sctp_sendv() and sctp_recv(). Modified: stable/8/lib/libc/net/sctp_sys_calls.c stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/README (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/df/ (props changed) stable/8/bin/echo/ (props changed) stable/8/bin/ed/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kenv/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/stty/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/dtracetoolkit/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/amd/ (props changed) stable/8/contrib/bc/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/cvs/ (props changed) stable/8/contrib/diff/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gcclibs/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/gnu-sort/ (props changed) stable/8/contrib/gperf/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/libarchive/ (props changed) stable/8/contrib/libarchive/cpio/ (props changed) stable/8/contrib/libarchive/libarchive/ (props changed) stable/8/contrib/libarchive/libarchive_fe/ (props changed) stable/8/contrib/libarchive/tar/ (props changed) stable/8/contrib/libbegemot/ (props changed) stable/8/contrib/libf2c/ (props changed) stable/8/contrib/libobjc/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libreadline/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/lukemftpd/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ngatm/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/opie/ (props changed) stable/8/contrib/pam_modules/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/pnpinfo/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/smbfs/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/texinfo/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/crypto/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/etc/ (props changed) stable/8/games/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) stable/8/gnu/usr.bin/cc/include/ (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/gperf/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/comsat/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rshd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/conscontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/md5/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mdmfs/ (props changed) stable/8/sbin/mknod/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/mount_unionfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/quotacheck/ (props changed) stable/8/sbin/rcorder/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/shutdown/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/doc/ (props changed) stable/8/share/doc/papers/devfs/ (props changed) stable/8/share/doc/papers/jail/ (props changed) stable/8/share/doc/smm/01.setup/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/misc/bsd-family-tree (props changed) stable/8/share/mk/ (props changed) stable/8/share/skel/ (props changed) stable/8/share/syscons/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acct/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/date/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/bin/test/ (props changed) stable/8/tools/regression/doat/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/netinet/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/sockets/unix_gc/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/test/malloc/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/sctp.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/IPXrouted/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/Makefile.inc (props changed) stable/8/usr.sbin/ac/ (props changed) stable/8/usr.sbin/accton/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/adduser/ (props changed) stable/8/usr.sbin/amd/ (props changed) stable/8/usr.sbin/ancontrol/ (props changed) stable/8/usr.sbin/apm/ (props changed) stable/8/usr.sbin/apmd/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/audit/ (props changed) stable/8/usr.sbin/auditd/ (props changed) stable/8/usr.sbin/auditreduce/ (props changed) stable/8/usr.sbin/authpf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/bluetooth/l2control/ (props changed) stable/8/usr.sbin/bluetooth/l2ping/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/boot98cfg/ (props changed) stable/8/usr.sbin/bootparamd/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/8/usr.sbin/btxld/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chkgrp/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/chroot/ (props changed) stable/8/usr.sbin/ckdist/ (props changed) stable/8/usr.sbin/clear_locks/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/cron/crontab/ (props changed) stable/8/usr.sbin/crunch/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/daemon/ (props changed) stable/8/usr.sbin/dconschat/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/digictl/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dnssec-dsfromkey/ (props changed) stable/8/usr.sbin/dnssec-keyfromlabel/ (props changed) stable/8/usr.sbin/dnssec-keygen/ (props changed) stable/8/usr.sbin/dnssec-signzone/ (props changed) stable/8/usr.sbin/dumpcis/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/editmap/ (props changed) stable/8/usr.sbin/edquota/ (props changed) stable/8/usr.sbin/eeprom/ (props changed) stable/8/usr.sbin/extattr/ (props changed) stable/8/usr.sbin/extattrctl/ (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/ftp-proxy/ (props changed) stable/8/usr.sbin/fwcontrol/ (props changed) stable/8/usr.sbin/getfmac/ (props changed) stable/8/usr.sbin/getpmac/ (props changed) stable/8/usr.sbin/gssd/ (props changed) stable/8/usr.sbin/gstat/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/ifmcstat/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/ip6addrctl/ (props changed) stable/8/usr.sbin/ipfwpcap/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jexec/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/kbdcontrol/ (props changed) stable/8/usr.sbin/kbdmap/ (props changed) stable/8/usr.sbin/kernbb/ (props changed) stable/8/usr.sbin/keyserv/ (props changed) stable/8/usr.sbin/kgmon/ (props changed) stable/8/usr.sbin/kgzip/ (props changed) stable/8/usr.sbin/kldxref/ (props changed) stable/8/usr.sbin/lastlogin/ (props changed) stable/8/usr.sbin/lmcconfig/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/lptcontrol/ (props changed) stable/8/usr.sbin/mailstats/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makemap/ (props changed) stable/8/usr.sbin/manctl/ (props changed) stable/8/usr.sbin/memcontrol/ (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mixer/ (props changed) stable/8/usr.sbin/mld6query/ (props changed) stable/8/usr.sbin/mlxcontrol/ (props changed) stable/8/usr.sbin/mount_nwfs/ (props changed) stable/8/usr.sbin/mount_portalfs/ (props changed) stable/8/usr.sbin/mount_smbfs/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptable/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/named-checkconf/ (props changed) stable/8/usr.sbin/named-checkzone/ (props changed) stable/8/usr.sbin/named.reload/ (props changed) stable/8/usr.sbin/ndiscvt/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfscbd/ (props changed) stable/8/usr.sbin/nfsd/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/nfsrevoke/ (props changed) stable/8/usr.sbin/nfsuserd/ (props changed) stable/8/usr.sbin/ngctl/ (props changed) stable/8/usr.sbin/nghook/ (props changed) stable/8/usr.sbin/nologin/ (props changed) stable/8/usr.sbin/nscd/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/nvram/ (props changed) stable/8/usr.sbin/ofwdump/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/pnpinfo/ (props changed) stable/8/usr.sbin/portsnap/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/praliases/ (props changed) stable/8/usr.sbin/praudit/ (props changed) stable/8/usr.sbin/procctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/pw/ (props changed) stable/8/usr.sbin/pwd_mkdb/ (props changed) stable/8/usr.sbin/quot/ (props changed) stable/8/usr.sbin/quotaon/ (props changed) stable/8/usr.sbin/rarpd/ (props changed) stable/8/usr.sbin/repquota/ (props changed) stable/8/usr.sbin/rip6query/ (props changed) stable/8/usr.sbin/rmt/ (props changed) stable/8/usr.sbin/rndc/ (props changed) stable/8/usr.sbin/rndc-confgen/ (props changed) stable/8/usr.sbin/route6d/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.statd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rpc.yppasswdd/ (props changed) stable/8/usr.sbin/rpc.ypupdated/ (props changed) stable/8/usr.sbin/rpc.ypxfrd/ (props changed) stable/8/usr.sbin/rpcbind/ (props changed) stable/8/usr.sbin/rrenumd/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtprio/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/rwhod/ (props changed) stable/8/usr.sbin/sa/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/sendmail/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/service/Makefile (props changed) stable/8/usr.sbin/service/service.8 (props changed) stable/8/usr.sbin/service/service.sh (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/services_mkdb/Makefile (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.8 (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.c (props changed) stable/8/usr.sbin/services_mkdb/uniq.c (props changed) stable/8/usr.sbin/setfib/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/sicontrol/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/snapinfo/ (props changed) stable/8/usr.sbin/spkrtest/ (props changed) stable/8/usr.sbin/spray/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/tcpdchk/ (props changed) stable/8/usr.sbin/tcpdmatch/ (props changed) stable/8/usr.sbin/tcpdrop/ (props changed) stable/8/usr.sbin/tcpdump/ (props changed) stable/8/usr.sbin/timed/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/trpt/ (props changed) stable/8/usr.sbin/tzsetup/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/usbdevs/ (props changed) stable/8/usr.sbin/usbdump/ (props changed) stable/8/usr.sbin/usbdump/Makefile (props changed) stable/8/usr.sbin/usbdump/usbdump.8 (props changed) stable/8/usr.sbin/usbdump/usbdump.c (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/vipw/ (props changed) stable/8/usr.sbin/wake/ (props changed) stable/8/usr.sbin/watch/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wlandebug/ (props changed) stable/8/usr.sbin/wlconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/yp_mkdb/ (props changed) stable/8/usr.sbin/ypbind/ (props changed) stable/8/usr.sbin/yppoll/ (props changed) stable/8/usr.sbin/yppush/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/ypset/ (props changed) stable/8/usr.sbin/zic/ (props changed) stable/8/usr.sbin/zzz/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 21:33:12 2012 (r231443) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:06:08 2012 (r231444) @@ -942,6 +942,12 @@ sctp_recvv(int sd, struct sctp_rcvinfo *rcvinfo; struct sctp_nxtinfo *nxtinfo; + if (((info != NULL) && (infolen == NULL)) | + ((info == NULL) && (infolen != NULL) && (*infolen != 0)) || + ((info != NULL) && (infotype == NULL))) { + errno = EINVAL; + return (-1); + } if (infotype) { *infotype = SCTP_RECVV_NOINFO; } @@ -1017,16 +1023,22 @@ sctp_sendv(int sd, { ssize_t ret; int i; - size_t addr_len; - struct sctp_sendv_spa *spa_info; + socklen_t addr_len; struct msghdr msg; + in_port_t port; + struct sctp_sendv_spa *spa_info; struct cmsghdr *cmsg; char *cmsgbuf; struct sockaddr *addr; struct sockaddr_in *addr_in; struct sockaddr_in6 *addr_in6; - if ((addrcnt < 0) || (iovcnt < 0)) { + if ((addrcnt < 0) || + (iovcnt < 0) || + ((addr == NULL) && (addrcnt > 0)) || + ((addr != NULL) && (addrcnt == 0)) || + ((iov == NULL) && (iovcnt > 0)) || + ((iov != NULL) && (iovcnt == 0))) { errno = EINVAL; return (-1); } @@ -1042,8 +1054,15 @@ sctp_sendv(int sd, msg.msg_controllen = 0; cmsg = (struct cmsghdr *)cmsgbuf; switch (infotype) { + case SCTP_SENDV_NOINFO: + if ((infolen != 0) || (info != NULL)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + break; case SCTP_SENDV_SNDINFO: - if (infolen < sizeof(struct sctp_sndinfo)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_sndinfo))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1056,7 +1075,7 @@ sctp_sendv(int sd, cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); break; case SCTP_SENDV_PRINFO: - if (infolen < sizeof(struct sctp_prinfo)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_prinfo))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1069,7 +1088,7 @@ sctp_sendv(int sd, cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); break; case SCTP_SENDV_AUTHINFO: - if (infolen < sizeof(struct sctp_authinfo)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_authinfo))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1082,7 +1101,7 @@ sctp_sendv(int sd, cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo))); break; case SCTP_SENDV_SPA: - if (infolen < sizeof(struct sctp_sendv_spa)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_sendv_spa))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1119,52 +1138,74 @@ sctp_sendv(int sd, return (-1); } addr = addrs; - if (addrcnt == 1) { - msg.msg_name = addr; + msg.msg_name = NULL; + msg.msg_namelen = 0; + + for (i = 0; i < addrcnt; i++) { switch (addr->sa_family) { case AF_INET: - msg.msg_namelen = sizeof(struct sockaddr_in); + addr_len = (socklen_t) sizeof(struct sockaddr_in); + addr_in = (struct sockaddr_in *)addr; + if (addr_in->sin_len != addr_len) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + if (i == 0) { + port = addr_in->sin_port; + } else { + if (port == addr_in->sin_port) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV4; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); + } else { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + } break; case AF_INET6: - msg.msg_namelen = sizeof(struct sockaddr_in6); + addr_len = (socklen_t) sizeof(struct sockaddr_in6); + addr_in6 = (struct sockaddr_in6 *)addr; + if (addr_in6->sin6_len != addr_len) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + if (i == 0) { + port = addr_in6->sin6_port; + } else { + if (port == addr_in6->sin6_port) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV6; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr))); + } else { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + } break; default: free(cmsgbuf); errno = EINVAL; return (-1); } - } else { - msg.msg_name = NULL; - msg.msg_namelen = 0; - for (i = 0; i < addrcnt; i++) { - switch (addr->sa_family) { - case AF_INET: - addr_len = sizeof(struct sockaddr_in); - addr_in = (struct sockaddr_in *)addr; - cmsg->cmsg_level = IPPROTO_SCTP; - cmsg->cmsg_type = SCTP_DSTADDRV4; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr)); - msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr)); - cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); - break; - case AF_INET6: - addr_len = sizeof(struct sockaddr_in6); - addr_in6 = (struct sockaddr_in6 *)addr; - cmsg->cmsg_level = IPPROTO_SCTP; - cmsg->cmsg_type = SCTP_DSTADDRV6; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); - memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr)); - msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr)); - cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr))); - break; - default: - free(cmsgbuf); - errno = EINVAL; - return (-1); - } - addr = (struct sockaddr *)((caddr_t)addr + addr_len); + if (i == 0) { + msg.msg_name = addr; + msg.msg_namelen = addr_len; } + addr = (struct sockaddr *)((caddr_t)addr + addr_len); + } + if (msg.msg_controllen == 0) { + msg.msg_control = NULL; } if (msg.msg_controllen == 0) { msg.msg_control = NULL; Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 21:33:12 2012 (r231443) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:06:08 2012 (r231444) @@ -201,6 +201,7 @@ struct sctp_recvv_rn { #define SCTP_RECVV_NXTINFO 2 #define SCTP_RECVV_RN 3 +#define SCTP_SENDV_NOINFO 0 #define SCTP_SENDV_SNDINFO 1 #define SCTP_SENDV_PRINFO 2 #define SCTP_SENDV_AUTHINFO 3 From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:07:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AD291065670; Fri, 10 Feb 2012 22:07:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE7DB8FC12; Fri, 10 Feb 2012 22:07:51 +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 q1AM7pK9097679; Fri, 10 Feb 2012 22:07:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AM7pFK097677; Fri, 10 Feb 2012 22:07:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102207.q1AM7pFK097677@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:07:51 +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: r231445 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:07:52 -0000 Author: tuexen Date: Fri Feb 10 22:07:51 2012 New Revision: 231445 URL: http://svn.freebsd.org/changeset/base/231445 Log: MFC r223154: Fix two typos and remove redundant code. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:06:08 2012 (r231444) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:07:51 2012 (r231445) @@ -1035,8 +1035,8 @@ sctp_sendv(int sd, if ((addrcnt < 0) || (iovcnt < 0) || - ((addr == NULL) && (addrcnt > 0)) || - ((addr != NULL) && (addrcnt == 0)) || + ((addrs == NULL) && (addrcnt > 0)) || + ((addrs != NULL) && (addrcnt == 0)) || ((iov == NULL) && (iovcnt > 0)) || ((iov != NULL) && (iovcnt == 0))) { errno = EINVAL; @@ -1207,9 +1207,6 @@ sctp_sendv(int sd, if (msg.msg_controllen == 0) { msg.msg_control = NULL; } - if (msg.msg_controllen == 0) { - msg.msg_control = NULL; - } msg.msg_iov = (struct iovec *)iov; msg.msg_iovlen = iovcnt; msg.msg_flags = 0; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:10:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 776FF106564A; Fri, 10 Feb 2012 22:10:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61FC08FC0A; Fri, 10 Feb 2012 22:10:37 +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 q1AMAbqI097806; Fri, 10 Feb 2012 22:10:37 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMAbHA097802; Fri, 10 Feb 2012 22:10:37 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102210.q1AMAbHA097802@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:10:37 +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: r231446 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:10:37 -0000 Author: tuexen Date: Fri Feb 10 22:10:36 2012 New Revision: 231446 URL: http://svn.freebsd.org/changeset/base/231446 Log: MFC 223162: Add SCTP_DEFAULT_PRINFO socket option. Fix the SCTP_DEFAULT_SNDINFO socket option: Don't clear the PR SCTP policy when setting sinfo_flags. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 22:07:51 2012 (r231445) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 22:10:36 2012 (r231446) @@ -118,6 +118,7 @@ struct sctp_paramhdr { #define SCTP_RECVRCVINFO 0x0000001f #define SCTP_RECVNXTINFO 0x00000020 #define SCTP_DEFAULT_SNDINFO 0x00000021 +#define SCTP_DEFAULT_PRINFO 0x00000022 /* * read-only options Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:07:51 2012 (r231445) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:10:36 2012 (r231446) @@ -162,6 +162,12 @@ struct sctp_prinfo { uint32_t pr_value; }; +struct sctp_default_prinfo { + uint16_t pr_policy; + uint32_t pr_value; + sctp_assoc_t pr_assoc_id; +}; + struct sctp_authinfo { uint16_t auth_keyid; }; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:07:51 2012 (r231445) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:10:36 2012 (r231446) @@ -3021,6 +3021,7 @@ flags_out: if (stcb) { info->snd_sid = stcb->asoc.def_send.sinfo_stream; info->snd_flags = stcb->asoc.def_send.sinfo_flags; + info->snd_flags &= 0xfff0; info->snd_ppid = stcb->asoc.def_send.sinfo_ppid; info->snd_context = stcb->asoc.def_send.sinfo_context; SCTP_TCB_UNLOCK(stcb); @@ -3029,6 +3030,7 @@ flags_out: SCTP_INP_RLOCK(inp); info->snd_sid = inp->def_send.sinfo_stream; info->snd_flags = inp->def_send.sinfo_flags; + info->snd_flags &= 0xfff0; info->snd_ppid = inp->def_send.sinfo_ppid; info->snd_context = inp->def_send.sinfo_context; SCTP_INP_RUNLOCK(inp); @@ -3042,6 +3044,33 @@ flags_out: } break; } + case SCTP_DEFAULT_PRINFO: + { + struct sctp_default_prinfo *info; + + SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, *optsize); + SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); + + if (stcb) { + info->pr_policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags); + info->pr_value = stcb->asoc.def_send.sinfo_timetolive; + SCTP_TCB_UNLOCK(stcb); + } else { + if (info->pr_assoc_id == SCTP_FUTURE_ASSOC) { + SCTP_INP_RLOCK(inp); + info->pr_policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); + info->pr_value = inp->def_send.sinfo_timetolive; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_default_prinfo); + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; @@ -5015,6 +5044,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_DEFAULT_SNDINFO: { struct sctp_sndinfo *info; + uint16_t policy; SCTP_CHECK_AND_CAST(info, optval, struct sctp_sndinfo, optsize); SCTP_FIND_STCB(inp, stcb, info->snd_assoc_id); @@ -5022,7 +5052,9 @@ sctp_setopt(struct socket *so, int optna if (stcb) { if (info->snd_sid < stcb->asoc.streamoutcnt) { stcb->asoc.def_send.sinfo_stream = info->snd_sid; + policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags); stcb->asoc.def_send.sinfo_flags = info->snd_flags; + stcb->asoc.def_send.sinfo_flags |= policy; stcb->asoc.def_send.sinfo_ppid = info->snd_ppid; stcb->asoc.def_send.sinfo_context = info->snd_context; } else { @@ -5035,7 +5067,9 @@ sctp_setopt(struct socket *so, int optna (info->snd_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->def_send.sinfo_stream = info->snd_sid; + policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); inp->def_send.sinfo_flags = info->snd_flags; + inp->def_send.sinfo_flags |= policy; inp->def_send.sinfo_ppid = info->snd_ppid; inp->def_send.sinfo_context = info->snd_context; SCTP_INP_WUNLOCK(inp); @@ -5047,7 +5081,9 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_LOCK(stcb); if (info->snd_sid < stcb->asoc.streamoutcnt) { stcb->asoc.def_send.sinfo_stream = info->snd_sid; + policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags); stcb->asoc.def_send.sinfo_flags = info->snd_flags; + stcb->asoc.def_send.sinfo_flags |= policy; stcb->asoc.def_send.sinfo_ppid = info->snd_ppid; stcb->asoc.def_send.sinfo_context = info->snd_context; } @@ -5058,6 +5094,44 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_DEFAULT_PRINFO: + { + struct sctp_default_prinfo *info; + + SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, optsize); + SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); + + if (PR_SCTP_INVALID_POLICY(info->pr_policy)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + break; + } + if (stcb) { + stcb->asoc.def_send.sinfo_flags &= 0xfff0; + stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((info->pr_assoc_id == SCTP_FUTURE_ASSOC) || + (info->pr_assoc_id == SCTP_ALL_ASSOC)) { + SCTP_INP_WLOCK(inp); + inp->def_send.sinfo_flags &= 0xfff0; + inp->def_send.sinfo_flags |= info->pr_policy; + SCTP_INP_WUNLOCK(inp); + } + if ((info->pr_assoc_id == SCTP_CURRENT_ASSOC) || + (info->pr_assoc_id == SCTP_ALL_ASSOC)) { + SCTP_INP_RLOCK(inp); + LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { + SCTP_TCB_LOCK(stcb); + stcb->asoc.def_send.sinfo_flags &= 0xfff0; + stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + SCTP_TCB_UNLOCK(stcb); + } + SCTP_INP_RUNLOCK(inp); + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:13:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFF19106564A; Fri, 10 Feb 2012 22:13:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA7B78FC18; Fri, 10 Feb 2012 22:13: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 q1AMDBe1097942; Fri, 10 Feb 2012 22:13:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMDBtY097940; Fri, 10 Feb 2012 22:13:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102213.q1AMDBtY097940@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:13:11 +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: r231447 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:13:11 -0000 Author: tuexen Date: Fri Feb 10 22:13:11 2012 New Revision: 231447 URL: http://svn.freebsd.org/changeset/base/231447 Log: MFC r223178: Update the list of supported socket options for sctp_opt_info(). Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:10:36 2012 (r231446) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:13:11 2012 (r231447) @@ -365,9 +365,6 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_DEFAULT_SEND_PARAM: ((struct sctp_assocparams *)arg)->sasoc_assoc_id = id; break; - case SCTP_SET_PEER_PRIMARY_ADDR: - ((struct sctp_setpeerprim *)arg)->sspp_assoc_id = id; - break; case SCTP_PRIMARY_ADDR: ((struct sctp_setprim *)arg)->ssp_assoc_id = id; break; @@ -407,6 +404,12 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_EVENT: ((struct sctp_event *)arg)->se_assoc_id = id; break; + case SCTP_DEFAULT_SNDINFO: + ((struct sctp_sndinfo *)arg)->snd_assoc_id = id; + break; + case SCTP_DEFAULT_PRINFO: + ((struct sctp_default_prinfo *)arg)->pr_assoc_id = id; + break; default: break; } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:14:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F8C7106564A; Fri, 10 Feb 2012 22:14:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 789788FC1D; Fri, 10 Feb 2012 22:14: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 q1AMEZXs098028; Fri, 10 Feb 2012 22:14:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMEZ9C098026; Fri, 10 Feb 2012 22:14:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102214.q1AMEZ9C098026@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:14: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: r231448 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:14:35 -0000 Author: tuexen Date: Fri Feb 10 22:14:34 2012 New Revision: 231448 URL: http://svn.freebsd.org/changeset/base/231448 Log: MFC r223225: Document the latest changes to sctp_opt_info() in the code. This makes sctp_opt_info() compiliant with the latest version of the socket API ID. Modified: stable/8/lib/libc/net/sctp_opt_info.3 Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_opt_info.3 ============================================================================== --- stable/8/lib/libc/net/sctp_opt_info.3 Fri Feb 10 22:13:11 2012 (r231447) +++ stable/8/lib/libc/net/sctp_opt_info.3 Fri Feb 10 22:14:34 2012 (r231448) @@ -32,7 +32,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd December 15, 2006 +.Dd June 18, 2011 .Dt SCTP_OPT_INFO 3 .Os .Sh NAME @@ -76,14 +76,30 @@ socket options. .Pp .Dv SCTP_PRIMARY_ADDR .Pp -.Dv SCTP_SET_PEER_PRIMARY_ADDR +.Dv SCTP_PEER_ADDR_PARAMS .Pp -.Dv SCTP_STATUS +.Dv SCTP_DEFAULT_SEND_PARAM .Pp -.Dv SCTP_GET_PEER_ADDR_INFO +.Dv SCTP_MAX_SEG .Pp .Dv SCTP_AUTH_ACTIVE_KEY .Pp +.Dv SCTP_DELAYED_SACK +.Pp +.Dv SCTP_MAX_BURST +.Pp +.Dv SCTP_CONTEXT +.Pp +.Dv SCTP_EVENT +.Pp +.Dv SCTP_DEFAULT_SNDINFO +.Pp +.Dv SCTP_DEFAULT_PRINFO +.Pp +.Dv SCTP_STATUS +.Pp +.Dv SCTP_GET_PEER_ADDR_INFO +.Pp .Dv SCTP_PEER_AUTH_CHUNKS .Pp .Dv SCTP_LOCAL_AUTH_CHUNKS @@ -115,3 +131,14 @@ is not a socket. .Sh SEE ALSO .Xr getsockopt 2 , .Xr sctp 4 +.Sh BUGS +Because the structure used for +.Fa arg +of the +.Dv SCTP_MAX_BURST +socket option has changed in FreeBSD 9.0 and higher, +using +.Dv SCTP_MAX_BURST +as +.Fa opt +is only supported in FreeBSD 9.0 and higher. From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:16:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A2101065670; Fri, 10 Feb 2012 22:16:18 +0000 (UTC) (envelope-from cracauer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 547658FC12; Fri, 10 Feb 2012 22:16: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 q1AMGI7p098194; Fri, 10 Feb 2012 22:16:18 GMT (envelope-from cracauer@svn.freebsd.org) Received: (from cracauer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMGI0m098192; Fri, 10 Feb 2012 22:16:18 GMT (envelope-from cracauer@svn.freebsd.org) Message-Id: <201202102216.q1AMGI0m098192@svn.freebsd.org> From: Martin Cracauer Date: Fri, 10 Feb 2012 22:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:16:18 -0000 Author: cracauer Date: Fri Feb 10 22:16:17 2012 New Revision: 231449 URL: http://svn.freebsd.org/changeset/base/231449 Log: Fix bin/164947: tee looses data when writing to non-blocking file descriptors tee was not handling EAGAIN patch submitted by Diomidis Spinellis . Thanks so much reproduced and re-tested locally Modified: head/usr.bin/tee/tee.c Modified: head/usr.bin/tee/tee.c ============================================================================== --- head/usr.bin/tee/tee.c Fri Feb 10 22:14:34 2012 (r231448) +++ head/usr.bin/tee/tee.c Fri Feb 10 22:16:17 2012 (r231449) @@ -42,8 +42,10 @@ static const char rcsid[] = #endif /* not lint */ #include +#include #include #include +#include #include #include #include @@ -60,6 +62,7 @@ static LIST *head; static void add(int, const char *); static void usage(void); +static void waitfor(int fd); int main(int argc, char *argv[]) @@ -106,9 +109,14 @@ main(int argc, char *argv[]) bp = buf; do { if ((wval = write(p->fd, bp, n)) == -1) { - warn("%s", p->name); - exitval = 1; - break; + if (errno == EAGAIN) { + waitfor(p->fd); + wval = 0; + } else { + warn("%s", p->name); + exitval = 1; + break; + } } bp += wval; } while (n -= wval); @@ -137,3 +145,15 @@ add(int fd, const char *name) p->next = head; head = p; } + +/* Wait for the specified fd to be ready for writing */ +static void +waitfor(int fd) +{ + fd_set writefds; + + FD_ZERO(&writefds); + FD_SET(fd, &writefds); + if (select(fd + 1, NULL, &writefds, NULL, NULL) == -1) + err(1, "select"); +} From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:16:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A00451065672; Fri, 10 Feb 2012 22:16:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A2988FC1C; Fri, 10 Feb 2012 22: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 q1AMGqlp098252; Fri, 10 Feb 2012 22:16:52 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMGqAf098250; Fri, 10 Feb 2012 22:16:52 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102216.q1AMGqAf098250@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22: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: r231450 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:16:52 -0000 Author: tuexen Date: Fri Feb 10 22:16:52 2012 New Revision: 231450 URL: http://svn.freebsd.org/changeset/base/231450 Log: MFC r223613: Add support for SCTP_PR_SCTP_NONE which I misded to add. This constant is defined in the socket API ID. Modified: stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:16:17 2012 (r231449) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:16:52 2012 (r231450) @@ -251,12 +251,13 @@ struct sctp_snd_all_completes { /* for the endpoint */ /* The lower byte is an enumeration of PR-SCTP policies */ +#define SCTP_PR_SCTP_NONE 0x0000/* Reliable transfer */ #define SCTP_PR_SCTP_TTL 0x0001/* Time based PR-SCTP */ #define SCTP_PR_SCTP_BUF 0x0002/* Buffer based PR-SCTP */ #define SCTP_PR_SCTP_RTX 0x0003/* Number of retransmissions based PR-SCTP */ #define PR_SCTP_POLICY(x) ((x) & 0x0f) -#define PR_SCTP_ENABLED(x) (PR_SCTP_POLICY(x) != 0) +#define PR_SCTP_ENABLED(x) (PR_SCTP_POLICY(x) != SCTP_PR_SCTP_NONE) #define PR_SCTP_TTL_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL) #define PR_SCTP_BUF_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF) #define PR_SCTP_RTX_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX) From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:19:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8F2E106566B; Fri, 10 Feb 2012 22:19:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CFE48FC14; Fri, 10 Feb 2012 22:19:08 +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 q1AMJ8FW098377; Fri, 10 Feb 2012 22:19:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMJ8pK098374; Fri, 10 Feb 2012 22:19:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102219.q1AMJ8pK098374@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:19:08 +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: r231451 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:19:08 -0000 Author: tuexen Date: Fri Feb 10 22:19:07 2012 New Revision: 231451 URL: http://svn.freebsd.org/changeset/base/231451 Log: MFC r223697: Add the missing sca_keylength field to the sctp_authkey structure, which is used the the SCTP_AUTH_KEY socket option. Modified: stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:16:52 2012 (r231450) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:19:07 2012 (r231451) @@ -591,6 +591,7 @@ struct sctp_authchunk { struct sctp_authkey { sctp_assoc_t sca_assoc_id; uint16_t sca_keynumber; + uint16_t sca_keylength; uint8_t sca_key[]; }; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:16:52 2012 (r231450) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:19:07 2012 (r231451) @@ -3562,8 +3562,18 @@ sctp_setopt(struct socket *so, int optna size_t size; SCTP_CHECK_AND_CAST(sca, optval, struct sctp_authkey, optsize); + if (sca->sca_keylength == 0) { + size = optsize - sizeof(struct sctp_authkey); + } else { + if (sca->sca_keylength + sizeof(struct sctp_authkey) <= optsize) { + size = sca->sca_keylength; + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + break; + } + } SCTP_FIND_STCB(inp, stcb, sca->sca_assoc_id); - size = optsize - sizeof(struct sctp_authkey); if (stcb) { shared_keys = &stcb->asoc.shared_keys; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:21:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542A5106564A; Fri, 10 Feb 2012 22:21:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4137C8FC15; Fri, 10 Feb 2012 22:21:51 +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 q1AMLpCs098506; Fri, 10 Feb 2012 22:21:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMLpte098504; Fri, 10 Feb 2012 22:21:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102221.q1AMLpte098504@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:21:51 +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: r231452 - in stable/8/usr.bin: chpass netstat su X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:21:51 -0000 Author: tuexen Date: Fri Feb 10 22:21:50 2012 New Revision: 231452 URL: http://svn.freebsd.org/changeset/base/231452 Log: MFC r223947: Truncate link addresses like it is done for any other address type. Modified: stable/8/usr.bin/netstat/if.c (contents, props changed) Directory Properties: stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/sctp.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) Modified: stable/8/usr.bin/netstat/if.c ============================================================================== --- stable/8/usr.bin/netstat/if.c Fri Feb 10 22:19:07 2012 (r231451) +++ stable/8/usr.bin/netstat/if.c Fri Feb 10 22:21:50 2012 (r231452) @@ -402,7 +402,7 @@ intpr(int interval1, u_long ifnetaddr, v n = cp - sa->sa_data + 1; cp = sa->sa_data; hexprint: - while (--n >= 0) + while ((--n >= 0) && (m < 30)) m += printf("%02x%c", *cp++ & 0xff, n > 0 ? ':' : ' '); m = 32 - m; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:26:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EEF5106564A; Fri, 10 Feb 2012 22:26:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9798FC17; Fri, 10 Feb 2012 22:26:33 +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 q1AMQXT8098697; Fri, 10 Feb 2012 22:26:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMQXxs098694; Fri, 10 Feb 2012 22:26:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102226.q1AMQXxs098694@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:26:33 +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: r231453 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:26:33 -0000 Author: tuexen Date: Fri Feb 10 22:26:33 2012 New Revision: 231453 URL: http://svn.freebsd.org/changeset/base/231453 Log: MFC r223963: The socket API only specifies SCTP for SOCK_SEQPACKET and SOCK_STREAM, but not SOCK_DGRAM. So don't register it for SOCK_DGRAM. While there, fix some indentation. Modified: stable/8/sys/netinet/in_proto.c stable/8/sys/netinet6/in6_proto.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/in_proto.c ============================================================================== --- stable/8/sys/netinet/in_proto.c Fri Feb 10 22:21:50 2012 (r231452) +++ stable/8/sys/netinet/in_proto.c Fri Feb 10 22:26:33 2012 (r231453) @@ -150,7 +150,7 @@ struct protosw inetsw[] = { }, #ifdef SCTP { - .pr_type = SOCK_DGRAM, + .pr_type = SOCK_SEQPACKET, .pr_domain = &inetdomain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_WANTRCVD, @@ -164,18 +164,6 @@ struct protosw inetsw[] = { .pr_drain = sctp_drain, .pr_usrreqs = &sctp_usrreqs }, -{ - .pr_type = SOCK_SEQPACKET, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp_input, - .pr_ctlinput = sctp_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp_usrreqs -}, - { .pr_type = SOCK_STREAM, .pr_domain = &inetdomain, Modified: stable/8/sys/netinet6/in6_proto.c ============================================================================== --- stable/8/sys/netinet6/in6_proto.c Fri Feb 10 22:21:50 2012 (r231452) +++ stable/8/sys/netinet6/in6_proto.c Fri Feb 10 22:26:33 2012 (r231453) @@ -184,38 +184,29 @@ struct ip6protosw inet6sw[] = { }, #ifdef SCTP { - .pr_type = SOCK_DGRAM, - .pr_domain = &inet6domain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp6_input, - .pr_ctlinput = sctp6_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp6_usrreqs -}, -{ - .pr_type = SOCK_SEQPACKET, - .pr_domain = &inet6domain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp6_input, - .pr_ctlinput = sctp6_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp6_usrreqs + .pr_type = SOCK_SEQPACKET, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp6_input, + .pr_ctlinput = sctp6_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_drain = sctp_drain, +#ifndef INET /* Do not call initialization twice. */ + .pr_init = sctp_init, +#endif + .pr_usrreqs = &sctp6_usrreqs }, - { - .pr_type = SOCK_STREAM, - .pr_domain = &inet6domain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp6_input, - .pr_ctlinput = sctp6_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp6_usrreqs + .pr_type = SOCK_STREAM, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp6_input, + .pr_ctlinput = sctp6_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_drain = sctp_drain, + .pr_usrreqs = &sctp6_usrreqs }, #endif /* SCTP */ { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:29:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1198106564A; Fri, 10 Feb 2012 22:29:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F87A8FC1D; Fri, 10 Feb 2012 22:29:41 +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 q1AMTf5k098834; Fri, 10 Feb 2012 22:29:41 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMTf3E098832; Fri, 10 Feb 2012 22:29:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102229.q1AMTf3E098832@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231454 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:29:41 -0000 Author: tuexen Date: Fri Feb 10 22:29:41 2012 New Revision: 231454 URL: http://svn.freebsd.org/changeset/base/231454 Log: MFC r223965: Don't check for SOCK_DGRAM anymore. Also remove multicast related code which is not necessary anymore. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:26:33 2012 (r231453) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:29:41 2012 (r231454) @@ -2523,8 +2523,7 @@ sctp_inpcb_alloc(struct socket *so, uint so->so_pcb = (caddr_t)inp; - if ((SCTP_SO_TYPE(so) == SOCK_DGRAM) || - (SCTP_SO_TYPE(so) == SOCK_SEQPACKET)) { + if (SCTP_SO_TYPE(so) == SOCK_SEQPACKET) { /* UDP style socket */ inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE | SCTP_PCB_FLAGS_UNBOUND); @@ -3721,13 +3720,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, (void)sctp_m_free(ip_pcb->inp_options); ip_pcb->inp_options = 0; } -#ifdef INET - if (ip_pcb->inp_moptions) { - inp_freemoptions(ip_pcb->inp_moptions); - ip_pcb->inp_moptions = 0; - } -#endif - #ifdef INET6 if (ip_pcb->inp_vflag & INP_IPV6) { struct in6pcb *in6p; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:31:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DD31065678; Fri, 10 Feb 2012 22:31:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E37B8FC18; Fri, 10 Feb 2012 22:31:47 +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 q1AMVlDp098947; Fri, 10 Feb 2012 22:31:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMVlBp098945; Fri, 10 Feb 2012 22:31:47 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102231.q1AMVlBp098945@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:31:47 +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: r231455 - in stable/8/usr.bin: chpass netstat su X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:31:47 -0000 Author: tuexen Date: Fri Feb 10 22:31:47 2012 New Revision: 231455 URL: http://svn.freebsd.org/changeset/base/231455 Log: MFC r224271: Fix the following bugs related to the SCTP support of netstat: * Correctly handle -a. * -A isn't supported. * Show all closed 1-to-1 and 1-to-many style sockets. * Show all listening 1-to-many style sockets. * Use consistent formatting for -W. Modified: stable/8/usr.bin/netstat/sctp.c (contents, props changed) Directory Properties: stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) Modified: stable/8/usr.bin/netstat/sctp.c ============================================================================== --- stable/8/usr.bin/netstat/sctp.c Fri Feb 10 22:29:41 2012 (r231454) +++ stable/8/usr.bin/netstat/sctp.c Fri Feb 10 22:31:47 2012 (r231455) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved. + * Copyright (c) 2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -63,7 +64,6 @@ __FBSDID("$FreeBSD$"); #ifdef SCTP -void inetprint(struct in_addr *, int, const char *, int); static void sctp_statesprint(uint32_t state); #define NETSTAT_SCTP_STATES_CLOSED 0x0 @@ -102,6 +102,124 @@ struct xraddr_entry { LIST_ENTRY(xraddr_entry) xraddr_entries; }; +/* + * Construct an Internet address representation. + * If numeric_addr has been supplied, give + * numeric value, otherwise try for symbolic name. + */ +static char * +inetname(struct in_addr *inp) +{ + char *cp; + static char line[MAXHOSTNAMELEN]; + struct hostent *hp; + struct netent *np; + + cp = 0; + if (!numeric_addr && inp->s_addr != INADDR_ANY) { + int net = inet_netof(*inp); + int lna = inet_lnaof(*inp); + + if (lna == INADDR_ANY) { + np = getnetbyaddr(net, AF_INET); + if (np) + cp = np->n_name; + } + if (cp == 0) { + hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); + if (hp) { + cp = hp->h_name; + trimdomain(cp, strlen(cp)); + } + } + } + if (inp->s_addr == INADDR_ANY) + strcpy(line, "*"); + else if (cp) { + strlcpy(line, cp, sizeof(line)); + } else { + inp->s_addr = ntohl(inp->s_addr); +#define C(x) ((u_int)((x) & 0xff)) + sprintf(line, "%u.%u.%u.%u", C(inp->s_addr >> 24), + C(inp->s_addr >> 16), C(inp->s_addr >> 8), C(inp->s_addr)); + inp->s_addr = htonl(inp->s_addr); + } + return (line); +} + +#ifdef INET6 +static char ntop_buf[INET6_ADDRSTRLEN]; + +static char * +inet6name(struct in6_addr *in6p) +{ + char *cp; + static char line[50]; + struct hostent *hp; + static char domain[MAXHOSTNAMELEN]; + static int first = 1; + + if (first && !numeric_addr) { + first = 0; + if (gethostname(domain, MAXHOSTNAMELEN) == 0 && + (cp = index(domain, '.'))) + (void) strcpy(domain, cp + 1); + else + domain[0] = 0; + } + cp = 0; + if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) { + hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6); + if (hp) { + if ((cp = index(hp->h_name, '.')) && + !strcmp(cp + 1, domain)) + *cp = 0; + cp = hp->h_name; + } + } + if (IN6_IS_ADDR_UNSPECIFIED(in6p)) + strcpy(line, "*"); + else if (cp) + strcpy(line, cp); + else + sprintf(line, "%s", + inet_ntop(AF_INET6, (void *)in6p, ntop_buf, + sizeof(ntop_buf))); + return (line); +} +#endif + +static void +sctp_print_address(union sctp_sockstore *address, int port, int num_port) +{ + struct servent *sp = 0; + char line[80], *cp; + int width; + + switch (address->sa.sa_family) { + case AF_INET: + sprintf(line, "%.*s.", Wflag ? 39 : 16, inetname(&address->sin.sin_addr)); + break; +#ifdef INET6 + case AF_INET6: + sprintf(line, "%.*s.", Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr)); + break; +#endif + default: + sprintf(line, "%.*s.", Wflag ? 39 : 16, ""); + break; + } + cp = index(line, '\0'); + if (!num_port && port) + sp = getservbyport((int)port, "sctp"); + if (sp || port == 0) + sprintf(cp, "%.15s ", sp ? sp->s_name : "*"); + else + sprintf(cp, "%d ", ntohs((u_short)port)); + width = Wflag ? 45 : 22; + printf("%-*.*s ", width, width, line); +} + static int sctp_skip_xinpcb_ifneed(char *buf, const size_t buflen, size_t *offset) { @@ -150,18 +268,14 @@ sctp_skip_xinpcb_ifneed(char *buf, const } static void -sctp_process_tcb(struct xsctp_tcb *xstcb, const char *name, +sctp_process_tcb(struct xsctp_tcb *xstcb, char *buf, const size_t buflen, size_t *offset, int *indent) { int i, xl_total = 0, xr_total = 0, x_max; - struct sockaddr *sa; struct xsctp_raddr *xraddr; struct xsctp_laddr *xladdr; struct xladdr_entry *prev_xl = NULL, *xl = NULL, *xl_tmp; struct xraddr_entry *prev_xr = NULL, *xr = NULL, *xr_tmp; -#ifdef INET6 - struct sockaddr_in6 *in6; -#endif LIST_INIT(&xladdr_head); LIST_INIT(&xraddr_head); @@ -220,38 +334,22 @@ sctp_process_tcb(struct xsctp_tcb *xstcb x_max = (xl_total > xr_total) ? xl_total : xr_total; for (i = 0; i < x_max; i++) { if (((*indent == 0) && i > 0) || *indent > 0) - printf("%-11s ", " "); + printf("%-12s ", " "); if (xl != NULL) { - sa = &(xl->xladdr->address.sa); - if ((sa->sa_family) == AF_INET) - inetprint(&((struct sockaddr_in *)sa)->sin_addr, - htons(xstcb->local_port), - name, numeric_port); -#ifdef INET6 - else { - in6 = (struct sockaddr_in6 *)sa; - inet6print(&in6->sin6_addr, - htons(xstcb->local_port), - name, numeric_port); + sctp_print_address(&(xl->xladdr->address), + htons(xstcb->local_port), numeric_port); + } else { + if (Wflag) { + printf("%-45s ", " "); + } else { + printf("%-22s ", " "); } -#endif } if (xr != NULL && !Lflag) { - sa = &(xr->xraddr->address.sa); - if ((sa->sa_family) == AF_INET) - inetprint(&((struct sockaddr_in *)sa)->sin_addr, - htons(xstcb->remote_port), - name, numeric_port); -#ifdef INET6 - else { - in6 = (struct sockaddr_in6 *)sa; - inet6print(&in6->sin6_addr, - htons(xstcb->remote_port), - name, numeric_port); - } -#endif + sctp_print_address(&(xr->xraddr->address), + htons(xstcb->remote_port), numeric_port); } if (xl != NULL) @@ -285,53 +383,21 @@ out: } } -#ifdef SCTP_DEBUG -uint32_t sctp_pdup[64]; -int sctp_pcnt = 0; -#endif - static void -sctp_process_inpcb(struct xsctp_inpcb *xinpcb, const char *name, +sctp_process_inpcb(struct xsctp_inpcb *xinpcb, char *buf, const size_t buflen, size_t *offset) { - int offset_backup, indent = 0, xladdr_total = 0, is_listening = 0; + int indent = 0, xladdr_total = 0, is_listening = 0; static int first = 1; - char *tname; + char *tname, *pname; struct xsctp_tcb *xstcb; struct xsctp_laddr *xladdr; - struct sockaddr *sa; -#ifdef INET6 - struct sockaddr_in6 *in6; -#endif + size_t offset_laddr; + int process_closed; - if ((xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE) == - SCTP_PCB_FLAGS_TCPTYPE && xinpcb->maxqlen > 0) + if (xinpcb->maxqlen > 0) is_listening = 1; - if (!Lflag && !is_listening && - !(xinpcb->flags & SCTP_PCB_FLAGS_CONNECTED)) { -#ifdef SCTP_DEBUG - int i, found = 0; - - for (i = 0; i < sctp_pcnt; i++) { - if (sctp_pdup[i] == xinpcb->flags) { - found = 1; - break; - } - } - if (!found) { - sctp_pdup[sctp_pcnt++] = xinpcb->flags; - if (sctp_pcnt >= 64) - sctp_pcnt = 0; - printf("[0x%08x]", xinpcb->flags); - } -#endif - offset_backup = *offset; - if (!sctp_skip_xinpcb_ifneed(buf, buflen, offset)) - return; - *offset = offset_backup; - } - if (first) { if (!Lflag) { printf("Active SCTP associations"); @@ -340,90 +406,115 @@ sctp_process_inpcb(struct xsctp_inpcb *x } else printf("Current listen queue sizes (qlen/maxqlen)"); putchar('\n'); - if (Aflag) - printf("%-8.8s ", "Socket"); if (Lflag) - printf("%-5.5s %-5.5s %-8.8s %-22.22s\n", + printf("%-6.6s %-5.5s %-8.8s %-22.22s\n", "Proto", "Type", "Listen", "Local Address"); else - printf((Aflag && !Wflag) ? - "%-5.5s %-5.5s %-18.18s %-18.18s %s\n" : - "%-5.5s %-5.5s %-22.22s %-22.22s %s\n", - "Proto", "Type", - "Local Address", "Foreign Address", - "(state)"); + if (Wflag) + printf("%-6.6s %-5.5s %-45.45s %-45.45s %s\n", + "Proto", "Type", + "Local Address", "Foreign Address", + "(state)"); + else + printf("%-6.6s %-5.5s %-22.22s %-22.22s %s\n", + "Proto", "Type", + "Local Address", "Foreign Address", + "(state)"); first = 0; } - if (Lflag && xinpcb->maxqlen == 0) { + xladdr = (struct xsctp_laddr *)(buf + *offset); + if (Lflag && !is_listening) { (int)sctp_skip_xinpcb_ifneed(buf, buflen, offset); return; } - if (Aflag) - printf("%8lx ", (u_long)xinpcb); - printf("%-5.5s ", name); + if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { + /* Can't distinguish between sctp46 and sctp6 */ + pname = "sctp46"; + } else { + pname = "sctp4"; + } if (xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE) tname = "1to1"; else if (xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE) tname = "1toN"; else - return; - - printf("%-5.5s ", tname); + tname = "????"; if (Lflag) { char buf1[9]; snprintf(buf1, 9, "%hu/%hu", xinpcb->qlen, xinpcb->maxqlen); + printf("%-6.6s %-5.5s ", pname, tname); printf("%-8.8s ", buf1); } - /* - * process the local address. This routine are used for Lflag. - */ + + offset_laddr = *offset; + process_closed = 0; +retry: while (*offset < buflen) { xladdr = (struct xsctp_laddr *)(buf + *offset); *offset += sizeof(struct xsctp_laddr); - if (xladdr->last == 1) + if (xladdr->last) { + if (aflag && !Lflag && (xladdr_total == 0) && process_closed) { + printf("%-6.6s %-5.5s ", pname, tname); + if (Wflag) { + printf("%-91.91s CLOSED", " "); + } else { + printf("%-45.45s CLOSED", " "); + } + } + if (process_closed || is_listening) { + putchar('\n'); + } break; + } - if (!Lflag && !is_listening) + if (!Lflag && !is_listening && !process_closed) continue; - if (xladdr_total != 0) + if (xladdr_total == 0) { + printf("%-6.6s %-5.5s ", pname, tname); + } else { putchar('\n'); - if (xladdr_total > 0) printf((Lflag) ? - "%-20.20s " : "%-11.11s ", " "); - - sa = &(xladdr->address.sa); - if ((sa->sa_family) == AF_INET) - inetprint(&((struct sockaddr_in *)sa)->sin_addr, - htons(xinpcb->local_port), name, numeric_port); -#ifdef INET6 - else { - in6 = (struct sockaddr_in6 *)sa; - inet6print(&in6->sin6_addr, - htons(xinpcb->local_port), name, numeric_port); + "%-21.21s " : "%-12.12s ", " "); + } + sctp_print_address(&(xladdr->address), + htons(xinpcb->local_port), numeric_port); + if (aflag && !Lflag && xladdr_total == 0) { + if (Wflag) { + if (process_closed) { + printf("%-45.45s CLOSED", " "); + } else { + printf("%-45.45s LISTEN", " "); + } + } else { + if (process_closed) { + printf("%-22.22s CLOSED", " "); + } else { + printf("%-22.22s LISTEN", " "); + } + } } -#endif - - if (!Lflag && xladdr_total == 0 && is_listening == 1) - printf("%-22.22s LISTEN", " "); - xladdr_total++; } xstcb = (struct xsctp_tcb *)(buf + *offset); *offset += sizeof(struct xsctp_tcb); + if (aflag && (xladdr_total == 0) && xstcb->last && !process_closed) { + process_closed = 1; + *offset = offset_laddr; + goto retry; + } while (xstcb->last == 0 && *offset < buflen) { - sctp_process_tcb(xstcb, name, buf, buflen, offset, &indent); + printf("%-6.6s %-5.5s ", pname, tname); + sctp_process_tcb(xstcb, buf, buflen, offset, &indent); indent++; xstcb = (struct xsctp_tcb *)(buf + *offset); *offset += sizeof(struct xsctp_tcb); } - - putchar('\n'); } /* @@ -461,7 +552,7 @@ sctp_protopr(u_long off __unused, xinpcb = (struct xsctp_inpcb *)(buf + offset); offset += sizeof(struct xsctp_inpcb); while (xinpcb->last == 0 && offset < len) { - sctp_process_inpcb(xinpcb, name, buf, (const size_t)len, + sctp_process_inpcb(xinpcb, buf, (const size_t)len, &offset); xinpcb = (struct xsctp_inpcb *)(buf + offset); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:42:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E7C9106564A; Fri, 10 Feb 2012 22:42:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 891F28FC13; Fri, 10 Feb 2012 22:42:04 +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 q1AMg4UC099307; Fri, 10 Feb 2012 22:42:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMg4Z9099298; Fri, 10 Feb 2012 22:42:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102242.q1AMg4Z9099298@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:42:04 +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: r231456 - in stable/8: . contrib/bsnmp/snmpd contrib/top contrib/xz gnu/usr.bin lib lib/libc/net lib/liblzma lib/librtld_db lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/s... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:42:04 -0000 Author: tuexen Date: Fri Feb 10 22:42:03 2012 New Revision: 231456 URL: http://svn.freebsd.org/changeset/base/231456 Log: MFC r224641: The result of a joint work between rrs@ and myself at the IETF: * Decouple the path supervision using a separate HB timer per path. * Add support for potentially failed state. * Bring back RTO.min to 1 second. * Accept packets on IP-addresses already announced via an ASCONF * While there: do some cleanups. Modified: stable/8/lib/libc/net/sctp_sys_calls.c stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_timer.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/README (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/df/ (props changed) stable/8/bin/echo/ (props changed) stable/8/bin/ed/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kenv/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/stty/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/dtracetoolkit/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/amd/ (props changed) stable/8/contrib/bc/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/cvs/ (props changed) stable/8/contrib/diff/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gcclibs/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/gnu-sort/ (props changed) stable/8/contrib/gperf/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libarchive/ (props changed) stable/8/contrib/libarchive/cpio/ (props changed) stable/8/contrib/libarchive/libarchive/ (props changed) stable/8/contrib/libarchive/libarchive_fe/ (props changed) stable/8/contrib/libarchive/tar/ (props changed) stable/8/contrib/libbegemot/ (props changed) stable/8/contrib/libf2c/ (props changed) stable/8/contrib/libobjc/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libreadline/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/lukemftpd/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ngatm/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/opie/ (props changed) stable/8/contrib/pam_modules/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/pnpinfo/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/smbfs/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/texinfo/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/crypto/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/etc/ (props changed) stable/8/games/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) stable/8/gnu/usr.bin/cc/include/ (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/gperf/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/comsat/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rshd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/conscontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/md5/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mdmfs/ (props changed) stable/8/sbin/mknod/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/mount_unionfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/quotacheck/ (props changed) stable/8/sbin/rcorder/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/shutdown/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/doc/ (props changed) stable/8/share/doc/papers/devfs/ (props changed) stable/8/share/doc/papers/jail/ (props changed) stable/8/share/doc/smm/01.setup/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/misc/bsd-family-tree (props changed) stable/8/share/mk/ (props changed) stable/8/share/skel/ (props changed) stable/8/share/syscons/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acct/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/date/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/bin/test/ (props changed) stable/8/tools/regression/doat/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/netinet/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/sockets/unix_gc/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/test/malloc/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/sctp.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/IPXrouted/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/Makefile.inc (props changed) stable/8/usr.sbin/ac/ (props changed) stable/8/usr.sbin/accton/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/adduser/ (props changed) stable/8/usr.sbin/amd/ (props changed) stable/8/usr.sbin/ancontrol/ (props changed) stable/8/usr.sbin/apm/ (props changed) stable/8/usr.sbin/apmd/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/audit/ (props changed) stable/8/usr.sbin/auditd/ (props changed) stable/8/usr.sbin/auditreduce/ (props changed) stable/8/usr.sbin/authpf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/bluetooth/l2control/ (props changed) stable/8/usr.sbin/bluetooth/l2ping/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/boot98cfg/ (props changed) stable/8/usr.sbin/bootparamd/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/8/usr.sbin/btxld/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chkgrp/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/chroot/ (props changed) stable/8/usr.sbin/ckdist/ (props changed) stable/8/usr.sbin/clear_locks/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/cron/crontab/ (props changed) stable/8/usr.sbin/crunch/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/daemon/ (props changed) stable/8/usr.sbin/dconschat/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/digictl/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dnssec-dsfromkey/ (props changed) stable/8/usr.sbin/dnssec-keyfromlabel/ (props changed) stable/8/usr.sbin/dnssec-keygen/ (props changed) stable/8/usr.sbin/dnssec-signzone/ (props changed) stable/8/usr.sbin/dumpcis/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/editmap/ (props changed) stable/8/usr.sbin/edquota/ (props changed) stable/8/usr.sbin/eeprom/ (props changed) stable/8/usr.sbin/extattr/ (props changed) stable/8/usr.sbin/extattrctl/ (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/ftp-proxy/ (props changed) stable/8/usr.sbin/fwcontrol/ (props changed) stable/8/usr.sbin/getfmac/ (props changed) stable/8/usr.sbin/getpmac/ (props changed) stable/8/usr.sbin/gssd/ (props changed) stable/8/usr.sbin/gstat/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/ifmcstat/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/ip6addrctl/ (props changed) stable/8/usr.sbin/ipfwpcap/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jexec/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/kbdcontrol/ (props changed) stable/8/usr.sbin/kbdmap/ (props changed) stable/8/usr.sbin/kernbb/ (props changed) stable/8/usr.sbin/keyserv/ (props changed) stable/8/usr.sbin/kgmon/ (props changed) stable/8/usr.sbin/kgzip/ (props changed) stable/8/usr.sbin/kldxref/ (props changed) stable/8/usr.sbin/lastlogin/ (props changed) stable/8/usr.sbin/lmcconfig/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/lptcontrol/ (props changed) stable/8/usr.sbin/mailstats/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makemap/ (props changed) stable/8/usr.sbin/manctl/ (props changed) stable/8/usr.sbin/memcontrol/ (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mixer/ (props changed) stable/8/usr.sbin/mld6query/ (props changed) stable/8/usr.sbin/mlxcontrol/ (props changed) stable/8/usr.sbin/mount_nwfs/ (props changed) stable/8/usr.sbin/mount_portalfs/ (props changed) stable/8/usr.sbin/mount_smbfs/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptable/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/named-checkconf/ (props changed) stable/8/usr.sbin/named-checkzone/ (props changed) stable/8/usr.sbin/named.reload/ (props changed) stable/8/usr.sbin/ndiscvt/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfscbd/ (props changed) stable/8/usr.sbin/nfsd/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/nfsrevoke/ (props changed) stable/8/usr.sbin/nfsuserd/ (props changed) stable/8/usr.sbin/ngctl/ (props changed) stable/8/usr.sbin/nghook/ (props changed) stable/8/usr.sbin/nologin/ (props changed) stable/8/usr.sbin/nscd/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/nvram/ (props changed) stable/8/usr.sbin/ofwdump/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/pnpinfo/ (props changed) stable/8/usr.sbin/portsnap/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/praliases/ (props changed) stable/8/usr.sbin/praudit/ (props changed) stable/8/usr.sbin/procctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/pw/ (props changed) stable/8/usr.sbin/pwd_mkdb/ (props changed) stable/8/usr.sbin/quot/ (props changed) stable/8/usr.sbin/quotaon/ (props changed) stable/8/usr.sbin/rarpd/ (props changed) stable/8/usr.sbin/repquota/ (props changed) stable/8/usr.sbin/rip6query/ (props changed) stable/8/usr.sbin/rmt/ (props changed) stable/8/usr.sbin/rndc/ (props changed) stable/8/usr.sbin/rndc-confgen/ (props changed) stable/8/usr.sbin/route6d/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.statd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rpc.yppasswdd/ (props changed) stable/8/usr.sbin/rpc.ypupdated/ (props changed) stable/8/usr.sbin/rpc.ypxfrd/ (props changed) stable/8/usr.sbin/rpcbind/ (props changed) stable/8/usr.sbin/rrenumd/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtprio/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/rwhod/ (props changed) stable/8/usr.sbin/sa/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/sendmail/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/service/Makefile (props changed) stable/8/usr.sbin/service/service.8 (props changed) stable/8/usr.sbin/service/service.sh (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/services_mkdb/Makefile (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.8 (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.c (props changed) stable/8/usr.sbin/services_mkdb/uniq.c (props changed) stable/8/usr.sbin/setfib/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/sicontrol/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/snapinfo/ (props changed) stable/8/usr.sbin/spkrtest/ (props changed) stable/8/usr.sbin/spray/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/tcpdchk/ (props changed) stable/8/usr.sbin/tcpdmatch/ (props changed) stable/8/usr.sbin/tcpdrop/ (props changed) stable/8/usr.sbin/tcpdump/ (props changed) stable/8/usr.sbin/timed/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/trpt/ (props changed) stable/8/usr.sbin/tzsetup/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/usbdevs/ (props changed) stable/8/usr.sbin/usbdump/ (props changed) stable/8/usr.sbin/usbdump/Makefile (props changed) stable/8/usr.sbin/usbdump/usbdump.8 (props changed) stable/8/usr.sbin/usbdump/usbdump.c (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/vipw/ (props changed) stable/8/usr.sbin/wake/ (props changed) stable/8/usr.sbin/watch/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wlandebug/ (props changed) stable/8/usr.sbin/wlconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/yp_mkdb/ (props changed) stable/8/usr.sbin/ypbind/ (props changed) stable/8/usr.sbin/yppoll/ (props changed) stable/8/usr.sbin/yppush/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/ypset/ (props changed) stable/8/usr.sbin/zic/ (props changed) stable/8/usr.sbin/zzz/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 22:42:03 2012 (r231456) @@ -410,6 +410,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_DEFAULT_PRINFO: ((struct sctp_default_prinfo *)arg)->pr_assoc_id = id; break; + case SCTP_PEER_ADDR_THLDS: + ((struct sctp_paddrthlds *)arg)->spt_assoc_id = id; + break; default: break; } Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 22:42:03 2012 (r231456) @@ -119,6 +119,7 @@ struct sctp_paramhdr { #define SCTP_RECVNXTINFO 0x00000020 #define SCTP_DEFAULT_SNDINFO 0x00000021 #define SCTP_DEFAULT_PRINFO 0x00000022 +#define SCTP_PEER_ADDR_THLDS 0x00000023 /* * read-only options @@ -564,7 +565,6 @@ struct sctp_error_unrecognized_chunk { #define SCTP_BLK_LOGGING_ENABLE 0x00000001 #define SCTP_CWND_MONITOR_ENABLE 0x00000002 #define SCTP_CWND_LOGGING_ENABLE 0x00000004 -#define SCTP_EARLYFR_LOGGING_ENABLE 0x00000010 #define SCTP_FLIGHT_LOGGING_ENABLE 0x00000020 #define SCTP_FR_LOGGING_ENABLE 0x00000040 #define SCTP_LOCK_LOGGING_ENABLE 0x00000080 @@ -572,23 +572,23 @@ struct sctp_error_unrecognized_chunk { #define SCTP_MBCNT_LOGGING_ENABLE 0x00000200 #define SCTP_MBUF_LOGGING_ENABLE 0x00000400 #define SCTP_NAGLE_LOGGING_ENABLE 0x00000800 -#define SCTP_RECV_RWND_LOGGING_ENABLE 0x00001000 +#define SCTP_RECV_RWND_LOGGING_ENABLE 0x00001000 #define SCTP_RTTVAR_LOGGING_ENABLE 0x00002000 #define SCTP_SACK_LOGGING_ENABLE 0x00004000 -#define SCTP_SACK_RWND_LOGGING_ENABLE 0x00008000 +#define SCTP_SACK_RWND_LOGGING_ENABLE 0x00008000 #define SCTP_SB_LOGGING_ENABLE 0x00010000 #define SCTP_STR_LOGGING_ENABLE 0x00020000 #define SCTP_WAKE_LOGGING_ENABLE 0x00040000 #define SCTP_LOG_MAXBURST_ENABLE 0x00080000 #define SCTP_LOG_RWND_ENABLE 0x00100000 -#define SCTP_LOG_SACK_ARRIVALS_ENABLE 0x00200000 -#define SCTP_LTRACE_CHUNK_ENABLE 0x00400000 -#define SCTP_LTRACE_ERROR_ENABLE 0x00800000 -#define SCTP_LAST_PACKET_TRACING 0x01000000 -#define SCTP_THRESHOLD_LOGGING 0x02000000 -#define SCTP_LOG_AT_SEND_2_SCTP 0x04000000 -#define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 -#define SCTP_LOG_TRY_ADVANCE 0x10000000 +#define SCTP_LOG_SACK_ARRIVALS_ENABLE 0x00200000 +#define SCTP_LTRACE_CHUNK_ENABLE 0x00400000 +#define SCTP_LTRACE_ERROR_ENABLE 0x00800000 +#define SCTP_LAST_PACKET_TRACING 0x01000000 +#define SCTP_THRESHOLD_LOGGING 0x02000000 +#define SCTP_LOG_AT_SEND_2_SCTP 0x04000000 +#define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 +#define SCTP_LOG_TRY_ADVANCE 0x10000000 #undef SCTP_PACKED Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 22:42:03 2012 (r231456) @@ -198,8 +198,9 @@ sctp_asconf_error_response(uint32_t id, static struct mbuf * sctp_process_asconf_add_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, - struct sctp_tcb *stcb, int response_required) + struct sctp_tcb *stcb, int send_hb, int response_required) { + struct sctp_nets *net; struct mbuf *m_reply = NULL; struct sockaddr_storage sa_source, sa_store; struct sctp_paramhdr *ph; @@ -284,7 +285,7 @@ sctp_process_asconf_add_ip(struct mbuf * SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); } /* add the address */ - if (sctp_add_remote_addr(stcb, sa, SCTP_DONOT_SETSCOPE, + if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE, SCTP_ADDR_DYNAMIC_ADDED) != 0) { SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: error adding address\n"); @@ -298,10 +299,12 @@ sctp_process_asconf_add_ip(struct mbuf * m_reply = sctp_asconf_success_response(aph->correlation_id); } - sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, - NULL, SCTP_FROM_SCTP_ASCONF + SCTP_LOC_1); + sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, stcb->sctp_ep, stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, - stcb, NULL); + stcb, net); + if (send_hb) { + sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + } } return m_reply; } @@ -554,7 +557,12 @@ sctp_process_asconf_set_primary(struct m "process_asconf_set_primary: primary address set\n"); /* notify upper layer */ sctp_ulp_notify(SCTP_NOTIFY_ASCONF_SET_PRIMARY, stcb, 0, sa, SCTP_SO_NOT_LOCKED); - + if ((stcb->asoc.primary_destination->dest_state & SCTP_ADDR_REACHABLE) && + (!(stcb->asoc.primary_destination->dest_state & SCTP_ADDR_PF)) && + (stcb->asoc.alternate)) { + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } if (response_required) { m_reply = sctp_asconf_success_response(aph->correlation_id); } @@ -622,7 +630,7 @@ sctp_handle_asconf(struct mbuf *m, unsig struct sctp_asconf_ack_chunk *ack_cp; struct sctp_asconf_paramhdr *aph, *ack_aph; struct sctp_ipv6addr_param *p_addr; - unsigned int asconf_limit; + unsigned int asconf_limit, cnt; int error = 0; /* did an error occur? */ /* asconf param buffer */ @@ -717,6 +725,7 @@ sctp_handle_asconf(struct mbuf *m, unsig goto send_reply; } /* process through all parameters */ + cnt = 0; while (aph != NULL) { unsigned int param_length, param_type; @@ -749,7 +758,8 @@ sctp_handle_asconf(struct mbuf *m, unsig case SCTP_ADD_IP_ADDRESS: asoc->peer_supports_asconf = 1; m_result = sctp_process_asconf_add_ip(m, aph, stcb, - error); + (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error); + cnt++; break; case SCTP_DEL_IP_ADDRESS: asoc->peer_supports_asconf = 1; @@ -1959,7 +1969,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * int status; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0 && + if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0 || sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_ASCONF)) { /* subset bound, no ASCONF allowed case, so ignore */ return; @@ -2075,8 +2085,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - addr_locked); + sctp_send_asconf(stcb, NULL, addr_locked); #endif } } @@ -2328,8 +2337,7 @@ sctp_asconf_iterator_stcb(struct sctp_in * If we have queued params in the open state, send out an ASCONF. */ if (num_queued > 0) { - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); } } @@ -2384,8 +2392,7 @@ sctp_set_primary_ip_address_sa(struct sc stcb->sctp_ep, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); #endif } } else { @@ -2421,8 +2428,7 @@ sctp_set_primary_ip_address(struct sctp_ stcb->sctp_ep, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); #endif } } @@ -2965,8 +2971,7 @@ sctp_process_initack_addresses(struct sc stcb->sctp_ep, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); #endif } } @@ -3540,5 +3545,5 @@ sctp_asconf_send_nat_state_update(struct } skip_rest: /* Now we must send the asconf into the queue */ - sctp_send_asconf(stcb, net, 0); + sctp_send_asconf(stcb, net, SCTP_ADDR_NOT_LOCKED); } Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_cc_functions.c Fri Feb 10 22:42:03 2012 (r231456) @@ -728,40 +728,6 @@ sctp_cwnd_update_after_sack_common(struc } } #endif - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - /* - * So, first of all do we need to have a Early FR - * timer running? - */ - if ((!TAILQ_EMPTY(&asoc->sent_queue) && - (net->ref_count > 1) && - (net->flight_size < net->cwnd)) || - (reneged_all)) { - /* - * yes, so in this case stop it if its - * running, and then restart it. Reneging - * all is a special case where we want to - * run the Early FR timer and then force the - * last few unacked to be sent, causing us - * to illicit a sack with gaps to force out - * the others. - */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck2); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); - } - SCTP_STAT_INCR(sctps_earlyfrstrid); - sctp_timer_start(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net); - } else { - /* No, stop it if its running */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck3); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_21); - } - } - } /* if nothing was acked on this destination skip it */ if (net->net_ack == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -769,51 +735,6 @@ sctp_cwnd_update_after_sack_common(struc } continue; } - if (net->net_ack2 > 0) { - /* - * Karn's rule applies to clearing error count, this - * is optional. - */ - net->error_count = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == - SCTP_ADDR_NOT_REACHABLE) { - /* addr came good */ - net->dest_state &= ~SCTP_ADDR_NOT_REACHABLE; - net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); - /* now was it the primary? if so restore */ - if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - (void)sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); - } - } - /* - * JRS 5/14/07 - If CMT PF is on and the destination - * is in PF state, set the destination to active - * state and set the cwnd to one or two MTU's based - * on whether PF1 or PF2 is being used. - * - * Should we stop any running T3 timer here? - */ - if ((asoc->sctp_cmt_on_off > 0) && - (asoc->sctp_cmt_pf > 0) && - ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { - net->dest_state &= ~SCTP_ADDR_PF; - old_cwnd = net->cwnd; - net->cwnd = net->mtu * asoc->sctp_cmt_pf; - SDT_PROBE(sctp, cwnd, net, ack, - stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, - old_cwnd, net->cwnd); - SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); - /* - * Since the cwnd value is explicitly set, - * skip the code that updates the cwnd - * value. - */ - goto skip_cwnd_update; - } - } #ifdef JANA_CMT_FAST_RECOVERY /* * CMT fast recovery code @@ -833,7 +754,7 @@ sctp_cwnd_update_after_sack_common(struc * If we are in loss recovery we skip any cwnd * update */ - goto skip_cwnd_update; + return; } /* * Did any measurements go on for this network? @@ -856,7 +777,7 @@ sctp_cwnd_update_after_sack_common(struc if (net->cc_mod.rtcc.lbw) { if (cc_bw_limit(stcb, net, nbw)) { /* Hold here, no update */ - goto skip_cwnd_update; + continue; } } else { uint64_t vtag, probepoint; @@ -1049,27 +970,25 @@ sctp_cwnd_update_after_sack_common(struc SCTP_CWND_LOG_NO_CUMACK); } } -skip_cwnd_update: - /* - * NOW, according to Karn's rule do we need to restore the - * RTO timer back? Check our net_ack2. If not set then we - * have a ambiguity.. i.e. all data ack'd was sent to more - * than one place. - */ - if (net->net_ack2) { - /* restore any doubled timers */ - net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; - if (net->RTO < stcb->asoc.minrto) { - net->RTO = stcb->asoc.minrto; - } - if (net->RTO > stcb->asoc.maxrto) { - net->RTO = stcb->asoc.maxrto; - } - } } } static void +sctp_cwnd_update_exit_pf_common(struct sctp_tcb *stcb, struct sctp_nets *net) +{ + int old_cwnd; + + old_cwnd = net->cwnd; + net->cwnd = net->mtu; + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, + old_cwnd, net->cwnd); + SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", + net, net->cwnd); +} + + +static void sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; @@ -1344,32 +1263,6 @@ sctp_cwnd_update_after_output(struct sct } static void -sctp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, - struct sctp_tcb *stcb, struct sctp_nets *net) -{ - int old_cwnd = net->cwnd; - - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_EARLY_FR_TMR, SCTP_SO_NOT_LOCKED); - /* - * make a small adjustment to cwnd and force to CA. - */ - if (net->cwnd > net->mtu) - /* drop down one MTU after sending */ - net->cwnd -= net->mtu; - if (net->cwnd < net->ssthresh) - /* still in SS move to CA */ - net->ssthresh = net->cwnd - 1; - SDT_PROBE(sctp, cwnd, net, fr, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (old_cwnd - net->cwnd), SCTP_CWND_LOG_FROM_FR); - } -} - -static void sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -1858,40 +1751,6 @@ sctp_hs_cwnd_update_after_sack(struct sc } } #endif - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - /* - * So, first of all do we need to have a Early FR - * timer running? - */ - if ((!TAILQ_EMPTY(&asoc->sent_queue) && - (net->ref_count > 1) && - (net->flight_size < net->cwnd)) || - (reneged_all)) { - /* - * yes, so in this case stop it if its - * running, and then restart it. Reneging - * all is a special case where we want to - * run the Early FR timer and then force the - * last few unacked to be sent, causing us - * to illicit a sack with gaps to force out - * the others. - */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck2); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); - } - SCTP_STAT_INCR(sctps_earlyfrstrid); - sctp_timer_start(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net); - } else { - /* No, stop it if its running */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck3); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_21); - } - } - } /* if nothing was acked on this destination skip it */ if (net->net_ack == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -1899,47 +1758,6 @@ sctp_hs_cwnd_update_after_sack(struct sc } continue; } - if (net->net_ack2 > 0) { - /* - * Karn's rule applies to clearing error count, this - * is optional. - */ - net->error_count = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == - SCTP_ADDR_NOT_REACHABLE) { - /* addr came good */ - net->dest_state &= ~SCTP_ADDR_NOT_REACHABLE; - net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); - /* now was it the primary? if so restore */ - if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - (void)sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); - } - } - /* - * JRS 5/14/07 - If CMT PF is on and the destination - * is in PF state, set the destination to active - * state and set the cwnd to one or two MTU's based - * on whether PF1 or PF2 is being used. - * - * Should we stop any running T3 timer here? - */ - if ((asoc->sctp_cmt_on_off > 0) && - (asoc->sctp_cmt_pf > 0) && - ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { - net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * asoc->sctp_cmt_pf; - SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); - /* - * Since the cwnd value is explicitly set, - * skip the code that updates the cwnd - * value. - */ - goto skip_cwnd_update; - } - } #ifdef JANA_CMT_FAST_RECOVERY /* * CMT fast recovery code @@ -1959,7 +1777,7 @@ sctp_hs_cwnd_update_after_sack(struct sc * If we are in loss recovery we skip any cwnd * update */ - goto skip_cwnd_update; + return; } /* * CMT: CUC algorithm. Update cwnd if pseudo-cumack has @@ -2004,23 +1822,6 @@ sctp_hs_cwnd_update_after_sack(struct sc SCTP_CWND_LOG_NO_CUMACK); } } -skip_cwnd_update: - /* - * NOW, according to Karn's rule do we need to restore the - * RTO timer back? Check our net_ack2. If not set then we - * have a ambiguity.. i.e. all data ack'd was sent to more - * than one place. - */ - if (net->net_ack2) { - /* restore any doubled timers */ - net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; - if (net->RTO < stcb->asoc.minrto) { - net->RTO = stcb->asoc.minrto; - } - if (net->RTO > stcb->asoc.maxrto) { - net->RTO = stcb->asoc.maxrto; - } - } } } @@ -2340,40 +2141,6 @@ sctp_htcp_cwnd_update_after_sack(struct } } #endif - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - /* - * So, first of all do we need to have a Early FR - * timer running? - */ - if ((!TAILQ_EMPTY(&asoc->sent_queue) && - (net->ref_count > 1) && - (net->flight_size < net->cwnd)) || - (reneged_all)) { - /* - * yes, so in this case stop it if its - * running, and then restart it. Reneging - * all is a special case where we want to - * run the Early FR timer and then force the - * last few unacked to be sent, causing us - * to illicit a sack with gaps to force out - * the others. - */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck2); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); - } - SCTP_STAT_INCR(sctps_earlyfrstrid); - sctp_timer_start(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net); - } else { - /* No, stop it if its running */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck3); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_21); - } - } - } /* if nothing was acked on this destination skip it */ if (net->net_ack == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -2381,47 +2148,6 @@ sctp_htcp_cwnd_update_after_sack(struct } continue; } - if (net->net_ack2 > 0) { - /* - * Karn's rule applies to clearing error count, this - * is optional. - */ - net->error_count = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == - SCTP_ADDR_NOT_REACHABLE) { - /* addr came good */ - net->dest_state &= ~SCTP_ADDR_NOT_REACHABLE; - net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); - /* now was it the primary? if so restore */ - if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - (void)sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); - } - } - /* - * JRS 5/14/07 - If CMT PF is on and the destination - * is in PF state, set the destination to active - * state and set the cwnd to one or two MTU's based - * on whether PF1 or PF2 is being used. - * - * Should we stop any running T3 timer here? - */ - if ((asoc->sctp_cmt_on_off > 0) && - (asoc->sctp_cmt_pf > 0) && - ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { - net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * asoc->sctp_cmt_pf; - SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); - /* - * Since the cwnd value is explicitly set, - * skip the code that updates the cwnd - * value. - */ - goto skip_cwnd_update; - } - } #ifdef JANA_CMT_FAST_RECOVERY /* * CMT fast recovery code @@ -2441,7 +2167,7 @@ sctp_htcp_cwnd_update_after_sack(struct * If we are in loss recovery we skip any cwnd * update */ - goto skip_cwnd_update; + return; } /* * CMT: CUC algorithm. Update cwnd if pseudo-cumack has @@ -2457,23 +2183,6 @@ sctp_htcp_cwnd_update_after_sack(struct SCTP_CWND_LOG_NO_CUMACK); } } -skip_cwnd_update: - /* - * NOW, according to Karn's rule do we need to restore the - * RTO timer back? Check our net_ack2. If not set then we - * have a ambiguity.. i.e. all data ack'd was sent to more - * than one place. - */ - if (net->net_ack2) { - /* restore any doubled timers */ - net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; - if (net->RTO < stcb->asoc.minrto) { - net->RTO = stcb->asoc.minrto; - } - if (net->RTO > stcb->asoc.maxrto) { - net->RTO = stcb->asoc.maxrto; - } - } } } @@ -2566,30 +2275,6 @@ sctp_htcp_cwnd_update_after_timeout(stru } static void -sctp_htcp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, - struct sctp_tcb *stcb, struct sctp_nets *net) -{ - int old_cwnd; - - old_cwnd = net->cwnd; - - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_EARLY_FR_TMR, SCTP_SO_NOT_LOCKED); - net->cc_mod.htcp_ca.last_cong = sctp_get_tick_count(); - /* - * make a small adjustment to cwnd and force to CA. - */ - if (net->cwnd > net->mtu) - /* drop down one MTU after sending */ - net->cwnd -= net->mtu; - if (net->cwnd < net->ssthresh) - /* still in SS move to CA */ - net->ssthresh = net->cwnd - 1; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (old_cwnd - net->cwnd), SCTP_CWND_LOG_FROM_FR); - } -} - -static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost) { @@ -2618,42 +2303,42 @@ struct sctp_cc_functions sctp_cc_functio { .sctp_set_initial_cc_param = sctp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_cwnd_update_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer }, { .sctp_set_initial_cc_param = sctp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_hs_cwnd_update_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_hs_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer }, { .sctp_set_initial_cc_param = sctp_htcp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_htcp_cwnd_update_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_htcp_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_htcp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_htcp_cwnd_update_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer }, { .sctp_set_initial_cc_param = sctp_set_rtcc_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_cwnd_update_rtcc_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_rtcc_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer, .sctp_cwnd_update_packet_transmitted = sctp_cwnd_update_rtcc_packet_transmitted, .sctp_cwnd_update_tsn_acknowledged = sctp_cwnd_update_rtcc_tsn_acknowledged, .sctp_cwnd_new_transmission_begins = sctp_cwnd_new_rtcc_transmission_begins, Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 22:42:03 2012 (r231456) @@ -416,7 +416,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_STR_RESET_IN_REQUEST 0x000e #define SCTP_STR_RESET_TSN_REQUEST 0x000f #define SCTP_STR_RESET_RESPONSE 0x0010 -#define SCTP_STR_RESET_ADD_STREAMS 0x0011 +#define SCTP_STR_RESET_ADD_STREAMS 0x0011 #define SCTP_MAX_RESET_PARAMS 2 #define SCTP_STREAM_RESET_TSN_DELTA 0x1000 @@ -508,14 +508,10 @@ __FBSDID("$FreeBSD$"); /* SCTP reachability state for each address */ #define SCTP_ADDR_REACHABLE 0x001 -#define SCTP_ADDR_NOT_REACHABLE 0x002 #define SCTP_ADDR_NOHB 0x004 #define SCTP_ADDR_BEING_DELETED 0x008 #define SCTP_ADDR_NOT_IN_ASSOC 0x010 -#define SCTP_ADDR_WAS_PRIMARY 0x020 -#define SCTP_ADDR_SWITCH_PRIMARY 0x040 #define SCTP_ADDR_OUT_OF_SCOPE 0x080 -#define SCTP_ADDR_DOUBLE_SWITCH 0x100 #define SCTP_ADDR_UNCONFIRMED 0x200 #define SCTP_ADDR_REQ_PRIMARY 0x400 /* JRS 5/13/07 - Added potentially failed state for CMT PF */ @@ -579,14 +575,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_TIMER_TYPE_EVENTWAKE 13 #define SCTP_TIMER_TYPE_STRRESET 14 #define SCTP_TIMER_TYPE_INPKILL 15 -#define SCTP_TIMER_TYPE_EARLYFR 17 -#define SCTP_TIMER_TYPE_ASOCKILL 18 -#define SCTP_TIMER_TYPE_ADDR_WQ 19 -#define SCTP_TIMER_TYPE_ZERO_COPY 20 -#define SCTP_TIMER_TYPE_ZCOPY_SENDQ 21 -#define SCTP_TIMER_TYPE_PRIM_DELETED 22 +#define SCTP_TIMER_TYPE_ASOCKILL 16 +#define SCTP_TIMER_TYPE_ADDR_WQ 17 +#define SCTP_TIMER_TYPE_ZERO_COPY 18 +#define SCTP_TIMER_TYPE_ZCOPY_SENDQ 19 +#define SCTP_TIMER_TYPE_PRIM_DELETED 20 /* add new timers here - and increment LAST */ -#define SCTP_TIMER_TYPE_LAST 23 +#define SCTP_TIMER_TYPE_LAST 21 #define SCTP_IS_TIMER_TYPE_VALID(t) (((t) > SCTP_TIMER_TYPE_NONE) && \ ((t) < SCTP_TIMER_TYPE_LAST)) @@ -655,16 +650,17 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEFAULT_SECRET_LIFE_SEC 3600 #define SCTP_RTO_UPPER_BOUND (60000) /* 60 sec in ms */ -#define SCTP_RTO_LOWER_BOUND (300) /* 0.3 sec is ms */ +#define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec is ms */ #define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ #define SCTP_INP_KILL_TIMEOUT 20/* number of ms to retry kill of inpcb */ #define SCTP_ASOC_KILL_TIMEOUT 10 /* number of ms to retry kill of inpcb */ -#define SCTP_DEF_MAX_INIT 8 -#define SCTP_DEF_MAX_SEND 10 -#define SCTP_DEF_MAX_PATH_RTX 5 +#define SCTP_DEF_MAX_INIT 8 +#define SCTP_DEF_MAX_SEND 10 +#define SCTP_DEF_MAX_PATH_RTX 5 +#define SCTP_DEF_PATH_PF_THRESHOLD SCTP_DEF_MAX_PATH_RTX #define SCTP_DEF_PMTU_RAISE_SEC 600 /* 10 min between raise attempts */ @@ -679,7 +675,7 @@ __FBSDID("$FreeBSD$"); /* Send window update (incr * this > hiwat). Should be a power of 2 */ #define SCTP_MINIMAL_RWND (4096) /* minimal rwnd */ -#define SCTP_ADDRMAX 24 +#define SCTP_ADDRMAX 16 /* SCTP DEBUG Switch parameters */ #define SCTP_DEBUG_TIMER1 0x00000001 Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 22:42:03 2012 (r231456) @@ -98,9 +98,10 @@ struct sctp_heartbeat_info_param { uint32_t time_value_2; uint32_t random_value1; uint32_t random_value2; - uint16_t user_req; uint8_t addr_family; uint8_t addr_len; + /* make sure that this structure is 4 byte aligned */ + uint8_t padding[2]; char address[SCTP_ADDRMAX]; } SCTP_PACKED; Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Fri Feb 10 22:31:47 2012 (r231455) +++ stable/8/sys/netinet/sctp_indata.c Fri Feb 10 22:42:03 2012 (r231456) @@ -2434,7 +2434,8 @@ sctp_sack_check(struct sctp_tcb *stcb, i sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_INDATA + SCTP_LOC_18); } - sctp_send_shutdown(stcb, stcb->asoc.primary_destination); + sctp_send_shutdown(stcb, + ((stcb->asoc.alternate) ? stcb->asoc.alternate : stcb->asoc.primary_destination)); sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } else { int is_a_gap; @@ -4054,9 +4055,50 @@ sctp_express_handle_sack(struct sctp_tcb } /* JRS - Use the congestion control given in the CC module */ - if ((asoc->last_acked_seq != cumack) && (ecne_seen == 0)) + if ((asoc->last_acked_seq != cumack) && (ecne_seen == 0)) { + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (net->net_ack2 > 0) { + /* + * Karn's rule applies to clearing error + * count, this is optional. + */ + net->error_count = 0; + if (!(net->dest_state & SCTP_ADDR_REACHABLE)) { + /* addr came good */ + net->dest_state |= SCTP_ADDR_REACHABLE; + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, + SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + } + if (net == stcb->asoc.primary_destination) { + if (stcb->asoc.alternate) { + /* + * release the alternate, + * primary is good + */ + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } + } + if (net->dest_state & SCTP_ADDR_PF) { + net->dest_state &= ~SCTP_ADDR_PF; + sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); + asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net); + /* Done with this net */ + net->net_ack = 0; + } + /* restore any doubled timers */ + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; + if (net->RTO < stcb->asoc.minrto) { + net->RTO = stcb->asoc.minrto; + } + if (net->RTO > stcb->asoc.maxrto) { + net->RTO = stcb->asoc.maxrto; + } + } + } asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, 1, 0, 0); - + } asoc->last_acked_seq = cumack; if (TAILQ_EMPTY(&asoc->sent_queue)) { @@ -4127,13 +4169,6 @@ again: stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_22); } - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck4); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_23); - } - } } } if ((j == 0) && @@ -4222,6 +4257,8 @@ again: stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, SCTP_RESPONSE_TO_USER_REQ, oper, SCTP_SO_NOT_LOCKED); } else { + struct sctp_nets *netp; + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); @@ -4229,26 +4266,36 @@ again: SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown(stcb, - stcb->asoc.primary_destination); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, - stcb->sctp_ep, stcb, asoc->primary_destination); + stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, - stcb->sctp_ep, stcb, asoc->primary_destination); + stcb->sctp_ep, stcb, netp); } } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { + struct sctp_nets *netp; + + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { goto abort_out_now; } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_send_shutdown_ack(stcb, - stcb->asoc.primary_destination); + sctp_send_shutdown_ack(stcb, netp); sctp_stop_timers_for_shutdown(stcb); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, - stcb->sctp_ep, stcb, asoc->primary_destination); + stcb->sctp_ep, stcb, netp); } } /*********************************************/ @@ -4380,7 +4427,7 @@ sctp_handle_sack(struct mbuf *m, int off num_dup, SCTP_LOG_NEW_SACK); } - if ((num_dup) && (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_FR_LOGGING_ENABLE | SCTP_EARLYFR_LOGGING_ENABLE))) { + if ((num_dup) && (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE)) { uint16_t i; uint32_t *dupdata, dblock; @@ -4468,13 +4515,6 @@ sctp_handle_sack(struct mbuf *m, int off TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck1); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); - } - } net->partial_bytes_acked = 0; net->flight_size = 0; } @@ -4830,20 +4870,54 @@ sctp_handle_sack(struct mbuf *m, int off asoc->saw_sack_with_nr_frags = 0; /* JRS - Use the congestion control given in the CC module */ - if (ecne_seen == 0) + if (ecne_seen == 0) { + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (net->net_ack2 > 0) { + /* + * Karn's rule applies to clearing error + * count, this is optional. + */ + net->error_count = 0; + if (!(net->dest_state & SCTP_ADDR_REACHABLE)) { + /* addr came good */ + net->dest_state |= SCTP_ADDR_REACHABLE; + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, + SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + } + if (net == stcb->asoc.primary_destination) { + if (stcb->asoc.alternate) { + /* + * release the alternate, + * primary is good + */ + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } + } + if (net->dest_state & SCTP_ADDR_PF) { + net->dest_state &= ~SCTP_ADDR_PF; + sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:44:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01D64106566B; Fri, 10 Feb 2012 22:44:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E38418FC13; Fri, 10 Feb 2012 22:44:36 +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 q1AMiaTD099447; Fri, 10 Feb 2012 22:44:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMiaOf099440; Fri, 10 Feb 2012 22:44:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102244.q1AMiaOf099440@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:44:36 +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: r231457 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:44:37 -0000 Author: tuexen Date: Fri Feb 10 22:44:36 2012 New Revision: 231457 URL: http://svn.freebsd.org/changeset/base/231457 Log: MFC r224870: Add support for the spp_dscp field in the SCTP_PEER_ADDR_PARAMS socket option. Backwards compatibility is provided by still supporting the spp_ipv4_tos field. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:44:36 2012 (r231457) @@ -3967,7 +3967,7 @@ sctp_lowlevel_chunk_output(struct sctp_i ip->ip_v = IPVERSION; ip->ip_hl = (sizeof(struct ip) >> 2); if (net) { - tos_value = net->tos_flowlabel & 0x000000ff; + tos_value = net->dscp; } else { tos_value = inp->ip_inp.inp.inp_ip_tos; } @@ -4204,7 +4204,7 @@ sctp_lowlevel_chunk_output(struct sctp_i int len; if (net != NULL) { - flowlabel = net->tos_flowlabel; + flowlabel = net->flowlabel; } else { flowlabel = ((struct in6pcb *)inp)->in6p_flowinfo; } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:44:36 2012 (r231457) @@ -4009,20 +4009,13 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->asoc.numnets++; *(&net->ref_count) = 1; net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; - net->tos_flowlabel = 0; if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); } else { net->port = 0; } -#ifdef INET - if (newaddr->sa_family == AF_INET) - net->tos_flowlabel = stcb->asoc.default_tos; -#endif -#ifdef INET6 - if (newaddr->sa_family == AF_INET6) - net->tos_flowlabel = stcb->asoc.default_flowlabel; -#endif + net->dscp = stcb->asoc.default_dscp; + net->flowlabel = stcb->asoc.default_flowlabel; if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { net->dest_state |= SCTP_ADDR_NOHB; } else { Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 22:44:36 2012 (r231457) @@ -321,7 +321,8 @@ struct sctp_nets { uint32_t fast_recovery_tsn; uint32_t heartbeat_random1; uint32_t heartbeat_random2; - uint32_t tos_flowlabel; + uint32_t flowlabel; + uint8_t dscp; struct timeval start_time; /* time when this net was created */ uint32_t marked_retrans;/* number or DATA chunks marked for timer @@ -1137,7 +1138,7 @@ struct sctp_association { uint8_t last_flags_delivered; uint8_t hb_ect_randombit; uint8_t hb_random_idx; - uint8_t default_tos; + uint8_t default_dscp; uint8_t asconf_del_pending; /* asconf delete last addr pending */ /* Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 22:44:36 2012 (r231457) @@ -505,9 +505,11 @@ struct sctp_paddrparams { uint32_t spp_flags; uint32_t spp_ipv6_flowlabel; uint16_t spp_pathmaxrxt; - uint8_t spp_ipv4_tos; + uint8_t spp_dscp; }; +#define spp_ipv4_tos spp_dscp + #define SPP_HB_ENABLE 0x00000001 #define SPP_HB_DISABLE 0x00000002 #define SPP_HB_DEMAND 0x00000004 @@ -515,7 +517,8 @@ struct sctp_paddrparams { #define SPP_PMTUD_DISABLE 0x00000010 #define SPP_HB_TIME_IS_ZERO 0x00000080 #define SPP_IPV6_FLOWLABEL 0x00000100 -#define SPP_IPV4_TOS 0x00000200 +#define SPP_DSCP 0x00000200 +#define SPP_IPV4_TOS SPP_DSCP struct sctp_paddrthlds { sctp_assoc_t spt_assoc_id; Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:44:36 2012 (r231457) @@ -2407,13 +2407,13 @@ flags_out: } #ifdef INET if (net->ro._l_addr.sin.sin_family == AF_INET) { - paddrp->spp_ipv4_tos = net->tos_flowlabel & 0x000000fc; - paddrp->spp_flags |= SPP_IPV4_TOS; + paddrp->spp_dscp = net->dscp; + paddrp->spp_flags |= SPP_DSCP; } #endif #ifdef INET6 if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { - paddrp->spp_ipv6_flowlabel = net->tos_flowlabel; + paddrp->spp_ipv6_flowlabel = net->flowlabel; paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; } #endif @@ -2427,8 +2427,8 @@ flags_out: paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure; paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc); #ifdef INET - paddrp->spp_ipv4_tos = stcb->asoc.default_tos & 0x000000fc; - paddrp->spp_flags |= SPP_IPV4_TOS; + paddrp->spp_dscp = stcb->asoc.default_dscp & 0x000000fc; + paddrp->spp_flags |= SPP_DSCP; #endif #ifdef INET6 paddrp->spp_ipv6_flowlabel = stcb->asoc.default_flowlabel; @@ -2461,8 +2461,8 @@ flags_out: paddrp->spp_assoc_id = SCTP_FUTURE_ASSOC; /* get inp's default */ #ifdef INET - paddrp->spp_ipv4_tos = inp->ip_inp.inp.inp_ip_tos; - paddrp->spp_flags |= SPP_IPV4_TOS; + paddrp->spp_dscp = inp->ip_inp.inp.inp_ip_tos; + paddrp->spp_flags |= SPP_DSCP; #endif #ifdef INET6 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { @@ -4598,16 +4598,16 @@ sctp_setopt(struct socket *so, int optna net->failure_threshold = paddrp->spp_pathmaxrxt; } #ifdef INET - if (paddrp->spp_flags & SPP_IPV4_TOS) { + if (paddrp->spp_flags & SPP_DSCP) { if (net->ro._l_addr.sin.sin_family == AF_INET) { - net->tos_flowlabel = paddrp->spp_ipv4_tos & 0x000000fc; + net->dscp = paddrp->spp_dscp & 0xfc; } } #endif #ifdef INET6 if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { - net->tos_flowlabel = paddrp->spp_ipv6_flowlabel; + net->flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; } } #endif @@ -4696,27 +4696,18 @@ sctp_setopt(struct socket *so, int optna } } } -#ifdef INET - if (paddrp->spp_flags & SPP_IPV4_TOS) { + if (paddrp->spp_flags & SPP_DSCP) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (net->ro._l_addr.sin.sin_family == AF_INET) { - net->tos_flowlabel = paddrp->spp_ipv4_tos & 0x000000fc; - } + net->dscp = paddrp->spp_dscp & 0x000000fc; } - stcb->asoc.default_tos = paddrp->spp_ipv4_tos & 0x000000fc; + stcb->asoc.default_dscp = paddrp->spp_dscp & 0x000000fc; } -#endif -#ifdef INET6 if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { - net->tos_flowlabel = paddrp->spp_ipv6_flowlabel; - } + net->flowlabel = paddrp->spp_ipv6_flowlabel; } stcb->asoc.default_flowlabel = paddrp->spp_ipv6_flowlabel; } -#endif - } SCTP_TCB_UNLOCK(stcb); } else { Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 22:42:03 2012 (r231456) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 22:44:36 2012 (r231457) @@ -924,9 +924,9 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_frag_point = m->sctp_frag_point; asoc->sctp_features = m->sctp_features; #ifdef INET - asoc->default_tos = m->ip_inp.inp.inp_ip_tos; + asoc->default_dscp = m->ip_inp.inp.inp_ip_tos; #else - asoc->default_tos = 0; + asoc->default_dscp = 0; #endif #ifdef INET6 From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:49:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53A9D106566C; Fri, 10 Feb 2012 22:49:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 416458FC15; Fri, 10 Feb 2012 22:49: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 q1AMn9xY099630; Fri, 10 Feb 2012 22:49:09 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMn9Mn099628; Fri, 10 Feb 2012 22:49:09 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102249.q1AMn9Mn099628@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:49:09 +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: r231458 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:49:09 -0000 Author: tuexen Date: Fri Feb 10 22:49:09 2012 New Revision: 231458 URL: http://svn.freebsd.org/changeset/base/231458 Log: MFC r224918: Fix the handling of [gs]etsockopt() unconnected 1-to-1 style sockets. While there: * Fix a locking issue in setsockopt() of SCTP_CMT_ON_OFF. * Fix a bug in setsockopt() of SCTP_DEFAULT_PRINFO, where the pr_value was ignored. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:44:36 2012 (r231457) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:49:09 2012 (r231458) @@ -1767,7 +1767,9 @@ flags_out: av->assoc_value = stcb->asoc.sctp_cmt_on_off; SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_cmt_on_off; SCTP_INP_RUNLOCK(inp); @@ -1791,7 +1793,9 @@ flags_out: av->assoc_value = stcb->asoc.congestion_control_module; SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_ep.sctp_default_cc_module; SCTP_INP_RUNLOCK(inp); @@ -1834,7 +1838,9 @@ flags_out: av->assoc_value = stcb->asoc.stream_scheduling_module; SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_ep.sctp_default_ss_module; SCTP_INP_RUNLOCK(inp); @@ -1949,7 +1955,9 @@ flags_out: av->assoc_value = stcb->asoc.context; SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); av->assoc_value = inp->sctp_context; SCTP_INP_RUNLOCK(inp); @@ -2022,7 +2030,9 @@ flags_out: sack->sack_freq = stcb->asoc.sack_freq; SCTP_TCB_UNLOCK(stcb); } else { - if (sack->sack_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sack->sack_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); sack->sack_delay = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV]); sack->sack_freq = inp->sctp_ep.sctp_sack_freq; @@ -2084,7 +2094,9 @@ flags_out: av->assoc_value = sctp_get_frag_point(stcb, &stcb->asoc); SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { ovh = SCTP_MED_OVERHEAD; @@ -2453,7 +2465,9 @@ flags_out: paddrp->spp_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); } else { - if (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC)) { /* Use endpoint defaults */ SCTP_INP_RLOCK(inp); paddrp->spp_pathmaxrxt = inp->sctp_ep.def_net_failure; @@ -2628,7 +2642,9 @@ flags_out: srto->srto_min = stcb->asoc.minrto; SCTP_TCB_UNLOCK(stcb); } else { - if (srto->srto_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (srto->srto_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); srto->srto_initial = inp->sctp_ep.initial_rto; srto->srto_max = inp->sctp_ep.sctp_maxrto; @@ -2682,7 +2698,9 @@ flags_out: sasoc->sasoc_local_rwnd = stcb->asoc.my_rwnd; SCTP_TCB_UNLOCK(stcb); } else { - if (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); sasoc->sasoc_cookie_life = TICKS_TO_MSEC(inp->sctp_ep.def_cookie_life); sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times; @@ -2711,7 +2729,9 @@ flags_out: memcpy(s_info, &stcb->asoc.def_send, sizeof(stcb->asoc.def_send)); SCTP_TCB_UNLOCK(stcb); } else { - if (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); memcpy(s_info, &inp->def_send, sizeof(inp->def_send)); SCTP_INP_RUNLOCK(inp); @@ -2813,7 +2833,9 @@ flags_out: scact->scact_keynumber = stcb->asoc.authinfo.active_keyid; SCTP_TCB_UNLOCK(stcb); } else { - if (scact->scact_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (scact->scact_assoc_id == SCTP_FUTURE_ASSOC)) { /* get the endpoint active key */ SCTP_INP_RLOCK(inp); scact->scact_keynumber = inp->sctp_ep.default_keyid; @@ -2852,7 +2874,9 @@ flags_out: } SCTP_TCB_UNLOCK(stcb); } else { - if (sac->gauth_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sac->gauth_assoc_id == SCTP_FUTURE_ASSOC)) { /* get off the endpoint */ SCTP_INP_RLOCK(inp); chklist = inp->sctp_ep.local_auth_chunks; @@ -2958,7 +2982,9 @@ flags_out: event->se_on = sctp_stcb_is_feature_on(inp, stcb, event_type); SCTP_TCB_UNLOCK(stcb); } else { - if (event->se_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (event->se_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); event->se_on = sctp_is_feature_on(inp, event_type); SCTP_INP_RUNLOCK(inp); @@ -3026,7 +3052,9 @@ flags_out: info->snd_context = stcb->asoc.def_send.sinfo_context; SCTP_TCB_UNLOCK(stcb); } else { - if (info->snd_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (info->snd_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); info->snd_sid = inp->def_send.sinfo_stream; info->snd_flags = inp->def_send.sinfo_flags; @@ -3056,7 +3084,9 @@ flags_out: info->pr_value = stcb->asoc.def_send.sinfo_timetolive; SCTP_TCB_UNLOCK(stcb); } else { - if (info->pr_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (info->pr_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_RLOCK(inp); info->pr_policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); info->pr_value = inp->def_send.sinfo_timetolive; @@ -3144,7 +3174,9 @@ flags_out: thlds->spt_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); } else { - if (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC)) { /* Use endpoint defaults */ SCTP_INP_RLOCK(inp); thlds->spt_pathmaxrxt = inp->sctp_ep.def_net_failure; @@ -3338,7 +3370,9 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.sctp_cmt_on_off = av->assoc_value; SCTP_TCB_UNLOCK(stcb); } else { - if ((av->assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC) || (av->assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_cmt_on_off = av->assoc_value; @@ -3351,8 +3385,8 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_LOCK(stcb); stcb->asoc.sctp_cmt_on_off = av->assoc_value; SCTP_TCB_UNLOCK(stcb); - SCTP_INP_RUNLOCK(inp); } + SCTP_INP_RUNLOCK(inp); } } } else { @@ -3385,7 +3419,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((av->assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC) || (av->assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_cc_module = av->assoc_value; @@ -3465,7 +3501,9 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); SCTP_TCB_UNLOCK(stcb); } else { - if ((av->assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC) || (av->assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_ss_module = av->assoc_value; @@ -3539,7 +3577,9 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.context = av->assoc_value; SCTP_TCB_UNLOCK(stcb); } else { - if ((av->assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC) || (av->assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_context = av->assoc_value; @@ -3605,7 +3645,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((sack->sack_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sack->sack_assoc_id == SCTP_FUTURE_ASSOC) || (sack->sack_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (sack->sack_delay) { @@ -3700,7 +3742,9 @@ sctp_setopt(struct socket *so, int optna error = sctp_insert_sharedkey(shared_keys, shared_key); SCTP_TCB_UNLOCK(stcb); } else { - if ((sca->sca_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sca->sca_assoc_id == SCTP_FUTURE_ASSOC) || (sca->sca_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); shared_keys = &inp->sctp_ep.shared_keys; @@ -3844,7 +3888,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((scact->scact_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (scact->scact_assoc_id == SCTP_FUTURE_ASSOC) || (scact->scact_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (sctp_auth_setactivekey_ep(inp, scact->scact_keynumber)) { @@ -3881,7 +3927,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((scdel->scact_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (scdel->scact_assoc_id == SCTP_FUTURE_ASSOC) || (scdel->scact_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (sctp_delete_sharedkey_ep(inp, scdel->scact_keynumber)) { @@ -3918,7 +3966,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((keyid->scact_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (keyid->scact_assoc_id == SCTP_FUTURE_ASSOC) || (keyid->scact_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (sctp_deact_sharedkey_ep(inp, keyid->scact_keynumber)) { @@ -4205,7 +4255,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if (av->assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); /* * FIXME MT: I think this is not in @@ -4413,7 +4465,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) || (s_info->sinfo_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); memcpy(&inp->def_send, s_info, min(optsize, sizeof(inp->def_send))); @@ -4712,7 +4766,9 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_UNLOCK(stcb); } else { /************************NO TCB, SET TO default stuff ******************/ - if (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); /* * For the TOS/FLOWLABEL stuff you @@ -4778,7 +4834,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if (srto->srto_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (srto->srto_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); if (srto->srto_initial) new_init = srto->srto_initial; @@ -4830,7 +4888,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); if (sasoc->sasoc_asocmaxrxt) inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt; @@ -5150,13 +5210,17 @@ sctp_setopt(struct socket *so, int optna * sender dry events */ if ((event_type == SCTP_PCB_FLAGS_DRYEVNT) && + ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) == 0) && + ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0) && ((event->se_assoc_id == SCTP_ALL_ASSOC) || (event->se_assoc_id == SCTP_CURRENT_ASSOC))) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTSUP); error = ENOTSUP; break; } - if ((event->se_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (event->se_assoc_id == SCTP_FUTURE_ASSOC) || (event->se_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); if (event->se_on) { @@ -5234,7 +5298,9 @@ sctp_setopt(struct socket *so, int optna } SCTP_TCB_UNLOCK(stcb); } else { - if ((info->snd_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (info->snd_assoc_id == SCTP_FUTURE_ASSOC) || (info->snd_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->def_send.sinfo_stream = info->snd_sid; @@ -5280,13 +5346,17 @@ sctp_setopt(struct socket *so, int optna if (stcb) { stcb->asoc.def_send.sinfo_flags &= 0xfff0; stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + stcb->asoc.def_send.sinfo_timetolive = info->pr_value; SCTP_TCB_UNLOCK(stcb); } else { - if ((info->pr_assoc_id == SCTP_FUTURE_ASSOC) || + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (info->pr_assoc_id == SCTP_FUTURE_ASSOC) || (info->pr_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->def_send.sinfo_flags &= 0xfff0; inp->def_send.sinfo_flags |= info->pr_policy; + inp->def_send.sinfo_timetolive = info->pr_value; SCTP_INP_WUNLOCK(inp); } if ((info->pr_assoc_id == SCTP_CURRENT_ASSOC) || @@ -5296,6 +5366,7 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_LOCK(stcb); stcb->asoc.def_send.sinfo_flags &= 0xfff0; stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + stcb->asoc.def_send.sinfo_timetolive = info->pr_value; SCTP_TCB_UNLOCK(stcb); } SCTP_INP_RUNLOCK(inp); @@ -5431,7 +5502,9 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.def_net_pf_threshold = thlds->spt_pathpfthld; } } else { - if (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (thlds->spt_assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); inp->sctp_ep.def_net_failure = thlds->spt_pathmaxrxt; inp->sctp_ep.def_net_pf_threshold = thlds->spt_pathpfthld; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:52:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F0E2106566C; Fri, 10 Feb 2012 22:52:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D1358FC16; Fri, 10 Feb 2012 22:52: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 q1AMq8MU099772; Fri, 10 Feb 2012 22:52:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMq8eb099770; Fri, 10 Feb 2012 22:52:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102252.q1AMq8eb099770@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:52:08 +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: r231459 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:52:09 -0000 Author: tuexen Date: Fri Feb 10 22:52:08 2012 New Revision: 231459 URL: http://svn.freebsd.org/changeset/base/231459 Log: MFC r225462: Improve implementation of the Nagle algorithm for SCTP: Don't delay the final fragment of a fragmented user message. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:49:09 2012 (r231458) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:52:08 2012 (r231459) @@ -9821,19 +9821,22 @@ sctp_chunk_output(struct sctp_inpcb *inp unsigned int burst_cnt = 0; struct timeval now; int now_filled = 0; - int nagle_on = 0; + int nagle_on; int frag_point = sctp_get_frag_point(stcb, &stcb->asoc); int un_sent = 0; int fr_done; unsigned int tot_frs = 0; asoc = &stcb->asoc; + /* The Nagle algorithm is only applied when handling a send call. */ if (from_where == SCTP_OUTPUT_FROM_USR_SEND) { if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NODELAY)) { nagle_on = 0; } else { nagle_on = 1; } + } else { + nagle_on = 0; } SCTP_TCB_LOCK_ASSERT(stcb); @@ -10007,15 +10010,18 @@ sctp_chunk_output(struct sctp_inpcb *inp } } if (nagle_on) { - /*- - * When nagle is on, we look at how much is un_sent, then - * if its smaller than an MTU and we have data in - * flight we stop. + /* + * When the Nagle algorithm is used, look at how + * much is unsent, then if its smaller than an MTU + * and we have data in flight we stop, except if we + * are handling a fragmented user message. */ un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); if ((un_sent < (int)(stcb->asoc.smallest_mtu - SCTP_MIN_OVERHEAD)) && - (stcb->asoc.total_flight > 0)) { + (stcb->asoc.total_flight > 0) && + ((stcb->asoc.locked_on_sending == NULL) || + sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR))) { break; } } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:54:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CB25106566B; Fri, 10 Feb 2012 22:54:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69FF38FC17; Fri, 10 Feb 2012 22:54: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 q1AMswa6099899; Fri, 10 Feb 2012 22:54:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMswqv099892; Fri, 10 Feb 2012 22:54:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102254.q1AMswqv099892@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:54:58 +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: r231460 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:54:58 -0000 Author: tuexen Date: Fri Feb 10 22:54:58 2012 New Revision: 231460 URL: http://svn.freebsd.org/changeset/base/231460 Log: MFC r225549: Fix the handling of the flowlabel and DSCP value in the SCTP_PEER_ADDR_PARAMS socket option. Honor the net.inet6.ip6.auto_flowlabel sysctl setting. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:54:58 2012 (r231460) @@ -3904,6 +3904,7 @@ sctp_lowlevel_chunk_output(struct sctp_i uint32_t vrf_id; sctp_route_t *ro = NULL; struct udphdr *udp = NULL; + uint8_t tos_value; #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so = NULL; @@ -3925,13 +3926,20 @@ sctp_lowlevel_chunk_output(struct sctp_i if ((auth != NULL) && (stcb != NULL)) { sctp_fill_hmac_digest_m(m, auth_offset, auth, stcb, auth_keyid); } + if (net) { + tos_value = net->dscp; + } else if (stcb) { + tos_value = stcb->asoc.default_dscp; + } else { + tos_value = inp->sctp_ep.default_dscp; + } + switch (to->sa_family) { #ifdef INET case AF_INET: { struct ip *ip = NULL; sctp_route_t iproute; - uint8_t tos_value; int len; len = sizeof(struct ip) + sizeof(struct sctphdr); @@ -3966,11 +3974,18 @@ sctp_lowlevel_chunk_output(struct sctp_i ip = mtod(m, struct ip *); ip->ip_v = IPVERSION; ip->ip_hl = (sizeof(struct ip) >> 2); - if (net) { - tos_value = net->dscp; - } else { + if (tos_value == 0) { + /* + * This means especially, that it is not set + * at the SCTP layer. So use the value from + * the IP layer. + */ tos_value = inp->ip_inp.inp.inp_ip_tos; } + tos_value &= 0xfc; + if (ecn_ok) { + tos_value |= sctp_get_ect(stcb, chk); + } if ((nofragment_flag) && (port == 0)) { ip->ip_off = IP_DF; } else @@ -3981,10 +3996,7 @@ sctp_lowlevel_chunk_output(struct sctp_i ip->ip_ttl = inp->ip_inp.inp.inp_ip_ttl; ip->ip_len = packet_length; - ip->ip_tos = tos_value & 0xfc; - if (ecn_ok) { - ip->ip_tos |= sctp_get_ect(stcb, chk); - } + ip->ip_tos = tos_value; if (port) { ip->ip_p = IPPROTO_UDP; } else { @@ -4189,13 +4201,10 @@ sctp_lowlevel_chunk_output(struct sctp_i #ifdef INET6 case AF_INET6: { - uint32_t flowlabel; + uint32_t flowlabel, flowinfo; struct ip6_hdr *ip6h; struct route_in6 ip6route; struct ifnet *ifp; - u_char flowTop; - uint16_t flowBottom; - u_char tosBottom, tosTop; struct sockaddr_in6 *sin6, tmp, *lsa6, lsa6_tmp; int prev_scope = 0; struct sockaddr_in6 lsa6_storage; @@ -4203,12 +4212,22 @@ sctp_lowlevel_chunk_output(struct sctp_i u_short prev_port = 0; int len; - if (net != NULL) { + if (net) { flowlabel = net->flowlabel; + } else if (stcb) { + flowlabel = stcb->asoc.default_flowlabel; } else { - flowlabel = ((struct in6pcb *)inp)->in6p_flowinfo; + flowlabel = inp->sctp_ep.default_flowlabel; } - + if (flowlabel == 0) { + /* + * This means especially, that it is not set + * at the SCTP layer. So use the value from + * the IP layer. + */ + flowlabel = ntohl(((struct in6pcb *)inp)->in6p_flowinfo); + } + flowlabel &= 0x000fffff; len = sizeof(struct ip6_hdr) + sizeof(struct sctphdr); if (port) { len += sizeof(struct udphdr); @@ -4240,13 +4259,6 @@ sctp_lowlevel_chunk_output(struct sctp_i packet_length = sctp_calculate_len(m); ip6h = mtod(m, struct ip6_hdr *); - /* - * We assume here that inp_flow is in host byte - * order within the TCB! - */ - flowBottom = flowlabel & 0x0000ffff; - flowTop = ((flowlabel & 0x000f0000) >> 16); - tosTop = (((flowlabel & 0xf0) >> 4) | IPV6_VERSION); /* protect *sin6 from overwrite */ sin6 = (struct sockaddr_in6 *)to; tmp = *sin6; @@ -4264,12 +4276,28 @@ sctp_lowlevel_chunk_output(struct sctp_i } else { ro = (sctp_route_t *) & net->ro; } - tosBottom = (((struct in6pcb *)inp)->in6p_flowinfo & 0x0c); + /* + * We assume here that inp_flow is in host byte + * order within the TCB! + */ + if (tos_value == 0) { + /* + * This means especially, that it is not set + * at the SCTP layer. So use the value from + * the IP layer. + */ + tos_value = (ntohl(((struct in6pcb *)inp)->in6p_flowinfo) >> 20) & 0xff; + } + tos_value &= 0xfc; if (ecn_ok) { - tosBottom |= sctp_get_ect(stcb, chk); + tos_value |= sctp_get_ect(stcb, chk); } - tosBottom <<= 4; - ip6h->ip6_flow = htonl(((tosTop << 24) | ((tosBottom | flowTop) << 16) | flowBottom)); + flowinfo = 0x06; + flowinfo <<= 8; + flowinfo |= tos_value; + flowinfo <<= 20; + flowinfo |= flowlabel; + ip6h->ip6_flow = htonl(flowinfo); if (port) { ip6h->ip6_nxt = IPPROTO_UDP; } else { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:54:58 2012 (r231460) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INET6 +#include +#endif #include #include #include @@ -2503,6 +2506,11 @@ sctp_inpcb_alloc(struct socket *so, uint /* setup socket pointers */ inp->sctp_socket = so; inp->ip_inp.inp.inp_socket = so; +#ifdef INET6 + if (MODULE_GLOBAL(ip6_auto_flowlabel)) { + inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + } +#endif inp->sctp_associd_counter = 1; inp->partial_delivery_point = SCTP_SB_LIMIT_RCV(so) >> SCTP_PARTIAL_DELIVERY_SHIFT; inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT; @@ -2668,6 +2676,10 @@ sctp_inpcb_alloc(struct socket *so, uint */ m->local_hmacs = sctp_default_supported_hmaclist(); m->local_auth_chunks = sctp_alloc_chunklist(); + m->default_dscp = 0; +#ifdef INET6 + m->default_flowlabel = 0; +#endif sctp_auth_set_default_chunks(m->local_auth_chunks); LIST_INIT(&m->shared_keys); /* add default NULL key as key id 0 */ @@ -4015,7 +4027,9 @@ sctp_add_remote_addr(struct sctp_tcb *st net->port = 0; } net->dscp = stcb->asoc.default_dscp; +#ifdef INET6 net->flowlabel = stcb->asoc.default_flowlabel; +#endif if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { net->dest_state |= SCTP_ADDR_NOHB; } else { Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 22:54:58 2012 (r231460) @@ -322,6 +322,10 @@ struct sctp_pcb { uint32_t store_at; uint32_t max_burst; uint32_t fr_max_burst; +#ifdef INET6 + uint32_t default_flowlabel; +#endif + uint8_t default_dscp; char current_secret_number; char last_secret_number; }; Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 22:54:58 2012 (r231460) @@ -321,7 +321,9 @@ struct sctp_nets { uint32_t fast_recovery_tsn; uint32_t heartbeat_random1; uint32_t heartbeat_random2; +#ifdef INET6 uint32_t flowlabel; +#endif uint8_t dscp; struct timeval start_time; /* time when this net was created */ @@ -987,7 +989,9 @@ struct sctp_association { uint32_t sb_send_resv; /* amount reserved on a send */ uint32_t my_rwnd_control_len; /* shadow of sb_mbcnt used for rwnd * control */ +#ifdef INET6 uint32_t default_flowlabel; +#endif uint32_t pr_sctp_cnt; int ctrl_queue_cnt; /* could be removed REM - NO IT CAN'T!! RRS */ /* Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:54:58 2012 (r231460) @@ -2417,15 +2417,14 @@ flags_out: } else { paddrp->spp_flags |= SPP_PMTUD_DISABLE; } -#ifdef INET - if (net->ro._l_addr.sin.sin_family == AF_INET) { - paddrp->spp_dscp = net->dscp; + if (net->dscp & 0x01) { + paddrp->spp_dscp = net->dscp >> 2; paddrp->spp_flags |= SPP_DSCP; } -#endif #ifdef INET6 - if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { - paddrp->spp_ipv6_flowlabel = net->flowlabel; + if ((net->ro._l_addr.sa.sa_family == AF_INET6) && + (net->flowlabel & 0x80000000)) { + paddrp->spp_ipv6_flowlabel = net->flowlabel & 0x000fffff; paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; } #endif @@ -2438,13 +2437,15 @@ flags_out: paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure; paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc); -#ifdef INET - paddrp->spp_dscp = stcb->asoc.default_dscp & 0x000000fc; - paddrp->spp_flags |= SPP_DSCP; -#endif + if (stcb->asoc.default_dscp & 0x01) { + paddrp->spp_dscp = stcb->asoc.default_dscp >> 2; + paddrp->spp_flags |= SPP_DSCP; + } #ifdef INET6 - paddrp->spp_ipv6_flowlabel = stcb->asoc.default_flowlabel; - paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; + if (stcb->asoc.default_flowlabel & 0x80000000) { + paddrp->spp_ipv6_flowlabel = stcb->asoc.default_flowlabel & 0x000fffff; + paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; + } #endif /* default settings should be these */ if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { @@ -2474,13 +2475,14 @@ flags_out: paddrp->spp_hbinterval = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]); paddrp->spp_assoc_id = SCTP_FUTURE_ASSOC; /* get inp's default */ -#ifdef INET - paddrp->spp_dscp = inp->ip_inp.inp.inp_ip_tos; - paddrp->spp_flags |= SPP_DSCP; -#endif + if (inp->sctp_ep.default_dscp & 0x01) { + paddrp->spp_dscp = inp->sctp_ep.default_dscp >> 2; + paddrp->spp_flags |= SPP_DSCP; + } #ifdef INET6 - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - paddrp->spp_ipv6_flowlabel = ((struct in6pcb *)inp)->in6p_flowinfo; + if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && + (inp->sctp_ep.default_flowlabel & 0x80000000)) { + paddrp->spp_ipv6_flowlabel = inp->sctp_ep.default_flowlabel & 0x000fffff; paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; } #endif @@ -4651,17 +4653,15 @@ sctp_setopt(struct socket *so, int optna } net->failure_threshold = paddrp->spp_pathmaxrxt; } -#ifdef INET if (paddrp->spp_flags & SPP_DSCP) { - if (net->ro._l_addr.sin.sin_family == AF_INET) { - net->dscp = paddrp->spp_dscp & 0xfc; - } + net->dscp = paddrp->spp_dscp << 2; + net->dscp |= 0x01; } -#endif #ifdef INET6 if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { - if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { + if (net->ro._l_addr.sa.sa_family == AF_INET6) { net->flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; + net->flowlabel |= 0x80000000; } } #endif @@ -4752,16 +4752,24 @@ sctp_setopt(struct socket *so, int optna } if (paddrp->spp_flags & SPP_DSCP) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - net->dscp = paddrp->spp_dscp & 0x000000fc; + net->dscp = paddrp->spp_dscp << 2; + net->dscp |= 0x01; } - stcb->asoc.default_dscp = paddrp->spp_dscp & 0x000000fc; + stcb->asoc.default_dscp = paddrp->spp_dscp << 2; + stcb->asoc.default_dscp |= 0x01; } +#ifdef INET6 if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - net->flowlabel = paddrp->spp_ipv6_flowlabel; + if (net->ro._l_addr.sa.sa_family == AF_INET6) { + net->flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; + net->flowlabel |= 0x80000000; + } } - stcb->asoc.default_flowlabel = paddrp->spp_ipv6_flowlabel; + stcb->asoc.default_flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; + stcb->asoc.default_flowlabel |= 0x80000000; } +#endif } SCTP_TCB_UNLOCK(stcb); } else { @@ -4795,6 +4803,18 @@ sctp_setopt(struct socket *so, int optna } else if (paddrp->spp_flags & SPP_HB_DISABLE) { sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } + if (paddrp->spp_flags & SPP_DSCP) { + inp->sctp_ep.default_dscp = paddrp->spp_dscp << 2; + inp->sctp_ep.default_dscp |= 0x01; + } +#ifdef INET6 + if (paddrp->spp_flags & SPP_IPV6_FLOWLABEL) { + if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + inp->sctp_ep.default_flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff; + inp->sctp_ep.default_flowlabel |= 0x80000000; + } + } +#endif SCTP_INP_WUNLOCK(inp); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 22:52:08 2012 (r231459) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 22:54:58 2012 (r231460) @@ -923,16 +923,19 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_cmt_pf = (uint8_t) 0; asoc->sctp_frag_point = m->sctp_frag_point; asoc->sctp_features = m->sctp_features; -#ifdef INET - asoc->default_dscp = m->ip_inp.inp.inp_ip_tos; -#else - asoc->default_dscp = 0; -#endif - + asoc->default_dscp = m->sctp_ep.default_dscp; #ifdef INET6 - asoc->default_flowlabel = ((struct in6pcb *)m)->in6p_flowinfo; -#else - asoc->default_flowlabel = 0; + if (m->sctp_ep.default_flowlabel) { + asoc->default_flowlabel = m->sctp_ep.default_flowlabel; + } else { + if (m->ip_inp.inp.inp_flags & IN6P_AUTOFLOWLABEL) { + asoc->default_flowlabel = sctp_select_initial_TSN(&m->sctp_ep); + asoc->default_flowlabel &= 0x000fffff; + asoc->default_flowlabel |= 0x80000000; + } else { + asoc->default_flowlabel = 0; + } + } #endif asoc->sb_send_resv = 0; if (override_tag) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 22:57:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E54BD106566C; Fri, 10 Feb 2012 22:57:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D33A88FC13; Fri, 10 Feb 2012 22:57:50 +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 q1AMvoCM000180; Fri, 10 Feb 2012 22:57:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMvo96000175; Fri, 10 Feb 2012 22:57:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102257.q1AMvo96000175@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 22:57:50 +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: r231462 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:57:51 -0000 Author: tuexen Date: Fri Feb 10 22:57:50 2012 New Revision: 231462 URL: http://svn.freebsd.org/changeset/base/231462 Log: MFC r225559: Ensure that 1-to-1 style SCTP sockets can only be connected once. Allow implicit setup also for 1-to-1 style sockets as described in the latest version of the socket API ID. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:55:22 2012 (r231461) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:57:50 2012 (r231462) @@ -12628,14 +12628,10 @@ sctp_lower_sosend(struct socket *so, (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { SCTP_INP_RLOCK(inp); stcb = LIST_FIRST(&inp->sctp_asoc_list); - if (stcb == NULL) { - SCTP_INP_RUNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); - error = ENOTCONN; - goto out_unlocked; + if (stcb) { + SCTP_TCB_LOCK(stcb); + hold_tcblock = 1; } - SCTP_TCB_LOCK(stcb); - hold_tcblock = 1; SCTP_INP_RUNLOCK(inp); } else if (sinfo_assoc_id) { stcb = sctp_findassociation_ep_asocid(inp, sinfo_assoc_id, 0); @@ -12700,21 +12696,12 @@ sctp_lower_sosend(struct socket *so, } } if (stcb == NULL) { - if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); - error = ENOTCONN; - goto out_unlocked; - } if (addr == NULL) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOENT); error = ENOENT; goto out_unlocked; } else { - /* - * UDP style, we must go ahead and start the INIT - * process - */ + /* We must go ahead and start the INIT process */ uint32_t vrf_id; if ((sinfo_flags & SCTP_ABORT) || @@ -12741,6 +12728,14 @@ sctp_lower_sosend(struct socket *so, /* Error is setup for us in the call */ goto out_unlocked; } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { + stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; + /* + * Set the connected flag so we can queue + * data + */ + soisconnecting(so); + } hold_tcblock = 1; if (create_lock_applied) { SCTP_ASOC_CREATE_UNLOCK(inp); Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:55:22 2012 (r231461) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:57:50 2012 (r231462) @@ -4291,6 +4291,16 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, *error = EINVAL; return (NULL); } + if ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) || + (inp->sctp_flags & SCTP_PCB_FLAGS_WAS_ABORTED)) { + SCTP_INP_RUNLOCK(inp); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); + *error = EINVAL; + return (NULL); + } + } SCTPDBG(SCTP_DEBUG_PCB3, "Allocate an association for peer:"); #ifdef SCTP_DEBUG if (firstaddr) { Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:55:22 2012 (r231461) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:57:50 2012 (r231462) @@ -1541,6 +1541,11 @@ sctp_do_connect_x(struct socket *so, str /* Gak! no memory */ goto out_now; } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { + stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; + /* Set the connected flag so we can queue data */ + soisconnecting(so); + } SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); /* move to second address */ switch (sa->sa_family) { @@ -5740,15 +5745,6 @@ sctp_connect(struct socket *so, struct s if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; /* Set the connected flag so we can queue data */ - SOCKBUF_LOCK(&so->so_rcv); - so->so_rcv.sb_state &= ~SBS_CANTRCVMORE; - SOCKBUF_UNLOCK(&so->so_rcv); - SOCKBUF_LOCK(&so->so_snd); - so->so_snd.sb_state &= ~SBS_CANTSENDMORE; - SOCKBUF_UNLOCK(&so->so_snd); - SOCK_LOCK(so); - so->so_state &= ~SS_ISDISCONNECTING; - SOCK_UNLOCK(so); soisconnecting(so); } SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 22:55:22 2012 (r231461) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 22:57:50 2012 (r231462) @@ -3622,10 +3622,14 @@ sctp_abort_notification(struct sctp_tcb #endif ) { - if (stcb == NULL) { return; } + if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_CONNECTED))) { + stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_WAS_ABORTED; + } if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) { @@ -3633,11 +3637,6 @@ sctp_abort_notification(struct sctp_tcb } /* Tell them we lost the asoc */ sctp_report_all_outbound(stcb, 1, so_locked); - if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || - ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_CONNECTED))) { - stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_WAS_ABORTED; - } sctp_ulp_notify(SCTP_NOTIFY_ASSOC_ABORTED, stcb, error, NULL, so_locked); } @@ -5098,17 +5097,6 @@ restart_nosblocks: */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); error = ECONNRESET; - /* - * You get this once if you are - * active open side - */ - if (!(inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - /* - * Remove flag if on the - * active open side - */ - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAS_ABORTED; - } } so->so_state &= ~(SS_ISCONNECTING | SS_ISDISCONNECTING | @@ -5118,8 +5106,6 @@ restart_nosblocks: if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) == 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); error = ENOTCONN; - } else { - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAS_CONNECTED; } } goto out; @@ -5152,18 +5138,6 @@ restart_nosblocks: */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); error = ECONNRESET; - /* - * You get this once if you - * are active open side - */ - if (!(inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - /* - * Remove flag if on - * the active open - * side - */ - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAS_ABORTED; - } } so->so_state &= ~(SS_ISCONNECTING | SS_ISDISCONNECTING | @@ -5173,8 +5147,6 @@ restart_nosblocks: if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) == 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); error = ENOTCONN; - } else { - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAS_CONNECTED; } } goto out; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:00:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31B28106564A; Fri, 10 Feb 2012 23:00:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D9358FC16; Fri, 10 Feb 2012 23:00: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 q1AN0OhQ000336; Fri, 10 Feb 2012 23:00:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AN0O0r000331; Fri, 10 Feb 2012 23:00:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102300.q1AN0O0r000331@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:00:24 +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: r231463 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:00:25 -0000 Author: tuexen Date: Fri Feb 10 23:00:24 2012 New Revision: 231463 URL: http://svn.freebsd.org/changeset/base/231463 Log: MFC r225571: Make sure that SCTP rejects broadcast, multicast and wildcard addresses as remote addresses. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 23:00:24 2012 (r231463) @@ -207,6 +207,7 @@ sctp_process_asconf_add_ip(struct mbuf * uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; int zero_address = 0; + int bad_address = 0; #ifdef INET struct sockaddr_in *sin; @@ -239,6 +240,10 @@ sctp_process_asconf_add_ip(struct mbuf * sin->sin_len = sizeof(struct sockaddr_in); sin->sin_port = stcb->rport; sin->sin_addr.s_addr = v4addr->addr; + if ((sin->sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { + bad_address = 1;; + } if (sin->sin_addr.s_addr == INADDR_ANY) zero_address = 1; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding "); @@ -259,6 +264,9 @@ sctp_process_asconf_add_ip(struct mbuf * sin6->sin6_port = stcb->rport; memcpy((caddr_t)&sin6->sin6_addr, v6addr->addr, sizeof(struct in6_addr)); + if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { + bad_address = 1; + } if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) zero_address = 1; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding "); @@ -266,12 +274,8 @@ sctp_process_asconf_add_ip(struct mbuf * break; #endif default: - /* - * XXX: Is this the correct error cause? Maybe - * SCTP_CAUSE_INVALID_PARAM is a better choice. - */ m_reply = sctp_asconf_error_response(aph->correlation_id, - SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, + SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, aparam_length); return m_reply; } /* end switch */ @@ -285,7 +289,11 @@ sctp_process_asconf_add_ip(struct mbuf * SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); } /* add the address */ - if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE, + if (bad_address) { + m_reply = sctp_asconf_error_response(aph->correlation_id, + SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, + aparam_length); + } else if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE, SCTP_ADDR_DYNAMIC_ADDED) != 0) { SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: error adding address\n"); Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:00:24 2012 (r231463) @@ -3541,7 +3541,7 @@ sctp_process_cmsgs_for_init(struct sctp_ (sin.sin_addr.s_addr == INADDR_BROADCAST) || IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { *error = EINVAL; - return (-1); + return (1); } if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { @@ -3564,7 +3564,7 @@ sctp_process_cmsgs_for_init(struct sctp_ if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr) || IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) { *error = EINVAL; - return (-1); + return (1); } #ifdef INET if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { @@ -3573,7 +3573,7 @@ sctp_process_cmsgs_for_init(struct sctp_ (sin.sin_addr.s_addr == INADDR_BROADCAST) || IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { *error = EINVAL; - return (-1); + return (1); } if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:00:24 2012 (r231463) @@ -4332,7 +4332,10 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr_in *sin; sin = (struct sockaddr_in *)firstaddr; - if ((sin->sin_port == 0) || (sin->sin_addr.s_addr == 0)) { + if ((ntohs(sin->sin_port) == 0) || + (sin->sin_addr.s_addr == INADDR_ANY) || + (sin->sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); @@ -4349,8 +4352,9 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr_in6 *sin6; sin6 = (struct sockaddr_in6 *)firstaddr; - if ((sin6->sin6_port == 0) || - (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr))) { + if ((ntohs(sin6->sin6_port) == 0) || + IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || + IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { /* Invalid address */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:00:24 2012 (r231463) @@ -560,7 +560,7 @@ sctp_bind(struct socket *so, struct sock struct sctp_inpcb *inp = NULL; int error; -#ifdef INET6 +#ifdef INET if (addr && addr->sa_family != AF_INET) { /* must be a v4 address! */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 22:57:50 2012 (r231462) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:00:24 2012 (r231463) @@ -6080,6 +6080,15 @@ sctp_connectx_helper_add(struct sctp_tcb struct sockaddr *sa; size_t incr = 0; +#ifdef INET + struct sockaddr_in *sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 *sin6; + +#endif + sa = addr; inp = stcb->sctp_ep; *error = 0; @@ -6088,6 +6097,15 @@ sctp_connectx_helper_add(struct sctp_tcb #ifdef INET case AF_INET: incr = sizeof(struct sockaddr_in); + sin = (struct sockaddr_in *)sa; + if ((sin->sin_addr.s_addr == INADDR_ANY) || + (sin->sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7); + *error = EINVAL; + goto out_now; + } if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS); @@ -6101,6 +6119,14 @@ sctp_connectx_helper_add(struct sctp_tcb #ifdef INET6 case AF_INET6: incr = sizeof(struct sockaddr_in6); + sin6 = (struct sockaddr_in6 *)sa; + if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || + IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, EINVAL); + (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_8); + *error = EINVAL; + goto out_now; + } if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:02:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 262C91065672; Fri, 10 Feb 2012 23:02:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1489F8FC0C; Fri, 10 Feb 2012 23:02:46 +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 q1AN2jfc000456; Fri, 10 Feb 2012 23:02:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AN2jd8000454; Fri, 10 Feb 2012 23:02:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102302.q1AN2jd8000454@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:02:45 +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: r231464 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:02:46 -0000 Author: tuexen Date: Fri Feb 10 23:02:45 2012 New Revision: 231464 URL: http://svn.freebsd.org/changeset/base/231464 Log: MFC r225584: Fix a typo introduced in http://svn.freebsd.org/changeset/base/225571 Reported by Ilya A. Arkhipov. Modified: stable/8/sys/netinet/sctp_asconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 23:00:24 2012 (r231463) +++ stable/8/sys/netinet/sctp_asconf.c Fri Feb 10 23:02:45 2012 (r231464) @@ -242,7 +242,7 @@ sctp_process_asconf_add_ip(struct mbuf * sin->sin_addr.s_addr = v4addr->addr; if ((sin->sin_addr.s_addr == INADDR_BROADCAST) || IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { - bad_address = 1;; + bad_address = 1; } if (sin->sin_addr.s_addr == INADDR_ANY) zero_address = 1; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:12:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABDE7106564A; Fri, 10 Feb 2012 23:12:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F29C8FC24; Fri, 10 Feb 2012 23:12:48 +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 q1ANCmTC000857; Fri, 10 Feb 2012 23:12:48 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANCmjH000851; Fri, 10 Feb 2012 23:12:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102312.q1ANCmjH000851@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:12:48 +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: r231466 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:12:48 -0000 Author: tuexen Date: Fri Feb 10 23:12:48 2012 New Revision: 231466 URL: http://svn.freebsd.org/changeset/base/231466 Log: MFC r225635: Fix the enabling/disabling of Heartbeats and path MTU discovery when using the SCTP_PEER_ADDR_PARAMS socket option. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 23:12:48 2012 (r231466) @@ -496,6 +496,7 @@ struct sctp_error_unrecognized_chunk { /* * PCB Features (in sctp_features bitmask) */ +#define SCTP_PCB_FLAGS_DO_NOT_PMTUD 0x00000001 #define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002 /* deprecated */ #define SCTP_PCB_FLAGS_DONOT_HEARTBEAT 0x00000004 #define SCTP_PCB_FLAGS_FRAG_INTERLEAVE 0x00000008 Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctp_constants.h Fri Feb 10 23:12:48 2012 (r231466) @@ -508,6 +508,7 @@ __FBSDID("$FreeBSD$"); /* SCTP reachability state for each address */ #define SCTP_ADDR_REACHABLE 0x001 +#define SCTP_ADDR_NO_PMTUD 0x002 #define SCTP_ADDR_NOHB 0x004 #define SCTP_ADDR_BEING_DELETED 0x008 #define SCTP_ADDR_NOT_IN_ASSOC 0x010 Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:12:48 2012 (r231466) @@ -4030,11 +4030,16 @@ sctp_add_remote_addr(struct sctp_tcb *st #ifdef INET6 net->flowlabel = stcb->asoc.default_flowlabel; #endif - if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { net->dest_state |= SCTP_ADDR_NOHB; } else { net->dest_state &= ~SCTP_ADDR_NOHB; } + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD)) { + net->dest_state |= SCTP_ADDR_NO_PMTUD; + } else { + net->dest_state &= ~SCTP_ADDR_NO_PMTUD; + } net->heart_beat_delay = stcb->asoc.heart_beat_delay; /* Init the timer structure */ SCTP_OS_TIMER_INIT(&net->rxt_timer.timer); Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:12:48 2012 (r231466) @@ -2412,12 +2412,13 @@ flags_out: paddrp->spp_pathmaxrxt = net->failure_threshold; paddrp->spp_pathmtu = net->mtu - ovh; /* get flags for HB */ - if (net->dest_state & SCTP_ADDR_NOHB) + if (net->dest_state & SCTP_ADDR_NOHB) { paddrp->spp_flags |= SPP_HB_DISABLE; - else + } else { paddrp->spp_flags |= SPP_HB_ENABLE; + } /* get flags for PMTU */ - if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { + if (net->dest_state & SCTP_ADDR_NO_PMTUD) { paddrp->spp_flags |= SPP_PMTUD_ENABLE; } else { paddrp->spp_flags |= SPP_PMTUD_DISABLE; @@ -2438,8 +2439,6 @@ flags_out: * No destination so return default * value */ - int cnt = 0; - paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure; paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc); if (stcb->asoc.default_dscp & 0x01) { @@ -2453,20 +2452,17 @@ flags_out: } #endif /* default settings should be these */ - if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { + if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { paddrp->spp_flags |= SPP_HB_DISABLE; } else { paddrp->spp_flags |= SPP_HB_ENABLE; } - paddrp->spp_hbinterval = stcb->asoc.heart_beat_delay; - TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { - cnt++; - } - } - if (cnt) { + if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD)) { + paddrp->spp_flags |= SPP_PMTUD_DISABLE; + } else { paddrp->spp_flags |= SPP_PMTUD_ENABLE; } + paddrp->spp_hbinterval = stcb->asoc.heart_beat_delay; } paddrp->spp_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); @@ -2494,14 +2490,16 @@ flags_out: /* can't return this */ paddrp->spp_pathmtu = 0; - /* default behavior, no stcb */ - paddrp->spp_flags = SPP_PMTUD_ENABLE; - if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { paddrp->spp_flags |= SPP_HB_ENABLE; } else { paddrp->spp_flags |= SPP_HB_DISABLE; } + if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD)) { + paddrp->spp_flags |= SPP_PMTUD_ENABLE; + } else { + paddrp->spp_flags |= SPP_PMTUD_DISABLE; + } SCTP_INP_RUNLOCK(inp); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -4619,6 +4617,7 @@ sctp_setopt(struct socket *so, int optna sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10); } + net->dest_state |= SCTP_ADDR_NO_PMTUD; if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) { net->mtu = paddrp->spp_pathmtu + ovh; if (net->mtu < stcb->asoc.smallest_mtu) { @@ -4627,9 +4626,10 @@ sctp_setopt(struct socket *so, int optna } } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { - if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { + if (!SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net); } + net->dest_state &= ~SCTP_ADDR_NO_PMTUD; } if (paddrp->spp_pathmaxrxt) { if (net->dest_state & SCTP_ADDR_PF) { @@ -4722,9 +4722,9 @@ sctp_setopt(struct socket *so, int optna SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); } + sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } if (paddrp->spp_flags & SPP_HB_DISABLE) { - /* Turn back on the timer */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (!(net->dest_state & SCTP_ADDR_NOHB)) { net->dest_state |= SCTP_ADDR_NOHB; @@ -4733,6 +4733,7 @@ sctp_setopt(struct socket *so, int optna } } } + sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -4740,6 +4741,7 @@ sctp_setopt(struct socket *so, int optna sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_10); } + net->dest_state |= SCTP_ADDR_NO_PMTUD; if (paddrp->spp_pathmtu > SCTP_DEFAULT_MINSEGMENT) { net->mtu = paddrp->spp_pathmtu + ovh; if (net->mtu < stcb->asoc.smallest_mtu) { @@ -4747,13 +4749,16 @@ sctp_setopt(struct socket *so, int optna } } } + sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { + if (!SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net); } + net->dest_state &= ~SCTP_ADDR_NO_PMTUD; } + sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_DSCP) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -4808,6 +4813,11 @@ sctp_setopt(struct socket *so, int optna } else if (paddrp->spp_flags & SPP_HB_DISABLE) { sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } + if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { + sctp_feature_off(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); + } else if (paddrp->spp_flags & SPP_PMTUD_DISABLE) { + sctp_feature_on(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); + } if (paddrp->spp_flags & SPP_DSCP) { inp->sctp_ep.default_dscp = paddrp->spp_dscp << 2; inp->sctp_ep.default_dscp |= 0x01; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 23:06:20 2012 (r231465) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:12:48 2012 (r231466) @@ -2052,6 +2052,9 @@ sctp_timer_start(int t_type, struct sctp if (net == NULL) { return; } + if (net->dest_state & SCTP_ADDR_NO_PMTUD) { + return; + } to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_PMTU]; tmr = &net->pmtu_timer; break; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:15:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55176106566C; Fri, 10 Feb 2012 23:15:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38C348FC13; Fri, 10 Feb 2012 23:15: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 q1ANFBVT000978; Fri, 10 Feb 2012 23:15:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANFBGQ000974; Fri, 10 Feb 2012 23:15:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102315.q1ANFBGQ000974@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:15:11 +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: r231467 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:15:11 -0000 Author: tuexen Date: Fri Feb 10 23:15:10 2012 New Revision: 231467 URL: http://svn.freebsd.org/changeset/base/231467 Log: MFC r225676: Cleanup the iterator code, remove code that is never executed. Modified: stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 23:12:48 2012 (r231466) +++ stable/8/sys/netinet/sctp_bsd_addr.c Fri Feb 10 23:15:10 2012 (r231467) @@ -74,22 +74,6 @@ MALLOC_DEFINE(SCTP_M_MCORE, "sctp_mcore" /* Global NON-VNET structure that controls the iterator */ struct iterator_control sctp_it_ctl; -static int __sctp_thread_based_iterator_started = 0; - - -static void -sctp_cleanup_itqueue(void) -{ - struct sctp_iterator *it, *nit; - - TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { - if (it->function_atend != NULL) { - (*it->function_atend) (it->pointer, it->val); - } - TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); - SCTP_FREE(it, SCTP_M_ITER); - } -} void @@ -102,17 +86,11 @@ static void sctp_iterator_thread(void *v) { SCTP_IPI_ITERATOR_WQ_LOCK(); + /* In FreeBSD this thread never terminates. */ while (1) { msleep(&sctp_it_ctl.iterator_running, &sctp_it_ctl.ipi_iterator_wq_mtx, 0, "waiting_for_work", 0); - if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_MUST_EXIT) { - SCTP_IPI_ITERATOR_WQ_DESTROY(); - SCTP_ITERATOR_LOCK_DESTROY(); - sctp_cleanup_itqueue(); - __sctp_thread_based_iterator_started = 0; - kthread_exit(); - } sctp_iterator_worker(); } } @@ -120,21 +98,21 @@ sctp_iterator_thread(void *v) void sctp_startup_iterator(void) { - if (__sctp_thread_based_iterator_started) { + static int called = 0; + int ret; + + if (called) { /* You only get one */ return; } /* init the iterator head */ - __sctp_thread_based_iterator_started = 1; + called = 1; sctp_it_ctl.iterator_running = 0; sctp_it_ctl.iterator_flags = 0; sctp_it_ctl.cur_it = NULL; SCTP_ITERATOR_LOCK_INIT(); SCTP_IPI_ITERATOR_WQ_INIT(); TAILQ_INIT(&sctp_it_ctl.iteratorhead); - - int ret; - ret = kproc_create(sctp_iterator_thread, (void *)NULL, &sctp_it_ctl.thread_proc, Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 23:12:48 2012 (r231466) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 23:15:10 2012 (r231467) @@ -185,9 +185,8 @@ struct iterator_control { uint32_t iterator_flags; }; -#define SCTP_ITERATOR_MUST_EXIT 0x00000001 -#define SCTP_ITERATOR_STOP_CUR_IT 0x00000002 -#define SCTP_ITERATOR_STOP_CUR_INP 0x00000004 +#define SCTP_ITERATOR_STOP_CUR_IT 0x00000004 +#define SCTP_ITERATOR_STOP_CUR_INP 0x00000008 struct sctp_net_route { sctp_rtentry_t *ro_rt; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 23:12:48 2012 (r231466) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:15:10 2012 (r231467) @@ -1293,10 +1293,6 @@ select_a_new_ep: SCTP_INP_DECR_REF(it->inp); atomic_add_int(&it->stcb->asoc.refcnt, -1); if (sctp_it_ctl.iterator_flags & - SCTP_ITERATOR_MUST_EXIT) { - goto done_with_iterator; - } - if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_STOP_CUR_IT) { sctp_it_ctl.iterator_flags &= ~SCTP_ITERATOR_STOP_CUR_IT; goto done_with_iterator; @@ -1372,9 +1368,6 @@ sctp_iterator_worker(void) sctp_it_ctl.cur_it = NULL; CURVNET_RESTORE(); SCTP_IPI_ITERATOR_WQ_LOCK(); - if (sctp_it_ctl.iterator_flags & SCTP_ITERATOR_MUST_EXIT) { - break; - } /* sa_ignore FREED_MEMORY */ } sctp_it_ctl.iterator_running = 0; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:17:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 795B31065675; Fri, 10 Feb 2012 23:17:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67A898FC13; Fri, 10 Feb 2012 23:17:33 +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 q1ANHX9j001183; Fri, 10 Feb 2012 23:17:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANHX3q001180; Fri, 10 Feb 2012 23:17:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102317.q1ANHX3q001180@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:17:33 +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: r231468 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:17:33 -0000 Author: tuexen Date: Fri Feb 10 23:17:33 2012 New Revision: 231468 URL: http://svn.freebsd.org/changeset/base/231468 Log: MFC r226168: Update the inp stored in a HB-timer when moving an stcb to a new inp. Use only this stored inp when processing a HB timeout. This fixes a bug which results in a crash. Modified: stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:15:10 2012 (r231467) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:17:33 2012 (r231468) @@ -2804,6 +2804,7 @@ sctp_move_pcb_and_assoc(struct sctp_inpc /* now what about the nets? */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { net->pmtu_timer.ep = (void *)new_inp; + net->hb_timer.ep = (void *)new_inp; net->rxt_timer.ep = (void *)new_inp; } SCTP_INP_WUNLOCK(new_inp); Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 23:15:10 2012 (r231467) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:17:33 2012 (r231468) @@ -1661,7 +1661,7 @@ sctp_timeout_handler(void *t) sctp_auditing(4, inp, stcb, net); #endif if (!(net->dest_state & SCTP_ADDR_NOHB)) { - sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_HB_TMR, SCTP_SO_NOT_LOCKED); } break; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:19:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86D7D106567A; Fri, 10 Feb 2012 23:19:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6ECE18FC14; Fri, 10 Feb 2012 23:19:33 +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 q1ANJXdL001348; Fri, 10 Feb 2012 23:19:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANJXF0001346; Fri, 10 Feb 2012 23:19:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102319.q1ANJXF0001346@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:19:33 +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: r231469 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:19:33 -0000 Author: tuexen Date: Fri Feb 10 23:19:33 2012 New Revision: 231469 URL: http://svn.freebsd.org/changeset/base/231469 Log: MFC r226203: When moving an stcb to a new inp and we copy over the list of bound addresses, update the last used address pointer. If not, it might result in a crash if the old inp goes away. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:17:33 2012 (r231468) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:19:33 2012 (r231469) @@ -2786,6 +2786,9 @@ sctp_move_pcb_and_assoc(struct sctp_inpc LIST_INSERT_HEAD(&new_inp->sctp_addr_list, laddr, sctp_nxt_addr); new_inp->laddr_count++; + if (oladdr == stcb->asoc.last_used_address) { + stcb->asoc.last_used_address = laddr; + } } } /* From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:24:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57A4C106564A; Fri, 10 Feb 2012 23:24:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46C928FC0C; Fri, 10 Feb 2012 23:24:34 +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 q1ANOYbS001593; Fri, 10 Feb 2012 23:24:34 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANOYYW001591; Fri, 10 Feb 2012 23:24:34 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202102324.q1ANOYYW001591@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 23:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231470 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:24:34 -0000 Author: gonzo Date: Fri Feb 10 23:24:33 2012 New Revision: 231470 URL: http://svn.freebsd.org/changeset/base/231470 Log: - Reverse logic so base tls is fixed up with correct number Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Fri Feb 10 23:19:33 2012 (r231469) +++ head/sys/mips/mips/vm_machdep.c Fri Feb 10 23:24:33 2012 (r231470) @@ -608,7 +608,7 @@ cpu_set_user_tls(struct thread *td, void * to make it the same way TLS base is passed to * MIPS_SET_TLS/MIPS_GET_TLS API */ -#ifndef __mips_n64 +#ifdef __mips_n64 td->td_md.md_tls = (char*)tls_base + 0x7010; #else td->td_md.md_tls = (char*)tls_base + 0x7008; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:24:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A22DC106566B; Fri, 10 Feb 2012 23:24:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8604D8FC12; Fri, 10 Feb 2012 23:24:34 +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 q1ANOYK5001607; Fri, 10 Feb 2012 23:24:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANOYN1001605; Fri, 10 Feb 2012 23:24:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102324.q1ANOYN1001605@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:24:34 +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: r231471 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:24:34 -0000 Author: tuexen Date: Fri Feb 10 23:24:34 2012 New Revision: 231471 URL: http://svn.freebsd.org/changeset/base/231471 Log: MFC r226252: Use the most significant 6 bits of the dscp instead of the least significant ones. This has changed in the latest version of the socket API ID and provides backwards compatibility and gets it in syn with the usage of the IP_TOS socket option. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:24:33 2012 (r231470) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:24:34 2012 (r231471) @@ -2424,7 +2424,7 @@ flags_out: paddrp->spp_flags |= SPP_PMTUD_DISABLE; } if (net->dscp & 0x01) { - paddrp->spp_dscp = net->dscp >> 2; + paddrp->spp_dscp = net->dscp & 0xfc; paddrp->spp_flags |= SPP_DSCP; } #ifdef INET6 @@ -2442,7 +2442,7 @@ flags_out: paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure; paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc); if (stcb->asoc.default_dscp & 0x01) { - paddrp->spp_dscp = stcb->asoc.default_dscp >> 2; + paddrp->spp_dscp = stcb->asoc.default_dscp & 0xfc; paddrp->spp_flags |= SPP_DSCP; } #ifdef INET6 @@ -2477,7 +2477,7 @@ flags_out: paddrp->spp_assoc_id = SCTP_FUTURE_ASSOC; /* get inp's default */ if (inp->sctp_ep.default_dscp & 0x01) { - paddrp->spp_dscp = inp->sctp_ep.default_dscp >> 2; + paddrp->spp_dscp = inp->sctp_ep.default_dscp & 0xfc; paddrp->spp_flags |= SPP_DSCP; } #ifdef INET6 @@ -4659,7 +4659,7 @@ sctp_setopt(struct socket *so, int optna net->failure_threshold = paddrp->spp_pathmaxrxt; } if (paddrp->spp_flags & SPP_DSCP) { - net->dscp = paddrp->spp_dscp << 2; + net->dscp = paddrp->spp_dscp & 0xfc; net->dscp |= 0x01; } #ifdef INET6 @@ -4762,10 +4762,10 @@ sctp_setopt(struct socket *so, int optna } if (paddrp->spp_flags & SPP_DSCP) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - net->dscp = paddrp->spp_dscp << 2; + net->dscp = paddrp->spp_dscp & 0xfc; net->dscp |= 0x01; } - stcb->asoc.default_dscp = paddrp->spp_dscp << 2; + stcb->asoc.default_dscp = paddrp->spp_dscp & 0xfc; stcb->asoc.default_dscp |= 0x01; } #ifdef INET6 @@ -4819,7 +4819,7 @@ sctp_setopt(struct socket *so, int optna sctp_feature_on(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_DSCP) { - inp->sctp_ep.default_dscp = paddrp->spp_dscp << 2; + inp->sctp_ep.default_dscp = paddrp->spp_dscp & 0xfc; inp->sctp_ep.default_dscp |= 0x01; } #ifdef INET6 From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:26:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2617E106566C; Fri, 10 Feb 2012 23:26:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE8FE8FC08; Fri, 10 Feb 2012 23:26: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 q1ANQhDf001717; Fri, 10 Feb 2012 23:26:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANQhVB001715; Fri, 10 Feb 2012 23:26:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102326.q1ANQhVB001715@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:26: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: r231472 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:26:44 -0000 Author: tuexen Date: Fri Feb 10 23:26:43 2012 New Revision: 231472 URL: http://svn.freebsd.org/changeset/base/231472 Log: MFC r226868: Send out control chunks which have no specific destination. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:24:34 2012 (r231471) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:26:43 2012 (r231472) @@ -8003,12 +8003,20 @@ again_one_more_time: if (chk->rec.chunk_id.id != SCTP_ASCONF) { continue; } - if (chk->whoTo != net) { - /* - * No, not sent to the network we are - * looking at - */ - break; + if (chk->whoTo == NULL) { + if (asoc->alternate == NULL) { + if (asoc->primary_destination != net) { + break; + } + } else { + if (asoc->alternate != net) { + break; + } + } + } else { + if (chk->whoTo != net) { + break; + } } if (chk->data == NULL) { break; @@ -8092,6 +8100,10 @@ again_one_more_time: */ no_data_chunks = 1; chk->sent = SCTP_DATAGRAM_SENT; + if (chk->whoTo == NULL) { + chk->whoTo = net; + atomic_add_int(&net->ref_count, 1); + } chk->snd_count++; if (mtu == 0) { /* @@ -8198,12 +8210,20 @@ again_one_more_time: goto skip_net_check; } } - if (chk->whoTo != net) { - /* - * No, not sent to the network we are - * looking at - */ - continue; + if (chk->whoTo == NULL) { + if (asoc->alternate == NULL) { + if (asoc->primary_destination != net) { + continue; + } + } else { + if (asoc->alternate != net) { + continue; + } + } + } else { + if (chk->whoTo != net) { + continue; + } } skip_net_check: if (chk->data == NULL) { @@ -8332,6 +8352,10 @@ again_one_more_time: SCTP_STAT_INCR(sctps_sendecne); } chk->sent = SCTP_DATAGRAM_SENT; + if (chk->whoTo == NULL) { + chk->whoTo = net; + atomic_add_int(&net->ref_count, 1); + } chk->snd_count++; } if (mtu == 0) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:29:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B07211065673; Fri, 10 Feb 2012 23:29:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF6A8FC0C; Fri, 10 Feb 2012 23:29:08 +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 q1ANT8Q6001832; Fri, 10 Feb 2012 23:29:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANT8Tl001830; Fri, 10 Feb 2012 23:29:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102329.q1ANT8Tl001830@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:29:08 +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: r231473 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:29:08 -0000 Author: tuexen Date: Fri Feb 10 23:29:08 2012 New Revision: 231473 URL: http://svn.freebsd.org/changeset/base/231473 Log: MFC r226869: When add a new remote address using sctp_add_remote_addr(), return the correct net if requested. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:26:43 2012 (r231472) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:29:08 2012 (r231473) @@ -4138,6 +4138,9 @@ sctp_add_remote_addr(struct sctp_tcb *st #ifdef INVARIANTS net->flowidset = 1; #endif + if (netp) { + *netp = net; + } netfirst = TAILQ_FIRST(&stcb->asoc.nets); if (net->ro.ro_rt == NULL) { /* Since we have no route put it at the back */ @@ -4209,9 +4212,6 @@ sctp_add_remote_addr(struct sctp_tcb *st TAILQ_INSERT_HEAD(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next); } - if (netp) { - *netp = net; - } return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:30:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39197106564A; Fri, 10 Feb 2012 23:30:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2828B8FC0C; Fri, 10 Feb 2012 23:30: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 q1ANUUfh001931; Fri, 10 Feb 2012 23:30:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANUUMT001929; Fri, 10 Feb 2012 23:30:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202102330.q1ANUUMT001929@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 10 Feb 2012 23:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231474 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:30:30 -0000 Author: jkim Date: Fri Feb 10 23:30:29 2012 New Revision: 231474 URL: http://svn.freebsd.org/changeset/base/231474 Log: De-obfuscate acpi_acquire_global_lock(). It seems the function was directly translated from i386 assembly version. Modified: head/sys/dev/acpica/Osd/OsdSynch.c Modified: head/sys/dev/acpica/Osd/OsdSynch.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSynch.c Fri Feb 10 23:29:08 2012 (r231473) +++ head/sys/dev/acpica/Osd/OsdSynch.c Fri Feb 10 23:30:29 2012 (r231474) @@ -566,11 +566,8 @@ AcpiOsReleaseLock(ACPI_SPINLOCK Handle, } /* Section 5.2.10.1: global lock acquire/release functions */ -#define GL_ACQUIRED (-1) -#define GL_BUSY 0 #define GL_BIT_PENDING 0x01 #define GL_BIT_OWNED 0x02 -#define GL_BIT_MASK (GL_BIT_PENDING | GL_BIT_OWNED) /* * Acquire the global lock. If busy, set the pending bit. The caller @@ -584,11 +581,12 @@ acpi_acquire_global_lock(uint32_t *lock) do { old = *lock; - new = ((old & ~GL_BIT_MASK) | GL_BIT_OWNED) | - ((old >> 1) & GL_BIT_PENDING); + new = (old & ~GL_BIT_PENDING) | GL_BIT_OWNED; + if ((old & GL_BIT_OWNED) != 0) + new |= GL_BIT_PENDING; } while (atomic_cmpset_acq_int(lock, old, new) == 0); - return ((new < GL_BIT_MASK) ? GL_ACQUIRED : GL_BUSY); + return ((new & GL_BIT_PENDING) == 0); } /* @@ -603,8 +601,8 @@ acpi_release_global_lock(uint32_t *lock) do { old = *lock; - new = old & ~GL_BIT_MASK; + new = old & ~(GL_BIT_PENDING | GL_BIT_OWNED); } while (atomic_cmpset_rel_int(lock, old, new) == 0); - return (old & GL_BIT_PENDING); + return ((old & GL_BIT_PENDING) != 0); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:32:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B43481065678; Fri, 10 Feb 2012 23:32:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A28898FC1A; Fri, 10 Feb 2012 23:32:04 +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 q1ANW47J002019; Fri, 10 Feb 2012 23:32:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANW4pW002017; Fri, 10 Feb 2012 23:32:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102332.q1ANW4pW002017@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:32:04 +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: r231475 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:32:04 -0000 Author: tuexen Date: Fri Feb 10 23:32:04 2012 New Revision: 231475 URL: http://svn.freebsd.org/changeset/base/231475 Log: MFC r227266: Initialize all components of the sent COOKIE. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:30:29 2012 (r231474) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:32:04 2012 (r231475) @@ -5711,6 +5711,8 @@ do_a_abort: stc.laddress[2] = 0; stc.laddress[3] = 0; stc.laddr_type = SCTP_IPV4_ADDRESS; + /* scope_id is only for v6 */ + stc.scope_id = 0; break; #endif #ifdef INET6 @@ -5719,6 +5721,7 @@ do_a_abort: memcpy(&stc.address, &sin6->sin6_addr, sizeof(struct in6_addr)); stc.addr_type = SCTP_IPV6_ADDRESS; + stc.scope_id = sin6->sin6_scope_id; if (net->src_addr_selected == 0) { /* * strange case here, the INIT should have @@ -5746,6 +5749,7 @@ do_a_abort: /* who are we */ memcpy(stc.identification, SCTP_VERSION_STRING, min(strlen(SCTP_VERSION_STRING), sizeof(stc.identification))); + memset(stc.reserved, 0, SCTP_RESERVE_SPACE); /* now the chunk header */ initack->ch.chunk_type = SCTP_INITIATION_ACK; initack->ch.chunk_flags = 0; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:34:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 873731065678; Fri, 10 Feb 2012 23:34:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 758708FC14; Fri, 10 Feb 2012 23:34: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 q1ANY7W7002136; Fri, 10 Feb 2012 23:34:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANY7dJ002134; Fri, 10 Feb 2012 23:34:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102334.q1ANY7dJ002134@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:34: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: r231476 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:34:07 -0000 Author: tuexen Date: Fri Feb 10 23:34:07 2012 New Revision: 231476 URL: http://svn.freebsd.org/changeset/base/231476 Log: MFC r227320: When loading addresses from INITs, always use the correct local address. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:32:04 2012 (r231475) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:34:07 2012 (r231476) @@ -6181,54 +6181,65 @@ sctp_load_addresses_from_init(struct sct sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_port = stcb->rport; #endif - if (altsa == NULL) { - iph = mtod(m, struct ip *); - switch (iph->ip_v) { + iph = mtod(m, struct ip *); + switch (iph->ip_v) { #ifdef INET - case IPVERSION: - { - /* its IPv4 */ - struct sockaddr_in *sin_2; - - sin_2 = (struct sockaddr_in *)(local_sa); - memset(sin_2, 0, sizeof(sin)); - sin_2->sin_family = AF_INET; - sin_2->sin_len = sizeof(sin); - sin_2->sin_port = sh->dest_port; - sin_2->sin_addr.s_addr = iph->ip_dst.s_addr; + case IPVERSION: + { + /* its IPv4 */ + struct sockaddr_in *sin_2; + + sin_2 = (struct sockaddr_in *)(local_sa); + memset(sin_2, 0, sizeof(sin)); + sin_2->sin_family = AF_INET; + sin_2->sin_len = sizeof(sin); + sin_2->sin_port = sh->dest_port; + sin_2->sin_addr.s_addr = iph->ip_dst.s_addr; + if (altsa) { + /* + * For cookies we use the src address NOT + * from the packet but from the original + * INIT. + */ + sa = altsa; + } else { sin.sin_addr = iph->ip_src; sa = (struct sockaddr *)&sin; - break; } + break; + } #endif #ifdef INET6 - case IPV6_VERSION >> 4: - { - /* its IPv6 */ - struct ip6_hdr *ip6; - struct sockaddr_in6 *sin6_2; - - ip6 = mtod(m, struct ip6_hdr *); - sin6_2 = (struct sockaddr_in6 *)(local_sa); - memset(sin6_2, 0, sizeof(sin6)); - sin6_2->sin6_family = AF_INET6; - sin6_2->sin6_len = sizeof(struct sockaddr_in6); - sin6_2->sin6_port = sh->dest_port; + case IPV6_VERSION >> 4: + { + /* its IPv6 */ + struct ip6_hdr *ip6; + struct sockaddr_in6 *sin6_2; + + ip6 = mtod(m, struct ip6_hdr *); + sin6_2 = (struct sockaddr_in6 *)(local_sa); + memset(sin6_2, 0, sizeof(sin6)); + sin6_2->sin6_family = AF_INET6; + sin6_2->sin6_len = sizeof(struct sockaddr_in6); + sin6_2->sin6_port = sh->dest_port; + sin6_2->sin6_addr = ip6->ip6_dst; + if (altsa) { + /* + * For cookies we use the src address NOT + * from the packet but from the original + * INIT. + */ + sa = altsa; + } else { sin6.sin6_addr = ip6->ip6_src; sa = (struct sockaddr *)&sin6; - break; } -#endif - default: - return (-1); break; } - } else { - /* - * For cookies we use the src address NOT from the packet - * but from the original INIT - */ - sa = altsa; +#endif + default: + return (-1); + break; } /* Turn off ECN until we get through all params */ ecn_allowed = 0; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:36:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B4D11065670; Fri, 10 Feb 2012 23:36:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FA6C8FC1A; Fri, 10 Feb 2012 23:36:34 +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 q1ANaXY2002254; Fri, 10 Feb 2012 23:36:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANaXhW002252; Fri, 10 Feb 2012 23:36:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102336.q1ANaXhW002252@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:36:33 +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: r231477 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:36:34 -0000 Author: tuexen Date: Fri Feb 10 23:36:33 2012 New Revision: 231477 URL: http://svn.freebsd.org/changeset/base/231477 Log: MFC r227486: Don't copy uninitialized memory. Also simplify the comparison of interface names. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:34:07 2012 (r231476) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:36:33 2012 (r231477) @@ -559,9 +559,9 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - memcpy(sctp_ifnp->ifn_name, if_name, SCTP_IFNAMSIZ); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); } else { - memcpy(sctp_ifnp->ifn_name, "unknown", min(7, SCTP_IFNAMSIZ)); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -768,19 +768,9 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, * panda who might recycle indexes fast. */ if (if_name) { - int len1, len2; - - len1 = min(SCTP_IFNAMSIZ, strlen(if_name)); - len2 = min(SCTP_IFNAMSIZ, strlen(sctp_ifap->ifn_p->ifn_name)); - if (len1 && len2 && (len1 == len2)) { - /* we can compare them */ - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) == 0) { - /* - * They match its a correct - * delete - */ - valid = 1; - } + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { + /* They match its a correct delete */ + valid = 1; } } if (!valid) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:38:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1478106564A; Fri, 10 Feb 2012 23:38:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B57988FC17; Fri, 10 Feb 2012 23:38:38 +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 q1ANcclK002358; Fri, 10 Feb 2012 23:38:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANccVm002356; Fri, 10 Feb 2012 23:38:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102338.q1ANccVm002356@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:38:38 +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: r231478 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:38:39 -0000 Author: tuexen Date: Fri Feb 10 23:38:38 2012 New Revision: 231478 URL: http://svn.freebsd.org/changeset/base/231478 Log: MFC r227540: Set the MTU of an path to an approriate value if the interface MTU can't be determined. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:36:33 2012 (r231477) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:38:38 2012 (r231478) @@ -4064,13 +4064,8 @@ sctp_add_remote_addr(struct sctp_tcb *st /* Now get the interface MTU */ if (net->ro._s_addr && net->ro._s_addr->ifn_p) { net->mtu = SCTP_GATHER_MTU_FROM_INTFC(net->ro._s_addr->ifn_p); - } else { - net->mtu = 0; } - if (net->mtu == 0) { - /* Huh ?? */ - net->mtu = SCTP_DEFAULT_MTU; - } else { + if (net->mtu > 0) { uint32_t rmtu; rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt); @@ -4090,11 +4085,31 @@ sctp_add_remote_addr(struct sctp_tcb *st net->mtu = rmtu; } } - if (from == SCTP_ALLOC_ASOC) { - stcb->asoc.smallest_mtu = net->mtu; + } + if (net->mtu == 0) { + switch (newaddr->sa_family) { +#ifdef INET + case AF_INET: + net->mtu = SCTP_DEFAULT_MTU; + break; +#endif +#ifdef INET6 + case AF_INET6: + net->mtu = 1280; + break; +#endif + default: + break; } - } else { - net->mtu = stcb->asoc.smallest_mtu; + } + if (net->port) { + net->mtu -= (uint32_t) sizeof(struct udphdr); + } + if (from == SCTP_ALLOC_ASOC) { + stcb->asoc.smallest_mtu = net->mtu; + } + if (stcb->asoc.smallest_mtu > net->mtu) { + stcb->asoc.smallest_mtu = net->mtu; } #ifdef INET6 if (newaddr->sa_family == AF_INET6) { @@ -4104,12 +4119,7 @@ sctp_add_remote_addr(struct sctp_tcb *st (void)sa6_recoverscope(sin6); } #endif - if (net->port) { - net->mtu -= sizeof(struct udphdr); - } - if (stcb->asoc.smallest_mtu > net->mtu) { - stcb->asoc.smallest_mtu = net->mtu; - } + /* JRS - Use the congestion control given in the CC module */ if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) (*stcb->asoc.cc_functions.sctp_set_initial_cc_param) (stcb, net); From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:41:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 565B01065674; Fri, 10 Feb 2012 23:41:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A85C8FC16; Fri, 10 Feb 2012 23:41:38 +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 q1ANfc61002501; Fri, 10 Feb 2012 23:41:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANfclM002499; Fri, 10 Feb 2012 23:41:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102341.q1ANfclM002499@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:41:38 +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: r231479 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:41:38 -0000 Author: tuexen Date: Fri Feb 10 23:41:37 2012 New Revision: 231479 URL: http://svn.freebsd.org/changeset/base/231479 Log: MFC r227655: Cleanup comparison of interface names. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:38:38 2012 (r231478) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:41:37 2012 (r231479) @@ -331,19 +331,9 @@ sctp_mark_ifa_addr_down(uint32_t vrf_id, goto out; } if (if_name) { - int len1, len2; - - len1 = strlen(if_name); - len2 = strlen(sctp_ifap->ifn_p->ifn_name); - if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", - len1, len2); - goto out; - } - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) { + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, - if_name); + sctp_ifap->ifn_p->ifn_name, if_name); goto out; } } else { @@ -384,19 +374,9 @@ sctp_mark_ifa_addr_up(uint32_t vrf_id, s goto out; } if (if_name) { - int len1, len2; - - len1 = strlen(if_name); - len2 = strlen(sctp_ifap->ifn_p->ifn_name); - if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", - len1, len2); - goto out; - } - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) { + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, - if_name); + sctp_ifap->ifn_p->ifn_name, if_name); goto out; } } else { From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:49:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 522C01065672; Fri, 10 Feb 2012 23:49:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28F678FC12; Fri, 10 Feb 2012 23:49: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 q1ANn5fr002785; Fri, 10 Feb 2012 23:49:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANn4G1002773; Fri, 10 Feb 2012 23:49:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102349.q1ANn4G1002773@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:49:04 +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: r231480 - in stable/8: . contrib/bsnmp/snmpd contrib/top contrib/xz gnu/usr.bin lib lib/libc/net lib/liblzma lib/librtld_db lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/s... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:49:05 -0000 Author: tuexen Date: Fri Feb 10 23:49:04 2012 New Revision: 231480 URL: http://svn.freebsd.org/changeset/base/231480 Log: MFC r227755: Add support for the SCTP_REMOTE_UDP_ENCAPS_PORT socket option. Retire the the now unused sctp_udp_tunneling_for_client_enable sysctl variable. Modified: stable/8/lib/libc/net/sctp_sys_calls.c stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/ (props changed) stable/8/COPYRIGHT (props changed) stable/8/LOCKS (props changed) stable/8/MAINTAINERS (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/README (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/df/ (props changed) stable/8/bin/echo/ (props changed) stable/8/bin/ed/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kenv/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/stty/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/dtracetoolkit/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/amd/ (props changed) stable/8/contrib/bc/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/cvs/ (props changed) stable/8/contrib/diff/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gcclibs/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/gnu-sort/ (props changed) stable/8/contrib/gperf/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libarchive/ (props changed) stable/8/contrib/libarchive/cpio/ (props changed) stable/8/contrib/libarchive/libarchive/ (props changed) stable/8/contrib/libarchive/libarchive_fe/ (props changed) stable/8/contrib/libarchive/tar/ (props changed) stable/8/contrib/libbegemot/ (props changed) stable/8/contrib/libf2c/ (props changed) stable/8/contrib/libobjc/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libreadline/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/lukemftpd/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ngatm/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/opie/ (props changed) stable/8/contrib/pam_modules/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/pnpinfo/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/smbfs/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/texinfo/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) stable/8/crypto/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) stable/8/gnu/usr.bin/cc/include/ (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/gperf/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/comsat/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rshd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/conscontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/gvinum/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/md5/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mdmfs/ (props changed) stable/8/sbin/mknod/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/mount_unionfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/quotacheck/ (props changed) stable/8/sbin/rcorder/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/shutdown/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/doc/ (props changed) stable/8/share/doc/papers/devfs/ (props changed) stable/8/share/doc/papers/jail/ (props changed) stable/8/share/doc/smm/01.setup/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/misc/bsd-family-tree (props changed) stable/8/share/mk/ (props changed) stable/8/share/skel/ (props changed) stable/8/share/syscons/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acct/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/ (props changed) stable/8/tools/regression/bin/date/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/bin/test/ (props changed) stable/8/tools/regression/doat/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/netinet/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/sockets/unix_gc/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/test/malloc/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/aac/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/cfi/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/tools/tools/iwi/ (props changed) stable/8/tools/tools/mctest/ (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/sctp.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/IPXrouted/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/Makefile.inc (props changed) stable/8/usr.sbin/ac/ (props changed) stable/8/usr.sbin/accton/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/adduser/ (props changed) stable/8/usr.sbin/amd/ (props changed) stable/8/usr.sbin/ancontrol/ (props changed) stable/8/usr.sbin/apm/ (props changed) stable/8/usr.sbin/apmd/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/audit/ (props changed) stable/8/usr.sbin/auditd/ (props changed) stable/8/usr.sbin/auditreduce/ (props changed) stable/8/usr.sbin/authpf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/bluetooth/l2control/ (props changed) stable/8/usr.sbin/bluetooth/l2ping/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/boot98cfg/ (props changed) stable/8/usr.sbin/bootparamd/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) stable/8/usr.sbin/btxld/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chkgrp/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/chroot/ (props changed) stable/8/usr.sbin/ckdist/ (props changed) stable/8/usr.sbin/clear_locks/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/cron/crontab/ (props changed) stable/8/usr.sbin/crunch/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/daemon/ (props changed) stable/8/usr.sbin/dconschat/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/digictl/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dnssec-dsfromkey/ (props changed) stable/8/usr.sbin/dnssec-keyfromlabel/ (props changed) stable/8/usr.sbin/dnssec-keygen/ (props changed) stable/8/usr.sbin/dnssec-signzone/ (props changed) stable/8/usr.sbin/dumpcis/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/editmap/ (props changed) stable/8/usr.sbin/edquota/ (props changed) stable/8/usr.sbin/eeprom/ (props changed) stable/8/usr.sbin/extattr/ (props changed) stable/8/usr.sbin/extattrctl/ (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/ftp-proxy/ (props changed) stable/8/usr.sbin/fwcontrol/ (props changed) stable/8/usr.sbin/getfmac/ (props changed) stable/8/usr.sbin/getpmac/ (props changed) stable/8/usr.sbin/gssd/ (props changed) stable/8/usr.sbin/gstat/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/ifmcstat/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/ip6addrctl/ (props changed) stable/8/usr.sbin/ipfwpcap/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jexec/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/kbdcontrol/ (props changed) stable/8/usr.sbin/kbdmap/ (props changed) stable/8/usr.sbin/kernbb/ (props changed) stable/8/usr.sbin/keyserv/ (props changed) stable/8/usr.sbin/kgmon/ (props changed) stable/8/usr.sbin/kgzip/ (props changed) stable/8/usr.sbin/kldxref/ (props changed) stable/8/usr.sbin/lastlogin/ (props changed) stable/8/usr.sbin/lmcconfig/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/lptcontrol/ (props changed) stable/8/usr.sbin/mailstats/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makemap/ (props changed) stable/8/usr.sbin/manctl/ (props changed) stable/8/usr.sbin/memcontrol/ (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mixer/ (props changed) stable/8/usr.sbin/mld6query/ (props changed) stable/8/usr.sbin/mlxcontrol/ (props changed) stable/8/usr.sbin/mount_nwfs/ (props changed) stable/8/usr.sbin/mount_portalfs/ (props changed) stable/8/usr.sbin/mount_smbfs/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptable/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/named-checkconf/ (props changed) stable/8/usr.sbin/named-checkzone/ (props changed) stable/8/usr.sbin/named.reload/ (props changed) stable/8/usr.sbin/ndiscvt/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfscbd/ (props changed) stable/8/usr.sbin/nfsd/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/nfsrevoke/ (props changed) stable/8/usr.sbin/nfsuserd/ (props changed) stable/8/usr.sbin/ngctl/ (props changed) stable/8/usr.sbin/nghook/ (props changed) stable/8/usr.sbin/nologin/ (props changed) stable/8/usr.sbin/nscd/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/nvram/ (props changed) stable/8/usr.sbin/ofwdump/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/info/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/pnpinfo/ (props changed) stable/8/usr.sbin/portsnap/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/praliases/ (props changed) stable/8/usr.sbin/praudit/ (props changed) stable/8/usr.sbin/procctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/pw/ (props changed) stable/8/usr.sbin/pwd_mkdb/ (props changed) stable/8/usr.sbin/quot/ (props changed) stable/8/usr.sbin/quotaon/ (props changed) stable/8/usr.sbin/rarpd/ (props changed) stable/8/usr.sbin/repquota/ (props changed) stable/8/usr.sbin/rip6query/ (props changed) stable/8/usr.sbin/rmt/ (props changed) stable/8/usr.sbin/rndc/ (props changed) stable/8/usr.sbin/rndc-confgen/ (props changed) stable/8/usr.sbin/route6d/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.statd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rpc.yppasswdd/ (props changed) stable/8/usr.sbin/rpc.ypupdated/ (props changed) stable/8/usr.sbin/rpc.ypxfrd/ (props changed) stable/8/usr.sbin/rpcbind/ (props changed) stable/8/usr.sbin/rrenumd/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtprio/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/rwhod/ (props changed) stable/8/usr.sbin/sa/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/sendmail/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/service/Makefile (props changed) stable/8/usr.sbin/service/service.8 (props changed) stable/8/usr.sbin/service/service.sh (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/services_mkdb/Makefile (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.8 (props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.c (props changed) stable/8/usr.sbin/services_mkdb/uniq.c (props changed) stable/8/usr.sbin/setfib/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/sicontrol/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/snapinfo/ (props changed) stable/8/usr.sbin/spkrtest/ (props changed) stable/8/usr.sbin/spray/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/tcpdchk/ (props changed) stable/8/usr.sbin/tcpdmatch/ (props changed) stable/8/usr.sbin/tcpdrop/ (props changed) stable/8/usr.sbin/tcpdump/ (props changed) stable/8/usr.sbin/timed/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/trpt/ (props changed) stable/8/usr.sbin/tzsetup/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/usbdevs/ (props changed) stable/8/usr.sbin/usbdump/ (props changed) stable/8/usr.sbin/usbdump/Makefile (props changed) stable/8/usr.sbin/usbdump/usbdump.8 (props changed) stable/8/usr.sbin/usbdump/usbdump.c (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/vipw/ (props changed) stable/8/usr.sbin/wake/ (props changed) stable/8/usr.sbin/watch/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wlandebug/ (props changed) stable/8/usr.sbin/wlconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/yp_mkdb/ (props changed) stable/8/usr.sbin/ypbind/ (props changed) stable/8/usr.sbin/yppoll/ (props changed) stable/8/usr.sbin/yppush/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/ypset/ (props changed) stable/8/usr.sbin/zic/ (props changed) stable/8/usr.sbin/zzz/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/lib/libc/net/sctp_sys_calls.c Fri Feb 10 23:49:04 2012 (r231480) @@ -413,6 +413,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PEER_ADDR_THLDS: ((struct sctp_paddrthlds *)arg)->spt_assoc_id = id; break; + case SCTP_REMOTE_UDP_ENCAPS_PORT: + ((struct sctp_udpencaps *)arg)->sue_assoc_id = id; + break; default: break; } Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp.h Fri Feb 10 23:49:04 2012 (r231480) @@ -120,6 +120,7 @@ struct sctp_paramhdr { #define SCTP_DEFAULT_SNDINFO 0x00000021 #define SCTP_DEFAULT_PRINFO 0x00000022 #define SCTP_PEER_ADDR_THLDS 0x00000023 +#define SCTP_REMOTE_UDP_ENCAPS_PORT 0x00000024 /* * read-only options Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:49:04 2012 (r231480) @@ -4062,6 +4062,12 @@ sctp_lowlevel_chunk_output(struct sctp_i } } if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_handle_no_route(stcb, net, so_locked); + SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); + sctp_m_freem(m); + return (EHOSTUNREACH); + } udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -4413,6 +4419,12 @@ sctp_lowlevel_chunk_output(struct sctp_i ip6h->ip6_src = lsa6->sin6_addr; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_handle_no_route(stcb, net, so_locked); + SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); + sctp_m_freem(m); + return (EHOSTUNREACH); + } udp = (struct udphdr *)((caddr_t)ip6h + sizeof(struct ip6_hdr)); udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -10965,6 +10977,10 @@ sctp_send_shutdown_complete2(struct mbuf return; } if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp = (struct udphdr *)comp_cp; udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; @@ -11925,6 +11941,10 @@ sctp_send_abort(struct mbuf *m, int iphl udp = (struct udphdr *)abm; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; /* set udp->uh_ulen later */ @@ -12186,6 +12206,10 @@ sctp_send_operr_to(struct mbuf *m, int i udp = (struct udphdr *)sh_out; if (port) { + if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { + sctp_m_freem(mout); + return; + } udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; /* set udp->uh_ulen later */ Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_pcb.c Fri Feb 10 23:49:04 2012 (r231480) @@ -2650,6 +2650,7 @@ sctp_inpcb_alloc(struct socket *so, uint #ifdef INET6 m->default_flowlabel = 0; #endif + m->port = 0; /* encapsulation disabled by default */ sctp_auth_set_default_chunks(m->local_auth_chunks); LIST_INIT(&m->shared_keys); /* add default NULL key as key id 0 */ @@ -3993,13 +3994,9 @@ sctp_add_remote_addr(struct sctp_tcb *st net->RTO = 0; net->RTO_measured = 0; stcb->asoc.numnets++; - *(&net->ref_count) = 1; + net->ref_count = 1; net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; - if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { - net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); - } else { - net->port = 0; - } + net->port = stcb->asoc.port; net->dscp = stcb->asoc.default_dscp; #ifdef INET6 net->flowlabel = stcb->asoc.default_flowlabel; Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_pcb.h Fri Feb 10 23:49:04 2012 (r231480) @@ -328,6 +328,7 @@ struct sctp_pcb { uint8_t default_dscp; char current_secret_number; char last_secret_number; + uint16_t port; /* remote UDP encapsulation port */ }; #ifndef SCTP_ALIGNMENT Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_structs.h Fri Feb 10 23:49:04 2012 (r231480) @@ -414,7 +414,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used as a bit mask */ +/* The upper byte is used a a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { @@ -1211,6 +1211,7 @@ struct sctp_association { uint8_t sctp_cmt_pf; uint8_t use_precise_time; uint32_t sctp_features; + uint16_t port; /* remote UDP encapsulation port */ /* * The mapping array is used to track out of order sequences above * last_acked_seq. 0 indicates packet missing 1 indicates packet Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_sysctl.c Fri Feb 10 23:49:04 2012 (r231480) @@ -122,7 +122,6 @@ sctp_init_sysctls() #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif - SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable) = SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = SCTPCTL_UDP_TUNNELING_PORT_DEFAULT; SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) = SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; @@ -666,10 +665,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), SCTPCTL_RTTVAR_DCCCECN_MIN, SCTPCTL_RTTVAR_DCCCECN_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); -/* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ -#if !defined(__FreeBSD__) || defined(INET) - RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); @@ -1089,10 +1084,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT /* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ #if !defined(__FreeBSD__) || defined(INET) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), 0, sysctl_sctp_check, "IU", - SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_sysctl.h Fri Feb 10 23:49:04 2012 (r231480) @@ -110,7 +110,6 @@ struct sctp_sysctl { #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_log sctp_log; #endif - uint32_t sctp_udp_tunneling_for_client_enable; uint32_t sctp_udp_tunneling_port; uint32_t sctp_enable_sack_immediately; uint32_t sctp_vtag_time_wait; @@ -464,12 +463,6 @@ struct sctp_sysctl { #define SCTPCTL_MOBILITY_FASTHANDOFF_MAX 1 #define SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT SCTP_DEFAULT_MOBILITY_FASTHANDOFF -/* Enable SCTP/UDP tunneling for clients*/ -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC "Enable SCTP/UDP tunneling for client" -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN 0 -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX 1 -#define SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN - /* Enable SCTP/UDP tunneling port */ #define SCTPCTL_UDP_TUNNELING_PORT_DESC "Set the SCTP/UDP tunneling port" #define SCTPCTL_UDP_TUNNELING_PORT_MIN 0 Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:49:04 2012 (r231480) @@ -671,6 +671,12 @@ struct sctp_timeouts { uint32_t stimo_shutdownack; }; +struct sctp_udpencaps { + sctp_assoc_t sue_assoc_id; + struct sockaddr_storage sue_address; + uint16_t sue_port; +}; + struct sctp_cwnd_args { struct sctp_nets *net; /* network to *//* FIXME: LP64 issue */ uint32_t cwnd_new_value;/* cwnd in k */ Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:49:04 2012 (r231480) @@ -3197,6 +3197,92 @@ flags_out: } break; } + case SCTP_REMOTE_UDP_ENCAPS_PORT: + { + struct sctp_udpencaps *encaps; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, *optsize); + SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); + + if (stcb) { + net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + } else { + /* + * We increment here since + * sctp_findassociation_ep_addr() wil do a + * decrement if it finds the stcb as long as + * the locked tcb (last argument) is NOT a + * TCB.. aka NULL. + */ + net = NULL; + SCTP_INP_INCR_REF(inp); + stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + if (stcb == NULL) { + SCTP_INP_DECR_REF(inp); + } + } + if (stcb && (net == NULL)) { + struct sockaddr *sa; + + sa = (struct sockaddr *)&encaps->sue_address; +#ifdef INET + if (sa->sa_family == AF_INET) { + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)sa; + if (sin->sin_addr.s_addr) { + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } else +#endif +#ifdef INET6 + if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } else +#endif + { + error = EAFNOSUPPORT; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } + if (stcb) { + if (net) { + encaps->sue_port = net->port; + } else { + encaps->sue_port = stcb->asoc.port; + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + encaps->sue_port = inp->sctp_ep.port; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_paddrparams); + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; @@ -4494,7 +4580,6 @@ sctp_setopt(struct socket *so, int optna break; } case SCTP_PEER_ADDR_PARAMS: - /* Applies to the specific association */ { struct sctp_paddrparams *paddrp; struct sctp_nets *net; @@ -5551,6 +5636,89 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_REMOTE_UDP_ENCAPS_PORT: + { + struct sctp_udpencaps *encaps; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, optsize); + SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); + if (stcb) { + net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + } else { + /* + * We increment here since + * sctp_findassociation_ep_addr() wil do a + * decrement if it finds the stcb as long as + * the locked tcb (last argument) is NOT a + * TCB.. aka NULL. + */ + net = NULL; + SCTP_INP_INCR_REF(inp); + stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + if (stcb == NULL) { + SCTP_INP_DECR_REF(inp); + } + } + if (stcb && (net == NULL)) { + struct sockaddr *sa; + + sa = (struct sockaddr *)&encaps->sue_address; +#ifdef INET + if (sa->sa_family == AF_INET) { + + struct sockaddr_in *sin; + + sin = (struct sockaddr_in *)sa; + if (sin->sin_addr.s_addr) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + SCTP_TCB_UNLOCK(stcb); + error = EINVAL; + break; + } + } else +#endif +#ifdef INET6 + if (sa->sa_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)sa; + if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + SCTP_TCB_UNLOCK(stcb); + error = EINVAL; + break; + } + } else +#endif + { + error = EAFNOSUPPORT; + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + break; + } + } + if (stcb) { + if (net) { + net->port = encaps->sue_port; + } else { + stcb->asoc.port = encaps->sue_port; + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (encaps->sue_assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + inp->sctp_ep.port = encaps->sue_port; + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Fri Feb 10 23:41:37 2012 (r231479) +++ stable/8/sys/netinet/sctputil.c Fri Feb 10 23:49:04 2012 (r231480) @@ -1117,6 +1117,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->authinfo.recv_keyid = 0; LIST_INIT(&asoc->shared_keys); asoc->marked_retrans = 0; + asoc->port = m->sctp_ep.port; asoc->timoinit = 0; asoc->timodata = 0; asoc->timosack = 0; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:51:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE7EA106564A; Fri, 10 Feb 2012 23:51:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD1578FC08; Fri, 10 Feb 2012 23:51: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 q1ANpNL3002900; Fri, 10 Feb 2012 23:51:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANpN13002898; Fri, 10 Feb 2012 23:51:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102351.q1ANpN13002898@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231481 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:51:23 -0000 Author: tuexen Date: Fri Feb 10 23:51:23 2012 New Revision: 231481 URL: http://svn.freebsd.org/changeset/base/231481 Log: MFC r227930: Move up the address to the top of the sctp_paddrthlds structure like in all other structures. This avoids alignment problems. Modified: stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:49:04 2012 (r231480) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:51:23 2012 (r231481) @@ -521,8 +521,8 @@ struct sctp_paddrparams { #define SPP_IPV4_TOS SPP_DSCP struct sctp_paddrthlds { - sctp_assoc_t spt_assoc_id; struct sockaddr_storage spt_address; + sctp_assoc_t spt_assoc_id; uint16_t spt_pathmaxrxt; uint16_t spt_pathpfthld; }; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:53:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDD10106564A; Fri, 10 Feb 2012 23:53:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC8828FC13; Fri, 10 Feb 2012 23:53: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 q1ANr6LY002995; Fri, 10 Feb 2012 23:53:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANr6hL002993; Fri, 10 Feb 2012 23:53:06 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102353.q1ANr6hL002993@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:53:06 +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: r231482 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:53:07 -0000 Author: tuexen Date: Fri Feb 10 23:53:06 2012 New Revision: 231482 URL: http://svn.freebsd.org/changeset/base/231482 Log: MFC r227931: Move up the address to the top of the sctp_udencaps structure like in all other structures. This avoids alignment problems. Modified: stable/8/sys/netinet/sctp_uio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_uio.h ============================================================================== --- stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:51:23 2012 (r231481) +++ stable/8/sys/netinet/sctp_uio.h Fri Feb 10 23:53:06 2012 (r231482) @@ -672,8 +672,8 @@ struct sctp_timeouts { }; struct sctp_udpencaps { - sctp_assoc_t sue_assoc_id; struct sockaddr_storage sue_address; + sctp_assoc_t sue_assoc_id; uint16_t sue_port; }; From owner-svn-src-all@FreeBSD.ORG Fri Feb 10 23:55:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC021065670; Fri, 10 Feb 2012 23:55:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91C388FC13; Fri, 10 Feb 2012 23:55: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 q1ANteed003128; Fri, 10 Feb 2012 23:55:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANtevS003125; Fri, 10 Feb 2012 23:55:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202102355.q1ANtevS003125@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 Feb 2012 23:55:40 +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: r231483 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:55:40 -0000 Author: tuexen Date: Fri Feb 10 23:55:40 2012 New Revision: 231483 URL: http://svn.freebsd.org/changeset/base/231483 Log: MFC r228031: Fix a warning reported by arundel@. Fix a bug where the parameter length of a supported address types parameter is set to a wrong value if the kernel is built with with either INET or INET6, but not both. Modified: stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Fri Feb 10 23:53:06 2012 (r231482) +++ stable/8/sys/netinet/sctp_header.h Fri Feb 10 23:55:40 2012 (r231483) @@ -81,8 +81,7 @@ struct sctp_host_name_param { /* supported address type */ struct sctp_supported_addr_param { struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */ - uint16_t addr_type[SCTP_ARRAY_MIN_LEN]; /* array of supported address - * types */ + uint16_t addr_type[2]; /* array of supported address types */ } SCTP_PACKED; /* ECN parameter */ Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:53:06 2012 (r231482) +++ stable/8/sys/netinet/sctp_output.c Fri Feb 10 23:55:40 2012 (r231483) @@ -4680,24 +4680,24 @@ sctp_send_initiate(struct sctp_inpcb *in #ifdef INET6 #ifdef INET /* we support 2 types: IPv4/IPv6 */ - sup_addr->ph.param_length = htons(sizeof(*sup_addr) + sizeof(uint16_t)); + sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(SCTP_IPV6_ADDRESS); #else /* we support 1 type: IPv6 */ - sup_addr->ph.param_length = htons(sizeof(*sup_addr) + sizeof(uint8_t)); + sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); sup_addr->addr_type[0] = htons(SCTP_IPV6_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ #endif #else /* we support 1 type: IPv4 */ - sup_addr->ph.param_length = htons(sizeof(*sup_addr) + sizeof(uint8_t)); + sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ #endif - SCTP_BUF_LEN(m) += sizeof(*sup_addr) + sizeof(uint16_t); + SCTP_BUF_LEN(m) += sizeof(struct sctp_supported_addr_param); /* adaptation layer indication parameter */ - ali = (struct sctp_adaptation_layer_indication *)((caddr_t)sup_addr + sizeof(*sup_addr) + sizeof(uint16_t)); + ali = (struct sctp_adaptation_layer_indication *)((caddr_t)sup_addr + sizeof(struct sctp_supported_addr_param)); ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); ali->ph.param_length = htons(sizeof(*ali)); ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 00:28:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ACBE106566C; Sat, 11 Feb 2012 00:28:31 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE3B98FC08; Sat, 11 Feb 2012 00:28: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 q1B0SURK004250; Sat, 11 Feb 2012 00:28:30 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0SUKD004248; Sat, 11 Feb 2012 00:28:30 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202110028.q1B0SUKD004248@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sat, 11 Feb 2012 00:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231485 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:28:31 -0000 Author: ken Date: Sat Feb 11 00:28:30 2012 New Revision: 231485 URL: http://svn.freebsd.org/changeset/base/231485 Log: Return BUS_PROBE_DEFAULT instead of BUS_PROBE_VENDOR from the mps driver probe routine. This will allow LSI to ship drivers that return BUS_PROBE_VENDOR to override the in-tree version of the driver. MFC after: 3 days Modified: head/sys/dev/mps/mps_pci.c Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Sat Feb 11 00:19:31 2012 (r231484) +++ head/sys/dev/mps/mps_pci.c Sat Feb 11 00:28:30 2012 (r231485) @@ -172,7 +172,7 @@ mps_pci_probe(device_t dev) if ((id = mps_find_ident(dev)) != NULL) { device_set_desc(dev, id->desc); - return (BUS_PROBE_VENDOR); + return (BUS_PROBE_DEFAULT); } return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 00:46:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8A551065672; Sat, 11 Feb 2012 00:46:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C70C78FC13; Sat, 11 Feb 2012 00:46: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 q1B0k6eM004843; Sat, 11 Feb 2012 00:46:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0k6XL004841; Sat, 11 Feb 2012 00:46:06 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110046.q1B0k6XL004841@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:46:06 +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: r231486 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:46:07 -0000 Author: tuexen Date: Sat Feb 11 00:46:06 2012 New Revision: 231486 URL: http://svn.freebsd.org/changeset/base/231486 Log: MFC r228102: Remove debug code. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Sat Feb 11 00:28:30 2012 (r231485) +++ stable/8/sys/netinet/sctp_pcb.c Sat Feb 11 00:46:06 2012 (r231486) @@ -6895,11 +6895,6 @@ skip_vtag_check: return (1); } - -static sctp_assoc_t reneged_asoc_ids[256]; -static uint8_t reneged_at = 0; - - static void sctp_drain_mbufs(struct sctp_inpcb *inp, struct sctp_tcb *stcb) { @@ -7004,8 +6999,6 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, /* sa_ignore NO_NULL_CHK */ sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_DRAIN, SCTP_SO_NOT_LOCKED); - reneged_asoc_ids[reneged_at] = sctp_get_associd(stcb); - reneged_at++; } /* * Another issue, in un-setting the TSN's in the mapping array we From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 00:48:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3770106566C; Sat, 11 Feb 2012 00:48:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7D0A8FC1A; Sat, 11 Feb 2012 00:48: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 q1B0mMKO004957; Sat, 11 Feb 2012 00:48:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0mMqM004954; Sat, 11 Feb 2012 00:48:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110048.q1B0mMqM004954@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231487 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:48:23 -0000 Author: tuexen Date: Sat Feb 11 00:48:22 2012 New Revision: 231487 URL: http://svn.freebsd.org/changeset/base/231487 Log: MFC r228391: Fix a bug reported by Irene Ruengeler which resulted in not sending out HEARTBEATs when requested by the user. The HEARTBEATs were only queued, but not actually sent out. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:46:06 2012 (r231486) +++ stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:48:22 2012 (r231487) @@ -391,6 +391,8 @@ __FBSDID("$FreeBSD$"); #define SCTP_OUTPUT_FROM_COOKIE_ACK 14 #define SCTP_OUTPUT_FROM_DRAIN 15 #define SCTP_OUTPUT_FROM_CLOSING 16 +#define SCTP_OUTPUT_FROM_SOCKOPT 17 + /* SCTP chunk types are moved sctp.h for application (NAT, FW) use */ /* align to 32-bit sizes */ Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Sat Feb 11 00:46:06 2012 (r231486) +++ stable/8/sys/netinet/sctp_usrreq.c Sat Feb 11 00:48:22 2012 (r231487) @@ -4695,6 +4695,7 @@ sctp_setopt(struct socket *so, int optna if (paddrp->spp_flags & SPP_HB_DEMAND) { /* on demand HB */ sctp_send_hb(stcb, net, SCTP_SO_LOCKED); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); } if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) { From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 00:49:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E25C7106564A; Sat, 11 Feb 2012 00:49:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D02988FC17; Sat, 11 Feb 2012 00:49:54 +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 q1B0nsgP005049; Sat, 11 Feb 2012 00:49:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0nsfw005046; Sat, 11 Feb 2012 00:49:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110049.q1B0nsfw005046@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:49:54 +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: r231488 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:49:55 -0000 Author: tuexen Date: Sat Feb 11 00:49:54 2012 New Revision: 231488 URL: http://svn.freebsd.org/changeset/base/231488 Log: MFC r228531: Fix a bug where sctp_sendmdg() uses uninitialized memory. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Sat Feb 11 00:48:22 2012 (r231487) +++ stable/8/lib/libc/net/sctp_sys_calls.c Sat Feb 11 00:49:54 2012 (r231488) @@ -560,6 +560,7 @@ sctp_sendmsg(int s, #ifdef SYS_sctp_generic_sendmsg struct sctp_sndrcvinfo sinfo; + memset(&sinfo, 0, sizeof(struct sctp_sndrcvinfo)); sinfo.sinfo_ppid = ppid; sinfo.sinfo_flags = flags; sinfo.sinfo_stream = stream_no; From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 00:51:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89D2A1065678; Sat, 11 Feb 2012 00:51:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 774CB8FC16; Sat, 11 Feb 2012 00:51: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 q1B0pQdu005150; Sat, 11 Feb 2012 00:51:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0pQnA005148; Sat, 11 Feb 2012 00:51:26 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110051.q1B0pQnA005148@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:51: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: r231489 - in stable/8/lib: . libc/net liblzma librtld_db libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:51:26 -0000 Author: tuexen Date: Sat Feb 11 00:51:26 2012 New Revision: 231489 URL: http://svn.freebsd.org/changeset/base/231489 Log: MFC r228630: Address warnings found by clang. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/Makefile (props changed) stable/8/lib/Makefile.inc (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libalias/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libauditd/ (props changed) stable/8/lib/libautofs/ (props changed) stable/8/lib/libbegemot/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libbsm/ (props changed) stable/8/lib/libbsnmp/ (props changed) stable/8/lib/libbz2/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcalendar/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcom_err/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libcrypt/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdevstat/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libdwarf/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libftpio/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libipsec/ (props changed) stable/8/lib/libipx/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkiconv/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/liblzma/Makefile (props changed) stable/8/lib/liblzma/Symbol.map (props changed) stable/8/lib/liblzma/Versions.def (props changed) stable/8/lib/liblzma/config.h (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmd/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libmilter/ (props changed) stable/8/lib/libmp/ (props changed) stable/8/lib/libncp/ (props changed) stable/8/lib/libnetgraph/ (props changed) stable/8/lib/libngatm/ (props changed) stable/8/lib/libopie/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpcap/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librpcsvc/ (props changed) stable/8/lib/librt/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/librtld_db/Makefile (props changed) stable/8/lib/librtld_db/librtld_db.3 (props changed) stable/8/lib/librtld_db/rtld_db.c (props changed) stable/8/lib/librtld_db/rtld_db.h (props changed) stable/8/lib/libsbuf/ (props changed) stable/8/lib/libsdp/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libsmb/ (props changed) stable/8/lib/libsmdb/ (props changed) stable/8/lib/libsmutil/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libtelnet/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libvgl/ (props changed) stable/8/lib/libwrap/ (props changed) stable/8/lib/liby/ (props changed) stable/8/lib/libypclnt/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/lib/ncurses/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Sat Feb 11 00:49:54 2012 (r231488) +++ stable/8/lib/libc/net/sctp_sys_calls.c Sat Feb 11 00:51:26 2012 (r231489) @@ -245,7 +245,8 @@ sctp_bindx(int sd, struct sockaddr *addr struct sockaddr *sa; struct sockaddr_in *sin; struct sockaddr_in6 *sin6; - int i, sz, argsz; + int i; + size_t argsz; uint16_t sport = 0; /* validate the flags */ @@ -269,7 +270,6 @@ sctp_bindx(int sd, struct sockaddr *addr /* First pre-screen the addresses */ sa = addrs; for (i = 0; i < addrcnt; i++) { - sz = sa->sa_len; if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) goto out_error; @@ -307,7 +307,7 @@ sctp_bindx(int sd, struct sockaddr *addr goto out_error; } - sa = (struct sockaddr *)((caddr_t)sa + sz); + sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } sa = addrs; /* @@ -319,7 +319,6 @@ sctp_bindx(int sd, struct sockaddr *addr sin->sin_port = sport; } for (i = 0; i < addrcnt; i++) { - sz = sa->sa_len; if (sa->sa_family == AF_INET) { if (sa->sa_len != sizeof(struct sockaddr_in)) goto out_error; @@ -335,13 +334,13 @@ sctp_bindx(int sd, struct sockaddr *addr } memset(gaddrs, 0, argsz); gaddrs->sget_assoc_id = 0; - memcpy(gaddrs->addr, sa, sz); + memcpy(gaddrs->addr, sa, sa->sa_len); if (setsockopt(sd, IPPROTO_SCTP, flags, gaddrs, (socklen_t) argsz) != 0) { free(gaddrs); return (-1); } - sa = (struct sockaddr *)((caddr_t)sa + sz); + sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } free(gaddrs); return (0); @@ -427,10 +426,9 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, { struct sctp_getaddresses *addrs; struct sockaddr *sa; - struct sockaddr *re; sctp_assoc_t asoc; caddr_t lim; - socklen_t siz; + socklen_t opt_len; int cnt; if (raddrs == NULL) { @@ -438,30 +436,28 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, return (-1); } asoc = id; - siz = sizeof(sctp_assoc_t); + opt_len = (socklen_t) sizeof(sctp_assoc_t); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_REMOTE_ADDR_SIZE, - &asoc, &siz) != 0) { + &asoc, &opt_len) != 0) { return (-1); } /* size required is returned in 'asoc' */ - siz = (size_t)asoc; - siz += sizeof(struct sctp_getaddresses); - addrs = calloc(1, siz); + opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); + addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { return (-1); } addrs->sget_assoc_id = id; /* Now lets get the array of addresses */ if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_PEER_ADDRESSES, - addrs, &siz) != 0) { + addrs, &opt_len) != 0) { free(addrs); return (-1); } - re = (struct sockaddr *)&addrs->addr[0]; - *raddrs = re; + *raddrs = (struct sockaddr *)&addrs->addr[0]; cnt = 0; sa = (struct sockaddr *)&addrs->addr[0]; - lim = (caddr_t)addrs + siz; + lim = (caddr_t)addrs + opt_len; while (((caddr_t)sa < lim) && (sa->sa_len > 0)) { sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); cnt++; @@ -484,11 +480,10 @@ int sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) { struct sctp_getaddresses *addrs; - struct sockaddr *re; caddr_t lim; struct sockaddr *sa; - int size_of_addresses; - socklen_t siz; + size_t size_of_addresses; + socklen_t opt_len; int cnt; if (raddrs == NULL) { @@ -496,9 +491,9 @@ sctp_getladdrs(int sd, sctp_assoc_t id, return (-1); } size_of_addresses = 0; - siz = sizeof(int); + opt_len = (socklen_t) sizeof(int); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDR_SIZE, - &size_of_addresses, &siz) != 0) { + &size_of_addresses, &opt_len) != 0) { errno = ENOMEM; return (-1); } @@ -506,9 +501,10 @@ sctp_getladdrs(int sd, sctp_assoc_t id, errno = ENOTCONN; return (-1); } - siz = size_of_addresses + sizeof(struct sockaddr_storage); - siz += sizeof(struct sctp_getaddresses); - addrs = calloc(1, siz); + opt_len = (socklen_t) (size_of_addresses + + sizeof(struct sockaddr_storage) + + sizeof(struct sctp_getaddresses)); + addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; return (-1); @@ -516,16 +512,15 @@ sctp_getladdrs(int sd, sctp_assoc_t id, addrs->sget_assoc_id = id; /* Now lets get the array of addresses */ if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs, - &siz) != 0) { + &opt_len) != 0) { free(addrs); errno = ENOMEM; return (-1); } - re = (struct sockaddr *)&addrs->addr[0]; - *raddrs = re; + *raddrs = (struct sockaddr *)&addrs->addr[0]; cnt = 0; sa = (struct sockaddr *)&addrs->addr[0]; - lim = (caddr_t)addrs + siz; + lim = (caddr_t)addrs + opt_len; while (((caddr_t)sa < lim) && (sa->sa_len > 0)) { sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); cnt++; @@ -732,7 +727,8 @@ sctp_sendx(int sd, const void *msg, size ssize_t ret; int i, cnt, *aa, saved_errno; char *buf; - int add_len, len, no_end_cx = 0; + int no_end_cx = 0; + size_t len, add_len; struct sockaddr *at; if (addrs == NULL) { @@ -782,7 +778,7 @@ sctp_sendx(int sd, const void *msg, size aa = (int *)buf; *aa = cnt; aa++; - memcpy((caddr_t)aa, addrs, (len - sizeof(int))); + memcpy((caddr_t)aa, addrs, (size_t)(len - sizeof(int))); ret = setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X_DELAYED, (void *)buf, (socklen_t) len); @@ -859,7 +855,6 @@ sctp_recvmsg(int s, #else struct sctp_sndrcvinfo *s_info; ssize_t sz; - int sinfo_found = 0; struct msghdr msg; struct iovec iov; char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; @@ -888,7 +883,6 @@ sctp_recvmsg(int s, return (sz); } s_info = NULL; - len = sz; if (sinfo) { sinfo->sinfo_assoc_id = 0; } @@ -909,7 +903,6 @@ sctp_recvmsg(int s, /* Copy it to the user */ if (sinfo) *sinfo = *s_info; - sinfo_found = 1; break; } else if (cmsg->cmsg_type == SCTP_EXTRCV) { /* @@ -922,7 +915,6 @@ sctp_recvmsg(int s, if (sinfo) { memcpy(sinfo, s_info, sizeof(struct sctp_extrcvinfo)); } - sinfo_found = 1; break; } @@ -1055,7 +1047,7 @@ sctp_sendv(int sd, cmsgbuf = malloc(CMSG_SPACE(sizeof(struct sctp_sndinfo)) + CMSG_SPACE(sizeof(struct sctp_prinfo)) + CMSG_SPACE(sizeof(struct sctp_authinfo)) + - addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); + (size_t)addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); if (cmsgbuf == NULL) { errno = ENOBUFS; return (-1); From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 00:54:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD035106566B; Sat, 11 Feb 2012 00:54:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A967A8FC13; Sat, 11 Feb 2012 00:54: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 q1B0sOSk005301; Sat, 11 Feb 2012 00:54:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0sODo005283; Sat, 11 Feb 2012 00:54:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110054.q1B0sODo005283@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:54:24 +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: r231490 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:54:24 -0000 Author: tuexen Date: Sat Feb 11 00:54:24 2012 New Revision: 231490 URL: http://svn.freebsd.org/changeset/base/231490 Log: MFC r228653: Fix unused parameter warnings. While there, fix some whitespace issues. Modified: stable/8/sys/netinet/sctp.h stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_asconf.h stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_auth.h stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_bsd_addr.h stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_crc32.h stable/8/sys/netinet/sctp_dtrace_declare.h stable/8/sys/netinet/sctp_dtrace_define.h stable/8/sys/netinet/sctp_header.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_input.h stable/8/sys/netinet/sctp_os.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_output.h stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_peeloff.c stable/8/sys/netinet/sctp_peeloff.h stable/8/sys/netinet/sctp_ss_functions.c stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_timer.h stable/8/sys/netinet/sctp_uio.h stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet/sctputil.h stable/8/sys/netinet6/sctp6_usrreq.c stable/8/sys/netinet6/sctp6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp.h ============================================================================== --- stable/8/sys/netinet/sctp.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp.h Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_asconf.c Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -1261,8 +1261,7 @@ sctp_path_check_and_react(struct sctp_tc * flag: 1=success, 0=failure. */ static void -sctp_asconf_addr_mgmt_ack(struct sctp_tcb *stcb, struct sctp_ifa *addr, - uint16_t type, uint32_t flag) +sctp_asconf_addr_mgmt_ack(struct sctp_tcb *stcb, struct sctp_ifa *addr, uint32_t flag) { /* * do the necessary asoc list work- if we get a failure indication, @@ -1712,7 +1711,7 @@ sctp_asconf_process_param_ack(struct sct case SCTP_ADD_IP_ADDRESS: SCTPDBG(SCTP_DEBUG_ASCONF1, "process_param_ack: added IP address\n"); - sctp_asconf_addr_mgmt_ack(stcb, aparam->ifa, param_type, flag); + sctp_asconf_addr_mgmt_ack(stcb, aparam->ifa, flag); break; case SCTP_DEL_IP_ADDRESS: SCTPDBG(SCTP_DEBUG_ASCONF1, @@ -2102,7 +2101,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * int -sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val) +sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; @@ -2150,7 +2149,7 @@ sctp_asconf_iterator_ep(struct sctp_inpc } static int -sctp_asconf_iterator_ep_end(struct sctp_inpcb *inp, void *ptr, uint32_t val) +sctp_asconf_iterator_ep_end(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_ifa *ifa; struct sctp_asconf_iterator *asc; @@ -2182,7 +2181,7 @@ sctp_asconf_iterator_ep_end(struct sctp_ void sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - void *ptr, uint32_t val) + void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; @@ -2350,7 +2349,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } void -sctp_asconf_iterator_end(void *ptr, uint32_t val) +sctp_asconf_iterator_end(void *ptr, uint32_t val SCTP_UNUSED) { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; @@ -3009,8 +3008,7 @@ next_addr: * 1 if found, 0 if not */ static uint32_t -sctp_addr_in_initack(struct sctp_tcb *stcb, struct mbuf *m, uint32_t offset, - uint32_t length, struct sockaddr *sa) +sctp_addr_in_initack(struct mbuf *m, uint32_t offset, uint32_t length, struct sockaddr *sa) { struct sctp_paramhdr tmp_param, *ph; uint16_t plen, ptype; @@ -3155,8 +3153,7 @@ sctp_check_address_list_ep(struct sctp_t continue; } /* check to see if in the init-ack */ - if (!sctp_addr_in_initack(stcb, m, offset, length, - &laddr->ifa->address.sa)) { + if (!sctp_addr_in_initack(m, offset, length, &laddr->ifa->address.sa)) { /* try to add it */ sctp_addr_mgmt_assoc(stcb->sctp_ep, stcb, laddr->ifa, SCTP_ADD_IP_ADDRESS, SCTP_ADDR_NOT_LOCKED); @@ -3179,6 +3176,15 @@ sctp_check_address_list_all(struct sctp_ struct sctp_ifa *sctp_ifa; uint32_t vrf_id; +#ifdef INET + struct sockaddr_in *sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 *sin6; + +#endif + if (stcb) { vrf_id = stcb->asoc.vrf_id; } else { @@ -3202,9 +3208,35 @@ sctp_check_address_list_all(struct sctp_ if (sctp_cmpaddr(&sctp_ifa->address.sa, init_addr)) { continue; } + switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + sin = (struct sockaddr_in *)&sctp_ifa->address.sin; + if ((ipv4_scope == 0) && + (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) { + /* private address not in scope */ + continue; + } + break; +#endif +#ifdef INET6 + case AF_INET6: + sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sin6; + if ((local_scope == 0) && + (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))) { + continue; + } + if ((site_scope == 0) && + (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { + continue; + } + break; +#endif + default: + break; + } /* check to see if in the init-ack */ - if (!sctp_addr_in_initack(stcb, m, offset, length, - &sctp_ifa->address.sa)) { + if (!sctp_addr_in_initack(m, offset, length, &sctp_ifa->address.sa)) { /* try to add it */ sctp_addr_mgmt_assoc(stcb->sctp_ep, stcb, sctp_ifa, SCTP_ADD_IP_ADDRESS, Modified: stable/8/sys/netinet/sctp_asconf.h ============================================================================== --- stable/8/sys/netinet/sctp_asconf.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_asconf.h Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_auth.c Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -1891,7 +1891,7 @@ sctp_notify_authentication(struct sctp_t /* append to socket */ control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, - 0, 0, 0, 0, 0, 0, m_notify); + 0, 0, stcb->asoc.context, 0, 0, 0, m_notify); if (control == NULL) { /* no memory */ sctp_m_freem(m_notify); Modified: stable/8/sys/netinet/sctp_auth.h ============================================================================== --- stable/8/sys/netinet/sctp_auth.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_auth.h Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_bsd_addr.c Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -83,11 +83,11 @@ sctp_wakeup_iterator(void) } static void -sctp_iterator_thread(void *v) +sctp_iterator_thread(void *v SCTP_UNUSED) { SCTP_IPI_ITERATOR_WQ_LOCK(); /* In FreeBSD this thread never terminates. */ - while (1) { + for (;;) { msleep(&sctp_it_ctl.iterator_running, &sctp_it_ctl.ipi_iterator_wq_mtx, 0, "waiting_for_work", 0); Modified: stable/8/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_bsd_addr.h Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_cc_functions.c Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -508,8 +508,7 @@ out_decision: } static int -cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, - uint64_t vtag, uint8_t inst_ind) +cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t vtag) { uint64_t oth, probepoint; @@ -643,7 +642,7 @@ cc_bw_limit(struct sctp_tcb *stcb, struc } bw_offset = net->cc_mod.rtcc.lbw >> bw_shift; if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { - ret = cc_bw_increase(stcb, net, nbw, vtag, inst_ind); + ret = cc_bw_increase(stcb, net, nbw, vtag); goto out; } rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); @@ -664,7 +663,7 @@ out: static void sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit, int use_rtcc) + int accum_moved, int reneged_all SCTP_UNUSED, int will_exit, int use_rtcc) { struct sctp_nets *net; int old_cwnd; @@ -1301,7 +1300,7 @@ sctp_cwnd_update_rtcc_tsn_acknowledged(s } static void -sctp_cwnd_prepare_rtcc_net_for_sack(struct sctp_tcb *stcb, +sctp_cwnd_prepare_rtcc_net_for_sack(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net) { if (net->cc_mod.rtcc.tls_needs_set > 0) { @@ -1473,7 +1472,7 @@ sctp_cwnd_rtcc_socket_option(struct sctp } static void -sctp_cwnd_update_rtcc_packet_transmitted(struct sctp_tcb *stcb, +sctp_cwnd_update_rtcc_packet_transmitted(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net) { if (net->cc_mod.rtcc.tls_needs_set == 0) { @@ -1492,8 +1491,9 @@ sctp_cwnd_update_rtcc_after_sack(struct } static void -sctp_rtt_rtcc_calculated(struct sctp_tcb *stcb, - struct sctp_nets *net, struct timeval *now) +sctp_rtt_rtcc_calculated(struct sctp_tcb *stcb SCTP_UNUSED, + struct sctp_nets *net, + struct timeval *now SCTP_UNUSED) { net->cc_mod.rtcc.rtt_set_this_sack = 1; } @@ -1731,7 +1731,7 @@ sctp_hs_cwnd_update_after_fr(struct sctp static void sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit) + int accum_moved, int reneged_all SCTP_UNUSED, int will_exit) { struct sctp_nets *net; @@ -1879,7 +1879,7 @@ htcp_cwnd_undo(struct sctp_tcb *stcb, st #endif static inline void -measure_rtt(struct sctp_tcb *stcb, struct sctp_nets *net) +measure_rtt(struct sctp_nets *net) { uint32_t srtt = net->lastsa >> SCTP_RTT_SHIFT; @@ -1897,7 +1897,7 @@ measure_rtt(struct sctp_tcb *stcb, struc } static void -measure_achieved_throughput(struct sctp_tcb *stcb, struct sctp_nets *net) +measure_achieved_throughput(struct sctp_nets *net) { uint32_t now = sctp_get_tick_count(); @@ -1997,7 +1997,7 @@ htcp_alpha_update(struct htcp *ca) * were getting just too full now). */ static void -htcp_param_update(struct sctp_tcb *stcb, struct sctp_nets *net) +htcp_param_update(struct sctp_nets *net) { uint32_t minRTT = net->cc_mod.htcp_ca.minRTT; uint32_t maxRTT = net->cc_mod.htcp_ca.maxRTT; @@ -2014,9 +2014,9 @@ htcp_param_update(struct sctp_tcb *stcb, } static uint32_t -htcp_recalc_ssthresh(struct sctp_tcb *stcb, struct sctp_nets *net) +htcp_recalc_ssthresh(struct sctp_nets *net) { - htcp_param_update(stcb, net); + htcp_param_update(net); return max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu); } @@ -2051,7 +2051,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s } } } else { - measure_rtt(stcb, net); + measure_rtt(net); /* * In dangerous area, increase slowly. In theory this is @@ -2093,7 +2093,7 @@ htcp_min_cwnd(struct sctp_tcb *stcb, str #endif static void -htcp_init(struct sctp_tcb *stcb, struct sctp_nets *net) +htcp_init(struct sctp_nets *net) { memset(&net->cc_mod.htcp_ca, 0, sizeof(struct htcp)); net->cc_mod.htcp_ca.alpha = ALPHA_BASE; @@ -2111,7 +2111,7 @@ sctp_htcp_set_initial_cc_param(struct sc */ net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); net->ssthresh = stcb->asoc.peers_rwnd; - htcp_init(stcb, net); + htcp_init(net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { sctp_log_cwnd(stcb, net, 0, SCTP_CWND_INITIALIZATION); @@ -2121,7 +2121,7 @@ sctp_htcp_set_initial_cc_param(struct sc static void sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit) + int accum_moved, int reneged_all SCTP_UNUSED, int will_exit) { struct sctp_nets *net; @@ -2176,7 +2176,7 @@ sctp_htcp_cwnd_update_after_sack(struct if (accum_moved || ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { htcp_cong_avoid(stcb, net); - measure_achieved_throughput(stcb, net); + measure_achieved_throughput(net); } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, @@ -2212,7 +2212,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc /* JRS - reset as if state were changed */ htcp_reset(&net->cc_mod.htcp_ca); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); + net->ssthresh = htcp_recalc_ssthresh(net); net->cwnd = net->ssthresh; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), @@ -2266,7 +2266,7 @@ sctp_htcp_cwnd_update_after_timeout(stru /* JRS - reset as if the state were being changed to timeout */ htcp_reset(&net->cc_mod.htcp_ca); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); + net->ssthresh = htcp_recalc_ssthresh(net); net->cwnd = net->mtu; net->partial_bytes_acked = 0; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { @@ -2276,7 +2276,7 @@ sctp_htcp_cwnd_update_after_timeout(stru static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, - struct sctp_nets *net, int in_window, int num_pkt_lost) + struct sctp_nets *net, int in_window, int num_pkt_lost SCTP_UNUSED) { int old_cwnd; @@ -2286,7 +2286,7 @@ sctp_htcp_cwnd_update_after_ecn_echo(str if (in_window == 0) { htcp_reset(&net->cc_mod.htcp_ca); SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = htcp_recalc_ssthresh(stcb, net); + net->ssthresh = htcp_recalc_ssthresh(net); if (net->ssthresh < net->mtu) { net->ssthresh = net->mtu; /* here back off the timer as well, to slow us down */ Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -1017,20 +1017,9 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) - -#define SCTP_GETTIME_TIMESPEC(x) (getnanouptime(x)) -#define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) -#define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) +#define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) +#define SCTP_GETPTIME_TIMEVAL(x) (microuptime(x)) #endif -/*#if defined(__FreeBSD__) || defined(__APPLE__)*/ -/*#define SCTP_GETTIME_TIMEVAL(x) { \*/ -/* (x)->tv_sec = ticks / 1000; \*/ -/* (x)->tv_usec = (ticks % 1000) * 1000; \*/ -/*}*/ - -/*#else*/ -/*#define SCTP_GETTIME_TIMEVAL(x) (microtime(x))*/ -/*#endif __FreeBSD__ */ #if defined(_KERNEL) || defined(__Userspace__) #define sctp_sowwakeup(inp, so) \ Modified: stable/8/sys/netinet/sctp_crc32.h ============================================================================== --- stable/8/sys/netinet/sctp_crc32.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_crc32.h Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/8/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_declare.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_dtrace_declare.h Sat Feb 11 00:54:24 2012 (r231490) @@ -6,11 +6,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/8/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/8/sys/netinet/sctp_dtrace_define.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_dtrace_define.h Sat Feb 11 00:54:24 2012 (r231490) @@ -6,11 +6,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/8/sys/netinet/sctp_header.h ============================================================================== --- stable/8/sys/netinet/sctp_header.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_header.h Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_indata.c Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -137,7 +137,7 @@ sctp_build_readq_entry(struct sctp_tcb * read_queue_e->sinfo_ssn = stream_seq; read_queue_e->sinfo_flags = (flags << 8); read_queue_e->sinfo_ppid = ppid; - read_queue_e->sinfo_context = stcb->asoc.context; + read_queue_e->sinfo_context = context; read_queue_e->sinfo_timetolive = 0; read_queue_e->sinfo_tsn = tsn; read_queue_e->sinfo_cumtsn = tsn; @@ -846,7 +846,6 @@ sctp_queue_data_for_reasm(struct sctp_tc { struct mbuf *oper; uint32_t cum_ackp1, last_tsn, prev_tsn, post_tsn; - u_char last_flags; struct sctp_tmit_chunk *at, *prev, *next; prev = next = NULL; @@ -1033,7 +1032,6 @@ sctp_queue_data_for_reasm(struct sctp_tc sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } else { - last_flags = at->rec.data.rcv_flags; last_tsn = at->rec.data.TSN_seq; prev = at; if (TAILQ_NEXT(at, sctp_next) == NULL) { @@ -1455,7 +1453,7 @@ sctp_process_a_data_chunk(struct sctp_tc struct sctp_tmit_chunk *chk; uint32_t tsn, gap; struct mbuf *dmbuf; - int indx, the_len; + int the_len; int need_reasm_check = 0; uint16_t strmno, strmseq; struct mbuf *oper; @@ -1587,7 +1585,6 @@ sctp_process_a_data_chunk(struct sctp_tc } else { SCTP_STAT_INCR(sctps_datadroprwnd); } - indx = *break_flag; *break_flag = 1; return (0); } @@ -2259,7 +2256,6 @@ sctp_slide_mapping_arrays(struct sctp_tc uint32_t old_cumack, old_base, old_highest, highest_tsn; asoc = &stcb->asoc; - at = 0; old_cumack = asoc->cumulative_tsn; old_base = asoc->mapping_array_base_tsn; @@ -2408,7 +2404,7 @@ sctp_slide_mapping_arrays(struct sctp_tc } void -sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap, int *abort_flag) +sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) { struct sctp_association *asoc; uint32_t highest_tsn; @@ -2824,10 +2820,7 @@ sctp_process_data(struct mbuf **mm, int stcb->asoc.send_sack = 1; } /* Start a sack timer or QUEUE a SACK for sending */ - sctp_sack_check(stcb, was_a_gap, &abort_flag); - if (abort_flag) - return (2); - + sctp_sack_check(stcb, was_a_gap); return (0); } @@ -2837,7 +2830,7 @@ sctp_process_segment_range(struct sctp_t int *num_frs, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int *ecn_seg_sums, int *rto_ok) + int *rto_ok) { struct sctp_tmit_chunk *tp1; unsigned int theTSN; @@ -3059,8 +3052,7 @@ static int sctp_handle_segments(struct mbuf *m, int *offset, struct sctp_tcb *stcb, struct sctp_association *asoc, uint32_t last_tsn, uint32_t * biggest_tsn_acked, uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack, - int num_seg, int num_nr_seg, int *ecn_seg_sums, - int *rto_ok) + int num_seg, int num_nr_seg, int *rto_ok) { struct sctp_gap_ack_block *frag, block; struct sctp_tmit_chunk *tp1; @@ -3106,7 +3098,7 @@ sctp_handle_segments(struct mbuf *m, int } if (sctp_process_segment_range(stcb, &tp1, last_tsn, frag_strt, frag_end, non_revocable, &num_frs, biggest_newly_acked_tsn, - this_sack_lowest_newack, ecn_seg_sums, rto_ok)) { + this_sack_lowest_newack, rto_ok)) { chunk_freed = 1; } prev_frag_end = frag_end; @@ -3761,7 +3753,6 @@ sctp_fs_audit(struct sctp_association *a static void sctp_window_probe_recovery(struct sctp_tcb *stcb, struct sctp_association *asoc, - struct sctp_nets *net, struct sctp_tmit_chunk *tp1) { tp1->window_probe = 0; @@ -4029,7 +4020,7 @@ sctp_express_handle_sack(struct sctp_tcb SOCKBUF_LOCK(&stcb->sctp_socket->so_snd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { /* sa_ignore NO_NULL_CHK */ - sctp_wakeup_log(stcb, cumack, 1, SCTP_WAKESND_FROM_SACK); + sctp_wakeup_log(stcb, 1, SCTP_WAKESND_FROM_SACK); } #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); @@ -4050,7 +4041,7 @@ sctp_express_handle_sack(struct sctp_tcb #endif } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { - sctp_wakeup_log(stcb, cumack, 1, SCTP_NOWAKE_FROM_SACK); + sctp_wakeup_log(stcb, 1, SCTP_NOWAKE_FROM_SACK); } } @@ -4136,7 +4127,7 @@ again: TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (tp1->window_probe) { /* move back to data send queue */ - sctp_window_probe_recovery(stcb, asoc, net, tp1); + sctp_window_probe_recovery(stcb, asoc, tp1); break; } } @@ -4344,7 +4335,7 @@ again: void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, - struct sctp_tcb *stcb, struct sctp_nets *net_from, + struct sctp_tcb *stcb, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, uint32_t cum_ack, uint32_t rwnd, int ecne_seen) @@ -4352,7 +4343,6 @@ sctp_handle_sack(struct mbuf *m, int off struct sctp_association *asoc; struct sctp_tmit_chunk *tp1, *tp2; uint32_t last_tsn, biggest_tsn_acked, biggest_tsn_newly_acked, this_sack_lowest_newack; - uint32_t sav_cum_ack; uint16_t wake_him = 0; uint32_t send_s = 0; long j; @@ -4362,7 +4352,6 @@ sctp_handle_sack(struct mbuf *m, int off int win_probe_recovery = 0; int win_probe_recovered = 0; struct sctp_nets *net = NULL; - int ecn_seg_sums = 0; int done_once; int rto_ok = 1; uint8_t reneged_all = 0; @@ -4392,7 +4381,6 @@ sctp_handle_sack(struct mbuf *m, int off SCTP_TCB_LOCK_ASSERT(stcb); /* CMT DAC algo */ this_sack_lowest_newack = 0; - j = 0; SCTP_STAT_INCR(sctps_slowpath_sack); last_tsn = cum_ack; cmt_dac_flag = flags & SCTP_SACK_CMT_DAC; @@ -4492,8 +4480,6 @@ sctp_handle_sack(struct mbuf *m, int off /* acking something behind */ return; } - sav_cum_ack = asoc->last_acked_seq; - /* update the Rwnd of the peer */ if (TAILQ_EMPTY(&asoc->sent_queue) && TAILQ_EMPTY(&asoc->send_queue) && @@ -4690,8 +4676,7 @@ sctp_handle_sack(struct mbuf *m, int off */ if (sctp_handle_segments(m, &offset_seg, stcb, asoc, last_tsn, &biggest_tsn_acked, &biggest_tsn_newly_acked, &this_sack_lowest_newack, - num_seg, num_nr_seg, &ecn_seg_sums, - &rto_ok)) { + num_seg, num_nr_seg, &rto_ok)) { wake_him++; } if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { @@ -4788,7 +4773,7 @@ sctp_handle_sack(struct mbuf *m, int off #endif SOCKBUF_LOCK(&stcb->sctp_socket->so_snd); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { - sctp_wakeup_log(stcb, cum_ack, wake_him, SCTP_WAKESND_FROM_SACK); + sctp_wakeup_log(stcb, wake_him, SCTP_WAKESND_FROM_SACK); } #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); @@ -4809,7 +4794,7 @@ sctp_handle_sack(struct mbuf *m, int off #endif } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { - sctp_wakeup_log(stcb, cum_ack, wake_him, SCTP_NOWAKE_FROM_SACK); + sctp_wakeup_log(stcb, wake_him, SCTP_NOWAKE_FROM_SACK); } } @@ -5112,7 +5097,7 @@ again: */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (tp1->window_probe) { - sctp_window_probe_recovery(stcb, asoc, net, tp1); + sctp_window_probe_recovery(stcb, asoc, tp1); break; } } @@ -5222,8 +5207,7 @@ again: } void -sctp_update_acked(struct sctp_tcb *stcb, struct sctp_shutdown_chunk *cp, - struct sctp_nets *netp, int *abort_flag) +sctp_update_acked(struct sctp_tcb *stcb, struct sctp_shutdown_chunk *cp, int *abort_flag) { /* Copy cum-ack */ uint32_t cum_ack, a_rwnd; @@ -5389,13 +5373,12 @@ sctp_handle_forward_tsn(struct sctp_tcb */ struct sctp_association *asoc; uint32_t new_cum_tsn, gap; - unsigned int i, fwd_sz, cumack_set_flag, m_size; + unsigned int i, fwd_sz, m_size; uint32_t str_seq; struct sctp_stream_in *strm; struct sctp_tmit_chunk *chk, *nchk; struct sctp_queued_to_read *ctl, *sv; - cumack_set_flag = 0; asoc = &stcb->asoc; if ((fwd_sz = ntohs(fwd->ch.chunk_length)) < sizeof(struct sctp_forward_tsn_chunk)) { SCTPDBG(SCTP_DEBUG_INDATA1, Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_indata.h Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -94,7 +94,7 @@ sctp_express_handle_sack(struct sctp_tcb void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, - struct sctp_tcb *stcb, struct sctp_nets *net_from, + struct sctp_tcb *stcb, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, uint32_t cum_ack, uint32_t rwnd, int ecne_seen); @@ -110,8 +110,7 @@ struct sctp_tmit_chunk * void sctp_service_queues(struct sctp_tcb *, struct sctp_association *); void -sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, - struct sctp_nets *, int *); + sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, int *); int sctp_process_data(struct mbuf **, int, int *, int, struct sctphdr *, @@ -120,7 +119,7 @@ sctp_process_data(struct mbuf **, int, i void sctp_slide_mapping_arrays(struct sctp_tcb *stcb); -void sctp_sack_check(struct sctp_tcb *, int, int *); +void sctp_sack_check(struct sctp_tcb *, int); #endif #endif Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:51:26 2012 (r231489) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:54:24 2012 (r231490) @@ -7,11 +7,11 @@ * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. + * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived @@ -84,7 +84,7 @@ sctp_stop_all_cookie_timers(struct sctp_ static void sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net, int *abort_no_unlock, uint32_t vrf_id, uint16_t port) + int *abort_no_unlock, uint32_t vrf_id, uint16_t port) { struct sctp_init *init; struct mbuf *op_err; @@ -258,8 +258,7 @@ sctp_is_there_unsent_data(struct sctp_tc } static int -sctp_process_init(struct sctp_init_chunk *cp, struct sctp_tcb *stcb, - struct sctp_nets *net) +sctp_process_init(struct sctp_init_chunk *cp, struct sctp_tcb *stcb) { struct sctp_init *init; struct sctp_association *asoc; @@ -433,13 +432,13 @@ sctp_process_init_ack(struct mbuf *m, in asoc = &stcb->asoc; asoc->peer_supports_nat = (uint8_t) nat_friendly; /* process the peer's parameters in the INIT-ACK */ - retval = sctp_process_init((struct sctp_init_chunk *)cp, stcb, net); + retval = sctp_process_init((struct sctp_init_chunk *)cp, stcb); if (retval < 0) { return (retval); } initack_limit = offset + ntohs(cp->ch.chunk_length); /* load all addresses */ - if ((retval = sctp_load_addresses_from_init(stcb, m, iphlen, + if ((retval = sctp_load_addresses_from_init(stcb, m, (offset + sizeof(struct sctp_init_chunk)), initack_limit, sh, NULL))) { /* Huh, we should abort */ @@ -521,7 +520,7 @@ sctp_process_init_ack(struct mbuf *m, in mp->resv = 0; } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - sh, op_err, 0, net->port); + sh, op_err, vrf_id, net->port); *abort_no_unlock = 1; } return (retval); @@ -871,7 +870,7 @@ sctp_handle_shutdown(struct sctp_shutdow /* Shutdown NOT the expected size */ return; } else { - sctp_update_acked(stcb, cp, net, abort_flag); + sctp_update_acked(stcb, cp, abort_flag); if (*abort_flag) { return; } @@ -953,7 +952,7 @@ sctp_handle_shutdown(struct sctp_shutdow } static void -sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp, +sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -1410,7 +1409,7 @@ static struct sctp_tcb * sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, - struct sockaddr *init_src, int *notification, sctp_assoc_t * sac_assoc_id, + struct sockaddr *init_src, int *notification, uint32_t vrf_id, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, uint16_t port) { struct sctp_association *asoc; @@ -1526,7 +1525,7 @@ sctp_process_cookie_existing(struct mbuf * the right seq no's. */ /* First we must process the INIT !! */ - retval = sctp_process_init(init_cp, stcb, net); + retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 3; @@ -1613,7 +1612,7 @@ sctp_process_cookie_existing(struct mbuf * somehow abort.. but we do have an existing asoc. This * really should not fail. */ - if (sctp_load_addresses_from_init(stcb, m, iphlen, + if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) @@ -1749,13 +1748,13 @@ sctp_process_cookie_existing(struct mbuf } /* process the INIT info (peer's info) */ - retval = sctp_process_init(init_cp, stcb, net); + retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 9; return (NULL); } - if (sctp_load_addresses_from_init(stcb, m, iphlen, + if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) @@ -1852,7 +1851,6 @@ sctp_process_cookie_existing(struct mbuf sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_15); sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); - *sac_assoc_id = sctp_get_associd(stcb); /* notify upper layer */ *notification = SCTP_NOTIFY_ASSOC_RESTART; atomic_add_int(&stcb->asoc.refcnt, 1); @@ -1928,7 +1926,7 @@ sctp_process_cookie_existing(struct mbuf SCTP_INP_WUNLOCK(stcb->sctp_ep); SCTP_INP_INFO_WUNLOCK(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 00:54:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55067106567A; Sat, 11 Feb 2012 00:54:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43DEC8FC1E; Sat, 11 Feb 2012 00:54: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 q1B0sv4N005360; Sat, 11 Feb 2012 00:54:57 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0sv4G005356; Sat, 11 Feb 2012 00:54:57 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202110054.q1B0sv4G005356@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 11 Feb 2012 00:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231491 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:54:58 -0000 Author: gonzo Date: Sat Feb 11 00:54:57 2012 New Revision: 231491 URL: http://svn.freebsd.org/changeset/base/231491 Log: Add handlers for TLS-related relocation entries Modified: head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/mips/rtld_machdep.h Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Sat Feb 11 00:54:24 2012 (r231490) +++ head/libexec/rtld-elf/mips/reloc.c Sat Feb 11 00:54:57 2012 (r231491) @@ -446,6 +446,89 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry break; } +#ifdef __mips_n64 + case R_TYPE(TLS_DTPMOD64): +#else + case R_TYPE(TLS_DTPMOD32): +#endif + { + + const size_t rlen = sizeof(Elf_Addr); + Elf_Addr old = load_ptr(where, rlen); + Elf_Addr val = old; + + def = find_symdef(r_symndx, obj, &defobj, false, NULL, + lockstate); + if (def == NULL) + return -1; + + val += (Elf_Addr)defobj->tlsindex; + + store_ptr(where, val, rlen); + dbg("DTPMOD %s in %s %p --> %p in %s", + obj->strtab + obj->symtab[r_symndx].st_name, + obj->path, (void *)old, (void*)val, defobj->path); + break; + } + +#ifdef __mips_n64 + case R_TYPE(TLS_DTPREL64): +#else + case R_TYPE(TLS_DTPREL32): +#endif + { + const size_t rlen = sizeof(Elf_Addr); + Elf_Addr old = load_ptr(where, rlen); + Elf_Addr val = old; + + def = find_symdef(r_symndx, obj, &defobj, false, NULL, + lockstate); + if (def == NULL) + return -1; + + if (!defobj->tls_done && allocate_tls_offset(obj)) + return -1; + + val += (Elf_Addr)def->st_value - TLS_DTP_OFFSET; + store_ptr(where, val, rlen); + + dbg("DTPREL %s in %s %p --> %p in %s", + obj->strtab + obj->symtab[r_symndx].st_name, + obj->path, (void*)old, (void *)val, defobj->path); + break; + } + +#ifdef __mips_n64 + case R_TYPE(TLS_TPREL64): +#else + case R_TYPE(TLS_TPREL32): +#endif + { + const size_t rlen = sizeof(Elf_Addr); + Elf_Addr old = load_ptr(where, rlen); + Elf_Addr val = old; + + def = find_symdef(r_symndx, obj, &defobj, false, NULL, + lockstate); + + if (def == NULL) + return -1; + + if (!defobj->tls_done && allocate_tls_offset(obj)) + return -1; + + val += (Elf_Addr)(def->st_value + defobj->tlsoffset + - TLS_TP_OFFSET - TLS_TCB_SIZE); + store_ptr(where, val, rlen); + + dbg("TPREL %s in %s %p --> %p in %s", + obj->strtab + obj->symtab[r_symndx].st_name, + obj->path, (void*)old, (void *)val, defobj->path); + break; + } + + + default: dbg("sym = %lu, type = %lu, offset = %p, " "contents = %p, symbol = %s", @@ -554,7 +637,7 @@ __tls_get_addr(tls_index* ti) sysarch(MIPS_GET_TLS, &tls); p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)tls - TLS_TP_OFFSET - - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset); + - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset + TLS_DTP_OFFSET); - return (p + TLS_DTV_OFFSET); + return (p); } Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Sat Feb 11 00:54:24 2012 (r231490) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Sat Feb 11 00:54:57 2012 (r231491) @@ -53,7 +53,8 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, */ #define TLS_TP_OFFSET 0x7000 -#define TLS_DTV_OFFSET 0x8000 +#define TLS_DTP_OFFSET 0x8000 + #ifdef __mips_n64 #define TLS_TCB_SIZE 16 #else From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 00:57:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF9BB106566C; Sat, 11 Feb 2012 00:57:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CAA18FC0A; Sat, 11 Feb 2012 00:57:08 +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 q1B0v8vO005487; Sat, 11 Feb 2012 00:57:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0v8rE005478; Sat, 11 Feb 2012 00:57:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110057.q1B0v8rE005478@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:57:08 +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: r231492 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:57:08 -0000 Author: tuexen Date: Sat Feb 11 00:57:08 2012 New Revision: 231492 URL: http://svn.freebsd.org/changeset/base/231492 Log: MFC r228907: Address issues found by clang. While there, fix also some style issues. Modified: stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_auth.c stable/8/sys/netinet/sctp_cc_functions.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_ss_functions.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctp_var.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_asconf.c Sat Feb 11 00:57:08 2012 (r231492) @@ -138,7 +138,7 @@ sctp_asconf_success_response(uint32_t id if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_success_response: couldn't get mbuf!\n"); - return NULL; + return (NULL); } aph = mtod(m_reply, struct sctp_asconf_paramhdr *); aph->correlation_id = id; @@ -147,7 +147,7 @@ sctp_asconf_success_response(uint32_t id SCTP_BUF_LEN(m_reply) = aph->ph.param_length; aph->ph.param_length = htons(aph->ph.param_length); - return m_reply; + return (m_reply); } static struct mbuf * @@ -166,7 +166,7 @@ sctp_asconf_error_response(uint32_t id, if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_error_response: couldn't get mbuf!\n"); - return NULL; + return (NULL); } aph = mtod(m_reply, struct sctp_asconf_paramhdr *); error = (struct sctp_error_cause *)(aph + 1); @@ -183,7 +183,7 @@ sctp_asconf_error_response(uint32_t id, "asconf_error_response: tlv_length (%xh) too big\n", tlv_length); sctp_m_freem(m_reply); /* discard */ - return NULL; + return (NULL); } if (error_tlv != NULL) { tlv = (uint8_t *) (error + 1); @@ -193,7 +193,7 @@ sctp_asconf_error_response(uint32_t id, error->length = htons(error->length); aph->ph.param_length = htons(aph->ph.param_length); - return m_reply; + return (m_reply); } static struct mbuf * @@ -231,7 +231,7 @@ sctp_process_asconf_add_ip(struct mbuf * case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; @@ -254,7 +254,7 @@ sctp_process_asconf_add_ip(struct mbuf * case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; @@ -277,7 +277,7 @@ sctp_process_asconf_add_ip(struct mbuf * m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* end switch */ /* if 0.0.0.0/::0, add the source address instead */ @@ -314,7 +314,7 @@ sctp_process_asconf_add_ip(struct mbuf * sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); } } - return m_reply; + return (m_reply); } static int @@ -326,7 +326,7 @@ sctp_asconf_del_remote_addrs_except(stru src_net = sctp_findnet(stcb, src); if (src_net == NULL) { /* not found */ - return -1; + return (-1); } /* delete all destination addresses except the source */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -342,7 +342,7 @@ sctp_asconf_del_remote_addrs_except(stru (struct sockaddr *)&net->ro._l_addr, SCTP_SO_NOT_LOCKED); } } - return 0; + return (0); } static struct mbuf * @@ -382,7 +382,7 @@ sctp_process_asconf_delete_ip(struct mbu case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; @@ -402,7 +402,7 @@ sctp_process_asconf_delete_ip(struct mbu case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; @@ -423,7 +423,7 @@ sctp_process_asconf_delete_ip(struct mbu m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* make sure the source address is not being deleted */ @@ -433,7 +433,7 @@ sctp_process_asconf_delete_ip(struct mbu m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_DELETING_SRC_ADDR, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* if deleting 0.0.0.0/::0, delete all addresses except src addr */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { @@ -452,7 +452,7 @@ sctp_process_asconf_delete_ip(struct mbu m_reply = sctp_asconf_success_response(aph->correlation_id); } - return m_reply; + return (m_reply); } /* delete the address */ result = sctp_del_remote_addr(stcb, sa); @@ -474,7 +474,7 @@ sctp_process_asconf_delete_ip(struct mbu /* notify upper layer */ sctp_ulp_notify(SCTP_NOTIFY_ASCONF_DELETE_IP, stcb, 0, sa, SCTP_SO_NOT_LOCKED); } - return m_reply; + return (m_reply); } static struct mbuf * @@ -511,7 +511,7 @@ sctp_process_asconf_set_primary(struct m case SCTP_IPV4_ADDRESS: if (param_length != sizeof(struct sctp_ipv4addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v4addr = (struct sctp_ipv4addr_param *)ph; sin = (struct sockaddr_in *)&sa_store; @@ -529,7 +529,7 @@ sctp_process_asconf_set_primary(struct m case SCTP_IPV6_ADDRESS: if (param_length != sizeof(struct sctp_ipv6addr_param)) { /* invalid param size */ - return NULL; + return (NULL); } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = (struct sockaddr_in6 *)&sa_store; @@ -548,7 +548,7 @@ sctp_process_asconf_set_primary(struct m m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph, aparam_length); - return m_reply; + return (m_reply); } /* if 0.0.0.0/::0, use the source address instead */ @@ -620,7 +620,7 @@ sctp_process_asconf_set_primary(struct m aparam_length); } - return m_reply; + return (m_reply); } /* @@ -2530,9 +2530,9 @@ sctp_is_addr_pending(struct sctp_tcb *st */ if (add_cnt > del_cnt || (add_cnt == del_cnt && last_param_type == SCTP_ADD_IP_ADDRESS)) { - return 1; + return (1); } - return 0; + return (0); } static struct sockaddr * Modified: stable/8/sys/netinet/sctp_auth.c ============================================================================== --- stable/8/sys/netinet/sctp_auth.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_auth.c Sat Feb 11 00:57:08 2012 (r231492) @@ -469,7 +469,6 @@ sctp_compute_hashkey(sctp_key_t * key1, } if (sctp_get_keylen(key2)) { bcopy(key2->key, key_ptr, key2->keylen); - key_ptr += key2->keylen; } } else { /* key is shared + key2 + key1 */ @@ -483,7 +482,6 @@ sctp_compute_hashkey(sctp_key_t * key1, } if (sctp_get_keylen(key1)) { bcopy(key1->key, key_ptr, key1->keylen); - key_ptr += key1->keylen; } } return (new_key); Modified: stable/8/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/8/sys/netinet/sctp_cc_functions.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_cc_functions.c Sat Feb 11 00:57:08 2012 (r231492) @@ -80,7 +80,6 @@ sctp_set_initial_cc_param(struct sctp_tc } } net->ssthresh = assoc->peers_rwnd; - SDT_PROBE(sctp, cwnd, net, init, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, 0, net->cwnd); @@ -339,7 +338,6 @@ cc_bw_same(struct sctp_tcb *stcb, struct ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), net->flight_size, probepoint); - if ((net->cc_mod.rtcc.steady_step) && (inst_ind != SCTP_INST_LOOSING)) { if (net->cc_mod.rtcc.last_step_state == 5) net->cc_mod.rtcc.step_cnt++; @@ -389,7 +387,6 @@ cc_bw_decrease(struct sctp_tcb *stcb, st ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), net->flight_size, probepoint); - if (net->cc_mod.rtcc.ret_from_eq) { /* * Switch over to CA if we are less @@ -408,7 +405,6 @@ cc_bw_decrease(struct sctp_tcb *stcb, st ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), net->flight_size, probepoint); - /* Someone else - fight for more? */ if (net->cc_mod.rtcc.steady_step) { oth = net->cc_mod.rtcc.vol_reduce; @@ -553,7 +549,8 @@ cc_bw_increase(struct sctp_tcb *stcb, st static int cc_bw_limit(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw) { - uint64_t bw_offset, rtt_offset, rtt, vtag, probepoint; + uint64_t bw_offset, rtt_offset; + uint64_t probepoint, rtt, vtag; uint64_t bytes_for_this_rtt, inst_bw; uint64_t div, inst_off; int bw_shift; @@ -619,15 +616,15 @@ cc_bw_limit(struct sctp_tcb *stcb, struc inst_ind = SCTP_INST_NEUTRAL; probepoint |= ((0xb << 16) | inst_ind); } else { + inst_ind = net->cc_mod.rtcc.last_inst_ind; inst_bw = bytes_for_this_rtt / (uint64_t) (net->rtt); /* Can't determine do not change */ - inst_ind = net->cc_mod.rtcc.last_inst_ind; probepoint |= ((0xc << 16) | inst_ind); } } else { + inst_ind = net->cc_mod.rtcc.last_inst_ind; inst_bw = bytes_for_this_rtt; /* Can't determine do not change */ - inst_ind = net->cc_mod.rtcc.last_inst_ind; probepoint |= ((0xd << 16) | inst_ind); } SDT_PROBE(sctp, cwnd, net, rttvar, @@ -702,15 +699,18 @@ sctp_cwnd_update_after_sack_common(struc } } } - if (t_ucwnd_sbw == 0) { - t_ucwnd_sbw = 1; - } if (t_path_mptcp > 0) { mptcp_like_alpha = max_path / (t_path_mptcp * t_path_mptcp); } else { mptcp_like_alpha = 1; } } + if (t_ssthresh == 0) { + t_ssthresh = 1; + } + if (t_ucwnd_sbw == 0) { + t_ucwnd_sbw = 1; + } /******************************/ /* update cwnd and Early FR */ /******************************/ @@ -1012,6 +1012,9 @@ sctp_cwnd_update_after_timeout(struct sc t_ucwnd_sbw += (uint64_t) lnet->cwnd / (uint64_t) srtt; } } + if (t_ssthresh < 1) { + t_ssthresh = 1; + } if (t_ucwnd_sbw < 1) { t_ucwnd_sbw = 1; } @@ -1841,19 +1844,19 @@ static int use_bandwidth_switch = 1; static inline int between(uint32_t seq1, uint32_t seq2, uint32_t seq3) { - return seq3 - seq2 >= seq1 - seq2; + return (seq3 - seq2 >= seq1 - seq2); } static inline uint32_t htcp_cong_time(struct htcp *ca) { - return sctp_get_tick_count() - ca->last_cong; + return (sctp_get_tick_count() - ca->last_cong); } static inline uint32_t htcp_ccount(struct htcp *ca) { - return htcp_cong_time(ca) / ca->minRTT; + return (htcp_cong_time(ca) / ca->minRTT); } static inline void @@ -1873,7 +1876,7 @@ htcp_cwnd_undo(struct sctp_tcb *stcb, st net->cc_mod.htcp_ca.last_cong = net->cc_mod.htcp_ca.undo_last_cong; net->cc_mod.htcp_ca.maxRTT = net->cc_mod.htcp_ca.undo_maxRTT; net->cc_mod.htcp_ca.old_maxB = net->cc_mod.htcp_ca.undo_old_maxB; - return max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->cc_mod.htcp_ca.beta) * net->mtu); + return (max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->cc_mod.htcp_ca.beta) * net->mtu)); } #endif @@ -2017,7 +2020,7 @@ static uint32_t htcp_recalc_ssthresh(struct sctp_nets *net) { htcp_param_update(net); - return max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu); + return (max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu)); } static void @@ -2087,7 +2090,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s static uint32_t htcp_min_cwnd(struct sctp_tcb *stcb, struct sctp_nets *net) { - return net->ssthresh; + return (net->ssthresh); } #endif Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_constants.h Sat Feb 11 00:57:08 2012 (r231492) @@ -396,7 +396,7 @@ __FBSDID("$FreeBSD$"); /* SCTP chunk types are moved sctp.h for application (NAT, FW) use */ /* align to 32-bit sizes */ -#define SCTP_SIZE32(x) ((((x)+3) >> 2) << 2) +#define SCTP_SIZE32(x) ((((x) + 3) >> 2) << 2) #define IS_SCTP_CONTROL(a) ((a)->chunk_type != SCTP_DATA) #define IS_SCTP_DATA(a) ((a)->chunk_type == SCTP_DATA) @@ -933,7 +933,7 @@ __FBSDID("$FreeBSD$"); } else { \ gap = (MAX_TSN - mapping_tsn) + tsn + 1; \ } \ - } while(0) + } while (0) #define SCTP_RETRAN_DONE -1 Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_indata.c Sat Feb 11 00:57:08 2012 (r231492) @@ -845,7 +845,7 @@ sctp_queue_data_for_reasm(struct sctp_tc struct sctp_tmit_chunk *chk, int *abort_flag) { struct mbuf *oper; - uint32_t cum_ackp1, last_tsn, prev_tsn, post_tsn; + uint32_t cum_ackp1, prev_tsn, post_tsn; struct sctp_tmit_chunk *at, *prev, *next; prev = next = NULL; @@ -1032,7 +1032,6 @@ sctp_queue_data_for_reasm(struct sctp_tc sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } else { - last_tsn = at->rec.data.TSN_seq; prev = at; if (TAILQ_NEXT(at, sctp_next) == NULL) { /* @@ -1698,12 +1697,10 @@ sctp_process_a_data_chunk(struct sctp_tc if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { struct mbuf *mat; - mat = dmbuf; - while (mat) { + for (mat = dmbuf; mat; mat = SCTP_BUF_NEXT(mat)) { if (SCTP_BUF_IS_EXTENDED(mat)) { sctp_log_mb(mat, SCTP_MBUF_ICOPY); } - mat = SCTP_BUF_NEXT(mat); } } #endif @@ -1724,10 +1721,8 @@ sctp_process_a_data_chunk(struct sctp_tc struct mbuf *lat; l_len = 0; - lat = dmbuf; - while (lat) { + for (lat = dmbuf; lat; lat = SCTP_BUF_NEXT(lat)) { l_len += SCTP_BUF_LEN(lat); - lat = SCTP_BUF_NEXT(lat); } } if (l_len > the_len) { @@ -1804,15 +1799,10 @@ failed_express_del: if (tsn == (control->sinfo_tsn + 1)) { /* Yep, we can add it on */ int end = 0; - uint32_t cumack; if (chunk_flags & SCTP_DATA_LAST_FRAG) { end = 1; } - cumack = asoc->cumulative_tsn; - if ((cumack + 1) == tsn) - cumack = tsn; - if (sctp_append_to_readq(stcb->sctp_ep, stcb, control, dmbuf, end, tsn, &stcb->sctp_socket->so_rcv)) { @@ -2634,7 +2624,7 @@ sctp_process_data(struct mbuf **mm, int if (length - *offset < chk_length) { /* all done, mutulated chunk */ stop_proc = 1; - break; + continue; } if (ch->ch.chunk_type == SCTP_DATA) { if ((size_t)chk_length < sizeof(struct sctp_data_chunk) + 1) { @@ -2690,7 +2680,7 @@ sctp_process_data(struct mbuf **mm, int * drop rep space left. */ stop_proc = 1; - break; + continue; } } else { /* not a data chunk in the data region */ @@ -2698,7 +2688,7 @@ sctp_process_data(struct mbuf **mm, int case SCTP_INITIATION: case SCTP_INITIATION_ACK: case SCTP_SELECTIVE_ACK: - case SCTP_NR_SELECTIVE_ACK: /* EY */ + case SCTP_NR_SELECTIVE_ACK: case SCTP_HEARTBEAT_REQUEST: case SCTP_HEARTBEAT_ACK: case SCTP_ABORT_ASSOCIATION: @@ -2772,7 +2762,7 @@ sctp_process_data(struct mbuf **mm, int } /* else skip this bad chunk and * continue... */ break; - }; /* switch of chunk type */ + } /* switch of chunk type */ } *offset += SCTP_SIZE32(chk_length); if ((*offset >= length) || stop_proc) { @@ -2785,10 +2775,9 @@ sctp_process_data(struct mbuf **mm, int if (ch == NULL) { *offset = length; stop_proc = 1; - break; - + continue; } - } /* while */ + } if (break_flag) { /* * we need to report rwnd overrun drops. @@ -3598,7 +3587,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t * this guy had a RTO calculation pending on * it, cancel it */ - if (tp1->whoTo->rto_needed == 0) { + if ((tp1->whoTo != NULL) && + (tp1->whoTo->rto_needed == 0)) { tp1->whoTo->rto_needed = 1; } tp1->do_rtt = 0; Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:57:08 2012 (r231492) @@ -1418,7 +1418,6 @@ sctp_process_cookie_existing(struct mbuf struct sctp_nets *net; struct mbuf *op_err; struct sctp_paramhdr *ph; - int chk_length; int init_offset, initack_offset, i; int retval; int spec_flag = 0; @@ -1468,7 +1467,6 @@ sctp_process_cookie_existing(struct mbuf /* could not pull a INIT chunk in cookie */ return (NULL); } - chk_length = ntohs(init_cp->ch.chunk_length); if (init_cp->ch.chunk_type != SCTP_INITIATION) { return (NULL); } @@ -1476,7 +1474,7 @@ sctp_process_cookie_existing(struct mbuf * find and validate the INIT-ACK chunk in the cookie (my info) the * INIT-ACK follows the INIT chunk */ - initack_offset = init_offset + SCTP_SIZE32(chk_length); + initack_offset = init_offset + SCTP_SIZE32(ntohs(init_cp->ch.chunk_length)); initack_cp = (struct sctp_init_ack_chunk *) sctp_m_getptr(m, initack_offset, sizeof(struct sctp_init_ack_chunk), (uint8_t *) & initack_buf); @@ -1484,7 +1482,6 @@ sctp_process_cookie_existing(struct mbuf /* could not pull INIT-ACK chunk in cookie */ return (NULL); } - chk_length = ntohs(initack_cp->ch.chunk_length); if (initack_cp->ch.chunk_type != SCTP_INITIATION_ACK) { return (NULL); } @@ -1984,11 +1981,9 @@ sctp_process_cookie_new(struct mbuf *m, struct sockaddr_storage sa_store; struct sockaddr *initack_src = (struct sockaddr *)&sa_store; struct sctp_association *asoc; - int chk_length; int init_offset, initack_offset, initack_limit; int retval; int error = 0; - uint32_t old_tag; uint8_t auth_chunk_buf[SCTP_PARAM_BUFFER_SIZE]; #ifdef INET @@ -2020,12 +2015,11 @@ sctp_process_cookie_new(struct mbuf *m, "process_cookie_new: could not pull INIT chunk hdr\n"); return (NULL); } - chk_length = ntohs(init_cp->ch.chunk_length); if (init_cp->ch.chunk_type != SCTP_INITIATION) { SCTPDBG(SCTP_DEBUG_INPUT1, "HUH? process_cookie_new: could not find INIT chunk!\n"); return (NULL); } - initack_offset = init_offset + SCTP_SIZE32(chk_length); + initack_offset = init_offset + SCTP_SIZE32(ntohs(init_cp->ch.chunk_length)); /* * find and validate the INIT-ACK chunk in the cookie (my info) the * INIT-ACK follows the INIT chunk @@ -2038,7 +2032,6 @@ sctp_process_cookie_new(struct mbuf *m, SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: could not pull INIT-ACK chunk hdr\n"); return (NULL); } - chk_length = ntohs(initack_cp->ch.chunk_length); if (initack_cp->ch.chunk_type != SCTP_INITIATION_ACK) { return (NULL); } @@ -2115,7 +2108,6 @@ sctp_process_cookie_new(struct mbuf *m, return (NULL); } /* process the INIT-ACK info (my info) */ - old_tag = asoc->my_vtag; asoc->my_vtag = ntohl(initack_cp->init.initiate_tag); asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); @@ -2702,10 +2694,9 @@ sctp_handle_cookie_echo(struct mbuf *m, */ if (netl == NULL) { /* TSNH! Huh, why do I need to add this address here? */ - int ret; - - ret = sctp_add_remote_addr(*stcb, to, NULL, SCTP_DONOT_SETSCOPE, - SCTP_IN_COOKIE_PROC); + if (sctp_add_remote_addr(*stcb, to, NULL, SCTP_DONOT_SETSCOPE, SCTP_IN_COOKIE_PROC)) { + return (NULL); + } netl = sctp_findnet(*stcb, to); } if (netl) { @@ -3003,7 +2994,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch struct sctp_nets *net; struct sctp_tmit_chunk *lchk; struct sctp_ecne_chunk bkup; - uint8_t override_bit = 0; + uint8_t override_bit; uint32_t tsn, window_data_tsn; int len; unsigned int pkt_cnt; @@ -3050,27 +3041,33 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (tsn == net->last_cwr_tsn) { /* Found him, send it off */ - goto out; + break; } } - /* - * If we reach here, we need to send a special CWR that says - * hey, we did this a long time ago and you lost the - * response. - */ - net = TAILQ_FIRST(&stcb->asoc.nets); - override_bit = SCTP_CWR_REDUCE_OVERRIDE; + if (net == NULL) { + /* + * If we reach here, we need to send a special CWR + * that says hey, we did this a long time ago and + * you lost the response. + */ + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + /* TSNH */ + return; + } + override_bit = SCTP_CWR_REDUCE_OVERRIDE; + } else { + override_bit = 0; + } + } else { + override_bit = 0; } -out: if (SCTP_TSN_GT(tsn, net->cwr_window_tsn) && ((override_bit & SCTP_CWR_REDUCE_OVERRIDE) == 0)) { /* * JRS - Use the congestion control given in the pluggable * CC module */ - int ocwnd; - - ocwnd = net->cwnd; stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 0, pkt_cnt); /* * We reduce once every RTT. So we will only lower cwnd at @@ -5074,7 +5071,6 @@ process_control_chunks: } SCTPDBG(SCTP_DEBUG_INPUT3, "GAK, null buffer\n"); - auth_skipped = 0; *offset = length; return (NULL); } @@ -5697,7 +5693,8 @@ sctp_common_input_processing(struct mbuf */ } /* take care of ecn */ - if ((stcb->asoc.ecn_allowed == 1) && + if ((data_processed == 1) && + (stcb->asoc.ecn_allowed == 1) && ((ecn_bits & SCTP_CE_BITS) == SCTP_CE_BITS)) { /* Yep, we need to add a ECNE */ sctp_send_ecn_echo(stcb, net, high_tsn); @@ -5807,12 +5804,10 @@ sctp_input_with_port(struct mbuf *i_pak, #ifdef SCTP_MBUF_LOGGING /* Log in any input mbufs */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { - mat = m; - while (mat) { + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { if (SCTP_BUF_IS_EXTENDED(mat)) { sctp_log_mb(mat, SCTP_MBUF_INPUT); } - mat = SCTP_BUF_NEXT(mat); } } #endif Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Sat Feb 11 00:54:57 2012 (r231491) +++ stable/8/sys/netinet/sctp_output.c Sat Feb 11 00:57:08 2012 (r231492) @@ -2156,23 +2156,20 @@ skip_count: } cnt++; } - if (cnt > SCTP_ADDRESS_LIMIT) { - limit_out = 1; - } /* * To get through a NAT we only list addresses if we have * more than one. That way if you just bind a single address * we let the source of the init dictate our address. */ if (cnt > 1) { + cnt = cnt_inits_to; LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { - cnt = 0; if (laddr->ifa == NULL) { continue; } - if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) + if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) { continue; - + } if (sctp_is_address_in_scope(laddr->ifa, scope->ipv4_addr_legal, scope->ipv6_addr_legal, @@ -3758,7 +3755,6 @@ sctp_add_cookie(struct mbuf *init, int i /* tack the INIT and then the INIT-ACK onto the chain */ cookie_sz = 0; - m_at = mret; for (m_at = mret; m_at; m_at = SCTP_BUF_NEXT(m_at)) { cookie_sz += SCTP_BUF_LEN(m_at); if (SCTP_BUF_NEXT(m_at) == NULL) { @@ -3766,7 +3762,6 @@ sctp_add_cookie(struct mbuf *init, int i break; } } - for (m_at = copy_init; m_at; m_at = SCTP_BUF_NEXT(m_at)) { cookie_sz += SCTP_BUF_LEN(m_at); if (SCTP_BUF_NEXT(m_at) == NULL) { @@ -3774,7 +3769,6 @@ sctp_add_cookie(struct mbuf *init, int i break; } } - for (m_at = copy_initack; m_at; m_at = SCTP_BUF_NEXT(m_at)) { cookie_sz += SCTP_BUF_LEN(m_at); if (SCTP_BUF_NEXT(m_at) == NULL) { @@ -4804,7 +4798,6 @@ sctp_send_initiate(struct sctp_inpcb *in SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); } } - m_at = m; /* now the addresses */ { struct sctp_scoping scp; @@ -4813,9 +4806,10 @@ sctp_send_initiate(struct sctp_inpcb *in * To optimize this we could put the scoping stuff into a * structure and remove the individual uint8's from the * assoc structure. Then we could just sifa in the address - * within the stcb.. but for now this is a quick hack to get + * within the stcb. But for now this is a quick hack to get * the address stuff teased apart. */ + scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; scp.loopback_scope = stcb->asoc.loopback_scope; @@ -4823,7 +4817,7 @@ sctp_send_initiate(struct sctp_inpcb *in scp.local_scope = stcb->asoc.local_scope; scp.site_scope = stcb->asoc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); + sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to); } /* calulate the size and update pkt header and chunk header */ @@ -4853,7 +4847,6 @@ sctp_send_initiate(struct sctp_inpcb *in sctp_m_freem(m); return; } - p_len += padval; } SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - calls lowlevel_output\n"); ret = sctp_lowlevel_chunk_output(inp, stcb, net, @@ -5074,7 +5067,6 @@ sctp_arethere_unrecognized_parameters(st return (NULL); } m_copyback(op_err, err_at, plen, (caddr_t)phdr); - err_at += plen; } return (op_err); break; @@ -5317,6 +5309,7 @@ sctp_are_there_new_addresses(struct sctp p4 = (struct sctp_ipv4addr_param *)phdr; sin4.sin_addr.s_addr = p4->addr; sa_touse = (struct sockaddr *)&sin4; + break; } #endif #ifdef INET6 @@ -5334,10 +5327,12 @@ sctp_are_there_new_addresses(struct sctp memcpy((caddr_t)&sin6.sin6_addr, p6->addr, sizeof(p6->addr)); sa_touse = (struct sockaddr *)&sin6; + break; } #endif default: sa_touse = NULL; + break; } if (sa_touse) { /* ok, sa_touse points to one to check */ @@ -5546,7 +5541,7 @@ do_a_abort: default: goto do_a_abort; break; - }; + } if (net == NULL) { to = (struct sockaddr *)&store; @@ -5966,6 +5961,7 @@ do_a_abort: llen = 0; ol = op_err; + while (ol) { llen += SCTP_BUF_LEN(ol); ol = SCTP_BUF_NEXT(ol); @@ -6035,15 +6031,11 @@ do_a_abort: padval = p_len % 4; if ((padval) && (mp_last)) { /* see my previous comments on mp_last */ - int ret; - - ret = sctp_add_pad_tombuf(mp_last, (4 - padval)); - if (ret) { + if (sctp_add_pad_tombuf(mp_last, (4 - padval))) { /* Houston we have a problem, no space */ sctp_m_freem(m); return; } - p_len += padval; } if (stc.loopback_scope) { over_addr = &store1; @@ -6242,7 +6234,7 @@ sctp_msg_append(struct sctp_tcb *stcb, struct mbuf *m, struct sctp_sndrcvinfo *srcv, int hold_stcb_lock) { - int error = 0, holds_lock; + int error = 0; struct mbuf *at; struct sctp_stream_queue_pending *sp = NULL; struct sctp_stream_out *strm; @@ -6251,7 +6243,6 @@ sctp_msg_append(struct sctp_tcb *stcb, * Given an mbuf chain, put it into the association send queue and * place it on the wheel */ - holds_lock = hold_stcb_lock; if (srcv->sinfo_stream >= stcb->asoc.streamoutcnt) { /* Invalid stream number */ SCTP_LTRACE_ERR_RET_PKT(m, NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); @@ -6320,7 +6311,9 @@ sctp_msg_append(struct sctp_tcb *stcb, sctp_auth_key_acquire(stcb, sp->auth_keyid); sp->holds_key_ref = 1; } - SCTP_TCB_SEND_LOCK(stcb); + if (hold_stcb_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&stcb->asoc.stream_queue_cnt, 1); TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); @@ -6330,7 +6323,9 @@ sctp_msg_append(struct sctp_tcb *stcb, } stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp, 1); m = NULL; - SCTP_TCB_SEND_UNLOCK(stcb); + if (hold_stcb_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } out_now: if (m) { sctp_m_freem(m); @@ -7597,7 +7592,6 @@ dont_do_it: out_of: if (send_lock_up) { SCTP_TCB_SEND_UNLOCK(stcb); - send_lock_up = 0; } return (to_move); } @@ -7612,7 +7606,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb ) { struct sctp_association *asoc; - struct sctp_stream_out *strq, *strqn; + struct sctp_stream_out *strq; int goal_mtu, moved_how_much, total_moved = 0, bail = 0; int locked, giveup; @@ -7641,7 +7635,6 @@ sctp_fill_outqueue(struct sctp_tcb *stcb strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); locked = 0; } - strqn = strq; while ((goal_mtu > 0) && strq) { giveup = 0; bail = 0; @@ -7954,7 +7947,7 @@ again_one_more_time: */ continue; } - ctl_cnt = bundle_at = 0; + bundle_at = 0; endoutchain = outchain = NULL; no_fragmentflg = 1; one_chunk = 0; @@ -8652,7 +8645,6 @@ again_one_more_time: chk->window_probe = 0; data_list[bundle_at++] = chk; if (bundle_at >= SCTP_MAX_DATA_BUNDLING) { - mtu = 0; break; } if (chk->sent == SCTP_DATAGRAM_UNSENT) { @@ -8769,7 +8761,7 @@ no_data_fill: } else { asoc->ifp_had_enobuf = 0; } - outchain = endoutchain = NULL; + endoutchain = NULL; auth = NULL; auth_offset = 0; if (bundle_at || hbflag) { @@ -9233,7 +9225,7 @@ sctp_send_asconf_ack(struct sctp_tcb *st */ struct sctp_tmit_chunk *chk; struct sctp_asconf_ack *ack, *latest_ack; - struct mbuf *m_ack, *m; + struct mbuf *m_ack; struct sctp_nets *net = NULL; SCTP_TCB_LOCK_ASSERT(stcb); @@ -9312,7 +9304,6 @@ sctp_send_asconf_ack(struct sctp_tcb *st chk->data = m_ack; chk->send_size = 0; /* Get size */ - m = m_ack; chk->send_size = ack->len; chk->rec.chunk_id.id = SCTP_ASCONF_ACK; chk->rec.chunk_id.can_take_data = 1; @@ -9405,7 +9396,6 @@ sctp_chunk_retransmission(struct sctp_in ctl_cnt++; if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) { fwd_tsn = 1; - fwd = chk; } /* * Add an AUTH chunk, if chunk requires it save the @@ -9443,7 +9433,7 @@ sctp_chunk_retransmission(struct sctp_in SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } - m = endofchain = NULL; + endofchain = NULL; auth = NULL; auth_offset = 0; /* @@ -9613,16 +9603,13 @@ one_chunk_around: * now are there anymore forward from chk to pick * up? */ - fwd = TAILQ_NEXT(chk, sctp_next); - while (fwd) { + for (fwd = TAILQ_NEXT(chk, sctp_next); fwd != NULL; fwd = TAILQ_NEXT(fwd, sctp_next)) { if (fwd->sent != SCTP_DATAGRAM_RESEND) { /* Nope, not for retran */ - fwd = TAILQ_NEXT(fwd, sctp_next); continue; } if (fwd->whoTo != net) { /* Nope, not the net in question */ - fwd = TAILQ_NEXT(fwd, sctp_next); continue; } if (data_auth_reqd && (auth == NULL)) { @@ -9670,7 +9657,6 @@ one_chunk_around: if (bundle_at >= SCTP_MAX_DATA_BUNDLING) { break; } - fwd = TAILQ_NEXT(fwd, sctp_next); } else { /* can't fit so we are done */ break; @@ -9702,7 +9688,7 @@ one_chunk_around: SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } - m = endofchain = NULL; + endofchain = NULL; auth = NULL; auth_offset = 0; /* For HB's */ @@ -10264,12 +10250,14 @@ sctp_fill_in_rest: * we report. */ at = TAILQ_FIRST(&asoc->sent_queue); - for (i = 0; i < cnt_of_skipped; i++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 00:59:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0117106564A; Sat, 11 Feb 2012 00:59:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEA3F8FC15; Sat, 11 Feb 2012 00:59: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 q1B0xMR0005597; Sat, 11 Feb 2012 00:59:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0xMMu005595; Sat, 11 Feb 2012 00:59:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110059.q1B0xMMu005595@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 00:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231493 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:59:22 -0000 Author: tuexen Date: Sat Feb 11 00:59:22 2012 New Revision: 231493 URL: http://svn.freebsd.org/changeset/base/231493 Log: MFC r229729: Use NULL instead of 0. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sat Feb 11 00:57:08 2012 (r231492) +++ stable/8/sys/netinet/sctputil.c Sat Feb 11 00:59:22 2012 (r231493) @@ -1460,7 +1460,7 @@ sctp_timeout_handler(void *t) type = tmr->type; if (inp) { SCTP_INP_INCR_REF(inp); - if ((inp->sctp_socket == 0) && + if ((inp->sctp_socket == NULL) && ((tmr->type != SCTP_TIMER_TYPE_INPKILL) && (tmr->type != SCTP_TIMER_TYPE_INIT) && (tmr->type != SCTP_TIMER_TYPE_SEND) && From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 01:01:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DF04106566C; Sat, 11 Feb 2012 01:01:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F30888FC0C; Sat, 11 Feb 2012 01:01: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 q1B117ln005719; Sat, 11 Feb 2012 01:01:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B117ie005717; Sat, 11 Feb 2012 01:01:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110101.q1B117ie005717@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:01: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: r231494 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:01:08 -0000 Author: tuexen Date: Sat Feb 11 01:01:07 2012 New Revision: 231494 URL: http://svn.freebsd.org/changeset/base/231494 Log: MFC r229774: Improve the handling of received INITs. Send an ABORT when not accepting the connection. Also fix a crash, which could happen when the user closed the socket. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 00:59:22 2012 (r231493) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:01:07 2012 (r231494) @@ -88,43 +88,14 @@ sctp_handle_init(struct mbuf *m, int iph { struct sctp_init *init; struct mbuf *op_err; - uint32_t init_limit; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_init: handling INIT tcb:%p\n", stcb); if (stcb == NULL) { SCTP_INP_RLOCK(inp); - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - goto outnow; - } - } - op_err = NULL; - init = &cp->init; - /* First are we accepting? */ - if ((inp->sctp_socket->so_qlimit == 0) && (stcb == NULL)) { - SCTPDBG(SCTP_DEBUG_INPUT2, - "sctp_handle_init: Abort, so_qlimit:%d\n", - inp->sctp_socket->so_qlimit); - /* - * FIX ME ?? What about TCP model and we have a - * match/restart case? Actually no fix is needed. the lookup - * will always find the existing assoc so stcb would not be - * NULL. It may be questionable to do this since we COULD - * just send back the INIT-ACK and hope that the app did - * accept()'s by the time the COOKIE was sent. But there is - * a price to pay for COOKIE generation and I don't want to - * pay it on the chance that the app will actually do some - * accepts(). The App just looses and should NOT be in this - * state :-) - */ - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, - vrf_id, port); - if (stcb) - *abort_no_unlock = 1; - goto outnow; } + /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { - /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, vrf_id, port); @@ -133,6 +104,7 @@ sctp_handle_init(struct mbuf *m, int iph goto outnow; } /* validate parameters */ + init = &cp->init; if (init->initiate_tag == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); @@ -169,19 +141,49 @@ sctp_handle_init(struct mbuf *m, int iph *abort_no_unlock = 1; goto outnow; } - init_limit = offset + ntohs(cp->ch.chunk_length); if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), - init_limit)) { + offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); if (stcb) *abort_no_unlock = 1; goto outnow; } - /* send an INIT-ACK w/cookie */ - SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, - ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + /* + * We are only accepting if we have a socket with positive + * so_qlimit. + */ + if ((stcb == NULL) && + ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || + (inp->sctp_socket == NULL) || + (inp->sctp_socket->so_qlimit == 0))) { + /* + * FIX ME ?? What about TCP model and we have a + * match/restart case? Actually no fix is needed. the lookup + * will always find the existing assoc so stcb would not be + * NULL. It may be questionable to do this since we COULD + * just send back the INIT-ACK and hope that the app did + * accept()'s by the time the COOKIE was sent. But there is + * a price to pay for COOKIE generation and I don't want to + * pay it on the chance that the app will actually do some + * accepts(). The App just looses and should NOT be in this + * state :-) + */ + sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + vrf_id, port); + goto outnow; + } + if ((stcb != NULL) && + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { + SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending SHUTDOWN-ACK\n"); + sctp_send_shutdown_ack(stcb, NULL); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); + } else { + SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, + ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + } outnow: if (stcb == NULL) { SCTP_INP_RUNLOCK(inp); @@ -1025,7 +1027,7 @@ sctp_handle_shutdown_ack(struct sctp_shu if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /* Set the connected flag to disconnected */ - stcb->sctp_ep->sctp_socket->so_snd.sb_cc = 0; + stcb->sctp_socket->so_snd.sb_cc = 0; } } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); @@ -4499,7 +4501,6 @@ __attribute__((noinline)) * process all control chunks... */ if (((ch->chunk_type == SCTP_SELECTIVE_ACK) || - /* EY */ (ch->chunk_type == SCTP_NR_SELECTIVE_ACK) || (ch->chunk_type == SCTP_HEARTBEAT_REQUEST)) && (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { @@ -4613,54 +4614,30 @@ process_control_chunks: } switch (ch->chunk_type) { case SCTP_INITIATION: - /* must be first and only chunk */ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT\n"); - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore? */ - if ((stcb) && (stcb->asoc.total_output_queue_size)) { - /* - * collision case where we are - * sending to them too - */ - ; - } else { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - *offset = length; - return (NULL); - } - } - if ((chk_length > SCTP_LARGEST_INIT_ACCEPTED) || - (num_chunks > 1) || + /* The INIT chunk must be the only chunk. */ + if ((num_chunks > 1) || (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + sctp_abort_association(inp, stcb, m, + iphlen, sh, NULL, vrf_id, port); *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } - if ((stcb != NULL) && - (SCTP_GET_STATE(&stcb->asoc) == - SCTP_STATE_SHUTDOWN_ACK_SENT)) { - sctp_send_shutdown_ack(stcb, NULL); + /* Honor our resource limit. */ + if (chk_length > SCTP_LARGEST_INIT_ACCEPTED) { + struct mbuf *op_err; + + op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); + sctp_abort_association(inp, stcb, m, + iphlen, sh, op_err, vrf_id, port); *offset = length; - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } - if (netp) { - sctp_handle_init(m, iphlen, *offset, sh, - (struct sctp_init_chunk *)ch, inp, - stcb, &abort_no_unlock, vrf_id, port); - } - if (abort_no_unlock) - return (NULL); - + sctp_handle_init(m, iphlen, *offset, sh, + (struct sctp_init_chunk *)ch, inp, + stcb, &abort_no_unlock, vrf_id, port); *offset = length; - if (locked_tcb) { + if ((!abort_no_unlock) && (locked_tcb)) { SCTP_TCB_UNLOCK(locked_tcb); } return (NULL); @@ -4668,7 +4645,6 @@ process_control_chunks: case SCTP_PAD_CHUNK: break; case SCTP_INITIATION_ACK: - /* must be first and only chunk */ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT-ACK\n"); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -4697,6 +4673,7 @@ process_control_chunks: return (NULL); } } + /* The INIT-CK chunk must be the only chunk. */ if ((num_chunks > 1) || (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { *offset = length; @@ -4711,16 +4688,17 @@ process_control_chunks: } else { ret = -1; } + *offset = length; + if (abort_no_unlock) { + return (NULL); + } /* * Special case, I must call the output routine to * get the cookie echoed */ - if (abort_no_unlock) - return (NULL); - - if ((stcb) && ret == 0) + if ((stcb != NULL) && (ret == 0)) { sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); - *offset = length; + } if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); } @@ -4977,7 +4955,6 @@ process_control_chunks: case SCTP_OPERATION_ERROR: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP-ERR\n"); if ((stcb) && netp && *netp && sctp_handle_error(ch, stcb, *netp) < 0) { - *offset = length; return (NULL); } @@ -5009,23 +4986,11 @@ process_control_chunks: if ((stcb == NULL) && (inp->sctp_socket->so_qlen >= inp->sctp_socket->so_qlimit)) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit))) { - struct mbuf *oper; - struct sctp_paramhdr *phdr; + struct mbuf *op_err; - oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); - if (oper) { - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr); - phdr = mtod(oper, - struct sctp_paramhdr *); - phdr->param_type = - htons(SCTP_CAUSE_OUT_OF_RESC); - phdr->param_length = - htons(sizeof(struct sctp_paramhdr)); - } + op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, stcb, m, - iphlen, sh, oper, vrf_id, port); + iphlen, sh, op_err, vrf_id, port); } *offset = length; return (NULL); From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 01:03:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F8DC106564A; Sat, 11 Feb 2012 01:03:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8329C8FC0C; Sat, 11 Feb 2012 01:03: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 q1B13Hd2005832; Sat, 11 Feb 2012 01:03:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B13HmW005828; Sat, 11 Feb 2012 01:03:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110103.q1B13HmW005828@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:03:17 +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: r231495 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:03:17 -0000 Author: tuexen Date: Sat Feb 11 01:03:17 2012 New Revision: 231495 URL: http://svn.freebsd.org/changeset/base/231495 Log: MFC r229775: Retire the SCTP sysctl "strict_init". We always perform the validation and there is no reason to make is configuarable. Discussed with rrs@. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:01:07 2012 (r231494) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:03:17 2012 (r231495) @@ -4617,7 +4617,7 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT\n"); /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || - (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + (length - *offset > (int)SCTP_SIZE32(chk_length))) { sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); *offset = length; @@ -4673,9 +4673,9 @@ process_control_chunks: return (NULL); } } - /* The INIT-CK chunk must be the only chunk. */ + /* The INIT-ACK chunk must be the only chunk. */ if ((num_chunks > 1) || - (SCTP_BASE_SYSCTL(sctp_strict_init) && (length - *offset > (int)SCTP_SIZE32(chk_length)))) { + (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Sat Feb 11 01:01:07 2012 (r231494) +++ stable/8/sys/netinet/sctp_sysctl.c Sat Feb 11 01:03:17 2012 (r231495) @@ -58,7 +58,6 @@ sctp_init_sysctls() #if !defined(SCTP_WITH_NO_CSUM) SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; #endif - SCTP_BASE_SYSCTL(sctp_strict_init) = SCTPCTL_STRICT_INIT_DEFAULT; SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -607,7 +606,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #if !defined(SCTP_WITH_NO_CSUM) RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); #endif - RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_init), SCTPCTL_STRICT_INIT_MIN, SCTPCTL_STRICT_INIT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); @@ -876,10 +874,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT SCTPCTL_LOOPBACK_NOCSUM_DESC); #endif -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU", - SCTPCTL_STRICT_INIT_DESC); - SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", SCTPCTL_PEER_CHKOH_DESC); Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 01:01:07 2012 (r231494) +++ stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 01:03:17 2012 (r231495) @@ -50,7 +50,6 @@ struct sctp_sysctl { #if !defined(SCTP_WITH_NO_CSUM) uint32_t sctp_no_csum_on_loopback; #endif - uint32_t sctp_strict_init; uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; @@ -168,12 +167,6 @@ struct sctp_sysctl { #define SCTPCTL_LOOPBACK_NOCSUM_MAX 1 #define SCTPCTL_LOOPBACK_NOCSUM_DEFAULT 1 -/* strict_init: Enable strict INIT/INIT-ACK singleton enforcement */ -#define SCTPCTL_STRICT_INIT_DESC "Enable strict INIT/INIT-ACK singleton enforcement" -#define SCTPCTL_STRICT_INIT_MIN 0 -#define SCTPCTL_STRICT_INIT_MAX 1 -#define SCTPCTL_STRICT_INIT_DEFAULT 1 - /* peer_chkoh: Amount to debit peers rwnd per chunk sent */ #define SCTPCTL_PEER_CHKOH_DESC "Amount to debit peers rwnd per chunk sent" #define SCTPCTL_PEER_CHKOH_MIN 0 From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 01:05:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31ED7106564A; Sat, 11 Feb 2012 01:05:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F8288FC08; Sat, 11 Feb 2012 01:05:42 +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 q1B15g6G005951; Sat, 11 Feb 2012 01:05:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B15fYV005945; Sat, 11 Feb 2012 01:05:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110105.q1B15fYV005945@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231496 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:05:42 -0000 Author: tuexen Date: Sat Feb 11 01:05:41 2012 New Revision: 231496 URL: http://svn.freebsd.org/changeset/base/231496 Log: MFC r229805: Add an SCTP sysctl "blackhole", similar to the one for TCP. If set to 1, no ABORT is sent back in response to an incoming INIT. If set to 2, no ABORT is sent back in response to an out of the blue packet. If set to 0 (the default), ABORTs are sent. Discussed with rrs@. Modified: stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:05:41 2012 (r231496) @@ -170,8 +170,9 @@ sctp_handle_init(struct mbuf *m, int iph * accepts(). The App just looses and should NOT be in this * state :-) */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, - vrf_id, port); + if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } goto outnow; } if ((stcb != NULL) && @@ -5927,8 +5928,13 @@ sctp_skip_csum_4: if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { goto bad; } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } + } goto bad; } else if (stcb == NULL) { refcount_up = 1; Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet/sctp_sysctl.c Sat Feb 11 01:05:41 2012 (r231496) @@ -117,6 +117,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; SCTP_BASE_SYSCTL(sctp_steady_step) = SCTPCTL_RTTVAR_STEADYS_DEFAULT; SCTP_BASE_SYSCTL(sctp_use_dccc_ecn) = SCTPCTL_RTTVAR_DCCCECN_DEFAULT; + SCTP_BASE_SYSCTL(sctp_blackhole) = SCTPCTL_BLACKHOLE_DEFAULT; #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); @@ -665,6 +666,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); #ifdef SCTP_DEBUG RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); @@ -1123,6 +1125,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), 0, sysctl_sctp_check, "IU", SCTPCTL_RTTVAR_DCCCECN_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, blackhole, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_blackhole), 0, sysctl_sctp_check, "IU", + SCTPCTL_BLACKHOLE_DESC); + #ifdef SCTP_DEBUG SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 01:05:41 2012 (r231496) @@ -114,6 +114,7 @@ struct sctp_sysctl { uint32_t sctp_vtag_time_wait; uint32_t sctp_buffer_splitting; uint32_t sctp_initial_cwnd; + uint32_t sctp_blackhole; #if defined(SCTP_DEBUG) uint32_t sctp_debug_on; #endif @@ -519,6 +520,11 @@ struct sctp_sysctl { #define SCTPCTL_RTTVAR_DCCCECN_MAX 1 #define SCTPCTL_RTTVAR_DCCCECN_DEFAULT 1 /* 0 means disable feature */ +#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing" +#define SCTPCTL_BLACKHOLE_MIN 0 +#define SCTPCTL_BLACKHOLE_MAX 2 +#define SCTPCTL_BLACKHOLE_DEFAULT SCTPCTL_BLACKHOLE_MIN + #if defined(SCTP_DEBUG) /* debug: Configure debug output */ #define SCTPCTL_DEBUG_DESC "Configure debug output" Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet/sctputil.c Sat Feb 11 01:05:41 2012 (r231496) @@ -3801,6 +3801,7 @@ sctp_handle_ootb(struct mbuf *m, int iph { struct sctp_chunkhdr *ch, chunk_buf; unsigned int chk_length; + int contains_init_chunk; SCTP_STAT_INCR_COUNTER32(sctps_outoftheblue); /* Generate a TO address for future reference */ @@ -3810,6 +3811,7 @@ sctp_handle_ootb(struct mbuf *m, int iph SCTP_CALLED_DIRECTLY_NOCMPSET); } } + contains_init_chunk = 0; ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, sizeof(*ch), (uint8_t *) & chunk_buf); while (ch != NULL) { @@ -3819,6 +3821,9 @@ sctp_handle_ootb(struct mbuf *m, int iph break; } switch (ch->chunk_type) { + case SCTP_INIT: + contains_init_chunk = 1; + break; case SCTP_COOKIE_ECHO: /* We hit here only if the assoc is being freed */ return; @@ -3844,7 +3849,11 @@ sctp_handle_ootb(struct mbuf *m, int iph ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, sizeof(*ch), (uint8_t *) & chunk_buf); } - sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (contains_init_chunk == 0))) { + sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + } } /* Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Sat Feb 11 01:03:17 2012 (r231495) +++ stable/8/sys/netinet6/sctp6_usrreq.c Sat Feb 11 01:05:41 2012 (r231496) @@ -236,8 +236,13 @@ sctp_skip_csum: if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { goto bad; } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } + } goto bad; } else if (stcb == NULL) { refcount_up = 1; From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 01:07:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0138106566C; Sat, 11 Feb 2012 01:07:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEB338FC0A; Sat, 11 Feb 2012 01:07:51 +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 q1B17pH1006062; Sat, 11 Feb 2012 01:07:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B17pOc006060; Sat, 11 Feb 2012 01:07:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110107.q1B17pOc006060@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:07:51 +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: r231497 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:07:51 -0000 Author: tuexen Date: Sat Feb 11 01:07:51 2012 New Revision: 231497 URL: http://svn.freebsd.org/changeset/base/231497 Log: MFC r230104: Fix two bugs, which result in a panic when calling getsockopt() using SCTP_RECVINFO or SCTP_NXTINFO. Reported by Clement Lecigne and forwarded to us by zi@. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Sat Feb 11 01:05:41 2012 (r231496) +++ stable/8/sys/netinet/sctp_usrreq.c Sat Feb 11 01:07:51 2012 (r231497) @@ -3008,7 +3008,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_RLOCK(inp); onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO); SCTP_INP_RUNLOCK(inp); } @@ -3027,7 +3027,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_RLOCK(inp); onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO); SCTP_INP_RUNLOCK(inp); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 01:09:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31149106566B; Sat, 11 Feb 2012 01:09:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F9E78FC0C; Sat, 11 Feb 2012 01:09:47 +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 q1B19luO006164; Sat, 11 Feb 2012 01:09:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B19kT3006161; Sat, 11 Feb 2012 01:09:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110109.q1B19kT3006161@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:09:46 +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: r231498 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:09:47 -0000 Author: tuexen Date: Sat Feb 11 01:09:46 2012 New Revision: 231498 URL: http://svn.freebsd.org/changeset/base/231498 Log: MFC r230136: Two cleanups. No functional change. Modified: stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Sat Feb 11 01:07:51 2012 (r231497) +++ stable/8/sys/netinet/sctp_output.c Sat Feb 11 01:09:46 2012 (r231498) @@ -12839,9 +12839,9 @@ sctp_lower_sosend(struct socket *so, goto out_unlocked; } } - if ((SCTP_SO_IS_NBIO(so) + if (SCTP_SO_IS_NBIO(so) || (flags & MSG_NBIO) - )) { + ) { non_blocking = 1; } /* would we block? */ Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sat Feb 11 01:07:51 2012 (r231497) +++ stable/8/sys/netinet/sctputil.c Sat Feb 11 01:09:46 2012 (r231498) @@ -6373,7 +6373,7 @@ sctp_bindx_delete_address(struct sctp_in return; } addr_touse = sa; -#if defined(INET6) && !defined(__Userspace__) /* TODO port in6_sin6_2_sin */ +#if defined(INET6) if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 01:11:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32DC8106564A; Sat, 11 Feb 2012 01:11:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 216E68FC0C; Sat, 11 Feb 2012 01:11:38 +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 q1B1Bc1r006278; Sat, 11 Feb 2012 01:11:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B1Bc6h006276; Sat, 11 Feb 2012 01:11:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110111.q1B1Bc6h006276@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:11:38 +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: r231499 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:11:38 -0000 Author: tuexen Date: Sat Feb 11 01:11:37 2012 New Revision: 231499 URL: http://svn.freebsd.org/changeset/base/231499 Log: MFC r230138: Small cleanup, no functional change. Modified: stable/8/sys/netinet6/sctp6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet6/sctp6_var.h ============================================================================== --- stable/8/sys/netinet6/sctp6_var.h Sat Feb 11 01:09:46 2012 (r231498) +++ stable/8/sys/netinet6/sctp6_var.h Sat Feb 11 01:11:37 2012 (r231499) @@ -37,7 +37,6 @@ #include __FBSDID("$FreeBSD$"); -/* TODO __Userspace__ IPv6 stuff... */ #if defined(_KERNEL) SYSCTL_DECL(_net_inet6_sctp6); From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 01:13:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E221065670; Sat, 11 Feb 2012 01:13:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 846918FC08; Sat, 11 Feb 2012 01:13: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 q1B1DZuM006381; Sat, 11 Feb 2012 01:13:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B1DZlH006379; Sat, 11 Feb 2012 01:13:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110113.q1B1DZlH006379@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:13: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: r231500 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:13:35 -0000 Author: tuexen Date: Sat Feb 11 01:13:35 2012 New Revision: 231500 URL: http://svn.freebsd.org/changeset/base/231500 Log: MFC r230379: Fix a problem when using the CBAPI. While there, remove an old comment which does not apply anymore. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:11:37 2012 (r231499) +++ stable/8/sys/netinet/sctp_input.c Sat Feb 11 01:13:35 2012 (r231500) @@ -1024,12 +1024,11 @@ sctp_handle_shutdown_ack(struct sctp_shu sctp_send_shutdown_complete(stcb, net, 0); /* notify upper layer protocol */ if (stcb->sctp_socket) { - sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - /* Set the connected flag to disconnected */ stcb->sctp_socket->so_snd.sb_cc = 0; } + sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); /* free the TCB but first save off the ep */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 01:15:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E33A106566C; Sat, 11 Feb 2012 01:15:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB1ED8FC15; Sat, 11 Feb 2012 01:15: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 q1B1F2Xq006480; Sat, 11 Feb 2012 01:15:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B1F2GZ006478; Sat, 11 Feb 2012 01:15:02 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110115.q1B1F2GZ006478@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:15:02 +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: r231501 - in stable/8/usr.bin: chpass netstat su X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:15:03 -0000 Author: tuexen Date: Sat Feb 11 01:15:02 2012 New Revision: 231501 URL: http://svn.freebsd.org/changeset/base/231501 Log: MFC r230555: Don't print a warning when using netstat to print SCTP statistics when there is not SCTP in the kernel. This problem was reported by Sean Mahood. Modified: stable/8/usr.bin/netstat/sctp.c (contents, props changed) Directory Properties: stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/netstat/Makefile (props changed) stable/8/usr.bin/netstat/atalk.c (props changed) stable/8/usr.bin/netstat/bpf.c (props changed) stable/8/usr.bin/netstat/if.c (props changed) stable/8/usr.bin/netstat/inet.c (props changed) stable/8/usr.bin/netstat/inet6.c (props changed) stable/8/usr.bin/netstat/ipsec.c (props changed) stable/8/usr.bin/netstat/ipx.c (props changed) stable/8/usr.bin/netstat/main.c (props changed) stable/8/usr.bin/netstat/mbuf.c (props changed) stable/8/usr.bin/netstat/mroute.c (props changed) stable/8/usr.bin/netstat/mroute6.c (props changed) stable/8/usr.bin/netstat/netgraph.c (props changed) stable/8/usr.bin/netstat/netisr.c (props changed) stable/8/usr.bin/netstat/netstat.1 (props changed) stable/8/usr.bin/netstat/netstat.h (props changed) stable/8/usr.bin/netstat/pfkey.c (props changed) stable/8/usr.bin/netstat/route.c (props changed) stable/8/usr.bin/netstat/unix.c (props changed) stable/8/usr.bin/newgrp/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/su/Makefile (props changed) stable/8/usr.bin/su/su.1 (props changed) stable/8/usr.bin/su/su.c (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) Modified: stable/8/usr.bin/netstat/sctp.c ============================================================================== --- stable/8/usr.bin/netstat/sctp.c Sat Feb 11 01:13:35 2012 (r231500) +++ stable/8/usr.bin/netstat/sctp.c Sat Feb 11 01:15:02 2012 (r231501) @@ -611,7 +611,8 @@ sctp_stats(u_long off, const char *name, memset(&zerostat, 0, len); if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len, zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.sctp.stats"); + if (errno != ENOENT) + warn("sysctl: net.inet.sctp.stats"); return; } } else From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 01:17:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9665D106566C; Sat, 11 Feb 2012 01:17:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5F48FC08; Sat, 11 Feb 2012 01:17: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 q1B1HRLw006600; Sat, 11 Feb 2012 01:17:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B1HRVH006598; Sat, 11 Feb 2012 01:17:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110117.q1B1HRVH006598@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 01:17:27 +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: r231502 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 01:17:27 -0000 Author: tuexen Date: Sat Feb 11 01:17:27 2012 New Revision: 231502 URL: http://svn.freebsd.org/changeset/base/231502 Log: MFC r231074: Fix a typo which was already fixed by eadler in r227489. We missed to integrate this fix in our code base, so it was removed in r227755. Modified: stable/8/sys/netinet/sctp_structs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Sat Feb 11 01:15:02 2012 (r231501) +++ stable/8/sys/netinet/sctp_structs.h Sat Feb 11 01:17:27 2012 (r231502) @@ -414,7 +414,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used a a bit mask */ +/* The upper byte is used as a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 04:12:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EF6A106566C; Sat, 11 Feb 2012 04:12:12 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E15D8FC08; Sat, 11 Feb 2012 04:12: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 q1B4CC3g012557; Sat, 11 Feb 2012 04:12:12 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B4CCYf012555; Sat, 11 Feb 2012 04:12:12 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202110412.q1B4CCYf012555@svn.freebsd.org> From: David Xu Date: Sat, 11 Feb 2012 04:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231503 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 04:12:12 -0000 Author: davidxu Date: Sat Feb 11 04:12:12 2012 New Revision: 231503 URL: http://svn.freebsd.org/changeset/base/231503 Log: Make code more stable by checking NULL pointers. Modified: head/lib/libthr/thread/thr_list.c Modified: head/lib/libthr/thread/thr_list.c ============================================================================== --- head/lib/libthr/thread/thr_list.c Sat Feb 11 01:17:27 2012 (r231502) +++ head/lib/libthr/thread/thr_list.c Sat Feb 11 04:12:12 2012 (r231503) @@ -154,8 +154,12 @@ _thr_alloc(struct pthread *curthread) atomic_fetchadd_int(&total_threads, -1); return (NULL); } - thread->sleepqueue = _sleepq_alloc(); - thread->wake_addr = _thr_alloc_wake_addr(); + if ((thread->sleepqueue = _sleepq_alloc()) == NULL || + (thread->wake_addr = _thr_alloc_wake_addr()) == NULL) { + thr_destroy(curthread, thread); + atomic_fetchadd_int(&total_threads, -1); + return (NULL); + } } else { bzero(&thread->_pthread_startzero, __rangeof(struct pthread, _pthread_startzero, _pthread_endzero)); From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 04:52:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 801A6106566B; Sat, 11 Feb 2012 04:52:32 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 8CFBE8FC08; Sat, 11 Feb 2012 04:52:31 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so3504583wgb.31 for ; Fri, 10 Feb 2012 20:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=1YYr0EONly28Uf1/nT4TPXM+QwOSMK/EhrWuog8SRJw=; b=GsLPvS3ixxhAyKkhCHqJbGKmU2OmFwOQXDBac2GVCi8vGnrGZpcd4OnEWkoIyjfOPQ +7C7K6kGBNaQ0c+c7CeTsNSD/iliU75sSxDpekgh0WyhHnwtE3EpcjAJM6SNWPquGspA 8eItdmD7E7m0SdFWoCHS+oRN6IHJdEntIJrQs= Received: by 10.216.135.138 with SMTP id u10mr1763160wei.43.1328935950249; Fri, 10 Feb 2012 20:52:30 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.103.10 with HTTP; Fri, 10 Feb 2012 20:52:00 -0800 (PST) In-Reply-To: <201202102216.q1AMGI0m098192@svn.freebsd.org> References: <201202102216.q1AMGI0m098192@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 23:52:00 -0500 X-Google-Sender-Auth: iR4ff0MEQUSrgbEBA2KIUSBd-Ho Message-ID: To: Martin Cracauer Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQk8FL/RM5URDI6H31BCEqgcSvoPIGF25lbUwmqysrM0XRd/oBGp5nhYu3XMi0wAUcjG1b7e Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 04:52:32 -0000 On Fri, Feb 10, 2012 at 5:16 PM, Martin Cracauer wro= te: > Author: cracauer > Date: Fri Feb 10 22:16:17 2012 > New Revision: 231449 > URL: http://svn.freebsd.org/changeset/base/231449 > > Log: > =C2=A0Fix bin/164947: tee looses data when writing to non-blocking file d= escriptors > =C2=A0tee was not handling EAGAIN > =C2=A0patch submitted by Diomidis Spinellis . Thanks so much > =C2=A0reproduced and re-tested locally Can you please include the standard lines for the commit log (PR, Submitted by, etc). Some of us have scripts that depend on those fields. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 05:59:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DDD1106566C; Sat, 11 Feb 2012 05:59:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02C388FC17; Sat, 11 Feb 2012 05:59:55 +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 q1B5xsHv015851; Sat, 11 Feb 2012 05:59:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B5xsae015847; Sat, 11 Feb 2012 05:59:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110559.q1B5xsae015847@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 05:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231504 - in head: lib/libc/net sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 05:59:55 -0000 Author: bz Date: Sat Feb 11 05:59:54 2012 New Revision: 231504 URL: http://svn.freebsd.org/changeset/base/231504 Log: Backout changes from r228571. Remove if_data from struct ifa_msghdr again. While this breaks carp on HEAD temporary, it restores the upgrade path from stable, and head before 20111215. Reviewed by: glebius, brooks Modified: head/lib/libc/net/getifaddrs.c head/sys/net/if.h head/sys/net/rtsock.c Modified: head/lib/libc/net/getifaddrs.c ============================================================================== --- head/lib/libc/net/getifaddrs.c Sat Feb 11 04:12:12 2012 (r231503) +++ head/lib/libc/net/getifaddrs.c Sat Feb 11 05:59:54 2012 (r231504) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #define HAVE_IFM_DATA #endif -#if (_BSDI_VERSION >= 199802) || (__FreeBSD_version >= 1000003) +#if _BSDI_VERSION >= 199802 /* ifam_data is very specific to recent versions of bsdi */ #define HAVE_IFAM_DATA #endif Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Sat Feb 11 04:12:12 2012 (r231503) +++ head/sys/net/if.h Sat Feb 11 05:59:54 2012 (r231504) @@ -267,8 +267,6 @@ struct ifa_msghdr { int ifam_flags; /* value of ifa_flags */ u_short ifam_index; /* index for associated ifp */ int ifam_metric; /* value of ifa_metric */ - struct if_data ifam_data;/* statistics and other data about if or - * address */ }; /* Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Feb 11 04:12:12 2012 (r231503) +++ head/sys/net/rtsock.c Sat Feb 11 05:59:54 2012 (r231504) @@ -1606,10 +1606,6 @@ sysctl_iflist(int af, struct walkarg *w) ifam->ifam_flags = ifa->ifa_flags; ifam->ifam_metric = ifa->ifa_metric; ifam->ifam_addrs = info.rti_addrs; - ifam->ifam_data = ifa->if_data; - if (carp_get_vhid_p != NULL) - ifam->ifam_data.ifi_vhid = - (*carp_get_vhid_p)(ifa); error = SYSCTL_OUT(w->w_req, w->w_tmem, len); if (error) goto done; From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 06:02:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B1921065670; Sat, 11 Feb 2012 06:02:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58FE58FC14; Sat, 11 Feb 2012 06:02: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 q1B62HNa015990; Sat, 11 Feb 2012 06:02:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B62Hx2015984; Sat, 11 Feb 2012 06:02:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110602.q1B62Hx2015984@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 06:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231505 - in head: lib/libc/gen sys/net sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 06:02:17 -0000 Author: bz Date: Sat Feb 11 06:02:16 2012 New Revision: 231505 URL: http://svn.freebsd.org/changeset/base/231505 Log: Introduce a new NET_RT_IFLISTL API to query the address list. It works on extended and extensible structs if_msghdrl and ifa_msghdrl. This will allow us to extend both the msghdrl structs and eventually if_data in the future without breaking the ABI. Bump __FreeBSD_version to allow ports to more easily detect the new API. Reviewed by: glebius, brooks MFC after: 3 days Modified: head/lib/libc/gen/sysctl.3 head/sys/net/if.h head/sys/net/rtsock.c head/sys/sys/param.h head/sys/sys/socket.h Modified: head/lib/libc/gen/sysctl.3 ============================================================================== --- head/lib/libc/gen/sysctl.3 Sat Feb 11 05:59:54 2012 (r231504) +++ head/lib/libc/gen/sysctl.3 Sat Feb 11 06:02:16 2012 (r231505) @@ -28,7 +28,7 @@ .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 25, 2010 +.Dd February 11, 2012 .Dt SYSCTL 3 .Os .Sh NAME @@ -554,6 +554,7 @@ The fifth and sixth level names are as f .It "NET_RT_DUMP None" .It "NET_RT_IFLIST 0 or if_index" .It "NET_RT_IFMALIST 0 or if_index" +.It "NET_RT_IFLISTL 0 or if_index" .El .Pp The @@ -561,6 +562,19 @@ The name returns information about multicast group memberships on all interfaces if 0 is specified, or for the interface specified by .Va if_index . +.Pp +The +.Dv NET_RT_IFLISTL +is like +.Dv NET_RT_IFLIST , +just returning message header structs with additional fields allowing the +interface to be extended without breaking binary compatibility. +The +.Dv NET_RT_IFLISTL +uses 'l' versions of the message header structures: +.Va struct if_msghdrl +and +.Va struct ifa_msghdrl . .It Li PF_INET Get or set various global information about the IPv4 (Internet Protocol version 4). Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Sat Feb 11 05:59:54 2012 (r231504) +++ head/sys/net/if.h Sat Feb 11 06:02:16 2012 (r231505) @@ -244,6 +244,7 @@ struct if_data { /* * Message format for use in obtaining information about interfaces * from getkerninfo and the routing socket + * For the new, extensible interface see struct if_msghdrl below. */ struct if_msghdr { u_short ifm_msglen; /* to skip over non-understood messages */ @@ -256,8 +257,34 @@ struct if_msghdr { }; /* + * The 'l' version shall be used by new interfaces, like NET_RT_IFLISTL. It is + * extensible after ifm_data_off or within ifm_data. Both the if_msghdr and + * if_data now have a member field detailing the struct length in addition to + * the routing message length. Macros are provided to find the start of + * ifm_data and the start of the socket address strucutres immediately following + * struct if_msghdrl given a pointer to struct if_msghdrl. + */ +#define IF_MSGHDRL_IFM_DATA(_l) \ + (struct if_data *)((char *)(_l) + (_l)->ifm_data_off) +#define IF_MSGHDRL_RTA(_l) \ + (void *)((uintptr_t)(_l) + (_l)->ifm_len) +struct if_msghdrl { + u_short ifm_msglen; /* to skip over non-understood messages */ + u_char ifm_version; /* future binary compatibility */ + u_char ifm_type; /* message type */ + int ifm_addrs; /* like rtm_addrs */ + int ifm_flags; /* value of if_flags */ + u_short ifm_index; /* index for associated ifp */ + u_short _ifm_spare1; /* spare space to grow if_index, see if_var.h */ + u_short ifm_len; /* length of if_msghdrl incl. if_data */ + u_short ifm_data_off; /* offset of if_data from beginning */ + struct if_data ifm_data;/* statistics and other data about if */ +}; + +/* * Message format for use in obtaining information about interface addresses * from getkerninfo and the routing socket + * For the new, extensible interface see struct ifa_msghdrl below. */ struct ifa_msghdr { u_short ifam_msglen; /* to skip over non-understood messages */ @@ -270,6 +297,33 @@ struct ifa_msghdr { }; /* + * The 'l' version shall be used by new interfaces, like NET_RT_IFLISTL. It is + * extensible after ifam_metric or within ifam_data. Both the ifa_msghdrl and + * if_data now have a member field detailing the struct length in addition to + * the routing message length. Macros are provided to find the start of + * ifm_data and the start of the socket address strucutres immediately following + * struct ifa_msghdrl given a pointer to struct ifa_msghdrl. + */ +#define IFA_MSGHDRL_IFAM_DATA(_l) \ + (struct if_data *)((char *)(_l) + (_l)->ifam_data_off) +#define IFA_MSGHDRL_RTA(_l) \ + (void *)((uintptr_t)(_l) + (_l)->ifam_len) +struct ifa_msghdrl { + u_short ifam_msglen; /* to skip over non-understood messages */ + u_char ifam_version; /* future binary compatibility */ + u_char ifam_type; /* message type */ + int ifam_addrs; /* like rtm_addrs */ + int ifam_flags; /* value of ifa_flags */ + u_short ifam_index; /* index for associated ifp */ + u_short _ifam_spare1; /* spare space to grow if_index, see if_var.h */ + u_short ifam_len; /* length of ifa_msghdrl incl. if_data */ + u_short ifam_data_off; /* offset of if_data from beginning */ + int ifam_metric; /* value of ifa_metric */ + struct if_data ifam_data;/* statistics and other data about if or + * address */ +}; + +/* * Message format for use in obtaining information about multicast addresses * from the routing socket */ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Feb 11 05:59:54 2012 (r231504) +++ head/sys/net/rtsock.c Sat Feb 11 06:02:16 2012 (r231505) @@ -115,7 +115,34 @@ struct if_msghdr32 { uint16_t ifm_index; struct if_data32 ifm_data; }; -#endif + +struct if_msghdrl32 { + uint16_t ifm_msglen; + uint8_t ifm_version; + uint8_t ifm_type; + int32_t ifm_addrs; + int32_t ifm_flags; + uint16_t ifm_index; + uint16_t _ifm_spare1; + uint16_t ifm_len; + uint16_t ifm_data_off; + struct if_data32 ifm_data; +}; + +struct ifa_msghdrl32 { + uint16_t ifam_msglen; + uint8_t ifam_version; + uint8_t ifam_type; + int32_t ifam_addrs; + int32_t ifam_flags; + uint16_t ifam_index; + uint16_t _ifam_spare1; + uint16_t ifam_len; + uint16_t ifam_data_off; + int32_t ifam_metric; + struct if_data32 ifam_data; +}; +#endif /* COMPAT_FREEBSD32 */ MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); @@ -1014,6 +1041,9 @@ rt_xaddrs(caddr_t cp, caddr_t cplim, str return (0); } +/* + * Used by the routing socket. + */ static struct mbuf * rt_msg1(int type, struct rt_addrinfo *rtinfo) { @@ -1081,6 +1111,9 @@ rt_msg1(int type, struct rt_addrinfo *rt return (m); } +/* + * Used by the sysctl code and routing socket. + */ static int rt_msg2(int type, struct rt_addrinfo *rtinfo, caddr_t cp, struct walkarg *w) { @@ -1094,17 +1127,31 @@ again: case RTM_DELADDR: case RTM_NEWADDR: - len = sizeof(struct ifa_msghdr); + if (w != NULL && w->w_op == NET_RT_IFLISTL) { +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) + len = sizeof(struct ifa_msghdrl32); + else +#endif + len = sizeof(struct ifa_msghdrl); + } else + len = sizeof(struct ifa_msghdr); break; case RTM_IFINFO: #ifdef COMPAT_FREEBSD32 if (w != NULL && w->w_req->flags & SCTL_MASK32) { - len = sizeof(struct if_msghdr32); + if (w->w_op == NET_RT_IFLISTL) + len = sizeof(struct if_msghdrl32); + else + len = sizeof(struct if_msghdr32); break; } #endif - len = sizeof(struct if_msghdr); + if (w != NULL && w->w_op == NET_RT_IFLISTL) + len = sizeof(struct if_msghdrl); + else + len = sizeof(struct if_msghdr); break; case RTM_NEWMADDR: @@ -1535,6 +1582,147 @@ copy_ifdata32(struct if_data *src, struc #endif static int +sysctl_iflist_ifml(struct ifnet *ifp, struct rt_addrinfo *info, + struct walkarg *w, int len) +{ + struct if_msghdrl *ifm; + +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) { + struct if_msghdrl32 *ifm32; + + ifm32 = (struct if_msghdrl32 *)w->w_tmem; + ifm32->ifm_addrs = info->rti_addrs; + ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm32->ifm_index = ifp->if_index; + ifm32->_ifm_spare1 = 0; + ifm32->ifm_len = sizeof(*ifm32); + ifm32->ifm_data_off = offsetof(struct if_msghdrl32, ifm_data); + + copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifm32->ifm_data.ifi_vhid = + (*carp_get_vhid_p)(ifp->if_addr); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm32, len)); + } +#endif + ifm = (struct if_msghdrl *)w->w_tmem; + ifm->ifm_addrs = info->rti_addrs; + ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm->ifm_index = ifp->if_index; + ifm->_ifm_spare1 = 0; + ifm->ifm_len = sizeof(*ifm); + ifm->ifm_data_off = offsetof(struct if_msghdrl, ifm_data); + + ifm->ifm_data = ifp->if_data; + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifm->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); +} + +static int +sysctl_iflist_ifm(struct ifnet *ifp, struct rt_addrinfo *info, + struct walkarg *w, int len) +{ + struct if_msghdr *ifm; + +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) { + struct if_msghdr32 *ifm32; + + ifm32 = (struct if_msghdr32 *)w->w_tmem; + ifm32->ifm_addrs = info->rti_addrs; + ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm32->ifm_index = ifp->if_index; + + copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifm32->ifm_data.ifi_vhid = + (*carp_get_vhid_p)(ifp->if_addr); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm32, len)); + } +#endif + ifm = (struct if_msghdr *)w->w_tmem; + ifm->ifm_addrs = info->rti_addrs; + ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm->ifm_index = ifp->if_index; + + ifm->ifm_data = ifp->if_data; + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifm->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); +} + +static int +sysctl_iflist_ifaml(struct ifaddr *ifa, struct rt_addrinfo *info, + struct walkarg *w, int len) +{ + struct ifa_msghdrl *ifam; + +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) { + struct ifa_msghdrl32 *ifam32; + + ifam32 = (struct ifa_msghdrl32 *)w->w_tmem; + ifam32->ifam_addrs = info->rti_addrs; + ifam32->ifam_flags = ifa->ifa_flags; + ifam32->ifam_index = ifa->ifa_ifp->if_index; + ifam32->_ifam_spare1 = 0; + ifam32->ifam_len = sizeof(*ifam32); + ifam32->ifam_data_off = + offsetof(struct ifa_msghdrl32, ifam_data); + ifam32->ifam_metric = ifa->ifa_metric; + + copy_ifdata32(&ifa->ifa_ifp->if_data, &ifam32->ifam_data); + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifam32->ifam_data.ifi_vhid = (*carp_get_vhid_p)(ifa); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifam32, len)); + } +#endif + + ifam = (struct ifa_msghdrl *)w->w_tmem; + ifam->ifam_addrs = info->rti_addrs; + ifam->ifam_flags = ifa->ifa_flags; + ifam->ifam_index = ifa->ifa_ifp->if_index; + ifam->_ifam_spare1 = 0; + ifam->ifam_len = sizeof(*ifam); + ifam->ifam_data_off = offsetof(struct ifa_msghdrl, ifam_data); + ifam->ifam_metric = ifa->ifa_metric; + + ifam->ifam_data = ifa->if_data; + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifam->ifam_data.ifi_vhid = (*carp_get_vhid_p)(ifa); + + return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); +} + +static int +sysctl_iflist_ifam(struct ifaddr *ifa, struct rt_addrinfo *info, + struct walkarg *w, int len) +{ + struct ifa_msghdr *ifam; + + ifam = (struct ifa_msghdr *)w->w_tmem; + ifam->ifam_addrs = info->rti_addrs; + ifam->ifam_flags = ifa->ifa_flags; + ifam->ifam_index = ifa->ifa_ifp->if_index; + ifam->ifam_metric = ifa->ifa_metric; + + return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); +} + +static int sysctl_iflist(int af, struct walkarg *w) { struct ifnet *ifp; @@ -1553,38 +1741,10 @@ sysctl_iflist(int af, struct walkarg *w) len = rt_msg2(RTM_IFINFO, &info, NULL, w); info.rti_info[RTAX_IFP] = NULL; if (w->w_req && w->w_tmem) { - struct if_msghdr *ifm; - -#ifdef COMPAT_FREEBSD32 - if (w->w_req->flags & SCTL_MASK32) { - struct if_msghdr32 *ifm32; - - ifm32 = (struct if_msghdr32 *)w->w_tmem; - ifm32->ifm_index = ifp->if_index; - ifm32->ifm_flags = ifp->if_flags | - ifp->if_drv_flags; - copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); - if (carp_get_vhid_p != NULL) - ifm32->ifm_data.ifi_vhid = - (*carp_get_vhid_p)(ifa); - ifm32->ifm_addrs = info.rti_addrs; - error = SYSCTL_OUT(w->w_req, (caddr_t)ifm32, - len); - goto sysctl_out; - } -#endif - ifm = (struct if_msghdr *)w->w_tmem; - ifm->ifm_index = ifp->if_index; - ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; - ifm->ifm_data = ifp->if_data; - if (carp_get_vhid_p != NULL) - ifm->ifm_data.ifi_vhid = - (*carp_get_vhid_p)(ifa); - ifm->ifm_addrs = info.rti_addrs; - error = SYSCTL_OUT(w->w_req, (caddr_t)ifm, len); -#ifdef COMPAT_FREEBSD32 - sysctl_out: -#endif + if (w->w_op == NET_RT_IFLISTL) + error = sysctl_iflist_ifml(ifp, &info, w, len); + else + error = sysctl_iflist_ifm(ifp, &info, w, len); if (error) goto done; } @@ -1599,14 +1759,12 @@ sysctl_iflist(int af, struct walkarg *w) info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr; len = rt_msg2(RTM_NEWADDR, &info, NULL, w); if (w->w_req && w->w_tmem) { - struct ifa_msghdr *ifam; - - ifam = (struct ifa_msghdr *)w->w_tmem; - ifam->ifam_index = ifa->ifa_ifp->if_index; - ifam->ifam_flags = ifa->ifa_flags; - ifam->ifam_metric = ifa->ifa_metric; - ifam->ifam_addrs = info.rti_addrs; - error = SYSCTL_OUT(w->w_req, w->w_tmem, len); + if (w->w_op == NET_RT_IFLISTL) + error = sysctl_iflist_ifaml(ifa, &info, + w, len); + else + error = sysctl_iflist_ifam(ifa, &info, + w, len); if (error) goto done; } @@ -1736,6 +1894,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) break; case NET_RT_IFLIST: + case NET_RT_IFLISTL: error = sysctl_iflist(af, &w); break; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Feb 11 05:59:54 2012 (r231504) +++ head/sys/sys/param.h Sat Feb 11 06:02:16 2012 (r231505) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000007 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000008 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Sat Feb 11 05:59:54 2012 (r231504) +++ head/sys/sys/socket.h Sat Feb 11 06:02:16 2012 (r231505) @@ -396,7 +396,9 @@ struct sockproto { #define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */ #define NET_RT_IFLIST 3 /* survey interface list */ #define NET_RT_IFMALIST 4 /* return multicast address list */ -#define NET_RT_MAXID 5 +#define NET_RT_IFLISTL 5 /* Survey interface list, using 'l'en + * versions of msghdr structs. */ +#define NET_RT_MAXID 6 #define CTL_NET_RT_NAMES { \ { 0, 0 }, \ @@ -404,6 +406,7 @@ struct sockproto { { "flags", CTLTYPE_STRUCT }, \ { "iflist", CTLTYPE_STRUCT }, \ { "ifmalist", CTLTYPE_STRUCT }, \ + { "iflist2", CTLTYPE_STRUCT }, \ } #endif /* __BSD_VISIBLE */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 06:05:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BECC106564A; Sat, 11 Feb 2012 06:05:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AAAF8FC12; Sat, 11 Feb 2012 06:05:41 +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 q1B65eoZ016122; Sat, 11 Feb 2012 06:05:40 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B65e8h016119; Sat, 11 Feb 2012 06:05:40 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110605.q1B65e8h016119@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 06:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231506 - in head: . lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 06:05:41 -0000 Author: bz Date: Sat Feb 11 06:05:40 2012 New Revision: 231506 URL: http://svn.freebsd.org/changeset/base/231506 Log: Switch getifaddrs(3) to the new API introduced in r231505. Also remove conditional code parts not used by or applicable to FreeBSD. The new implementation is supposed to be able to cope with changes to the 'l' versions of the msghdr structs now used as well as to if_data allowing future changes without breaking things. This restores carp(4) config support in HEAD after r231504. Reviewed by: glebius, brooks MFC After: 3 months Modified: head/UPDATING head/lib/libc/net/getifaddrs.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Feb 11 06:02:16 2012 (r231505) +++ head/UPDATING Sat Feb 11 06:05:40 2012 (r231506) @@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20120211: + The getifaddrs upgrade path broken with 20111215 has been restored. + If you have upgraded in between 20111215 and 20120209 you need to + recompile libc again with your kernel. You still need to recompile + world to be able to configure CARP but this restriction already + comes from 20111215. + 20120114: The set_rcvar() function has been removed from /etc/rc.subr. All base and ports rc.d scripts have been updated, so if you have a Modified: head/lib/libc/net/getifaddrs.c ============================================================================== --- head/lib/libc/net/getifaddrs.c Sat Feb 11 06:02:16 2012 (r231505) +++ head/lib/libc/net/getifaddrs.c Sat Feb 11 06:05:40 2012 (r231506) @@ -72,19 +72,6 @@ __FBSDID("$FreeBSD$"); #define ALIGN(p) (((u_long)(p) + ALIGNBYTES) &~ ALIGNBYTES) #endif -#if _BSDI_VERSION >= 199701 -#define HAVE_IFM_DATA -#endif - -#if _BSDI_VERSION >= 199802 -/* ifam_data is very specific to recent versions of bsdi */ -#define HAVE_IFAM_DATA -#endif - -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) -#define HAVE_IFM_DATA -#endif - #define MAX_SYSCTL_TRY 5 int @@ -93,7 +80,6 @@ getifaddrs(struct ifaddrs **pif) int icnt = 1; int dcnt = 0; int ncnt = 0; -#ifdef NET_RT_IFLIST int ntry = 0; int mib[6]; size_t needed; @@ -102,30 +88,23 @@ getifaddrs(struct ifaddrs **pif) struct ifaddrs *cif = 0; char *p, *p0; struct rt_msghdr *rtm; - struct if_msghdr *ifm; - struct ifa_msghdr *ifam; + struct if_msghdrl *ifm; + struct ifa_msghdrl *ifam; struct sockaddr_dl *dl; struct sockaddr *sa; struct ifaddrs *ifa, *ift; + struct if_data *if_data; u_short idx = 0; -#else /* NET_RT_IFLIST */ - char buf[1024]; - int m, sock; - struct ifconf ifc; - struct ifreq *ifr; - struct ifreq *lifr; -#endif /* NET_RT_IFLIST */ int i; size_t len, alen; char *data; char *names; -#ifdef NET_RT_IFLIST mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; /* protocol */ mib[3] = 0; /* wildcard address family */ - mib[4] = NET_RT_IFLIST; + mib[4] = NET_RT_IFLISTL;/* extra fields for extensible msghdr structs */ mib[5] = 0; /* no flags */ do { /* @@ -159,34 +138,33 @@ getifaddrs(struct ifaddrs **pif) continue; switch (rtm->rtm_type) { case RTM_IFINFO: - ifm = (struct if_msghdr *)(void *)rtm; + ifm = (struct if_msghdrl *)(void *)rtm; if (ifm->ifm_addrs & RTA_IFP) { idx = ifm->ifm_index; ++icnt; - dl = (struct sockaddr_dl *)(void *)(ifm + 1); + if_data = IF_MSGHDRL_IFM_DATA(ifm); + dcnt += if_data->ifi_datalen; + dl = (struct sockaddr_dl *)IF_MSGHDRL_RTA(ifm); dcnt += SA_RLEN((struct sockaddr *)(void*)dl) + ALIGNBYTES; -#ifdef HAVE_IFM_DATA - dcnt += sizeof(ifm->ifm_data); -#endif /* HAVE_IFM_DATA */ ncnt += dl->sdl_nlen + 1; } else idx = 0; break; case RTM_NEWADDR: - ifam = (struct ifa_msghdr *)(void *)rtm; + ifam = (struct ifa_msghdrl *)(void *)rtm; if (idx && ifam->ifam_index != idx) abort(); /* this cannot happen */ #define RTA_MASKS (RTA_NETMASK | RTA_IFA | RTA_BRD) if (idx == 0 || (ifam->ifam_addrs & RTA_MASKS) == 0) break; - p = (char *)(void *)(ifam + 1); + p = (char *)IFA_MSGHDRL_RTA(ifam); ++icnt; -#ifdef HAVE_IFAM_DATA - dcnt += sizeof(ifam->ifam_data) + ALIGNBYTES; -#endif /* HAVE_IFAM_DATA */ + if_data = IFA_MSGHDRL_IFAM_DATA(ifam); + dcnt += if_data->ifi_datalen + ALIGNBYTES; + /* Scan to look for length of address */ alen = 0; for (p0 = p, i = 0; i < RTAX_MAX; i++) { @@ -216,34 +194,6 @@ getifaddrs(struct ifaddrs **pif) break; } } -#else /* NET_RT_IFLIST */ - ifc.ifc_buf = buf; - ifc.ifc_len = sizeof(buf); - - if ((sock = _socket(AF_INET, SOCK_STREAM, 0)) < 0) - return (-1); - i = _ioctl(sock, SIOCGIFCONF, (char *)&ifc); - _close(sock); - if (i < 0) - return (-1); - - ifr = ifc.ifc_req; - lifr = (struct ifreq *)&ifc.ifc_buf[ifc.ifc_len]; - - while (ifr < lifr) { - struct sockaddr *sa; - - sa = &ifr->ifr_addr; - ++icnt; - dcnt += SA_RLEN(sa); - ncnt += sizeof(ifr->ifr_name) + 1; - - if (SA_LEN(sa) < sizeof(*sa)) - ifr = (struct ifreq *)(((char *)sa) + sizeof(*sa)); - else - ifr = (struct ifreq *)(((char *)sa) + SA_LEN(sa)); - } -#endif /* NET_RT_IFLIST */ if (icnt + dcnt + ncnt == 1) { *pif = NULL; @@ -263,7 +213,6 @@ getifaddrs(struct ifaddrs **pif) memset(ifa, 0, sizeof(struct ifaddrs) * icnt); ift = ifa; -#ifdef NET_RT_IFLIST idx = 0; for (next = buf; next < buf + needed; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; @@ -271,41 +220,38 @@ getifaddrs(struct ifaddrs **pif) continue; switch (rtm->rtm_type) { case RTM_IFINFO: - ifm = (struct if_msghdr *)(void *)rtm; - if (ifm->ifm_addrs & RTA_IFP) { - idx = ifm->ifm_index; - dl = (struct sockaddr_dl *)(void *)(ifm + 1); + ifm = (struct if_msghdrl *)(void *)rtm; + if ((ifm->ifm_addrs & RTA_IFP) == 0) { + idx = 0; + break; + } - cif = ift; - ift->ifa_name = names; - ift->ifa_flags = (int)ifm->ifm_flags; - memcpy(names, dl->sdl_data, - (size_t)dl->sdl_nlen); - names[dl->sdl_nlen] = 0; - names += dl->sdl_nlen + 1; - - ift->ifa_addr = (struct sockaddr *)(void *)data; - memcpy(data, dl, - (size_t)SA_LEN((struct sockaddr *) - (void *)dl)); - data += SA_RLEN((struct sockaddr *)(void *)dl); - -#ifdef HAVE_IFM_DATA - /* ifm_data needs to be aligned */ - ift->ifa_data = data = (void *)ALIGN(data); - memcpy(data, &ifm->ifm_data, sizeof(ifm->ifm_data)); - data += sizeof(ifm->ifm_data); -#else /* HAVE_IFM_DATA */ - ift->ifa_data = NULL; -#endif /* HAVE_IFM_DATA */ + idx = ifm->ifm_index; + dl = (struct sockaddr_dl *)IF_MSGHDRL_RTA(ifm); - ift = (ift->ifa_next = ift + 1); - } else - idx = 0; + cif = ift; + ift->ifa_name = names; + ift->ifa_flags = (int)ifm->ifm_flags; + memcpy(names, dl->sdl_data, (size_t)dl->sdl_nlen); + names[dl->sdl_nlen] = 0; + names += dl->sdl_nlen + 1; + + ift->ifa_addr = (struct sockaddr *)(void *)data; + memcpy(data, dl, (size_t)SA_LEN((struct sockaddr *) + (void *)dl)); + data += SA_RLEN((struct sockaddr *)(void *)dl); + + if_data = IF_MSGHDRL_IFM_DATA(ifm); + /* ifm_data needs to be aligned */ + ift->ifa_data = data = (void *)ALIGN(data); + memcpy(data, if_data, if_data->ifi_datalen); + data += if_data->ifi_datalen; + + ift = (ift->ifa_next = ift + 1); break; case RTM_NEWADDR: - ifam = (struct ifa_msghdr *)(void *)rtm; + ifam = (struct ifa_msghdrl *)(void *)rtm; if (idx && ifam->ifam_index != idx) abort(); /* this cannot happen */ @@ -314,7 +260,8 @@ getifaddrs(struct ifaddrs **pif) ift->ifa_name = cif->ifa_name; ift->ifa_flags = cif->ifa_flags; ift->ifa_data = NULL; - p = (char *)(void *)(ifam + 1); + + p = (char *)IFA_MSGHDRL_RTA(ifam); /* Scan to look for length of address */ alen = 0; for (p0 = p, i = 0; i < RTAX_MAX; i++) { @@ -365,12 +312,11 @@ getifaddrs(struct ifaddrs **pif) p += len; } -#ifdef HAVE_IFAM_DATA + if_data = IFA_MSGHDRL_IFAM_DATA(ifam); /* ifam_data needs to be aligned */ ift->ifa_data = data = (void *)ALIGN(data); - memcpy(data, &ifam->ifam_data, sizeof(ifam->ifam_data)); - data += sizeof(ifam->ifam_data); -#endif /* HAVE_IFAM_DATA */ + memcpy(data, if_data, if_data->ifi_datalen); + data += if_data->ifi_datalen; ift = (ift->ifa_next = ift + 1); break; @@ -378,28 +324,7 @@ getifaddrs(struct ifaddrs **pif) } free(buf); -#else /* NET_RT_IFLIST */ - ifr = ifc.ifc_req; - lifr = (struct ifreq *)&ifc.ifc_buf[ifc.ifc_len]; - - while (ifr < lifr) { - struct sockaddr *sa; - - ift->ifa_name = names; - names[sizeof(ifr->ifr_name)] = 0; - strncpy(names, ifr->ifr_name, sizeof(ifr->ifr_name)); - while (*names++) - ; - - ift->ifa_addr = (struct sockaddr *)data; - sa = &ifr->ifr_addr; - memcpy(data, sa, SA_LEN(sa)); - data += SA_RLEN(sa); - - ifr = (struct ifreq *)(((char *)sa) + SA_LEN(sa)); - ift = (ift->ifa_next = ift + 1); - } -#endif /* NET_RT_IFLIST */ + if (--ift >= ifa) { ift->ifa_next = NULL; *pif = ifa; From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 06:21:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E64A1065672; Sat, 11 Feb 2012 06:21:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D9298FC0A; Sat, 11 Feb 2012 06:21: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 q1B6LH9o016633; Sat, 11 Feb 2012 06:21:17 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B6LHMU016630; Sat, 11 Feb 2012 06:21:17 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202110621.q1B6LHMU016630@svn.freebsd.org> From: Doug Barton Date: Sat, 11 Feb 2012 06:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231507 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 06:21:17 -0000 Author: dougb Date: Sat Feb 11 06:21:16 2012 New Revision: 231507 URL: http://svn.freebsd.org/changeset/base/231507 Log: In the days before r208307 addswap was running early in the second stage of rcorder. Somehow in the intervening period addswap got moved to the very end, which is almost certainly not what we want. This change moves it to right after kld so that for users who need it, they'll get it ASAP. Modified: head/etc/rc.d/addswap head/etc/rc.d/var Modified: head/etc/rc.d/addswap ============================================================================== --- head/etc/rc.d/addswap Sat Feb 11 06:05:40 2012 (r231506) +++ head/etc/rc.d/addswap Sat Feb 11 06:21:16 2012 (r231507) @@ -6,7 +6,7 @@ # # PROVIDE: addswap -# REQUIRE: FILESYSTEMS +# REQUIRE: FILESYSTEMS kld # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/var ============================================================================== --- head/etc/rc.d/var Sat Feb 11 06:05:40 2012 (r231506) +++ head/etc/rc.d/var Sat Feb 11 06:21:16 2012 (r231507) @@ -28,7 +28,7 @@ # # PROVIDE: var -# REQUIRE: FILESYSTEMS kld +# REQUIRE: FILESYSTEMS kld addswap . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 07:43:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC1B8106566C; Sat, 11 Feb 2012 07:43:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB3438FC0A; Sat, 11 Feb 2012 07:43:33 +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 q1B7hXpL019217; Sat, 11 Feb 2012 07:43:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B7hXoq019215; Sat, 11 Feb 2012 07:43:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110743.q1B7hXoq019215@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 07:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231508 - head/sys/dev/oce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 07:43:33 -0000 Author: bz Date: Sat Feb 11 07:43:33 2012 New Revision: 231508 URL: http://svn.freebsd.org/changeset/base/231508 Log: Make use of the read-only variant of the IF_ADDR_*LOCK() macros introduced in r229614 rather than the compat one. Modified: head/sys/dev/oce/oce_hw.c Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Sat Feb 11 06:21:16 2012 (r231507) +++ head/sys/dev/oce/oce_hw.c Sat Feb 11 07:43:33 2012 (r231508) @@ -558,7 +558,7 @@ oce_hw_update_multicast(POCE_SOFTC sc) bzero(req, sizeof(struct mbx_set_common_iface_multicast)); #if __FreeBSD_version > 800000 - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); #endif TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -578,7 +578,7 @@ oce_hw_update_multicast(POCE_SOFTC sc) req->params.req.num_mac = req->params.req.num_mac + 1; } #if __FreeBSD_version > 800000 -IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); #endif req->params.req.if_id = sc->if_id; rc = oce_update_multicast(sc, &dma); From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 07:47:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 690C91065670; Sat, 11 Feb 2012 07:47:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 584C68FC08; Sat, 11 Feb 2012 07:47: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 q1B7l7vU019378; Sat, 11 Feb 2012 07:47:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B7l7ga019376; Sat, 11 Feb 2012 07:47:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110747.q1B7l7ga019376@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 07:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231509 - head/sys/dev/oce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 07:47:07 -0000 Author: bz Date: Sat Feb 11 07:47:06 2012 New Revision: 231509 URL: http://svn.freebsd.org/changeset/base/231509 Log: Use the more common macro to set the if_baudrate to 10Gbit/s. Just use UL not ULL, which should make 32bit archs more happy. Modified: head/sys/dev/oce/oce_if.c Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Sat Feb 11 07:43:33 2012 (r231508) +++ head/sys/dev/oce/oce_if.c Sat Feb 11 07:47:06 2012 (r231509) @@ -1644,7 +1644,7 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_capabilities |= IFCAP_LRO; sc->ifp->if_capenable = sc->ifp->if_capabilities; - sc->ifp->if_baudrate = IF_Mbps(10000ULL); + sc->ifp->if_baudrate = IF_Gbps(10UL); ether_ifattach(sc->ifp, sc->macaddr.mac_addr); From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 08:12:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35DDD106566B; Sat, 11 Feb 2012 08:12:53 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24E908FC17; Sat, 11 Feb 2012 08:12: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 q1B8CqVO020286; Sat, 11 Feb 2012 08:12:52 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B8CqfY020283; Sat, 11 Feb 2012 08:12:52 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202110812.q1B8CqfY020283@svn.freebsd.org> From: Kevin Lo Date: Sat, 11 Feb 2012 08:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231510 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 08:12:53 -0000 Author: kevlo Date: Sat Feb 11 08:12:52 2012 New Revision: 231510 URL: http://svn.freebsd.org/changeset/base/231510 Log: Remove unused variable mii Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Sat Feb 11 07:47:06 2012 (r231509) +++ head/sys/dev/vge/if_vge.c Sat Feb 11 08:12:52 2012 (r231510) @@ -2022,11 +2022,9 @@ static void vge_init_locked(struct vge_softc *sc) { struct ifnet *ifp = sc->vge_ifp; - struct mii_data *mii; int error, i; VGE_LOCK_ASSERT(sc); - mii = device_get_softc(sc->vge_miibus); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 08:33:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C502106564A; Sat, 11 Feb 2012 08:33:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6ACD18FC14; Sat, 11 Feb 2012 08:33: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 q1B8XrW1021029; Sat, 11 Feb 2012 08:33:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B8XrtA021027; Sat, 11 Feb 2012 08:33:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110833.q1B8XrtA021027@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 08:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231511 - head/sys/dev/oce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 08:33:53 -0000 Author: bz Date: Sat Feb 11 08:33:52 2012 New Revision: 231511 URL: http://svn.freebsd.org/changeset/base/231511 Log: Start to try to hide LRO (and some TSO) bits behind #ifdefs as especially the symbols are not there when compiling a kernel without IP support and we do have users doing so. Modified: head/sys/dev/oce/oce_if.c Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Sat Feb 11 08:12:52 2012 (r231510) +++ head/sys/dev/oce/oce_if.c Sat Feb 11 08:33:52 2012 (r231511) @@ -39,6 +39,9 @@ /* $FreeBSD$ */ +#include "opt_inet6.h" +#include "opt_inet.h" + #include "oce_if.h" @@ -68,8 +71,10 @@ static int oce_tx(POCE_SOFTC sc, struct static void oce_tx_restart(POCE_SOFTC sc, struct oce_wq *wq); static void oce_tx_complete(struct oce_wq *wq, uint32_t wqe_idx, uint32_t status); +#if defined(INET6) || defined(INET) static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, uint16_t *mss); +#endif static int oce_multiq_transmit(struct ifnet *ifp, struct mbuf *m, struct oce_wq *wq); @@ -77,7 +82,9 @@ static int oce_multiq_transmit(struct i static void oce_discard_rx_comp(struct oce_rq *rq, struct oce_nic_rx_cqe *cqe); static int oce_cqe_vtp_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); static int oce_cqe_portid_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); +#if defined(INET6) || defined(INET) static void oce_rx_flush_lro(struct oce_rq *rq); +#endif static void oce_rx(struct oce_rq *rq, uint32_t rqe_idx, struct oce_nic_rx_cqe *cqe); @@ -89,7 +96,9 @@ static int oce_vid_config(POCE_SOFTC sc static void oce_mac_addr_set(POCE_SOFTC sc); static int oce_handle_passthrough(struct ifnet *ifp, caddr_t data); static void oce_local_timer(void *arg); +#if defined(INET6) || defined(INET) static int oce_init_lro(POCE_SOFTC sc); +#endif static void oce_if_deactivate(POCE_SOFTC sc); static void oce_if_activate(POCE_SOFTC sc); static void setup_max_queues_want(POCE_SOFTC sc); @@ -238,9 +247,11 @@ oce_attach(device_t dev) goto queues_free; +#if defined(INET6) || defined(INET) rc = oce_init_lro(sc); if (rc) goto ifp_free; +#endif rc = oce_hw_start(sc); @@ -277,8 +288,10 @@ vlan_free: EVENTHANDLER_DEREGISTER(vlan_unconfig, sc->vlan_detach); oce_hw_intr_disable(sc); lro_free: +#if defined(INET6) || defined(INET) oce_free_lro(sc); ifp_free: +#endif ether_ifdetach(sc->ifp); if_free(sc->ifp); queues_free: @@ -462,8 +475,10 @@ oce_ioctl(struct ifnet *ifp, u_long comm oce_vid_config(sc); } +#if defined(INET6) || defined(INET) if (u & IFCAP_LRO) ifp->if_capenable ^= IFCAP_LRO; +#endif break; @@ -798,7 +813,9 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, struct oce_nic_frag_wqe *nicfrag; int num_wqes; uint32_t reg_value; +#if defined(INET6) || defined(INET) uint16_t mss = 0; +#endif m = *mpp; if (!m) @@ -810,8 +827,12 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, } if (m->m_pkthdr.csum_flags & CSUM_TSO) { +#if defined(INET6) || defined(INET) /* consolidate packet buffers for TSO/LSO segment offload */ m = oce_tso_setup(sc, mpp, &mss); +#else + m = NULL; +#endif if (m == NULL) { rc = ENXIO; goto free_ret; @@ -991,17 +1012,22 @@ oce_tx_restart(POCE_SOFTC sc, struct oce } - +#if defined(INET6) || defined(INET) static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, uint16_t *mss) { struct mbuf *m; +#ifdef INET struct ip *ip; +#endif +#ifdef INET6 struct ip6_hdr *ip6; +#endif struct ether_vlan_header *eh; struct tcphdr *th; + int total_len = 0; uint16_t etype; - int total_len = 0, ehdrlen = 0; + int ehdrlen = 0; m = *mpp; *mss = m->m_pkthdr.tso_segsz; @@ -1025,6 +1051,7 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf switch (etype) { +#ifdef INET case ETHERTYPE_IP: ip = (struct ip *)(m->m_data + ehdrlen); if (ip->ip_p != IPPROTO_TCP) @@ -1033,6 +1060,8 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf total_len = ehdrlen + (ip->ip_hl << 2) + (th->th_off << 2); break; +#endif +#ifdef INET6 case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(m->m_data + ehdrlen); if (ip6->ip6_nxt != IPPROTO_TCP) @@ -1041,6 +1070,7 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf total_len = ehdrlen + sizeof(struct ip6_hdr) + (th->th_off << 2); break; +#endif default: return NULL; } @@ -1052,6 +1082,7 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf return m; } +#endif /* INET6 || INET */ void @@ -1305,6 +1336,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i } sc->ifp->if_ipackets++; +#if defined(INET6) || defined(INET) /* Try to queue to LRO */ if (IF_LRO_ENABLED(sc) && !(m->m_flags & M_VLANTAG) && @@ -1319,9 +1351,12 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i } /* If LRO posting fails then try to post to STACK */ } +#endif (*sc->ifp->if_input) (sc->ifp, m); +#if defined(INET6) || defined(INET) post_done: +#endif /* Update rx stats per queue */ rq->rx_stats.rx_pkts++; rq->rx_stats.rx_bytes += cqe->u0.s.pkt_size; @@ -1408,6 +1443,7 @@ oce_cqe_portid_valid(POCE_SOFTC sc, stru } +#if defined(INET6) || defined(INET) static void oce_rx_flush_lro(struct oce_rq *rq) { @@ -1446,11 +1482,12 @@ oce_init_lro(POCE_SOFTC sc) return rc; } - +#endif /* INET6 || INET */ void oce_free_lro(POCE_SOFTC sc) { +#if defined(INET6) || defined(INET) struct lro_ctrl *lro = NULL; int i = 0; @@ -1459,6 +1496,7 @@ oce_free_lro(POCE_SOFTC sc) if (lro) tcp_lro_free(lro); } +#endif } @@ -1567,9 +1605,11 @@ oce_rq_handler(void *arg) rq->rx_stats.rx_compl++; cqe->u0.dw[2] = 0; +#if defined(INET6) || defined(INET) if (IF_LRO_ENABLED(sc) && rq->lro_pkts_queued >= 16) { oce_rx_flush_lro(rq); } +#endif RING_GET(cq->ring, 1); bus_dmamap_sync(cq->ring->dma.tag, @@ -1580,8 +1620,10 @@ oce_rq_handler(void *arg) if (num_cqes >= (IS_XE201(sc) ? 8 : oce_max_rsp_handled)) break; } +#if defined(INET6) || defined(INET) if (IF_LRO_ENABLED(sc)) oce_rx_flush_lro(rq); +#endif if (num_cqes) { oce_arm_cq(sc, cq->cq_id, num_cqes, FALSE); @@ -1638,10 +1680,12 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_hwassist |= (CSUM_IP | CSUM_TCP | CSUM_UDP); sc->ifp->if_capabilities = OCE_IF_CAPABILITIES; - sc->ifp->if_capabilities |= IFCAP_TSO; sc->ifp->if_capabilities |= IFCAP_HWCSUM; sc->ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; +#if defined(INET6) || defined(INET) + sc->ifp->if_capabilities |= IFCAP_TSO; sc->ifp->if_capabilities |= IFCAP_LRO; +#endif sc->ifp->if_capenable = sc->ifp->if_capabilities; sc->ifp->if_baudrate = IF_Gbps(10UL); From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 08:34:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B40051065670; Sat, 11 Feb 2012 08:34:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A31A48FC1A; Sat, 11 Feb 2012 08:34:33 +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 q1B8YXlg021089; Sat, 11 Feb 2012 08:34:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B8YXO3021087; Sat, 11 Feb 2012 08:34:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110834.q1B8YXO3021087@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 08:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231512 - head/sys/modules/oce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 08:34:33 -0000 Author: bz Date: Sat Feb 11 08:34:33 2012 New Revision: 231512 URL: http://svn.freebsd.org/changeset/base/231512 Log: Depend on the relevant header files. Modified: head/sys/modules/oce/Makefile Modified: head/sys/modules/oce/Makefile ============================================================================== --- head/sys/modules/oce/Makefile Sat Feb 11 08:33:52 2012 (r231511) +++ head/sys/modules/oce/Makefile Sat Feb 11 08:34:33 2012 (r231512) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/../../dev/oce KMOD = oce SRCS = oce_if.c oce_hw.c oce_mbox.c oce_util.c oce_queue.c oce_sysctl.c -#SRCS += ${ofw_bus_if} bus_if.h device_if.h pci_if.h opt_inet.h opt_inet6.h +SRCS += bus_if.h device_if.h pci_if.h opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../dev/oce -DSMP From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 08:58:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBB4A106564A; Sat, 11 Feb 2012 08:58:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F54F8FC0A; Sat, 11 Feb 2012 08:58: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 q1B8wCia021919; Sat, 11 Feb 2012 08:58:12 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B8wCUC021917; Sat, 11 Feb 2012 08:58:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202110858.q1B8wCUC021917@svn.freebsd.org> From: Michael Tuexen Date: Sat, 11 Feb 2012 08:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231513 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 08:58:12 -0000 Author: tuexen Date: Sat Feb 11 08:58:12 2012 New Revision: 231513 URL: http://svn.freebsd.org/changeset/base/231513 Log: MFC r218264: Fix typo (Tuneable -> Tunable). From brucec@. Modified: stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 08:34:33 2012 (r231512) +++ stable/8/sys/netinet/sctp_sysctl.h Sat Feb 11 08:58:12 2012 (r231513) @@ -193,13 +193,13 @@ struct sctp_sysctl { #define SCTPCTL_MAXCHUNKS_MAX 0xFFFFFFFF #define SCTPCTL_MAXCHUNKS_DEFAULT SCTP_ASOC_MAX_CHUNKS_ON_QUEUE -/* tcbhashsize: Tuneable for Hash table sizes */ +/* tcbhashsize: Tunable for Hash table sizes */ #define SCTPCTL_TCBHASHSIZE_DESC "Tunable for TCB hash table sizes" #define SCTPCTL_TCBHASHSIZE_MIN 1 #define SCTPCTL_TCBHASHSIZE_MAX 0xFFFFFFFF #define SCTPCTL_TCBHASHSIZE_DEFAULT SCTP_TCBHASHSIZE -/* pcbhashsize: Tuneable for PCB Hash table sizes */ +/* pcbhashsize: Tunable for PCB Hash table sizes */ #define SCTPCTL_PCBHASHSIZE_DESC "Tunable for PCB hash table sizes" #define SCTPCTL_PCBHASHSIZE_MIN 1 #define SCTPCTL_PCBHASHSIZE_MAX 0xFFFFFFFF @@ -211,8 +211,8 @@ struct sctp_sysctl { #define SCTPCTL_MIN_SPLIT_POINT_MAX 0xFFFFFFFF #define SCTPCTL_MIN_SPLIT_POINT_DEFAULT SCTP_DEFAULT_SPLIT_POINT_MIN -/* chunkscale: Tuneable for Scaling of number of chunks and messages */ -#define SCTPCTL_CHUNKSCALE_DESC "Tuneable for Scaling of number of chunks and messages" +/* chunkscale: Tunable for Scaling of number of chunks and messages */ +#define SCTPCTL_CHUNKSCALE_DESC "Tunable for Scaling of number of chunks and messages" #define SCTPCTL_CHUNKSCALE_MIN 1 #define SCTPCTL_CHUNKSCALE_MAX 0xFFFFFFFF #define SCTPCTL_CHUNKSCALE_DEFAULT SCTP_CHUNKQUEUE_SCALE From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 09:35:50 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C20B01065670; Sat, 11 Feb 2012 09:35:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 4C96C8FC08; Sat, 11 Feb 2012 09:35:49 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1B9ZkX9010997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 11 Feb 2012 20:35:47 +1100 Date: Sat, 11 Feb 2012 20:35:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Martin Cracauer In-Reply-To: <201202102216.q1AMGI0m098192@svn.freebsd.org> Message-ID: <20120211194854.J2214@besplex.bde.org> References: <201202102216.q1AMGI0m098192@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 09:35:51 -0000 On Fri, 10 Feb 2012, Martin Cracauer wrote: > Log: > Fix bin/164947: tee looses data when writing to non-blocking file descriptors > > tee was not handling EAGAIN > > patch submitted by Diomidis Spinellis . Thanks so much > > reproduced and re-tested locally This seems to give a buffer overrun (apart from reducing to a write() spinloop) when the number of output files is enormous and non-blocking mode is broken. > Modified: head/usr.bin/tee/tee.c > ============================================================================== > --- head/usr.bin/tee/tee.c Fri Feb 10 22:14:34 2012 (r231448) > +++ head/usr.bin/tee/tee.c Fri Feb 10 22:16:17 2012 (r231449) > ... > @@ -106,9 +109,14 @@ main(int argc, char *argv[]) > bp = buf; > do { > if ((wval = write(p->fd, bp, n)) == -1) { > - warn("%s", p->name); > - exitval = 1; > - break; > + if (errno == EAGAIN) { > + waitfor(p->fd); p->fd is limited only by the number of args (which is limited by {ARG_MAX}, which defaults to 256K and is hard to change) and {OPEN_MAX} (which is about 12000 on all machines I can test quickly, including 2 very different ones; it is easy to reduce but not so easy to increase). However, this code should be unreachable except for fd == 0, since we opened all the other fd's for itself and we didn't ask for O_NONBLOCK on them). However2, I think some device files still have broken non-blocking mode, where the non-blocking flag is set in the device state instead of in the open file state and is thus too global. > + wval = 0; > + } else { > + warn("%s", p->name); > + exitval = 1; > + break; > + } > } > bp += wval; > } while (n -= wval); > @@ -137,3 +145,15 @@ add(int fd, const char *name) > p->next = head; > head = p; > } > + > +/* Wait for the specified fd to be ready for writing */ > +static void > +waitfor(int fd) > +{ > + fd_set writefds; The number of bits is this is limited by FD_SETSIZE, which defaults to 1024. This is much smaller than the other limits, so fd can easily exceed FD_SETSIZE. FD_SETSIZE is easy to change, but it is not changed by this program. > + > + FD_ZERO(&writefds); > + FD_SET(fd, &writefds); This gives a buffer overrun when fd >= FD_SETSIZE. FD_SET() does no internal range checking, so callers must do it. > + if (select(fd + 1, NULL, &writefds, NULL, NULL) == -1) > + err(1, "select"); This might even work if the buffer overrun doesn't trash too much, since (fd + 1) is not too large for the kernel. > +} > The easiest fix is to return immediately if fd >= FD_SETSIZE or even if fd > 0. This intentionally reduces to the write() spinloop if someone makes fd >= FD_SETSIZE, or if someone uses tee on a buggy device. An enormous number of output files enlarges chances for other interesting bugs. It only takes one in the middle to have an i/o error (EIO for hangup is most likely) to break the i/o for all. Blocking on one while the others could be displaying output is not best. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 10:35:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E0E21065672; Sat, 11 Feb 2012 10:35:35 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id CC5B58FC0A; Sat, 11 Feb 2012 10:35:33 +0000 (UTC) Received: by bkcjg1 with SMTP id jg1so3135310bkc.13 for ; Sat, 11 Feb 2012 02:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=61MFnUhawF3Zw+N6EhNqsW69skIfjHuaSClZWCcEVbU=; b=tuY6MzoMEJxj6Q5WJVAC1BT6LXi3u6T+sTY5SjNG0vxhqcHvTDpsMZQe+sQdNYRa7L d5JtSqy0E7t507ZQJ0sETV2N9J5zjUpZopSxF3UaniyrStcMMfsAVEr3F95uOpWY512W FAinW8YkzaQDtk9s0rsbzPMQ6DasqoLxJrLcI= Received: by 10.204.151.209 with SMTP id d17mr4068781bkw.52.1328956532884; Sat, 11 Feb 2012 02:35:32 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id o26sm25906448bko.14.2012.02.11.02.35.29 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 11 Feb 2012 02:35:30 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek References: <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> X-Comment-To: Pawel Jakub Dawidek Sender: Mikolaj Golub Date: Sat, 11 Feb 2012 12:35:27 +0200 In-Reply-To: <20120208090600.GA1308@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Wed, 8 Feb 2012 10:06:01 +0100") Message-ID: <86sjihsln4.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 10:35:35 -0000 On Wed, 8 Feb 2012 10:06:01 +0100 Pawel Jakub Dawidek wrote: PJD> On Wed, Feb 08, 2012 at 10:32:41AM +0200, Mikolaj Golub wrote: >> >> On Mon, 6 Feb 2012 23:17:43 +0100 Pawel Jakub Dawidek wrote: >> >> PJD> On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote: >> >> >> Thanks. The updated version is attached. >> >> PJD> Looks good to me. >> >> Thanks. But I still think that adding some signal handling is a good idea. I >> agree that there may be no sense in trying to handle many different signals, >> but handling SIGTERM (software termination signal :-) nicely looks like a good >> thing. PJD> Ok:) In that case could you break you patch into one that only fixes the PJD> problem we discussed and the other that implements new functionality? >> This would solve problems like stale pid files after shutdown or orphaned >> programs (again with stale pid files and a possibility to start another >> instance) due to a user mistakenly terminated the supervising daemons. >> >> Also it is possible then to add "automatic restart" option, as Andrey has >> proposed. >> >> Here is the patch that does it. It also change proctitle to make identifying a >> a supervisor with its charge. PJD> I'd prefer to see more general solution to that problem, but I guess PJD> this can't hurt. I've only one suggestion based on my experience. PJD> Before you restart the program, wait for 1 second. This helps a lot when PJD> you have misbehaving program or some misconfiguration that make the PJD> process to exit immediately. >> A technical question concerning the patch :-). Does sombody know if >> sigwaitinfo() may be interrupted in my case and I should check for EINTR, as I >> do in the patch? PJD> Calling sigwaitinfo() with second argument equal to NULL is equivalent PJD> to calling sigwait(). The only difference is that sigwait() cannot be PJD> interrupted by signal, thus never sets errno to EINTR. Why not to use PJD> just that? Thank you. Here are the patches I would like to commit if there are no objections or other suggestions: http://people.freebsd.org/~trociny/daemon/daemon.spawn.1.patch http://people.freebsd.org/~trociny/daemon/daemon.SIGTERM.1.patch http://people.freebsd.org/~trociny/daemon/daemon.restart.1.patch -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 11:11:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02241106564A; Sat, 11 Feb 2012 11:11:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4EB08FC14; Sat, 11 Feb 2012 11:11:13 +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 q1BBBDrw028343; Sat, 11 Feb 2012 11:11:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BBBDG3028340; Sat, 11 Feb 2012 11:11:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202111111.q1BBBDG3028340@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 11:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231514 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 11:11:14 -0000 Author: ed Date: Sat Feb 11 11:11:13 2012 New Revision: 231514 URL: http://svn.freebsd.org/changeset/base/231514 Log: Set read buffer size to multiple of sizeof(struct futx). If the utmpx database gets updated while an application is reading it, there is a chance the reading application processes partially overwritten entries. To solve this, make sure we always read a multiple of sizeof(struct futx) at a time. MFC after: 2 weeks Modified: head/lib/libc/gen/getutxent.c Modified: head/lib/libc/gen/getutxent.c ============================================================================== --- head/lib/libc/gen/getutxent.c Sat Feb 11 08:58:12 2012 (r231513) +++ head/lib/libc/gen/getutxent.c Sat Feb 11 11:11:13 2012 (r231514) @@ -70,13 +70,18 @@ setutxdb(int db, const char *file) if (uf == NULL) return (-1); - /* Safety check: never use broken files. */ - if (db != UTXDB_LOG && _fstat(fileno(uf), &sb) != -1 && - sb.st_size % sizeof(struct futx) != 0) { - fclose(uf); - uf = NULL; - errno = EFTYPE; - return (-1); + if (db != UTXDB_LOG) { + /* Safety check: never use broken files. */ + if (_fstat(fileno(uf), &sb) != -1 && + sb.st_size % sizeof(struct futx) != 0) { + fclose(uf); + uf = NULL; + errno = EFTYPE; + return (-1); + } + /* Prevent reading of partial records. */ + (void)setvbuf(uf, NULL, _IOFBF, + rounddown(BUFSIZ, sizeof(struct futx))); } udb = db; From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 11:11:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 667CF106564A; Sat, 11 Feb 2012 11:11:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 555528FC08; Sat, 11 Feb 2012 11:11: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 q1BBBhCr028403; Sat, 11 Feb 2012 11:11:43 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BBBhw3028401; Sat, 11 Feb 2012 11:11:43 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202111111.q1BBBhw3028401@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 11:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231515 - head/lib/libipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 11:11:44 -0000 Author: bz Date: Sat Feb 11 11:11:43 2012 New Revision: 231515 URL: http://svn.freebsd.org/changeset/base/231515 Log: Use the correct constant (with same value) for comparying the SA type. PR: kern/142741 Submitted by: Matthijs Kooiman (matthijs stdin.nl) MFC after: 3 days Modified: head/lib/libipsec/pfkey.c Modified: head/lib/libipsec/pfkey.c ============================================================================== --- head/lib/libipsec/pfkey.c Sat Feb 11 11:11:13 2012 (r231514) +++ head/lib/libipsec/pfkey.c Sat Feb 11 11:11:43 2012 (r231515) @@ -662,7 +662,7 @@ pfkey_send_register(so, satype) { int len, algno; - if (satype == PF_UNSPEC) { + if (satype == SADB_SATYPE_UNSPEC) { for (algno = 0; algno < sizeof(supported_map)/sizeof(supported_map[0]); algno++) { From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 11:24:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424BB106566C; Sat, 11 Feb 2012 11:24:31 +0000 (UTC) (envelope-from dmarion@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 307AB8FC08; Sat, 11 Feb 2012 11:24:31 +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 q1BBOVO4028961; Sat, 11 Feb 2012 11:24:31 GMT (envelope-from dmarion@svn.freebsd.org) Received: (from dmarion@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BBOUAX028959; Sat, 11 Feb 2012 11:24:30 GMT (envelope-from dmarion@svn.freebsd.org) Message-Id: <201202111124.q1BBOUAX028959@svn.freebsd.org> From: Damjan Marion Date: Sat, 11 Feb 2012 11:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231516 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 11:24:31 -0000 Author: dmarion Date: Sat Feb 11 11:24:30 2012 New Revision: 231516 URL: http://svn.freebsd.org/changeset/base/231516 Log: Add myself to calendar. Approved by: cognet (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Feb 11 11:11:43 2012 (r231515) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sat Feb 11 11:24:30 2012 (r231516) @@ -239,6 +239,7 @@ 08/05 Alfred Perlstein born in Brooklyn, New York, United States, 1978 08/06 Anton Berezin born in Dnepropetrovsk, Ukraine, 1970 08/06 John-Mark Gurney born in Detroit, Michigan, United States, 1978 +08/06 Damjan Marion born in Rijeka, Croatia, 1978 08/07 Jonathan Mini born in San Mateo, California, United States, 1979 08/08 Mikolaj Golub born in Kharkov, USSR, 1977 08/10 Peter Pentchev born in Sofia, Bulgaria, 1977 From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 12:03:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890D41065675; Sat, 11 Feb 2012 12:03:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76A6D8FC1F; Sat, 11 Feb 2012 12:03: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 q1BC3jHG030199; Sat, 11 Feb 2012 12:03:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BC3jJD030193; Sat, 11 Feb 2012 12:03:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202111203.q1BC3jJD030193@svn.freebsd.org> From: Marius Strobl Date: Sat, 11 Feb 2012 12:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231518 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 12:03:45 -0000 Author: marius Date: Sat Feb 11 12:03:44 2012 New Revision: 231518 URL: http://svn.freebsd.org/changeset/base/231518 Log: Flesh out support for SAS1078 and SAS1078DE (which are said to actually be the same chip): - The I/O port resource may not be available with these. However, given that we actually only need this resource for some controllers that require their firmware to be up- and downloaded (which excludes the SAS1078{,DE}) just handle failure to allocate this resource gracefully when possible. While at it, generally put non-fatal resource allocation failures under bootverbose. - SAS1078{,DE} use a different hard reset protocol. - Add workarounds for the 36GB physical address limitation of scatter/ gather elements of these controllers. Tested by: Slawa Olhovchenkov PR: 149220 (remaining part) Modified: head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_cam.c head/sys/dev/mpt/mpt_pci.c head/sys/dev/mpt/mpt_reg.h Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt.c Sat Feb 11 12:03:44 2012 (r231518) @@ -1053,6 +1053,12 @@ mpt_hard_reset(struct mpt_softc *mpt) mpt_lprt(mpt, MPT_PRT_DEBUG, "hard reset\n"); + if (mpt->is_1078) { + mpt_write(mpt, MPT_OFFSET_RESET_1078, 0x07); + DELAY(1000); + return; + } + error = mpt_enable_diag_mode(mpt); if (error) { mpt_prt(mpt, "WARNING - Could not enter diagnostic mode !\n"); @@ -2450,6 +2456,11 @@ mpt_download_fw(struct mpt_softc *mpt) uint32_t ext_offset; uint32_t data; + if (mpt->pci_pio_reg == NULL) { + mpt_prt(mpt, "No PIO resource!\n"); + return (ENXIO); + } + mpt_prt(mpt, "Downloading Firmware - Image Size %d\n", mpt->fw_image_size); Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt.h Sat Feb 11 12:03:44 2012 (r231518) @@ -608,7 +608,7 @@ struct mpt_softc { #endif uint32_t mpt_pers_mask; uint32_t - : 8, + : 7, unit : 8, ready : 1, fw_uploaded : 1, @@ -625,7 +625,8 @@ struct mpt_softc { disabled : 1, is_spi : 1, is_sas : 1, - is_fc : 1; + is_fc : 1, + is_1078 : 1; u_int cfg_role; u_int role; /* role: none, ini, target, both */ @@ -982,12 +983,14 @@ mpt_read(struct mpt_softc *mpt, int offs static __inline void mpt_pio_write(struct mpt_softc *mpt, size_t offset, uint32_t val) { + KASSERT(mpt->pci_pio_reg != NULL, ("no PIO resource")); bus_space_write_4(mpt->pci_pio_st, mpt->pci_pio_sh, offset, val); } static __inline uint32_t mpt_pio_read(struct mpt_softc *mpt, int offset) { + KASSERT(mpt->pci_pio_reg != NULL, ("no PIO resource")); return (bus_space_read_4(mpt->pci_pio_st, mpt->pci_pio_sh, offset)); } /*********************** Reply Frame/Request Management ***********************/ Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt_cam.c Sat Feb 11 12:03:44 2012 (r231518) @@ -1279,8 +1279,9 @@ mpt_execute_req_a64(void *arg, bus_dma_s char *mpt_off; union ccb *ccb; struct mpt_softc *mpt; - int seg, first_lim; - uint32_t flags, nxt_off; + bus_addr_t chain_list_addr; + int first_lim, seg, this_seg_lim; + uint32_t addr, cur_off, flags, nxt_off, tf; void *sglp = NULL; MSG_REQUEST_HEADER *hdrp; SGE_SIMPLE64 *se; @@ -1434,16 +1435,20 @@ bad: se = (SGE_SIMPLE64 *) sglp; for (seg = 0; seg < first_lim; seg++, se++, dm_segs++) { - uint32_t tf; - + tf = flags; memset(se, 0, sizeof (*se)); + MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); se->Address.Low = htole32(dm_segs->ds_addr & 0xffffffff); if (sizeof(bus_addr_t) > 4) { - se->Address.High = - htole32(((uint64_t)dm_segs->ds_addr) >> 32); + addr = ((uint64_t)dm_segs->ds_addr) >> 32; + /* SAS1078 36GB limitation WAR */ + if (mpt->is_1078 && (((uint64_t)dm_segs->ds_addr + + MPI_SGE_LENGTH(se->FlagsLength)) >> 32) == 9) { + addr |= (1 << 31); + tf |= MPI_SGE_FLAGS_LOCAL_ADDRESS; + } + se->Address.High = htole32(addr); } - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); - tf = flags; if (seg == first_lim - 1) { tf |= MPI_SGE_FLAGS_LAST_ELEMENT; } @@ -1468,15 +1473,11 @@ bad: /* * Make up the rest of the data segments out of a chain element - * (contiained in the current request frame) which points to + * (contained in the current request frame) which points to * SIMPLE64 elements in the next request frame, possibly ending * with *another* chain element (if there's more). */ while (seg < nseg) { - int this_seg_lim; - uint32_t tf, cur_off; - bus_addr_t chain_list_addr; - /* * Point to the chain descriptor. Note that the chain * descriptor is at the end of the *previous* list (whether @@ -1504,7 +1505,7 @@ bad: nxt_off += MPT_RQSL(mpt); /* - * Now initialized the chain descriptor. + * Now initialize the chain descriptor. */ memset(ce, 0, sizeof (*ce)); @@ -1554,16 +1555,24 @@ bad: * set the end of list and end of buffer flags. */ while (seg < this_seg_lim) { + tf = flags; memset(se, 0, sizeof (*se)); + MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); se->Address.Low = htole32(dm_segs->ds_addr & 0xffffffff); if (sizeof (bus_addr_t) > 4) { - se->Address.High = - htole32(((uint64_t)dm_segs->ds_addr) >> 32); + addr = ((uint64_t)dm_segs->ds_addr) >> 32; + /* SAS1078 36GB limitation WAR */ + if (mpt->is_1078 && + (((uint64_t)dm_segs->ds_addr + + MPI_SGE_LENGTH(se->FlagsLength)) >> + 32) == 9) { + addr |= (1 << 31); + tf |= MPI_SGE_FLAGS_LOCAL_ADDRESS; + } + se->Address.High = htole32(addr); } - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); - tf = flags; - if (seg == this_seg_lim - 1) { + if (seg == this_seg_lim - 1) { tf |= MPI_SGE_FLAGS_LAST_ELEMENT; } if (seg == nseg - 1) { @@ -1868,7 +1877,7 @@ bad: /* * Make up the rest of the data segments out of a chain element - * (contiained in the current request frame) which points to + * (contained in the current request frame) which points to * SIMPLE32 elements in the next request frame, possibly ending * with *another* chain element (if there's more). */ @@ -1904,7 +1913,7 @@ bad: nxt_off += MPT_RQSL(mpt); /* - * Now initialized the chain descriptor. + * Now initialize the chain descriptor. */ memset(ce, 0, sizeof (*ce)); @@ -1958,7 +1967,7 @@ bad: MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; - if (seg == this_seg_lim - 1) { + if (seg == this_seg_lim - 1) { tf |= MPI_SGE_FLAGS_LAST_ELEMENT; } if (seg == nseg - 1) { Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt_pci.c Sat Feb 11 12:03:44 2012 (r231518) @@ -438,6 +438,10 @@ mpt_pci_attach(device_t dev) case PCI_PRODUCT_LSI_FC7X04X: mpt->is_fc = 1; break; + case PCI_PRODUCT_LSI_SAS1078: + case PCI_PRODUCT_LSI_SAS1078DE: + mpt->is_1078 = 1; + /* FALLTHROUGH */ case PCI_PRODUCT_LSI_SAS1064: case PCI_PRODUCT_LSI_SAS1064A: case PCI_PRODUCT_LSI_SAS1064E: @@ -445,8 +449,6 @@ mpt_pci_attach(device_t dev) case PCI_PRODUCT_LSI_SAS1066E: case PCI_PRODUCT_LSI_SAS1068: case PCI_PRODUCT_LSI_SAS1068E: - case PCI_PRODUCT_LSI_SAS1078: - case PCI_PRODUCT_LSI_SAS1078DE: mpt->is_sas = 1; break; default: @@ -527,23 +529,31 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &mpt_io_bar, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { - device_printf(dev, "unable to map registers in PIO mode\n"); - goto bad; + if (bootverbose) { + device_printf(dev, + "unable to map registers in PIO mode\n"); + } + } else { + mpt->pci_pio_st = rman_get_bustag(mpt->pci_pio_reg); + mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); } - mpt->pci_pio_st = rman_get_bustag(mpt->pci_pio_reg); - mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ mpt_mem_bar = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mpt_mem_bar, RF_ACTIVE); if (mpt->pci_reg == NULL) { - device_printf(dev, "Unable to memory map registers.\n"); - if (mpt->is_sas) { + if (bootverbose || mpt->is_sas || mpt->pci_pio_reg == NULL) { + device_printf(dev, + "Unable to memory map registers.\n"); + } + if (mpt->is_sas || mpt->pci_pio_reg == NULL) { device_printf(dev, "Giving Up.\n"); goto bad; } - device_printf(dev, "Falling back to PIO mode.\n"); + if (bootverbose) { + device_printf(dev, "Falling back to PIO mode.\n"); + } mpt->pci_st = mpt->pci_pio_st; mpt->pci_sh = mpt->pci_pio_sh; } else { Modified: head/sys/dev/mpt/mpt_reg.h ============================================================================== --- head/sys/dev/mpt/mpt_reg.h Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt_reg.h Sat Feb 11 12:03:44 2012 (r231518) @@ -77,6 +77,7 @@ #define MPT_OFFSET_REPLY_Q 0x44 #define MPT_OFFSET_HOST_INDEX 0x50 #define MPT_OFFSET_FUBAR 0x90 +#define MPT_OFFSET_RESET_1078 0x10fc /* Bit Maps for DOORBELL register */ enum DB_STATE_BITS { From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 12:16:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9407D106564A; Sat, 11 Feb 2012 12:16:23 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id F09228FC17; Sat, 11 Feb 2012 12:16:21 +0000 (UTC) Received: by bkcjg1 with SMTP id jg1so3175415bkc.13 for ; Sat, 11 Feb 2012 04:16:21 -0800 (PST) Received: by 10.204.133.219 with SMTP id g27mr4086642bkt.47.1328962580613; Sat, 11 Feb 2012 04:16:20 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-138-46.pppoe.spdop.ru. [95.165.138.46]) by mx.google.com with ESMTPS id cg2sm26572991bkb.12.2012.02.11.04.16.18 (version=SSLv3 cipher=OTHER); Sat, 11 Feb 2012 04:16:19 -0800 (PST) Message-ID: <4F365C10.5050607@zonov.org> Date: Sat, 11 Feb 2012 16:16:16 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Mikolaj Golub References: <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> In-Reply-To: <86sjihsln4.fsf@kopusha.home.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmjkqkIuqoUexHDY0ur6TVcdRP1OJ1Pu+5O3Ea83Keh9e8ddwR+SS+CWo0w0Mal3kXhHE21 Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 12:16:23 -0000 On 11.02.2012 14:35, Mikolaj Golub wrote: > > Thank you. Here are the patches I would like to commit if there are no > objections or other suggestions: > > http://people.freebsd.org/~trociny/daemon/daemon.spawn.1.patch > http://people.freebsd.org/~trociny/daemon/daemon.SIGTERM.1.patch > http://people.freebsd.org/~trociny/daemon/daemon.restart.1.patch > There are two more suggestions, if you don't mind. Use madvise(MADV_PROTECT). It would be useful because of the daemon(8) should not leak or eats much memory. Check return code from pidfile_write() function. I saw many times when pid could not be written because of there is not enough free space (but file was created). Unfortunately, I have no suggestions how to handle this properly. -- Andrey Zonov From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 13:41:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFC141065673; Sat, 11 Feb 2012 13:41:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEC998FC17; Sat, 11 Feb 2012 13:41:38 +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 q1BDfcZa033226; Sat, 11 Feb 2012 13:41:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BDfcsv033224; Sat, 11 Feb 2012 13:41:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202111341.q1BDfcsv033224@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 13:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231520 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 13:41:38 -0000 Author: bz Date: Sat Feb 11 13:41:38 2012 New Revision: 231520 URL: http://svn.freebsd.org/changeset/base/231520 Log: Properly name the sysctl to "iflistl" rather than "iflist2", which had been the prototype name and slipped in in r231505. Spotted in a reply from: bde MFC after: 3 days Modified: head/sys/sys/socket.h Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Sat Feb 11 13:12:53 2012 (r231519) +++ head/sys/sys/socket.h Sat Feb 11 13:41:38 2012 (r231520) @@ -406,7 +406,7 @@ struct sockproto { { "flags", CTLTYPE_STRUCT }, \ { "iflist", CTLTYPE_STRUCT }, \ { "ifmalist", CTLTYPE_STRUCT }, \ - { "iflist2", CTLTYPE_STRUCT }, \ + { "iflistl", CTLTYPE_STRUCT }, \ } #endif /* __BSD_VISIBLE */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 13:50:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72EB11065670; Sat, 11 Feb 2012 13:50:28 +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 F385B8FC0A; Sat, 11 Feb 2012 13:50:27 +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 BB1F125D385E; Sat, 11 Feb 2012 13:50:26 +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 C47F9BDB211; Sat, 11 Feb 2012 13:50:25 +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 wJKHPHckGCLG; Sat, 11 Feb 2012 13:50:24 +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 B5B31BDB210; Sat, 11 Feb 2012 13:50:24 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201202111341.q1BDfcsv033224@svn.freebsd.org> Date: Sat, 11 Feb 2012 13:50:23 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201202111341.q1BDfcsv033224@svn.freebsd.org> To: src-committers@freebsd.org X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r231520 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 13:50:28 -0000 On 11. Feb 2012, at 13:41 , Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Feb 11 13:41:38 2012 > New Revision: 231520 > URL: http://svn.freebsd.org/changeset/base/231520 >=20 > Log: > Properly name the sysctl to "iflistl" rather than "iflist2", which = had been > the prototype name and slipped in in r231505. Not that it would make any difference, given it's entirely unused as bde = had pointed out but for consistency until someone will clean all this up. I currently do not feel like going through all of it and nuke it and = convert the numbered sysctls in rtsock.c etc. /bz >=20 > Spotted in a reply from: bde > MFC after: 3 days >=20 > Modified: > head/sys/sys/socket.h >=20 > Modified: head/sys/sys/socket.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 > --- head/sys/sys/socket.h Sat Feb 11 13:12:53 2012 = (r231519) > +++ head/sys/sys/socket.h Sat Feb 11 13:41:38 2012 = (r231520) > @@ -406,7 +406,7 @@ struct sockproto { > { "flags", CTLTYPE_STRUCT }, \ > { "iflist", CTLTYPE_STRUCT }, \ > { "ifmalist", CTLTYPE_STRUCT }, \ > - { "iflist2", CTLTYPE_STRUCT }, \ > + { "iflistl", CTLTYPE_STRUCT }, \ > } > #endif /* __BSD_VISIBLE */ >=20 --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 13:57:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D70631065672; Sat, 11 Feb 2012 13:57:32 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 63C758FC0A; Sat, 11 Feb 2012 13:57:32 +0000 (UTC) Received: by iaeo4 with SMTP id o4so2190716iae.13 for ; Sat, 11 Feb 2012 05:57:31 -0800 (PST) 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=YqG6POnUp6TX8g/fnXzKQIdw6hcpfQr3mVD4zc+YZTU=; b=YfhvEck3KgVECZz5zZPhpWhcvoOLEPcWMMK+G+xaXpxb0JzwdsmdaFYLvk20/9KgmT bYfTMM+zsqQedQ8iTIVUrYhcsYGfvaqdCQF0P4iCK3SLVFzhCokpP4uFLVGOXPYr+3IA pDCDjx6KnGdhPO9ocQonBeLW7WoQEyjQTGhBc= MIME-Version: 1.0 Received: by 10.50.236.34 with SMTP id ur2mr17333973igc.20.1328968651875; Sat, 11 Feb 2012 05:57:31 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.43.130.201 with HTTP; Sat, 11 Feb 2012 05:57:31 -0800 (PST) In-Reply-To: References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> Date: Sat, 11 Feb 2012 13:57:31 +0000 X-Google-Sender-Auth: K9k9Ge7oeNRsdYMVqc6s_DVxVL8 Message-ID: From: Robert Millan To: "Bjoern A. Zeeb" Content-Type: multipart/mixed; boundary=14dae9399d7d69a47904b8b0a061 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Adrian Chadd Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 13:57:32 -0000 --14dae9399d7d69a47904b8b0a061 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable El 10 de febrer de 2012 19:42, Robert Millan ha escrit: > Here's a possible solution to this patch (untested). =C2=A0In case it loo= ks > fine to everyone (and my mentors approve it), I'll definitely test > with "make universe" before commit. Another possibility (perhaps a better one) would be to move those files off sys/${MACHINE}/conf directories, then they won't be picked up by "universe". Since they're not ${MACHINE}-specific, would sys/conf/ be a good location? Patch is attached. --14dae9399d7d69a47904b8b0a061 Content-Type: text/plain; charset=US-ASCII; name="without_sourceless.diff" Content-Disposition: attachment; filename="without_sourceless.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gyiplwfh1 SW5kZXg6IHN5cy9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX0hPU1QKPT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQot LS0gc3lzL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAkocmV2aXNpb24gMjMwOTcx KQorKysgc3lzL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAkod29ya2luZyBjb3B5 KQpAQCAtMSwxMCArMCwwIEBACi0jCi0jIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERSAtLSBEaXNh YmxlIGRyaXZlcnMgdGhhdCBpbmNsdWRlIHNvdXJjZWxlc3MKLSMgbmF0aXZlIGNvZGUgZm9yIGhv c3QgQ1BVLgotIwotIyAkRnJlZUJTRCQKLQotbm9kZXZpY2UJaHB0Mjd4eAotbm9kZXZpY2UJaHB0 bXYKLW5vZGV2aWNlCWhwdHJyCi1ub2RldmljZQludmUKSW5kZXg6IHN5cy9pMzg2L2NvbmYvV0lU SE9VVF9TT1VSQ0VMRVNTX1VDT0RFCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9pMzg2L2NvbmYvV0lUSE9V VF9TT1VSQ0VMRVNTX1VDT0RFCShyZXZpc2lvbiAyMzA5NzEpCisrKyBzeXMvaTM4Ni9jb25mL1dJ VEhPVVRfU09VUkNFTEVTU19VQ09ERQkod29ya2luZyBjb3B5KQpAQCAtMSw0MSArMCwwIEBACi0j Ci0jIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERSAtLSBEaXNhYmxlIGRyaXZlcnMgdGhhdCBpbmNs dWRlIHNvdXJjZWxlc3MKLSMgbWljcm9jb2RlLgotIwotIyAkRnJlZUJTRCQKLQotbm9kZXZpY2UJ YWR3Ci1ub2RldmljZQliY2UKLW5vZGV2aWNlCWZhdG0KLW5vZGV2aWNlCWZ4cAotbm9kZXZpY2UJ aXNwZncKLW5vZGV2aWNlCW13bGZ3Ci1ub2RldmljZQlyYWxmdwotbm9kZXZpY2UJcnVuZncKLW5v ZGV2aWNlCXNmCi1ub2RldmljZQlzbgotbm9kZXZpY2UJdGkKLW5vZGV2aWNlCXR4cAotbm9kZXZp Y2UJY2UKLW5vZGV2aWNlCWNwCi1ub2RldmljZQljdGF1Ci1ub2RldmljZQlpcHdmdwotbm9kZXZp Y2UJaXdpZncKLW5vZGV2aWNlCWl3bmZ3Ci1ub2RldmljZQl3cGlmdwotCi0jIGRybQotbm9kZXZp Y2UJbWdhCi1ub2RldmljZQlyMTI4Ci1ub2RldmljZQlyYWRlb24KLQotIyBzb3VuZAotbm9kZXZp Y2UJY3NhCi1ub2RldmljZQlkczEKLW5vZGV2aWNlCW1hZXN0cm8zCi0KLSMgdXNiCi1ub2Rldmlj ZQlydW0KLW5vZGV2aWNlCXVhdGgKLW5vZGV2aWNlCXp5ZAotbm9kZXZpY2UJa3VlCkluZGV4OiBz eXMvaTM4Ni9jb25mL1dJVEhPVVRfU09VUkNFTEVTUwo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMvaTM4Ni9j b25mL1dJVEhPVVRfU09VUkNFTEVTUwkocmV2aXNpb24gMjMwOTcxKQorKysgc3lzL2kzODYvY29u Zi9XSVRIT1VUX1NPVVJDRUxFU1MJKHdvcmtpbmcgY29weSkKQEAgLTEsNyArMCwwIEBACi0jCi0j IFdJVEhPVVRfU09VUkNFTEVTUyAtLSBEaXNhYmxlIGRyaXZlcnMgdGhhdCBpbmNsdWRlIHNvdXJj ZWxlc3MgY29kZS4KLSMKLSMgJEZyZWVCU0QkCi0KLWluY2x1ZGUgV0lUSE9VVF9TT1VSQ0VMRVNT X0hPU1QKLWluY2x1ZGUgV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCkluZGV4OiBzeXMvYW1kNjQv Y29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMvYW1kNjQvY29u Zi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAkocmV2aXNpb24gMjMwOTcxKQorKysgc3lzL2FtZDY0 L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX0hPU1QJKHdvcmtpbmcgY29weSkKQEAgLTEsMTAgKzAs MCBAQAotIwotIyBXSVRIT1VUX1NPVVJDRUxFU1NfVUNPREUgLS0gRGlzYWJsZSBkcml2ZXJzIHRo YXQgaW5jbHVkZSBzb3VyY2VsZXNzCi0jIG5hdGl2ZSBjb2RlIGZvciBob3N0IENQVS4KLSMKLSMg JEZyZWVCU0QkCi0KLW5vZGV2aWNlCWhwdDI3eHgKLW5vZGV2aWNlCWhwdG12Ci1ub2RldmljZQlo cHRycgotbm9kZXZpY2UJbnZlCkluZGV4OiBzeXMvYW1kNjQvY29uZi9XSVRIT1VUX1NPVVJDRUxF U1NfVUNPREUKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2FtZDY0L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNT X1VDT0RFCShyZXZpc2lvbiAyMzA5NzEpCisrKyBzeXMvYW1kNjQvY29uZi9XSVRIT1VUX1NPVVJD RUxFU1NfVUNPREUJKHdvcmtpbmcgY29weSkKQEAgLTEsNDEgKzAsMCBAQAotIwotIyBXSVRIT1VU X1NPVVJDRUxFU1NfVUNPREUgLS0gRGlzYWJsZSBkcml2ZXJzIHRoYXQgaW5jbHVkZSBzb3VyY2Vs ZXNzCi0jIG1pY3JvY29kZS4KLSMKLSMgJEZyZWVCU0QkCi0KLW5vZGV2aWNlCWFkdwotbm9kZXZp Y2UJYmNlCi1ub2RldmljZQlmYXRtCi1ub2RldmljZQlmeHAKLW5vZGV2aWNlCWlzcGZ3Ci1ub2Rl dmljZQltd2xmdwotbm9kZXZpY2UJcmFsZncKLW5vZGV2aWNlCXJ1bmZ3Ci1ub2RldmljZQlzZgot bm9kZXZpY2UJc24KLW5vZGV2aWNlCXRpCi1ub2RldmljZQl0eHAKLW5vZGV2aWNlCWNlCi1ub2Rl dmljZQljcAotbm9kZXZpY2UJY3RhdQotbm9kZXZpY2UJaXB3ZncKLW5vZGV2aWNlCWl3aWZ3Ci1u b2RldmljZQlpd25mdwotbm9kZXZpY2UJd3BpZncKLQotIyBkcm0KLW5vZGV2aWNlCW1nYQotbm9k ZXZpY2UJcjEyOAotbm9kZXZpY2UJcmFkZW9uCi0KLSMgc291bmQKLW5vZGV2aWNlCWNzYQotbm9k ZXZpY2UJZHMxCi1ub2RldmljZQltYWVzdHJvMwotCi0jIHVzYgotbm9kZXZpY2UJcnVtCi1ub2Rl dmljZQl1YXRoCi1ub2RldmljZQl6eWQKLW5vZGV2aWNlCWt1ZQpJbmRleDogc3lzL2FtZDY0L2Nv bmYvV0lUSE9VVF9TT1VSQ0VMRVNTCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9hbWQ2NC9jb25mL1dJVEhP VVRfU09VUkNFTEVTUwkocmV2aXNpb24gMjMwOTcxKQorKysgc3lzL2FtZDY0L2NvbmYvV0lUSE9V VF9TT1VSQ0VMRVNTCSh3b3JraW5nIGNvcHkpCkBAIC0xLDcgKzAsMCBAQAotIwotIyBXSVRIT1VU X1NPVVJDRUxFU1MgLS0gRGlzYWJsZSBkcml2ZXJzIHRoYXQgaW5jbHVkZSBzb3VyY2VsZXNzIGNv ZGUuCi0jCi0jICRGcmVlQlNEJAotCi1pbmNsdWRlIFdJVEhPVVRfU09VUkNFTEVTU19IT1NUCi1p bmNsdWRlIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERQo= --14dae9399d7d69a47904b8b0a061-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 14:07:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF5AE106566C; Sat, 11 Feb 2012 14:07:12 +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 0F3AE8FC0A; Sat, 11 Feb 2012 14:07:11 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q1BE775D033530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 11 Feb 2012 16:07:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q1BE777I056796; Sat, 11 Feb 2012 16:07:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q1BE77Wv056795; Sat, 11 Feb 2012 16:07:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 11 Feb 2012 16:07:07 +0200 From: Konstantin Belousov To: Robert Millan Message-ID: <20120211140707.GS3283@deviant.kiev.zoral.com.ua> References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NhNFzfCfperyfXiA" Content-Disposition: inline In-Reply-To: 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.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Konstantin Belousov , svn-src-head@freebsd.org, "Bjoern A. Zeeb" Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:07:12 -0000 --NhNFzfCfperyfXiA Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 11, 2012 at 01:57:31PM +0000, Robert Millan wrote: > El 10 de febrer de 2012 19:42, Robert Millan ha escrit: > > Here's a possible solution to this patch (untested). =9AIn case it looks > > fine to everyone (and my mentors approve it), I'll definitely test > > with "make universe" before commit. >=20 > Another possibility (perhaps a better one) would be to move those > files off sys/${MACHINE}/conf directories, then they won't be picked > up by "universe". Since they're not ${MACHINE}-specific, would > sys/conf/ be a good location? >=20 > Patch is attached. sys/conf is quite good, I like it. The files are much like NOTES. --NhNFzfCfperyfXiA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk82dgsACgkQC3+MBN1Mb4isGQCeIaN4qzV/aIqqbfCyPaYYTvro LHYAoJ+vAEN83fhBYe8H6V1DdBioPscU =nzXX -----END PGP SIGNATURE----- --NhNFzfCfperyfXiA-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 14:38:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DFB3106564A; Sat, 11 Feb 2012 14:38:47 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id E8E2A8FC13; Sat, 11 Feb 2012 14:38:46 +0000 (UTC) Received: by iaeo4 with SMTP id o4so2239551iae.13 for ; Sat, 11 Feb 2012 06:38:46 -0800 (PST) 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=cTByrUdVJelzFWfEadycft7XO4o4Dev/6HOPi6Oy3IA=; b=E1/78MXUNU/9wbHZ2siB6pCPiqfKMdhoIEEDhvZC2F/p5JisJixSZkQZSlhu0cBghi 8lYq+SKb/F9UB6Nro+i2xXc/lFKs2cbWMg9Nz5ht/7mGA9AwvvTuTQMwVWgvUeR4az3t DZO/ho4h8eXVTJWoRe0gfXR5wtHBVAzlzR1cs= MIME-Version: 1.0 Received: by 10.50.236.73 with SMTP id us9mr10329723igc.16.1328971126324; Sat, 11 Feb 2012 06:38:46 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.43.130.201 with HTTP; Sat, 11 Feb 2012 06:38:46 -0800 (PST) In-Reply-To: References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> Date: Sat, 11 Feb 2012 14:38:46 +0000 X-Google-Sender-Auth: J0ov12yfBykI_nBSV3LJpB4JxnM Message-ID: From: Robert Millan To: "Bjoern A. Zeeb" Content-Type: multipart/mixed; boundary=14dae934125de6bf8f04b8b13350 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Adrian Chadd Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:38:47 -0000 --14dae934125de6bf8f04b8b13350 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable El 11 de febrer de 2012 13:57, Robert Millan ha escrit: > Another possibility (perhaps a better one) would be to move those > files off sys/${MACHINE}/conf directories, then they won't be picked > up by "universe". =C2=A0Since they're not ${MACHINE}-specific, would > sys/conf/ be a good location? > > Patch is attached. Sorry, I noticed that "svn diff" didn't include moved files in the patch. Here's the complete diff. --14dae934125de6bf8f04b8b13350 Content-Type: text/plain; charset=US-ASCII; name="without_sourceless.diff" Content-Disposition: attachment; filename="without_sourceless.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gyir39y61 ZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9hbWQ2NC9jb25mL1dJVEhPVVRfU09VUkNFTEVTUyBz eXMvYW1kNjQvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1MKLS0tIHN5cy5vbGQvYW1kNjQvY29uZi9X SVRIT1VUX1NPVVJDRUxFU1MJMjAxMi0wMi0xMSAxNTozMTo0OS4yOTcwOTE1NTYgKzAxMDAKKysr IHN5cy9hbWQ2NC9jb25mL1dJVEhPVVRfU09VUkNFTEVTUwkxOTcwLTAxLTAxIDAxOjAwOjAwLjAw MDAwMDAwMCArMDEwMApAQCAtMSw3ICswLDAgQEAKLSMKLSMgV0lUSE9VVF9TT1VSQ0VMRVNTIC0t IERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcyBjb2RlLgotIwotIyAkRnJl ZUJTRCQKLQotaW5jbHVkZSBXSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAotaW5jbHVkZSBXSVRIT1VU X1NPVVJDRUxFU1NfVUNPREUKZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9hbWQ2NC9jb25mL1dJ VEhPVVRfU09VUkNFTEVTU19IT1NUIHN5cy9hbWQ2NC9jb25mL1dJVEhPVVRfU09VUkNFTEVTU19I T1NUCi0tLSBzeXMub2xkL2FtZDY0L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX0hPU1QJMjAxMi0w Mi0xMSAxNTozMTo0OS4yOTQwOTMzNDcgKzAxMDAKKysrIHN5cy9hbWQ2NC9jb25mL1dJVEhPVVRf U09VUkNFTEVTU19IT1NUCTE5NzAtMDEtMDEgMDE6MDA6MDAuMDAwMDAwMDAwICswMTAwCkBAIC0x LDEwICswLDAgQEAKLSMKLSMgV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIC0tIERpc2FibGUgZHJp dmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcwotIyBuYXRpdmUgY29kZSBmb3IgaG9zdCBDUFUu Ci0jCi0jICRGcmVlQlNEJAotCi1ub2RldmljZQlocHQyN3h4Ci1ub2RldmljZQlocHRtdgotbm9k ZXZpY2UJaHB0cnIKLW5vZGV2aWNlCW52ZQpkaWZmIC1OdXIgLXggLnN2biBzeXMub2xkL2FtZDY0 L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIHN5cy9hbWQ2NC9jb25mL1dJVEhPVVRfU09V UkNFTEVTU19VQ09ERQotLS0gc3lzLm9sZC9hbWQ2NC9jb25mL1dJVEhPVVRfU09VUkNFTEVTU19V Q09ERQkyMDEyLTAyLTExIDE1OjMxOjQ5LjI5NjA5MzY0MyArMDEwMAorKysgc3lzL2FtZDY0L2Nv bmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCTE5NzAtMDEtMDEgMDE6MDA6MDAuMDAwMDAwMDAw ICswMTAwCkBAIC0xLDQxICswLDAgQEAKLSMKLSMgV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIC0t IERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcwotIyBtaWNyb2NvZGUuCi0j Ci0jICRGcmVlQlNEJAotCi1ub2RldmljZQlhZHcKLW5vZGV2aWNlCWJjZQotbm9kZXZpY2UJZmF0 bQotbm9kZXZpY2UJZnhwCi1ub2RldmljZQlpc3Bmdwotbm9kZXZpY2UJbXdsZncKLW5vZGV2aWNl CXJhbGZ3Ci1ub2RldmljZQlydW5mdwotbm9kZXZpY2UJc2YKLW5vZGV2aWNlCXNuCi1ub2Rldmlj ZQl0aQotbm9kZXZpY2UJdHhwCi1ub2RldmljZQljZQotbm9kZXZpY2UJY3AKLW5vZGV2aWNlCWN0 YXUKLW5vZGV2aWNlCWlwd2Z3Ci1ub2RldmljZQlpd2lmdwotbm9kZXZpY2UJaXduZncKLW5vZGV2 aWNlCXdwaWZ3Ci0KLSMgZHJtCi1ub2RldmljZQltZ2EKLW5vZGV2aWNlCXIxMjgKLW5vZGV2aWNl CXJhZGVvbgotCi0jIHNvdW5kCi1ub2RldmljZQljc2EKLW5vZGV2aWNlCWRzMQotbm9kZXZpY2UJ bWFlc3RybzMKLQotIyB1c2IKLW5vZGV2aWNlCXJ1bQotbm9kZXZpY2UJdWF0aAotbm9kZXZpY2UJ enlkCi1ub2RldmljZQlrdWUKZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9jb25mL1dJVEhPVVRf U09VUkNFTEVTUyBzeXMvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1MKLS0tIHN5cy5vbGQvY29uZi9X SVRIT1VUX1NPVVJDRUxFU1MJMTk3MC0wMS0wMSAwMTowMDowMC4wMDAwMDAwMDAgKzAxMDAKKysr IHN5cy9jb25mL1dJVEhPVVRfU09VUkNFTEVTUwkyMDEyLTAyLTExIDE0OjUzOjEyLjc3ODE2NDAw MCArMDEwMApAQCAtMCwwICsxLDcgQEAKKyMKKyMgV0lUSE9VVF9TT1VSQ0VMRVNTIC0tIERpc2Fi bGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcyBjb2RlLgorIworIyAkRnJlZUJTRCQK KworaW5jbHVkZSBXSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAoraW5jbHVkZSBXSVRIT1VUX1NPVVJD RUxFU1NfVUNPREUKZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9jb25mL1dJVEhPVVRfU09VUkNF TEVTU19IT1NUIHN5cy9jb25mL1dJVEhPVVRfU09VUkNFTEVTU19IT1NUCi0tLSBzeXMub2xkL2Nv bmYvV0lUSE9VVF9TT1VSQ0VMRVNTX0hPU1QJMTk3MC0wMS0wMSAwMTowMDowMC4wMDAwMDAwMDAg KzAxMDAKKysrIHN5cy9jb25mL1dJVEhPVVRfU09VUkNFTEVTU19IT1NUCTIwMTItMDItMTEgMTQ6 NTM6MTIuNzgyMTYzMDAwICswMTAwCkBAIC0wLDAgKzEsMTAgQEAKKyMKKyMgV0lUSE9VVF9TT1VS Q0VMRVNTX1VDT0RFIC0tIERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcwor IyBuYXRpdmUgY29kZSBmb3IgaG9zdCBDUFUuCisjCisjICRGcmVlQlNEJAorCitub2RldmljZQlo cHQyN3h4Citub2RldmljZQlocHRtdgorbm9kZXZpY2UJaHB0cnIKK25vZGV2aWNlCW52ZQpkaWZm IC1OdXIgLXggLnN2biBzeXMub2xkL2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIHN5cy9j b25mL1dJVEhPVVRfU09VUkNFTEVTU19VQ09ERQotLS0gc3lzLm9sZC9jb25mL1dJVEhPVVRfU09V UkNFTEVTU19VQ09ERQkxOTcwLTAxLTAxIDAxOjAwOjAwLjAwMDAwMDAwMCArMDEwMAorKysgc3lz L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCTIwMTItMDItMTEgMTQ6NTM6MTIuODA3MTY0 MDAwICswMTAwCkBAIC0wLDAgKzEsNDEgQEAKKyMKKyMgV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RF IC0tIERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcworIyBtaWNyb2NvZGUu CisjCisjICRGcmVlQlNEJAorCitub2RldmljZQlhZHcKK25vZGV2aWNlCWJjZQorbm9kZXZpY2UJ ZmF0bQorbm9kZXZpY2UJZnhwCitub2RldmljZQlpc3Bmdworbm9kZXZpY2UJbXdsZncKK25vZGV2 aWNlCXJhbGZ3Citub2RldmljZQlydW5mdworbm9kZXZpY2UJc2YKK25vZGV2aWNlCXNuCitub2Rl dmljZQl0aQorbm9kZXZpY2UJdHhwCitub2RldmljZQljZQorbm9kZXZpY2UJY3AKK25vZGV2aWNl CWN0YXUKK25vZGV2aWNlCWlwd2Z3Citub2RldmljZQlpd2lmdworbm9kZXZpY2UJaXduZncKK25v ZGV2aWNlCXdwaWZ3CisKKyMgZHJtCitub2RldmljZQltZ2EKK25vZGV2aWNlCXIxMjgKK25vZGV2 aWNlCXJhZGVvbgorCisjIHNvdW5kCitub2RldmljZQljc2EKK25vZGV2aWNlCWRzMQorbm9kZXZp Y2UJbWFlc3RybzMKKworIyB1c2IKK25vZGV2aWNlCXJ1bQorbm9kZXZpY2UJdWF0aAorbm9kZXZp Y2UJenlkCitub2RldmljZQlrdWUKZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9pMzg2L2NvbmYv V0lUSE9VVF9TT1VSQ0VMRVNTIHN5cy9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTCi0tLSBz eXMub2xkL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1MJMjAxMi0wMi0xMSAxNTozMTo0OS4z MDIwOTA5MDAgKzAxMDAKKysrIHN5cy9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTCTE5NzAt MDEtMDEgMDE6MDA6MDAuMDAwMDAwMDAwICswMTAwCkBAIC0xLDcgKzAsMCBAQAotIwotIyBXSVRI T1VUX1NPVVJDRUxFU1MgLS0gRGlzYWJsZSBkcml2ZXJzIHRoYXQgaW5jbHVkZSBzb3VyY2VsZXNz IGNvZGUuCi0jCi0jICRGcmVlQlNEJAotCi1pbmNsdWRlIFdJVEhPVVRfU09VUkNFTEVTU19IT1NU Ci1pbmNsdWRlIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERQpkaWZmIC1OdXIgLXggLnN2biBzeXMu b2xkL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVCBzeXMvaTM4Ni9jb25mL1dJVEhP VVRfU09VUkNFTEVTU19IT1NUCi0tLSBzeXMub2xkL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxF U1NfSE9TVAkyMDEyLTAyLTExIDE1OjMxOjQ5LjMwMDA5MTE2MiArMDEwMAorKysgc3lzL2kzODYv Y29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAkxOTcwLTAxLTAxIDAxOjAwOjAwLjAwMDAwMDAw MCArMDEwMApAQCAtMSwxMCArMCwwIEBACi0jCi0jIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERSAt LSBEaXNhYmxlIGRyaXZlcnMgdGhhdCBpbmNsdWRlIHNvdXJjZWxlc3MKLSMgbmF0aXZlIGNvZGUg Zm9yIGhvc3QgQ1BVLgotIwotIyAkRnJlZUJTRCQKLQotbm9kZXZpY2UJaHB0Mjd4eAotbm9kZXZp Y2UJaHB0bXYKLW5vZGV2aWNlCWhwdHJyCi1ub2RldmljZQludmUKZGlmZiAtTnVyIC14IC5zdm4g c3lzLm9sZC9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIHN5cy9pMzg2L2NvbmYv V0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCi0tLSBzeXMub2xkL2kzODYvY29uZi9XSVRIT1VUX1NP VVJDRUxFU1NfVUNPREUJMjAxMi0wMi0xMSAxNTozMTo0OS4zMDEwOTEwMzEgKzAxMDAKKysrIHN5 cy9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCTE5NzAtMDEtMDEgMDE6MDA6MDAu MDAwMDAwMDAwICswMTAwCkBAIC0xLDQxICswLDAgQEAKLSMKLSMgV0lUSE9VVF9TT1VSQ0VMRVNT X1VDT0RFIC0tIERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcwotIyBtaWNy b2NvZGUuCi0jCi0jICRGcmVlQlNEJAotCi1ub2RldmljZQlhZHcKLW5vZGV2aWNlCWJjZQotbm9k ZXZpY2UJZmF0bQotbm9kZXZpY2UJZnhwCi1ub2RldmljZQlpc3Bmdwotbm9kZXZpY2UJbXdsZncK LW5vZGV2aWNlCXJhbGZ3Ci1ub2RldmljZQlydW5mdwotbm9kZXZpY2UJc2YKLW5vZGV2aWNlCXNu Ci1ub2RldmljZQl0aQotbm9kZXZpY2UJdHhwCi1ub2RldmljZQljZQotbm9kZXZpY2UJY3AKLW5v ZGV2aWNlCWN0YXUKLW5vZGV2aWNlCWlwd2Z3Ci1ub2RldmljZQlpd2lmdwotbm9kZXZpY2UJaXdu ZncKLW5vZGV2aWNlCXdwaWZ3Ci0KLSMgZHJtCi1ub2RldmljZQltZ2EKLW5vZGV2aWNlCXIxMjgK LW5vZGV2aWNlCXJhZGVvbgotCi0jIHNvdW5kCi1ub2RldmljZQljc2EKLW5vZGV2aWNlCWRzMQot bm9kZXZpY2UJbWFlc3RybzMKLQotIyB1c2IKLW5vZGV2aWNlCXJ1bQotbm9kZXZpY2UJdWF0aAot bm9kZXZpY2UJenlkCi1ub2RldmljZQlrdWUK --14dae934125de6bf8f04b8b13350-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 14:49:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE7011065670; Sat, 11 Feb 2012 14:49:25 +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 AD50B8FC0C; Sat, 11 Feb 2012 14:49: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 q1BEnPov035388; Sat, 11 Feb 2012 14:49:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BEnPqA035385; Sat, 11 Feb 2012 14:49:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202111449.q1BEnPqA035385@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 11 Feb 2012 14:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231521 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:49:25 -0000 Author: kib Date: Sat Feb 11 14:49:25 2012 New Revision: 231521 URL: http://svn.freebsd.org/changeset/base/231521 Log: The PTRACESTOP() macro is used only once. Inline the only use and remove the macro. MFC after: 1 week Modified: head/sys/kern/subr_syscall.c head/sys/sys/ptrace.h Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Sat Feb 11 13:41:38 2012 (r231520) +++ head/sys/kern/subr_syscall.c Sat Feb 11 14:49:25 2012 (r231521) @@ -85,7 +85,11 @@ syscallenter(struct thread *td, struct s if (error == 0) { STOPEVENT(p, S_SCE, sa->narg); - PTRACESTOP_SC(p, td, S_PT_SCE); + if (p->p_flag & P_TRACED && p->p_stops & S_PT_SCE) { + PROC_LOCK(p); + ptracestop((td), SIGTRAP); + PROC_UNLOCK(p); + } if (td->td_dbgflags & TDB_USERWR) { /* * Reread syscall number and arguments if Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Sat Feb 11 13:41:38 2012 (r231520) +++ head/sys/sys/ptrace.h Sat Feb 11 14:49:25 2012 (r231521) @@ -131,12 +131,6 @@ struct ptrace_vm_entry { #ifdef _KERNEL -#define PTRACESTOP_SC(p, td, flag) \ - if ((p)->p_flag & P_TRACED && (p)->p_stops & (flag)) { \ - PROC_LOCK(p); \ - ptracestop((td), SIGTRAP); \ - PROC_UNLOCK(p); \ - } /* * The flags below are used for ptrace(2) tracing and have no relation * to procfs. They are stored in struct proc's p_stops member. From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 14:55:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 206F71065670; Sat, 11 Feb 2012 14:55:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2E7A8FC12; Sat, 11 Feb 2012 14:55: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 q1BEt5kM035632; Sat, 11 Feb 2012 14:55:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BEt5X4035630; Sat, 11 Feb 2012 14:55:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201202111455.q1BEt5X4035630@svn.freebsd.org> From: Andriy Gapon Date: Sat, 11 Feb 2012 14:55: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: r231522 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:55:06 -0000 Author: avg Date: Sat Feb 11 14:55:05 2012 New Revision: 231522 URL: http://svn.freebsd.org/changeset/base/231522 Log: MFC r230157: dadump: don't leak the periph lock on i/o error Modified: stable/9/sys/cam/scsi/scsi_da.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/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Sat Feb 11 14:49:25 2012 (r231521) +++ stable/9/sys/cam/scsi/scsi_da.c Sat Feb 11 14:55:05 2012 (r231522) @@ -1100,6 +1100,7 @@ dadump(void *arg, void *virtual, vm_offs /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); xpt_polled_action((union ccb *)&csio); + cam_periph_unlock(periph); if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { printf("Aborting dump due to I/O error.\n"); @@ -1111,7 +1112,6 @@ dadump(void *arg, void *virtual, vm_offs csio.ccb_h.status, csio.scsi_status); return(EIO); } - cam_periph_unlock(periph); return(0); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 14:58:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C935106566B; Sat, 11 Feb 2012 14:58:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76FC18FC0C; Sat, 11 Feb 2012 14:58:47 +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 q1BEwlfq035787; Sat, 11 Feb 2012 14:58:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BEwlxG035785; Sat, 11 Feb 2012 14:58:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201202111458.q1BEwlxG035785@svn.freebsd.org> From: Andriy Gapon Date: Sat, 11 Feb 2012 14:58:47 +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: r231523 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:58:47 -0000 Author: avg Date: Sat Feb 11 14:58:46 2012 New Revision: 231523 URL: http://svn.freebsd.org/changeset/base/231523 Log: MFC r230157: dadump: don't leak the periph lock on i/o error Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Sat Feb 11 14:55:05 2012 (r231522) +++ stable/8/sys/cam/scsi/scsi_da.c Sat Feb 11 14:58:46 2012 (r231523) @@ -1097,6 +1097,7 @@ dadump(void *arg, void *virtual, vm_offs /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); xpt_polled_action((union ccb *)&csio); + cam_periph_unlock(periph); if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { printf("Aborting dump due to I/O error.\n"); @@ -1108,7 +1109,6 @@ dadump(void *arg, void *virtual, vm_offs csio.ccb_h.status, csio.scsi_status); return(EIO); } - cam_periph_unlock(periph); return(0); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 16:34:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C051065670; Sat, 11 Feb 2012 16:34:03 +0000 (UTC) (envelope-from cracauer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD6D08FC12; Sat, 11 Feb 2012 16:34:03 +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 q1BGY37x038863; Sat, 11 Feb 2012 16:34:03 GMT (envelope-from cracauer@svn.freebsd.org) Received: (from cracauer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BGY3BN038861; Sat, 11 Feb 2012 16:34:03 GMT (envelope-from cracauer@svn.freebsd.org) Message-Id: <201202111634.q1BGY3BN038861@svn.freebsd.org> From: Martin Cracauer Date: Sat, 11 Feb 2012 16:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231524 - head/usr.bin/tee X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 16:34:04 -0000 Author: cracauer Date: Sat Feb 11 16:34:03 2012 New Revision: 231524 URL: http://svn.freebsd.org/changeset/base/231524 Log: Reverting last change r231449 (fix bin/164947) due to concerns voiced on src-committers and the fact that I can only take care of this in a week. Modified: head/usr.bin/tee/tee.c Modified: head/usr.bin/tee/tee.c ============================================================================== --- head/usr.bin/tee/tee.c Sat Feb 11 14:58:46 2012 (r231523) +++ head/usr.bin/tee/tee.c Sat Feb 11 16:34:03 2012 (r231524) @@ -42,10 +42,8 @@ static const char rcsid[] = #endif /* not lint */ #include -#include #include #include -#include #include #include #include @@ -62,7 +60,6 @@ static LIST *head; static void add(int, const char *); static void usage(void); -static void waitfor(int fd); int main(int argc, char *argv[]) @@ -109,14 +106,9 @@ main(int argc, char *argv[]) bp = buf; do { if ((wval = write(p->fd, bp, n)) == -1) { - if (errno == EAGAIN) { - waitfor(p->fd); - wval = 0; - } else { - warn("%s", p->name); - exitval = 1; - break; - } + warn("%s", p->name); + exitval = 1; + break; } bp += wval; } while (n -= wval); @@ -145,15 +137,3 @@ add(int fd, const char *name) p->next = head; head = p; } - -/* Wait for the specified fd to be ready for writing */ -static void -waitfor(int fd) -{ - fd_set writefds; - - FD_ZERO(&writefds); - FD_SET(fd, &writefds); - if (select(fd + 1, NULL, &writefds, NULL, NULL) == -1) - err(1, "select"); -} From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 16:38:13 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F23A106566C; Sat, 11 Feb 2012 16:38:13 +0000 (UTC) (envelope-from cracauer@koef.zs64.net) Received: from koef.zs64.net (koef.zs64.net [IPv6:2001:470:1f0b:105e::1e6]) by mx1.freebsd.org (Postfix) with ESMTP id C75D98FC0A; Sat, 11 Feb 2012 16:38:09 +0000 (UTC) Received: from koef.zs64.net (koef.zs64.net [IPv6:2001:470:1f0b:105e::1e6]) by koef.zs64.net (8.14.5/8.14.5) with ESMTP id q1BGc7R5080395; Sat, 11 Feb 2012 16:38:07 GMT (envelope-from cracauer@koef.zs64.net) Received: (from cracauer@localhost) by koef.zs64.net (8.14.5/8.14.5/Submit) id q1BGc77j080394; Sat, 11 Feb 2012 11:38:07 -0500 (EST) (envelope-from cracauer) Date: Sat, 11 Feb 2012 11:38:07 -0500 From: Martin Cracauer To: Bruce Evans Message-ID: <20120211163807.GA25525@cons.org> References: <201202102216.q1AMGI0m098192@svn.freebsd.org> <20120211194854.J2214@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120211194854.J2214@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.ORG, Martin Cracauer , svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 16:38:13 -0000 I (kinda) knew I shouldn't have tried to do this real quick before leaving for a trip. I reverted the change and I'll fix the concerns including the commit message when I'm back in a week. Now I also want to know what exactly is going on in bash there, the difference between the explicit named pipe and bash'es construct is unexplained. Bruce, do you have a rule of thumb concerning reacting to EAGAIN with select/poll or with a busy loop, or with one try instantly and then going with select? Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/ From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 16:41:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6A0D106564A; Sat, 11 Feb 2012 16:41:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A19328FC1A; Sat, 11 Feb 2012 16:41: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 q1BGfqgk039141; Sat, 11 Feb 2012 16:41:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BGfqit039139; Sat, 11 Feb 2012 16:41:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202111641.q1BGfqit039139@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 11 Feb 2012 16:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231525 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 16:41:52 -0000 Author: pjd Date: Sat Feb 11 16:41:52 2012 New Revision: 231525 URL: http://svn.freebsd.org/changeset/base/231525 Log: Nice range comparison. MFC after: 3 days Modified: head/sbin/hastd/rangelock.c Modified: head/sbin/hastd/rangelock.c ============================================================================== --- head/sbin/hastd/rangelock.c Sat Feb 11 16:34:03 2012 (r231524) +++ head/sbin/hastd/rangelock.c Sat Feb 11 16:41:52 2012 (r231525) @@ -128,15 +128,13 @@ bool rangelock_islocked(struct rangelocks *rls, off_t offset, off_t length) { struct rlock *rl; + off_t end; PJDLOG_ASSERT(rls->rls_magic == RANGELOCKS_MAGIC); + end = offset + length; TAILQ_FOREACH(rl, &rls->rls_locks, rl_next) { - if (rl->rl_start >= offset && rl->rl_start < offset + length) - break; - else if (rl->rl_end > offset && rl->rl_end <= offset + length) - break; - else if (rl->rl_start < offset && rl->rl_end > offset + length) + if (rl->rl_start < end && rl->rl_end > offset) break; } return (rl != NULL); From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 17:29:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4802D1065676; Sat, 11 Feb 2012 17:29:08 +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 32DB78FC1B; Sat, 11 Feb 2012 17:29:08 +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 q1BHT8Tb040605; Sat, 11 Feb 2012 17:29:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BHT7Io040601; Sat, 11 Feb 2012 17:29:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202111729.q1BHT7Io040601@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 11 Feb 2012 17:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231526 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 17:29:08 -0000 Author: kib Date: Sat Feb 11 17:29:07 2012 New Revision: 231526 URL: http://svn.freebsd.org/changeset/base/231526 Log: Close a race due to dropping of the map lock between creating map entry for a shared mapping and marking the entry for inheritance. Other thread might execute vmspace_fork() in between (e.g. by fork(2)), resulting in the mapping becoming private. Noted and reviewed by: alc MFC after: 1 week Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Feb 11 16:41:52 2012 (r231525) +++ head/sys/vm/vm_map.c Sat Feb 11 17:29:07 2012 (r231526) @@ -1130,6 +1130,7 @@ vm_map_insert(vm_map_t map, vm_object_t vm_map_entry_t temp_entry; vm_eflags_t protoeflags; struct ucred *cred; + vm_inherit_t inheritance; boolean_t charge_prev_obj; VM_MAP_ASSERT_LOCKED(map); @@ -1173,6 +1174,10 @@ vm_map_insert(vm_map_t map, vm_object_t protoeflags |= MAP_ENTRY_NOSYNC; if (cow & MAP_DISABLE_COREDUMP) protoeflags |= MAP_ENTRY_NOCOREDUMP; + if (cow & MAP_INHERIT_SHARE) + inheritance = VM_INHERIT_SHARE; + else + inheritance = VM_INHERIT_DEFAULT; cred = NULL; KASSERT((object != kmem_object && object != kernel_object) || @@ -1227,7 +1232,7 @@ charged: * can extend the previous map entry to include the * new range as well. */ - if ((prev_entry->inheritance == VM_INHERIT_DEFAULT) && + if ((prev_entry->inheritance == inheritance) && (prev_entry->protection == prot) && (prev_entry->max_protection == max)) { map->size += (end - prev_entry->end); @@ -1276,7 +1281,7 @@ charged: new_entry->offset = offset; new_entry->avail_ssize = 0; - new_entry->inheritance = VM_INHERIT_DEFAULT; + new_entry->inheritance = inheritance; new_entry->protection = prot; new_entry->max_protection = max; new_entry->wired_count = 0; Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sat Feb 11 16:41:52 2012 (r231525) +++ head/sys/vm/vm_map.h Sat Feb 11 17:29:07 2012 (r231526) @@ -307,7 +307,7 @@ long vmspace_wired_count(struct vmspace /* * Copy-on-write flags for vm_map operations */ -#define MAP_UNUSED_01 0x0001 +#define MAP_INHERIT_SHARE 0x0001 #define MAP_COPY_ON_WRITE 0x0002 #define MAP_NOFAULT 0x0004 #define MAP_PREFAULT 0x0008 Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Feb 11 16:41:52 2012 (r231525) +++ head/sys/vm/vm_mmap.c Sat Feb 11 17:29:07 2012 (r231526) @@ -1517,6 +1517,9 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, docow |= MAP_DISABLE_SYNCER; if (flags & MAP_NOCORE) docow |= MAP_DISABLE_COREDUMP; + /* Shared memory is also shared with children. */ + if (flags & MAP_SHARED) + docow |= MAP_INHERIT_SHARE; if (flags & MAP_STACK) rv = vm_map_stack(map, *addr, size, prot, maxprot, @@ -1536,13 +1539,6 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, * or named anonymous without other references. */ vm_object_deallocate(object); - } else if (flags & MAP_SHARED) { - /* - * Shared memory is also shared with children. - */ - rv = vm_map_inherit(map, *addr, *addr + size, VM_INHERIT_SHARE); - if (rv != KERN_SUCCESS) - (void) vm_map_remove(map, *addr, *addr + size); } /* From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 18:51:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387D7106566B; Sat, 11 Feb 2012 18:51:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id C20F58FC12; Sat, 11 Feb 2012 18:51:42 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1BIpX4K018501 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Feb 2012 05:51:34 +1100 Date: Sun, 12 Feb 2012 05:51:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Martin Cracauer In-Reply-To: <20120211163807.GA25525@cons.org> Message-ID: <20120212040658.D4220@besplex.bde.org> References: <201202102216.q1AMGI0m098192@svn.freebsd.org> <20120211194854.J2214@besplex.bde.org> <20120211163807.GA25525@cons.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Martin Cracauer , svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 18:51:44 -0000 On Sat, 11 Feb 2012, Martin Cracauer wrote: > I (kinda) knew I shouldn't have tried to do this real quick before > leaving for a trip. I reverted the change and I'll fix the concerns > including the commit message when I'm back in a week. Now I also want > to know what exactly is going on in bash there, the difference between > the explicit named pipe and bash'es construct is unexplained. > > Bruce, do you have a rule of thumb concerning reacting to EAGAIN with > select/poll or with a busy loop, or with one try instantly and then > going with select? I think using select() directly is best, except possibly if there is only 1 more byte to write. A pure busy loop with write() is too likely to write tinygrams, and one write() try before select() is too likely to either return EAGAIN, or succeed and write a tinygram, leading to further tinygrams. Devices should have output watermarks and not return from select() when there is only space to write a tinygram. BTW, one of the many bugs in the tty driver in -current is that it no longer does watermark processing for select() and poll(), so it reads and writes tinygrams even when polled using select() and poll() (and there is no better way). I use the following quick fix: % Index: ttydisc.h % =================================================================== % RCS file: /home/ncvs/src/sys/sys/ttydisc.h,v % retrieving revision 1.7 % diff -u -2 -r1.7 ttydisc.h % --- ttydisc.h 23 Aug 2009 08:04:40 -0000 1.7 % +++ ttydisc.h 25 Sep 2010 14:37:54 -0000 % @@ -70,8 +70,13 @@ % ttydisc_read_poll(struct tty *tp) % { % + size_t navail; % % tty_lock_assert(tp, MA_OWNED); % % - return ttyinq_bytescanonicalized(&tp->t_inq); % + navail = ttyinq_bytescanonicalized(&tp->t_inq); % + if ((tp->t_termios.c_lflag & ICANON) == 0 && % + navail < tp->t_termios.c_cc[VMIN] && tp->t_termios.c_cc[VTIME] == 0) % + navail = 0; % + return (navail); % } % % @@ -79,8 +84,10 @@ % ttydisc_write_poll(struct tty *tp) % { % + size_t nleft; % % tty_lock_assert(tp, MA_OWNED); % % - return ttyoutq_bytesleft(&tp->t_outq); % + nleft = ttyoutq_bytesleft(&tp->t_outq); % + return (nleft >= tp->t_outlow ? nleft : 0); % } % The watermarks that affect applications should be under control of the application like they are for sockets. There is only limited control of the read watermark for ttys, by enabling MIN and setting it as high as possible (the maximum is normally UCHAR_MAX which is normally 255), and this is not standardized, but it works in Linux and used to work in FreeBSD. The watermarks that affect drivers should be under control of drivers like they used to be. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 19:41:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE62C1065673; Sat, 11 Feb 2012 19:41:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C82D78FC14; Sat, 11 Feb 2012 19:41: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 q1BJfu4L044829; Sat, 11 Feb 2012 19:41:56 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BJfu1R044828; Sat, 11 Feb 2012 19:41:56 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202111941.q1BJfu1R044828@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 11 Feb 2012 19:41:56 +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: r231527 - stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 19:41:57 -0000 Author: pfg Date: Sat Feb 11 19:41:56 2012 New Revision: 231527 URL: http://svn.freebsd.org/changeset/base/231527 Log: MFC: r230635 Set SVN text/plain property for some shell scripts that happen to have a .exe extension. While here fix the shebang of a shell script that was looking for /bin/bash. Reviewed by: gnn Approved by: jhb (mentor) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe (contents, props changed) Directory Properties: stable/9/cddl/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 20:01:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86C99106564A; Sat, 11 Feb 2012 20:01:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701B68FC08; Sat, 11 Feb 2012 20:01:04 +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 q1BK142U045661; Sat, 11 Feb 2012 20:01:04 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BK14jh045657; Sat, 11 Feb 2012 20:01:04 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202112001.q1BK14jh045657@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 11 Feb 2012 20:01:04 +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: r231528 - stable/9/sys/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:01:04 -0000 Author: pfg Date: Sat Feb 11 20:01:03 2012 New Revision: 231528 URL: http://svn.freebsd.org/changeset/base/231528 Log: MFC: r231168 Update the data structures with some fields reserved for ext4 but that can be used in ext3 mode. Also adjust the internal inode to carry the birthtime, like in UFS, which is starting to get some use when big inodes are available. This is a prerequisite for new features that will be coming in the future. Approved by: jhb (mentor) Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h stable/9/sys/fs/ext2fs/ext2fs.h stable/9/sys/fs/ext2fs/inode.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Feb 11 19:41:56 2012 (r231527) +++ stable/9/sys/fs/ext2fs/ext2_dinode.h Sat Feb 11 20:01:03 2012 (r231528) @@ -70,7 +70,7 @@ struct ext2fs_dinode { uint16_t e2di_uid; /* 2: Owner UID */ uint32_t e2di_size; /* 4: Size (in bytes) */ uint32_t e2di_atime; /* 8: Access time */ - uint32_t e2di_ctime; /* 12: Create time */ + uint32_t e2di_ctime; /* 12: Change time */ uint32_t e2di_mtime; /* 16: Modification time */ uint32_t e2di_dtime; /* 20: Deletion time */ uint16_t e2di_gid; /* 24: Owner GID */ @@ -89,6 +89,8 @@ struct ext2fs_dinode { uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ uint32_t e2di_linux_reserved3; /* 124 */ + uint16_t e2di_extra_isize; + uint16_t e2di_pad1; }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: stable/9/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2fs.h Sat Feb 11 19:41:56 2012 (r231527) +++ stable/9/sys/fs/ext2fs/ext2fs.h Sat Feb 11 20:01:03 2012 (r231528) @@ -123,7 +123,22 @@ struct ext2fs { char e3fs_reserved_char_pad; uint32_t e3fs_default_mount_opts; uint32_t e3fs_first_meta_bg; /* First metablock block group */ - uint32_t reserved2[190]; /* Padding to the end of the block */ + uint32_t e3fs_mkfs_time; /* when the fs was created */ + uint32_t e3fs_jnl_blks[17]; /* backup of the journal inode */ + uint32_t e4fs_bcount_hi; /* block count */ + uint32_t e4fs_rbcount_hi; /* reserved blocks count */ + uint32_t e4fs_fbcount_hi; /* free blocks count */ + uint16_t e4fs_min_extra_isize;/* all inodes have at least some bytes */ + uint16_t e4fs_want_extra_isize; /* new inodes should reserve some bytes */ + uint32_t e4fs_flags; /* miscellaneous flags */ + uint16_t e4fs_raid_stride; /* RAID stride */ + uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ + uint64_t e4fs_mmpblk; /* block for multi-mount protection */ + uint32_t e4fs_raid_stripe_wid;/* blocks on all data disks (N * stride) */ + uint8_t e4fs_log_gpf; /* FLEX_BG group size */ + uint8_t e4fs_char_pad2; + uint16_t e4fs_pad; + uint32_t reserved2[162]; /* Padding to the end of the block */ }; @@ -139,15 +154,15 @@ struct m_ext2fs { uint32_t e2fs_bsize; /* Block size */ uint32_t e2fs_bshift; /* calc of logical block no */ int32_t e2fs_bmask; /* calc of block offset */ - int32_t e2fs_bpg; /* Number of blocks per group */ + int32_t e2fs_bpg; /* Number of blocks per group */ int64_t e2fs_qbmask; /* = s_blocksize -1 */ uint32_t e2fs_fsbtodb; /* Shift to get disk block */ - uint32_t e2fs_ipg; /* Number of inodes per group */ - uint32_t e2fs_ipb; /* Number of inodes per block */ + uint32_t e2fs_ipg; /* Number of inodes per group */ + uint32_t e2fs_ipb; /* Number of inodes per block */ uint32_t e2fs_itpg; /* Number of inode table per group */ uint32_t e2fs_fsize; /* Size of fragments per block */ - uint32_t e2fs_fpb; /* Number of fragments per block */ - uint32_t e2fs_fpg; /* Number of fragments per group */ + uint32_t e2fs_fpb; /* Number of fragments per block */ + uint32_t e2fs_fpg; /* Number of fragments per group */ uint32_t e2fs_dbpg; /* Number of descriptor blocks per group */ uint32_t e2fs_descpb; /* Number of group descriptors per block */ uint32_t e2fs_gdbcount; /* Number of group descriptors */ @@ -161,7 +176,7 @@ struct m_ext2fs { char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ - int32_t e2fs_maxcontig; /* max number of contiguous blks */ + int32_t e2fs_maxcontig; /* max number of contiguous blks */ int32_t e2fs_contigsumsize; /* size of cluster summary array */ int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ Modified: stable/9/sys/fs/ext2fs/inode.h ============================================================================== --- stable/9/sys/fs/ext2fs/inode.h Sat Feb 11 19:41:56 2012 (r231527) +++ stable/9/sys/fs/ext2fs/inode.h Sat Feb 11 20:01:03 2012 (r231528) @@ -85,11 +85,13 @@ struct inode { int16_t i_nlink; /* File link count. */ uint64_t i_size; /* File byte count. */ int32_t i_atime; /* Last access time. */ - int32_t i_atimensec; /* Last access time. */ int32_t i_mtime; /* Last modified time. */ - int32_t i_mtimensec; /* Last modified time. */ int32_t i_ctime; /* Last inode change time. */ + int32_t i_birthtime; /* Inode creation time. */ + int32_t i_mtimensec; /* Last modified time. */ + int32_t i_atimensec; /* Last access time. */ int32_t i_ctimensec; /* Last inode change time. */ + int32_t i_birthnsec; /* Inode creation time. */ int32_t i_db[NDADDR]; /* Direct disk blocks. */ int32_t i_ib[NIADDR]; /* Indirect disk blocks. */ uint32_t i_flags; /* Status flags (chflags). */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 20:08:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228FF1065672; Sat, 11 Feb 2012 20:08:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C9A28FC13; Sat, 11 Feb 2012 20:08:47 +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 q1BK8kpa045970; Sat, 11 Feb 2012 20:08:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BK8kAg045968; Sat, 11 Feb 2012 20:08:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202112008.q1BK8kAg045968@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Feb 2012 20:08:46 +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: r231529 - stable/9/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:08:47 -0000 Author: jilles Date: Sat Feb 11 20:08:46 2012 New Revision: 231529 URL: http://svn.freebsd.org/changeset/base/231529 Log: MFC r231001: sh: Fix swapped INTON/INTOFF. A possible consequence of this bug was a memory leak if SIGINT arrived during a 'set' command (listing variables). Modified: stable/9/bin/sh/var.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/var.c ============================================================================== --- stable/9/bin/sh/var.c Sat Feb 11 20:01:03 2012 (r231528) +++ stable/9/bin/sh/var.c Sat Feb 11 20:08:46 2012 (r231529) @@ -600,7 +600,7 @@ showvarscmd(int argc __unused, char **ar } } - INTON; + INTOFF; vars = ckmalloc(n * sizeof(*vars)); i = 0; for (vpp = vartab; vpp < vartab + VTABSIZE; vpp++) { @@ -625,7 +625,7 @@ showvarscmd(int argc __unused, char **ar out1c('\n'); } ckfree(vars); - INTOFF; + INTON; return 0; } From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 20:28:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37AC3106566C; Sat, 11 Feb 2012 20:28:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE388FC12; Sat, 11 Feb 2012 20:28: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 q1BKSg0H046657; Sat, 11 Feb 2012 20:28:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKSgY3046649; Sat, 11 Feb 2012 20:28:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202112028.q1BKSgY3046649@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 20:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231530 - in head: lib/libc/gen tools/build/mk tools/build/options usr.sbin usr.sbin/utx usr.sbin/utxrm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:28:43 -0000 Author: ed Date: Sat Feb 11 20:28:42 2012 New Revision: 231530 URL: http://svn.freebsd.org/changeset/base/231530 Log: Replace utxrm(8) by utx(8). At first, I added a utility called utxrm(8) to remove stale entries from the user accounting database. It seems there are cases in which we need to perform different operations on the database as well. Simply rename utxrm(8) to utx(8) and place the old code under the "rm" command. In addition to "rm", this tool supports "boot" and "shutdown", which are going to be used by an rc-script which I am going to commit separately. Added: head/usr.sbin/utx/ - copied from r231514, head/usr.sbin/utxrm/ head/usr.sbin/utx/utx.8 - copied, changed from r231514, head/usr.sbin/utxrm/utxrm.8 head/usr.sbin/utx/utx.c - copied, changed from r231514, head/usr.sbin/utxrm/utxrm.c Deleted: head/usr.sbin/utx/utxrm.8 head/usr.sbin/utx/utxrm.c head/usr.sbin/utxrm/ Modified: head/lib/libc/gen/getutxent.3 head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/build/options/WITHOUT_UTMPX head/usr.sbin/Makefile head/usr.sbin/utx/Makefile Modified: head/lib/libc/gen/getutxent.3 ============================================================================== --- head/lib/libc/gen/getutxent.3 Sat Feb 11 20:08:46 2012 (r231529) +++ head/lib/libc/gen/getutxent.3 Sat Feb 11 20:28:42 2012 (r231530) @@ -423,7 +423,7 @@ The file format is invalid. .Xr tty 4 , .Xr ac 8 , .Xr newsyslog 8 , -.Xr utxrm 8 +.Xr utx 8 .Sh STANDARDS The .Fn endutxent , Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 11 20:08:46 2012 (r231529) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 11 20:28:42 2012 (r231530) @@ -3407,6 +3407,7 @@ OLD_FILES+=usr/bin/who OLD_FILES+=usr/bin/wtmpcvt OLD_FILES+=usr/sbin/ac OLD_FILES+=usr/sbin/lastlogin +OLD_FILES+=usr/sbin/utx OLD_FILES+=usr/sbin/utxrm OLD_FILES+=usr/share/man/man1/last.1.gz OLD_FILES+=usr/share/man/man1/users.1.gz @@ -3414,6 +3415,7 @@ OLD_FILES+=usr/share/man/man1/who.1.gz OLD_FILES+=usr/share/man/man1/wtmpcvt.1.gz OLD_FILES+=usr/share/man/man8/ac.8.gz OLD_FILES+=usr/share/man/man8/lastlogin.8.gz +OLD_FILES+=usr/share/man/man8/utx.8.gz OLD_FILES+=usr/share/man/man8/utxrm.8.gz .endif Modified: head/tools/build/options/WITHOUT_UTMPX ============================================================================== --- head/tools/build/options/WITHOUT_UTMPX Sat Feb 11 20:08:46 2012 (r231529) +++ head/tools/build/options/WITHOUT_UTMPX Sat Feb 11 20:28:42 2012 (r231530) @@ -6,4 +6,4 @@ Set to not build user accounting tools s .Xr ac 8 , .Xr lastlogin 8 and -.Xr utxrm 8 . +.Xr utx 8 . Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sat Feb 11 20:08:46 2012 (r231529) +++ head/usr.sbin/Makefile Sat Feb 11 20:28:42 2012 (r231530) @@ -306,7 +306,7 @@ SUBDIR+= usbdump .if ${MK_UTMPX} != "no" SUBDIR+= ac SUBDIR+= lastlogin -SUBDIR+= utxrm +SUBDIR+= utx .endif .if ${MK_WIRELESS} != "no" Modified: head/usr.sbin/utx/Makefile ============================================================================== --- head/usr.sbin/utxrm/Makefile Sat Feb 11 11:11:13 2012 (r231514) +++ head/usr.sbin/utx/Makefile Sat Feb 11 20:28:42 2012 (r231530) @@ -1,6 +1,9 @@ # $FreeBSD$ -PROG= utxrm -MAN= utxrm.8 +PROG= utx +MAN= utx.8 + +LINKS= ${BINDIR}/utx ${BINDIR}/utxrm +MLINKS= utx.8 utxrm.8 .include Copied and modified: head/usr.sbin/utx/utx.8 (from r231514, head/usr.sbin/utxrm/utxrm.8) ============================================================================== --- head/usr.sbin/utxrm/utxrm.8 Sat Feb 11 11:11:13 2012 (r231514, copy source) +++ head/usr.sbin/utx/utx.8 Sat Feb 11 20:28:42 2012 (r231530) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Ed Schouten +.\" Copyright (c) 2011-2012 Ed Schouten .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,20 +24,46 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2011 -.Dt UTXRM 8 +.Dd February 11, 2012 +.Dt UTX 8 .Os .Sh NAME +.Nm utx , .Nm utxrm -.Nd remove sessions from the user accounting database +.Nd manage the user accounting database .Sh SYNOPSIS .Nm +.Cm boot +.Nm +.Cm shutdown +.Nm +.Cm rm +.Ar identifier +.Ar ... +.Nm utxrm .Ar identifier .Ar ... .Sh DESCRIPTION The .Nm -utility can be used to remove stale sessions from the user accounting +utility can be used to perform operations on the user accounting +database, as done by +.Xr pututxline 3 . +.Pp +The first argument to +.Nm +indicates an action to be performed: +.Bl -tag -width ".Cm shutdown" +.It Cm boot +Write a boot time record to the user accounting database. +This option should typically only be used by +.Xr rc 8 . +.It Cm shutdown +Write a shutdown time record to the user accounting database. +This option should typically only be used by +.Xr rc 8 . +.It Cm rm +Remove stale sessions from the user accounting database, by referring to their .Ar identifier . Stale sessions can occur if a login service exits prematurely or fails @@ -57,6 +83,13 @@ Identifiers can either be supplied in he .Xr getent 1 , or as a string if the identifier allows such a representation. .Pp +To remain backward compatible, this action can also be invoked directly +by using the +.Nm utxrm +command. +.El +.Pp +.Pp Because this utility requires write-access to the user accounting database, its use is limited to the super-user. .Sh SEE ALSO @@ -66,7 +99,9 @@ database, its use is limited to the supe .Sh HISTORY The .Nm -utility appeared in -.Fx 9.0 . +utility replaced +.Nm utxrm +in +.Fx 10.0 . .Sh AUTHORS .An Ed Schouten Aq ed@FreeBSD.org Copied and modified: head/usr.sbin/utx/utx.c (from r231514, head/usr.sbin/utxrm/utxrm.c) ============================================================================== --- head/usr.sbin/utxrm/utxrm.c Sat Feb 11 11:11:13 2012 (r231514, copy source) +++ head/usr.sbin/utx/utx.c Sat Feb 11 20:28:42 2012 (r231530) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Ed Schouten + * Copyright (c) 2011-2012 Ed Schouten * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -47,38 +48,67 @@ b16_pton(const char *in, char *out, size return (0); } -int -main(int argc, char *argv[]) +static int +rm(char *id[]) { struct utmpx utx = { .ut_type = DEAD_PROCESS }; size_t len; - int i, ret = 0; - - if (argc < 2) { - fprintf(stderr, "usage: utxrm identifier ...\n"); - return (1); - } + int ret = 0; - gettimeofday(&utx.ut_tv, NULL); - for (i = 1; i < argc; i++) { - len = strlen(argv[i]); + (void)gettimeofday(&utx.ut_tv, NULL); + for (; *id != NULL; id++) { + len = strlen(*id); if (len <= sizeof(utx.ut_id)) { /* Identifier as string. */ - strncpy(utx.ut_id, argv[i], sizeof(utx.ut_id)); + strncpy(utx.ut_id, *id, sizeof(utx.ut_id)); } else if (len != sizeof(utx.ut_id) * 2 || - b16_pton(argv[i], utx.ut_id, sizeof(utx.ut_id)) != 0) { + b16_pton(*id, utx.ut_id, sizeof(utx.ut_id)) != 0) { /* Also not hexadecimal. */ - fprintf(stderr, "%s: Invalid identifier format\n", - argv[i]); + fprintf(stderr, "%s: Invalid identifier format\n", *id); ret = 1; continue; } /* Zap the entry. */ if (pututxline(&utx) == NULL) { - perror(argv[i]); + perror(*id); ret = 1; } } return (ret); } + +static int +boot(short type) +{ + struct utmpx utx = { .ut_type = type }; + + (void)gettimeofday(&utx.ut_tv, NULL); + if (pututxline(&utx) == NULL) { + perror("pututxline"); + return (1); + } + return (0); +} + +int +main(int argc, char *argv[]) +{ + + if (argc >= 2 && strcmp(getprogname(), "utxrm") == 0) + /* For compatibility. */ + return (rm(&argv[1])); + else if (argc == 2 && strcmp(argv[1], "boot") == 0) + return (boot(BOOT_TIME)); + else if (argc == 2 && strcmp(argv[1], "shutdown") == 0) + return (boot(SHUTDOWN_TIME)); + else if (argc >= 3 && strcmp(argv[1], "rm") == 0) + return (rm(&argv[2])); + + fprintf(stderr, + "usage: utx boot\n" + " utx shutdown\n" + " utx rm identifier ...\n" + " utxrm identifier ...\n"); + exit(1); +} From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 20:37:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04F12106566C; Sat, 11 Feb 2012 20:37:09 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E298D8FC13; Sat, 11 Feb 2012 20:37:08 +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 q1BKb8mK046967; Sat, 11 Feb 2012 20:37:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKb8l8046965; Sat, 11 Feb 2012 20:37:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202112037.q1BKb8l8046965@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Feb 2012 20:37:08 +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: r231531 - stable/8/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:37:09 -0000 Author: jilles Date: Sat Feb 11 20:37:08 2012 New Revision: 231531 URL: http://svn.freebsd.org/changeset/base/231531 Log: MFC r231001: sh: Fix swapped INTON/INTOFF. A possible consequence of this bug was a memory leak if SIGINT arrived during a 'set' command (listing variables). Modified: stable/8/bin/sh/var.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/var.c ============================================================================== --- stable/8/bin/sh/var.c Sat Feb 11 20:28:42 2012 (r231530) +++ stable/8/bin/sh/var.c Sat Feb 11 20:37:08 2012 (r231531) @@ -547,7 +547,7 @@ showvarscmd(int argc __unused, char **ar } } - INTON; + INTOFF; vars = ckmalloc(n * sizeof(*vars)); i = 0; for (vpp = vartab; vpp < vartab + VTABSIZE; vpp++) { @@ -566,7 +566,7 @@ showvarscmd(int argc __unused, char **ar out1c('\n'); } ckfree(vars); - INTOFF; + INTON; return 0; } From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 20:43:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7DA106564A; Sat, 11 Feb 2012 20:43:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 240DF8FC15; Sat, 11 Feb 2012 20:43: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 q1BKh1tI047245; Sat, 11 Feb 2012 20:43:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKh1tP047243; Sat, 11 Feb 2012 20:43:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202112043.q1BKh1tP047243@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 20:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231532 - head/lib/libipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:43:02 -0000 Author: bz Date: Sat Feb 11 20:43:01 2012 New Revision: 231532 URL: http://svn.freebsd.org/changeset/base/231532 Log: MFp4 204292: Ignore the NAT_T extension types so we can at least dump the SADB from the in-base libipsec/setkey without error when NAT_T support is present in the kernel, though not printing the additional information yet. However in case there is no NAT_T support in kernel still consider them to be an error. MFC after: 8 weeks Modified: head/lib/libipsec/pfkey.c Modified: head/lib/libipsec/pfkey.c ============================================================================== --- head/lib/libipsec/pfkey.c Sat Feb 11 20:37:08 2012 (r231531) +++ head/lib/libipsec/pfkey.c Sat Feb 11 20:43:01 2012 (r231532) @@ -1778,6 +1778,18 @@ pfkey_align(msg, mhp) case SADB_X_EXT_SA2: mhp[ext->sadb_ext_type] = (caddr_t)ext; break; + case SADB_X_EXT_NAT_T_TYPE: + case SADB_X_EXT_NAT_T_SPORT: + case SADB_X_EXT_NAT_T_DPORT: + /* case SADB_X_EXT_NAT_T_OA: is OAI */ + case SADB_X_EXT_NAT_T_OAI: + case SADB_X_EXT_NAT_T_OAR: + case SADB_X_EXT_NAT_T_FRAG: + if (feature_present("ipsec_natt")) { + mhp[ext->sadb_ext_type] = (caddr_t)ext; + break; + } + /* FALLTHROUGH */ default: __ipsec_errcode = EIPSEC_INVAL_EXTTYPE; return -1; From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 20:44:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65532106566B; Sat, 11 Feb 2012 20:44:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 346388FC1E; Sat, 11 Feb 2012 20:44: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 q1BKiH3W047339; Sat, 11 Feb 2012 20:44:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKiHc4047338; Sat, 11 Feb 2012 20:44:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202112044.q1BKiHc4047338@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Feb 2012 20:44:17 +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: r231533 - stable/9/bin/sh/funcs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:44:17 -0000 Author: jilles Date: Sat Feb 11 20:44:16 2012 New Revision: 231533 URL: http://svn.freebsd.org/changeset/base/231533 Log: MFC r230437: sh: Remove "kill" example function, which is superseded by the kill builtin. Deleted: stable/9/bin/sh/funcs/kill Modified: Directory Properties: stable/9/bin/sh/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 20:47:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EEEE106564A; Sat, 11 Feb 2012 20:47:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 088F08FC17; Sat, 11 Feb 2012 20:47: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 q1BKlGq9047504; Sat, 11 Feb 2012 20:47:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKlGhP047498; Sat, 11 Feb 2012 20:47:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202112047.q1BKlGhP047498@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 20:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231534 - in head: etc/rc.d sbin/init X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:47:17 -0000 Author: ed Date: Sat Feb 11 20:47:16 2012 New Revision: 231534 URL: http://svn.freebsd.org/changeset/base/231534 Log: Move utmpx handling out of init(8). This has the following advantages: - During boot, the BOOT_TIME record is now written right after the file systems become writable, but before users are allowed to log in. This means that they can't cause `hidden logins' by logging in right before init(8) kicks in. - The pututxline(3) function may potentially block on file locking, though this is very rare to occur. By placing it in an rc script, the user can still kill it with ^C if needed. - Most importantly: jails don't use init(8). This means that a force reboot of a system running jails will leave stale entries in the accounting database of the jails individually. Added: head/etc/rc.d/utx (contents, props changed) Modified: head/etc/rc.d/Makefile head/etc/rc.d/cleanvar head/sbin/init/init.8 head/sbin/init/init.c Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Feb 11 20:44:16 2012 (r231533) +++ head/etc/rc.d/Makefile Sat Feb 11 20:47:16 2012 (r231534) @@ -144,6 +144,7 @@ FILES= DAEMON \ tmp \ ${_ubthidhci} \ ugidfw \ + ${_utx} \ var \ virecover \ watchdogd \ @@ -177,6 +178,10 @@ _nscd= nscd _ubthidhci= ubthidhci .endif +.if ${MK_UTMPX} != "no" +_utx= utx +.endif + FILESDIR= /etc/rc.d FILESMODE= ${BINMODE} Modified: head/etc/rc.d/cleanvar ============================================================================== --- head/etc/rc.d/cleanvar Sat Feb 11 20:44:16 2012 (r231533) +++ head/etc/rc.d/cleanvar Sat Feb 11 20:47:16 2012 (r231534) @@ -58,8 +58,6 @@ cleanvar_start () { if [ -d /var/run -a ! -f /var/run/clean_var ]; then purgedir /var/run - # And an initial utmpx active session file - (cd /var/run && cp /dev/null utx.active && chmod 644 utx.active) >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then Added: head/etc/rc.d/utx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/utx Sat Feb 11 20:47:16 2012 (r231534) @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: utx +# REQUIRE: DAEMON cleanvar +# BEFORE: LOGIN +# KEYWORD: shutdown + +. /etc/rc.subr + +name="utx" +start_cmd="utx boot" +stop_cmd="utx shutdown" + +load_rc_config $name +run_rc_command "$1" Modified: head/sbin/init/init.8 ============================================================================== --- head/sbin/init/init.8 Sat Feb 11 20:44:16 2012 (r231533) +++ head/sbin/init/init.8 Sat Feb 11 20:47:16 2012 (r231534) @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd January 23, 2011 +.Dd February 11, 2012 .Dt INIT 8 .Os .Sh NAME @@ -146,14 +146,7 @@ executes a shell for that user. When this shell dies, either because the user logged out or an abnormal termination occurred (a signal), -.Nm login -records the logout in the user accounting -database (see -.Xr getutxent 3) -and terminates. -The cycle is -then restarted by -.Nm +the cycle is restarted by executing a new .Nm getty for the line. Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Sat Feb 11 20:44:16 2012 (r231533) +++ head/sbin/init/init.c Sat Feb 11 20:47:16 2012 (r231534) @@ -66,7 +66,6 @@ static const char rcsid[] = #include #include #include -#include #include #include @@ -181,8 +180,6 @@ static void setprocresources(const char #endif static int clang; -static void clear_session_logs(session_t *); - static int start_session_db(void); static void add_session(session_t *); static void del_session(session_t *); @@ -567,20 +564,6 @@ transition(state_t s) } /* - * Close out the accounting files for a login session. - * NB: should send a message to the session logger to avoid blocking. - */ -static void -clear_session_logs(session_t *sp __unused) -{ - - /* - * XXX: Use getutxline() and call pututxline() for each entry. - * Is this safe to do this here? Is it really required anyway? - */ -} - -/* * Start a session and allocate a controlling terminal. * Only called by children of init after forking. */ @@ -780,17 +763,12 @@ single_user(void) static state_func_t runcom(void) { - struct utmpx utx; state_func_t next_transition; if ((next_transition = run_script(_PATH_RUNCOM)) != 0) return next_transition; runcom_mode = AUTOBOOT; /* the default */ - /* NB: should send a message to the session logger to avoid blocking. */ - utx.ut_type = BOOT_TIME; - gettimeofday(&utx.ut_tv, NULL); - pututxline(&utx); return (state_func_t) read_ttys; } @@ -1119,8 +1097,6 @@ read_ttys(void) * There shouldn't be any, but just in case... */ for (sp = sessions; sp; sp = snext) { - if (sp->se_process) - clear_session_logs(sp); snext = sp->se_next; free_session(sp); } @@ -1274,7 +1250,6 @@ collect_child(pid_t pid) if (! (sp = find_session(pid))) return; - clear_session_logs(sp); del_session(sp); sp->se_process = 0; @@ -1504,14 +1479,8 @@ alrm_handler(int sig) static state_func_t death(void) { - struct utmpx utx; session_t *sp; - /* NB: should send a message to the session logger to avoid blocking. */ - utx.ut_type = SHUTDOWN_TIME; - gettimeofday(&utx.ut_tv, NULL); - pututxline(&utx); - /* * Also revoke the TTY here. Because runshutdown() may reopen * the TTY whose getty we're killing here, there is no guarantee From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 21:06:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B3F61065672; Sat, 11 Feb 2012 21:06:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9FB78FC0A; Sat, 11 Feb 2012 21:06: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 q1BL6j4k048149; Sat, 11 Feb 2012 21:06:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BL6jMf048146; Sat, 11 Feb 2012 21:06:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202112106.q1BL6jMf048146@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Feb 2012 21:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231535 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 21:06:46 -0000 Author: jilles Date: Sat Feb 11 21:06:45 2012 New Revision: 231535 URL: http://svn.freebsd.org/changeset/base/231535 Log: sh: Make 'hash' return 1 if at least one utility is not found. Reported by: lme Added: head/tools/regression/bin/sh/builtins/hash4.0 (contents, props changed) Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sat Feb 11 20:47:16 2012 (r231534) +++ head/bin/sh/exec.c Sat Feb 11 21:06:45 2012 (r231535) @@ -231,7 +231,9 @@ hashcmd(int argc __unused, char **argv _ int verbose; struct cmdentry entry; char *name; + int errors; + errors = 0; verbose = 0; while ((c = nextopt("rv")) != '\0') { if (c == 'r') { @@ -254,19 +256,21 @@ hashcmd(int argc __unused, char **argv _ && cmdp->cmdtype == CMDNORMAL) delete_cmd_entry(); find_command(name, &entry, DO_ERR, pathval()); - if (verbose) { - if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ - cmdp = cmdlookup(name, 0); - if (cmdp != NULL) - printentry(cmdp, verbose); - else - outfmt(out2, "%s: not found\n", name); + if (entry.cmdtype == CMDUNKNOWN) + errors = 1; + else if (verbose) { + cmdp = cmdlookup(name, 0); + if (cmdp != NULL) + printentry(cmdp, verbose); + else { + outfmt(out2, "%s: not found\n", name); + errors = 1; } flushall(); } argptr++; } - return 0; + return errors; } Added: head/tools/regression/bin/sh/builtins/hash4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/hash4.0 Sat Feb 11 21:06:45 2012 (r231535) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +exec 3>&1 +m=`hash nosuchtool 2>&1 >&3` +r=$? +[ "$r" != 0 ] && [ -n "$m" ] From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 21:49:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8647C1065670; Sat, 11 Feb 2012 21:49:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6681D8FC15; Sat, 11 Feb 2012 21:49: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 q1BLnOdx049513; Sat, 11 Feb 2012 21:49:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BLnOfT049510; Sat, 11 Feb 2012 21:49:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202112149.q1BLnOfT049510@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 21:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231536 - head/usr.bin/who X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 21:49:24 -0000 Author: ed Date: Sat Feb 11 21:49:23 2012 New Revision: 231536 URL: http://svn.freebsd.org/changeset/base/231536 Log: Attempt to implement who -a. According to POSIX, -a is equal to -bdlprtTu. It seems this is not true in practice, as -b normally restricts the output to BOOT_TIME entries and all implementations that I know of don't. Modified: head/usr.bin/who/who.1 head/usr.bin/who/who.c Modified: head/usr.bin/who/who.1 ============================================================================== --- head/usr.bin/who/who.1 Sat Feb 11 21:06:45 2012 (r231535) +++ head/usr.bin/who/who.1 Sat Feb 11 21:49:23 2012 (r231536) @@ -28,7 +28,7 @@ .\" @(#)who.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd Oct 28, 2011 +.Dd February 11, 2012 .Dt WHO 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd display who is on the system .Sh SYNOPSIS .Nm -.Op Fl bHmqsTu +.Op Fl abHmqsTu .Op Cm am I .Op Ar file .Sh DESCRIPTION @@ -48,6 +48,11 @@ remote hostname if not local. .Pp The options are as follows: .Bl -tag -width indent +.It Fl a +Equivalent to +.Fl bTu , +with the exception that output isn't restricted to the time and date of +the last system reboot. .It Fl b Write the time and date of the last system reboot. .It Fl H Modified: head/usr.bin/who/who.c ============================================================================== --- head/usr.bin/who/who.c Sat Feb 11 21:06:45 2012 (r231535) +++ head/usr.bin/who/who.c Sat Feb 11 21:49:23 2012 (r231536) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include static void heading(void); -static void boottime(void); static void process_utmp(void); static void quick(void); static void row(const struct utmpx *); @@ -57,6 +56,7 @@ static void usage(void); static void whoami(void); static int Hflag; /* Write column headings */ +static int aflag; /* Print all entries */ static int bflag; /* Show date of the last reboot */ static int mflag; /* Show info about current terminal */ static int qflag; /* "Quick" mode */ @@ -71,7 +71,7 @@ main(int argc, char *argv[]) setlocale(LC_TIME, ""); - while ((ch = getopt(argc, argv, "HTbmqsu")) != -1) { + while ((ch = getopt(argc, argv, "HTabmqsu")) != -1) { switch (ch) { case 'H': /* Write column headings */ Hflag = 1; @@ -79,6 +79,9 @@ main(int argc, char *argv[]) case 'T': /* Show terminal state */ Tflag = 1; break; + case 'a': /* Same as -bdlprtTu */ + aflag = bflag = Tflag = uflag = 1; + break; case 'b': /* Show date of the last reboot */ bflag = 1; break; @@ -126,8 +129,6 @@ main(int argc, char *argv[]) heading(); if (mflag) whoami(); - else if (bflag) - boottime(); else process_utmp(); } @@ -226,26 +227,14 @@ process_utmp(void) struct utmpx *utx; while ((utx = getutxent()) != NULL) { - if (utx->ut_type != USER_PROCESS) - continue; - if (ttystat(utx->ut_line) != 0) - continue; - row(utx); + if (((aflag || !bflag) && utx->ut_type == USER_PROCESS) || + (bflag && utx->ut_type == BOOT_TIME)) + if (ttystat(utx->ut_line) == 0) + row(utx); } } static void -boottime(void) -{ - struct utmpx u1, *u2; - - u1.ut_type = BOOT_TIME; - if ((u2 = getutxid(&u1)) == NULL) - return; - row(u2); -} - -static void quick(void) { struct utmpx *utx; From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 21:50:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07C5D1065670; Sat, 11 Feb 2012 21:50:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC6EA8FC0C; Sat, 11 Feb 2012 21:50: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 q1BLoi20049598; Sat, 11 Feb 2012 21:50:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BLoiFg049596; Sat, 11 Feb 2012 21:50:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202112150.q1BLoiFg049596@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 21:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231537 - head/usr.bin/who X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 21:50:45 -0000 Author: ed Date: Sat Feb 11 21:50:44 2012 New Revision: 231537 URL: http://svn.freebsd.org/changeset/base/231537 Log: And of course, I forgot to add -a to the usage. Modified: head/usr.bin/who/who.c Modified: head/usr.bin/who/who.c ============================================================================== --- head/usr.bin/who/who.c Sat Feb 11 21:49:23 2012 (r231536) +++ head/usr.bin/who/who.c Sat Feb 11 21:50:44 2012 (r231537) @@ -142,7 +142,7 @@ static void usage(void) { - fprintf(stderr, "usage: who [-bHmqsTu] [am I] [file]\n"); + fprintf(stderr, "usage: who [-abHmqsTu] [am I] [file]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 22:58:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 4E64F1065673; Sat, 11 Feb 2012 22:58:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 426A41515D5; Sat, 11 Feb 2012 22:58:46 +0000 (UTC) Message-ID: <4F36F2A5.6040405@FreeBSD.org> Date: Sat, 11 Feb 2012 14:58:45 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Ed Schouten References: <201202112047.q1BKlGhP047498@svn.freebsd.org> In-Reply-To: <201202112047.q1BKlGhP047498@svn.freebsd.org> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231534 - in head: etc/rc.d sbin/init X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 22:58:47 -0000 On 02/11/2012 12:47, Ed Schouten wrote: > +# BEFORE: LOGIN New scripts in the base should not use BEFORE. Rather, LOGIN should REQUIRE this script. Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 23:15:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B4A6106566B; Sat, 11 Feb 2012 23:15:15 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF3158FC18; Sat, 11 Feb 2012 23:15: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 q1BNFEu7054481; Sat, 11 Feb 2012 23:15:14 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BNFEkv054476; Sat, 11 Feb 2012 23:15:14 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201202112315.q1BNFEkv054476@svn.freebsd.org> From: Craig Rodrigues Date: Sat, 11 Feb 2012 23:15: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: r231538 - stable/8/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 23:15:15 -0000 Author: rodrigc Date: Sat Feb 11 23:15:14 2012 New Revision: 231538 URL: http://svn.freebsd.org/changeset/base/231538 Log: MFC 196045 through 231537 - this records svn:mergeinfo for previously merged changesets This pulls in changes such as: MFC 216370 - Remove adertising clause from UCB copyrighted files in usr.bin MFC 222534 - Fix a couple of spelling errors. MFC 223493 - Remove duplicated header files MFC 223135 - 223491 - man page updates MFC 229403 - Replace index() and rindex() calls with strchr() and strrchr(). MFC 230044 - fgets(3) returns a pointer, so compare against NULL, not integer 0. Modified: stable/8/usr.bin/tftp/main.c stable/8/usr.bin/tftp/tftp.1 stable/8/usr.bin/tftp/tftp.c stable/8/usr.bin/tftp/tftp.h Directory Properties: stable/8/usr.bin/tftp/ (props changed) Modified: stable/8/usr.bin/tftp/main.c ============================================================================== --- stable/8/usr.bin/tftp/main.c Sat Feb 11 21:50:44 2012 (r231537) +++ stable/8/usr.bin/tftp/main.c Sat Feb 11 23:15:14 2012 (r231538) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -56,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -159,7 +154,7 @@ static struct cmd cmdtab[] = { { "options", setoptions, "enable or disable RFC2347 style options" }, { "help", help, "print help information" }, - { "packetdrop", setpacketdrop, "artifical packetloss feature" }, + { "packetdrop", setpacketdrop, "artificial packetloss feature" }, { "?", help, "print help information" }, { NULL, NULL, NULL } }; @@ -442,16 +437,16 @@ put(int argc, char *argv[]) return; } targ = argv[argc - 1]; - if (rindex(argv[argc - 1], ':')) { + if (strrchr(argv[argc - 1], ':')) { char *lcp; for (n = 1; n < argc - 1; n++) - if (index(argv[n], ':')) { + if (strchr(argv[n], ':')) { putusage(argv[0]); return; } lcp = argv[argc - 1]; - targ = rindex(lcp, ':'); + targ = strrchr(lcp, ':'); *targ++ = 0; if (lcp[0] == '[' && lcp[strlen(lcp) - 1] == ']') { lcp[strlen(lcp) - 1] = '\0'; @@ -482,7 +477,7 @@ put(int argc, char *argv[]) } /* this assumes the target is a directory */ /* on a remote unix system. hmmmm. */ - cp = index(targ, '\0'); + cp = strchr(targ, '\0'); *cp++ = '/'; for (n = 1; n < argc - 1; n++) { strcpy(cp, tail(argv[n])); @@ -537,7 +532,7 @@ get(int argc, char *argv[]) } if (!connected) { for (n = 1; n < argc ; n++) - if (rindex(argv[n], ':') == 0) { + if (strrchr(argv[n], ':') == 0) { printf("No remote host specified and " "no host given for file '%s'\n", argv[n]); getusage(argv[0]); @@ -545,7 +540,7 @@ get(int argc, char *argv[]) } } for (n = 1; n < argc ; n++) { - src = rindex(argv[n], ':'); + src = strrchr(argv[n], ':'); if (src == NULL) src = argv[n]; else { @@ -686,7 +681,7 @@ tail(char *filename) char *s; while (*filename) { - s = rindex(filename, '/'); + s = strrchr(filename, '/'); if (s == NULL) break; if (s[1]) @@ -739,7 +734,7 @@ command(void) history(hist, &he, H_ENTER, bp); } else { line[0] = 0; - if (fgets(line, sizeof line , stdin) == 0) { + if (fgets(line, sizeof line , stdin) == NULL) { if (feof(stdin)) { exit(txrx_error); } else { @@ -844,8 +839,8 @@ help(int argc, char *argv[]) printf("%-*s\t%s\n", (int)HELPINDENT, c->name, c->help); printf("\n[-] : You shouldn't use these ones anymore.\n"); - printf("[*] : RFC2834 options support required.\n"); - printf("[**] : Non-standard RFC2834 option.\n"); + printf("[*] : RFC2347 options support required.\n"); + printf("[**] : Non-standard RFC2347 option.\n"); return; } while (--argc > 0) { @@ -959,7 +954,7 @@ setblocksize(int argc, char *argv[]) if (!options_rfc_enabled) printf("RFC2347 style options are not enabled " - "(but proceding anyway)\n"); + "(but proceeding anyway)\n"); if (argc != 1) { int size = atoi(argv[1]); @@ -997,7 +992,7 @@ setblocksize2(int argc, char *argv[]) if (!options_rfc_enabled || !options_extra_enabled) printf( "RFC2347 style or non-RFC defined options are not enabled " - "(but proceding anyway)\n"); + "(but proceeding anyway)\n"); if (argc != 1) { int size = atoi(argv[1]); Modified: stable/8/usr.bin/tftp/tftp.1 ============================================================================== --- stable/8/usr.bin/tftp/tftp.1 Sat Feb 11 21:50:44 2012 (r231537) +++ stable/8/usr.bin/tftp/tftp.1 Sat Feb 11 23:15:14 2012 (r231538) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. @@ -32,7 +28,7 @@ .\" @(#)tftp.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 1, 2003 +.Dd June 22, 2011 .Dt TFTP 1 .Os .Sh NAME @@ -74,6 +70,21 @@ Shorthand for "mode ascii" .It Cm binary Shorthand for "mode binary" .Pp +.It Cm blocksize Ar [size] +Sets the TFTP blksize option in TFTP Read Request or Write Request packets +to +.Ar [size] +as specified in RFC 2348. Valid values are between 8 and 65464. +If no blocksize is specified, then by default a blocksize of 512 bytes +will be used. +.Pp +.It Cm blocksize2 Ar [size] +Sets the TFTP blksize2 option in TFTP Read Request or Write Request packets +to +.Ar [size] . +Values are restricted to powers of 2 between 8 and 32768. This is a +non-standard TFTP option. +.Pp .It Cm connect Ar host Op Ar port Set the .Ar host @@ -97,6 +108,14 @@ or .Cm put commands. .Pp +.It Cm debug Ar level +Enable or disable debugging levels during verbose output. The value of +.Ar level +can be one of +.Cm packet, simple, options, +or +.Cm access. +.Pp .It Cm get Oo Ar host : Oc Ns Ar file Op Ar localname .It Cm get Xo .Oo Ar host1 : Oc Ns Ar file1 @@ -134,6 +153,11 @@ or The default is .Em ascii . .Pp +.It Cm packetdrop [arg] +Randomly drop +.Ar arg +out of 100 packets during a transfer. This is a debugging feature. +.Pp .It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename .It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory Put a file or set of files to the remote host. @@ -153,6 +177,17 @@ see the example under the .Cm get command. .Pp +.It Cm options Ar [arg] +Enable or disable support for TFTP options. The valid values of +.Ar arg +are +.Cm on +(enable RFC 2347 options), +.Cm off +(disable RFC 2347 options), and +.Cm extra +(toggle support for non-RFC defined options). +.Pp .It Cm quit Exit .Nm . @@ -161,6 +196,15 @@ An end of file also exits. .It Cm rexmt Ar retransmission-timeout Set the per-packet retransmission timeout, in seconds. .Pp +.It Cm rollover [arg] +Specify the rollover option in TFTP Read Request or Write +Request packets. After 65535 packets have been transmitted, set the block +counter to +.Ar arg . +Valid values of +.Ar arg +are 0 and 1. This is a non-standard TFTP option. +.Pp .It Cm status Show current status. .Pp @@ -173,12 +217,52 @@ Toggle packet tracing. .It Cm verbose Toggle verbose mode. .El +.Sh SEE ALSO +.Xr tftpd 8 +.Pp +The following RFC's are supported: +.Rs +RFC 1350 +.%T The TFTP Protocol (Revision 2) +.Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Rs +RFC 3617 +.%T Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP) +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm command appeared in .Bx 4.3 . -.Sh BUGS +.Pp +Edwin Groothuis performed a major rewrite of the +.Xr tftpd 8 +and +.Nm +code to support RFC2348. +.Sh NOTES Because there is no user-login or validation within the .Tn TFTP @@ -189,4 +273,5 @@ exact methods are specific to each site difficult to document here. .Pp Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting blocksize negotiation (RFC1783). +without client and server supporting the TFTP blocksize option (RFC2348), +or the non-standard TFTP rollover option. Modified: stable/8/usr.bin/tftp/tftp.c ============================================================================== --- stable/8/usr.bin/tftp/tftp.c Sat Feb 11 21:50:44 2012 (r231537) +++ stable/8/usr.bin/tftp/tftp.c Sat Feb 11 23:15:14 2012 (r231538) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: stable/8/usr.bin/tftp/tftp.h ============================================================================== --- stable/8/usr.bin/tftp/tftp.h Sat Feb 11 21:50:44 2012 (r231537) +++ stable/8/usr.bin/tftp/tftp.h Sat Feb 11 23:15:14 2012 (r231538) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 23:21:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9943E106564A; Sat, 11 Feb 2012 23:21:41 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 3103C8FC13; Sat, 11 Feb 2012 23:21:41 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 3CCB82A28CD0; Sun, 12 Feb 2012 00:21:40 +0100 (CET) Date: Sun, 12 Feb 2012 00:21:40 +0100 From: Ed Schouten To: Doug Barton Message-ID: <20120211232140.GU1860@hoeg.nl> References: <201202112047.q1BKlGhP047498@svn.freebsd.org> <4F36F2A5.6040405@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hgy5D1otryeNPdmY" Content-Disposition: inline In-Reply-To: <4F36F2A5.6040405@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231534 - in head: etc/rc.d sbin/init X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 23:21:41 -0000 --hgy5D1otryeNPdmY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Doug, * Doug Barton , 20120211 23:58: > New scripts in the base should not use BEFORE. Rather, LOGIN should > REQUIRE this script. You mean like this? I noticed there are still over 60 occurrences of BEFORE in the tree. Looks like there's still quite a lot of work to do to get rid of it then. %%% Index: etc/rc.d/utx =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 --- etc/rc.d/utx (revision 231534) +++ etc/rc.d/utx (working copy) @@ -5,7 +5,6 @@ =20 # PROVIDE: utx # REQUIRE: DAEMON cleanvar -# BEFORE: LOGIN # KEYWORD: shutdown =20 . /etc/rc.subr Index: etc/rc.d/LOGIN =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 --- etc/rc.d/LOGIN (revision 231514) +++ etc/rc.d/LOGIN (working copy) @@ -4,7 +4,7 @@ # =20 # PROVIDE: LOGIN -# REQUIRE: DAEMON +# REQUIRE: DAEMON utx =20 # This is a dummy dependency to ensure user services such as xdm, # inetd, cron and kerberos are started after everything else, in case %%% --=20 Ed Schouten WWW: http://80386.nl/ --hgy5D1otryeNPdmY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iQIcBAEBAgAGBQJPNvgEAAoJEG5e2P40kaK7UHQP/0fFB9xIu+9IX5WXHkEc56EL wS9iCMfRx7KkVEEdITx2RzJCNKGkYX3QeXtyQLUk/nAj9uvnqYiW8vkwEkapJzxC 54wDwG7p5gzgaJYf39XMqrl6XEyDC4b8Htlmnu/eWFntSXw1iiJinkOa4j2i1ROl gh01uL5H60WAuFLsHAGrjj4VUWCkJEoVITxfqbQwCpIUb1OloKhHVD0qBYcjVWM8 MLc8xZpwPa5fW2XiO+brw6RraEWmC0euhUBCMVw1GbuXFKDrSbyIPqb9UtiZkpp8 CDasO+Oak0xRloGxgCT7A4KTPsXXSgCBiatmWvpgc4KTpKy/KC3+7S36ttVY2vB4 aqxlvD5PRhd6vwhVjJvn2zzvjDQP5xWd8VDiJzziVpg8A5a5catjRqptHQkV7ni+ 09VHmjUkyweDoUWfg6DZdWXORCqbw2jvp+q8cWQn+8Img+S9w3St0G8vmCFlJnMz ip16jSyXn6UH/f4Siy/DXgLZrw6I6pcntC3fendn/76wYUVxYUJDAzujVmWYiSEE EUUq25xBwZlgLcPszhYxSjwfDg6Lm20tcW8KpzLwsLjbksoqiOeVO4yCbBA1Nkrc 6fjWELcZPR6hvICKYMBYjSyD/eJNkR12Oms+R45bwh9K64daDY3Pyu5lr6z0bt9C E8uzKvBSxHgRypt0ozny =BTDT -----END PGP SIGNATURE----- --hgy5D1otryeNPdmY-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 23:39:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D39FE106564A; Sat, 11 Feb 2012 23:39:53 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCE3C8FC13; Sat, 11 Feb 2012 23:39: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 q1BNdrbU055424; Sat, 11 Feb 2012 23:39:53 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BNdr6G055419; Sat, 11 Feb 2012 23:39:53 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201202112339.q1BNdr6G055419@svn.freebsd.org> From: Craig Rodrigues Date: Sat, 11 Feb 2012 23:39:53 +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: r231539 - stable/8/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 23:39:53 -0000 Author: rodrigc Date: Sat Feb 11 23:39:53 2012 New Revision: 231539 URL: http://svn.freebsd.org/changeset/base/231539 Log: MFC 203377-231538. This records mergeinfo for already merged changesets, but brings in the following changes: MFC 222326 - Fix tftp_log() usage MFC 223137 - Man page updates MFC 223487 - Bring back syncnet() implementation from older tftp implementation. MFC 229780 - Spelling fixes for libexec/ MFC 229904 - Fix warning when compiling with gcc46: error: variable 'bp' set but not used Modified: stable/8/libexec/tftpd/tftp-file.c stable/8/libexec/tftpd/tftp-io.c stable/8/libexec/tftpd/tftp-utils.h stable/8/libexec/tftpd/tftpd.8 Directory Properties: stable/8/libexec/tftpd/ (props changed) Modified: stable/8/libexec/tftpd/tftp-file.c ============================================================================== --- stable/8/libexec/tftpd/tftp-file.c Sat Feb 11 23:15:14 2012 (r231538) +++ stable/8/libexec/tftpd/tftp-file.c Sat Feb 11 23:39:53 2012 (r231539) @@ -27,6 +27,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include @@ -249,9 +251,34 @@ read_close(void) } +/* When an error has occurred, it is possible that the two sides + * are out of synch. Ie: that what I think is the other side's + * response to packet N is really their response to packet N-1. + * + * So, to try to prevent that, we flush all the input queued up + * for us on the network connection on our host. + * + * We return the number of packets we flushed (mostly for reporting + * when trace is active). + */ + int -synchnet(int peer __unused) +synchnet(int peer) /* socket to flush */ { - - return 0; + int i, j = 0; + char rbuf[MAXPKTSIZE]; + struct sockaddr_storage from; + socklen_t fromlen; + + while (1) { + (void) ioctl(peer, FIONREAD, &i); + if (i) { + j++; + fromlen = sizeof from; + (void) recvfrom(peer, rbuf, sizeof (rbuf), 0, + (struct sockaddr *)&from, &fromlen); + } else { + return(j); + } + } } Modified: stable/8/libexec/tftpd/tftp-io.c ============================================================================== --- stable/8/libexec/tftpd/tftp-io.c Sat Feb 11 23:15:14 2012 (r231538) +++ stable/8/libexec/tftpd/tftp-io.c Sat Feb 11 23:39:53 2012 (r231539) @@ -72,13 +72,13 @@ struct errmsg { #define DROPPACKET(s) \ if (packetdroppercentage != 0 && \ random()%100 < packetdroppercentage) { \ - tftp_log(LOG_DEBUG, "Artifical packet drop in %s", s); \ + tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s); \ return; \ } #define DROPPACKETn(s,n) \ if (packetdroppercentage != 0 && \ random()%100 < packetdroppercentage) { \ - tftp_log(LOG_DEBUG, "Artifical packet drop in %s", s); \ + tftp_log(LOG_DEBUG, "Artificial packet drop in %s", s); \ return (n); \ } @@ -262,7 +262,7 @@ send_rrq(int peer, char *filename, char n = sendto(peer, buf, size, 0, (struct sockaddr *)&peer_sock, peer_sock.ss_len); if (n != size) { - tftp_log(LOG_ERR, "send_rrq: %s", n, strerror(errno)); + tftp_log(LOG_ERR, "send_rrq: %d %s", n, strerror(errno)); return (1); } return (0); @@ -323,7 +323,6 @@ send_ack(int fp, uint16_t block) { struct tftphdr *tp; int size; - char *bp; char buf[MAXPKTSIZE]; if (debug&DEBUG_PACKETS) @@ -332,7 +331,6 @@ send_ack(int fp, uint16_t block) DROPPACKETn("send_ack", 0); tp = (struct tftphdr *)buf; - bp = buf + 2; size = sizeof(buf) - 2; tp->th_opcode = htons((u_short)ACK); tp->th_block = htons((u_short)block); Modified: stable/8/libexec/tftpd/tftp-utils.h ============================================================================== --- stable/8/libexec/tftpd/tftp-utils.h Sat Feb 11 23:15:14 2012 (r231538) +++ stable/8/libexec/tftpd/tftp-utils.h Sat Feb 11 23:39:53 2012 (r231539) @@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$"); #define MAXPKTSIZE (MAXSEGSIZE + 4) /* Maximum size of the packet */ /* For the blksize option */ -#define BLKSIZE_MIN 8 /* Minumum size of the data segment */ +#define BLKSIZE_MIN 8 /* Minimum size of the data segment */ #define BLKSIZE_MAX MAXSEGSIZE /* Maximum size of the data segment */ /* For the timeout option */ -#define TIMEOUT_MIN 0 /* Minumum timeout value */ +#define TIMEOUT_MIN 0 /* Minimum timeout value */ #define TIMEOUT_MAX 255 /* Maximum timeout value */ #define MIN_TIMEOUTS 3 Modified: stable/8/libexec/tftpd/tftpd.8 ============================================================================== --- stable/8/libexec/tftpd/tftpd.8 Sat Feb 11 23:15:14 2012 (r231538) +++ stable/8/libexec/tftpd/tftpd.8 Sat Feb 11 23:39:53 2012 (r231539) @@ -32,7 +32,7 @@ .\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 14, 2000 +.Dd June 22, 2011 .Dt TFTPD 8 .Os .Sh NAME @@ -150,9 +150,27 @@ compatible format string for the creatio .Fl W is specified. By default the string "%Y%m%d" is used. -.It Fl d +.It Fl d, d Ar [value] Enables debug output. -If specified twice, it will log DATA and ACK packets too. +If +.Ar value +is not specified, then the debug level is increased by one +for each instance of +.Fl d +which is specified. +.Pp +If +.Ar value +is specified, then the debug level is set to +.Ar value . +The debug level is a bitmask implemented in +.Pa src/libexec/tftpd/tftp-utils.h . +Valid values are 0 (DEBUG_NONE), 1 (DEBUG_PACKETS), 2, (DEBUG_SIMPLE), +4 (DEBUG_OPTIONS), and 8 (DEBUG_ACCESS). Multiple debug values can be combined +in the bitmask by logically OR'ing the values. For example, specifying +.Fl d +.Ar 15 +will enable all the debug values. .It Fl l Log all requests using .Xr syslog 3 @@ -217,12 +235,34 @@ option. .Xr services 5 , .Xr syslog.conf 5 , .Xr inetd 8 +.Pp +The following RFC's are supported: .Rs -.%A K. R. Sollins +RFC 1350 .%T The TFTP Protocol (Revision 2) -.%D July 1992 -.%O RFC 1350, STD 33 .Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm @@ -253,8 +293,22 @@ was introduced in support for the TFTP Blocksize Option (RFC2348) and the blksize2 option was introduced in .Fx 7.4 . -.Sh BUGS -Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting blocksize negotiation (RFC2348). .Pp -Many tftp clients will not transfer files over 16744448 octets (32767 blocks). +Edwin Groothuis performed a major rewrite of the +.Nm +and +.Xr tftp 1 +code to support RFC2348. +.Sh NOTES +Files larger than 33,553,919 octets (65535 blocks, last one <512 +octets) cannot be correctly transferred without client and server +supporting blocksize negotiation (RFCs 2347 and 2348), +or the non-standard TFTP rollover option. +As a kludge, +.Nm +accepts a sequence of block number which wrap to zero after 65535, +even if the rollover option is not specified. +.Pp +Many tftp clients will not transfer files over 16,776,703 octets +(32767 blocks), as they incorrectly count the block number using +a signed rather than unsigned 16-bit integer. From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 23:46:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id AD270106567F; Sat, 11 Feb 2012 23:46:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id D5DB91A4437; Sat, 11 Feb 2012 23:45:38 +0000 (UTC) Message-ID: <4F36FD9D.8030907@FreeBSD.org> Date: Sat, 11 Feb 2012 15:45:33 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Ed Schouten References: <201202112047.q1BKlGhP047498@svn.freebsd.org> <4F36F2A5.6040405@FreeBSD.org> <20120211232140.GU1860@hoeg.nl> In-Reply-To: <20120211232140.GU1860@hoeg.nl> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig00446C995BD23614797927C1" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231534 - in head: etc/rc.d sbin/init X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 23:46:09 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig00446C995BD23614797927C1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 02/11/2012 15:21, Ed Schouten wrote: > Hi Doug, >=20 > * Doug Barton , 20120211 23:58: >> New scripts in the base should not use BEFORE. Rather, LOGIN should >> REQUIRE this script. >=20 > You mean like this? Yes, thanks. > I noticed there are still over 60 occurrences of > BEFORE in the tree. Looks like there's still quite a lot of work to do > to get rid of it then. Quite. I tackle them when I can, but the goal at this point is to avoid making the problem any worse. :) Doug > %%% > Index: etc/rc.d/utx > =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 > --- etc/rc.d/utx (revision 231534) > +++ etc/rc.d/utx (working copy) > @@ -5,7 +5,6 @@ > =20 > # PROVIDE: utx > # REQUIRE: DAEMON cleanvar > -# BEFORE: LOGIN > # KEYWORD: shutdown > =20 > . /etc/rc.subr > Index: etc/rc.d/LOGIN > =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 > --- etc/rc.d/LOGIN (revision 231514) > +++ etc/rc.d/LOGIN (working copy) > @@ -4,7 +4,7 @@ > # > =20 > # PROVIDE: LOGIN > -# REQUIRE: DAEMON > +# REQUIRE: DAEMON utx > =20 > # This is a dummy dependency to ensure user services such as xdm, > # inetd, cron and kerberos are started after everything else, in case > %%% >=20 --=20 It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------enig00446C995BD23614797927C1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJPNv2iAAoJEFzGhvEaGryEZMMIALxRlSlciOiH9WsHMAi1bBlK WqCb6hGUBMKxPf5v9a7P8lqweIaD1myEwxj5GoFAQHtwA7D0iGWlIsEZV7fxgw+7 Xs+9xx4YfhpomenR4o1qo1qFQH7Bq3Yuzk2YnMLLLlbDg/+hbUQoxdQFN0W9XTm5 aeLtnVfMFO/g9an23Xf7rgqZkYzaMxxN+Hx1sEu83UShLmxwLVOvmkGCtwb9t/HD WUjedOeZuJBvAcfttjZckyAbAtvRvihFtPBx6T1fUxsbdbqo1CZPjVH9kDkx+5l/ GHNy8UNPZOuir733bSjIkpZfZCgBiOCFRdIJYuM4H71sU8akjUv5tjY/AR3o8dM= =Qr59 -----END PGP SIGNATURE----- --------------enig00446C995BD23614797927C1-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 11 23:58:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F9CE1065670; Sat, 11 Feb 2012 23:58:08 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07B098FC08; Sat, 11 Feb 2012 23:58:08 +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 q1BNw7JG056064; Sat, 11 Feb 2012 23:58:07 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BNw7D9056059; Sat, 11 Feb 2012 23:58:07 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201202112358.q1BNw7D9056059@svn.freebsd.org> From: Craig Rodrigues Date: Sat, 11 Feb 2012 23:58:07 +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: r231540 - stable/7/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 23:58:08 -0000 Author: rodrigc Date: Sat Feb 11 23:58:07 2012 New Revision: 231540 URL: http://svn.freebsd.org/changeset/base/231540 Log: MFC 170382 through 231539 - this records svn:mergeinfo for previously merged changesets This pulls in changes such as: MFC 216370 - Remove adertising clause from UCB copyrighted files in usr.bin MFC 222534 - Fix a couple of spelling errors. MFC 223493 - Remove duplicated header files MFC 223135 - 223491 - man page updates MFC 229403 - Replace index() and rindex() calls with strchr() and strrchr(). MFC 230044 - fgets(3) returns a pointer, so compare against NULL, not integer 0. Modified: stable/7/usr.bin/tftp/main.c stable/7/usr.bin/tftp/tftp.1 stable/7/usr.bin/tftp/tftp.c stable/7/usr.bin/tftp/tftp.h Directory Properties: stable/7/usr.bin/tftp/ (props changed) Modified: stable/7/usr.bin/tftp/main.c ============================================================================== --- stable/7/usr.bin/tftp/main.c Sat Feb 11 23:39:53 2012 (r231539) +++ stable/7/usr.bin/tftp/main.c Sat Feb 11 23:58:07 2012 (r231540) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -56,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -82,7 +77,7 @@ __FBSDID("$FreeBSD$"); #define MAXLINE 200 #define TIMEOUT 5 /* secs between rexmt's */ -static struct sockaddr_storage peeraddr; +typedef struct sockaddr_storage peeraddr; static int connected; static char mode[32]; jmp_buf toplevel; @@ -159,7 +154,7 @@ static struct cmd cmdtab[] = { { "options", setoptions, "enable or disable RFC2347 style options" }, { "help", help, "print help information" }, - { "packetdrop", setpacketdrop, "artifical packetloss feature" }, + { "packetdrop", setpacketdrop, "artificial packetloss feature" }, { "?", help, "print help information" }, { NULL, NULL, NULL } }; @@ -442,16 +437,16 @@ put(int argc, char *argv[]) return; } targ = argv[argc - 1]; - if (rindex(argv[argc - 1], ':')) { + if (strrchr(argv[argc - 1], ':')) { char *lcp; for (n = 1; n < argc - 1; n++) - if (index(argv[n], ':')) { + if (strchr(argv[n], ':')) { putusage(argv[0]); return; } lcp = argv[argc - 1]; - targ = rindex(lcp, ':'); + targ = strrchr(lcp, ':'); *targ++ = 0; if (lcp[0] == '[' && lcp[strlen(lcp) - 1] == ']') { lcp[strlen(lcp) - 1] = '\0'; @@ -482,7 +477,7 @@ put(int argc, char *argv[]) } /* this assumes the target is a directory */ /* on a remote unix system. hmmmm. */ - cp = index(targ, '\0'); + cp = strchr(targ, '\0'); *cp++ = '/'; for (n = 1; n < argc - 1; n++) { strcpy(cp, tail(argv[n])); @@ -537,7 +532,7 @@ get(int argc, char *argv[]) } if (!connected) { for (n = 1; n < argc ; n++) - if (rindex(argv[n], ':') == 0) { + if (strrchr(argv[n], ':') == 0) { printf("No remote host specified and " "no host given for file '%s'\n", argv[n]); getusage(argv[0]); @@ -545,7 +540,7 @@ get(int argc, char *argv[]) } } for (n = 1; n < argc ; n++) { - src = rindex(argv[n], ':'); + src = strrchr(argv[n], ':'); if (src == NULL) src = argv[n]; else { @@ -686,7 +681,7 @@ tail(char *filename) char *s; while (*filename) { - s = rindex(filename, '/'); + s = strrchr(filename, '/'); if (s == NULL) break; if (s[1]) @@ -739,7 +734,7 @@ command(void) history(hist, &he, H_ENTER, bp); } else { line[0] = 0; - if (fgets(line, sizeof line , stdin) == 0) { + if (fgets(line, sizeof line , stdin) == NULL) { if (feof(stdin)) { exit(txrx_error); } else { @@ -844,8 +839,8 @@ help(int argc, char *argv[]) printf("%-*s\t%s\n", (int)HELPINDENT, c->name, c->help); printf("\n[-] : You shouldn't use these ones anymore.\n"); - printf("[*] : RFC2834 options support required.\n"); - printf("[**] : Non-standard RFC2834 option.\n"); + printf("[*] : RFC2347 options support required.\n"); + printf("[**] : Non-standard RFC2347 option.\n"); return; } while (--argc > 0) { @@ -959,7 +954,7 @@ setblocksize(int argc, char *argv[]) if (!options_rfc_enabled) printf("RFC2347 style options are not enabled " - "(but proceding anyway)\n"); + "(but proceeding anyway)\n"); if (argc != 1) { int size = atoi(argv[1]); @@ -997,7 +992,7 @@ setblocksize2(int argc, char *argv[]) if (!options_rfc_enabled || !options_extra_enabled) printf( "RFC2347 style or non-RFC defined options are not enabled " - "(but proceding anyway)\n"); + "(but proceeding anyway)\n"); if (argc != 1) { int size = atoi(argv[1]); Modified: stable/7/usr.bin/tftp/tftp.1 ============================================================================== --- stable/7/usr.bin/tftp/tftp.1 Sat Feb 11 23:39:53 2012 (r231539) +++ stable/7/usr.bin/tftp/tftp.1 Sat Feb 11 23:58:07 2012 (r231540) @@ -9,10 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. @@ -32,7 +28,7 @@ .\" @(#)tftp.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 1, 2003 +.Dd June 22, 2011 .Dt TFTP 1 .Os .Sh NAME @@ -74,6 +70,21 @@ Shorthand for "mode ascii" .It Cm binary Shorthand for "mode binary" .Pp +.It Cm blocksize Ar [size] +Sets the TFTP blksize option in TFTP Read Request or Write Request packets +to +.Ar [size] +as specified in RFC 2348. Valid values are between 8 and 65464. +If no blocksize is specified, then by default a blocksize of 512 bytes +will be used. +.Pp +.It Cm blocksize2 Ar [size] +Sets the TFTP blksize2 option in TFTP Read Request or Write Request packets +to +.Ar [size] . +Values are restricted to powers of 2 between 8 and 32768. This is a +non-standard TFTP option. +.Pp .It Cm connect Ar host Op Ar port Set the .Ar host @@ -97,6 +108,14 @@ or .Cm put commands. .Pp +.It Cm debug Ar level +Enable or disable debugging levels during verbose output. The value of +.Ar level +can be one of +.Cm packet, simple, options, +or +.Cm access. +.Pp .It Cm get Oo Ar host : Oc Ns Ar file Op Ar localname .It Cm get Xo .Oo Ar host1 : Oc Ns Ar file1 @@ -134,6 +153,11 @@ or The default is .Em ascii . .Pp +.It Cm packetdrop [arg] +Randomly drop +.Ar arg +out of 100 packets during a transfer. This is a debugging feature. +.Pp .It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename .It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory Put a file or set of files to the remote host. @@ -153,6 +177,17 @@ see the example under the .Cm get command. .Pp +.It Cm options Ar [arg] +Enable or disable support for TFTP options. The valid values of +.Ar arg +are +.Cm on +(enable RFC 2347 options), +.Cm off +(disable RFC 2347 options), and +.Cm extra +(toggle support for non-RFC defined options). +.Pp .It Cm quit Exit .Nm . @@ -161,6 +196,15 @@ An end of file also exits. .It Cm rexmt Ar retransmission-timeout Set the per-packet retransmission timeout, in seconds. .Pp +.It Cm rollover [arg] +Specify the rollover option in TFTP Read Request or Write +Request packets. After 65535 packets have been transmitted, set the block +counter to +.Ar arg . +Valid values of +.Ar arg +are 0 and 1. This is a non-standard TFTP option. +.Pp .It Cm status Show current status. .Pp @@ -173,12 +217,52 @@ Toggle packet tracing. .It Cm verbose Toggle verbose mode. .El +.Sh SEE ALSO +.Xr tftpd 8 +.Pp +The following RFC's are supported: +.Rs +RFC 1350 +.%T The TFTP Protocol (Revision 2) +.Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Rs +RFC 3617 +.%T Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP) +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm command appeared in .Bx 4.3 . -.Sh BUGS +.Pp +Edwin Groothuis performed a major rewrite of the +.Xr tftpd 8 +and +.Nm +code to support RFC2348. +.Sh NOTES Because there is no user-login or validation within the .Tn TFTP @@ -189,4 +273,5 @@ exact methods are specific to each site difficult to document here. .Pp Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting blocksize negotiation (RFC1783). +without client and server supporting the TFTP blocksize option (RFC2348), +or the non-standard TFTP rollover option. Modified: stable/7/usr.bin/tftp/tftp.c ============================================================================== --- stable/7/usr.bin/tftp/tftp.c Sat Feb 11 23:39:53 2012 (r231539) +++ stable/7/usr.bin/tftp/tftp.c Sat Feb 11 23:58:07 2012 (r231540) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: stable/7/usr.bin/tftp/tftp.h ============================================================================== --- stable/7/usr.bin/tftp/tftp.h Sat Feb 11 23:39:53 2012 (r231539) +++ stable/7/usr.bin/tftp/tftp.h Sat Feb 11 23:58:07 2012 (r231540) @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission.