From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 07:02:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 22665106568D; Sun, 27 Sep 2009 07:02:21 +0000 (UTC) Date: Sun, 27 Sep 2009 07:02:21 +0000 From: Alexey Dokuchaev To: Dag-Erling Sm??rgrav Message-ID: <20090927070220.GA18022@FreeBSD.org> References: <200909251824.n8PIOLte036513@svn.freebsd.org> <20090925191416.GA1597@garage.freebsd.pl> <86tyyph1jl.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <86tyyph1jl.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , Thomas Backman Subject: Re: svn commit: r197498 - 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: Sun, 27 Sep 2009 07:02:21 -0000 On Sat, Sep 26, 2009 at 10:51:58PM +0200, Dag-Erling Sm??rgrav wrote: > Pawel Jakub Dawidek writes: > > I didn't, thanks. Unfortunately svn doesn't even allow forced commits, > > which is a paintful regression compared to cvs. > > Subversion does allow editing a log message after the fact, but our > commit scripts prohibit it. This should IMHO be allowed, and cause a > new email to be sent out to note the change. I recall that one of the reasons behind prohibition was to avoid issues with CVS exporter. ./danfe From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 13:16:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E9911065672; Sun, 27 Sep 2009 13:16:39 +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 1CEA28FC14; Sun, 27 Sep 2009 13:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RDGdao090254; Sun, 27 Sep 2009 13:16:39 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RDGdlr090252; Sun, 27 Sep 2009 13:16:39 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <200909271316.n8RDGdlr090252@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 27 Sep 2009 13:16: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: r197534 - head/lib/libc/nls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 13:16:39 -0000 Author: gabor (doc,ports committer) Date: Sun Sep 27 13:16:38 2009 New Revision: 197534 URL: http://svn.freebsd.org/changeset/base/197534 Log: - Add Galician NLS catalog Added: head/lib/libc/nls/gl_ES.ISO8859-1.msg (contents, props changed) Modified: head/lib/libc/nls/Makefile.inc Modified: head/lib/libc/nls/Makefile.inc ============================================================================== --- head/lib/libc/nls/Makefile.inc Sat Sep 26 23:25:22 2009 (r197533) +++ head/lib/libc/nls/Makefile.inc Sun Sep 27 13:16:38 2009 (r197534) @@ -20,6 +20,7 @@ NLS+= el_GR.ISO8859-7 NLS+= es_ES.ISO8859-1 NLS+= fi_FI.ISO8859-1 NLS+= fr_FR.ISO8859-1 +NLS+= gl_ES.ISO8859-1 NLS+= hu_HU.ISO8859-2 NLS+= it_IT.ISO8859-15 NLS+= ko_KR.UTF-8 Added: head/lib/libc/nls/gl_ES.ISO8859-1.msg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/nls/gl_ES.ISO8859-1.msg Sun Sep 27 13:16:38 2009 (r197534) @@ -0,0 +1,249 @@ +$ $FreeBSD$ +$ +$ Message catalog for gl_ES.ISO8859-1 locale +$ +$ strerror() support catalog +$ +$set 1 +$ EPERM +1 Operación non permitida +$ ENOENT +2 Ficheiro ou directorio inexistente +$ ESRCH +3 Proceso inexistente +$ EINTR +4 Chamada do sistema interrompida +$ EIO +5 Erro de Entrada/Saída +$ ENXIO +6 Dispositivo non configurado +$ E2BIG +7 A lista de argumentos é demasiado larga +$ ENOEXEC +8 Erro no formato do executable +$ EBADF +9 Descriptor incorrecto de ficheiro +$ ECHILD +10 Non hai procesos fillos +$ EDEADLK +11 Evitouse o bloqueo do recurso +$ ENOMEM +12 Non se puido asignar memoria +$ EACCES +13 Permiso denegado +$ EFAULT +14 Dirección incorrecta +$ ENOTBLK +15 Precísase un dispositivo de bloques +$ EBUSY +16 Dispositivo ocupado +$ EEXIST +17 O ficheiro xa existe +$ EXDEV +18 Enlace entre dispositivos +$ ENODEV +19 Operación inadecuada para este dispositivo +$ ENOTDIR +20 Non é un directorio +$ EISDIR +21 É un directorio +$ EINVAL +22 Argumento inadecuado +$ ENFILE +23 Hai demasiados ficheiros abertos no sistema +$ EMFILE +24 Hai demasiados ficheiros abertos +$ ENOTTY +25 ioctl inapropiado para o dispositivo +$ ETXTBSY +26 Ficheiro de texto ocupado +$ EFBIG +27 Ficheiro demasiado grande +$ ENOSPC +28 Non queda espacio libre no dispositivo +$ ESPIPE +29 seek inválido +$ EROFS +30 Sistema de ficheiros de só lectura +$ EMLINK +31 Demasiados enlaces +$ EPIPE +32 Canal (pipe) roto +$ EDOM +33 Argumento numérico fóra de rango +$ ERANGE +34 O resultado é demasiado grande +$ EAGAIN, EWOULDBLOCK +35 O recurso non está dispoñible temporalmente +$ EINPROGRESS +36 Operación en proceso +$ EALREADY +37 A operación xa estase executando +$ ENOTSOCK +38 Operación de socket inaceptable para o dispositivo +$ EDESTADDRREQ +39 Precísase unha dirección de destino +$ EMSGSIZE +40 Mensaxe demasiado largo +$ EPROTOTYPE +41 Tipo malo de protocolo para o socket +$ ENOPROTOOPT +42 Protocolo non dispoñible +$ EPROTONOSUPPORT +43 Protocolo non contemplado +$ ESOCKTNOSUPPORT +44 Tipo de socket non contemplado +$ EOPNOTSUPP +45 Operación non contemplada +$ EPFNOSUPPORT +46 Familia de protocolos non contemplada +$ EAFNOSUPPORT +47 Familia de direcciones non contemplada pola familia de protocolos +$ EADDRINUSE +48 A dirección xa está en uso +$ EADDRNOTAVAIL +49 Non se puido asignar a dirección requerida +$ ENETDOWN +50 A rede non funciona +$ ENETUNREACH +51 Non se puido acceder á rede +$ ENETRESET +52 A conexión de rede interrompiuse ao reinicializar +$ ECONNABORTED +53 Conexión perdida por problemas no software +$ ECONNRESET +54 O interlocutor reinicializou a conexión +$ ENOBUFS +55 Non queda espacio no búfer +$ EISCONN +56 O socket xa estaba conectado +$ ENOTCONN +57 O socket non está conectado +$ ESHUTDOWN +58 Non se pode enviar tras a desconexión do socket +$ ETOOMANYREFS +59 Demasiadas referencias: non poden unirse +$ ETIMEDOUT +60 O tempo de conexión expirou +$ ECONNREFUSED +61 Conexión rexeitada +$ ELOOP +62 Demasiados niveles de enlaces simbólicos +$ ENAMETOOLONG +63 Nome de ficheiro demasiado largo +$ EHOSTDOWN +64 A máquina está fóra de servicio +$ EHOSTUNREACH +65 Non hai ruta ata a máquina +$ ENOTEMPTY +66 Directorio non baleiro +$ EPROCLIM +67 Demasiados procesos +$ EUSERS +68 Demasiados usuarios +$ EDQUOT +69 Cuota de disco sobrepasada +$ ESTALE +70 Descriptor de ficheiro NFS inválido +$ EREMOTE +71 Ruta con demasiados niveles +$ EBADRPC +72 A estructura da RPC é mala +$ ERPCMISMATCH +73 A versión da RPC é mala +$ EPROGUNAVAIL +74 A RPC non está accesible +$ EPROGMISMATCH +75 Versión mala do programa +$ EPROCUNAVAIL +76 Procedemento malo para o programa +$ ENOLCK +77 Non hai bloqueos dispoñibles +$ ENOSYS +78 Función non realizada +$ EFTYPE +79 Tipo de ficheiro ou formato inapropiado +$ EAUTH +80 Erro de autenticación +$ ENEEDAUTH +81 Precísase un autenticador +$ EIDRM +82 Identificador eliminado +$ ENOMSG +83 Non hai mensaxes do tipo desexado +$ EOVERFLOW +84 Valor demasiado grande para se almacenar no tipo desexado +$ ECANCELED +85 Operación cancelada +$ EILSEQ +86 Secuencia inválida de byte +$ ENOATTR +87 Atributo non encontrado +$ EDOOFUS +88 Erro de programación +$ +$ strsignal() support catalog +$ +$set 2 +$ SIGHUP +1 Fin de liña (Hangup) +$ SIGINT +2 Interrompido +$ SIGQUIT +3 Terminado +$ SIGILL +4 Instrucción inválida +$ SIGTRAP +5 Trace/BPT trap +$ SIGABRT +6 Abort trap +$ SIGEMT +7 EMT trap +$ SIGFPE +8 Excepción de coma flotante +$ SIGKILL +9 Matado +$ SIGBUS +10 Erro no bus +$ SIGSEGV +11 Fallo de segmentación +$ SIGSYS +12 Chamada ao sistema mala +$ SIGPIPE +13 Canal (pipe) roto +$ SIGALRM +14 Alarma do reloxo +$ SIGTERM +15 Terminado +$ SIGURG +16 Condición urxente de E/S +$ SIGSTOP +17 Detido (sinal) +$ SIGTSTP +18 Detido +$ SIGCONT +19 Continuando +$ SIGCHLD +20 Proceso fillo terminado +$ SIGTTIN +21 Detido (entrada tty) +$ SIGTTOU +22 Detido (sída tty) +$ SIGIO +23 E/S posible +$ SIGXCPU +24 Sobrepasouse o tempo límite da CPU +$ SIGXFSZ +25 Sobrepasouse o límite de tamaño de ficheiro +$ SIGVTALRM +26 Temporizador virtual caducado +$ SIGPROF +27 Temporizador de perfilación caducado +$ SIGWINCH +28 Cambios no tamaño de xanela +$ SIGINFO +29 Petición de información +$ SIGUSR1 +30 Sinal definida polo usuario no. 1 +$ SIGUSR2 +31 Sinal definida polo usuario no. 2 From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 13:24:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 013E0106566C; Sun, 27 Sep 2009 13:24:35 +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 E3E2B8FC13; Sun, 27 Sep 2009 13:24:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RDOY81090433; Sun, 27 Sep 2009 13:24:34 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RDOYVY090431; Sun, 27 Sep 2009 13:24:34 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200909271324.n8RDOYVY090431@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 27 Sep 2009 13: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: r197535 - head/sys/modules/nfslockd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 13:24:35 -0000 Author: nyan Date: Sun Sep 27 13:24:34 2009 New Revision: 197535 URL: http://svn.freebsd.org/changeset/base/197535 Log: Add '#define NFSCLIENT' into opt_nfs.h if the NFSCLIENT variable is 1 (the default is 1). This makes the nfslockd module works for NFS client. Reviewed by: dfr MFC after: 3 days Modified: head/sys/modules/nfslockd/Makefile Modified: head/sys/modules/nfslockd/Makefile ============================================================================== --- head/sys/modules/nfslockd/Makefile Sun Sep 27 13:16:38 2009 (r197534) +++ head/sys/modules/nfslockd/Makefile Sun Sep 27 13:24:34 2009 (r197535) @@ -14,11 +14,18 @@ SRCS+= opt_inet6.h opt_nfs.h .if !defined(KERNBUILDDIR) NFS_INET6?= 1 # 0/1 - requires INET6 to be configured in kernel +NFSCLIENT?= 1 # 0/1 - requires NFSCLIENT to be configured in kernel .if ${NFS_INET6} > 0 opt_inet6.h: echo "#define INET6 1" > ${.TARGET} .endif + +.if ${NFSCLIENT} > 0 +opt_nfs.h: + echo "#define NFSCLIENT 1" > ${.TARGET} +.endif + .endif .include From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 13:51:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61B01065692; Sun, 27 Sep 2009 13:51:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 1F0028FC1A; Sun, 27 Sep 2009 13:51:23 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n8RDpKfl092681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 27 Sep 2009 16:51:20 +0300 (EEST) (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.3/8.14.3) with ESMTP id n8RDpKEK058984; Sun, 27 Sep 2009 16:51:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n8RDpKWY058983; Sun, 27 Sep 2009 16:51:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 27 Sep 2009 16:51:20 +0300 From: Kostik Belousov To: Takahashi Yoshihiro Message-ID: <20090927135120.GI47688@deviant.kiev.zoral.com.ua> References: <200909271324.n8RDOYVY090431@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nQ68ZCL8P0driJRh" Content-Disposition: inline In-Reply-To: <200909271324.n8RDOYVY090431@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 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: r197535 - head/sys/modules/nfslockd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 13:51:24 -0000 --nQ68ZCL8P0driJRh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 27, 2009 at 01:24:34PM +0000, Takahashi Yoshihiro wrote: > Author: nyan > Date: Sun Sep 27 13:24:34 2009 > New Revision: 197535 > URL: http://svn.freebsd.org/changeset/base/197535 >=20 > Log: > Add '#define NFSCLIENT' into opt_nfs.h if the NFSCLIENT variable is 1 > (the default is 1). > =20 > This makes the nfslockd module works for NFS client. > =20 > Reviewed by: dfr > MFC after: 3 days >=20 > Modified: > head/sys/modules/nfslockd/Makefile >=20 > Modified: head/sys/modules/nfslockd/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/modules/nfslockd/Makefile Sun Sep 27 13:16:38 2009 (r197534) > +++ head/sys/modules/nfslockd/Makefile Sun Sep 27 13:24:34 2009 (r197535) > @@ -14,11 +14,18 @@ SRCS+=3D opt_inet6.h opt_nfs.h > =20 > .if !defined(KERNBUILDDIR) > NFS_INET6?=3D 1 # 0/1 - requires INET6 to be configured in kernel > +NFSCLIENT?=3D 1 # 0/1 - requires NFSCLIENT to be configured in kernel > =20 > .if ${NFS_INET6} > 0 > opt_inet6.h: > echo "#define INET6 1" > ${.TARGET} > .endif > + > +.if ${NFSCLIENT} > 0 > +opt_nfs.h: > + echo "#define NFSCLIENT 1" > ${.TARGET} > +.endif > + > .endif > =20 > .include It seems more interesting and more unfortunate that nlm would not work for client when nfs client is not compiled into the kernel ? Is this true ? --nQ68ZCL8P0driJRh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkq/bdcACgkQC3+MBN1Mb4gm/QCggc9moKYuNkuaSxmf9c2B07ZM ZQMAnRCh1ooJ+1tPIEg8tF0OEur/QJwT =DTjV -----END PGP SIGNATURE----- --nQ68ZCL8P0driJRh-- From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 14:00:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1621106568F; Sun, 27 Sep 2009 14:00:16 +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 CD6DF8FC15; Sun, 27 Sep 2009 14:00:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RE0GMt051136; Sun, 27 Sep 2009 14:00:16 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RE0GDN051129; Sun, 27 Sep 2009 14:00:16 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200909271400.n8RE0GDN051129@svn.freebsd.org> From: Jung-uk Kim Date: Sun, 27 Sep 2009 14:00: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: r197536 - in head: sys/amd64/acpica sys/amd64/include sys/dev/acpica sys/i386/include usr.sbin usr.sbin/apm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 14:00:17 -0000 Author: jkim Date: Sun Sep 27 14:00:16 2009 New Revision: 197536 URL: http://svn.freebsd.org/changeset/base/197536 Log: Copy apm(4) emulation from sys/i386/acpica/acpi_machdep.c and install apm(8) and apm_bios.h on amd64. Added: head/sys/amd64/include/apm_bios.h - copied, changed from r197533, head/sys/i386/include/apm_bios.h Modified: head/sys/amd64/acpica/acpi_machdep.c head/sys/dev/acpica/acpi.c head/sys/i386/include/apm_bios.h head/usr.sbin/Makefile head/usr.sbin/apm/Makefile Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Sun Sep 27 13:24:34 2009 (r197535) +++ head/sys/amd64/acpica/acpi_machdep.c Sun Sep 27 14:00:16 2009 (r197536) @@ -43,6 +43,24 @@ __FBSDID("$FreeBSD$"); #include +/* + * APM driver emulation + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + SYSCTL_DECL(_debug_acpi); int acpi_resume_beep; @@ -54,7 +72,432 @@ int acpi_reset_video; TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video); static int intr_model = ACPI_INTR_PIC; -static struct apm_clone_data acpi_clone; +static int apm_active; +static struct clonedevs *apm_clones; + +MALLOC_DEFINE(M_APMDEV, "apmdev", "APM device emulation"); + +static d_open_t apmopen; +static d_close_t apmclose; +static d_write_t apmwrite; +static d_ioctl_t apmioctl; +static d_poll_t apmpoll; +static d_kqfilter_t apmkqfilter; +static void apmreadfiltdetach(struct knote *kn); +static int apmreadfilt(struct knote *kn, long hint); +static struct filterops apm_readfiltops = { + .f_isfd = 1, + .f_detach = apmreadfiltdetach, + .f_event = apmreadfilt, +}; + +static struct cdevsw apm_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE | D_NEEDMINOR, + .d_open = apmopen, + .d_close = apmclose, + .d_write = apmwrite, + .d_ioctl = apmioctl, + .d_poll = apmpoll, + .d_name = "apm", + .d_kqfilter = apmkqfilter +}; + +static int +acpi_capm_convert_battstate(struct acpi_battinfo *battp) +{ + int state; + + state = APM_UNKNOWN; + + if (battp->state & ACPI_BATT_STAT_DISCHARG) { + if (battp->cap >= 50) + state = 0; /* high */ + else + state = 1; /* low */ + } + if (battp->state & ACPI_BATT_STAT_CRITICAL) + state = 2; /* critical */ + if (battp->state & ACPI_BATT_STAT_CHARGING) + state = 3; /* charging */ + + /* If still unknown, determine it based on the battery capacity. */ + if (state == APM_UNKNOWN) { + if (battp->cap >= 50) + state = 0; /* high */ + else + state = 1; /* low */ + } + + return (state); +} + +static int +acpi_capm_convert_battflags(struct acpi_battinfo *battp) +{ + int flags; + + flags = 0; + + if (battp->cap >= 50) + flags |= APM_BATT_HIGH; + else { + if (battp->state & ACPI_BATT_STAT_CRITICAL) + flags |= APM_BATT_CRITICAL; + else + flags |= APM_BATT_LOW; + } + if (battp->state & ACPI_BATT_STAT_CHARGING) + flags |= APM_BATT_CHARGING; + if (battp->state == ACPI_BATT_STAT_NOT_PRESENT) + flags = APM_BATT_NOT_PRESENT; + + return (flags); +} + +static int +acpi_capm_get_info(apm_info_t aip) +{ + int acline; + struct acpi_battinfo batt; + + aip->ai_infoversion = 1; + aip->ai_major = 1; + aip->ai_minor = 2; + aip->ai_status = apm_active; + aip->ai_capabilities= 0xff00; /* unknown */ + + if (acpi_acad_get_acline(&acline)) + aip->ai_acline = APM_UNKNOWN; /* unknown */ + else + aip->ai_acline = acline; /* on/off */ + + if (acpi_battery_get_battinfo(NULL, &batt) != 0) { + aip->ai_batt_stat = APM_UNKNOWN; + aip->ai_batt_life = APM_UNKNOWN; + aip->ai_batt_time = -1; /* unknown */ + aip->ai_batteries = ~0U; /* unknown */ + } else { + aip->ai_batt_stat = acpi_capm_convert_battstate(&batt); + aip->ai_batt_life = batt.cap; + aip->ai_batt_time = (batt.min == -1) ? -1 : batt.min * 60; + aip->ai_batteries = acpi_battery_get_units(); + } + + return (0); +} + +static int +acpi_capm_get_pwstatus(apm_pwstatus_t app) +{ + device_t dev; + int acline, unit, error; + struct acpi_battinfo batt; + + if (app->ap_device != PMDV_ALLDEV && + (app->ap_device < PMDV_BATT0 || app->ap_device > PMDV_BATT_ALL)) + return (1); + + if (app->ap_device == PMDV_ALLDEV) + error = acpi_battery_get_battinfo(NULL, &batt); + else { + unit = app->ap_device - PMDV_BATT0; + dev = devclass_get_device(devclass_find("battery"), unit); + if (dev != NULL) + error = acpi_battery_get_battinfo(dev, &batt); + else + error = ENXIO; + } + if (error) + return (1); + + app->ap_batt_stat = acpi_capm_convert_battstate(&batt); + app->ap_batt_flag = acpi_capm_convert_battflags(&batt); + app->ap_batt_life = batt.cap; + app->ap_batt_time = (batt.min == -1) ? -1 : batt.min * 60; + + if (acpi_acad_get_acline(&acline)) + app->ap_acline = APM_UNKNOWN; + else + app->ap_acline = acline; /* on/off */ + + return (0); +} + +/* Create single-use devices for /dev/apm and /dev/apmctl. */ +static void +apm_clone(void *arg, struct ucred *cred, char *name, int namelen, + struct cdev **dev) +{ + int ctl_dev, unit; + + if (*dev != NULL) + return; + if (strcmp(name, "apmctl") == 0) + ctl_dev = TRUE; + else if (strcmp(name, "apm") == 0) + ctl_dev = FALSE; + else + return; + + /* Always create a new device and unit number. */ + unit = -1; + if (clone_create(&apm_clones, &apm_cdevsw, &unit, dev, 0)) { + if (ctl_dev) { + *dev = make_dev(&apm_cdevsw, unit, + UID_ROOT, GID_OPERATOR, 0660, "apmctl%d", unit); + } else { + *dev = make_dev(&apm_cdevsw, unit, + UID_ROOT, GID_OPERATOR, 0664, "apm%d", unit); + } + if (*dev != NULL) { + dev_ref(*dev); + (*dev)->si_flags |= SI_CHEAPCLONE; + } + } +} + +/* Create a struct for tracking per-device suspend notification. */ +static struct apm_clone_data * +apm_create_clone(struct cdev *dev, struct acpi_softc *acpi_sc) +{ + struct apm_clone_data *clone; + + clone = malloc(sizeof(*clone), M_APMDEV, M_WAITOK); + clone->cdev = dev; + clone->acpi_sc = acpi_sc; + clone->notify_status = APM_EV_NONE; + bzero(&clone->sel_read, sizeof(clone->sel_read)); + knlist_init_mtx(&clone->sel_read.si_note, &acpi_mutex); + + /* + * The acpi device is always managed by devd(8) and is considered + * writable (i.e., ack is required to allow suspend to proceed.) + */ + if (strcmp("acpi", devtoname(dev)) == 0) + clone->flags = ACPI_EVF_DEVD | ACPI_EVF_WRITE; + else + clone->flags = ACPI_EVF_NONE; + + ACPI_LOCK(acpi); + STAILQ_INSERT_TAIL(&acpi_sc->apm_cdevs, clone, entries); + ACPI_UNLOCK(acpi); + return (clone); +} + +static int +apmopen(struct cdev *dev, int flag, int fmt, struct thread *td) +{ + struct acpi_softc *acpi_sc; + struct apm_clone_data *clone; + + acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); + clone = apm_create_clone(dev, acpi_sc); + dev->si_drv1 = clone; + + /* If the device is opened for write, record that. */ + if ((flag & FWRITE) != 0) + clone->flags |= ACPI_EVF_WRITE; + + return (0); +} + +static int +apmclose(struct cdev *dev, int flag, int fmt, struct thread *td) +{ + struct apm_clone_data *clone; + struct acpi_softc *acpi_sc; + + clone = dev->si_drv1; + acpi_sc = clone->acpi_sc; + + /* We are about to lose a reference so check if suspend should occur */ + if (acpi_sc->acpi_next_sstate != 0 && + clone->notify_status != APM_EV_ACKED) + acpi_AckSleepState(clone, 0); + + /* Remove this clone's data from the list and free it. */ + ACPI_LOCK(acpi); + STAILQ_REMOVE(&acpi_sc->apm_cdevs, clone, apm_clone_data, entries); + knlist_destroy(&clone->sel_read.si_note); + ACPI_UNLOCK(acpi); + free(clone, M_APMDEV); + destroy_dev_sched(dev); + return (0); +} + +static int +apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) +{ + int error; + struct apm_clone_data *clone; + struct acpi_softc *acpi_sc; + struct apm_info info; + struct apm_event_info *ev_info; + apm_info_old_t aiop; + + error = 0; + clone = dev->si_drv1; + acpi_sc = clone->acpi_sc; + + switch (cmd) { + case APMIO_SUSPEND: + if ((flag & FWRITE) == 0) + return (EPERM); + if (acpi_sc->acpi_next_sstate == 0) { + if (acpi_sc->acpi_suspend_sx != ACPI_STATE_S5) { + error = acpi_ReqSleepState(acpi_sc, + acpi_sc->acpi_suspend_sx); + } else { + printf( + "power off via apm suspend not supported\n"); + error = ENXIO; + } + } else + error = acpi_AckSleepState(clone, 0); + break; + case APMIO_STANDBY: + if ((flag & FWRITE) == 0) + return (EPERM); + if (acpi_sc->acpi_next_sstate == 0) { + if (acpi_sc->acpi_standby_sx != ACPI_STATE_S5) { + error = acpi_ReqSleepState(acpi_sc, + acpi_sc->acpi_standby_sx); + } else { + printf( + "power off via apm standby not supported\n"); + error = ENXIO; + } + } else + error = acpi_AckSleepState(clone, 0); + break; + case APMIO_NEXTEVENT: + printf("apm nextevent start\n"); + ACPI_LOCK(acpi); + if (acpi_sc->acpi_next_sstate != 0 && clone->notify_status == + APM_EV_NONE) { + ev_info = (struct apm_event_info *)addr; + if (acpi_sc->acpi_next_sstate <= ACPI_STATE_S3) + ev_info->type = PMEV_STANDBYREQ; + else + ev_info->type = PMEV_SUSPENDREQ; + ev_info->index = 0; + clone->notify_status = APM_EV_NOTIFIED; + printf("apm event returning %d\n", ev_info->type); + } else + error = EAGAIN; + ACPI_UNLOCK(acpi); + break; + case APMIO_GETINFO_OLD: + if (acpi_capm_get_info(&info)) + error = ENXIO; + aiop = (apm_info_old_t)addr; + aiop->ai_major = info.ai_major; + aiop->ai_minor = info.ai_minor; + aiop->ai_acline = info.ai_acline; + aiop->ai_batt_stat = info.ai_batt_stat; + aiop->ai_batt_life = info.ai_batt_life; + aiop->ai_status = info.ai_status; + break; + case APMIO_GETINFO: + if (acpi_capm_get_info((apm_info_t)addr)) + error = ENXIO; + break; + case APMIO_GETPWSTATUS: + if (acpi_capm_get_pwstatus((apm_pwstatus_t)addr)) + error = ENXIO; + break; + case APMIO_ENABLE: + if ((flag & FWRITE) == 0) + return (EPERM); + apm_active = 1; + break; + case APMIO_DISABLE: + if ((flag & FWRITE) == 0) + return (EPERM); + apm_active = 0; + break; + case APMIO_HALTCPU: + break; + case APMIO_NOTHALTCPU: + break; + case APMIO_DISPLAY: + if ((flag & FWRITE) == 0) + return (EPERM); + break; + case APMIO_BIOS: + if ((flag & FWRITE) == 0) + return (EPERM); + bzero(addr, sizeof(struct apm_bios_arg)); + break; + default: + error = EINVAL; + break; + } + + return (error); +} + +static int +apmwrite(struct cdev *dev, struct uio *uio, int ioflag) +{ + return (uio->uio_resid); +} + +static int +apmpoll(struct cdev *dev, int events, struct thread *td) +{ + struct apm_clone_data *clone; + int revents; + + revents = 0; + ACPI_LOCK(acpi); + clone = dev->si_drv1; + if (clone->acpi_sc->acpi_next_sstate) + revents |= events & (POLLIN | POLLRDNORM); + else + selrecord(td, &clone->sel_read); + ACPI_UNLOCK(acpi); + return (revents); +} + +static int +apmkqfilter(struct cdev *dev, struct knote *kn) +{ + struct apm_clone_data *clone; + + ACPI_LOCK(acpi); + clone = dev->si_drv1; + kn->kn_hook = clone; + kn->kn_fop = &apm_readfiltops; + knlist_add(&clone->sel_read.si_note, kn, 0); + ACPI_UNLOCK(acpi); + return (0); +} + +static void +apmreadfiltdetach(struct knote *kn) +{ + struct apm_clone_data *clone; + + ACPI_LOCK(acpi); + clone = kn->kn_hook; + knlist_remove(&clone->sel_read.si_note, kn, 0); + ACPI_UNLOCK(acpi); +} + +static int +apmreadfilt(struct knote *kn, long hint) +{ + struct apm_clone_data *clone; + int sleeping; + + ACPI_LOCK(acpi); + clone = kn->kn_hook; + sleeping = clone->acpi_sc->acpi_next_sstate ? 1 : 0; + ACPI_UNLOCK(acpi); + return (sleeping); +} int acpi_machdep_init(device_t dev) @@ -63,14 +506,11 @@ acpi_machdep_init(device_t dev) sc = devclass_get_softc(devclass_find("acpi"), 0); - /* Create a fake clone for /dev/acpi. */ + /* Create a clone for /dev/acpi also. */ STAILQ_INIT(&sc->apm_cdevs); - acpi_clone.cdev = sc->acpi_dev_t; - acpi_clone.acpi_sc = sc; - ACPI_LOCK(acpi); - STAILQ_INSERT_TAIL(&sc->apm_cdevs, &acpi_clone, entries); - ACPI_UNLOCK(acpi); - sc->acpi_clone = &acpi_clone; + sc->acpi_clone = apm_create_clone(sc->acpi_dev_t, sc); + clone_setup(&apm_clones); + EVENTHANDLER_REGISTER(dev_clone, apm_clone, 0, 1000); acpi_install_wakeup_handler(sc); if (intr_model != ACPI_INTR_PIC) Copied and modified: head/sys/amd64/include/apm_bios.h (from r197533, head/sys/i386/include/apm_bios.h) ============================================================================== --- head/sys/i386/include/apm_bios.h Sat Sep 26 23:25:22 2009 (r197533, copy source) +++ head/sys/amd64/include/apm_bios.h Sun Sep 27 14:00:16 2009 (r197536) @@ -230,12 +230,12 @@ typedef struct apm_pwstatus { } *apm_pwstatus_t; struct apm_bios_arg { - u_long eax; - u_long ebx; - u_long ecx; - u_long edx; - u_long esi; - u_long edi; + uint32_t eax; + uint32_t ebx; + uint32_t ecx; + uint32_t edx; + uint32_t esi; + uint32_t edi; }; struct apm_event_info { Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sun Sep 27 13:24:34 2009 (r197535) +++ head/sys/dev/acpica/acpi.c Sun Sep 27 14:00:16 2009 (r197536) @@ -2308,9 +2308,8 @@ acpi_sleep_force(void *arg) int acpi_ReqSleepState(struct acpi_softc *sc, int state) { -#if defined(__i386__) +#if defined(__amd64__) || defined(__i386__) struct apm_clone_data *clone; -#endif if (state < ACPI_STATE_S1 || state > ACPI_S_STATES_MAX) return (EINVAL); @@ -2325,7 +2324,6 @@ acpi_ReqSleepState(struct acpi_softc *sc return (ENXIO); } -#if defined(__amd64__) || defined(__i386__) /* If a suspend request is already in progress, just return. */ ACPI_LOCK(acpi); if (sc->acpi_next_sstate != 0) { @@ -2335,7 +2333,6 @@ acpi_ReqSleepState(struct acpi_softc *sc /* Record the pending state and notify all apm devices. */ sc->acpi_next_sstate = state; -#if defined(__i386__) STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) { @@ -2343,7 +2340,6 @@ acpi_ReqSleepState(struct acpi_softc *sc KNOTE_UNLOCKED(&clone->sel_read.si_note, 0); } } -#endif /* If devd(8) is not running, immediately enter the sleep state. */ if (!devctl_process_running()) { @@ -2414,7 +2410,6 @@ acpi_AckSleepState(struct apm_clone_data * are writable since read-only devices couldn't ack the request. */ sleeping = TRUE; -#if defined(__i386__) clone->notify_status = APM_EV_ACKED; STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { if ((clone->flags & ACPI_EVF_WRITE) != 0 && @@ -2423,7 +2418,6 @@ acpi_AckSleepState(struct apm_clone_data break; } } -#endif /* If all devices have voted "yes", we will suspend now. */ if (sleeping) Modified: head/sys/i386/include/apm_bios.h ============================================================================== --- head/sys/i386/include/apm_bios.h Sun Sep 27 13:24:34 2009 (r197535) +++ head/sys/i386/include/apm_bios.h Sun Sep 27 14:00:16 2009 (r197536) @@ -230,12 +230,12 @@ typedef struct apm_pwstatus { } *apm_pwstatus_t; struct apm_bios_arg { - u_long eax; - u_long ebx; - u_long ecx; - u_long edx; - u_long esi; - u_long edi; + uint32_t eax; + uint32_t ebx; + uint32_t ecx; + uint32_t edx; + uint32_t esi; + uint32_t edi; }; struct apm_event_info { Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sun Sep 27 13:24:34 2009 (r197535) +++ head/usr.sbin/Makefile Sun Sep 27 14:00:16 2009 (r197536) @@ -468,6 +468,9 @@ _boot98cfg= boot98cfg .if ${MK_ACPI} != "no" _acpi= acpi .endif +.if ${MK_APM} != "no" +_apm= apm +.endif _asf= asf _boot0cfg= boot0cfg .if ${MK_TOOLCHAIN} != "no" Modified: head/usr.sbin/apm/Makefile ============================================================================== --- head/usr.sbin/apm/Makefile Sun Sep 27 13:24:34 2009 (r197535) +++ head/usr.sbin/apm/Makefile Sun Sep 27 14:00:16 2009 (r197536) @@ -3,7 +3,7 @@ PROG= apm MAN= apm.8 MLINKS= apm.8 apmconf.8 -MANSUBDIR= /i386 +MANSUBDIR= /${MACHINE_ARCH} WARNS?= 6 .include From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 14:49:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00CC31065679; Sun, 27 Sep 2009 14:49:53 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E32828FC14; Sun, 27 Sep 2009 14:49:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8REnpUG027610; Sun, 27 Sep 2009 14:49:51 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8REnpUX027608; Sun, 27 Sep 2009 14:49:51 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200909271449.n8REnpUX027608@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 27 Sep 2009 14:49:51 +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: r197537 - 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: Sun, 27 Sep 2009 14:49:53 -0000 Author: simon Date: Sun Sep 27 14:49:51 2009 New Revision: 197537 URL: http://svn.freebsd.org/changeset/base/197537 Log: Do not allow mmap with the MAP_FIXED argument to map at address zero. This is done to make it harder to exploit kernel NULL pointer security vulnerabilities. While this of course does not fix vulnerabilities, it does mitigate their impact. Note that this may break some applications, most likely emulators or similar, which for one reason or another require mapping memory at zero. This restriction can be disabled with the security.bsd.mmap_zero sysctl variable. Discussed with: rwatson, bz Tested by: bz (Wine), simon (VirtualBox) Submitted by: jhb Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Sep 27 14:00:16 2009 (r197536) +++ head/sys/vm/vm_mmap.c Sun Sep 27 14:49:51 2009 (r197537) @@ -97,6 +97,14 @@ SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap, "Maximum number of memory-mapped files per process"); /* + * 'mmap_zero' determines whether or not MAP_FIXED mmap() requests for + * virtual address zero are permitted. + */ +static int mmap_zero; +SYSCTL_INT(_security_bsd, OID_AUTO, mmap_zero, CTLFLAG_RW, &mmap_zero, 0, + "Processes may map an object at virtual address zero"); + +/* * Set the maximum number of vm_map_entry structures per process. Roughly * speaking vm_map_entry structures are tiny, so allowing them to eat 1/100 * of our KVM malloc space still results in generous limits. We want a @@ -229,7 +237,8 @@ mmap(td, uap) pos = uap->pos; fp = NULL; - /* make sure mapping fits into numeric range etc */ + + /* Make sure mapping fits into numeric range, etc. */ if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && curproc->p_osrel >= 800104) || ((flags & MAP_ANON) && uap->fd != -1)) @@ -267,6 +276,14 @@ mmap(td, uap) addr -= pageoff; if (addr & PAGE_MASK) return (EINVAL); + + /* + * Mapping to address zero is only permitted if + * mmap_zero is enabled. + */ + if (addr == 0 && !mmap_zero) + return (EINVAL); + /* Address range must be all in user VM space. */ if (addr < vm_map_min(&vms->vm_map) || addr + size > vm_map_max(&vms->vm_map)) From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 14:55:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5889B106566B; Sun, 27 Sep 2009 14:55:11 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8AB8FC13; Sun, 27 Sep 2009 14:55:11 +0000 (UTC) Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3]) by mx.nitro.dk (Postfix) with ESMTP id 63BD42D48A1; Sun, 27 Sep 2009 14:55:10 +0000 (UTC) Received: by arthur.nitro.dk (Postfix, from userid 1000) id 4F3AC5C05; Sun, 27 Sep 2009 16:55:10 +0200 (CEST) Date: Sun, 27 Sep 2009 16:55:10 +0200 From: "Simon L. Nielsen" To: Alexey Dokuchaev Message-ID: <20090927145509.GG1495@arthur.nitro.dk> References: <200909251824.n8PIOLte036513@svn.freebsd.org> <20090925191416.GA1597@garage.freebsd.pl> <86tyyph1jl.fsf@ds4.des.no> <20090927070220.GA18022@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090927070220.GA18022@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Thomas Backman , svn-src-head@freebsd.org, Dag-Erling Sm??rgrav Subject: Re: svn commit: r197498 - 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: Sun, 27 Sep 2009 14:55:11 -0000 On 2009.09.27 07:02:21 +0000, Alexey Dokuchaev wrote: > On Sat, Sep 26, 2009 at 10:51:58PM +0200, Dag-Erling Sm??rgrav wrote: > > Pawel Jakub Dawidek writes: > > > I didn't, thanks. Unfortunately svn doesn't even allow forced commits, > > > which is a paintful regression compared to cvs. > > > > Subversion does allow editing a log message after the fact, but our > > commit scripts prohibit it. This should IMHO be allowed, and cause a > > new email to be sent out to note the change. > > I recall that one of the reasons behind prohibition was to avoid issues > with CVS exporter. I doubt the CVS exporter would have a problem, though I'm not 100% sure. I think the problem is more that svnsync does not pick up the change, but des knows more about that than I do. PS. I don't personally have a problem allowing people to edit commit messages, as long as it's "visible" and we knows what the side-effects are. -- Simon L. Nielsen From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 15:16:49 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E45D6106566B; Sun, 27 Sep 2009 15:16:49 +0000 (UTC) (envelope-from nyan@jp.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 7023D8FC12; Sun, 27 Sep 2009 15:16:49 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id n8RFGiVN056098; Mon, 28 Sep 2009 00:16:47 +0900 (JST) (envelope-from nyan@jp.FreeBSD.org) Date: Mon, 28 Sep 2009 00:16:36 +0900 (JST) Message-Id: <20090928.001636.94960401.nyan@jp.FreeBSD.org> To: kostikbel@gmail.com From: Takahashi Yoshihiro In-Reply-To: <20090927135120.GI47688@deviant.kiev.zoral.com.ua> References: <200909271324.n8RDOYVY090431@svn.freebsd.org> <20090927135120.GI47688@deviant.kiev.zoral.com.ua> X-Mailer: Mew version 6.2 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r197535 - head/sys/modules/nfslockd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 15:16:50 -0000 In article <20090927135120.GI47688@deviant.kiev.zoral.com.ua> Kostik Belousov writes: > It seems more interesting and more unfortunate that nlm would not work > for client when nfs client is not compiled into the kernel ? Is this true ? Yes. --- TAKAHASHI Yoshihiro From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 15:39:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 060DA1065672; Sun, 27 Sep 2009 15:39:21 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id B04FD8FC08; Sun, 27 Sep 2009 15:39:20 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id BC8176D41B; Sun, 27 Sep 2009 15:39:19 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 8A7DE844B4; Sun, 27 Sep 2009 17:39:19 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Simon L. Nielsen" References: <200909251824.n8PIOLte036513@svn.freebsd.org> <20090925191416.GA1597@garage.freebsd.pl> <86tyyph1jl.fsf@ds4.des.no> <20090927070220.GA18022@FreeBSD.org> <20090927145509.GG1495@arthur.nitro.dk> Date: Sun, 27 Sep 2009 17:39:19 +0200 In-Reply-To: <20090927145509.GG1495@arthur.nitro.dk> (Simon L. Nielsen's message of "Sun, 27 Sep 2009 16:55:10 +0200") Message-ID: <86tyyoflco.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Alexey Dokuchaev , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Thomas Backman , svn-src-head@freebsd.org Subject: Re: svn commit: r197498 - 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: Sun, 27 Sep 2009 15:39:21 -0000 "Simon L. Nielsen" writes: > I doubt the CVS exporter would have a problem, though I'm not 100% > sure. I think the problem is more that svnsync does not pick up the > change, but des knows more about that than I do. Yes, the problem is svnsync, which I've always said is the wrong answer to the wrong question. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 18:19:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F1EC106566B; Sun, 27 Sep 2009 18:19:42 +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 0D4FA8FC08; Sun, 27 Sep 2009 18:19:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RIJf1h031447; Sun, 27 Sep 2009 18:19:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RIJfNg031440; Sun, 27 Sep 2009 18:19:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200909271819.n8RIJfNg031440@svn.freebsd.org> From: Ed Schouten Date: Sun, 27 Sep 2009 18:19: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: r197539 - in head/sys: dev/syscons teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 18:19:42 -0000 Author: ed Date: Sun Sep 27 18:19:41 2009 New Revision: 197539 URL: http://svn.freebsd.org/changeset/base/197539 Log: Add support for VT200-style mouse input. Right now if applications want to use the mouse on the command line, they use sysmouse(4) and install a signal handler in the kernel to deliver signals when mouse events arrive. This conflicts with my plan to change to TERM=xterm, so implement proper VT200-style mouse input. Because mouse input is now streamed through the TTY, it means you can now SSH to another system on the console and use the mouse there as well. The disadvantage of the VT200 mouse protocol, is that it doesn't seem to generate events when moving the cursor. Only when pressing and releasing mouse buttons. There are different protocols as well, but this one seems to be most commonly supported. Reported by: Paul B. Mahol Tested with: vim(1) Modified: head/sys/dev/syscons/scmouse.c head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h head/sys/teken/teken.h head/sys/teken/teken_subr.h Modified: head/sys/dev/syscons/scmouse.c ============================================================================== --- head/sys/dev/syscons/scmouse.c Sun Sep 27 17:33:26 2009 (r197538) +++ head/sys/dev/syscons/scmouse.c Sun Sep 27 18:19:41 2009 (r197539) @@ -117,6 +117,48 @@ sc_alloc_cut_buffer(scr_stat *scp, int w } #endif /* SC_NO_CUTPASTE */ +static void +sc_mouse_input_button(scr_stat *scp, int button) +{ + char mouseb[6] = "\x1B[M"; + + mouseb[3] = ' ' + button; + mouseb[4] = '!' + scp->mouse_pos % scp->xsize; + mouseb[5] = '!' + scp->mouse_pos / scp->xsize; + sc_respond(scp, mouseb, sizeof mouseb, 1); +} + +static void +sc_mouse_input(scr_stat *scp, mouse_info_t *mouse) +{ + + switch (mouse->operation) { + case MOUSE_BUTTON_EVENT: + if (mouse->u.event.value > 0) { + /* Mouse button pressed. */ + if (mouse->u.event.id & MOUSE_BUTTON1DOWN) + sc_mouse_input_button(scp, 0); + if (mouse->u.event.id & MOUSE_BUTTON2DOWN) + sc_mouse_input_button(scp, 1); + if (mouse->u.event.id & MOUSE_BUTTON3DOWN) + sc_mouse_input_button(scp, 2); + } else { + /* Mouse button released. */ + sc_mouse_input_button(scp, 3); + } + break; + case MOUSE_MOTION_EVENT: + if (mouse->u.data.z < 0) { + /* Scroll up. */ + sc_mouse_input_button(scp, 64); + } else if (mouse->u.data.z > 0) { + /* Scroll down. */ + sc_mouse_input_button(scp, 65); + } + break; + } +} + /* move mouse */ void sc_mouse_move(scr_stat *scp, int x, int y) @@ -755,6 +797,11 @@ sc_mouse_ioctl(struct tty *tp, u_long cm cur_scp->status &= ~MOUSE_HIDDEN; + if (cur_scp->mouse_level > 0) { + sc_mouse_input(scp, mouse); + break; + } + if (cur_scp->mouse_signal && cur_scp->mouse_proc) { /* has controlling process died? */ if (cur_scp->mouse_proc != (p1 = pfind(cur_scp->mouse_pid))) { @@ -811,6 +858,11 @@ sc_mouse_ioctl(struct tty *tp, u_long cm cur_scp->status &= ~MOUSE_HIDDEN; + if (cur_scp->mouse_level > 0) { + sc_mouse_input(scp, mouse); + break; + } + if (cur_scp->mouse_signal && cur_scp->mouse_proc) { if (cur_scp->mouse_proc != (p1 = pfind(cur_scp->mouse_pid))){ cur_scp->mouse_signal = 0; Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sun Sep 27 17:33:26 2009 (r197538) +++ head/sys/dev/syscons/scterm-teken.c Sun Sep 27 18:19:41 2009 (r197539) @@ -644,6 +644,9 @@ scteken_param(void *arg, int cmd, unsign scp->bell_pitch = TP_SETBELLPD_PITCH(value); scp->bell_duration = TP_SETBELLPD_DURATION(value); break; + case TP_MOUSE: + scp->mouse_level = value; + break; } } @@ -652,5 +655,5 @@ scteken_respond(void *arg, const void *b { scr_stat *scp = arg; - sc_respond(scp, buf, len); + sc_respond(scp, buf, len, 0); } Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Sun Sep 27 17:33:26 2009 (r197538) +++ head/sys/dev/syscons/syscons.c Sun Sep 27 18:19:41 2009 (r197539) @@ -3561,19 +3561,18 @@ sc_paste(scr_stat *scp, const u_char *p, } void -sc_respond(scr_stat *scp, const u_char *p, int count) +sc_respond(scr_stat *scp, const u_char *p, int count, int wakeup) { struct tty *tp; tp = SC_DEV(scp->sc, scp->sc->cur_scp->index); if (!tty_opened(tp)) return; - for (; count > 0; --count) - ttydisc_rint(tp, *p++, 0); -#if 0 - /* XXX: we can't call ttydisc_rint_done() here! */ - ttydisc_rint_done(tp); -#endif + ttydisc_rint_simple(tp, p, count); + if (wakeup) { + /* XXX: we can't always call ttydisc_rint_done() here! */ + ttydisc_rint_done(tp); + } } void Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Sun Sep 27 17:33:26 2009 (r197538) +++ head/sys/dev/syscons/syscons.h Sun Sep 27 18:19:41 2009 (r197539) @@ -314,6 +314,7 @@ typedef struct scr_stat { short mouse_buttons; /* mouse buttons */ int mouse_cut_start; /* mouse cut start pos */ int mouse_cut_end; /* mouse cut end pos */ + int mouse_level; /* xterm mouse protocol */ struct proc *mouse_proc; /* proc* of controlling proc */ pid_t mouse_pid; /* pid of controlling proc */ int mouse_signal; /* signal # to report with */ @@ -564,7 +565,8 @@ int sc_switch_scr(sc_softc_t *sc, u_int void sc_alloc_scr_buffer(scr_stat *scp, int wait, int discard); int sc_init_emulator(scr_stat *scp, char *name); void sc_paste(scr_stat *scp, const u_char *p, int count); -void sc_respond(scr_stat *scp, const u_char *p, int count); +void sc_respond(scr_stat *scp, const u_char *p, + int count, int wakeup); void sc_bell(scr_stat *scp, int pitch, int duration); /* schistory.c */ Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Sun Sep 27 17:33:26 2009 (r197538) +++ head/sys/teken/teken.h Sun Sep 27 18:19:41 2009 (r197539) @@ -97,6 +97,7 @@ typedef void tf_param_t(void *, int, uns #define TP_SETBELLPD 6 #define TP_SETBELLPD_PITCH(pd) ((pd) >> 16) #define TP_SETBELLPD_DURATION(pd) ((pd) & 0xffff) +#define TP_MOUSE 7 typedef void tf_respond_t(void *, const void *, size_t); typedef struct { Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sun Sep 27 17:33:26 2009 (r197538) +++ head/sys/teken/teken_subr.h Sun Sep 27 18:19:41 2009 (r197539) @@ -932,6 +932,9 @@ teken_subr_reset_dec_mode(teken_t *t, un case 47: /* Switch to alternate buffer. */ teken_printf("Switch to alternate buffer\n"); break; + case 1000: /* Mouse input. */ + teken_funcs_param(t, TP_MOUSE, 0); + break; default: teken_printf("Unknown DECRST: %u\n", cmd); } @@ -1078,6 +1081,9 @@ teken_subr_set_dec_mode(teken_t *t, unsi case 47: /* Switch to alternate buffer. */ teken_printf("Switch away from alternate buffer\n"); break; + case 1000: /* Mouse input. */ + teken_funcs_param(t, TP_MOUSE, 1); + break; default: teken_printf("Unknown DECSET: %u\n", cmd); } From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 18:54:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 987DC106568F for ; Sun, 27 Sep 2009 18:54:09 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outX.internet-mail-service.net (outx.internet-mail-service.net [216.240.47.247]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1E08FC1E for ; Sun, 27 Sep 2009 18:54:09 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 53789B998C; Sun, 27 Sep 2009 11:54:12 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id C0F0B2D6017; Sun, 27 Sep 2009 11:54:08 -0700 (PDT) Message-ID: <4ABFB4D1.5070505@elischer.org> Date: Sun, 27 Sep 2009 11:54:09 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: "Simon L. Nielsen" References: <200909271449.n8REnpUX027608@svn.freebsd.org> In-Reply-To: <200909271449.n8REnpUX027608@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: r197537 - 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: Sun, 27 Sep 2009 18:54:09 -0000 Simon L. Nielsen wrote: > Author: simon > Date: Sun Sep 27 14:49:51 2009 > New Revision: 197537 > URL: http://svn.freebsd.org/changeset/base/197537 > > Log: > Do not allow mmap with the MAP_FIXED argument to map at address zero. > This is done to make it harder to exploit kernel NULL pointer security > vulnerabilities. While this of course does not fix vulnerabilities, > it does mitigate their impact. > > Note that this may break some applications, most likely emulators or > similar, which for one reason or another require mapping memory at > zero. If you are going to take this approach then it shuel be enabled by a bit in the inherrited process permissions, with a toll to set it, like: map0 {command} where command could be something like "wine". use setfib or nice as a template for the tool. this way only processes that need it are affected. > > This restriction can be disabled with the security.bsd.mmap_zero > sysctl variable. > > Discussed with: rwatson, bz > Tested by: bz (Wine), simon (VirtualBox) > Submitted by: jhb > > Modified: > head/sys/vm/vm_mmap.c > > Modified: head/sys/vm/vm_mmap.c > ============================================================================== > --- head/sys/vm/vm_mmap.c Sun Sep 27 14:00:16 2009 (r197536) > +++ head/sys/vm/vm_mmap.c Sun Sep 27 14:49:51 2009 (r197537) > @@ -97,6 +97,14 @@ SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap, > "Maximum number of memory-mapped files per process"); > > /* > + * 'mmap_zero' determines whether or not MAP_FIXED mmap() requests for > + * virtual address zero are permitted. > + */ > +static int mmap_zero; > +SYSCTL_INT(_security_bsd, OID_AUTO, mmap_zero, CTLFLAG_RW, &mmap_zero, 0, > + "Processes may map an object at virtual address zero"); > + > +/* > * Set the maximum number of vm_map_entry structures per process. Roughly > * speaking vm_map_entry structures are tiny, so allowing them to eat 1/100 > * of our KVM malloc space still results in generous limits. We want a > @@ -229,7 +237,8 @@ mmap(td, uap) > pos = uap->pos; > > fp = NULL; > - /* make sure mapping fits into numeric range etc */ > + > + /* Make sure mapping fits into numeric range, etc. */ > if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && > curproc->p_osrel >= 800104) || > ((flags & MAP_ANON) && uap->fd != -1)) > @@ -267,6 +276,14 @@ mmap(td, uap) > addr -= pageoff; > if (addr & PAGE_MASK) > return (EINVAL); > + > + /* > + * Mapping to address zero is only permitted if > + * mmap_zero is enabled. > + */ > + if (addr == 0 && !mmap_zero) > + return (EINVAL); > + > /* Address range must be all in user VM space. */ > if (addr < vm_map_min(&vms->vm_map) || > addr + size > vm_map_max(&vms->vm_map)) From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 18:55:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBC18106568B for ; Sun, 27 Sep 2009 18:55:56 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outI.internet-mail-service.net (outi.internet-mail-service.net [216.240.47.232]) by mx1.freebsd.org (Postfix) with ESMTP id B30598FC17 for ; Sun, 27 Sep 2009 18:55:56 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 6CBD3C9282; Sun, 27 Sep 2009 11:55:59 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id E91602D6019; Sun, 27 Sep 2009 11:55:55 -0700 (PDT) Message-ID: <4ABFB53E.6010702@elischer.org> Date: Sun, 27 Sep 2009 11:55:58 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: "Simon L. Nielsen" References: <200909271449.n8REnpUX027608@svn.freebsd.org> <4ABFB4D1.5070505@elischer.org> In-Reply-To: <4ABFB4D1.5070505@elischer.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: r197537 - 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: Sun, 27 Sep 2009 18:55:56 -0000 Julian Elischer wrote: > Simon L. Nielsen wrote: >> Author: simon >> Date: Sun Sep 27 14:49:51 2009 >> New Revision: 197537 >> URL: http://svn.freebsd.org/changeset/base/197537 >> >> Log: >> Do not allow mmap with the MAP_FIXED argument to map at address zero. >> This is done to make it harder to exploit kernel NULL pointer security >> vulnerabilities. While this of course does not fix vulnerabilities, >> it does mitigate their impact. >> Note that this may break some applications, most likely emulators or >> similar, which for one reason or another require mapping memory at >> zero. > > If you are going to take this approach then it shuel be enabled by > a bit in the inherrited process permissions, with a toll to set it, > like: > > map0 {command} > where command could be something like "wine". > use setfib or nice as a template for the tool. > > this way only processes that need it are affected. > (of course only root can run the program or set the bit) From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 20:48:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E4461065676; Sun, 27 Sep 2009 20:48:11 +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 6D52C8FC17; Sun, 27 Sep 2009 20:48:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RKmBuH034079; Sun, 27 Sep 2009 20:48:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RKmBWd034078; Sun, 27 Sep 2009 20:48:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909272048.n8RKmBWd034078@svn.freebsd.org> From: Alexander Motin Date: Sun, 27 Sep 2009 20:48: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: r197540 - 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: Sun, 27 Sep 2009 20:48:11 -0000 Author: mav Date: Sun Sep 27 20:48:10 2009 New Revision: 197540 URL: http://svn.freebsd.org/changeset/base/197540 Log: Add more defines from recent and not only specs. Modified: head/sys/sys/ata.h Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Sun Sep 27 18:19:41 2009 (r197539) +++ head/sys/sys/ata.h Sun Sep 27 20:48:10 2009 (r197540) @@ -67,6 +67,8 @@ struct ata_params { /*049*/ u_int16_t capabilities1; #define ATA_SUPPORT_DMA 0x0100 #define ATA_SUPPORT_LBA 0x0200 +#define ATA_SUPPORT_IORDY 0x0400 +#define ATA_SUPPORT_IORDYDIS 0x0800 #define ATA_SUPPORT_OVERLAP 0x4000 /*050*/ u_int16_t capabilities2; @@ -108,22 +110,31 @@ struct ata_params { /*075*/ u_int16_t queue; #define ATA_QUEUE_LEN(x) ((x) & 0x001f) - u_int16_t satacapabilities; +/*76*/ u_int16_t satacapabilities; #define ATA_SATA_GEN1 0x0002 #define ATA_SATA_GEN2 0x0004 +#define ATA_SATA_GEN3 0x0008 #define ATA_SUPPORT_NCQ 0x0100 #define ATA_SUPPORT_IFPWRMNGTRCV 0x0200 #define ATA_SUPPORT_PHYEVENTCNT 0x0400 #define ATA_SUPPORT_NCQ_UNLOAD 0x0800 #define ATA_SUPPORT_NCQ_PRIO 0x1000 - - u_int16_t reserved77; - u_int16_t satasupport; +#define ATA_SUPPORT_HAPST 0x2000 +#define ATA_SUPPORT_DAPST 0x4000 +#define ATA_SUPPORT_READLOGDMAEXT 0x8000 + +/*77*/ u_int16_t satacapabilities2; +#define ATA_SATA_CURR_GEN_MASK 0x0006 +#define ATA_SUPPORT_NCQ_STREAM 0x0010 +#define ATA_SUPPORT_NCQ_QMANAGEMENT 0x0020 +/*78*/ u_int16_t satasupport; #define ATA_SUPPORT_NONZERO 0x0002 #define ATA_SUPPORT_AUTOACTIVATE 0x0004 #define ATA_SUPPORT_IFPWRMNGT 0x0008 #define ATA_SUPPORT_INORDERDATA 0x0010 - u_int16_t sataenabled; +#define ATA_SUPPORT_SOFTSETPRESERVE 0x0040 +/*79*/ u_int16_t sataenabled; +#define ATA_ENABLED_DAPST 0x0080 /*080*/ u_int16_t version_major; /*081*/ u_int16_t version_minor; @@ -161,8 +172,8 @@ struct ata_params { #define ATA_SUPPORT_FLUSHCACHE48 0x2000 /*084/087*/ u_int16_t extension; -#define ATA_SUPPORT_SMARTTEST 0x0001 -#define ATA_SUPPORT_SMARTLOG 0x0002 +#define ATA_SUPPORT_SMARTLOG 0x0001 +#define ATA_SUPPORT_SMARTTEST 0x0002 #define ATA_SUPPORT_MEDIASN 0x0004 #define ATA_SUPPORT_MEDIAPASS 0x0008 #define ATA_SUPPORT_STREAMING 0x0010 @@ -170,6 +181,7 @@ struct ata_params { #define ATA_SUPPORT_WRITEDMAFUAEXT 0x0040 #define ATA_SUPPORT_WRITEDMAQFUAEXT 0x0080 #define ATA_SUPPORT_64BITWWN 0x0100 +#define ATA_SUPPORT_UNLOAD 0x2000 } __packed support, enabled; /*088*/ u_int16_t udmamodes; /* UltraDMA modes */ @@ -192,14 +204,48 @@ struct ata_params { u_int16_t lba_size48_2; u_int16_t lba_size48_3; u_int16_t lba_size48_4; - u_int16_t reserved104[23]; + u_int16_t reserved104[2]; +/*106*/ u_int16_t pss; +#define ATA_PSS_LSPPS 0x000F +#define ATA_PSS_LSSABOVE512 0x2000 +#define ATA_PSS_MULTLS 0x4000 +/*107*/ u_int16_t isd; +/*108*/ u_int16_t wwn[4]; + u_int16_t reserved112[5]; +/*117*/ u_int16_t lss_1; +/*118*/ u_int16_t lss_2; +/*119*/ u_int16_t support2; +#define ATA_SUPPORT_WRITEREADVERIFY 0x0002 +#define ATA_SUPPORT_WRITEUNCORREXT 0x0004 +#define ATA_SUPPORT_RWLOGDMAEXT 0x0008 +#define ATA_SUPPORT_MICROCODE3 0x0010 +#define ATA_SUPPORT_FREEFALL 0x0020 +/*120*/ u_int16_t enabled2; + u_int16_t reserved121[6]; /*127*/ u_int16_t removable_status; /*128*/ u_int16_t security_status; u_int16_t reserved129[31]; /*160*/ u_int16_t cfa_powermode1; u_int16_t reserved161[15]; -/*176*/ u_int16_t media_serial[30]; - u_int16_t reserved206[49]; +/*176*/ u_int8_t media_serial[60]; +/*206*/ u_int16_t sct; + u_int16_t reserved206[2]; +/*209*/ u_int16_t lbalign; +/*210*/ u_int16_t wrv_sectors_m3_1; + u_int16_t wrv_sectors_m3_2; +/*212*/ u_int16_t wrv_sectors_m2_1; + u_int16_t wrv_sectors_m2_2; +/*214*/ u_int16_t nv_cache_caps; +/*215*/ u_int16_t nv_cache_size_1; + u_int16_t nv_cache_size_2; +/*217*/ u_int16_t media_rotation_rate; + u_int16_t reserved218; +/*219*/ u_int16_t nv_cache_opt; +/*220*/ u_int16_t wrv_mode; + u_int16_t reserved221; +/*222*/ u_int16_t transport_major; +/*223*/ u_int16_t transport_minor; + u_int16_t reserved224[31]; /*255*/ u_int16_t integrity; } __packed; From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 20:50:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43AA3106566B; Sun, 27 Sep 2009 20:50: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 32C7D8FC15; Sun, 27 Sep 2009 20:50:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RKotk4034228; Sun, 27 Sep 2009 20:50:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RKotQK034226; Sun, 27 Sep 2009 20:50:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909272050.n8RKotQK034226@svn.freebsd.org> From: Alexander Motin Date: Sun, 27 Sep 2009 20:50: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: r197541 - head/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: Sun, 27 Sep 2009 20:50:55 -0000 Author: mav Date: Sun Sep 27 20:50:54 2009 New Revision: 197541 URL: http://svn.freebsd.org/changeset/base/197541 Log: Report SATA 3.x devices. Modified: head/sys/cam/ata/ata_all.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Sun Sep 27 20:48:10 2009 (r197540) +++ head/sys/cam/ata/ata_all.c Sun Sep 27 20:50:54 2009 (r197541) @@ -80,7 +80,9 @@ ata_print_ident(struct ata_params *ident printf("<%s %s> ATA/ATAPI-%d", product, revision, ata_version(ident_data->version_major)); if (ident_data->satacapabilities && ident_data->satacapabilities != 0xffff) { - if (ident_data->satacapabilities & ATA_SATA_GEN2) + if (ident_data->satacapabilities & ATA_SATA_GEN3) + printf(" SATA 3.x"); + else if (ident_data->satacapabilities & ATA_SATA_GEN2) printf(" SATA 2.x"); else if (ident_data->satacapabilities & ATA_SATA_GEN1) printf(" SATA 1.x"); From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 21:01:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B679A1065695; Sun, 27 Sep 2009 21:01:07 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A50498FC15; Sun, 27 Sep 2009 21:01:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RL17Ip034463; Sun, 27 Sep 2009 21:01:07 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RL17Kd034461; Sun, 27 Sep 2009 21:01:07 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200909272101.n8RL17Kd034461@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 27 Sep 2009 21:01: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: r197542 - head/tools/tools/nanobsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 21:01:07 -0000 Author: simon Date: Sun Sep 27 21:01:07 2009 New Revision: 197542 URL: http://svn.freebsd.org/changeset/base/197542 Log: - When we run our trap cleanup handler, echo that we are running this handler to make it more clear why we are 'suddenly' running df, umount, and mdconfig. - Remove trap handler again after we have unconfigured the memory device etc. Before we could end up running the trap handler if a later stage failed, which was a bit confusing and not really useful. MFC after: 2 weeks Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Sun Sep 27 20:50:54 2009 (r197541) +++ head/tools/tools/nanobsd/nanobsd.sh Sun Sep 27 21:01:07 2009 (r197542) @@ -439,7 +439,7 @@ create_i386_diskimage ( ) ( -y ${NANO_HEADS}` fi - trap "df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT + trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} fdisk ${MD} @@ -491,6 +491,9 @@ create_i386_diskimage ( ) ( echo "Writing out _.disk.image..." dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k mdconfig -d -u $MD + + trap - 1 2 15 EXIT + ) > ${NANO_OBJ}/_.di 2>&1 ) From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 21:03:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9738E106568B; Sun, 27 Sep 2009 21:03: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 8590C8FC0C; Sun, 27 Sep 2009 21:03:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RL3XGN034541; Sun, 27 Sep 2009 21:03:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RL3XV8034538; Sun, 27 Sep 2009 21:03:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200909272103.n8RL3XV8034538@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 27 Sep 2009 21:03: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: r197543 - head/tools/regression/mmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 21:03:33 -0000 Author: bz Date: Sun Sep 27 21:03:33 2009 New Revision: 197543 URL: http://svn.freebsd.org/changeset/base/197543 Log: Add a simple C program to check mmap calls to various different addresses. The most important test is the mapping fixed at address 0 depending on the new sysctl. Things will be updated and possibly converted to m4/.t style once the details about the kernel patch will be shaken out. Submitted by: simon (initial version) Added: head/tools/regression/mmap/ head/tools/regression/mmap/Makefile (contents, props changed) head/tools/regression/mmap/mmap.c (contents, props changed) Added: head/tools/regression/mmap/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/mmap/Makefile Sun Sep 27 21:03:33 2009 (r197543) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= mmap +NO_MAN= + +.include Added: head/tools/regression/mmap/mmap.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/mmap/mmap.c Sun Sep 27 21:03:33 2009 (r197543) @@ -0,0 +1,96 @@ +/*- + * Copyright (c) 2009 Simon L. Nielsen , + * Bjoern A. Zeeb + * + * 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 + +const struct tests { + void *addr; + int ok[2]; /* Depending on security.bsd.mmap_zero {0, !=0}. */ +} tests[] = { + { (void *)0, { 0, 1 } }, /* Test sysctl. */ + { (void *)1, { 0, 0 } }, + { (void *)(PAGE_SIZE - 1), { 0, 0 } }, + { (void *)PAGE_SIZE, { 1, 1 } }, + { (void *)-1, { 0, 0 } }, + { (void *)(-PAGE_SIZE), { 0, 0 } }, + { (void *)(-1 - PAGE_SIZE), { 0, 0 } }, + { (void *)(-1 - PAGE_SIZE - 1), { 0, 0 } }, + { (void *)(0x1000 * PAGE_SIZE), { 1, 1 } }, +}; + +int +main(void) +{ + void *p; + size_t len; + int i, error, mib[3], mmap_zero; + + error = 0; + + /* Get the current sysctl value of security.bsd.mmap_zero. */ + len = sizeof(mib) / sizeof(*mib); + if (sysctlnametomib("security.bsd.mmap_zero", mib, &len) == -1) + err(1, "sysctlnametomib(security.bsd.mmap_zero)"); + + len = sizeof(mmap_zero); + if (sysctl(mib, 3, &mmap_zero, &len, NULL, 0) == -1) + err(1, "sysctl(security.bsd.mmap_zero)"); + + /* Normalize to 0 or 1 for array access. */ + mmap_zero = !!mmap_zero; + + for (i=0; i < (sizeof(tests) / sizeof(*tests)); i++) { + p = mmap((void *)tests[i].addr, PAGE_SIZE, + PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_FIXED, + -1, 0); + if (p == MAP_FAILED) { + if (tests[i].ok[mmap_zero] != 0) + error++; + warnx("%s: mmap(%p, ...) failed.", + (tests[i].ok[mmap_zero] == 0) ? "OK " : "ERR", + tests[i].addr); + } else { + if (tests[i].ok[mmap_zero] != 1) + error++; + warnx("%s: mmap(%p, ...) succeeded: p=%p", + (tests[i].ok[mmap_zero] == 1) ? "OK " : "ERR", + tests[i].addr, p); + } + } + + if (error) + err(1, "---\nERROR: %d unexpected results.", error); + + return (error != 0); +} From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 21:11:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F3C10656A5 for ; Sun, 27 Sep 2009 21:11:57 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id CD4208FC2C for ; Sun, 27 Sep 2009 21:11:56 +0000 (UTC) Received: from vampire.homelinux.org (dslb-088-066-054-182.pools.arcor-ip.net [88.66.54.182]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MKuxg-1Ms12B3D3g-000IRf; Sun, 27 Sep 2009 23:11:55 +0200 Received: (qmail 68666 invoked from network); 27 Sep 2009 21:11:55 -0000 Received: from kvm.laiers.local (HELO kvm.localnet) (192.168.4.200) by mx.laiers.local with SMTP; 27 Sep 2009 21:11:55 -0000 From: Max Laier Organization: FreeBSD To: "Simon L. Nielsen" Date: Sun, 27 Sep 2009 23:11:56 +0200 User-Agent: KMail/1.12.1 (Linux/2.6.30-ARCH; KDE/4.3.1; x86_64; ; ) References: <200909251824.n8PIOLte036513@svn.freebsd.org> <20090927070220.GA18022@FreeBSD.org> <20090927145509.GG1495@arthur.nitro.dk> In-Reply-To: <20090927145509.GG1495@arthur.nitro.dk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200909272311.56602.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1+eTtl/WS04DiDdVb4AWtYnGApeYfM6DYdlHI+ kGXjrXP999NgRf3ciyskStBE+LgI1DpvUVQXl9Q/8bQPb8NVJM MuFtr1vkrc= Cc: Alexey Dokuchaev , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Thomas Backman , svn-src-head@freebsd.org, Dag-Erling Sm??rgrav Subject: Re: svn commit: r197498 - 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: Sun, 27 Sep 2009 21:11:57 -0000 On Sunday 27 September 2009 16:55:10 Simon L. Nielsen wrote: > On 2009.09.27 07:02:21 +0000, Alexey Dokuchaev wrote: > > On Sat, Sep 26, 2009 at 10:51:58PM +0200, Dag-Erling Sm??rgrav wrote: > > > Pawel Jakub Dawidek writes: > > > > I didn't, thanks. Unfortunately svn doesn't even allow forced > > > > commits, which is a paintful regression compared to cvs. > > > > > > Subversion does allow editing a log message after the fact, but our > > > commit scripts prohibit it. This should IMHO be allowed, and cause a > > > new email to be sent out to note the change. > > > > I recall that one of the reasons behind prohibition was to avoid issues > > with CVS exporter. > > I doubt the CVS exporter would have a problem, though I'm not 100% > sure. I think the problem is more that svnsync does not pick up the > change, but des knows more about that than I do. > > PS. I don't personally have a problem allowing people to edit commit > messages, as long as it's "visible" and we knows what the side-effects > are. svn ps fbsd:forced r197498 head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 svn ci -m "Revised commit message" There you go. Forced commit with no problem. Plus we can also record the revision that the forced commit message belongs to. Disclaimer: Don't try this on the main repo before the SVN-meisters have had a look and approve. -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 21:27:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F8371065670; Sun, 27 Sep 2009 21:27: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 5E61A8FC1D; Sun, 27 Sep 2009 21:27:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RLRBew035030; Sun, 27 Sep 2009 21:27:11 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RLRBEI035028; Sun, 27 Sep 2009 21:27:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <200909272127.n8RLRBEI035028@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 27 Sep 2009 21:27: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: r197544 - head/etc/mtree X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 21:27:11 -0000 Author: gabor (doc,ports committer) Date: Sun Sep 27 21:27:11 2009 New Revision: 197544 URL: http://svn.freebsd.org/changeset/base/197544 Log: - Add share/nls/gl_ES.ISO8859-1, which I forgot in my last commit Submitted by: Andrzej Tobola (via private mail) Modified: head/etc/mtree/BSD.usr.dist Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sun Sep 27 21:03:33 2009 (r197543) +++ head/etc/mtree/BSD.usr.dist Sun Sep 27 21:27:11 2009 (r197544) @@ -1031,6 +1031,8 @@ .. fr_FR.UTF-8 .. + gl_ES.ISO8859-1 + .. he_IL.UTF-8 .. hi_IN.ISCII-DEV From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 22:00:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB91F106566C; Sun, 27 Sep 2009 22:00:26 +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 D99378FC1A; Sun, 27 Sep 2009 22:00:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8RM0QF9035714; Sun, 27 Sep 2009 22:00:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8RM0QUZ035712; Sun, 27 Sep 2009 22:00:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200909272200.n8RM0QUZ035712@svn.freebsd.org> From: Alexander Motin Date: Sun, 27 Sep 2009 22:00: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: r197545 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Sep 2009 22:00:27 -0000 Author: mav Date: Sun Sep 27 22:00:26 2009 New Revision: 197545 URL: http://svn.freebsd.org/changeset/base/197545 Log: Fethch more information from IDENTIFY result. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Sun Sep 27 21:27:11 2009 (r197544) +++ head/sbin/camcontrol/camcontrol.c Sun Sep 27 22:00:26 2009 (r197545) @@ -1019,18 +1019,28 @@ atacapprint(struct ata_params *parm) printf("protocol "); printf("ATA/ATAPI-%d", ata_version(parm->version_major)); if (parm->satacapabilities && parm->satacapabilities != 0xffff) { - if (parm->satacapabilities & ATA_SATA_GEN2) + if (parm->satacapabilities & ATA_SATA_GEN3) + printf(" SATA 3.x\n"); + else if (parm->satacapabilities & ATA_SATA_GEN2) printf(" SATA 2.x\n"); else if (parm->satacapabilities & ATA_SATA_GEN1) printf(" SATA 1.x\n"); else - printf(" SATA x.x\n"); + printf(" SATA\n"); } else printf("\n"); printf("device model %.40s\n", parm->model); - printf("serial number %.20s\n", parm->serial); printf("firmware revision %.8s\n", parm->revision); + printf("serial number %.20s\n", parm->serial); + if (parm->enabled.extension & ATA_SUPPORT_64BITWWN) { + printf("WWN %02x%02x%02x%02x\n", + parm->wwn[0], parm->wwn[1], parm->wwn[2], parm->wwn[3]); + } + if (parm->enabled.extension & ATA_SUPPORT_MEDIASN) { + printf("media serial number %.30s\n", + parm->media_serial); + } printf("cylinders %d\n", parm->cylinders); printf("heads %d\n", parm->heads); @@ -1071,6 +1081,8 @@ atacapprint(struct ata_params *parm) default: printf("0"); } + if ((parm->capabilities1 & ATA_SUPPORT_IORDY) == 0) + printf(" w/o IORDY"); printf("\n"); printf("DMA%ssupported ", @@ -1110,18 +1122,25 @@ atacapprint(struct ata_params *parm) printf("overlap%ssupported\n", parm->capabilities1 & ATA_SUPPORT_OVERLAP ? " " : " not "); + if (parm->media_rotation_rate == 1) { + printf("media RPM non-rotating\n"); + } else if (parm->media_rotation_rate >= 0x0401 && + parm->media_rotation_rate <= 0xFFFE) { + printf("media RPM %d\n", + parm->media_rotation_rate); + } printf("\nFeature " "Support Enable Value Vendor\n"); - - printf("write cache %s %s\n", - parm->support.command1 & ATA_SUPPORT_WRITECACHE ? "yes" : "no", - parm->enabled.command1 & ATA_SUPPORT_WRITECACHE ? "yes" : "no"); - printf("read ahead %s %s\n", parm->support.command1 & ATA_SUPPORT_LOOKAHEAD ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_LOOKAHEAD ? "yes" : "no"); - + printf("write cache %s %s\n", + parm->support.command1 & ATA_SUPPORT_WRITECACHE ? "yes" : "no", + parm->enabled.command1 & ATA_SUPPORT_WRITECACHE ? "yes" : "no"); + printf("flush cache %s %s\n", + parm->support.command2 & ATA_SUPPORT_FLUSHCACHE ? "yes" : "no", + parm->enabled.command2 & ATA_SUPPORT_FLUSHCACHE ? "yes" : "no"); if (parm->satacapabilities && parm->satacapabilities != 0xffff) { printf("Native Command Queuing (NCQ) %s " " %d/0x%02X\n", @@ -1136,28 +1155,22 @@ atacapprint(struct ata_params *parm) parm->support.command2 & ATA_SUPPORT_QUEUED ? "yes" : "no", parm->enabled.command2 & ATA_SUPPORT_QUEUED ? "yes" : "no", ATA_QUEUE_LEN(parm->queue), ATA_QUEUE_LEN(parm->queue)); - printf("SMART %s %s\n", parm->support.command1 & ATA_SUPPORT_SMART ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_SMART ? "yes" : "no"); - printf("microcode download %s %s\n", parm->support.command2 & ATA_SUPPORT_MICROCODE ? "yes" : "no", parm->enabled.command2 & ATA_SUPPORT_MICROCODE ? "yes" : "no"); - printf("security %s %s\n", parm->support.command1 & ATA_SUPPORT_SECURITY ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_SECURITY ? "yes" : "no"); - printf("power management %s %s\n", parm->support.command1 & ATA_SUPPORT_POWERMGT ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_POWERMGT ? "yes" : "no"); - printf("advanced power management %s %s %d/0x%02X\n", parm->support.command2 & ATA_SUPPORT_APM ? "yes" : "no", parm->enabled.command2 & ATA_SUPPORT_APM ? "yes" : "no", parm->apm_value, parm->apm_value); - printf("automatic acoustic management %s %s " "%d/0x%02X %d/0x%02X\n", parm->support.command2 & ATA_SUPPORT_AUTOACOUSTIC ? "yes" :"no", @@ -1166,6 +1179,22 @@ atacapprint(struct ata_params *parm) ATA_ACOUSTIC_CURRENT(parm->acoustic), ATA_ACOUSTIC_VENDOR(parm->acoustic), ATA_ACOUSTIC_VENDOR(parm->acoustic)); + printf("media status notification %s %s\n", + parm->support.command2 & ATA_SUPPORT_NOTIFY ? "yes" : "no", + parm->enabled.command2 & ATA_SUPPORT_NOTIFY ? "yes" : "no"); + printf("power-up in Standby %s %s\n", + parm->support.command2 & ATA_SUPPORT_STANDBY ? "yes" : "no", + parm->enabled.command2 & ATA_SUPPORT_STANDBY ? "yes" : "no"); + printf("write-read-verify %s %s %d/0x%x\n", + parm->support2 & ATA_SUPPORT_WRITEREADVERIFY ? "yes" : "no", + parm->enabled2 & ATA_SUPPORT_WRITEREADVERIFY ? "yes" : "no", + parm->wrv_mode, parm->wrv_mode); + printf("unload %s %s\n", + parm->support.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no", + parm->enabled.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no"); + printf("free-fall %s %s\n", + parm->support2 & ATA_SUPPORT_FREEFALL ? "yes" : "no", + parm->enabled2 & ATA_SUPPORT_FREEFALL ? "yes" : "no"); } @@ -1261,6 +1290,7 @@ ataidentify(struct cam_device *device, i ata_bswap(ident_buf->model, sizeof(ident_buf->model)); ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); + ata_bswap(ident_buf->media_serial, sizeof(ident_buf->media_serial)); } ata_btrim(ident_buf->model, sizeof(ident_buf->model)); ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); @@ -1268,6 +1298,9 @@ ataidentify(struct cam_device *device, i ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + ata_btrim(ident_buf->media_serial, sizeof(ident_buf->media_serial)); + ata_bpack(ident_buf->media_serial, ident_buf->media_serial, + sizeof(ident_buf->media_serial)); fprintf(stdout, "%s%d: ", device->device_name, device->dev_unit_num); From owner-svn-src-all@FreeBSD.ORG Sun Sep 27 23:08:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 420581065676; Sun, 27 Sep 2009 23:08:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F0DDE8FC18; Sun, 27 Sep 2009 23:08:17 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7946846B03; Sun, 27 Sep 2009 19:08:17 -0400 (EDT) Date: Mon, 28 Sep 2009 00:08:17 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Julian Elischer In-Reply-To: <4ABFB4D1.5070505@elischer.org> Message-ID: References: <200909271449.n8REnpUX027608@svn.freebsd.org> <4ABFB4D1.5070505@elischer.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) 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, "Simon L. Nielsen" Subject: Re: svn commit: r197537 - 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: Sun, 27 Sep 2009 23:08:18 -0000 On Sun, 27 Sep 2009, Julian Elischer wrote: >> Do not allow mmap with the MAP_FIXED argument to map at address zero. >> This is done to make it harder to exploit kernel NULL pointer security >> vulnerabilities. While this of course does not fix vulnerabilities, >> it does mitigate their impact. >> Note that this may break some applications, most likely emulators or >> similar, which for one reason or another require mapping memory at >> zero. > > If you are going to take this approach then it shuel be enabled by a bit in > the inherrited process permissions, with a toll to set it, like: > > map0 {command} > where command could be something like "wine". > use setfib or nice as a template for the tool. > > this way only processes that need it are affected. I think the real question is whether or not any applications we actually care about are affected. If it turns out they are and we need to do something special, we can do that, but otherwise perhaps we can just quietly deprecate support for mapping at 0x0 and be done with it. One of my todo list items for 9.x is to implement fine-grained privileges, so a reasonable approach to making it flexible/fine-grained is simply to make mapping at 0x0 another of those privileges. Of course, that was a goal for 8.x and didn't happen, so... :-) Robert > > >> This restriction can be disabled with the security.bsd.mmap_zero >> sysctl variable. >> Discussed with: rwatson, bz >> Tested by: bz (Wine), simon (VirtualBox) >> Submitted by: jhb >> >> Modified: >> head/sys/vm/vm_mmap.c >> >> Modified: head/sys/vm/vm_mmap.c >> ============================================================================== >> --- head/sys/vm/vm_mmap.c Sun Sep 27 14:00:16 2009 (r197536) >> +++ head/sys/vm/vm_mmap.c Sun Sep 27 14:49:51 2009 (r197537) >> @@ -97,6 +97,14 @@ SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap, >> "Maximum number of memory-mapped files per process"); >> /* >> + * 'mmap_zero' determines whether or not MAP_FIXED mmap() requests for >> + * virtual address zero are permitted. >> + */ >> +static int mmap_zero; >> +SYSCTL_INT(_security_bsd, OID_AUTO, mmap_zero, CTLFLAG_RW, &mmap_zero, 0, >> + "Processes may map an object at virtual address zero"); >> + >> +/* >> * Set the maximum number of vm_map_entry structures per process. Roughly >> * speaking vm_map_entry structures are tiny, so allowing them to eat >> 1/100 >> * of our KVM malloc space still results in generous limits. We want a >> @@ -229,7 +237,8 @@ mmap(td, uap) >> pos = uap->pos; >> fp = NULL; >> - /* make sure mapping fits into numeric range etc */ >> + >> + /* Make sure mapping fits into numeric range, etc. */ >> if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && >> curproc->p_osrel >= 800104) || >> ((flags & MAP_ANON) && uap->fd != -1)) >> @@ -267,6 +276,14 @@ mmap(td, uap) >> addr -= pageoff; >> if (addr & PAGE_MASK) >> return (EINVAL); >> + >> + /* >> + * Mapping to address zero is only permitted if >> + * mmap_zero is enabled. >> + */ >> + if (addr == 0 && !mmap_zero) >> + return (EINVAL); >> + >> /* Address range must be all in user VM space. */ >> if (addr < vm_map_min(&vms->vm_map) || >> addr + size > vm_map_max(&vms->vm_map)) > > From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 03:32:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFF611065693; Mon, 28 Sep 2009 03:32:35 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEF948FC19; Mon, 28 Sep 2009 03:32:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S3WZZD042261; Mon, 28 Sep 2009 03:32:35 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S3WZAP042258; Mon, 28 Sep 2009 03:32:35 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200909280332.n8S3WZAP042258@svn.freebsd.org> From: Colin Percival Date: Mon, 28 Sep 2009 03:32: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: r197552 - in head/etc/periodic: daily security X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 03:32:35 -0000 Author: cperciva Date: Mon Sep 28 03:32:35 2009 New Revision: 197552 URL: http://svn.freebsd.org/changeset/base/197552 Log: Silence warning printed by getfsspec(3) when /etc/fstab does not exist fstab: /etc/fstab:0: No such file or directory and from dump(8) when setfsent(3) fails due to /etc/fstab not existing: DUMP: Can't open /etc/fstab for dump table information: No such... This makes daily and security periodic runs somewhat cleaner in jails which lack /etc/fstab files. MFC after: 1 month Modified: head/etc/periodic/daily/400.status-disks head/etc/periodic/security/200.chkmounts Modified: head/etc/periodic/daily/400.status-disks ============================================================================== --- head/etc/periodic/daily/400.status-disks Sun Sep 27 23:01:17 2009 (r197551) +++ head/etc/periodic/daily/400.status-disks Mon Sep 28 03:32:35 2009 (r197552) @@ -19,6 +19,9 @@ case "$daily_status_disks_enable" in df $daily_status_disks_df_flags && rc=1 || rc=3 # display which filesystems need backing up + if ! [ -f /etc/fstab ]; then + export PATH_FSTAB=/dev/null + fi echo "" dump W || rc=3;; Modified: head/etc/periodic/security/200.chkmounts ============================================================================== --- head/etc/periodic/security/200.chkmounts Sun Sep 27 23:01:17 2009 (r197551) +++ head/etc/periodic/security/200.chkmounts Mon Sep 28 03:32:35 2009 (r197552) @@ -50,6 +50,9 @@ case "$daily_status_security_chkmounts_e ignore="${ignore}|^amd:" esac [ -n "$ignore" ] && cmd="egrep -v ${ignore#|}" || cmd=cat + if ! [ -f /etc/fstab ]; then + export PATH_FSTAB=/dev/null + fi mount -p | sort | ${cmd} | check_diff mount - "${host} changes in mounted filesystems:" rc=$?;; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:01:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FA36106566B; Mon, 28 Sep 2009 07:01:54 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E4548FC0C; Mon, 28 Sep 2009 07:01:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S71siX046025; Mon, 28 Sep 2009 07:01:54 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S71sBD046019; Mon, 28 Sep 2009 07:01:54 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280701.n8S71sBD046019@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:01: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: r197553 - in head/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: Mon, 28 Sep 2009 07:01:54 -0000 Author: thompsa Date: Mon Sep 28 07:01:54 2009 New Revision: 197553 URL: http://svn.freebsd.org/changeset/base/197553 Log: MFp4 @ 168387 - clean up USB detach logic. There seems to be some problems detaching multiple USB HUBs connected in series from the root. - after this patch the rule is: 1) Always use device_detach() on the USB HUB first. 2) Never just device_delete_child() on the USB HUB, because that function will traverse to all the device leaves and free them first, and then the USB stack will free the devices twice which doesn't work very well. - make sure the did DMA delay gets set after the timeout has elapsed to make logic more clear. There is no functional difference. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Mon Sep 28 03:32:35 2009 (r197552) +++ head/sys/dev/usb/controller/usb_controller.c Mon Sep 28 07:01:54 2009 (r197553) @@ -270,11 +270,9 @@ usb_bus_detach(struct usb_proc_msg *pm) mtx_unlock(&Giant); /* - * Free USB Root device, but not any sub-devices, hence they - * are freed by the caller of this function: + * Free USB device and all subdevices, if any. */ - usb_free_device(udev, - USB_UNCFG_FLAG_FREE_EP0); + usb_free_device(udev, 0); USB_BUS_LOCK(bus); /* clear bdev variable last */ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Sep 28 03:32:35 2009 (r197552) +++ head/sys/dev/usb/usb_device.c Mon Sep 28 07:01:54 2009 (r197553) @@ -478,7 +478,7 @@ usbd_set_config_index(struct usb_device usbd_enum_lock(udev); } - usb_unconfigure(udev, USB_UNCFG_FLAG_FREE_SUBDEV); + usb_unconfigure(udev, 0); if (index == USB_UNCONFIG_INDEX) { /* @@ -582,7 +582,7 @@ usbd_set_config_index(struct usb_device done: DPRINTF("error=%s\n", usbd_errstr(err)); if (err) { - usb_unconfigure(udev, USB_UNCFG_FLAG_FREE_SUBDEV); + usb_unconfigure(udev, 0); } if (do_unlock) usbd_enum_unlock(udev); @@ -989,18 +989,13 @@ usb_detach_device_sub(struct usb_device device_t dev; int err; - if (!(flag & USB_UNCFG_FLAG_FREE_SUBDEV)) { - - *ppdev = NULL; - - } else if (*ppdev) { - + dev = *ppdev; + if (dev) { /* * NOTE: It is important to clear "*ppdev" before deleting * the child due to some device methods being called late * during the delete process ! */ - dev = *ppdev; *ppdev = NULL; device_printf(dev, "at %s, port %d, addr %d " @@ -1778,7 +1773,7 @@ repeat_set_config: } else if (usb_test_huawei_autoinst_p(udev, &uaa) == 0) { DPRINTFN(0, "Found Huawei auto-install disk!\n"); /* leave device unconfigured */ - usb_unconfigure(udev, USB_UNCFG_FLAG_FREE_SUBDEV); + usb_unconfigure(udev, 0); } } else { err = 0; /* set success */ @@ -1803,10 +1798,10 @@ repeat_set_config: #endif done: if (err) { - /* free device */ - usb_free_device(udev, - USB_UNCFG_FLAG_FREE_SUBDEV | - USB_UNCFG_FLAG_FREE_EP0); + /* + * Free USB device and all subdevices, if any. + */ + usb_free_device(udev, 0); udev = NULL; } return (udev); @@ -1926,9 +1921,10 @@ usb_cdev_cleanup(void* arg) /*------------------------------------------------------------------------* * usb_free_device * - * This function is NULL safe and will free an USB device. + * This function is NULL safe and will free an USB device and its + * children devices, if any. * - * Flag values, see "USB_UNCFG_FLAG_XXX". + * Flag values: Reserved, set to zero. *------------------------------------------------------------------------*/ void usb_free_device(struct usb_device *udev, uint8_t flag) @@ -1982,7 +1978,7 @@ usb_free_device(struct usb_device *udev, } /* the following will get the device unconfigured in software */ - usb_unconfigure(udev, flag); + usb_unconfigure(udev, USB_UNCFG_FLAG_FREE_EP0); /* unsetup any leftover default USB transfers */ usbd_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX); Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Mon Sep 28 03:32:35 2009 (r197552) +++ head/sys/dev/usb/usb_device.h Mon Sep 28 07:01:54 2009 (r197553) @@ -41,7 +41,6 @@ struct usb_device; /* linux compat */ /* "usb_unconfigure()" flags */ #define USB_UNCFG_FLAG_NONE 0x00 -#define USB_UNCFG_FLAG_FREE_SUBDEV 0x01 /* subdevices are freed */ #define USB_UNCFG_FLAG_FREE_EP0 0x02 /* endpoint zero is freed */ struct usb_clear_stall_msg { Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Mon Sep 28 03:32:35 2009 (r197552) +++ head/sys/dev/usb/usb_hub.c Mon Sep 28 07:01:54 2009 (r197553) @@ -316,12 +316,13 @@ repeat: if (err) { goto error; } - /* detach any existing devices */ + /* check if there is a child */ - if (child) { - usb_free_device(child, - USB_UNCFG_FLAG_FREE_SUBDEV | - USB_UNCFG_FLAG_FREE_EP0); + if (child != NULL) { + /* + * Free USB device and all subdevices, if any. + */ + usb_free_device(child, 0); child = NULL; } /* get fresh status */ @@ -438,10 +439,11 @@ repeat: return (0); /* success */ error: - if (child) { - usb_free_device(child, - USB_UNCFG_FLAG_FREE_SUBDEV | - USB_UNCFG_FLAG_FREE_EP0); + if (child != NULL) { + /* + * Free USB device and all subdevices, if any. + */ + usb_free_device(child, 0); child = NULL; } if (err == 0) { @@ -888,12 +890,14 @@ uhub_detach(device_t dev) struct usb_device *child; uint8_t x; - /* detach all children first */ - bus_generic_detach(dev); - if (hub == NULL) { /* must be partially working */ return (0); } + + /* Make sure interrupt transfer is gone. */ + usbd_transfer_unsetup(sc->sc_xfer, UHUB_N_TRANSFER); + + /* Detach all ports */ for (x = 0; x != hub->nports; x++) { child = usb_bus_port_get_device(sc->sc_udev->bus, hub->ports + x); @@ -901,16 +905,13 @@ uhub_detach(device_t dev) if (child == NULL) { continue; } + /* - * Subdevices are not freed, because the caller of - * uhub_detach() will do that. + * Free USB device and all subdevices, if any. */ - usb_free_device(child, - USB_UNCFG_FLAG_FREE_EP0); + usb_free_device(child, 0); } - usbd_transfer_unsetup(sc->sc_xfer, UHUB_N_TRANSFER); - free(hub, M_USBDEV); sc->sc_udev->hub = NULL; @@ -984,10 +985,19 @@ static int uhub_child_location_string(device_t parent, device_t child, char *buf, size_t buflen) { - struct uhub_softc *sc = device_get_softc(parent); - struct usb_hub *hub = sc->sc_udev->hub; + struct uhub_softc *sc; + struct usb_hub *hub; struct hub_result res; + if (!device_is_attached(parent)) { + if (buflen) + buf[0] = 0; + return (0); + } + + sc = device_get_softc(parent); + hub = sc->sc_udev->hub; + mtx_lock(&Giant); uhub_find_iface_index(hub, child, &res); if (!res.udev) { @@ -1009,11 +1019,20 @@ static int uhub_child_pnpinfo_string(device_t parent, device_t child, char *buf, size_t buflen) { - struct uhub_softc *sc = device_get_softc(parent); - struct usb_hub *hub = sc->sc_udev->hub; + struct uhub_softc *sc; + struct usb_hub *hub; struct usb_interface *iface; struct hub_result res; + if (!device_is_attached(parent)) { + if (buflen) + buf[0] = 0; + return (0); + } + + sc = device_get_softc(parent); + hub = sc->sc_udev->hub; + mtx_lock(&Giant); uhub_find_iface_index(hub, child, &res); if (!res.udev) { Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Mon Sep 28 03:32:35 2009 (r197552) +++ head/sys/dev/usb/usb_transfer.c Mon Sep 28 07:01:54 2009 (r197553) @@ -2121,6 +2121,9 @@ usb_dma_delay_done_cb(void *arg) DPRINTFN(3, "Completed %p\n", xfer); + /* only delay once */ + xfer->flags_int.did_dma_delay = 1; + /* queue callback for execution, again */ usbd_transfer_done(xfer, 0); } @@ -2488,9 +2491,6 @@ usbd_callback_wrapper_sub(struct usb_xfe usb_timeout_t temp; - /* only delay once */ - xfer->flags_int.did_dma_delay = 1; - /* we can not cancel this delay */ xfer->flags_int.can_cancel_immed = 0; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:06:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 094D4106566C; Mon, 28 Sep 2009 07:06:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D34E78FC12; Mon, 28 Sep 2009 07:06:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S76lA0046139; Mon, 28 Sep 2009 07:06:47 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S76l56046137; Mon, 28 Sep 2009 07:06:47 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280706.n8S76l56046137@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07: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: r197554 - head/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: Mon, 28 Sep 2009 07:06:48 -0000 Author: thompsa Date: Mon Sep 28 07:06:47 2009 New Revision: 197554 URL: http://svn.freebsd.org/changeset/base/197554 Log: Import two PCI quirks from Linux - Add quirk for ATI SB600 and SB700 to free SMB controller - Correct schedule sleep time to 10us on the VIA ehci controller Reported by: Dorian Bttner, Andriy Gapon Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Sep 28 07:01:54 2009 (r197553) +++ head/sys/dev/usb/controller/ehci_pci.c Mon Sep 28 07:06:47 2009 (r197554) @@ -240,6 +240,50 @@ ehci_pci_probe(device_t self) } } +static void +ehci_pci_ati_quirk(device_t self, uint8_t is_sb700) +{ + device_t smbdev; + uint32_t val; + + if (is_sb700) { + /* Lookup SMBUS PCI device */ + smbdev = pci_find_device(PCI_EHCI_VENDORID_ATI, 0x4385); + if (smbdev == NULL) + return; + val = pci_get_revid(smbdev); + if (val != 0x3a && val != 0x3b) + return; + } + + /* + * Note: this bit is described as reserved in SB700 + * Register Reference Guide. + */ + val = pci_read_config(self, 0x53, 1); + if (!(val & 0x8)) { + val |= 0x8; + pci_write_config(self, 0x53, val, 1); + device_printf(self, "AMD SB600/700 quirk applied\n"); + } +} + +static void +ehci_pci_via_quirk(device_t self) +{ + uint32_t val; + + if ((pci_get_device(self) == 0x3104) && + ((pci_get_revid(self) & 0xf0) == 0x60)) { + /* Correct schedule sleep time to 10us */ + val = pci_read_config(self, 0x4b, 1); + if (val & 0x20) + return; + pci_write_config(self, 0x4b, val, 1); + device_printf(self, "VIA-quirk applied\n"); + } +} + static int ehci_pci_attach(device_t self) { @@ -370,6 +414,32 @@ ehci_pci_attach(device_t self) goto error; } ehci_pci_takecontroller(self); + + /* Undocumented quirks taken from Linux */ + + switch (pci_get_vendor(self)) { + case PCI_EHCI_VENDORID_ATI: + /* SB600 and SB700 EHCI quirk */ + switch (pci_get_device(self)) { + case 0x4386: + ehci_pci_ati_quirk(self, 0); + break; + case 0x4396: + ehci_pci_ati_quirk(self, 1); + break; + default: + break; + } + break; + + case PCI_EHCI_VENDORID_VIA: + ehci_pci_via_quirk(self); + break; + + default: + break; + } + err = ehci_init(sc); if (!err) { err = device_probe_and_attach(sc->sc_bus.bdev); From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:09:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6492106566B; Mon, 28 Sep 2009 07:09:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA998FC13; Mon, 28 Sep 2009 07:09:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S79HRG046213; Mon, 28 Sep 2009 07:09:17 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S79HwK046211; Mon, 28 Sep 2009 07:09:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280709.n8S79HwK046211@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07: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: r197555 - head/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: Mon, 28 Sep 2009 07:09:17 -0000 Author: thompsa Date: Mon Sep 28 07:09:17 2009 New Revision: 197555 URL: http://svn.freebsd.org/changeset/base/197555 Log: Simplify logic around setting EHCI_QH_DTC and expand some htohc32(temp.sc, 0) statements to zero. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon Sep 28 07:06:47 2009 (r197554) +++ head/sys/dev/usb/controller/ehci.c Mon Sep 28 07:09:17 2009 (r197555) @@ -1918,18 +1918,15 @@ ehci_setup_standard_chain(struct usb_xfe EHCI_QH_SET_MPL(xfer->max_packet_size)); if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { - qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | - EHCI_QH_DTC); + qh_endp |= EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH); if (methods != &ehci_device_intr_methods) qh_endp |= EHCI_QH_SET_NRL(8); } else { if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) { - qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_FULL) | - EHCI_QH_DTC); + qh_endp |= EHCI_QH_SET_EPS(EHCI_QH_SPEED_FULL); } else { - qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_LOW) | - EHCI_QH_DTC); + qh_endp |= EHCI_QH_SET_EPS(EHCI_QH_SPEED_LOW); } if (methods == &ehci_device_ctrl_methods) { @@ -1941,6 +1938,11 @@ ehci_setup_standard_chain(struct usb_xfe } } + if (temp.auto_data_toggle == 0) { + /* software computes the data toggle */ + qh_endp |= EHCI_QH_DTC; + } + qh->qh_endp = htohc32(temp.sc, qh_endp); qh_endphub = @@ -1951,23 +1953,17 @@ ehci_setup_standard_chain(struct usb_xfe EHCI_QH_SET_PORT(xfer->xroot->udev->hs_port_no)); qh->qh_endphub = htohc32(temp.sc, qh_endphub); - qh->qh_curqtd = htohc32(temp.sc, 0); + qh->qh_curqtd = 0; /* fill the overlay qTD */ - qh->qh_qtd.qtd_status = htohc32(temp.sc, 0); - - if (temp.auto_data_toggle) { - - /* let the hardware compute the data toggle */ - qh->qh_endp &= htohc32(temp.sc, ~EHCI_QH_DTC); - - if (xfer->endpoint->toggle_next) { - /* DATA1 is next */ - qh->qh_qtd.qtd_status |= - htohc32(temp.sc, EHCI_QTD_SET_TOGGLE(1)); - } + if (temp.auto_data_toggle && xfer->endpoint->toggle_next) { + /* DATA1 is next */ + qh->qh_qtd.qtd_status = htohc32(temp.sc, EHCI_QTD_SET_TOGGLE(1)); + } else { + qh->qh_qtd.qtd_status = 0; } + td = xfer->td_transfer_first; qh->qh_qtd.qtd_next = td->qtd_self; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:10:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E98F31065672; Mon, 28 Sep 2009 07:10:32 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D95328FC12; Mon, 28 Sep 2009 07:10:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S7AWEX046283; Mon, 28 Sep 2009 07:10:32 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S7AW2P046281; Mon, 28 Sep 2009 07:10:32 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280710.n8S7AW2P046281@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:10: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: r197556 - head/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: Mon, 28 Sep 2009 07:10:33 -0000 Author: thompsa Date: Mon Sep 28 07:10:32 2009 New Revision: 197556 URL: http://svn.freebsd.org/changeset/base/197556 Log: Clear all interrupts rather than just SETUP packet. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/atmegadci.c Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Mon Sep 28 07:09:17 2009 (r197555) +++ head/sys/dev/usb/controller/atmegadci.c Mon Sep 28 07:10:32 2009 (r197556) @@ -301,8 +301,8 @@ atmegadci_setup_rx(struct atmegadci_td * sc->sc_dv_addr = 0xFF; } - /* clear SETUP packet interrupt */ - ATMEGA_WRITE_1(sc, ATMEGA_UEINTX, ~ATMEGA_UEINTX_RXSTPI); + /* Clear SETUP packet interrupt and all other previous interrupts */ + ATMEGA_WRITE_1(sc, ATMEGA_UEINTX, 0); return (0); /* complete */ not_complete: From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:32:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63FD2106566B; Mon, 28 Sep 2009 07:32:11 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 516EC8FC08; Mon, 28 Sep 2009 07:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S7WBBn046718; Mon, 28 Sep 2009 07:32:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S7WBYs046713; Mon, 28 Sep 2009 07:32:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280732.n8S7WBYs046713@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:32: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: r197557 - in head/sys: conf dev/usb/serial modules/usb modules/usb/uch341 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 07:32:11 -0000 Author: thompsa Date: Mon Sep 28 07:32:11 2009 New Revision: 197557 URL: http://svn.freebsd.org/changeset/base/197557 Log: Add support for ChipHead 341 serial port adapter. Submitted by: Hans Petter Selasky Added: head/sys/dev/usb/serial/uch341.c (contents, props changed) head/sys/modules/usb/uch341/ head/sys/modules/usb/uch341/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Sep 28 07:10:32 2009 (r197556) +++ head/sys/conf/files Mon Sep 28 07:32:11 2009 (r197557) @@ -1643,6 +1643,7 @@ dev/usb/serial/u3g.c optional u3g dev/usb/serial/uark.c optional uark dev/usb/serial/ubsa.c optional ubsa dev/usb/serial/ubser.c optional ubser +dev/usb/serial/uch341.c optional uch341 dev/usb/serial/uchcom.c optional uchcom dev/usb/serial/ucycom.c optional ucycom dev/usb/serial/ufoma.c optional ufoma @@ -1658,7 +1659,7 @@ dev/usb/serial/uslcom.c optional uslcom dev/usb/serial/uvisor.c optional uvisor dev/usb/serial/uvscom.c optional uvscom dev/usb/serial/usb_serial.c optional ucom | \ - (u3g | uark | ubsa | ubser | uchcom | ucycom | ufoma | uftdi | ugensa | uipaq | ulpt | umct | umodem | umoscom | uplcom | uslcom | uvisor | uvscom) + (u3g | uark | ubsa | ubser | uch341 | uchcom | ucycom | ufoma | uftdi | ugensa | uipaq | ulpt | umct | umodem | umoscom | uplcom | uslcom | uvisor | uvscom) # # USB misc drivers # Added: head/sys/dev/usb/serial/uch341.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/serial/uch341.c Mon Sep 28 07:32:11 2009 (r197557) @@ -0,0 +1,521 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2007 Frank A Kingswood. All rights reserved. + * Copyright (c) 2008 Hans Petter Selasky. 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. + */ + +/* + * The ChipHead 341 programming details were taken from the ch341.c + * driver written by Frank A Kingswood. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define USB_DEBUG_VAR uch341_debug +#include +#include + +#include + +#if USB_DEBUG +static int uch341_debug = 0; + +SYSCTL_NODE(_hw_usb, OID_AUTO, uch341, CTLFLAG_RW, 0, "USB CH341"); +SYSCTL_INT(_hw_usb_uch341, OID_AUTO, debug, CTLFLAG_RW, + &uch341_debug, 0, "Debug level"); +#endif + +#define UCH341_CONFIG_INDEX 0 +#define UCH341_IFACE_INDEX 0 +#define UCH341_BUFSIZE 1024 + +enum { + UCH341_BULK_DT_WR, + UCH341_BULK_DT_RD, + UCH341_N_TRANSFER, +}; + +struct uch341_softc { + struct ucom_super_softc sc_super_ucom; + struct ucom_softc sc_ucom; + + struct usb_device *sc_udev; + struct usb_xfer *sc_xfer[UCH341_N_TRANSFER]; + device_t sc_dev; + struct mtx sc_mtx; + + uint8_t sc_dtr; + uint8_t sc_rts; + uint8_t sc_iface_index; + uint8_t sc_hdrlen; + uint8_t sc_msr; + uint8_t sc_lsr; + + uint8_t sc_name[16]; +}; + +/* prototypes */ + +static device_probe_t uch341_probe; +static device_attach_t uch341_attach; +static device_detach_t uch341_detach; + +static usb_callback_t uch341_write_callback; +static usb_callback_t uch341_read_callback; + +static void uch341_cfg_open(struct ucom_softc *); +static void uch341_cfg_set_dtr(struct ucom_softc *, uint8_t); +static void uch341_cfg_set_rts(struct ucom_softc *, uint8_t); +static void uch341_cfg_set_break(struct ucom_softc *, uint8_t); +static int uch341_pre_param(struct ucom_softc *, struct termios *); +static void uch341_cfg_param(struct ucom_softc *, struct termios *); +static void uch341_cfg_get_status(struct ucom_softc *, uint8_t *, + uint8_t *); +static void uch341_start_read(struct ucom_softc *); +static void uch341_stop_read(struct ucom_softc *); +static void uch341_start_write(struct ucom_softc *); +static void uch341_stop_write(struct ucom_softc *); + +static const struct usb_config uch341_config[UCH341_N_TRANSFER] = { + + [UCH341_BULK_DT_WR] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = UCH341_BUFSIZE, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = &uch341_write_callback, + }, + + [UCH341_BULK_DT_RD] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = UCH341_BUFSIZE, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = &uch341_read_callback, + }, +}; + +static const struct ucom_callback uch341_callback = { + .ucom_cfg_get_status = &uch341_cfg_get_status, + .ucom_cfg_set_dtr = &uch341_cfg_set_dtr, + .ucom_cfg_set_rts = &uch341_cfg_set_rts, + .ucom_cfg_set_break = &uch341_cfg_set_break, + .ucom_cfg_param = &uch341_cfg_param, + .ucom_cfg_open = &uch341_cfg_open, + .ucom_pre_param = &uch341_pre_param, + .ucom_start_read = &uch341_start_read, + .ucom_stop_read = &uch341_stop_read, + .ucom_start_write = &uch341_start_write, + .ucom_stop_write = &uch341_stop_write, +}; + +static device_method_t uch341_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, uch341_probe), + DEVMETHOD(device_attach, uch341_attach), + DEVMETHOD(device_detach, uch341_detach), + + {0, 0} +}; + +static devclass_t uch341_devclass; + +static driver_t uch341_driver = { + .name = "uch341", + .methods = uch341_methods, + .size = sizeof(struct uch341_softc), +}; + +DRIVER_MODULE(uch341, uhub, uch341_driver, uch341_devclass, NULL, 0); +MODULE_DEPEND(uch341, ucom, 1, 1, 1); +MODULE_DEPEND(uch341, usb, 1, 1, 1); + +static struct usb_device_id uch341_devs[] = { + {USB_VPI(0x4348, 0x5523, 0)}, + {USB_VPI(0x1a86, 0x7523, 0)}, +}; + +static int +uch341_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + if (uaa->usb_mode != USB_MODE_HOST) { + return (ENXIO); + } + if (uaa->info.bConfigIndex != UCH341_CONFIG_INDEX) { + return (ENXIO); + } + /* attach to all present interfaces */ + + return (usbd_lookup_id_by_uaa(uch341_devs, sizeof(uch341_devs), uaa)); +} + +static int +uch341_attach(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + struct uch341_softc *sc = device_get_softc(dev); + int error; + + sc->sc_udev = uaa->device; + sc->sc_dev = dev; + + device_set_usb_desc(dev); + mtx_init(&sc->sc_mtx, "uch341", NULL, MTX_DEF); + + snprintf(sc->sc_name, sizeof(sc->sc_name), + "%s", device_get_nameunit(dev)); + + DPRINTF("\n"); + + sc->sc_iface_index = uaa->info.bIfaceIndex; + + error = usbd_transfer_setup(uaa->device, + &sc->sc_iface_index, sc->sc_xfer, uch341_config, + UCH341_N_TRANSFER, sc, &sc->sc_mtx); + + if (error) { + device_printf(dev, "allocating USB " + "transfers failed!\n"); + goto detach; + } + + /* clear stall at first run */ + mtx_lock(&sc->sc_mtx); + usbd_xfer_set_stall(sc->sc_xfer[UCH341_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_xfer[UCH341_BULK_DT_RD]); + mtx_unlock(&sc->sc_mtx); + + error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, + &uch341_callback, &sc->sc_mtx); + if (error) { + goto detach; + } + return (0); /* success */ + +detach: + uch341_detach(dev); + return (ENXIO); +} + +static int +uch341_detach(device_t dev) +{ + struct uch341_softc *sc = device_get_softc(dev); + + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + usbd_transfer_unsetup(sc->sc_xfer, UCH341_N_TRANSFER); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +uch341_cfg_open(struct ucom_softc *ucom) +{ +} + +static void +uch341_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uch341_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + uint32_t actlen; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_SETUP: + case USB_ST_TRANSFERRED: +tr_setup: + pc = usbd_xfer_get_frame(xfer, 0); + if (ucom_get_data(&sc->sc_ucom, pc, + 0, usbd_xfer_max_len(xfer), &actlen)) { + + usbd_xfer_set_frame_len(xfer, 0, actlen); + usbd_transfer_submit(xfer); + } + return; + + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + } +} + +static void +uch341_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uch341_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + int actlen; + + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + if (actlen > 0) { + pc = usbd_xfer_get_frame(xfer, 0); + ucom_put_data(&sc->sc_ucom, pc, 0, actlen); + } + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + return; + + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + } +} + +static void +uch341_control_out(struct uch341_softc *sc, uint8_t bRequest, + uint16_t wValue, uint16_t wIndex) +{ + struct usb_device_request req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = bRequest; + USETW(req.wValue, wValue); + USETW(req.wIndex, wIndex); + USETW(req.wLength, 0); + ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, NULL, 0, 1000); +} + +static void +uch341_control_in(struct uch341_softc *sc, uint8_t bRequest, + uint16_t wValue, uint16_t wIndex, void *buf, uint16_t wLength) +{ + struct usb_device_request req; + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = bRequest; + USETW(req.wValue, wValue); + USETW(req.wIndex, wIndex); + USETW(req.wLength, wLength); + ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, buf, USB_SHORT_XFER_OK, 1000); +} + +static void +uch341_cfg_set_rts_dtr(struct uch341_softc *sc) +{ + uch341_control_out(sc, 0xa4, ~((sc->sc_dtr ? (1<<5) : 0) | + (sc->sc_rts? (1<<6) : 0)), 0); +} + +static void +uch341_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff) +{ + struct uch341_softc *sc = ucom->sc_parent; + + sc->sc_dtr = onoff; + + uch341_cfg_set_rts_dtr(sc); +} + +static void +uch341_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff) +{ + struct uch341_softc *sc = ucom->sc_parent; + + sc->sc_rts = onoff; + + uch341_cfg_set_rts_dtr(sc); +} + +static void +uch341_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff) +{ + /* TODO */ +} + +static int +uch341_pre_param(struct ucom_softc *ucom, struct termios *t) +{ + DPRINTF("\n"); + + switch (t->c_ospeed) { + case 2400: + case 4800: + case 9600: + case 19200: + case 38400: + case 115200: + return (0); + default: + return (EINVAL); + } +} + +static void +uch341_set_baudrate(struct uch341_softc *sc, uint32_t rate) +{ + uint16_t a; + uint16_t b; + + DPRINTF("Baud = %d\n", rate); + + switch (rate) { + case 2400: + a = 0xd901; + b = 0x0038; + break; + case 4800: + a = 0x6402; + b = 0x001f; + break; + case 9600: + a = 0xb202; + b = 0x0013; + break; + case 19200: + a = 0xd902; + b = 0x000d; + break; + case 38400: + a = 0x6403; + b = 0x000a; + break; + case 115200: + a = 0xcc03; + b = 0x0008; + break; + default: + /* should not happen */ + a = 0; + b = 0; + break; + } + + uch341_control_out(sc, 0x9a, 0x1312, a); + uch341_control_out(sc, 0x9a, 0x0f2c, b); +} + +static void +uch341_get_status(struct uch341_softc *sc) +{ + uint8_t buf[8]; + uch341_control_in(sc, 0x95, 0x0706, 0, buf, sizeof(buf)); +} + +static void +uch341_cfg_param(struct ucom_softc *ucom, struct termios *t) +{ + struct uch341_softc *sc = ucom->sc_parent; + + uint8_t buf[8]; + + DPRINTF("\n"); + + uch341_control_in(sc, 0x5f, 0, 0, buf, sizeof(buf)); + uch341_control_out(sc, 0xa1, 0, 0); + uch341_set_baudrate(sc, t->c_ospeed); + uch341_control_in(sc, 0x95, 0x2518, 0, buf, sizeof(buf)); + uch341_control_out(sc, 0x9a, 0x2518, 0x0050); + uch341_get_status(sc); + uch341_control_out(sc, 0xa1, 0x501f, 0xd90a); + uch341_set_baudrate(sc, t->c_ospeed); + uch341_cfg_set_rts_dtr(sc); + uch341_get_status(sc); +} + +static void +uch341_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr) +{ + struct uch341_softc *sc = ucom->sc_parent; + + DPRINTF("msr=0x%02x lsr=0x%02x\n", + sc->sc_msr, sc->sc_lsr); + + *msr = sc->sc_msr; + *lsr = sc->sc_lsr; +} + +static void +uch341_start_read(struct ucom_softc *ucom) +{ + struct uch341_softc *sc = ucom->sc_parent; + + usbd_transfer_start(sc->sc_xfer[UCH341_BULK_DT_RD]); +} + +static void +uch341_stop_read(struct ucom_softc *ucom) +{ + struct uch341_softc *sc = ucom->sc_parent; + + usbd_transfer_stop(sc->sc_xfer[UCH341_BULK_DT_RD]); +} + +static void +uch341_start_write(struct ucom_softc *ucom) +{ + struct uch341_softc *sc = ucom->sc_parent; + + usbd_transfer_start(sc->sc_xfer[UCH341_BULK_DT_WR]); +} + +static void +uch341_stop_write(struct ucom_softc *ucom) +{ + struct uch341_softc *sc = ucom->sc_parent; + + usbd_transfer_stop(sc->sc_xfer[UCH341_BULK_DT_WR]); +} Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Sep 28 07:10:32 2009 (r197556) +++ head/sys/modules/usb/Makefile Mon Sep 28 07:32:11 2009 (r197557) @@ -29,8 +29,8 @@ SUBDIR = usb SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci} SUBDIR += rum uath upgt ural zyd ${_urtw} SUBDIR += uhid ukbd ums udbp ufm -SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ - umct umodem umoscom uplcom uslcom uvisor uvscom +SUBDIR += ucom u3g uark ubsa ubser uch341 uchcom ucycom ufoma uftdi ugensa \ + uipaq ulpt umct umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += uether aue axe cdce cue kue rue udav SUBDIR += usfs umass urio SUBDIR += quirk template Added: head/sys/modules/usb/uch341/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/uch341/Makefile Mon Sep 28 07:32:11 2009 (r197557) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2009 Hans Petter Selasky. 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/serial + +KMOD= uch341 +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + uch341.c + +.include From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:39:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B729106566B; Mon, 28 Sep 2009 07:39:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0E68FC13; Mon, 28 Sep 2009 07:39:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S7dq00046885; Mon, 28 Sep 2009 07:39:52 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S7dqww046883; Mon, 28 Sep 2009 07:39:52 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280739.n8S7dqww046883@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:39: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: r197558 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 07:39:53 -0000 Author: thompsa Date: Mon Sep 28 07:39:51 2009 New Revision: 197558 URL: http://svn.freebsd.org/changeset/base/197558 Log: Fix NULL-pointer dereference in usb_endpoint_foreach(). PR: usb/138389 Submitted by: Patroklos Argyroudis at census, inc Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Sep 28 07:32:11 2009 (r197557) +++ head/sys/dev/usb/usb_device.c Mon Sep 28 07:39:51 2009 (r197558) @@ -367,12 +367,14 @@ usb_init_endpoint(struct usb_device *ude struct usb_endpoint * usb_endpoint_foreach(struct usb_device *udev, struct usb_endpoint *ep) { - struct usb_endpoint *ep_end = udev->endpoints + udev->endpoints_max; + struct usb_endpoint *ep_end; /* be NULL safe */ if (udev == NULL) return (NULL); + ep_end = udev->endpoints + udev->endpoints_max; + /* get next endpoint */ if (ep == NULL) ep = udev->endpoints; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:41:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 165421065676; Mon, 28 Sep 2009 07:41:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05C008FC1F; Mon, 28 Sep 2009 07:41:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S7fHZl046953; Mon, 28 Sep 2009 07:41:17 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S7fHuB046950; Mon, 28 Sep 2009 07:41:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280741.n8S7fHuB046950@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:41: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: r197559 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 07:41:18 -0000 Author: thompsa Date: Mon Sep 28 07:41:17 2009 New Revision: 197559 URL: http://svn.freebsd.org/changeset/base/197559 Log: Add support for USB language selection. PR: usb/138563 Reported by: Bruce Cran Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_bus.h head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_bus.h ============================================================================== --- head/sys/dev/usb/usb_bus.h Mon Sep 28 07:39:51 2009 (r197558) +++ head/sys/dev/usb/usb_bus.h Mon Sep 28 07:41:17 2009 (r197559) @@ -98,10 +98,14 @@ struct usb_bus { uint8_t devices_max; /* maximum number of USB devices */ uint8_t do_probe; /* set if USB BUS should be re-probed */ + /* + * The scratch area can only be used inside the explore thread + * belonging to the give serial bus. + */ union { struct usb_hw_ep_scratch hw_ep_scratch[1]; struct usb_temp_setup temp_setup[1]; - uint8_t data[128]; + uint8_t data[255]; } scratch[1]; }; Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Sep 28 07:39:51 2009 (r197558) +++ head/sys/dev/usb/usb_device.c Mon Sep 28 07:41:17 2009 (r197559) @@ -105,9 +105,23 @@ static void usb_cdev_cleanup(void *); int usb_template = 0; +TUNABLE_INT("hw.usb.usb_template", &usb_template); SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW, &usb_template, 0, "Selected USB device side template"); +/* English is default language */ + +static int usb_lang_id = 0x0009; +static int usb_lang_mask = 0x00FF; + +TUNABLE_INT("hw.usb.usb_lang_id", &usb_lang_id); +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_id, CTLFLAG_RW, + &usb_lang_id, 0, "Preferred USB language ID"); + +TUNABLE_INT("hw.usb.usb_lang_mask", &usb_lang_mask); +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_mask, CTLFLAG_RW, + &usb_lang_mask, 0, "Preferred USB language mask"); + static const char* statestr[USB_STATE_MAX] = { [USB_STATE_DETACHED] = "DETACHED", [USB_STATE_ATTACHED] = "ATTACHED", @@ -1436,7 +1450,7 @@ usb_alloc_device(device_t parent_dev, st struct usb_device *adev; struct usb_device *hub; uint8_t *scratch_ptr; - uint32_t scratch_size; + size_t scratch_size; usb_error_t err; uint8_t device_index; @@ -1682,8 +1696,35 @@ usb_alloc_device(device_t parent_dev, st if (err || (scratch_ptr[0] < 4)) { udev->flags.no_strings = 1; } else { - /* pick the first language as the default */ - udev->langid = UGETW(scratch_ptr + 2); + uint16_t langid; + uint16_t pref; + uint16_t mask; + uint8_t x; + + /* load preferred value and mask */ + pref = usb_lang_id; + mask = usb_lang_mask; + + /* align length correctly */ + scratch_ptr[0] &= ~1; + + /* fix compiler warning */ + langid = 0; + + /* search for preferred language */ + for (x = 2; (x < scratch_ptr[0]); x += 2) { + langid = UGETW(scratch_ptr + x); + if ((langid & mask) == pref) + break; + } + if (x >= scratch_ptr[0]) { + /* pick the first language as the default */ + DPRINTFN(1, "Using first language\n"); + langid = UGETW(scratch_ptr + 2); + } + + DPRINTFN(1, "Language selected: 0x%04x\n", langid); + udev->langid = langid; } /* assume 100mA bus powered for now. Changed when configured. */ @@ -2149,34 +2190,35 @@ usbd_set_device_strings(struct usb_devic #ifdef USB_VERBOSE const struct usb_knowndev *kdp; #endif - char temp[64]; + uint8_t *temp_ptr; + size_t temp_size; uint16_t vendor_id; uint16_t product_id; + temp_ptr = udev->bus->scratch[0].data; + temp_size = sizeof(udev->bus->scratch[0].data); + vendor_id = UGETW(udd->idVendor); product_id = UGETW(udd->idProduct); /* get serial number string */ - bzero(temp, sizeof(temp)); - usbd_req_get_string_any(udev, NULL, temp, sizeof(temp), + usbd_req_get_string_any(udev, NULL, temp_ptr, temp_size, udev->ddesc.iSerialNumber); - udev->serial = strdup(temp, M_USB); + udev->serial = strdup(temp_ptr, M_USB); /* get manufacturer string */ - bzero(temp, sizeof(temp)); - usbd_req_get_string_any(udev, NULL, temp, sizeof(temp), + usbd_req_get_string_any(udev, NULL, temp_ptr, temp_size, udev->ddesc.iManufacturer); - usb_trim_spaces(temp); - if (temp[0] != '\0') - udev->manufacturer = strdup(temp, M_USB); + usb_trim_spaces(temp_ptr); + if (temp_ptr[0] != '\0') + udev->manufacturer = strdup(temp_ptr, M_USB); /* get product string */ - bzero(temp, sizeof(temp)); - usbd_req_get_string_any(udev, NULL, temp, sizeof(temp), + usbd_req_get_string_any(udev, NULL, temp_ptr, temp_size, udev->ddesc.iProduct); - usb_trim_spaces(temp); - if (temp[0] != '\0') - udev->product = strdup(temp, M_USB); + usb_trim_spaces(temp_ptr); + if (temp_ptr[0] != '\0') + udev->product = strdup(temp_ptr, M_USB); #ifdef USB_VERBOSE if (udev->manufacturer == NULL || udev->product == NULL) { @@ -2202,12 +2244,12 @@ usbd_set_device_strings(struct usb_devic #endif /* Provide default strings if none were found */ if (udev->manufacturer == NULL) { - snprintf(temp, sizeof(temp), "vendor 0x%04x", vendor_id); - udev->manufacturer = strdup(temp, M_USB); + snprintf(temp_ptr, temp_size, "vendor 0x%04x", vendor_id); + udev->manufacturer = strdup(temp_ptr, M_USB); } if (udev->product == NULL) { - snprintf(temp, sizeof(temp), "product 0x%04x", product_id); - udev->product = strdup(temp, M_USB); + snprintf(temp_ptr, temp_size, "product 0x%04x", product_id); + udev->product = strdup(temp_ptr, M_USB); } } From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:42:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B49D106566C; Mon, 28 Sep 2009 07:42:53 +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 11BA28FC17; Mon, 28 Sep 2009 07:42:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S7gqsH047027; Mon, 28 Sep 2009 07:42:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S7gqu4047025; Mon, 28 Sep 2009 07:42:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909280742.n8S7gqu4047025@svn.freebsd.org> From: Xin LI Date: Mon, 28 Sep 2009 07:42: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: r197560 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 07:42:53 -0000 Author: delphij Date: Mon Sep 28 07:42:52 2009 New Revision: 197560 URL: http://svn.freebsd.org/changeset/base/197560 Log: Static'ify internal methods and use prototype. Modified: head/sbin/shutdown/shutdown.c Modified: head/sbin/shutdown/shutdown.c ============================================================================== --- head/sbin/shutdown/shutdown.c Mon Sep 28 07:41:17 2009 (r197559) +++ head/sbin/shutdown/shutdown.c Mon Sep 28 07:42:52 2009 (r197560) @@ -92,15 +92,15 @@ static int dohalt, dopower, doreboot, ki static char mbuf[BUFSIZ]; static const char *nosync, *whom; -void badtime(void); -void die_you_gravy_sucking_pig_dog(void); -void finish(int); -void getoffset(char *); -void loop(void); -void nolog(void); -void timeout(int); -void timewarn(int); -void usage(const char *); +static void badtime(void); +static void die_you_gravy_sucking_pig_dog(void); +static void finish(int); +static void getoffset(char *); +static void loop(void); +static void nolog(void); +static void timeout(int); +static void timewarn(int); +static void usage(const char *); extern const char **environ; @@ -219,8 +219,8 @@ main(int argc, char **argv) return(0); } -void -loop() +static void +loop(void) { struct interval *tp; u_int sltime; @@ -268,7 +268,7 @@ static const char *restricted_environ[] NULL }; -void +static void timewarn(int timeleft) { static int first; @@ -318,13 +318,13 @@ timewarn(int timeleft) } } -void +static void timeout(int signo __unused) { longjmp(alarmbuf, 1); } -void +static void die_you_gravy_sucking_pig_dog() { char *empty_environ[] = { NULL }; @@ -385,7 +385,7 @@ die_you_gravy_sucking_pig_dog() #define ATOI2(p) (p[0] - '0') * 10 + (p[1] - '0'); p += 2; -void +static void getoffset(char *timearg) { struct tm *lt; @@ -468,8 +468,8 @@ getoffset(char *timearg) } #define NOMSG "\n\nNO LOGINS: System going down at " -void -nolog() +static void +nolog(void) { int logfd; char *ct; @@ -490,7 +490,7 @@ nolog() } } -void +static void finish(int signo __unused) { if (!killflg) @@ -498,13 +498,13 @@ finish(int signo __unused) exit(0); } -void +static void badtime() { errx(1, "bad time format"); } -void +static void usage(const char *cp) { if (cp != NULL) From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:43:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15DDE10656D8; Mon, 28 Sep 2009 07:42:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB32B8FC14; Mon, 28 Sep 2009 07:42:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S7gxWH047063; Mon, 28 Sep 2009 07:42:59 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S7gxKV047061; Mon, 28 Sep 2009 07:42:59 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280742.n8S7gxKV047061@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:42: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: r197561 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 07:43:00 -0000 Author: thompsa Date: Mon Sep 28 07:42:59 2009 New Revision: 197561 URL: http://svn.freebsd.org/changeset/base/197561 Log: Correct buffer sizes used so that they match. The old code could give the impression that a overflow situation existed but was not possible. Reported by: kib Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Sep 28 07:42:52 2009 (r197560) +++ head/sys/dev/usb/usb_device.c Mon Sep 28 07:42:59 2009 (r197561) @@ -2355,6 +2355,7 @@ usb_notify_addq(const char *type, struct { char *data = NULL; struct malloc_type *mt; + const size_t buf_size = 512; mtx_lock(&malloc_mtx); mt = malloc_desc2type("bus"); /* XXX M_BUS */ @@ -2362,12 +2363,12 @@ usb_notify_addq(const char *type, struct if (mt == NULL) return; - data = malloc(512, mt, M_NOWAIT); + data = malloc(buf_size, mt, M_NOWAIT); if (data == NULL) return; /* String it all together. */ - snprintf(data, 1024, + snprintf(data, buf_size, "%s" "%s " "vendor=0x%04x " From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:46:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BCE5106566C; Mon, 28 Sep 2009 07:46:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 219CB8FC0A; Mon, 28 Sep 2009 07:46:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S7kNM6047171; Mon, 28 Sep 2009 07:46:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S7kNm5047169; Mon, 28 Sep 2009 07:46:23 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280746.n8S7kNm5047169@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:46: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: r197562 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 07:46:23 -0000 Author: thompsa Date: Mon Sep 28 07:46:22 2009 New Revision: 197562 URL: http://svn.freebsd.org/changeset/base/197562 Log: Add extra safety locking when clobbering xfer->flags_int.started in start and stop functions, because xfer->flags_int is also updated by the USB controller, under the controller lock. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Mon Sep 28 07:42:59 2009 (r197561) +++ head/sys/dev/usb/usb_transfer.c Mon Sep 28 07:46:22 2009 (r197562) @@ -1332,7 +1332,9 @@ usbd_setup_ctrl_transfer(struct usb_xfer /* check if there is a length mismatch */ if (len > xfer->flags_int.control_rem) { - DPRINTFN(0, "Length greater than remaining length!\n"); + DPRINTFN(0, "Length (%d) greater than " + "remaining length (%d)!\n", len, + xfer->flags_int.control_rem); goto error; } /* check if we are doing a short transfer */ @@ -1620,7 +1622,10 @@ usbd_transfer_start(struct usb_xfer *xfe /* mark the USB transfer started */ if (!xfer->flags_int.started) { + /* lock the BUS lock to avoid races updating flags_int */ + USB_BUS_LOCK(xfer->xroot->bus); xfer->flags_int.started = 1; + USB_BUS_UNLOCK(xfer->xroot->bus); } /* check if the USB transfer callback is already transferring */ @@ -1655,14 +1660,21 @@ usbd_transfer_stop(struct usb_xfer *xfer /* check if the USB transfer was ever opened */ if (!xfer->flags_int.open) { - /* nothing to do except clearing the "started" flag */ - xfer->flags_int.started = 0; + if (xfer->flags_int.started) { + /* nothing to do except clearing the "started" flag */ + /* lock the BUS lock to avoid races updating flags_int */ + USB_BUS_LOCK(xfer->xroot->bus); + xfer->flags_int.started = 0; + USB_BUS_UNLOCK(xfer->xroot->bus); + } return; } /* try to stop the current USB transfer */ USB_BUS_LOCK(xfer->xroot->bus); - xfer->error = USB_ERR_CANCELLED;/* override any previous error */ + /* override any previous error */ + xfer->error = USB_ERR_CANCELLED; + /* * Clear "open" and "started" when both private and USB lock * is locked so that we don't get a race updating "flags_int" @@ -2121,9 +2133,6 @@ usb_dma_delay_done_cb(void *arg) DPRINTFN(3, "Completed %p\n", xfer); - /* only delay once */ - xfer->flags_int.did_dma_delay = 1; - /* queue callback for execution, again */ usbd_transfer_done(xfer, 0); } @@ -2193,6 +2202,8 @@ usbd_transfer_done(struct usb_xfer *xfer */ if (!xfer->flags_int.transferring) { DPRINTF("not transferring\n"); + /* end of control transfer, if any */ + xfer->flags_int.control_act = 0; return; } /* only set transfer error if not already set */ @@ -2491,6 +2502,9 @@ usbd_callback_wrapper_sub(struct usb_xfe usb_timeout_t temp; + /* only delay once */ + xfer->flags_int.did_dma_delay = 1; + /* we can not cancel this delay */ xfer->flags_int.can_cancel_immed = 0; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:53:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B583106566B; Mon, 28 Sep 2009 07:53:56 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ACAC8FC1C; Mon, 28 Sep 2009 07:53:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S7ruV7047345; Mon, 28 Sep 2009 07:53:56 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S7ruZJ047340; Mon, 28 Sep 2009 07:53:56 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280753.n8S7ruZJ047340@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:53: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: r197563 - in head/sys/dev/usb: . 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: Mon, 28 Sep 2009 07:53:56 -0000 Author: thompsa Date: Mon Sep 28 07:53:55 2009 New Revision: 197563 URL: http://svn.freebsd.org/changeset/base/197563 Log: Add basic support for USB Network Control Model (NCM) v1.0 to if_cdce.c. http://www.usb.org/developers/devclass_docs/NCM10.zip Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cdcereg.h head/sys/dev/usb/usb.h head/sys/dev/usb/usb_cdc.h Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Mon Sep 28 07:46:22 2009 (r197562) +++ head/sys/dev/usb/net/if_cdce.c Mon Sep 28 07:53:55 2009 (r197563) @@ -40,6 +40,11 @@ * http://www.usb.org/developers/devclass_docs/usbcdc11.pdf */ +/* + * USB Network Control Model (NCM) + * http://www.usb.org/developers/devclass_docs/NCM10.zip + */ + #include __FBSDID("$FreeBSD$"); @@ -89,6 +94,11 @@ static usb_callback_t cdce_bulk_read_cal static usb_callback_t cdce_intr_read_callback; static usb_callback_t cdce_intr_write_callback; +#if CDCE_HAVE_NCM +static usb_callback_t cdce_ncm_bulk_write_callback; +static usb_callback_t cdce_ncm_bulk_read_callback; +#endif + static uether_fn_t cdce_attach_post; static uether_fn_t cdce_init; static uether_fn_t cdce_stop; @@ -159,6 +169,61 @@ static const struct usb_config cdce_conf }, }; +#if CDCE_HAVE_NCM +static const struct usb_config cdce_ncm_config[CDCE_N_TRANSFER] = { + + [CDCE_BULK_RX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .if_index = 0, + .frames = CDCE_NCM_RX_FRAMES_MAX, + .bufsize = (CDCE_NCM_RX_FRAMES_MAX * CDCE_NCM_RX_MAXLEN), + .flags = {.pipe_bof = 1,.short_frames_ok = 1,.short_xfer_ok = 1,}, + .callback = cdce_ncm_bulk_read_callback, + .timeout = 0, /* no timeout */ + .usb_mode = USB_MODE_DUAL, /* both modes */ + }, + + [CDCE_BULK_TX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .if_index = 0, + .frames = CDCE_NCM_TX_FRAMES_MAX, + .bufsize = (CDCE_NCM_TX_FRAMES_MAX * CDCE_NCM_TX_MAXLEN), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = cdce_ncm_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + .usb_mode = USB_MODE_DUAL, /* both modes */ + }, + + [CDCE_INTR_RX] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .if_index = 1, + .bufsize = CDCE_IND_SIZE_MAX, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.no_pipe_ok = 1,}, + .callback = cdce_intr_read_callback, + .timeout = 0, + .usb_mode = USB_MODE_HOST, + }, + + [CDCE_INTR_TX] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .if_index = 1, + .bufsize = CDCE_IND_SIZE_MAX, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,.no_pipe_ok = 1,}, + .callback = cdce_intr_write_callback, + .timeout = 10000, /* 10 seconds */ + .usb_mode = USB_MODE_DEVICE, + }, +}; +#endif + static device_method_t cdce_methods[] = { /* USB interface */ DEVMETHOD(usb_handle_request, cdce_handle_request), @@ -213,8 +278,151 @@ static const struct usb_device_id cdce_d {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL, 0)}, {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_MOBILE_DIRECT_LINE_MODEL, 0)}, + {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_NETWORK_CONTROL_MODEL, 0)}, }; +#if CDCE_HAVE_NCM +/*------------------------------------------------------------------------* + * cdce_ncm_init + * + * Return values: + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +static uint8_t +cdce_ncm_init(struct cdce_softc *sc) +{ + struct usb_ncm_parameters temp; + struct usb_device_request req; + uDWord value; + int err; + + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = UCDC_NCM_GET_NTB_PARAMETERS; + USETW(req.wValue, 0); + req.wIndex[0] = sc->sc_ifaces_index[1]; + req.wIndex[1] = 0; + USETW(req.wLength, sizeof(temp)); + + err = usbd_do_request_flags(sc->sc_ue.ue_udev, NULL, &req, + &temp, 0, NULL, 1000 /* ms */); + if (err) + return (1); + + /* Read correct set of parameters according to device mode */ + + if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) { + sc->sc_ncm.rx_max = UGETW(temp.dwNtbInMaxSize); + sc->sc_ncm.tx_max = UGETW(temp.dwNtbOutMaxSize); + sc->sc_ncm.tx_remainder = UGETW(temp.wNdpOutPayloadRemainder); + sc->sc_ncm.tx_modulus = UGETW(temp.wNdpOutDivisor); + sc->sc_ncm.tx_struct_align = UGETW(temp.wNdpOutAlignment); + } else { + sc->sc_ncm.rx_max = UGETW(temp.dwNtbOutMaxSize); + sc->sc_ncm.tx_max = UGETW(temp.dwNtbInMaxSize); + sc->sc_ncm.tx_remainder = UGETW(temp.wNdpInPayloadRemainder); + sc->sc_ncm.tx_modulus = UGETW(temp.wNdpInDivisor); + sc->sc_ncm.tx_struct_align = UGETW(temp.wNdpInAlignment); + } + + /* Verify maximum receive length */ + + if (err || (sc->sc_ncm.rx_max < 32) || + (sc->sc_ncm.rx_max > CDCE_NCM_RX_MAXLEN)) { + DPRINTFN(1, "Using default maximum receive length\n"); + sc->sc_ncm.rx_max = CDCE_NCM_RX_MAXLEN; + } + + /* Verify maximum transmit length */ + + if (err || (sc->sc_ncm.tx_max < 32) || + (sc->sc_ncm.tx_max > CDCE_NCM_TX_MAXLEN)) { + DPRINTFN(1, "Using default maximum transmit length\n"); + sc->sc_ncm.tx_max = CDCE_NCM_TX_MAXLEN; + } + + /* + * Verify that the structure alignment is: + * - power of two + * - not greater than the maximum transmit length + * - not less than four bytes + */ + if (err || (sc->sc_ncm.tx_struct_align < 4) || + (sc->sc_ncm.tx_struct_align != + ((-sc->sc_ncm.tx_struct_align) & sc->sc_ncm.tx_struct_align)) || + (sc->sc_ncm.tx_struct_align >= sc->sc_ncm.tx_max)) { + DPRINTFN(1, "Using default other alignment: 4 bytes\n"); + sc->sc_ncm.tx_struct_align = 4; + } + + /* + * Verify that the payload alignment is: + * - power of two + * - not greater than the maximum transmit length + * - not less than four bytes + */ + if (err || (sc->sc_ncm.tx_modulus < 4) || + (sc->sc_ncm.tx_modulus != + ((-sc->sc_ncm.tx_modulus) & sc->sc_ncm.tx_modulus)) || + (sc->sc_ncm.tx_modulus >= sc->sc_ncm.tx_max)) { + DPRINTFN(1, "Using default transmit modulus: 4 bytes\n"); + sc->sc_ncm.tx_modulus = 4; + } + + /* Verify that the payload remainder */ + + if (err || (sc->sc_ncm.tx_remainder >= sc->sc_ncm.tx_modulus)) { + DPRINTFN(1, "Using default transmit remainder: 0 bytes\n"); + sc->sc_ncm.tx_remainder = 0; + } + + /* Additional configuration, will fail in device side mode, which is OK. */ + + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UCDC_NCM_SET_NTB_INPUT_SIZE; + USETW(req.wValue, 0); + req.wIndex[0] = sc->sc_ifaces_index[1]; + req.wIndex[1] = 0; + USETW(req.wLength, 4); + USETDW(value, sc->sc_ncm.rx_max); + + err = usbd_do_request_flags(sc->sc_ue.ue_udev, NULL, &req, + &value, 0, NULL, 1000 /* ms */); + if (err) { + DPRINTFN(1, "Setting input size " + "to %u failed.\n", sc->sc_ncm.rx_max); + } + + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UCDC_NCM_SET_CRC_MODE; + USETW(req.wValue, 0); /* no CRC */ + req.wIndex[0] = sc->sc_ifaces_index[1]; + req.wIndex[1] = 0; + USETW(req.wLength, 0); + + err = usbd_do_request_flags(sc->sc_ue.ue_udev, NULL, &req, + NULL, 0, NULL, 1000 /* ms */); + if (err) { + DPRINTFN(1, "Setting CRC mode to off failed.\n"); + } + + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UCDC_NCM_SET_NTB_FORMAT; + USETW(req.wValue, 0); /* NTB-16 */ + req.wIndex[0] = sc->sc_ifaces_index[1]; + req.wIndex[1] = 0; + USETW(req.wLength, 0); + + err = usbd_do_request_flags(sc->sc_ue.ue_udev, NULL, &req, + NULL, 0, NULL, 1000 /* ms */); + if (err) { + DPRINTFN(1, "Setting NTB format to 16-bit failed.\n"); + } + + return (0); /* success */ +} +#endif + static int cdce_probe(device_t dev) { @@ -240,31 +448,31 @@ cdce_attach(device_t dev) const struct usb_cdc_union_descriptor *ud; const struct usb_interface_descriptor *id; const struct usb_cdc_ethernet_descriptor *ued; + const struct usb_config *pcfg; int error; uint8_t i; + uint8_t data_iface_no; char eaddr_str[5 * ETHER_ADDR_LEN]; /* approx */ sc->sc_flags = USB_GET_DRIVER_INFO(uaa); + sc->sc_ue.ue_udev = uaa->device; device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); - if (sc->sc_flags & CDCE_FLAG_NO_UNION) { - sc->sc_ifaces_index[0] = uaa->info.bIfaceIndex; - sc->sc_ifaces_index[1] = uaa->info.bIfaceIndex; - sc->sc_data_iface_no = 0; /* not used */ - goto alloc_transfers; - } ud = usbd_find_descriptor (uaa->device, NULL, uaa->info.bIfaceIndex, UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); - if ((ud == NULL) || (ud->bLength < sizeof(*ud))) { - device_printf(dev, "no union descriptor!\n"); - goto detach; + if ((ud == NULL) || (ud->bLength < sizeof(*ud)) || + (sc->sc_flags & CDCE_FLAG_NO_UNION)) { + DPRINTFN(1, "No union descriptor!\n"); + sc->sc_ifaces_index[0] = uaa->info.bIfaceIndex; + sc->sc_ifaces_index[1] = uaa->info.bIfaceIndex; + goto alloc_transfers; } - sc->sc_data_iface_no = ud->bSlaveInterface[0]; + data_iface_no = ud->bSlaveInterface[0]; for (i = 0;; i++) { @@ -274,8 +482,7 @@ cdce_attach(device_t dev) id = usbd_get_interface_descriptor(iface); - if (id && (id->bInterfaceNumber == - sc->sc_data_iface_no)) { + if (id && (id->bInterfaceNumber == data_iface_no)) { sc->sc_ifaces_index[0] = i; sc->sc_ifaces_index[1] = uaa->info.bIfaceIndex; usbd_set_parent_iface(uaa->device, i, uaa->info.bIfaceIndex); @@ -312,24 +519,30 @@ cdce_attach(device_t dev) alloc_transfers: - for (i = 0; i != 32; i++) { + pcfg = cdce_config; /* Default Configuration */ - error = usbd_set_alt_interface_index - (uaa->device, sc->sc_ifaces_index[0], i); + for (i = 0; i != 32; i++) { - if (error) { - device_printf(dev, "no valid alternate " - "setting found!\n"); - goto detach; - } - error = usbd_transfer_setup - (uaa->device, sc->sc_ifaces_index, - sc->sc_xfer, cdce_config, CDCE_N_TRANSFER, - sc, &sc->sc_mtx); + error = usbd_set_alt_interface_index(uaa->device, + sc->sc_ifaces_index[0], i); + if (error) + break; +#if CDCE_HAVE_NCM + if ((i == 0) && (cdce_ncm_init(sc) == 0)) + pcfg = cdce_ncm_config; +#endif + error = usbd_transfer_setup(uaa->device, + sc->sc_ifaces_index, sc->sc_xfer, + pcfg, CDCE_N_TRANSFER, sc, &sc->sc_mtx); - if (error == 0) { + if (error == 0) break; - } + } + + if (error || (i == 32)) { + device_printf(dev, "No valid alternate " + "setting found!\n"); + goto detach; } ued = usbd_find_descriptor @@ -768,3 +981,328 @@ cdce_handle_request(device_t dev, { return (ENXIO); /* use builtin handler */ } + +#if CDCE_HAVE_NCM +static uint8_t +cdce_ncm_fill_tx_frames(struct usb_xfer *xfer, uint8_t index) +{ + struct cdce_softc *sc = usbd_xfer_softc(xfer); + struct ifnet *ifp = uether_getifp(&sc->sc_ue); + struct usb_page_cache *pc = usbd_xfer_get_frame(xfer, index); + struct mbuf *m; + uint32_t rem; + uint32_t offset; + uint32_t last_offset; + uint32_t n; + + usbd_xfer_set_frame_offset(xfer, index * CDCE_NCM_TX_MAXLEN, index); + + offset = sizeof(sc->sc_ncm.hdr) + + sizeof(sc->sc_ncm.dpt) + sizeof(sc->sc_ncm.dp); + + /* Store last valid offset before alignment */ + last_offset = offset; + + /* Align offset correctly */ + offset = sc->sc_ncm.tx_remainder - + ((0UL - offset) & (0UL - sc->sc_ncm.tx_modulus)); + + for (n = 0; n != CDCE_NCM_SUBFRAMES_MAX; n++) { + + /* check if end of transmit buffer is reached */ + + if (offset >= sc->sc_ncm.tx_max) + break; + + /* compute maximum buffer size */ + + rem = sc->sc_ncm.tx_max - offset; + + IFQ_DRV_DEQUEUE(&(ifp->if_snd), m); + + if (m == NULL) + break; + + if (m->m_pkthdr.len > rem) { + if (n == 0) { + /* The frame won't fit in our buffer */ + DPRINTFN(1, "Frame too big to be transmitted!\n"); + m_freem(m); + ifp->if_oerrors++; + n--; + continue; + } + /* Wait till next buffer becomes ready */ + IFQ_DRV_PREPEND(&(ifp->if_snd), m); + break; + } + usbd_m_copy_in(pc, offset, m, 0, m->m_pkthdr.len); + + USETW(sc->sc_ncm.dp[n].wFrameLength, m->m_pkthdr.len); + USETW(sc->sc_ncm.dp[n].wFrameIndex, offset); + + /* Update offset */ + offset += m->m_pkthdr.len; + + /* Store last valid offset before alignment */ + last_offset = offset; + + /* Align offset correctly */ + offset = sc->sc_ncm.tx_remainder - + ((0UL - offset) & (0UL - sc->sc_ncm.tx_modulus)); + + /* + * If there's a BPF listener, bounce a copy + * of this frame to him: + */ + BPF_MTAP(ifp, m); + + /* Free mbuf */ + + m_freem(m); + + /* Pre-increment interface counter */ + + ifp->if_opackets++; + } + + if (n == 0) + return (1); + + rem = (sizeof(sc->sc_ncm.dpt) + (4 * n) + 4); + + USETW(sc->sc_ncm.dpt.wLength, rem); + + /* zero the rest of the data pointer entries */ + for (; n != CDCE_NCM_SUBFRAMES_MAX; n++) { + USETW(sc->sc_ncm.dp[n].wFrameLength, 0); + USETW(sc->sc_ncm.dp[n].wFrameIndex, 0); + } + + /* set frame length */ + usbd_xfer_set_frame_len(xfer, index, last_offset); + + /* Fill out 16-bit header */ + sc->sc_ncm.hdr.dwSignature[0] = 'N'; + sc->sc_ncm.hdr.dwSignature[1] = 'C'; + sc->sc_ncm.hdr.dwSignature[2] = 'M'; + sc->sc_ncm.hdr.dwSignature[3] = 'H'; + USETW(sc->sc_ncm.hdr.wHeaderLength, sizeof(sc->sc_ncm.hdr)); + USETW(sc->sc_ncm.hdr.wBlockLength, offset); + USETW(sc->sc_ncm.hdr.wSequence, sc->sc_ncm.tx_seq); + USETW(sc->sc_ncm.hdr.wDptIndex, sizeof(sc->sc_ncm.hdr)); + + sc->sc_ncm.tx_seq++; + + /* Fill out 16-bit frame table header */ + sc->sc_ncm.dpt.dwSignature[0] = 'N'; + sc->sc_ncm.dpt.dwSignature[1] = 'C'; + sc->sc_ncm.dpt.dwSignature[2] = 'M'; + sc->sc_ncm.dpt.dwSignature[3] = 'x'; + USETW(sc->sc_ncm.dpt.wNextNdpIndex, 0); /* reserved */ + + usbd_copy_in(pc, 0, &(sc->sc_ncm.hdr), sizeof(sc->sc_ncm.hdr)); + usbd_copy_in(pc, sizeof(sc->sc_ncm.hdr), &(sc->sc_ncm.dpt), + sizeof(sc->sc_ncm.dpt)); + usbd_copy_in(pc, sizeof(sc->sc_ncm.hdr) + sizeof(sc->sc_ncm.dpt), + &(sc->sc_ncm.dp), sizeof(sc->sc_ncm.dp)); + return (0); +} + +static void +cdce_ncm_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct cdce_softc *sc = usbd_xfer_softc(xfer); + struct ifnet *ifp = uether_getifp(&sc->sc_ue); + uint16_t x; + int actlen; + int aframes; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTFN(10, "transfer complete: " + "%u bytes in %u frames\n", actlen, aframes); + + case USB_ST_SETUP: + for (x = 0; x != CDCE_NCM_TX_FRAMES_MAX; x++) { + if (cdce_ncm_fill_tx_frames(xfer, x)) + break; + } + + if (x != 0) { + usbd_xfer_set_frames(xfer, x); + usbd_transfer_submit(xfer); + } + break; + + default: /* Error */ + DPRINTFN(10, "Transfer error: %s\n", + usbd_errstr(error)); + + /* update error counter */ + ifp->if_oerrors += 1; + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + usbd_xfer_set_frames(xfer, 0); + usbd_transfer_submit(xfer); + } + break; + } +} + +static void +cdce_ncm_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct cdce_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc = usbd_xfer_get_frame(xfer, 0); + struct ifnet *ifp = uether_getifp(&sc->sc_ue); + struct mbuf *m; + int sumdata; + int sumlen; + int actlen; + int aframes; + int temp; + int nframes; + int x; + int offset; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + usbd_xfer_status(xfer, &actlen, &sumlen, &aframes, NULL); + + DPRINTFN(1, "received %u bytes in %u frames\n", + actlen, aframes); + + if (actlen < (sizeof(sc->sc_ncm.hdr) + + sizeof(sc->sc_ncm.dpt))) { + DPRINTFN(1, "frame too short\n"); + goto tr_stall; + } + usbd_copy_out(pc, 0, &(sc->sc_ncm.hdr), + sizeof(sc->sc_ncm.hdr)); + + if ((sc->sc_ncm.hdr.dwSignature[0] != 'N') || + (sc->sc_ncm.hdr.dwSignature[1] != 'C') || + (sc->sc_ncm.hdr.dwSignature[2] != 'M') || + (sc->sc_ncm.hdr.dwSignature[3] != 'H')) { + DPRINTFN(1, "invalid HDR signature\n"); + goto tr_stall; + } + temp = UGETW(sc->sc_ncm.hdr.wBlockLength); + if (temp > sumlen) { + DPRINTFN(1, "unsupported block length %u/%u\n", + temp, sumlen); + goto tr_stall; + } + temp = UGETW(sc->sc_ncm.hdr.wDptIndex); + if ((temp + sizeof(sc->sc_ncm.dpt)) > actlen) { + DPRINTFN(1, "invalid DPT index\n"); + goto tr_stall; + } + usbd_copy_out(pc, temp, &(sc->sc_ncm.dpt), + sizeof(sc->sc_ncm.dpt)); + + if ((sc->sc_ncm.dpt.dwSignature[0] != 'N') || + (sc->sc_ncm.dpt.dwSignature[1] != 'C') || + (sc->sc_ncm.dpt.dwSignature[2] != 'M') || + (sc->sc_ncm.dpt.dwSignature[3] != 'x')) { + DPRINTFN(1, "invalid DPT signature\n"); + goto tr_stall; + } + nframes = UGETW(sc->sc_ncm.dpt.wLength) / 4; + + /* Subtract size of header and last zero padded entry */ + if (nframes >= (2 + 1)) + nframes -= (2 + 1); + else + nframes = 0; + + DPRINTFN(1, "nframes = %u\n", nframes); + + temp += sizeof(sc->sc_ncm.dpt); + + if ((temp + (4 * nframes)) > actlen) + goto tr_stall; + + if (nframes > CDCE_NCM_SUBFRAMES_MAX) { + DPRINTFN(1, "Truncating number of frames from %u to %u\n", + nframes, CDCE_NCM_SUBFRAMES_MAX); + nframes = CDCE_NCM_SUBFRAMES_MAX; + } + usbd_copy_out(pc, temp, &(sc->sc_ncm.dp), (4 * nframes)); + + sumdata = 0; + + for (x = 0; x != nframes; x++) { + + offset = UGETW(sc->sc_ncm.dp[x].wFrameIndex); + temp = UGETW(sc->sc_ncm.dp[x].wFrameLength); + if ((offset + temp) > actlen) { + DPRINTFN(1, "invalid frame detected (ignored)\n"); + m = NULL; + + } else if (temp >= sizeof(struct ether_header)) { + /* + * allocate a suitable memory buffer, if + * possible + */ + if (temp > (MCLBYTES - ETHER_ALIGN)) { + m = NULL; + continue; + } if (temp > (MHLEN - ETHER_ALIGN)) { + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + } else { + m = m_gethdr(M_DONTWAIT, MT_DATA); + } + } else { + m = NULL; /* dump it */ + } + + DPRINTFN(16, "frame %u, offset = %u, length = %u \n", + x, offset, temp); + + /* check if we have a buffer */ + if (m) { + m_adj(m, ETHER_ALIGN); + + usbd_copy_out(pc, offset, m->m_data, temp); + + /* enqueue */ + uether_rxmbuf(&sc->sc_ue, m, temp); + + sumdata += temp; + } else { + ifp->if_ierrors++; + } + } + + DPRINTFN(1, "Efficiency: %u/%u bytes\n", sumdata, actlen); + + case USB_ST_SETUP: + usbd_xfer_set_frame_len(xfer, 0, sc->sc_ncm.rx_max); + usbd_xfer_set_frames(xfer, 1); + usbd_transfer_submit(xfer); + uether_rxflush(&sc->sc_ue); /* must be last */ + break; + + default: /* Error */ + DPRINTFN(1, "error = %s\n", + usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { +tr_stall: + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + usbd_xfer_set_frames(xfer, 0); + usbd_transfer_submit(xfer); + } + break; + } +} +#endif Modified: head/sys/dev/usb/net/if_cdcereg.h ============================================================================== --- head/sys/dev/usb/net/if_cdcereg.h Mon Sep 28 07:46:22 2009 (r197562) +++ head/sys/dev/usb/net/if_cdcereg.h Mon Sep 28 07:53:55 2009 (r197563) @@ -38,6 +38,18 @@ #define CDCE_FRAMES_MAX 8 /* units */ #define CDCE_IND_SIZE_MAX 32 /* bytes */ +#define CDCE_NCM_TX_MAXLEN 2048UL /* bytes */ +#define CDCE_NCM_TX_FRAMES_MAX 8 /* units */ + +#define CDCE_NCM_RX_MAXLEN (1UL << 14) /* bytes */ +#define CDCE_NCM_RX_FRAMES_MAX 1 /* units */ + +#define CDCE_NCM_SUBFRAMES_MAX 32 /* units */ + +#ifndef CDCE_HAVE_NCM +#define CDCE_HAVE_NCM 1 +#endif + enum { CDCE_BULK_RX, CDCE_BULK_TX, @@ -46,9 +58,24 @@ enum { CDCE_N_TRANSFER, }; +struct cdce_ncm { + struct usb_ncm16_hdr hdr; + struct usb_ncm16_dpt dpt; + struct usb_ncm16_dp dp[CDCE_NCM_SUBFRAMES_MAX]; + uint32_t rx_max; + uint32_t tx_max; + uint16_t tx_remainder; + uint16_t tx_modulus; + uint16_t tx_struct_align; + uint16_t tx_seq; +}; + struct cdce_softc { struct usb_ether sc_ue; struct mtx sc_mtx; +#if CDCE_HAVE_NCM + struct cdce_ncm sc_ncm; +#endif struct usb_xfer *sc_xfer[CDCE_N_TRANSFER]; struct mbuf *sc_rx_buf[CDCE_FRAMES_MAX]; struct mbuf *sc_tx_buf[CDCE_FRAMES_MAX]; @@ -59,7 +86,6 @@ struct cdce_softc { #define CDCE_FLAG_RX_DATA 0x0010 uint8_t sc_eaddr_str_index; - uint8_t sc_data_iface_no; uint8_t sc_ifaces_index[2]; }; Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Mon Sep 28 07:46:22 2009 (r197562) +++ head/sys/dev/usb/usb.h Mon Sep 28 07:53:55 2009 (r197563) @@ -424,9 +424,9 @@ typedef struct usb_interface_assoc_descr #define UISUBCLASS_MOBILE_DIRECT_LINE_MODEL 10 #define UISUBCLASS_OBEX 11 #define UISUBCLASS_ETHERNET_EMULATION_MODEL 12 +#define UISUBCLASS_NETWORK_CONTROL_MODEL 13 #define UIPROTO_CDC_AT 1 -#define UIPROTO_CDC_ETH_512X4 0x76 /* FreeBSD specific */ #define UICLASS_HID 0x03 #define UISUBCLASS_BOOT 1 @@ -461,7 +461,7 @@ typedef struct usb_interface_assoc_descr #define UIPROTO_HSHUBMTT 1 #define UICLASS_CDC_DATA 0x0a -#define UISUBCLASS_DATA 0 +#define UISUBCLASS_DATA 0x00 #define UIPROTO_DATA_ISDNBRI 0x30 /* Physical iface */ #define UIPROTO_DATA_HDLC 0x31 /* HDLC */ #define UIPROTO_DATA_TRANSPARENT 0x32 /* Transparent */ @@ -475,6 +475,7 @@ typedef struct usb_interface_assoc_descr #define UIPROTO_DATA_HOST_BASED 0xfd /* Host based driver */ #define UIPROTO_DATA_PUF 0xfe /* see Prot. Unit Func. Desc. */ #define UIPROTO_DATA_VENDOR 0xff /* Vendor specific */ +#define UIPROTO_DATA_NCM 0x01 /* Network Control Model */ #define UICLASS_SMARTCARD 0x0b #define UICLASS_FIRM_UPD 0x0c Modified: head/sys/dev/usb/usb_cdc.h ============================================================================== --- head/sys/dev/usb/usb_cdc.h Mon Sep 28 07:46:22 2009 (r197562) +++ head/sys/dev/usb/usb_cdc.h Mon Sep 28 07:53:55 2009 (r197563) @@ -188,4 +188,107 @@ struct usb_cdc_notification { #define UCDC_MDM_PARITY_ERR 0x20 #define UCDC_MDM_OVERRUN_ERR 0x40 +/* + * Network Control Model, NCM16 + NCM32, protocol definitions + */ +struct usb_ncm16_hdr { + uDWord dwSignature; + uWord wHeaderLength; + uWord wSequence; + uWord wBlockLength; + uWord wDptIndex; +} __packed; + +struct usb_ncm16_dp { + uWord wFrameIndex; + uWord wFrameLength; +} __packed; + +struct usb_ncm16_dpt { + uDWord dwSignature; + uWord wLength; + uWord wNextNdpIndex; + struct usb_ncm16_dp dp[0]; +} __packed; + +struct usb_ncm32_hdr { + uDWord dwSignature; + uWord wHeaderLength; + uWord wSequence; + uDWord dwBlockLength; + uDWord dwDptIndex; +} __packed; + +struct usb_ncm32_dp { + uDWord dwFrameIndex; + uDWord dwFrameLength; +} __packed; + +struct usb_ncm32_dpt { + uDWord dwSignature; + uWord wLength; + uWord wReserved6; + uDWord dwNextNdpIndex; + uDWord dwReserved12; + struct usb_ncm32_dp dp[0]; +} __packed; + +/* Communications interface class specific descriptors */ + +#define UCDC_NCM_FUNC_DESC_SUBTYPE 0x1A + +struct usb_ncm_func_descriptor { + uByte bLength; + uByte bDescriptorType; + uByte bDescriptorSubtype; + uByte bcdNcmVersion[2]; + uByte bmNetworkCapabilities; +#define UCDC_NCM_CAP_FILTER 0x01 +#define UCDC_NCM_CAP_MAC_ADDR 0x02 +#define UCDC_NCM_CAP_ENCAP 0x04 +#define UCDC_NCM_CAP_MAX_DATA 0x08 +#define UCDC_NCM_CAP_CRCMODE 0x10 +} __packed; + +/* Communications interface specific class request codes */ + +#define UCDC_NCM_SET_ETHERNET_MULTICAST_FILTERS 0x40 +#define UCDC_NCM_SET_ETHERNET_POWER_MGMT_PATTERN_FILTER 0x41 +#define UCDC_NCM_GET_ETHERNET_POWER_MGMT_PATTERN_FILTER 0x42 +#define UCDC_NCM_SET_ETHERNET_PACKET_FILTER 0x43 +#define UCDC_NCM_GET_ETHERNET_STATISTIC 0x44 +#define UCDC_NCM_GET_NTB_PARAMETERS 0x80 +#define UCDC_NCM_GET_NET_ADDRESS 0x81 +#define UCDC_NCM_SET_NET_ADDRESS 0x82 +#define UCDC_NCM_GET_NTB_FORMAT 0x83 +#define UCDC_NCM_SET_NTB_FORMAT 0x84 +#define UCDC_NCM_GET_NTB_INPUT_SIZE 0x85 +#define UCDC_NCM_SET_NTB_INPUT_SIZE 0x86 +#define UCDC_NCM_GET_MAX_DATAGRAM_SIZE 0x87 +#define UCDC_NCM_SET_MAX_DATAGRAM_SIZE 0x88 +#define UCDC_NCM_GET_CRC_MODE 0x89 +#define UCDC_NCM_SET_CRC_MODE 0x8A + +struct usb_ncm_parameters { + uWord wLength; + uWord bmNtbFormatsSupported; +#define UCDC_NCM_FORMAT_NTB16 0x0001 +#define UCDC_NCM_FORMAT_NTB32 0x0002 + uDWord dwNtbInMaxSize; + uWord wNdpInDivisor; + uWord wNdpInPayloadRemainder; + uWord wNdpInAlignment; + uWord wReserved14; + uDWord dwNtbOutMaxSize; + uWord wNdpOutDivisor; + uWord wNdpOutPayloadRemainder; + uWord wNdpOutAlignment; + uWord wReserved26; +} __packed; + +/* Communications interface specific class notification codes */ +#define UCDC_NCM_NOTIF_NETWORK_CONNECTION 0x00 +#define UCDC_NCM_NOTIF_RESPONSE_AVAILABLE 0x01 +#define UCDC_NCM_NOTIF_CONNECTION_SPEED_CHANGE 0x2A + #endif /* _USB_CDC_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 07:57:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0D4D106566B; Mon, 28 Sep 2009 07:57:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C72D18FC0C; Mon, 28 Sep 2009 07:57:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S7vNeI047458; Mon, 28 Sep 2009 07:57:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S7vNwI047456; Mon, 28 Sep 2009 07:57:23 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280757.n8S7vNwI047456@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 07:57: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: r197564 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 07:57:24 -0000 Author: thompsa Date: Mon Sep 28 07:57:23 2009 New Revision: 197564 URL: http://svn.freebsd.org/changeset/base/197564 Log: MFp4 Add new usbdev entries for Marvell, FTDI, Option and Western. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Sep 28 07:53:55 2009 (r197563) +++ head/sys/dev/usb/usbdevs Mon Sep 28 07:57:23 2009 (r197564) @@ -659,6 +659,7 @@ vendor 3COM2 0x6891 3Com vendor INTEL 0x8086 Intel vendor SITECOM2 0x9016 Sitecom vendor MOSCHIP 0x9710 MosChip Semiconductor +vendor MARVELL 0x9e88 Marvell Technology Group Ltd. vendor 3COM3 0xa727 3Com vendor HP2 0xf003 Hewlett Packard vendor USRP 0xfffe GNU Radio USRP @@ -1336,6 +1337,9 @@ product FTDI CFA_633 0xfc0b Crystalfont product FTDI CFA_631 0xfc0c Crystalfontz CFA-631 USB LCD product FTDI CFA_635 0xfc0d Crystalfontz CFA-635 USB LCD product FTDI SEMC_DSS20 0xfc82 SEMC DSS-20 SyncStation +/* Commerzielle und Technische Informationssysteme GmbH products */ +product FTDI CTI_USB_NANO_485 0xf60b CTI USB-Nano 485 +product FTDI CTI_USB_MINI_485 0xf608 CTI USB-Mini 485 /* Fuji photo products */ product FUJIPHOTO MASS0100 0x0100 Mass Storage @@ -1691,6 +1695,9 @@ product LUWEN EASYDISK 0x0005 EasyDisc /* Macally products */ product MACALLY MOUSE1 0x0101 mouse +/* Marvell Technology Group, Ltd. products */ +product MARVELL SHEEVAPLUG 0x9e8f SheevaPlug serial interface + /* MCT Corp. */ product MCT HUB0100 0x0100 Hub product MCT DU_H3SP_USB232 0x0200 D-Link DU-H3SP USB BAY Hub @@ -1940,6 +1947,8 @@ product OPTION GTICON322 0xd033 GlobeTro product OPTION GTMAX36 0x6701 GlobeTrotter Max 3.6 Modem product OPTION GTHSDPA 0x6971 GlobeTrotter HSDPA product OPTION GTMAXHSUPA 0x7001 GlobeTrotter HSUPA +product OPTION GTMAXHSUPAE 0x6901 GlobeTrotter HSUPA PCIe +product OPTION GTMAX380HSUPAE 0x7211 GlobeTrotter 380HSUPA PCIe /* OQO */ product OQO WIFI01 0x0002 model 01 WiFi interface @@ -2504,6 +2513,7 @@ product WESTERN COMBO 0x0200 Firewire U product WESTERN EXTHDD 0x0400 External HDD product WESTERN HUB 0x0500 USB HUB product WESTERN MYBOOK 0x0901 MyBook External HDD +product WESTERN MYPASSWORD 0x0704 MyPassword External HDD /* Windbond Electronics */ product WINBOND UH104 0x5518 4-port USB Hub From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 08:00:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B28106568B; Mon, 28 Sep 2009 08:00:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 636A38FC12; Mon, 28 Sep 2009 08:00:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S80HUr047575; Mon, 28 Sep 2009 08:00:17 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S80Hi8047573; Mon, 28 Sep 2009 08:00:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280800.n8S80Hi8047573@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 08:00: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: r197565 - head/sys/dev/usb/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 08:00:17 -0000 Author: thompsa Date: Mon Sep 28 08:00:17 2009 New Revision: 197565 URL: http://svn.freebsd.org/changeset/base/197565 Log: - Remove SAMSUNG_YP_U2 now that it is in the cam layer - Add quirk from Tobias Grosser for Western Mypassword Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Mon Sep 28 07:57:23 2009 (r197564) +++ head/sys/dev/usb/storage/umass.c Mon Sep 28 08:00:17 2009 (r197565) @@ -750,10 +750,6 @@ static const struct umass_devdescr umass UMASS_PROTO_SCSI | UMASS_PROTO_BBB, IGNORE_RESIDUE | NO_START_STOP }, - {USB_VENDOR_SAMSUNG, USB_PRODUCT_SAMSUNG_YP_U2, RID_WILDCARD, - UMASS_PROTO_SCSI | UMASS_PROTO_BBB, - SHUTTLE_INIT | NO_GETMAXLUN - }, {USB_VENDOR_SAMSUNG_TECHWIN, USB_PRODUCT_SAMSUNG_TECHWIN_DIGIMAX_410, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_INQUIRY @@ -950,6 +946,10 @@ static const struct umass_devdescr umass UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_INQUIRY_EVPD }, + {USB_VENDOR_WESTERN, USB_PRODUCT_WESTERN_MYPASSWORD, RID_WILDCARD, + UMASS_PROTO_DEFAULT, + FORCE_SHORT_INQUIRY + }, {USB_VENDOR_WINMAXGROUP, USB_PRODUCT_WINMAXGROUP_FLASH64MC, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_INQUIRY From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 08:03:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC2481065672; Mon, 28 Sep 2009 08:03:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A08AD8FC0A; Mon, 28 Sep 2009 08:03:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S83q1O047677; Mon, 28 Sep 2009 08:03:52 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S83qbr047675; Mon, 28 Sep 2009 08:03:52 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280803.n8S83qbr047675@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 08:03: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: r197566 - head/sys/dev/usb/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: Mon, 28 Sep 2009 08:03:52 -0000 Author: thompsa Date: Mon Sep 28 08:03:52 2009 New Revision: 197566 URL: http://svn.freebsd.org/changeset/base/197566 Log: Increase the rx buffer size to 16384 bytes, this increases RX performance from 50Mbps to 220Mbps on PLANEX GU-1000T. Submitted by: yongari Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Mon Sep 28 08:00:17 2009 (r197565) +++ head/sys/dev/usb/net/if_axe.c Mon Sep 28 08:03:52 2009 (r197566) @@ -205,10 +205,7 @@ static const struct usb_config axe_confi .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, -#if (MCLBYTES < 2048) -#error "(MCLBYTES < 2048)" -#endif - .bufsize = MCLBYTES, + .bufsize = 16384, /* bytes */ .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = axe_bulk_read_callback, .timeout = 0, /* no timeout */ @@ -777,7 +774,7 @@ axe_bulk_read_callback(struct usb_xfer * struct ifnet *ifp = uether_getifp(ue); struct axe_sframe_hdr hdr; struct usb_page_cache *pc; - int err, pos, len, adjust; + int err, pos, len; int actlen; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); @@ -785,50 +782,42 @@ axe_bulk_read_callback(struct usb_xfer * switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: pos = 0; + len = 0; + err = 0; + pc = usbd_xfer_get_frame(xfer, 0); - while (1) { - if (sc->sc_flags & (AXE_FLAG_772 | AXE_FLAG_178)) { - if (actlen < sizeof(hdr)) { + if (sc->sc_flags & (AXE_FLAG_772 | AXE_FLAG_178)) { + while (pos < actlen) { + if ((pos + sizeof(hdr)) > actlen) { /* too little data */ + err = EINVAL; break; } usbd_copy_out(pc, pos, &hdr, sizeof(hdr)); if ((hdr.len ^ hdr.ilen) != 0xFFFF) { /* we lost sync */ + err = EINVAL; break; } - actlen -= sizeof(hdr); pos += sizeof(hdr); len = le16toh(hdr.len); - if (len > actlen) { + if ((pos + len) > actlen) { /* invalid length */ + err = EINVAL; break; } - adjust = (len & 1); - - } else { - len = actlen; - adjust = 0; - } - err = uether_rxbuf(ue, pc, pos, len); - if (err) - break; - - pos += len; - actlen -= len; + err = uether_rxbuf(ue, pc, pos, len); - if (actlen <= adjust) { - /* we are finished */ - goto tr_setup; + pos += len + (len % 2); } - pos += adjust; - actlen -= adjust; + } else { + err = uether_rxbuf(ue, pc, 0, actlen); } - /* count an error */ - ifp->if_ierrors++; + if (err != 0) + ifp->if_ierrors++; /* FALLTHROUGH */ case USB_ST_SETUP: @@ -1011,7 +1000,15 @@ axe_init(struct usb_ether *ue) /* Enable receiver, set RX mode */ rxmode = (AXE_RXCMD_MULTICAST | AXE_RXCMD_ENABLE); if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) { +#if 0 rxmode |= AXE_178_RXCMD_MFB_2048; /* chip default */ +#else + /* + * Default Rx buffer size is too small to get + * maximum performance. + */ + rxmode |= AXE_178_RXCMD_MFB_16384; +#endif } else { rxmode |= AXE_172_RXCMD_UNICAST; } From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 08:05:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EB9F106566C; Mon, 28 Sep 2009 08:05:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EA608FC14; Mon, 28 Sep 2009 08:05:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S85E5C047746; Mon, 28 Sep 2009 08:05:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S85EvV047744; Mon, 28 Sep 2009 08:05:14 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280805.n8S85EvV047744@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 08:05: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: r197567 - head/sys/dev/usb/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: Mon, 28 Sep 2009 08:05:14 -0000 Author: thompsa Date: Mon Sep 28 08:05:14 2009 New Revision: 197567 URL: http://svn.freebsd.org/changeset/base/197567 Log: Allow setting of MAC address for AXE based ethernet adapters. Submitted by: yongari Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Mon Sep 28 08:03:52 2009 (r197566) +++ head/sys/dev/usb/net/if_axe.c Mon Sep 28 08:05:14 2009 (r197567) @@ -982,10 +982,11 @@ axe_init(struct usb_ether *ue) /* Cancel pending I/O */ axe_stop(ue); -#ifdef notdef - /* Set MAC address */ - axe_mac(sc, IF_LLADDR(ifp), 1); -#endif + /* Set MAC address. */ + if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) + axe_cmd(sc, AXE_178_CMD_WRITE_NODEID, 0, 0, IF_LLADDR(ifp)); + else + axe_cmd(sc, AXE_172_CMD_WRITE_NODEID, 0, 0, IF_LLADDR(ifp)); /* Set transmitter IPG values */ if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) { From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 08:07:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3453E106566C; Mon, 28 Sep 2009 08:07:21 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23DFE8FC0A; Mon, 28 Sep 2009 08:07:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S87LIS047844; Mon, 28 Sep 2009 08:07:21 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S87LJC047842; Mon, 28 Sep 2009 08:07:21 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280807.n8S87LJC047842@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 08:07: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: r197568 - head/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: Mon, 28 Sep 2009 08:07:21 -0000 Author: thompsa Date: Mon Sep 28 08:07:20 2009 New Revision: 197568 URL: http://svn.freebsd.org/changeset/base/197568 Log: add more device IDs Reported by: Mike Tancsa Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/serial/u3g.c Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Mon Sep 28 08:05:14 2009 (r197567) +++ head/sys/dev/usb/serial/u3g.c Mon Sep 28 08:07:20 2009 (r197568) @@ -180,6 +180,8 @@ static const struct usb_device_id u3g_de U3G_DEV(OPTION, GTMAX36, 0), U3G_DEV(OPTION, GTHSDPA, 0), U3G_DEV(OPTION, GTMAXHSUPA, 0), + U3G_DEV(OPTION, GTMAXHSUPAE, 0), + U3G_DEV(OPTION, GTMAX380HSUPAE, 0), U3G_DEV(OPTION, VODAFONEMC3G, 0), /* OEM: Qualcomm, Inc. */ U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GFL_SCSI_EJECT), @@ -204,6 +206,7 @@ static const struct usb_device_id u3g_de U3G_DEV(NOVATEL, X950D, 0), U3G_DEV(NOVATEL, XU870, 0), U3G_DEV(NOVATEL, ZEROCD, U3GFL_SCSI_EJECT), + U3G_DEV(NOVATEL, U760, U3GFL_SCSI_EJECT), U3G_DEV(DELL, U740, 0), /* OEM: Merlin */ U3G_DEV(MERLIN, V620, 0), From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 08:09:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 087CE1065698; Mon, 28 Sep 2009 08:09:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC6298FC26; Mon, 28 Sep 2009 08:09:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S89BhX047910; Mon, 28 Sep 2009 08:09:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S89BjZ047908; Mon, 28 Sep 2009 08:09:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280809.n8S89BjZ047908@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 08:09: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: r197569 - head/sys/dev/usb/quirk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 08:09:12 -0000 Author: thompsa Date: Mon Sep 28 08:09:11 2009 New Revision: 197569 URL: http://svn.freebsd.org/changeset/base/197569 Log: Add a config number quirk for the ELSA_MODEM1 Submitted by: Stefan Bethke Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Sep 28 08:07:20 2009 (r197568) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Sep 28 08:09:11 2009 (r197569) @@ -94,6 +94,7 @@ static struct usb_quirk_entry usb_quirks {USB_QUIRK_ENTRY(USB_VENDOR_TELEX, USB_PRODUCT_TELEX_MIC1, 0x009, 0x009, UQ_AU_NO_FRAC, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_SILICONPORTALS, USB_PRODUCT_SILICONPORTALS_YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_UN53B, 0x0000, 0xFFFF, UQ_NO_STRINGS, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_ELSA, USB_PRODUCT_ELSA_MODEM1, 0x0000, 0xFFFF, UQ_CFG_INDEX_1, UQ_NONE)}, /* * XXX The following quirks should have a more specific revision From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 08:13:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63B4C106566C; Mon, 28 Sep 2009 08:13:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5229C8FC12; Mon, 28 Sep 2009 08:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S8Dob8048071; Mon, 28 Sep 2009 08:13:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S8DooU048052; Mon, 28 Sep 2009 08:13:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280813.n8S8DooU048052@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 08:13: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: r197570 - head/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: Mon, 28 Sep 2009 08:13:51 -0000 Author: thompsa Date: Mon Sep 28 08:13:50 2009 New Revision: 197570 URL: http://svn.freebsd.org/changeset/base/197570 Log: Add experimental support for usb serial console and polled mode during DDB. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/ubser.c head/sys/dev/usb/serial/uch341.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ucycom.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ugensa.c head/sys/dev/usb/serial/uipaq.c head/sys/dev/usb/serial/umct.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/umoscom.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/serial/uvscom.c Modified: head/sys/dev/usb/serial/uark.c ============================================================================== --- head/sys/dev/usb/serial/uark.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/uark.c Mon Sep 28 08:13:50 2009 (r197570) @@ -114,6 +114,7 @@ static void uark_cfg_get_status(struct u uint8_t *); static void uark_cfg_set_break(struct ucom_softc *, uint8_t); static void uark_cfg_write(struct uark_softc *, uint16_t, uint16_t); +static void uark_poll(struct ucom_softc *ucom); static const struct usb_config uark_xfer_config[UARK_N_TRANSFER] = { @@ -146,6 +147,7 @@ static const struct ucom_callback uark_c .ucom_stop_read = &uark_stop_read, .ucom_start_write = &uark_start_write, .ucom_stop_write = &uark_stop_write, + .ucom_poll = &uark_poll, }; static device_method_t uark_methods[] = { @@ -431,3 +433,10 @@ uark_cfg_write(struct uark_softc *sc, ui "(ignored)\n", usbd_errstr(err)); } } + +static void +uark_poll(struct ucom_softc *ucom) +{ + struct uark_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UARK_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/ubsa.c ============================================================================== --- head/sys/dev/usb/serial/ubsa.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/ubsa.c Mon Sep 28 08:13:50 2009 (r197570) @@ -194,6 +194,7 @@ static void ubsa_start_write(struct ucom static void ubsa_stop_write(struct ucom_softc *); static void ubsa_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); +static void ubsa_poll(struct ucom_softc *ucom); static const struct usb_config ubsa_config[UBSA_N_TRANSFER] = { @@ -236,6 +237,7 @@ static const struct ucom_callback ubsa_c .ucom_stop_read = &ubsa_stop_read, .ucom_start_write = &ubsa_start_write, .ucom_stop_write = &ubsa_stop_write, + .ucom_poll = &ubsa_poll, }; static const struct usb_device_id ubsa_devs[] = { @@ -659,3 +661,11 @@ tr_setup: } } + +static void +ubsa_poll(struct ucom_softc *ucom) +{ + struct ubsa_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UBSA_N_TRANSFER); + +} Modified: head/sys/dev/usb/serial/ubser.c ============================================================================== --- head/sys/dev/usb/serial/ubser.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/ubser.c Mon Sep 28 08:13:50 2009 (r197570) @@ -163,6 +163,7 @@ static void ubser_start_read(struct ucom static void ubser_stop_read(struct ucom_softc *); static void ubser_start_write(struct ucom_softc *); static void ubser_stop_write(struct ucom_softc *); +static void ubser_poll(struct ucom_softc *ucom); static const struct usb_config ubser_config[UBSER_N_TRANSFER] = { @@ -193,6 +194,7 @@ static const struct ucom_callback ubser_ .ucom_stop_read = &ubser_stop_read, .ucom_start_write = &ubser_start_write, .ucom_stop_write = &ubser_stop_write, + .ucom_poll = &ubser_poll, }; static device_method_t ubser_methods[] = { @@ -535,3 +537,10 @@ ubser_stop_write(struct ucom_softc *ucom usbd_transfer_stop(sc->sc_xfer[UBSER_BULK_DT_WR]); } + +static void +ubser_poll(struct ucom_softc *ucom) +{ + struct ubser_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UBSER_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/uch341.c ============================================================================== --- head/sys/dev/usb/serial/uch341.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/uch341.c Mon Sep 28 08:13:50 2009 (r197570) @@ -118,6 +118,7 @@ static void uch341_start_read(struct uco static void uch341_stop_read(struct ucom_softc *); static void uch341_start_write(struct ucom_softc *); static void uch341_stop_write(struct ucom_softc *); +static void uch341_poll(struct ucom_softc *ucom); static const struct usb_config uch341_config[UCH341_N_TRANSFER] = { @@ -152,6 +153,7 @@ static const struct ucom_callback uch341 .ucom_stop_read = &uch341_stop_read, .ucom_start_write = &uch341_start_write, .ucom_stop_write = &uch341_stop_write, + .ucom_poll = &uch341_poll, }; static device_method_t uch341_methods[] = { @@ -519,3 +521,10 @@ uch341_stop_write(struct ucom_softc *uco usbd_transfer_stop(sc->sc_xfer[UCH341_BULK_DT_WR]); } + +static void +uch341_poll(struct ucom_softc *ucom) +{ + struct uch341_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UCH341_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/uchcom.c Mon Sep 28 08:13:50 2009 (r197570) @@ -230,6 +230,7 @@ static void uchcom_set_dte_rate(struct u static void uchcom_set_line_control(struct uchcom_softc *, tcflag_t); static void uchcom_clear_chip(struct uchcom_softc *); static void uchcom_reset_chip(struct uchcom_softc *); +static void uchcom_poll(struct ucom_softc *ucom); static device_probe_t uchcom_probe; static device_attach_t uchcom_attach; @@ -280,6 +281,7 @@ static struct ucom_callback uchcom_callb .ucom_stop_read = &uchcom_stop_read, .ucom_start_write = &uchcom_start_write, .ucom_stop_write = &uchcom_stop_write, + .ucom_poll = &uchcom_poll, }; /* ---------------------------------------------------------------------- @@ -888,6 +890,13 @@ tr_setup: } } +static void +uchcom_poll(struct ucom_softc *ucom) +{ + struct uchcom_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UCHCOM_N_TRANSFER); +} + static device_method_t uchcom_methods[] = { /* Device interface */ DEVMETHOD(device_probe, uchcom_probe), Modified: head/sys/dev/usb/serial/ucycom.c ============================================================================== --- head/sys/dev/usb/serial/ucycom.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/ucycom.c Mon Sep 28 08:13:50 2009 (r197570) @@ -124,6 +124,7 @@ static void ucycom_stop_write(struct uco static void ucycom_cfg_write(struct ucycom_softc *, uint32_t, uint8_t); static int ucycom_pre_param(struct ucom_softc *, struct termios *); static void ucycom_cfg_param(struct ucom_softc *, struct termios *); +static void ucycom_poll(struct ucom_softc *ucom); static const struct usb_config ucycom_config[UCYCOM_N_TRANSFER] = { @@ -154,6 +155,7 @@ static const struct ucom_callback ucycom .ucom_stop_read = &ucycom_stop_read, .ucom_start_write = &ucycom_start_write, .ucom_stop_write = &ucycom_stop_write, + .ucom_poll = &ucycom_poll, }; static device_method_t ucycom_methods[] = { @@ -578,3 +580,10 @@ tr_setup: } } + +static void +ucycom_poll(struct ucom_softc *ucom) +{ + struct ucycom_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UCYCOM_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/ufoma.c Mon Sep 28 08:13:50 2009 (r197570) @@ -230,13 +230,13 @@ static void ufoma_start_read(struct ucom static void ufoma_stop_read(struct ucom_softc *); static void ufoma_start_write(struct ucom_softc *); static void ufoma_stop_write(struct ucom_softc *); +static void ufoma_poll(struct ucom_softc *ucom); /*sysctl stuff*/ static int ufoma_sysctl_support(SYSCTL_HANDLER_ARGS); static int ufoma_sysctl_current(SYSCTL_HANDLER_ARGS); static int ufoma_sysctl_open(SYSCTL_HANDLER_ARGS); - static const struct usb_config ufoma_ctrl_config[UFOMA_CTRL_ENDPT_MAX] = { @@ -304,6 +304,7 @@ static const struct ucom_callback ufoma_ .ucom_stop_read = &ufoma_stop_read, .ucom_start_write = &ufoma_start_write, .ucom_stop_write = &ufoma_stop_write, + .ucom_poll = &ufoma_poll, }; static device_method_t ufoma_methods[] = { @@ -1241,3 +1242,11 @@ static int ufoma_sysctl_open(SYSCTL_HAND return EINVAL; } + +static void +ufoma_poll(struct ucom_softc *ucom) +{ + struct ufoma_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_ctrl_xfer, UFOMA_CTRL_ENDPT_MAX); + usbd_transfer_poll(sc->sc_bulk_xfer, UFOMA_BULK_ENDPT_MAX); +} Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/uftdi.c Mon Sep 28 08:13:50 2009 (r197570) @@ -156,6 +156,7 @@ static void uftdi_stop_read(struct ucom_ static void uftdi_start_write(struct ucom_softc *); static void uftdi_stop_write(struct ucom_softc *); static uint8_t uftdi_8u232am_getrate(uint32_t, uint16_t *); +static void uftdi_poll(struct ucom_softc *ucom); static const struct usb_config uftdi_config[UFTDI_N_TRANSFER] = { @@ -190,6 +191,7 @@ static const struct ucom_callback uftdi_ .ucom_stop_read = &uftdi_stop_read, .ucom_start_write = &uftdi_start_write, .ucom_stop_write = &uftdi_stop_write, + .ucom_poll = &uftdi_poll, }; static device_method_t uftdi_methods[] = { @@ -808,3 +810,10 @@ done: *rate = result; return (0); } + +static void +uftdi_poll(struct ucom_softc *ucom) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UFTDI_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/ugensa.c ============================================================================== --- head/sys/dev/usb/serial/ugensa.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/ugensa.c Mon Sep 28 08:13:50 2009 (r197570) @@ -110,9 +110,9 @@ static void ugensa_start_read(struct uco static void ugensa_stop_read(struct ucom_softc *); static void ugensa_start_write(struct ucom_softc *); static void ugensa_stop_write(struct ucom_softc *); +static void ugensa_poll(struct ucom_softc *ucom); -static const struct usb_config - ugensa_xfer_config[UGENSA_N_TRANSFER] = { +static const struct usb_config ugensa_xfer_config[UGENSA_N_TRANSFER] = { [UGENSA_BULK_DT_WR] = { .type = UE_BULK, @@ -138,6 +138,7 @@ static const struct ucom_callback ugensa .ucom_stop_read = &ugensa_stop_read, .ucom_start_write = &ugensa_start_write, .ucom_stop_write = &ugensa_stop_write, + .ucom_poll = &ugensa_poll, }; static device_method_t ugensa_methods[] = { @@ -369,3 +370,12 @@ ugensa_stop_write(struct ucom_softc *uco usbd_transfer_stop(ssc->sc_xfer[UGENSA_BULK_DT_WR]); } + +static void +ugensa_poll(struct ucom_softc *ucom) +{ + struct ugensa_softc *sc = ucom->sc_parent; + struct ugensa_sub_softc *ssc = sc->sc_sub + ucom->sc_portno; + + usbd_transfer_poll(ssc->sc_xfer, UGENSA_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/uipaq.c ============================================================================== --- head/sys/dev/usb/serial/uipaq.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/uipaq.c Mon Sep 28 08:13:50 2009 (r197570) @@ -122,6 +122,7 @@ static void uipaq_stop_write(struct ucom static void uipaq_cfg_set_dtr(struct ucom_softc *, uint8_t); static void uipaq_cfg_set_rts(struct ucom_softc *, uint8_t); static void uipaq_cfg_set_break(struct ucom_softc *, uint8_t); +static void uipaq_poll(struct ucom_softc *ucom); static const struct usb_config uipaq_config_data[UIPAQ_N_TRANSFER] = { @@ -152,6 +153,7 @@ static const struct ucom_callback uipaq_ .ucom_stop_read = &uipaq_stop_read, .ucom_start_write = &uipaq_start_write, .ucom_stop_write = &uipaq_stop_write, + .ucom_poll = &uipaq_poll, }; /* @@ -1342,3 +1344,10 @@ tr_setup: return; } } + +static void +uipaq_poll(struct ucom_softc *ucom) +{ + struct uipaq_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UIPAQ_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/umct.c ============================================================================== --- head/sys/dev/usb/serial/umct.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/umct.c Mon Sep 28 08:13:50 2009 (r197570) @@ -142,6 +142,7 @@ static void umct_start_read(struct ucom_ static void umct_stop_read(struct ucom_softc *); static void umct_start_write(struct ucom_softc *); static void umct_stop_write(struct ucom_softc *); +static void umct_poll(struct ucom_softc *ucom); static const struct usb_config umct_config[UMCT_N_TRANSFER] = { @@ -186,6 +187,7 @@ static const struct ucom_callback umct_c .ucom_stop_read = &umct_stop_read, .ucom_start_write = &umct_start_write, .ucom_stop_write = &umct_stop_write, + .ucom_poll = &umct_poll, }; static const struct usb_device_id umct_devs[] = { @@ -603,3 +605,10 @@ tr_setup: return; } } + +static void +umct_poll(struct ucom_softc *ucom) +{ + struct umct_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UMCT_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/umodem.c Mon Sep 28 08:13:50 2009 (r197570) @@ -196,6 +196,7 @@ static void umodem_cfg_set_break(struct static void *umodem_get_desc(struct usb_attach_arg *, uint8_t, uint8_t); static usb_error_t umodem_set_comm_feature(struct usb_device *, uint8_t, uint16_t, uint16_t); +static void umodem_poll(struct ucom_softc *ucom); static const struct usb_config umodem_config[UMODEM_N_TRANSFER] = { @@ -242,6 +243,7 @@ static const struct ucom_callback umodem .ucom_stop_read = &umodem_stop_read, .ucom_start_write = &umodem_start_write, .ucom_stop_write = &umodem_stop_write, + .ucom_poll = &umodem_poll, }; static device_method_t umodem_methods[] = { @@ -810,3 +812,10 @@ umodem_detach(device_t dev) return (0); } + +static void +umodem_poll(struct ucom_softc *ucom) +{ + struct umodem_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UMODEM_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/umoscom.c ============================================================================== --- head/sys/dev/usb/serial/umoscom.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/umoscom.c Mon Sep 28 08:13:50 2009 (r197570) @@ -210,6 +210,7 @@ static void umoscom_start_read(struct uc static void umoscom_stop_read(struct ucom_softc *); static void umoscom_start_write(struct ucom_softc *); static void umoscom_stop_write(struct ucom_softc *); +static void umoscom_poll(struct ucom_softc *ucom); static const struct usb_config umoscom_config_data[UMOSCOM_N_TRANSFER] = { @@ -257,6 +258,7 @@ static const struct ucom_callback umosco .ucom_stop_read = &umoscom_stop_read, .ucom_start_write = &umoscom_start_write, .ucom_stop_write = &umoscom_stop_write, + .ucom_poll = &umoscom_poll, }; static device_method_t umoscom_methods[] = { @@ -694,3 +696,10 @@ tr_setup: return; } } + +static void +umoscom_poll(struct ucom_softc *ucom) +{ + struct umoscom_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UMOSCOM_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/uplcom.c Mon Sep 28 08:13:50 2009 (r197570) @@ -186,6 +186,7 @@ static void uplcom_start_write(struct uc static void uplcom_stop_write(struct ucom_softc *); static void uplcom_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); +static void uplcom_poll(struct ucom_softc *ucom); static device_probe_t uplcom_probe; static device_attach_t uplcom_attach; @@ -239,6 +240,7 @@ static struct ucom_callback uplcom_callb .ucom_stop_read = &uplcom_stop_read, .ucom_start_write = &uplcom_start_write, .ucom_stop_write = &uplcom_stop_write, + .ucom_poll = &uplcom_poll, }; #define USB_UPL(v,p,rl,rh,t) \ @@ -862,3 +864,10 @@ tr_setup: return; } } + +static void +uplcom_poll(struct ucom_softc *ucom) +{ + struct uplcom_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UPLCOM_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/usb_serial.c Mon Sep 28 08:13:50 2009 (r197570) @@ -86,6 +86,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -98,14 +100,40 @@ __FBSDID("$FreeBSD$"); #include +#include "opt_gdb.h" + +SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom"); + #if USB_DEBUG static int ucom_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom"); SYSCTL_INT(_hw_usb_ucom, OID_AUTO, debug, CTLFLAG_RW, &ucom_debug, 0, "ucom debug level"); #endif +#define UCOM_CONS_BUFSIZE 1024 + +static uint8_t ucom_cons_rx_buf[UCOM_CONS_BUFSIZE]; +static uint8_t ucom_cons_tx_buf[UCOM_CONS_BUFSIZE]; + +static unsigned int ucom_cons_rx_low = 0; +static unsigned int ucom_cons_rx_high = 0; + +static unsigned int ucom_cons_tx_low = 0; +static unsigned int ucom_cons_tx_high = 0; + +static int ucom_cons_unit = -1; +static int ucom_cons_baud = 9600; +static struct ucom_softc *ucom_cons_softc = NULL; + +TUNABLE_INT("hw.usb.ucom.cons_unit", &ucom_cons_unit); +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW, + &ucom_cons_unit, 0, "console unit number"); + +TUNABLE_INT("hw.usb.ucom.cons_baud", &ucom_cons_baud); +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW, + &ucom_cons_baud, 0, "console baud rate"); + static usb_proc_callback_t ucom_cfg_start_transfers; static usb_proc_callback_t ucom_cfg_open; static usb_proc_callback_t ucom_cfg_close; @@ -121,6 +149,7 @@ static void ucom_queue_command(struct uc usb_proc_callback_t *, struct termios *pt, struct usb_proc_msg *t0, struct usb_proc_msg *t1); static void ucom_shutdown(struct ucom_softc *); +static void ucom_ring(struct ucom_softc *, uint8_t); static void ucom_break(struct ucom_softc *, uint8_t); static void ucom_dtr(struct ucom_softc *, uint8_t); static void ucom_rts(struct ucom_softc *, uint8_t); @@ -147,7 +176,7 @@ static struct ttydevsw ucom_class = { MODULE_DEPEND(ucom, usb, 1, 1, 1); MODULE_VERSION(ucom, 1); -#define UCOM_UNIT_MAX 0x1000 /* exclusive */ +#define UCOM_UNIT_MAX 0x200 /* exclusive */ #define UCOM_SUB_UNIT_MAX 0x100 /* exclusive */ static uint8_t ucom_bitmap[(UCOM_UNIT_MAX + 7) / 8]; @@ -346,6 +375,29 @@ ucom_attach_tty(struct ucom_softc *sc, u DPRINTF("ttycreate: %s\n", buf); cv_init(&sc->sc_cv, "ucom"); + /* Check if this device should be a console */ + if ((ucom_cons_softc == NULL) && + (sc->sc_unit == ucom_cons_unit)) { + + struct termios t; + + ucom_cons_softc = sc; + + memset(&t, 0, sizeof(t)); + t.c_ispeed = ucom_cons_baud; + t.c_ospeed = t.c_ispeed; + t.c_cflag = CS8; + + mtx_lock(ucom_cons_softc->sc_mtx); + ucom_cons_rx_low = 0; + ucom_cons_rx_high = 0; + ucom_cons_tx_low = 0; + ucom_cons_tx_high = 0; + sc->sc_flag |= UCOM_FLAG_CONSOLE; + ucom_open(ucom_cons_softc->sc_tty); + ucom_param(ucom_cons_softc->sc_tty, &t); + mtx_unlock(ucom_cons_softc->sc_mtx); + } done: return (error); } @@ -357,12 +409,18 @@ ucom_detach_tty(struct ucom_softc *sc) DPRINTF("sc = %p, tp = %p\n", sc, sc->sc_tty); + if (sc->sc_flag & UCOM_FLAG_CONSOLE) { + mtx_lock(ucom_cons_softc->sc_mtx); + ucom_close(ucom_cons_softc->sc_tty); + mtx_unlock(ucom_cons_softc->sc_mtx); + ucom_cons_softc = NULL; + } + /* the config thread has been stopped when we get here */ mtx_lock(sc->sc_mtx); sc->sc_flag |= UCOM_FLAG_GONE; - sc->sc_flag &= ~(UCOM_FLAG_HL_READY | - UCOM_FLAG_LL_READY); + sc->sc_flag &= ~(UCOM_FLAG_HL_READY | UCOM_FLAG_LL_READY); mtx_unlock(sc->sc_mtx); if (tp) { tty_lock(tp); @@ -588,6 +646,8 @@ ucom_open(struct tty *tp) ucom_modem(tp, SER_DTR | SER_RTS, 0); + ucom_ring(sc, 0); + ucom_break(sc, 0); ucom_status_change(sc); @@ -653,6 +713,16 @@ ucom_ioctl(struct tty *tp, u_long cmd, c DPRINTF("cmd = 0x%08lx\n", cmd); switch (cmd) { +#if 0 + case TIOCSRING: + ucom_ring(sc, 1); + error = 0; + break; + case TIOCCRING: + ucom_ring(sc, 0); + error = 0; + break; +#endif case TIOCSBRK: ucom_break(sc, 1); error = 0; @@ -751,6 +821,8 @@ ucom_cfg_line_state(struct usb_proc_msg mask |= UCOM_LS_RTS; if (sc->sc_callback->ucom_cfg_set_break) mask |= UCOM_LS_BREAK; + if (sc->sc_callback->ucom_cfg_set_ring) + mask |= UCOM_LS_RING; /* compute the bits we are to program */ notch_bits = (sc->sc_pls_set & sc->sc_pls_clr) & mask; @@ -773,6 +845,9 @@ ucom_cfg_line_state(struct usb_proc_msg if (notch_bits & UCOM_LS_BREAK) sc->sc_callback->ucom_cfg_set_break(sc, (prev_value & UCOM_LS_BREAK) ? 1 : 0); + if (notch_bits & UCOM_LS_RING) + sc->sc_callback->ucom_cfg_set_ring(sc, + (prev_value & UCOM_LS_RING) ? 1 : 0); /* set last value */ if (any_bits & UCOM_LS_DTR) @@ -784,6 +859,9 @@ ucom_cfg_line_state(struct usb_proc_msg if (any_bits & UCOM_LS_BREAK) sc->sc_callback->ucom_cfg_set_break(sc, (last_value & UCOM_LS_BREAK) ? 1 : 0); + if (any_bits & UCOM_LS_RING) + sc->sc_callback->ucom_cfg_set_ring(sc, + (last_value & UCOM_LS_RING) ? 1 : 0); } static void @@ -811,6 +889,17 @@ ucom_line_state(struct ucom_softc *sc, } static void +ucom_ring(struct ucom_softc *sc, uint8_t onoff) +{ + DPRINTF("onoff = %d\n", onoff); + + if (onoff) + ucom_line_state(sc, UCOM_LS_RING, 0); + else + ucom_line_state(sc, 0, UCOM_LS_RING); +} + +static void ucom_break(struct ucom_softc *sc, uint8_t onoff) { DPRINTF("onoff = %d\n", onoff); @@ -895,6 +984,9 @@ ucom_status_change(struct ucom_softc *sc { mtx_assert(sc->sc_mtx, MA_OWNED); + if (sc->sc_flag & UCOM_FLAG_CONSOLE) + return; /* not supported */ + if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) { return; } @@ -1033,6 +1125,38 @@ ucom_get_data(struct ucom_softc *sc, str mtx_assert(sc->sc_mtx, MA_OWNED); + if (sc->sc_flag & UCOM_FLAG_CONSOLE) { + unsigned int temp; + + /* get total TX length */ + + temp = ucom_cons_tx_high - ucom_cons_tx_low; + temp %= UCOM_CONS_BUFSIZE; + + /* limit TX length */ + + if (temp > (UCOM_CONS_BUFSIZE - ucom_cons_tx_low)) + temp = (UCOM_CONS_BUFSIZE - ucom_cons_tx_low); + + if (temp > len) + temp = len; + + /* copy in data */ + + usbd_copy_in(pc, offset, ucom_cons_tx_buf + ucom_cons_tx_low, temp); + + /* update counters */ + + ucom_cons_tx_low += temp; + ucom_cons_tx_low %= UCOM_CONS_BUFSIZE; + + /* store actual length */ + + *actlen = temp; + + return (temp ? 1 : 0); + } + if (tty_gone(tp) || !(sc->sc_flag & UCOM_FLAG_GP_DATA)) { actlen[0] = 0; @@ -1080,6 +1204,34 @@ ucom_put_data(struct ucom_softc *sc, str mtx_assert(sc->sc_mtx, MA_OWNED); + if (sc->sc_flag & UCOM_FLAG_CONSOLE) { + unsigned int temp; + + /* get maximum RX length */ + + temp = (UCOM_CONS_BUFSIZE - 1) - ucom_cons_rx_high + ucom_cons_rx_low; + temp %= UCOM_CONS_BUFSIZE; + + /* limit RX length */ + + if (temp > (UCOM_CONS_BUFSIZE - ucom_cons_rx_high)) + temp = (UCOM_CONS_BUFSIZE - ucom_cons_rx_high); + + if (temp > len) + temp = len; + + /* copy out data */ + + usbd_copy_out(pc, offset, ucom_cons_rx_buf + ucom_cons_rx_high, temp); + + /* update counters */ + + ucom_cons_rx_high += temp; + ucom_cons_rx_high %= UCOM_CONS_BUFSIZE; + + return; + } + if (tty_gone(tp)) return; /* multiport device polling */ @@ -1136,3 +1288,138 @@ ucom_free(void *xsc) cv_signal(&sc->sc_cv); mtx_unlock(sc->sc_mtx); } + +static cn_probe_t ucom_cnprobe; +static cn_init_t ucom_cninit; +static cn_term_t ucom_cnterm; +static cn_getc_t ucom_cngetc; +static cn_putc_t ucom_cnputc; + +CONSOLE_DRIVER(ucom); + +static void +ucom_cnprobe(struct consdev *cp) +{ + cp->cn_pri = CN_NORMAL; +} + +static void +ucom_cninit(struct consdev *cp) +{ +} + +static void +ucom_cnterm(struct consdev *cp) +{ +} + +static int +ucom_cngetc(struct consdev *cd) +{ + struct ucom_softc *sc = ucom_cons_softc; + int c; + + if (sc == NULL) + return (-1); + + mtx_lock(sc->sc_mtx); + + if (ucom_cons_rx_low != ucom_cons_rx_high) { + c = ucom_cons_rx_buf[ucom_cons_rx_low]; + ucom_cons_rx_low ++; + ucom_cons_rx_low %= UCOM_CONS_BUFSIZE; + } else { + c = -1; + } + + /* start USB transfers */ + ucom_outwakeup(sc->sc_tty); + + mtx_unlock(sc->sc_mtx); + + /* poll if necessary */ + if (kdb_active && sc->sc_callback->ucom_poll) + (sc->sc_callback->ucom_poll) (sc); + + return (c); +} + +static void +ucom_cnputc(struct consdev *cd, int c) +{ + struct ucom_softc *sc = ucom_cons_softc; + unsigned int temp; + + if (sc == NULL) + return; + + repeat: + + mtx_lock(sc->sc_mtx); + + /* compute maximum TX length */ + + temp = (UCOM_CONS_BUFSIZE - 1) - ucom_cons_tx_high + ucom_cons_tx_low; + temp %= UCOM_CONS_BUFSIZE; + + if (temp) { + ucom_cons_tx_buf[ucom_cons_tx_high] = c; + ucom_cons_tx_high ++; + ucom_cons_tx_high %= UCOM_CONS_BUFSIZE; + } + + /* start USB transfers */ + ucom_outwakeup(sc->sc_tty); + + mtx_unlock(sc->sc_mtx); + + /* poll if necessary */ + if (kdb_active && sc->sc_callback->ucom_poll) { + (sc->sc_callback->ucom_poll) (sc); + /* simple flow control */ + if (temp == 0) + goto repeat; + } +} + +#if defined(GDB) + +#include + +static gdb_probe_f ucom_gdbprobe; +static gdb_init_f ucom_gdbinit; +static gdb_term_f ucom_gdbterm; +static gdb_getc_f ucom_gdbgetc; +static gdb_putc_f ucom_gdbputc; + +GDB_DBGPORT(sio, ucom_gdbprobe, ucom_gdbinit, ucom_gdbterm, ucom_gdbgetc, ucom_gdbputc); + +static int +ucom_gdbprobe(void) +{ + return ((ucom_cons_softc != NULL) ? 0 : -1); +} + +static void +ucom_gdbinit(void) +{ +} + +static void +ucom_gdbterm(void) +{ +} + +static void +ucom_gdbputc(int c) +{ + ucom_cnputc(NULL, c); +} + +static int +ucom_gdbgetc(void) +{ + return (ucom_cngetc(NULL)); +} + +#endif Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/usb_serial.h Mon Sep 28 08:13:50 2009 (r197570) @@ -94,6 +94,7 @@ struct ucom_callback { void (*ucom_cfg_set_dtr) (struct ucom_softc *, uint8_t); void (*ucom_cfg_set_rts) (struct ucom_softc *, uint8_t); void (*ucom_cfg_set_break) (struct ucom_softc *, uint8_t); + void (*ucom_cfg_set_ring) (struct ucom_softc *, uint8_t); void (*ucom_cfg_param) (struct ucom_softc *, struct termios *); void (*ucom_cfg_open) (struct ucom_softc *); void (*ucom_cfg_close) (struct ucom_softc *); @@ -105,6 +106,7 @@ struct ucom_callback { void (*ucom_start_write) (struct ucom_softc *); void (*ucom_stop_write) (struct ucom_softc *); void (*ucom_tty_name) (struct ucom_softc *, char *pbuf, uint16_t buflen, uint16_t local_subunit); + void (*ucom_poll) (struct ucom_softc *); }; /* Line status register */ @@ -162,13 +164,14 @@ struct ucom_softc { uint32_t sc_unit; uint32_t sc_local_unit; uint16_t sc_portno; - uint8_t sc_flag; + uint16_t sc_flag; #define UCOM_FLAG_RTS_IFLOW 0x01 /* use RTS input flow control */ #define UCOM_FLAG_GONE 0x02 /* the device is gone */ #define UCOM_FLAG_ATTACHED 0x04 /* set if attached */ #define UCOM_FLAG_GP_DATA 0x08 /* set if get and put data is possible */ #define UCOM_FLAG_LL_READY 0x20 /* set if low layer is ready */ #define UCOM_FLAG_HL_READY 0x40 /* set if high layer is ready */ +#define UCOM_FLAG_CONSOLE 0x80 /* set if device is a console */ uint8_t sc_lsr; uint8_t sc_msr; uint8_t sc_mcr; @@ -180,6 +183,7 @@ struct ucom_softc { #define UCOM_LS_DTR 0x01 #define UCOM_LS_RTS 0x02 #define UCOM_LS_BREAK 0x04 +#define UCOM_LS_RING 0x08 }; #define ucom_cfg_do_request(udev,com,req,ptr,flags,timo) \ Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/uslcom.c Mon Sep 28 08:13:50 2009 (r197570) @@ -135,6 +135,7 @@ static void uslcom_start_read(struct uco static void uslcom_stop_read(struct ucom_softc *); static void uslcom_start_write(struct ucom_softc *); static void uslcom_stop_write(struct ucom_softc *); +static void uslcom_poll(struct ucom_softc *ucom); static const struct usb_config uslcom_config[USLCOM_N_TRANSFER] = { @@ -170,6 +171,7 @@ static struct ucom_callback uslcom_callb .ucom_stop_read = &uslcom_stop_read, .ucom_start_write = &uslcom_start_write, .ucom_stop_write = &uslcom_stop_write, + .ucom_poll = &uslcom_poll, }; static const struct usb_device_id uslcom_devs[] = { @@ -562,3 +564,10 @@ uslcom_stop_write(struct ucom_softc *uco usbd_transfer_stop(sc->sc_xfer[USLCOM_BULK_DT_WR]); } + +static void +uslcom_poll(struct ucom_softc *ucom) +{ + struct uslcom_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, USLCOM_N_TRANSFER); +} Modified: head/sys/dev/usb/serial/uvscom.c ============================================================================== --- head/sys/dev/usb/serial/uvscom.c Mon Sep 28 08:09:11 2009 (r197569) +++ head/sys/dev/usb/serial/uvscom.c Mon Sep 28 08:13:50 2009 (r197570) @@ -185,6 +185,7 @@ static void uvscom_cfg_get_status(struct uint8_t *); static void uvscom_cfg_write(struct uvscom_softc *, uint8_t, uint16_t); static uint16_t uvscom_cfg_read_status(struct uvscom_softc *); +static void uvscom_poll(struct ucom_softc *ucom); static const struct usb_config uvscom_config[UVSCOM_N_TRANSFER] = { @@ -230,6 +231,7 @@ static const struct ucom_callback uvscom .ucom_stop_read = &uvscom_stop_read, .ucom_start_write = &uvscom_start_write, .ucom_stop_write = &uvscom_stop_write, + .ucom_poll = &uvscom_poll, }; static const struct usb_device_id uvscom_devs[] = { @@ -734,3 +736,10 @@ uvscom_cfg_read_status(struct uvscom_sof } return (data[0] | (data[1] << 8)); } + +static void +uvscom_poll(struct ucom_softc *ucom) +{ + struct uvscom_softc *sc = ucom->sc_parent; + usbd_transfer_poll(sc->sc_xfer, UVSCOM_N_TRANSFER); +} From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 08:14:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E19E106568F; Mon, 28 Sep 2009 08:14:15 +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 6D4F58FC19; Mon, 28 Sep 2009 08:14:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S8EFNB048118; Mon, 28 Sep 2009 08:14:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S8EFCk048115; Mon, 28 Sep 2009 08:14:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909280814.n8S8EFCk048115@svn.freebsd.org> From: Xin LI Date: Mon, 28 Sep 2009 08:14: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: r197571 - head/sys/compat/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 08:14:15 -0000 Author: delphij Date: Mon Sep 28 08:14:15 2009 New Revision: 197571 URL: http://svn.freebsd.org/changeset/base/197571 Log: Use a 2 clause BSD-style license instead of stating the code as public domain, as requested by core@ and reviewed by the author. Modified: head/sys/compat/x86bios/x86bios.c head/sys/compat/x86bios/x86bios.h Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Mon Sep 28 08:13:50 2009 (r197570) +++ head/sys/compat/x86bios/x86bios.c Mon Sep 28 08:14:15 2009 (r197571) @@ -1,6 +1,28 @@ /*- - * Written by paradox - * Public domain. + * Copyright (c) 2009 Alex Keda + * 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 Modified: head/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Mon Sep 28 08:13:50 2009 (r197570) +++ head/sys/compat/x86bios/x86bios.h Mon Sep 28 08:14:15 2009 (r197571) @@ -1,7 +1,30 @@ /*- - * Written by paradox - * Public domain. + * Copyright (c) 2009 Alex Keda + * 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. + * + */ +/* * x86 registers were borrowed from x86emu.h x86emu_regs.h * for compatability. * From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 08:15:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCF46106566B; Mon, 28 Sep 2009 08:15:26 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC6248FC25; Mon, 28 Sep 2009 08:15:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S8FQxu048191; Mon, 28 Sep 2009 08:15:26 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S8FQqB048189; Mon, 28 Sep 2009 08:15:26 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280815.n8S8FQqB048189@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 08:15: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: r197572 - head/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: Mon, 28 Sep 2009 08:15:27 -0000 Author: thompsa Date: Mon Sep 28 08:15:26 2009 New Revision: 197572 URL: http://svn.freebsd.org/changeset/base/197572 Log: Add new FTDI IDs. Submitted by: Maks Verver, Arrigo Marchiori Modified: head/sys/dev/usb/serial/uftdi.c Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Mon Sep 28 08:14:15 2009 (r197571) +++ head/sys/dev/usb/serial/uftdi.c Mon Sep 28 08:15:26 2009 (r197572) @@ -243,10 +243,13 @@ static struct usb_device_id uftdi_devs[] {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_PCMSFU, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_EMCU2H, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_MAXSTREAM, UFTDI_TYPE_8U232AM)}, + {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_CTI_USB_NANO_485, UFTDI_TYPE_8U232AM)}, + {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_CTI_USB_MINI_485, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_SIIG2, USB_PRODUCT_SIIG2_US2308, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_INTREPIDCS, USB_PRODUCT_INTREPIDCS_VALUECAN, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_INTREPIDCS, USB_PRODUCT_INTREPIDCS_NEOVI, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_BBELECTRONICS, USB_PRODUCT_BBELECTRONICS_USOTL4, UFTDI_TYPE_8U232AM)}, + {USB_VPI(USB_VENDOR_MARVELL, USB_PRODUCT_MARVELL_SHEEVAPLUG, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_PCOPRS1, UFTDI_TYPE_8U232AM)}, }; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 08:18:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55C55106566B; Mon, 28 Sep 2009 08:18:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 450888FC08; Mon, 28 Sep 2009 08:18:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S8IE3w048278; Mon, 28 Sep 2009 08:18:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S8IEFv048276; Mon, 28 Sep 2009 08:18:14 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200909280818.n8S8IEFv048276@svn.freebsd.org> From: Andrew Thompson Date: Mon, 28 Sep 2009 08:18: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: r197573 - head/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: Mon, 28 Sep 2009 08:18:15 -0000 Author: thompsa Date: Mon Sep 28 08:18:14 2009 New Revision: 197573 URL: http://svn.freebsd.org/changeset/base/197573 Log: Add back endpoint swap detection that was disabled in an earlier driver conversion. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/serial/umct.c Modified: head/sys/dev/usb/serial/umct.c ============================================================================== --- head/sys/dev/usb/serial/umct.c Mon Sep 28 08:15:26 2009 (r197572) +++ head/sys/dev/usb/serial/umct.c Mon Sep 28 08:18:14 2009 (r197573) @@ -115,6 +115,7 @@ struct umct_softc { uint8_t sc_lcr; uint8_t sc_mcr; uint8_t sc_iface_no; + uint8_t sc_swap_cb; uint8_t sc_name[16]; }; @@ -125,8 +126,10 @@ static device_attach_t umct_attach; static device_detach_t umct_detach; static usb_callback_t umct_intr_callback; -static usb_callback_t umct_write_callback; +static usb_callback_t umct_intr_callback_sub; static usb_callback_t umct_read_callback; +static usb_callback_t umct_read_callback_sub; +static usb_callback_t umct_write_callback; static void umct_cfg_do_request(struct umct_softc *sc, uint8_t request, uint16_t len, uint32_t value); @@ -240,7 +243,7 @@ umct_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); struct umct_softc *sc = device_get_softc(dev); int32_t error; - //uint16_t maxp; + uint16_t maxp; uint8_t iface_index; sc->sc_udev = uaa->device; @@ -263,13 +266,13 @@ umct_attach(device_t dev) "transfers failed!\n"); goto detach; } + /* * The real bulk-in endpoint is also marked as an interrupt. * The only way to differentiate it from the real interrupt * endpoint is to look at the wMaxPacketSize field. */ -#ifdef XXX - maxp = UGETW(sc->sc_xfer[UMCT_BULK_DT_RD]->endpoint->edesc->wMaxPacketSize); + maxp = usbd_xfer_max_framelen(sc->sc_xfer[UMCT_BULK_DT_RD]); if (maxp == 0x2) { /* guessed wrong - switch around endpoints */ @@ -278,11 +281,9 @@ umct_attach(device_t dev) sc->sc_xfer[UMCT_INTR_DT_RD] = sc->sc_xfer[UMCT_BULK_DT_RD]; sc->sc_xfer[UMCT_BULK_DT_RD] = temp; - - sc->sc_xfer[UMCT_BULK_DT_RD]->callback = &umct_read_callback; - sc->sc_xfer[UMCT_INTR_DT_RD]->callback = &umct_intr_callback; + sc->sc_swap_cb = 1; } -#endif + sc->sc_obufsize = usbd_xfer_max_len(sc->sc_xfer[UMCT_BULK_DT_WR]); if (uaa->info.idProduct == USB_PRODUCT_MCT_SITECOM_USB232) { @@ -342,7 +343,7 @@ umct_cfg_do_request(struct umct_softc *s } static void -umct_intr_callback(struct usb_xfer *xfer, usb_error_t error) +umct_intr_callback_sub(struct usb_xfer *xfer, usb_error_t error) { struct umct_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; @@ -547,6 +548,28 @@ umct_stop_write(struct ucom_softc *ucom) } static void +umct_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct umct_softc *sc = usbd_xfer_softc(xfer); + + if (sc->sc_swap_cb) + umct_intr_callback_sub(xfer, error); + else + umct_read_callback_sub(xfer, error); +} + +static void +umct_intr_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct umct_softc *sc = usbd_xfer_softc(xfer); + + if (sc->sc_swap_cb) + umct_read_callback_sub(xfer, error); + else + umct_intr_callback_sub(xfer, error); +} + +static void umct_write_callback(struct usb_xfer *xfer, usb_error_t error) { struct umct_softc *sc = usbd_xfer_softc(xfer); @@ -577,7 +600,7 @@ tr_setup: } static void -umct_read_callback(struct usb_xfer *xfer, usb_error_t error) +umct_read_callback_sub(struct usb_xfer *xfer, usb_error_t error) { struct umct_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 09:49:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11B1F1065672; Mon, 28 Sep 2009 09:49:49 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBB528FC1E; Mon, 28 Sep 2009 09:49:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8S9nmcK050122; Mon, 28 Sep 2009 09:49:48 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8S9nmEB050120; Mon, 28 Sep 2009 09:49:48 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200909280949.n8S9nmEB050120@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 28 Sep 2009 09:49: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: r197574 - 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: Mon, 28 Sep 2009 09:49:50 -0000 Author: ru Date: Mon Sep 28 09:49:48 2009 New Revision: 197574 URL: http://svn.freebsd.org/changeset/base/197574 Log: Fixed a markup bug. Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Sep 28 08:18:14 2009 (r197573) +++ head/share/man/man5/rc.conf.5 Mon Sep 28 09:49:48 2009 (r197574) @@ -393,7 +393,7 @@ variable for interface .Ar iface only. .It Va synchronous_dhclient -.Pq Bt bool +.Pq Vt bool Set to .Dq Li YES to start From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 10:22:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F5311065672; Mon, 28 Sep 2009 10:22:46 +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 4DFB78FC1B; Mon, 28 Sep 2009 10:22:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SAMkaA050788; Mon, 28 Sep 2009 10:22:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SAMkof050786; Mon, 28 Sep 2009 10:22:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909281022.n8SAMkof050786@svn.freebsd.org> From: Xin LI Date: Mon, 28 Sep 2009 10:22: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: r197575 - 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, 28 Sep 2009 10:22:46 -0000 Author: delphij Date: Mon Sep 28 10:22:46 2009 New Revision: 197575 URL: http://svn.freebsd.org/changeset/base/197575 Log: Use correct sizeof() object for klist 'list'. Currently, struct klist contained only SLIST_HEAD as its member, thus sizeof(struct klist) would equal to sizeof(struct klist *), so this change makes the code more correct in terms of semantics, but should be a no-op to compiler at this time. Reported by: MQ Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Mon Sep 28 09:49:48 2009 (r197574) +++ head/sys/kern/kern_event.c Mon Sep 28 10:22:46 2009 (r197575) @@ -1229,7 +1229,7 @@ kqueue_expand(struct kqueue *kq, struct size = kq->kq_knlistsize; while (size <= fd) size += KQEXTENT; - list = malloc(size * sizeof list, M_KQUEUE, mflag); + list = malloc(size * sizeof(*list), M_KQUEUE, mflag); if (list == NULL) return ENOMEM; KQ_LOCK(kq); @@ -1239,13 +1239,13 @@ kqueue_expand(struct kqueue *kq, struct } else { if (kq->kq_knlist != NULL) { bcopy(kq->kq_knlist, list, - kq->kq_knlistsize * sizeof list); + kq->kq_knlistsize * sizeof(*list)); free(kq->kq_knlist, M_KQUEUE); kq->kq_knlist = NULL; } bzero((caddr_t)list + - kq->kq_knlistsize * sizeof list, - (size - kq->kq_knlistsize) * sizeof list); + kq->kq_knlistsize * sizeof(*list), + (size - kq->kq_knlistsize) * sizeof(*list)); kq->kq_knlistsize = size; kq->kq_knlist = list; } From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 11:31:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75DC7106566C; Mon, 28 Sep 2009 11:31: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 47F7B8FC12; Mon, 28 Sep 2009 11:31:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SBVMIb053068; Mon, 28 Sep 2009 11:31:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SBVMv9053065; Mon, 28 Sep 2009 11:31:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909281131.n8SBVMv9053065@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Sep 2009 11:31: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: r197576 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci 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, 28 Sep 2009 11:31:22 -0000 Author: kib Date: Mon Sep 28 11:31:21 2009 New Revision: 197576 URL: http://svn.freebsd.org/changeset/base/197576 Log: MFC r197390: Remove forward_roundrobin(). Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/subr_smp.c stable/8/sys/sys/smp.h Modified: stable/8/sys/kern/subr_smp.c ============================================================================== --- stable/8/sys/kern/subr_smp.c Mon Sep 28 10:22:46 2009 (r197575) +++ stable/8/sys/kern/subr_smp.c Mon Sep 28 11:31:21 2009 (r197576) @@ -104,12 +104,6 @@ SYSCTL_INT(_kern_smp, OID_AUTO, forward_ &forward_signal_enabled, 0, "Forwarding of a signal to a process on a different CPU"); -/* Enable forwarding of roundrobin to all other cpus */ -static int forward_roundrobin_enabled = 1; -SYSCTL_INT(_kern_smp, OID_AUTO, forward_roundrobin_enabled, CTLFLAG_RW, - &forward_roundrobin_enabled, 0, - "Forwarding of roundrobin to all other CPUs"); - /* Variables needed for SMP rendezvous. */ static volatile int smp_rv_ncpus; static void (*volatile smp_rv_setup_func)(void *arg); @@ -189,33 +183,6 @@ forward_signal(struct thread *td) ipi_selected(1 << id, IPI_AST); } -void -forward_roundrobin(void) -{ - struct pcpu *pc; - struct thread *td; - cpumask_t id, map, me; - - CTR0(KTR_SMP, "forward_roundrobin()"); - - if (!smp_started || cold || panicstr) - return; - if (!forward_roundrobin_enabled) - return; - map = 0; - me = PCPU_GET(cpumask); - SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - td = pc->pc_curthread; - id = pc->pc_cpumask; - if (id != me && (id & stopped_cpus) == 0 && - !TD_IS_IDLETHREAD(td)) { - td->td_flags |= TDF_NEEDRESCHED; - map |= id; - } - } - ipi_selected(map, IPI_AST); -} - /* * When called the executing CPU will send an IPI to all other CPUs * requesting that they halt execution. Modified: stable/8/sys/sys/smp.h ============================================================================== --- stable/8/sys/sys/smp.h Mon Sep 28 10:22:46 2009 (r197575) +++ stable/8/sys/sys/smp.h Mon Sep 28 11:31:21 2009 (r197576) @@ -120,7 +120,6 @@ void cpu_mp_setmaxid(void); void cpu_mp_start(void); void forward_signal(struct thread *); -void forward_roundrobin(void); int restart_cpus(cpumask_t); int stop_cpus(cpumask_t); int stop_cpus_hard(cpumask_t); From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 15:10:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 770F4106566B; Mon, 28 Sep 2009 15:10:09 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64EA68FC17; Mon, 28 Sep 2009 15:10:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SFA9F7058134; Mon, 28 Sep 2009 15:10:09 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SFA9sx058132; Mon, 28 Sep 2009 15:10:09 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200909281510.n8SFA9sx058132@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 28 Sep 2009 15:10: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: r197577 - in stable/7/sys: . contrib/pf dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 15:10:09 -0000 Author: gallatin Date: Mon Sep 28 15:10:08 2009 New Revision: 197577 URL: http://svn.freebsd.org/changeset/base/197577 Log: MFC 197395: Improve mxge watchdog routine's ability to reliably reset a failed NIC Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/mxge/if_mxge.c Modified: stable/7/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Mon Sep 28 11:31:21 2009 (r197576) +++ stable/7/sys/dev/mxge/if_mxge.c Mon Sep 28 15:10:08 2009 (r197577) @@ -135,7 +135,7 @@ MODULE_DEPEND(mxge, zlib, 1, 1, 1); static int mxge_load_firmware(mxge_softc_t *sc, int adopt); static int mxge_send_cmd(mxge_softc_t *sc, uint32_t cmd, mxge_cmd_t *data); -static int mxge_close(mxge_softc_t *sc); +static int mxge_close(mxge_softc_t *sc, int down); static int mxge_open(mxge_softc_t *sc); static void mxge_tick(void *arg); @@ -1291,8 +1291,7 @@ mxge_reset(mxge_softc_t *sc, int interru ss->lro_queued = 0; ss->lro_flushed = 0; if (ss->fw_stats != NULL) { - ss->fw_stats->valid = 0; - ss->fw_stats->send_done_count = 0; + bzero(ss->fw_stats, sizeof *ss->fw_stats); } } sc->rdma_tags_available = 15; @@ -1365,7 +1364,7 @@ mxge_change_lro_locked(mxge_softc_t *sc, ifp->if_capenable |= IFCAP_LRO; sc->lro_cnt = lro_cnt; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); + mxge_close(sc, 0); err = mxge_open(sc); } return err; @@ -1481,6 +1480,10 @@ mxge_add_sysctls(mxge_softc_t *sc) "read_write_dma_MBs", CTLFLAG_RD, &sc->read_write_dma, 0, "DMA concurrent Read/Write speed in MB/s"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "watchdog_resets", + CTLFLAG_RD, &sc->watchdog_resets, + 0, "Number of times NIC was reset"); /* performance related tunables */ @@ -3377,28 +3380,29 @@ abort: } static int -mxge_close(mxge_softc_t *sc) +mxge_close(mxge_softc_t *sc, int down) { mxge_cmd_t cmd; int err, old_down_cnt; callout_stop(&sc->co_hdl); sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - old_down_cnt = sc->down_cnt; - mb(); - err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_DOWN, &cmd); - if (err) { - device_printf(sc->dev, "Couldn't bring down link\n"); - } - if (old_down_cnt == sc->down_cnt) { - /* wait for down irq */ - DELAY(10 * sc->intr_coal_delay); - } - mb(); - if (old_down_cnt == sc->down_cnt) { - device_printf(sc->dev, "never got down irq\n"); + if (!down) { + old_down_cnt = sc->down_cnt; + mb(); + err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_DOWN, &cmd); + if (err) { + device_printf(sc->dev, "Couldn't bring down link\n"); + } + if (old_down_cnt == sc->down_cnt) { + /* wait for down irq */ + DELAY(10 * sc->intr_coal_delay); + } + mb(); + if (old_down_cnt == sc->down_cnt) { + device_printf(sc->dev, "never got down irq\n"); + } } - mxge_free_mbufs(sc); return 0; @@ -3451,7 +3455,8 @@ static int mxge_watchdog_reset(mxge_softc_t *sc) { struct pci_devinfo *dinfo; - int err; + struct mxge_slice_state *ss; + int err, running, s, num_tx_slices = 1; uint32_t reboot; uint16_t cmd; @@ -3485,6 +3490,30 @@ mxge_watchdog_reset(mxge_softc_t *sc) reboot = mxge_read_reboot(sc); device_printf(sc->dev, "NIC rebooted, status = 0x%x\n", reboot); + running = sc->ifp->if_drv_flags & IFF_DRV_RUNNING; + if (running) { + + /* + * quiesce NIC so that TX routines will not try to + * xmit after restoration of BAR + */ + + /* Mark the link as down */ + if (sc->link_state) { + sc->link_state = 0; + if_link_state_change(sc->ifp, + LINK_STATE_DOWN); + } +#ifdef IFNET_BUF_RING + num_tx_slices = sc->num_slices; +#endif + /* grab all TX locks to ensure no tx */ + for (s = 0; s < num_tx_slices; s++) { + ss = &sc->ss[s]; + mtx_lock(&ss->tx.mtx); + } + mxge_close(sc, 1); + } /* restore PCI configuration space */ dinfo = device_get_ivars(sc->dev); pci_cfg_restore(sc->dev, dinfo); @@ -3492,10 +3521,22 @@ mxge_watchdog_reset(mxge_softc_t *sc) /* and redo any changes we made to our config space */ mxge_setup_cfg_space(sc); - if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); - err = mxge_open(sc); + /* reload f/w */ + err = mxge_load_firmware(sc, 0); + if (err) { + device_printf(sc->dev, + "Unable to re-load f/w\n"); } + if (running) { + if (!err) + err = mxge_open(sc); + /* release all TX locks */ + for (s = 0; s < num_tx_slices; s++) { + ss = &sc->ss[s]; + mtx_unlock(&ss->tx.mtx); + } + } + sc->watchdog_resets++; } else { device_printf(sc->dev, "NIC did not reboot, ring state:\n"); device_printf(sc->dev, "tx.req=%d tx.done=%d\n", @@ -3505,6 +3546,9 @@ mxge_watchdog_reset(mxge_softc_t *sc) be32toh(sc->ss->fw_stats->send_done_count)); device_printf(sc->dev, "not resetting\n"); } + if (err) + device_printf(sc->dev, "watchdog reset failed\n"); + return (err); } @@ -3590,11 +3634,11 @@ mxge_change_mtu(mxge_softc_t *sc, int mt old_mtu = ifp->if_mtu; ifp->if_mtu = mtu; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); + mxge_close(sc, 0); err = mxge_open(sc); if (err != 0) { ifp->if_mtu = old_mtu; - mxge_close(sc); + mxge_close(sc, 0); (void) mxge_open(sc); } } @@ -3648,7 +3692,7 @@ mxge_ioctl(struct ifnet *ifp, u_long com } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); + mxge_close(sc, 0); } } mtx_unlock(&sc->driver_mtx); @@ -4345,7 +4389,7 @@ mxge_detach(device_t dev) } mtx_lock(&sc->driver_mtx); if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) - mxge_close(sc); + mxge_close(sc, 0); mtx_unlock(&sc->driver_mtx); ether_ifdetach(sc->ifp); callout_drain(&sc->co_hdl); From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 15:11:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAD4C106566C; Mon, 28 Sep 2009 15:11:49 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 982EE8FC13; Mon, 28 Sep 2009 15:11:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SFBn0i058215; Mon, 28 Sep 2009 15:11:49 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SFBn7B058213; Mon, 28 Sep 2009 15:11:49 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200909281511.n8SFBn7B058213@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 28 Sep 2009 15:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197578 - in stable/6/sys: . conf contrib/pf dev/cxgb dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 15:11:49 -0000 Author: gallatin Date: Mon Sep 28 15:11:49 2009 New Revision: 197578 URL: http://svn.freebsd.org/changeset/base/197578 Log: MFC 197395: Improve mxge watchdog routine's ability to reliably reset a failed NIC Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/dev/mxge/if_mxge.c Modified: stable/6/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/6/sys/dev/mxge/if_mxge.c Mon Sep 28 15:10:08 2009 (r197577) +++ stable/6/sys/dev/mxge/if_mxge.c Mon Sep 28 15:11:49 2009 (r197578) @@ -135,7 +135,7 @@ MODULE_DEPEND(mxge, zlib, 1, 1, 1); static int mxge_load_firmware(mxge_softc_t *sc, int adopt); static int mxge_send_cmd(mxge_softc_t *sc, uint32_t cmd, mxge_cmd_t *data); -static int mxge_close(mxge_softc_t *sc); +static int mxge_close(mxge_softc_t *sc, int down); static int mxge_open(mxge_softc_t *sc); static void mxge_tick(void *arg); @@ -1291,8 +1291,7 @@ mxge_reset(mxge_softc_t *sc, int interru ss->lro_queued = 0; ss->lro_flushed = 0; if (ss->fw_stats != NULL) { - ss->fw_stats->valid = 0; - ss->fw_stats->send_done_count = 0; + bzero(ss->fw_stats, sizeof *ss->fw_stats); } } sc->rdma_tags_available = 15; @@ -1365,7 +1364,7 @@ mxge_change_lro_locked(mxge_softc_t *sc, ifp->if_capenable |= IFCAP_LRO; sc->lro_cnt = lro_cnt; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); + mxge_close(sc, 0); err = mxge_open(sc); } return err; @@ -1481,6 +1480,10 @@ mxge_add_sysctls(mxge_softc_t *sc) "read_write_dma_MBs", CTLFLAG_RD, &sc->read_write_dma, 0, "DMA concurrent Read/Write speed in MB/s"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "watchdog_resets", + CTLFLAG_RD, &sc->watchdog_resets, + 0, "Number of times NIC was reset"); /* performance related tunables */ @@ -3377,28 +3380,30 @@ abort: } static int -mxge_close(mxge_softc_t *sc) +mxge_close(mxge_softc_t *sc, int down) { mxge_cmd_t cmd; int err, old_down_cnt; callout_stop(&sc->co_hdl); sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - old_down_cnt = sc->down_cnt; - mb(); - err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_DOWN, &cmd); - if (err) { - device_printf(sc->dev, "Couldn't bring down link\n"); - } - if (old_down_cnt == sc->down_cnt) { - /* wait for down irq */ - DELAY(10 * sc->intr_coal_delay); - } - mb(); - if (old_down_cnt == sc->down_cnt) { - device_printf(sc->dev, "never got down irq\n"); + if (!down) { + old_down_cnt = sc->down_cnt; + mb(); + err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_DOWN, &cmd); + if (err) { + device_printf(sc->dev, + "Couldn't bring down link\n"); + } + if (old_down_cnt == sc->down_cnt) { + /* wait for down irq */ + DELAY(10 * sc->intr_coal_delay); + } + mb(); + if (old_down_cnt == sc->down_cnt) { + device_printf(sc->dev, "never got down irq\n"); + } } - mxge_free_mbufs(sc); return 0; @@ -3451,7 +3456,8 @@ static int mxge_watchdog_reset(mxge_softc_t *sc) { struct pci_devinfo *dinfo; - int err; + struct mxge_slice_state *ss; + int err, running, s, num_tx_slices = 1; uint32_t reboot; uint16_t cmd; @@ -3485,6 +3491,30 @@ mxge_watchdog_reset(mxge_softc_t *sc) reboot = mxge_read_reboot(sc); device_printf(sc->dev, "NIC rebooted, status = 0x%x\n", reboot); + running = sc->ifp->if_drv_flags & IFF_DRV_RUNNING; + if (running) { + + /* + * quiesce NIC so that TX routines will not try to + * xmit after restoration of BAR + */ + + /* Mark the link as down */ + if (sc->link_state) { + sc->link_state = 0; + if_link_state_change(sc->ifp, + LINK_STATE_DOWN); + } +#ifdef IFNET_BUF_RING + num_tx_slices = sc->num_slices; +#endif + /* grab all TX locks to ensure no tx */ + for (s = 0; s < num_tx_slices; s++) { + ss = &sc->ss[s]; + mtx_lock(&ss->tx.mtx); + } + mxge_close(sc, 1); + } /* restore PCI configuration space */ dinfo = device_get_ivars(sc->dev); pci_cfg_restore(sc->dev, dinfo); @@ -3492,10 +3522,22 @@ mxge_watchdog_reset(mxge_softc_t *sc) /* and redo any changes we made to our config space */ mxge_setup_cfg_space(sc); - if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); - err = mxge_open(sc); + /* reload f/w */ + err = mxge_load_firmware(sc, 0); + if (err) { + device_printf(sc->dev, + "Unable to re-load f/w\n"); } + if (running) { + if (!err) + err = mxge_open(sc); + /* release all TX locks */ + for (s = 0; s < num_tx_slices; s++) { + ss = &sc->ss[s]; + mtx_unlock(&ss->tx.mtx); + } + } + sc->watchdog_resets++; } else { device_printf(sc->dev, "NIC did not reboot, ring state:\n"); device_printf(sc->dev, "tx.req=%d tx.done=%d\n", @@ -3505,6 +3547,9 @@ mxge_watchdog_reset(mxge_softc_t *sc) be32toh(sc->ss->fw_stats->send_done_count)); device_printf(sc->dev, "not resetting\n"); } + if (err) + device_printf(sc->dev, "watchdog reset failed\n"); + return (err); } @@ -3590,11 +3635,11 @@ mxge_change_mtu(mxge_softc_t *sc, int mt old_mtu = ifp->if_mtu; ifp->if_mtu = mtu; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); + mxge_close(sc, 0); err = mxge_open(sc); if (err != 0) { ifp->if_mtu = old_mtu; - mxge_close(sc); + mxge_close(sc, 0); (void) mxge_open(sc); } } @@ -3648,7 +3693,7 @@ mxge_ioctl(struct ifnet *ifp, u_long com } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); + mxge_close(sc, 0); } } mtx_unlock(&sc->driver_mtx); @@ -4345,7 +4390,7 @@ mxge_detach(device_t dev) } mtx_lock(&sc->driver_mtx); if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) - mxge_close(sc); + mxge_close(sc, 0); mtx_unlock(&sc->driver_mtx); ether_ifdetach(sc->ifp); callout_drain(&sc->co_hdl); From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 16:59:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E0DA1065672; Mon, 28 Sep 2009 16:59:47 +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 8D06D8FC19; Mon, 28 Sep 2009 16:59:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SGxlNV060343; Mon, 28 Sep 2009 16:59:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SGxlR4060338; Mon, 28 Sep 2009 16:59:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200909281659.n8SGxlR4060338@svn.freebsd.org> From: Xin LI Date: Mon, 28 Sep 2009 16:59: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: r197579 - in head: lib/libc/sys sys/kern 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, 28 Sep 2009 16:59:47 -0000 Author: delphij Date: Mon Sep 28 16:59:47 2009 New Revision: 197579 URL: http://svn.freebsd.org/changeset/base/197579 Log: Add two new fcntls to enable/disable read-ahead: - F_READAHEAD: specify the amount for sequential access. The amount is specified in bytes and is rounded up to nearest block size. - F_RDAHEAD: Darwin compatible version that use 128KB as the sequential access size. A third argument of zero disables the read-ahead behavior. Please note that the read-ahead amount is also constrainted by sysctl variable, vfs.read_max, which may need to be raised in order to better utilize this feature. Thanks Igor Sysoev for proposing the feature and submitting the original version, and kib@ for his valuable comments. Submitted by: Igor Sysoev Reviewed by: kib@ MFC after: 1 month Modified: head/lib/libc/sys/fcntl.2 head/sys/kern/kern_descrip.c head/sys/kern/vfs_vnops.c head/sys/sys/fcntl.h Modified: head/lib/libc/sys/fcntl.2 ============================================================================== --- head/lib/libc/sys/fcntl.2 Mon Sep 28 15:11:49 2009 (r197578) +++ head/lib/libc/sys/fcntl.2 Mon Sep 28 16:59:47 2009 (r197579) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd March 8, 2008 +.Dd September 28, 2009 .Dt FCNTL 2 .Os .Sh NAME @@ -241,6 +241,22 @@ will be interrupted if the signal handle .Dv SA_RESTART (see .Xr sigaction 2 ) . +.It Dv F_READAHEAD +Set or clear the read ahead amount for sequential access to the third +argument, +.Fa arg , +which is rounded up to the nearest block size. +A zero value in +.Fa arg +turns off read ahead. +.It Dv F_RDAHEAD +Equivalent to Darwin counterpart which sets read ahead amount of 128KB +when the third argument, +.Fa arg +is non-zero. +A zero value in +.Fa arg +turns off read ahead. .El .Pp When a shared lock has been set on a segment of a file, Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Sep 28 15:11:49 2009 (r197578) +++ head/sys/kern/kern_descrip.c Mon Sep 28 16:59:47 2009 (r197579) @@ -421,6 +421,8 @@ kern_fcntl(struct thread *td, int fd, in struct vnode *vp; int error, flg, tmp; int vfslocked; + u_int old, new; + uint64_t bsize; vfslocked = 0; error = 0; @@ -686,6 +688,48 @@ kern_fcntl(struct thread *td, int fd, in vfslocked = 0; fdrop(fp, td); break; + + case F_RDAHEAD: + arg = arg ? 128 * 1024: 0; + /* FALLTHROUGH */ + case F_READAHEAD: + FILEDESC_SLOCK(fdp); + if ((fp = fdtofp(fd, fdp)) == NULL) { + FILEDESC_SUNLOCK(fdp); + error = EBADF; + break; + } + if (fp->f_type != DTYPE_VNODE) { + FILEDESC_SUNLOCK(fdp); + error = EBADF; + break; + } + fhold(fp); + FILEDESC_SUNLOCK(fdp); + if (arg != 0) { + vp = fp->f_vnode; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + error = vn_lock(vp, LK_SHARED); + if (error != 0) + goto readahead_vnlock_fail; + bsize = fp->f_vnode->v_mount->mnt_stat.f_iosize; + VOP_UNLOCK(vp, 0); + fp->f_seqcount = (arg + bsize - 1) / bsize; + do { + new = old = fp->f_flag; + new |= FRDAHEAD; + } while (atomic_cmpset_rel_int(&fp->f_flag, old, new) == 0); +readahead_vnlock_fail: + VFS_UNLOCK_GIANT(vfslocked); + } else { + do { + new = old = fp->f_flag; + new &= ~FRDAHEAD; + } while (atomic_cmpset_rel_int(&fp->f_flag, old, new) == 0); + } + fdrop(fp, td); + break; + default: error = EINVAL; break; Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Sep 28 15:11:49 2009 (r197578) +++ head/sys/kern/vfs_vnops.c Mon Sep 28 16:59:47 2009 (r197579) @@ -312,6 +312,9 @@ static int sequential_heuristic(struct uio *uio, struct file *fp) { + if (atomic_load_acq_int(&(fp->f_flag)) & FRDAHEAD) + return (fp->f_seqcount << IO_SEQSHIFT); + /* * Offset 0 is handled specially. open() sets f_seqcount to 1 so * that the first I/O is normally considered to be slightly Modified: head/sys/sys/fcntl.h ============================================================================== --- head/sys/sys/fcntl.h Mon Sep 28 15:11:49 2009 (r197578) +++ head/sys/sys/fcntl.h Mon Sep 28 16:59:47 2009 (r197579) @@ -140,7 +140,7 @@ typedef __pid_t pid_t; /* bits to save after open */ #define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT|FEXEC) /* bits settable by fcntl(F_SETFL, ...) */ -#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT) +#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FRDAHEAD|O_DIRECT) #if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \ defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) @@ -151,7 +151,8 @@ typedef __pid_t pid_t; */ #define FPOSIXSHM O_NOFOLLOW #undef FCNTLFLAGS -#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|O_DIRECT) +#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|FRDAHEAD| \ + O_DIRECT) #endif #endif @@ -176,6 +177,8 @@ typedef __pid_t pid_t; * different meaning for fcntl(2). */ #if __BSD_VISIBLE +/* Read ahead */ +#define FRDAHEAD O_CREAT #endif /* Defined by POSIX Extended API Set Part 2 */ @@ -218,6 +221,8 @@ typedef __pid_t pid_t; #define F_SETLK 12 /* set record locking information */ #define F_SETLKW 13 /* F_SETLK; wait if blocked */ #define F_SETLK_REMOTE 14 /* debugging support for remote locks */ +#define F_READAHEAD 15 /* read ahead */ +#define F_RDAHEAD 16 /* Darwin compatible read ahead */ /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 17:10:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE3B3106566B; Mon, 28 Sep 2009 17:10:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE02D8FC13; Mon, 28 Sep 2009 17:10:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SHAR3B060583; Mon, 28 Sep 2009 17:10:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SHAR9V060581; Mon, 28 Sep 2009 17:10:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200909281710.n8SHAR9V060581@svn.freebsd.org> From: Alan Cox Date: Mon, 28 Sep 2009 17:10:27 +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: r197580 - 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: Mon, 28 Sep 2009 17:10:27 -0000 Author: alc Date: Mon Sep 28 17:10:27 2009 New Revision: 197580 URL: http://svn.freebsd.org/changeset/base/197580 Log: Temporarily disable the use of 1GB page mappings by the direct map. There are currently two problems with the use of 1GB page mappings by the direct map. First, at least one device driver uses pmap_extract() rather than DMAP_TO_PHYS() to translate a direct map address to a physical address. Unfortunately, neither pmap_extract() nor pmap_kextract() yet support 1GB page mappings. Second, pmap_bootstrap() needs to interrogate the MTRRs to ensure that a 1GB page mapping doesn't span two MTRRs of different types. Reported and tested by: Daniel O'Connor MFC after: 3 days Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 28 16:59:47 2009 (r197579) +++ head/sys/amd64/amd64/pmap.c Mon Sep 28 17:10:27 2009 (r197580) @@ -442,7 +442,7 @@ create_pagetables(vm_paddr_t *firstaddr) if (ndmpdp < 4) /* Minimum 4GB of dirmap */ ndmpdp = 4; DMPDPphys = allocpages(firstaddr, NDMPML4E); - if ((amd_feature & AMDID_PAGE1GB) == 0) + if (TRUE || (amd_feature & AMDID_PAGE1GB) == 0) DMPDphys = allocpages(firstaddr, ndmpdp); dmaplimit = (vm_paddr_t)ndmpdp << PDPSHIFT; @@ -476,7 +476,7 @@ create_pagetables(vm_paddr_t *firstaddr) /* Now set up the direct map space using either 2MB or 1GB pages */ /* Preset PG_M and PG_A because demotion expects it */ - if ((amd_feature & AMDID_PAGE1GB) == 0) { + if (TRUE || (amd_feature & AMDID_PAGE1GB) == 0) { for (i = 0; i < NPDEPG * ndmpdp; i++) { ((pd_entry_t *)DMPDphys)[i] = (vm_paddr_t)i << PDRSHIFT; ((pd_entry_t *)DMPDphys)[i] |= PG_RW | PG_V | PG_PS | From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 18:07:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 641FF1065692; Mon, 28 Sep 2009 18:07:16 +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 523C68FC14; Mon, 28 Sep 2009 18:07:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SI7Gsx061840; Mon, 28 Sep 2009 18:07:16 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SI7GiO061837; Mon, 28 Sep 2009 18:07:16 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200909281807.n8SI7GiO061837@svn.freebsd.org> From: Jamie Gritton Date: Mon, 28 Sep 2009 18:07: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: r197581 - in head/sys: kern rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 18:07:16 -0000 Author: jamie Date: Mon Sep 28 18:07:16 2009 New Revision: 197581 URL: http://svn.freebsd.org/changeset/base/197581 Log: Set the prison in NFS anon and GSS SVC creds. Reviewed by: marcel MFC after: 3 days Modified: head/sys/kern/vfs_export.c head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Mon Sep 28 17:10:27 2009 (r197580) +++ head/sys/kern/vfs_export.c Mon Sep 28 18:07:16 2009 (r197581) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -122,6 +123,8 @@ vfs_hang_addrlist(struct mount *mp, stru np->netc_anon->cr_uid = argp->ex_anon.cr_uid; crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, argp->ex_anon.cr_groups); + np->netc_anon->cr_prison = &prison0; + prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; bcopy(argp->ex_secflavors, np->netc_secflavors, sizeof(np->netc_secflavors)); @@ -206,6 +209,8 @@ vfs_hang_addrlist(struct mount *mp, stru np->netc_anon->cr_uid = argp->ex_anon.cr_uid; crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, np->netc_anon->cr_groups); + np->netc_anon->cr_prison = &prison0; + prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; bcopy(argp->ex_secflavors, np->netc_secflavors, sizeof(np->netc_secflavors)); Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 17:10:27 2009 (r197580) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:07:16 2009 (r197581) @@ -1,6 +1,11 @@ /*- - * Copyright (c) 2008 Doug Rabson - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,11 +15,14 @@ * 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. + * 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. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS 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) @@ -22,1465 +30,463 @@ * 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. - */ -/* - svc_rpcsec_gss.c - - Copyright (c) 2000 The Regents of the University of Michigan. - All rights reserved. - - Copyright (c) 2000 Dug Song . - All rights reserved, all wrongs reversed. - - 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 University 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 ``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 REGENTS 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. - - $Id: svc_auth_gss.c,v 1.27 2002/01/15 15:43:00 andros Exp $ + * + * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 */ #include __FBSDID("$FreeBSD$"); #include -#include +#include +#include #include #include -#include #include #include #include +#include #include -#include -#include -#include - -#include -#include - -#include "rpcsec_gss_int.h" - -static bool_t svc_rpc_gss_wrap(SVCAUTH *, struct mbuf **); -static bool_t svc_rpc_gss_unwrap(SVCAUTH *, struct mbuf **); -static void svc_rpc_gss_release(SVCAUTH *); -static enum auth_stat svc_rpc_gss(struct svc_req *, struct rpc_msg *); -static int rpc_gss_svc_getcred(struct svc_req *, struct ucred **, int *); - -static struct svc_auth_ops svc_auth_gss_ops = { - svc_rpc_gss_wrap, - svc_rpc_gss_unwrap, - svc_rpc_gss_release, -}; - -struct sx svc_rpc_gss_lock; - -struct svc_rpc_gss_callback { - SLIST_ENTRY(svc_rpc_gss_callback) cb_link; - rpc_gss_callback_t cb_callback; -}; -static SLIST_HEAD(svc_rpc_gss_callback_list, svc_rpc_gss_callback) - svc_rpc_gss_callbacks = SLIST_HEAD_INITIALIZER(&svc_rpc_gss_callbacks); - -struct svc_rpc_gss_svc_name { - SLIST_ENTRY(svc_rpc_gss_svc_name) sn_link; - char *sn_principal; - gss_OID sn_mech; - u_int sn_req_time; - gss_cred_id_t sn_cred; - u_int sn_program; - u_int sn_version; -}; -static SLIST_HEAD(svc_rpc_gss_svc_name_list, svc_rpc_gss_svc_name) - svc_rpc_gss_svc_names = SLIST_HEAD_INITIALIZER(&svc_rpc_gss_svc_names); +#include +#include +#include +#include +#include -enum svc_rpc_gss_client_state { - CLIENT_NEW, /* still authenticating */ - CLIENT_ESTABLISHED, /* context established */ - CLIENT_STALE /* garbage to collect */ -}; +#include -#define SVC_RPC_GSS_SEQWINDOW 128 +static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure"); -struct svc_rpc_gss_clientid { - unsigned long ci_hostid; - uint32_t ci_boottime; - uint32_t ci_id; -}; +static void vfs_free_addrlist(struct netexport *nep); +static int vfs_free_netcred(struct radix_node *rn, void *w); +static int vfs_hang_addrlist(struct mount *mp, struct netexport *nep, + struct export_args *argp); +static struct netcred *vfs_export_lookup(struct mount *, struct sockaddr *); -struct svc_rpc_gss_client { - TAILQ_ENTRY(svc_rpc_gss_client) cl_link; - TAILQ_ENTRY(svc_rpc_gss_client) cl_alllink; - volatile u_int cl_refs; - struct sx cl_lock; - struct svc_rpc_gss_clientid cl_id; - time_t cl_expiration; /* when to gc */ - enum svc_rpc_gss_client_state cl_state; /* client state */ - bool_t cl_locked; /* fixed service+qop */ - gss_ctx_id_t cl_ctx; /* context id */ - gss_cred_id_t cl_creds; /* delegated creds */ - gss_name_t cl_cname; /* client name */ - struct svc_rpc_gss_svc_name *cl_sname; /* server name used */ - rpc_gss_rawcred_t cl_rawcred; /* raw credentials */ - rpc_gss_ucred_t cl_ucred; /* unix-style credentials */ - struct ucred *cl_cred; /* kernel-style credentials */ - int cl_rpcflavor; /* RPC pseudo sec flavor */ - bool_t cl_done_callback; /* TRUE after call */ - void *cl_cookie; /* user cookie from callback */ - gid_t cl_gid_storage[NGROUPS]; - gss_OID cl_mech; /* mechanism */ - gss_qop_t cl_qop; /* quality of protection */ - uint32_t cl_seqlast; /* sequence window origin */ - uint32_t cl_seqmask[SVC_RPC_GSS_SEQWINDOW/32]; /* bitmask of seqnums */ +/* + * Network address lookup element + */ +struct netcred { + struct radix_node netc_rnodes[2]; + int netc_exflags; + struct ucred *netc_anon; + int netc_numsecflavors; + int netc_secflavors[MAXSECFLAVORS]; }; -TAILQ_HEAD(svc_rpc_gss_client_list, svc_rpc_gss_client); /* - * This structure holds enough information to unwrap arguments or wrap - * results for a given request. We use the rq_clntcred area for this - * (which is a per-request buffer). + * Network export information */ -struct svc_rpc_gss_cookedcred { - struct svc_rpc_gss_client *cc_client; - rpc_gss_service_t cc_service; - uint32_t cc_seq; +struct netexport { + struct netcred ne_defexported; /* Default export */ + struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */ }; -#define CLIENT_HASH_SIZE 256 -#define CLIENT_MAX 128 -struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; -struct svc_rpc_gss_client_list svc_rpc_gss_clients; -static size_t svc_rpc_gss_client_count; -static uint32_t svc_rpc_gss_next_clientid = 1; - -static void -svc_rpc_gss_init(void *arg) -{ - int i; - - for (i = 0; i < CLIENT_HASH_SIZE; i++) - TAILQ_INIT(&svc_rpc_gss_client_hash[i]); - TAILQ_INIT(&svc_rpc_gss_clients); - svc_auth_reg(RPCSEC_GSS, svc_rpc_gss, rpc_gss_svc_getcred); - sx_init(&svc_rpc_gss_lock, "gsslock"); -} -SYSINIT(svc_rpc_gss_init, SI_SUB_KMEM, SI_ORDER_ANY, svc_rpc_gss_init, NULL); - -bool_t -rpc_gss_set_callback(rpc_gss_callback_t *cb) -{ - struct svc_rpc_gss_callback *scb; - - scb = mem_alloc(sizeof(struct svc_rpc_gss_callback)); - if (!scb) { - _rpc_gss_set_error(RPC_GSS_ER_SYSTEMERROR, ENOMEM); - return (FALSE); - } - scb->cb_callback = *cb; - sx_xlock(&svc_rpc_gss_lock); - SLIST_INSERT_HEAD(&svc_rpc_gss_callbacks, scb, cb_link); - sx_xunlock(&svc_rpc_gss_lock); - - return (TRUE); -} - -void -rpc_gss_clear_callback(rpc_gss_callback_t *cb) -{ - struct svc_rpc_gss_callback *scb; - - sx_xlock(&svc_rpc_gss_lock); - SLIST_FOREACH(scb, &svc_rpc_gss_callbacks, cb_link) { - if (scb->cb_callback.program == cb->program - && scb->cb_callback.version == cb->version - && scb->cb_callback.callback == cb->callback) { - SLIST_REMOVE(&svc_rpc_gss_callbacks, scb, - svc_rpc_gss_callback, cb_link); - sx_xunlock(&svc_rpc_gss_lock); - mem_free(scb, sizeof(*scb)); - return; - } - } - sx_xunlock(&svc_rpc_gss_lock); -} - -static bool_t -rpc_gss_acquire_svc_cred(struct svc_rpc_gss_svc_name *sname) -{ - OM_uint32 maj_stat, min_stat; - gss_buffer_desc namebuf; - gss_name_t name; - gss_OID_set_desc oid_set; - - oid_set.count = 1; - oid_set.elements = sname->sn_mech; - - namebuf.value = (void *) sname->sn_principal; - namebuf.length = strlen(sname->sn_principal); - - maj_stat = gss_import_name(&min_stat, &namebuf, - GSS_C_NT_HOSTBASED_SERVICE, &name); - if (maj_stat != GSS_S_COMPLETE) - return (FALSE); - - if (sname->sn_cred != GSS_C_NO_CREDENTIAL) - gss_release_cred(&min_stat, &sname->sn_cred); - - maj_stat = gss_acquire_cred(&min_stat, name, - sname->sn_req_time, &oid_set, GSS_C_ACCEPT, &sname->sn_cred, - NULL, NULL); - if (maj_stat != GSS_S_COMPLETE) { - gss_release_name(&min_stat, &name); - return (FALSE); - } - gss_release_name(&min_stat, &name); - - return (TRUE); -} - -bool_t -rpc_gss_set_svc_name(const char *principal, const char *mechanism, - u_int req_time, u_int program, u_int version) -{ - struct svc_rpc_gss_svc_name *sname; - gss_OID mech_oid; - - if (!rpc_gss_mech_to_oid(mechanism, &mech_oid)) - return (FALSE); - - sname = mem_alloc(sizeof(*sname)); - if (!sname) - return (FALSE); - sname->sn_principal = strdup(principal, M_RPC); - sname->sn_mech = mech_oid; - sname->sn_req_time = req_time; - sname->sn_cred = GSS_C_NO_CREDENTIAL; - sname->sn_program = program; - sname->sn_version = version; - - if (!rpc_gss_acquire_svc_cred(sname)) { - free(sname->sn_principal, M_RPC); - mem_free(sname, sizeof(*sname)); - return (FALSE); - } - - sx_xlock(&svc_rpc_gss_lock); - SLIST_INSERT_HEAD(&svc_rpc_gss_svc_names, sname, sn_link); - sx_xunlock(&svc_rpc_gss_lock); - - return (TRUE); -} - -void -rpc_gss_clear_svc_name(u_int program, u_int version) -{ - OM_uint32 min_stat; - struct svc_rpc_gss_svc_name *sname; - - sx_xlock(&svc_rpc_gss_lock); - SLIST_FOREACH(sname, &svc_rpc_gss_svc_names, sn_link) { - if (sname->sn_program == program - && sname->sn_version == version) { - SLIST_REMOVE(&svc_rpc_gss_svc_names, sname, - svc_rpc_gss_svc_name, sn_link); - sx_xunlock(&svc_rpc_gss_lock); - gss_release_cred(&min_stat, &sname->sn_cred); - free(sname->sn_principal, M_RPC); - mem_free(sname, sizeof(*sname)); - return; - } - } - sx_xunlock(&svc_rpc_gss_lock); -} - -bool_t -rpc_gss_get_principal_name(rpc_gss_principal_t *principal, - const char *mech, const char *name, const char *node, const char *domain) -{ - OM_uint32 maj_stat, min_stat; - gss_OID mech_oid; - size_t namelen; - gss_buffer_desc buf; - gss_name_t gss_name, gss_mech_name; - rpc_gss_principal_t result; - - if (!rpc_gss_mech_to_oid(mech, &mech_oid)) - return (FALSE); - - /* - * Construct a gss_buffer containing the full name formatted - * as "name/node@domain" where node and domain are optional. - */ - namelen = strlen(name); - if (node) { - namelen += strlen(node) + 1; - } - if (domain) { - namelen += strlen(domain) + 1; - } - - buf.value = mem_alloc(namelen); - buf.length = namelen; - strcpy((char *) buf.value, name); - if (node) { - strcat((char *) buf.value, "/"); - strcat((char *) buf.value, node); - } - if (domain) { - strcat((char *) buf.value, "@"); - strcat((char *) buf.value, domain); - } - - /* - * Convert that to a gss_name_t and then convert that to a - * mechanism name in the selected mechanism. - */ - maj_stat = gss_import_name(&min_stat, &buf, - GSS_C_NT_USER_NAME, &gss_name); - mem_free(buf.value, buf.length); - if (maj_stat != GSS_S_COMPLETE) { - rpc_gss_log_status("gss_import_name", mech_oid, maj_stat, min_stat); - return (FALSE); - } - maj_stat = gss_canonicalize_name(&min_stat, gss_name, mech_oid, - &gss_mech_name); - if (maj_stat != GSS_S_COMPLETE) { - rpc_gss_log_status("gss_canonicalize_name", mech_oid, maj_stat, - min_stat); - gss_release_name(&min_stat, &gss_name); - return (FALSE); - } - gss_release_name(&min_stat, &gss_name); - - /* - * Export the mechanism name and use that to construct the - * rpc_gss_principal_t result. - */ - maj_stat = gss_export_name(&min_stat, gss_mech_name, &buf); - if (maj_stat != GSS_S_COMPLETE) { - rpc_gss_log_status("gss_export_name", mech_oid, maj_stat, min_stat); - gss_release_name(&min_stat, &gss_mech_name); - return (FALSE); - } - gss_release_name(&min_stat, &gss_mech_name); - - result = mem_alloc(sizeof(int) + buf.length); - if (!result) { - gss_release_buffer(&min_stat, &buf); - return (FALSE); - } - result->len = buf.length; - memcpy(result->name, buf.value, buf.length); - gss_release_buffer(&min_stat, &buf); - - *principal = result; - return (TRUE); -} - -bool_t -rpc_gss_getcred(struct svc_req *req, rpc_gss_rawcred_t **rcred, - rpc_gss_ucred_t **ucred, void **cookie) -{ - struct svc_rpc_gss_cookedcred *cc; - struct svc_rpc_gss_client *client; - - if (req->rq_cred.oa_flavor != RPCSEC_GSS) - return (FALSE); - - cc = req->rq_clntcred; - client = cc->cc_client; - if (rcred) - *rcred = &client->cl_rawcred; - if (ucred) - *ucred = &client->cl_ucred; - if (cookie) - *cookie = client->cl_cookie; - return (TRUE); -} - /* - * This simpler interface is used by svc_getcred to copy the cred data - * into a kernel cred structure. + * Build hash lists of net addresses and hang them off the mount point. + * Called by vfs_export() to set up the lists of export addresses. */ static int -rpc_gss_svc_getcred(struct svc_req *req, struct ucred **crp, int *flavorp) +vfs_hang_addrlist(struct mount *mp, struct netexport *nep, + struct export_args *argp) { - struct ucred *cr; - struct svc_rpc_gss_cookedcred *cc; - struct svc_rpc_gss_client *client; - rpc_gss_ucred_t *uc; - - if (req->rq_cred.oa_flavor != RPCSEC_GSS) - return (FALSE); - - cc = req->rq_clntcred; - client = cc->cc_client; - - if (flavorp) - *flavorp = client->cl_rpcflavor; - - if (client->cl_cred) { - *crp = crhold(client->cl_cred); - return (TRUE); - } - - uc = &client->cl_ucred; - cr = client->cl_cred = crget(); - cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; - cr->cr_rgid = cr->cr_svgid = uc->gid; - crsetgroups(cr, uc->gidlen, uc->gidlist); - *crp = crhold(cr); - - return (TRUE); -} - -int -rpc_gss_svc_max_data_length(struct svc_req *req, int max_tp_unit_len) -{ - struct svc_rpc_gss_cookedcred *cc = req->rq_clntcred; - struct svc_rpc_gss_client *client = cc->cc_client; - int want_conf; - OM_uint32 max; - OM_uint32 maj_stat, min_stat; - int result; - - switch (client->cl_rawcred.service) { - case rpc_gss_svc_none: - return (max_tp_unit_len); - break; - - case rpc_gss_svc_default: - case rpc_gss_svc_integrity: - want_conf = FALSE; - break; - - case rpc_gss_svc_privacy: - want_conf = TRUE; - break; - - default: + register struct netcred *np; + register struct radix_node_head *rnh; + register int i; + struct radix_node *rn; + struct sockaddr *saddr, *smask = 0; + struct domain *dom; + int error; + + /* + * XXX: This routine converts from a `struct xucred' + * (argp->ex_anon) to a `struct ucred' (np->netc_anon). This + * operation is questionable; for example, what should be done + * with fields like cr_uidinfo and cr_prison? Currently, this + * routine does not touch them (leaves them as NULL). + */ + if (argp->ex_anon.cr_version != XUCRED_VERSION) { + vfs_mount_error(mp, "ex_anon.cr_version: %d != %d", + argp->ex_anon.cr_version, XUCRED_VERSION); + return (EINVAL); + } + + if (argp->ex_addrlen == 0) { + if (mp->mnt_flag & MNT_DEFEXPORTED) { + vfs_mount_error(mp, + "MNT_DEFEXPORTED already set for mount %p", mp); + return (EPERM); + } + np = &nep->ne_defexported; + np->netc_exflags = argp->ex_flags; + np->netc_anon = crget(); + np->netc_anon->cr_uid = argp->ex_anon.cr_uid; + crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, + argp->ex_anon.cr_groups); + np->netc_anon->cr_prison = &prison0; + prison_hold(np->netc_anon->cr_prison); + np->netc_numsecflavors = argp->ex_numsecflavors; + bcopy(argp->ex_secflavors, np->netc_secflavors, + sizeof(np->netc_secflavors)); + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_DEFEXPORTED; + MNT_IUNLOCK(mp); return (0); } - maj_stat = gss_wrap_size_limit(&min_stat, client->cl_ctx, want_conf, - client->cl_qop, max_tp_unit_len, &max); - - if (maj_stat == GSS_S_COMPLETE) { - result = (int) max; - if (result < 0) - result = 0; - return (result); - } else { - rpc_gss_log_status("gss_wrap_size_limit", client->cl_mech, - maj_stat, min_stat); - return (0); +#if MSIZE <= 256 + if (argp->ex_addrlen > MLEN) { + vfs_mount_error(mp, "ex_addrlen %d is greater than %d", + argp->ex_addrlen, MLEN); + return (EINVAL); } -} - -static struct svc_rpc_gss_client * -svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *id) -{ - struct svc_rpc_gss_client *client; - struct svc_rpc_gss_client_list *list; - unsigned long hostid; - - rpc_gss_log_debug("in svc_rpc_gss_find_client(%d)", id->ci_id); - - getcredhostid(curthread->td_ucred, &hostid); - if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) - return (NULL); +#endif - list = &svc_rpc_gss_client_hash[id->ci_id % CLIENT_HASH_SIZE]; - sx_xlock(&svc_rpc_gss_lock); - TAILQ_FOREACH(client, list, cl_link) { - if (client->cl_id.ci_id == id->ci_id) { - /* - * Move this client to the front of the LRU - * list. - */ - TAILQ_REMOVE(&svc_rpc_gss_clients, client, cl_alllink); - TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, - cl_alllink); - refcount_acquire(&client->cl_refs); - break; + i = sizeof(struct netcred) + argp->ex_addrlen + argp->ex_masklen; + np = (struct netcred *) malloc(i, M_NETADDR, M_WAITOK | M_ZERO); + saddr = (struct sockaddr *) (np + 1); + if ((error = copyin(argp->ex_addr, saddr, argp->ex_addrlen))) + goto out; + if (saddr->sa_family == AF_UNSPEC || saddr->sa_family > AF_MAX) { + error = EINVAL; + vfs_mount_error(mp, "Invalid saddr->sa_family: %d"); + goto out; + } + if (saddr->sa_len > argp->ex_addrlen) + saddr->sa_len = argp->ex_addrlen; + if (argp->ex_masklen) { + smask = (struct sockaddr *)((caddr_t)saddr + argp->ex_addrlen); + error = copyin(argp->ex_mask, smask, argp->ex_masklen); + if (error) + goto out; + if (smask->sa_len > argp->ex_masklen) + smask->sa_len = argp->ex_masklen; + } + i = saddr->sa_family; + if ((rnh = nep->ne_rtable[i]) == NULL) { + /* + * Seems silly to initialize every AF when most are not used, + * do so on demand here + */ + for (dom = domains; dom; dom = dom->dom_next) { + KASSERT(((i == AF_INET) || (i == AF_INET6)), + ("unexpected protocol in vfs_hang_addrlist")); + if (dom->dom_family == i && dom->dom_rtattach) { + /* + * XXX MRT + * The INET and INET6 domains know the + * offset already. We don't need to send it + * So we just use it as a flag to say that + * we are or are not setting up a real routing + * table. Only IP and IPV6 need have this + * be 0 so all other protocols can stay the + * same (ABI compatible). + */ + dom->dom_rtattach( + (void **) &nep->ne_rtable[i], 0); + break; + } + } + if ((rnh = nep->ne_rtable[i]) == NULL) { + error = ENOBUFS; + vfs_mount_error(mp, "%s %s %d", + "Unable to initialize radix node head ", + "for address family", i); + goto out; } } - sx_xunlock(&svc_rpc_gss_lock); - - return (client); + RADIX_NODE_HEAD_LOCK(rnh); + rn = (*rnh->rnh_addaddr)(saddr, smask, rnh, np->netc_rnodes); + RADIX_NODE_HEAD_UNLOCK(rnh); + if (rn == NULL || np != (struct netcred *)rn) { /* already exists */ + error = EPERM; + vfs_mount_error(mp, "Invalid radix node head, rn: %p %p", + rn, np); + goto out; + } + np->netc_exflags = argp->ex_flags; + np->netc_anon = crget(); + np->netc_anon->cr_uid = argp->ex_anon.cr_uid; + crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, + np->netc_anon->cr_groups); + np->netc_anon->cr_prison = &prison0; + prison_hold(np->netc_anon->cr_prison); + np->netc_numsecflavors = argp->ex_numsecflavors; + bcopy(argp->ex_secflavors, np->netc_secflavors, + sizeof(np->netc_secflavors)); + return (0); +out: + free(np, M_NETADDR); + return (error); } -static struct svc_rpc_gss_client * -svc_rpc_gss_create_client(void) +/* Helper for vfs_free_addrlist. */ +/* ARGSUSED */ +static int +vfs_free_netcred(struct radix_node *rn, void *w) { - struct svc_rpc_gss_client *client; - struct svc_rpc_gss_client_list *list; - unsigned long hostid; - - rpc_gss_log_debug("in svc_rpc_gss_create_client()"); - - client = mem_alloc(sizeof(struct svc_rpc_gss_client)); - memset(client, 0, sizeof(struct svc_rpc_gss_client)); - refcount_init(&client->cl_refs, 1); - sx_init(&client->cl_lock, "GSS-client"); - getcredhostid(curthread->td_ucred, &hostid); - client->cl_id.ci_hostid = hostid; - client->cl_id.ci_boottime = boottime.tv_sec; - client->cl_id.ci_id = svc_rpc_gss_next_clientid++; - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; - sx_xlock(&svc_rpc_gss_lock); - TAILQ_INSERT_HEAD(list, client, cl_link); - TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink); - svc_rpc_gss_client_count++; - sx_xunlock(&svc_rpc_gss_lock); + struct radix_node_head *rnh = (struct radix_node_head *) w; + struct ucred *cred; - /* - * Start the client off with a short expiration time. We will - * try to get a saner value from the client creds later. - */ - client->cl_state = CLIENT_NEW; - client->cl_locked = FALSE; - client->cl_expiration = time_uptime + 5*60; - - return (client); -} - -static void -svc_rpc_gss_destroy_client(struct svc_rpc_gss_client *client) -{ - OM_uint32 min_stat; - - rpc_gss_log_debug("in svc_rpc_gss_destroy_client()"); - - if (client->cl_ctx) - gss_delete_sec_context(&min_stat, - &client->cl_ctx, GSS_C_NO_BUFFER); - - if (client->cl_cname) - gss_release_name(&min_stat, &client->cl_cname); - - if (client->cl_rawcred.client_principal) - mem_free(client->cl_rawcred.client_principal, - sizeof(*client->cl_rawcred.client_principal) - + client->cl_rawcred.client_principal->len); - - if (client->cl_cred) - crfree(client->cl_cred); - - sx_destroy(&client->cl_lock); - mem_free(client, sizeof(*client)); + (*rnh->rnh_deladdr) (rn->rn_key, rn->rn_mask, rnh); + cred = ((struct netcred *)rn)->netc_anon; + if (cred != NULL) + crfree(cred); + free(rn, M_NETADDR); + return (0); } /* - * Drop a reference to a client and free it if that was the last reference. + * Free the net address hash lists that are hanging off the mount points. */ static void -svc_rpc_gss_release_client(struct svc_rpc_gss_client *client) +vfs_free_addrlist(struct netexport *nep) { + int i; + struct radix_node_head *rnh; + struct ucred *cred; + + for (i = 0; i <= AF_MAX; i++) { + if ((rnh = nep->ne_rtable[i])) { + RADIX_NODE_HEAD_LOCK(rnh); + (*rnh->rnh_walktree) (rnh, vfs_free_netcred, rnh); + RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_DESTROY(rnh); + free(rnh, M_RTABLE); + nep->ne_rtable[i] = NULL; /* not SMP safe XXX */ + } + } + cred = nep->ne_defexported.netc_anon; + if (cred != NULL) + crfree(cred); - if (!refcount_release(&client->cl_refs)) - return; - svc_rpc_gss_destroy_client(client); } /* - * Remove a client from our global lists and free it if we can. + * High level function to manipulate export options on a mount point + * and the passed in netexport. + * Struct export_args *argp is the variable used to twiddle options, + * the structure is described in sys/mount.h */ -static void -svc_rpc_gss_forget_client(struct svc_rpc_gss_client *client) -{ - struct svc_rpc_gss_client_list *list; - - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; - sx_xlock(&svc_rpc_gss_lock); - TAILQ_REMOVE(list, client, cl_link); - TAILQ_REMOVE(&svc_rpc_gss_clients, client, cl_alllink); - svc_rpc_gss_client_count--; - sx_xunlock(&svc_rpc_gss_lock); - svc_rpc_gss_release_client(client); -} - -static void -svc_rpc_gss_timeout_clients(void) +int +vfs_export(struct mount *mp, struct export_args *argp) { - struct svc_rpc_gss_client *client; - struct svc_rpc_gss_client *nclient; - time_t now = time_uptime; + struct netexport *nep; + int error; - rpc_gss_log_debug("in svc_rpc_gss_timeout_clients()"); - - /* - * First enforce the max client limit. We keep - * svc_rpc_gss_clients in LRU order. - */ - while (svc_rpc_gss_client_count > CLIENT_MAX) - svc_rpc_gss_forget_client(TAILQ_LAST(&svc_rpc_gss_clients, - svc_rpc_gss_client_list)); - TAILQ_FOREACH_SAFE(client, &svc_rpc_gss_clients, cl_alllink, nclient) { - if (client->cl_state == CLIENT_STALE - || now > client->cl_expiration) { - rpc_gss_log_debug("expiring client %p", client); - svc_rpc_gss_forget_client(client); + if (argp->ex_numsecflavors < 0 + || argp->ex_numsecflavors >= MAXSECFLAVORS) + return (EINVAL); + + error = 0; + lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); + nep = mp->mnt_export; + if (argp->ex_flags & MNT_DELEXPORT) { + if (nep == NULL) { + error = ENOENT; + goto out; + } + if (mp->mnt_flag & MNT_EXPUBLIC) { + vfs_setpublicfs(NULL, NULL, NULL); + MNT_ILOCK(mp); + mp->mnt_flag &= ~MNT_EXPUBLIC; + MNT_IUNLOCK(mp); + } + vfs_free_addrlist(nep); + mp->mnt_export = NULL; + free(nep, M_MOUNT); + nep = NULL; + MNT_ILOCK(mp); + mp->mnt_flag &= ~(MNT_EXPORTED | MNT_DEFEXPORTED); + MNT_IUNLOCK(mp); + } + if (argp->ex_flags & MNT_EXPORTED) { + if (nep == NULL) { + nep = malloc(sizeof(struct netexport), M_MOUNT, M_WAITOK | M_ZERO); + mp->mnt_export = nep; + } + if (argp->ex_flags & MNT_EXPUBLIC) { + if ((error = vfs_setpublicfs(mp, nep, argp)) != 0) + goto out; + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_EXPUBLIC; + MNT_IUNLOCK(mp); } + if ((error = vfs_hang_addrlist(mp, nep, argp))) + goto out; + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_EXPORTED; + MNT_IUNLOCK(mp); } + +out: + lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); + /* + * Once we have executed the vfs_export() command, we do + * not want to keep the "export" option around in the + * options list, since that will cause subsequent MNT_UPDATE + * calls to fail. The export information is saved in + * mp->mnt_export, so we can safely delete the "export" mount option + * here. + */ + vfs_deleteopt(mp->mnt_optnew, "export"); + vfs_deleteopt(mp->mnt_opt, "export"); + return (error); } -#ifdef DEBUG /* - * OID<->string routines. These are uuuuugly. + * Set the publicly exported filesystem (WebNFS). Currently, only + * one public filesystem is possible in the spec (RFC 2054 and 2055) */ -static OM_uint32 -gss_oid_to_str(OM_uint32 *minor_status, gss_OID oid, gss_buffer_t oid_str) +int +vfs_setpublicfs(struct mount *mp, struct netexport *nep, + struct export_args *argp) { - char numstr[128]; - unsigned long number; - int numshift; - size_t string_length; - size_t i; - unsigned char *cp; - char *bp; - - /* Decoded according to krb5/gssapi_krb5.c */ - - /* First determine the size of the string */ - string_length = 0; - number = 0; - numshift = 0; - cp = (unsigned char *) oid->elements; - number = (unsigned long) cp[0]; - sprintf(numstr, "%ld ", number/40); - string_length += strlen(numstr); - sprintf(numstr, "%ld ", number%40); - string_length += strlen(numstr); - for (i=1; ilength; i++) { - if ( (size_t) (numshift+7) < (sizeof(unsigned long)*8)) { - number = (number << 7) | (cp[i] & 0x7f); - numshift += 7; - } - else { - *minor_status = 0; - return(GSS_S_FAILURE); - } - if ((cp[i] & 0x80) == 0) { - sprintf(numstr, "%ld ", number); - string_length += strlen(numstr); - number = 0; - numshift = 0; - } - } - /* - * If we get here, we've calculated the length of "n n n ... n ". Add 4 - * here for "{ " and "}\0". - */ - string_length += 4; - if ((bp = (char *) mem_alloc(string_length))) { - strcpy(bp, "{ "); - number = (unsigned long) cp[0]; - sprintf(numstr, "%ld ", number/40); - strcat(bp, numstr); - sprintf(numstr, "%ld ", number%40); - strcat(bp, numstr); - number = 0; - cp = (unsigned char *) oid->elements; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 18:32:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2D06106566C; Mon, 28 Sep 2009 18:32: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 B679B8FC22; Mon, 28 Sep 2009 18:32:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SIWSwi062382; Mon, 28 Sep 2009 18:32:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SIWSSP062380; Mon, 28 Sep 2009 18:32:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200909281832.n8SIWSSP062380@svn.freebsd.org> From: Michael Tuexen Date: Mon, 28 Sep 2009 18:32: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: r197582 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci 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, 28 Sep 2009 18:32:29 -0000 Author: tuexen Date: Mon Sep 28 18:32:28 2009 New Revision: 197582 URL: http://svn.freebsd.org/changeset/base/197582 Log: MFC r197341. Fix errnos. Approved by: re (bz), rrs (mentor) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/sctp_output.c Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Mon Sep 28 18:07:16 2009 (r197581) +++ stable/8/sys/netinet/sctp_output.c Mon Sep 28 18:32:28 2009 (r197582) @@ -12384,8 +12384,8 @@ sctp_lower_sosend(struct socket *so, t_inp = inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); - error = EFAULT; + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); + error = EINVAL; if (i_pak) { SCTP_RELEASE_PKT(i_pak); } @@ -12432,8 +12432,8 @@ sctp_lower_sosend(struct socket *so, if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (inp->sctp_socket->so_qlimit)) { /* The listener can NOT send */ - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); - error = EFAULT; + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); + error = ENOTCONN; goto out_unlocked; } if ((use_rcvinfo) && srcv) { @@ -12566,8 +12566,8 @@ sctp_lower_sosend(struct socket *so, if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { /* Should I really unlock ? */ - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); - error = EFAULT; + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); + error = EINVAL; goto out_unlocked; } @@ -12596,6 +12596,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; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 18:54:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EE821065676; Mon, 28 Sep 2009 18:54:27 +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 2D3F68FC18; Mon, 28 Sep 2009 18:54:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SIsRli062930; Mon, 28 Sep 2009 18:54:27 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SIsRRC062928; Mon, 28 Sep 2009 18:54:27 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200909281854.n8SIsRRC062928@svn.freebsd.org> From: Jamie Gritton Date: Mon, 28 Sep 2009 18:54:27 +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: r197583 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 18:54:27 -0000 Author: jamie Date: Mon Sep 28 18:54:26 2009 New Revision: 197583 URL: http://svn.freebsd.org/changeset/base/197583 Log: Back out r197581, which replaced this file witk sys/kern/vfs_export.c. Who knew that "svn export" was an actual command, or that I would have vfs_export.c stuck in my mind deep enough to type "export" instead of "commit"? Pointy Hat to: jamie Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:32:28 2009 (r197582) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:54:26 2009 (r197583) @@ -1,11 +1,6 @@ /*- - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. + * Copyright (c) 2008 Doug Rabson + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -15,14 +10,11 @@ * 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. - * 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. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -30,463 +22,1465 @@ * 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. - * - * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 + */ +/* + svc_rpcsec_gss.c + + Copyright (c) 2000 The Regents of the University of Michigan. + All rights reserved. + + Copyright (c) 2000 Dug Song . + All rights reserved, all wrongs reversed. + + 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 University 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 ``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 REGENTS 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. + + $Id: svc_auth_gss.c,v 1.27 2002/01/15 15:43:00 andros Exp $ */ #include __FBSDID("$FreeBSD$"); #include -#include -#include +#include #include #include +#include #include #include #include -#include #include -#include -#include -#include -#include -#include +#include +#include +#include + +#include +#include + +#include "rpcsec_gss_int.h" + +static bool_t svc_rpc_gss_wrap(SVCAUTH *, struct mbuf **); +static bool_t svc_rpc_gss_unwrap(SVCAUTH *, struct mbuf **); +static void svc_rpc_gss_release(SVCAUTH *); +static enum auth_stat svc_rpc_gss(struct svc_req *, struct rpc_msg *); +static int rpc_gss_svc_getcred(struct svc_req *, struct ucred **, int *); + +static struct svc_auth_ops svc_auth_gss_ops = { + svc_rpc_gss_wrap, + svc_rpc_gss_unwrap, + svc_rpc_gss_release, +}; -#include +struct sx svc_rpc_gss_lock; -static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure"); +struct svc_rpc_gss_callback { + SLIST_ENTRY(svc_rpc_gss_callback) cb_link; + rpc_gss_callback_t cb_callback; +}; +static SLIST_HEAD(svc_rpc_gss_callback_list, svc_rpc_gss_callback) + svc_rpc_gss_callbacks = SLIST_HEAD_INITIALIZER(&svc_rpc_gss_callbacks); -static void vfs_free_addrlist(struct netexport *nep); -static int vfs_free_netcred(struct radix_node *rn, void *w); -static int vfs_hang_addrlist(struct mount *mp, struct netexport *nep, - struct export_args *argp); -static struct netcred *vfs_export_lookup(struct mount *, struct sockaddr *); +struct svc_rpc_gss_svc_name { + SLIST_ENTRY(svc_rpc_gss_svc_name) sn_link; + char *sn_principal; + gss_OID sn_mech; + u_int sn_req_time; + gss_cred_id_t sn_cred; + u_int sn_program; + u_int sn_version; +}; +static SLIST_HEAD(svc_rpc_gss_svc_name_list, svc_rpc_gss_svc_name) + svc_rpc_gss_svc_names = SLIST_HEAD_INITIALIZER(&svc_rpc_gss_svc_names); -/* - * Network address lookup element - */ -struct netcred { - struct radix_node netc_rnodes[2]; - int netc_exflags; - struct ucred *netc_anon; - int netc_numsecflavors; - int netc_secflavors[MAXSECFLAVORS]; +enum svc_rpc_gss_client_state { + CLIENT_NEW, /* still authenticating */ + CLIENT_ESTABLISHED, /* context established */ + CLIENT_STALE /* garbage to collect */ }; -/* - * Network export information - */ -struct netexport { - struct netcred ne_defexported; /* Default export */ - struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */ +#define SVC_RPC_GSS_SEQWINDOW 128 + +struct svc_rpc_gss_clientid { + unsigned long ci_hostid; + uint32_t ci_boottime; + uint32_t ci_id; }; +struct svc_rpc_gss_client { + TAILQ_ENTRY(svc_rpc_gss_client) cl_link; + TAILQ_ENTRY(svc_rpc_gss_client) cl_alllink; + volatile u_int cl_refs; + struct sx cl_lock; + struct svc_rpc_gss_clientid cl_id; + time_t cl_expiration; /* when to gc */ + enum svc_rpc_gss_client_state cl_state; /* client state */ + bool_t cl_locked; /* fixed service+qop */ + gss_ctx_id_t cl_ctx; /* context id */ + gss_cred_id_t cl_creds; /* delegated creds */ + gss_name_t cl_cname; /* client name */ + struct svc_rpc_gss_svc_name *cl_sname; /* server name used */ + rpc_gss_rawcred_t cl_rawcred; /* raw credentials */ + rpc_gss_ucred_t cl_ucred; /* unix-style credentials */ + struct ucred *cl_cred; /* kernel-style credentials */ + int cl_rpcflavor; /* RPC pseudo sec flavor */ + bool_t cl_done_callback; /* TRUE after call */ + void *cl_cookie; /* user cookie from callback */ + gid_t cl_gid_storage[NGROUPS]; + gss_OID cl_mech; /* mechanism */ + gss_qop_t cl_qop; /* quality of protection */ + uint32_t cl_seqlast; /* sequence window origin */ + uint32_t cl_seqmask[SVC_RPC_GSS_SEQWINDOW/32]; /* bitmask of seqnums */ +}; +TAILQ_HEAD(svc_rpc_gss_client_list, svc_rpc_gss_client); + /* - * Build hash lists of net addresses and hang them off the mount point. - * Called by vfs_export() to set up the lists of export addresses. + * This structure holds enough information to unwrap arguments or wrap + * results for a given request. We use the rq_clntcred area for this + * (which is a per-request buffer). */ -static int -vfs_hang_addrlist(struct mount *mp, struct netexport *nep, - struct export_args *argp) +struct svc_rpc_gss_cookedcred { + struct svc_rpc_gss_client *cc_client; + rpc_gss_service_t cc_service; + uint32_t cc_seq; +}; + +#define CLIENT_HASH_SIZE 256 +#define CLIENT_MAX 128 +struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE]; +struct svc_rpc_gss_client_list svc_rpc_gss_clients; +static size_t svc_rpc_gss_client_count; +static uint32_t svc_rpc_gss_next_clientid = 1; + +static void +svc_rpc_gss_init(void *arg) { - register struct netcred *np; - register struct radix_node_head *rnh; - register int i; - struct radix_node *rn; - struct sockaddr *saddr, *smask = 0; - struct domain *dom; - int error; - - /* - * XXX: This routine converts from a `struct xucred' - * (argp->ex_anon) to a `struct ucred' (np->netc_anon). This - * operation is questionable; for example, what should be done - * with fields like cr_uidinfo and cr_prison? Currently, this - * routine does not touch them (leaves them as NULL). - */ - if (argp->ex_anon.cr_version != XUCRED_VERSION) { - vfs_mount_error(mp, "ex_anon.cr_version: %d != %d", - argp->ex_anon.cr_version, XUCRED_VERSION); - return (EINVAL); - } - - if (argp->ex_addrlen == 0) { - if (mp->mnt_flag & MNT_DEFEXPORTED) { - vfs_mount_error(mp, - "MNT_DEFEXPORTED already set for mount %p", mp); - return (EPERM); - } - np = &nep->ne_defexported; - np->netc_exflags = argp->ex_flags; - np->netc_anon = crget(); - np->netc_anon->cr_uid = argp->ex_anon.cr_uid; - crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, - argp->ex_anon.cr_groups); - np->netc_anon->cr_prison = &prison0; - prison_hold(np->netc_anon->cr_prison); - np->netc_numsecflavors = argp->ex_numsecflavors; - bcopy(argp->ex_secflavors, np->netc_secflavors, - sizeof(np->netc_secflavors)); - MNT_ILOCK(mp); - mp->mnt_flag |= MNT_DEFEXPORTED; - MNT_IUNLOCK(mp); - return (0); + int i; + + for (i = 0; i < CLIENT_HASH_SIZE; i++) + TAILQ_INIT(&svc_rpc_gss_client_hash[i]); + TAILQ_INIT(&svc_rpc_gss_clients); + svc_auth_reg(RPCSEC_GSS, svc_rpc_gss, rpc_gss_svc_getcred); + sx_init(&svc_rpc_gss_lock, "gsslock"); +} +SYSINIT(svc_rpc_gss_init, SI_SUB_KMEM, SI_ORDER_ANY, svc_rpc_gss_init, NULL); + +bool_t +rpc_gss_set_callback(rpc_gss_callback_t *cb) +{ + struct svc_rpc_gss_callback *scb; + + scb = mem_alloc(sizeof(struct svc_rpc_gss_callback)); + if (!scb) { + _rpc_gss_set_error(RPC_GSS_ER_SYSTEMERROR, ENOMEM); + return (FALSE); } + scb->cb_callback = *cb; + sx_xlock(&svc_rpc_gss_lock); + SLIST_INSERT_HEAD(&svc_rpc_gss_callbacks, scb, cb_link); + sx_xunlock(&svc_rpc_gss_lock); -#if MSIZE <= 256 - if (argp->ex_addrlen > MLEN) { - vfs_mount_error(mp, "ex_addrlen %d is greater than %d", - argp->ex_addrlen, MLEN); - return (EINVAL); + return (TRUE); +} + +void +rpc_gss_clear_callback(rpc_gss_callback_t *cb) +{ + struct svc_rpc_gss_callback *scb; + + sx_xlock(&svc_rpc_gss_lock); + SLIST_FOREACH(scb, &svc_rpc_gss_callbacks, cb_link) { + if (scb->cb_callback.program == cb->program + && scb->cb_callback.version == cb->version + && scb->cb_callback.callback == cb->callback) { + SLIST_REMOVE(&svc_rpc_gss_callbacks, scb, + svc_rpc_gss_callback, cb_link); + sx_xunlock(&svc_rpc_gss_lock); + mem_free(scb, sizeof(*scb)); + return; + } } -#endif + sx_xunlock(&svc_rpc_gss_lock); +} - i = sizeof(struct netcred) + argp->ex_addrlen + argp->ex_masklen; - np = (struct netcred *) malloc(i, M_NETADDR, M_WAITOK | M_ZERO); - saddr = (struct sockaddr *) (np + 1); - if ((error = copyin(argp->ex_addr, saddr, argp->ex_addrlen))) - goto out; - if (saddr->sa_family == AF_UNSPEC || saddr->sa_family > AF_MAX) { - error = EINVAL; - vfs_mount_error(mp, "Invalid saddr->sa_family: %d"); - goto out; +static bool_t +rpc_gss_acquire_svc_cred(struct svc_rpc_gss_svc_name *sname) +{ + OM_uint32 maj_stat, min_stat; + gss_buffer_desc namebuf; + gss_name_t name; + gss_OID_set_desc oid_set; + + oid_set.count = 1; + oid_set.elements = sname->sn_mech; + + namebuf.value = (void *) sname->sn_principal; + namebuf.length = strlen(sname->sn_principal); + + maj_stat = gss_import_name(&min_stat, &namebuf, + GSS_C_NT_HOSTBASED_SERVICE, &name); + if (maj_stat != GSS_S_COMPLETE) + return (FALSE); + + if (sname->sn_cred != GSS_C_NO_CREDENTIAL) + gss_release_cred(&min_stat, &sname->sn_cred); + + maj_stat = gss_acquire_cred(&min_stat, name, + sname->sn_req_time, &oid_set, GSS_C_ACCEPT, &sname->sn_cred, + NULL, NULL); + if (maj_stat != GSS_S_COMPLETE) { + gss_release_name(&min_stat, &name); + return (FALSE); } - if (saddr->sa_len > argp->ex_addrlen) - saddr->sa_len = argp->ex_addrlen; - if (argp->ex_masklen) { - smask = (struct sockaddr *)((caddr_t)saddr + argp->ex_addrlen); - error = copyin(argp->ex_mask, smask, argp->ex_masklen); - if (error) - goto out; - if (smask->sa_len > argp->ex_masklen) - smask->sa_len = argp->ex_masklen; + gss_release_name(&min_stat, &name); + + return (TRUE); +} + +bool_t +rpc_gss_set_svc_name(const char *principal, const char *mechanism, + u_int req_time, u_int program, u_int version) +{ + struct svc_rpc_gss_svc_name *sname; + gss_OID mech_oid; + + if (!rpc_gss_mech_to_oid(mechanism, &mech_oid)) + return (FALSE); + + sname = mem_alloc(sizeof(*sname)); + if (!sname) + return (FALSE); + sname->sn_principal = strdup(principal, M_RPC); + sname->sn_mech = mech_oid; + sname->sn_req_time = req_time; + sname->sn_cred = GSS_C_NO_CREDENTIAL; + sname->sn_program = program; + sname->sn_version = version; + + if (!rpc_gss_acquire_svc_cred(sname)) { + free(sname->sn_principal, M_RPC); + mem_free(sname, sizeof(*sname)); + return (FALSE); } - i = saddr->sa_family; - if ((rnh = nep->ne_rtable[i]) == NULL) { - /* - * Seems silly to initialize every AF when most are not used, - * do so on demand here - */ - for (dom = domains; dom; dom = dom->dom_next) { - KASSERT(((i == AF_INET) || (i == AF_INET6)), - ("unexpected protocol in vfs_hang_addrlist")); - if (dom->dom_family == i && dom->dom_rtattach) { - /* - * XXX MRT - * The INET and INET6 domains know the - * offset already. We don't need to send it - * So we just use it as a flag to say that - * we are or are not setting up a real routing - * table. Only IP and IPV6 need have this - * be 0 so all other protocols can stay the - * same (ABI compatible). - */ - dom->dom_rtattach( - (void **) &nep->ne_rtable[i], 0); - break; - } - } - if ((rnh = nep->ne_rtable[i]) == NULL) { - error = ENOBUFS; - vfs_mount_error(mp, "%s %s %d", - "Unable to initialize radix node head ", - "for address family", i); - goto out; + + sx_xlock(&svc_rpc_gss_lock); + SLIST_INSERT_HEAD(&svc_rpc_gss_svc_names, sname, sn_link); + sx_xunlock(&svc_rpc_gss_lock); + + return (TRUE); +} + +void +rpc_gss_clear_svc_name(u_int program, u_int version) +{ + OM_uint32 min_stat; + struct svc_rpc_gss_svc_name *sname; + + sx_xlock(&svc_rpc_gss_lock); + SLIST_FOREACH(sname, &svc_rpc_gss_svc_names, sn_link) { + if (sname->sn_program == program + && sname->sn_version == version) { + SLIST_REMOVE(&svc_rpc_gss_svc_names, sname, + svc_rpc_gss_svc_name, sn_link); + sx_xunlock(&svc_rpc_gss_lock); + gss_release_cred(&min_stat, &sname->sn_cred); + free(sname->sn_principal, M_RPC); + mem_free(sname, sizeof(*sname)); + return; } } - RADIX_NODE_HEAD_LOCK(rnh); - rn = (*rnh->rnh_addaddr)(saddr, smask, rnh, np->netc_rnodes); - RADIX_NODE_HEAD_UNLOCK(rnh); - if (rn == NULL || np != (struct netcred *)rn) { /* already exists */ - error = EPERM; - vfs_mount_error(mp, "Invalid radix node head, rn: %p %p", - rn, np); - goto out; + sx_xunlock(&svc_rpc_gss_lock); +} + +bool_t +rpc_gss_get_principal_name(rpc_gss_principal_t *principal, + const char *mech, const char *name, const char *node, const char *domain) +{ + OM_uint32 maj_stat, min_stat; + gss_OID mech_oid; + size_t namelen; + gss_buffer_desc buf; + gss_name_t gss_name, gss_mech_name; + rpc_gss_principal_t result; + + if (!rpc_gss_mech_to_oid(mech, &mech_oid)) + return (FALSE); + + /* + * Construct a gss_buffer containing the full name formatted + * as "name/node@domain" where node and domain are optional. + */ + namelen = strlen(name); + if (node) { + namelen += strlen(node) + 1; } - np->netc_exflags = argp->ex_flags; - np->netc_anon = crget(); - np->netc_anon->cr_uid = argp->ex_anon.cr_uid; - crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, - np->netc_anon->cr_groups); - np->netc_anon->cr_prison = &prison0; - prison_hold(np->netc_anon->cr_prison); - np->netc_numsecflavors = argp->ex_numsecflavors; - bcopy(argp->ex_secflavors, np->netc_secflavors, - sizeof(np->netc_secflavors)); - return (0); -out: - free(np, M_NETADDR); - return (error); + if (domain) { + namelen += strlen(domain) + 1; + } + + buf.value = mem_alloc(namelen); + buf.length = namelen; + strcpy((char *) buf.value, name); + if (node) { + strcat((char *) buf.value, "/"); + strcat((char *) buf.value, node); + } + if (domain) { + strcat((char *) buf.value, "@"); + strcat((char *) buf.value, domain); + } + + /* + * Convert that to a gss_name_t and then convert that to a + * mechanism name in the selected mechanism. + */ + maj_stat = gss_import_name(&min_stat, &buf, + GSS_C_NT_USER_NAME, &gss_name); + mem_free(buf.value, buf.length); + if (maj_stat != GSS_S_COMPLETE) { + rpc_gss_log_status("gss_import_name", mech_oid, maj_stat, min_stat); + return (FALSE); + } + maj_stat = gss_canonicalize_name(&min_stat, gss_name, mech_oid, + &gss_mech_name); + if (maj_stat != GSS_S_COMPLETE) { + rpc_gss_log_status("gss_canonicalize_name", mech_oid, maj_stat, + min_stat); + gss_release_name(&min_stat, &gss_name); + return (FALSE); + } + gss_release_name(&min_stat, &gss_name); + + /* + * Export the mechanism name and use that to construct the + * rpc_gss_principal_t result. + */ + maj_stat = gss_export_name(&min_stat, gss_mech_name, &buf); + if (maj_stat != GSS_S_COMPLETE) { + rpc_gss_log_status("gss_export_name", mech_oid, maj_stat, min_stat); + gss_release_name(&min_stat, &gss_mech_name); + return (FALSE); + } + gss_release_name(&min_stat, &gss_mech_name); + + result = mem_alloc(sizeof(int) + buf.length); + if (!result) { + gss_release_buffer(&min_stat, &buf); + return (FALSE); + } + result->len = buf.length; + memcpy(result->name, buf.value, buf.length); + gss_release_buffer(&min_stat, &buf); + + *principal = result; + return (TRUE); } -/* Helper for vfs_free_addrlist. */ -/* ARGSUSED */ -static int -vfs_free_netcred(struct radix_node *rn, void *w) +bool_t +rpc_gss_getcred(struct svc_req *req, rpc_gss_rawcred_t **rcred, + rpc_gss_ucred_t **ucred, void **cookie) { - struct radix_node_head *rnh = (struct radix_node_head *) w; - struct ucred *cred; + struct svc_rpc_gss_cookedcred *cc; + struct svc_rpc_gss_client *client; + + if (req->rq_cred.oa_flavor != RPCSEC_GSS) + return (FALSE); - (*rnh->rnh_deladdr) (rn->rn_key, rn->rn_mask, rnh); - cred = ((struct netcred *)rn)->netc_anon; - if (cred != NULL) - crfree(cred); - free(rn, M_NETADDR); - return (0); + cc = req->rq_clntcred; + client = cc->cc_client; + if (rcred) + *rcred = &client->cl_rawcred; + if (ucred) + *ucred = &client->cl_ucred; + if (cookie) + *cookie = client->cl_cookie; + return (TRUE); } /* - * Free the net address hash lists that are hanging off the mount points. + * This simpler interface is used by svc_getcred to copy the cred data + * into a kernel cred structure. */ -static void -vfs_free_addrlist(struct netexport *nep) +static int +rpc_gss_svc_getcred(struct svc_req *req, struct ucred **crp, int *flavorp) { - int i; - struct radix_node_head *rnh; - struct ucred *cred; + struct ucred *cr; + struct svc_rpc_gss_cookedcred *cc; + struct svc_rpc_gss_client *client; + rpc_gss_ucred_t *uc; + + if (req->rq_cred.oa_flavor != RPCSEC_GSS) + return (FALSE); + + cc = req->rq_clntcred; + client = cc->cc_client; + + if (flavorp) + *flavorp = client->cl_rpcflavor; + + if (client->cl_cred) { + *crp = crhold(client->cl_cred); + return (TRUE); + } - for (i = 0; i <= AF_MAX; i++) { - if ((rnh = nep->ne_rtable[i])) { - RADIX_NODE_HEAD_LOCK(rnh); - (*rnh->rnh_walktree) (rnh, vfs_free_netcred, rnh); - RADIX_NODE_HEAD_UNLOCK(rnh); - RADIX_NODE_HEAD_DESTROY(rnh); - free(rnh, M_RTABLE); - nep->ne_rtable[i] = NULL; /* not SMP safe XXX */ - } - } - cred = nep->ne_defexported.netc_anon; - if (cred != NULL) - crfree(cred); + uc = &client->cl_ucred; + cr = client->cl_cred = crget(); + cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; + cr->cr_rgid = cr->cr_svgid = uc->gid; + crsetgroups(cr, uc->gidlen, uc->gidlist); + *crp = crhold(cr); + return (TRUE); } -/* - * High level function to manipulate export options on a mount point - * and the passed in netexport. - * Struct export_args *argp is the variable used to twiddle options, - * the structure is described in sys/mount.h - */ int -vfs_export(struct mount *mp, struct export_args *argp) +rpc_gss_svc_max_data_length(struct svc_req *req, int max_tp_unit_len) { - struct netexport *nep; - int error; + struct svc_rpc_gss_cookedcred *cc = req->rq_clntcred; + struct svc_rpc_gss_client *client = cc->cc_client; + int want_conf; + OM_uint32 max; + OM_uint32 maj_stat, min_stat; + int result; + + switch (client->cl_rawcred.service) { + case rpc_gss_svc_none: + return (max_tp_unit_len); + break; + + case rpc_gss_svc_default: + case rpc_gss_svc_integrity: + want_conf = FALSE; + break; + + case rpc_gss_svc_privacy: + want_conf = TRUE; + break; - if (argp->ex_numsecflavors < 0 - || argp->ex_numsecflavors >= MAXSECFLAVORS) - return (EINVAL); - - error = 0; - lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); - nep = mp->mnt_export; - if (argp->ex_flags & MNT_DELEXPORT) { - if (nep == NULL) { - error = ENOENT; - goto out; - } - if (mp->mnt_flag & MNT_EXPUBLIC) { - vfs_setpublicfs(NULL, NULL, NULL); - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_EXPUBLIC; - MNT_IUNLOCK(mp); - } - vfs_free_addrlist(nep); - mp->mnt_export = NULL; - free(nep, M_MOUNT); - nep = NULL; - MNT_ILOCK(mp); - mp->mnt_flag &= ~(MNT_EXPORTED | MNT_DEFEXPORTED); - MNT_IUNLOCK(mp); - } - if (argp->ex_flags & MNT_EXPORTED) { - if (nep == NULL) { - nep = malloc(sizeof(struct netexport), M_MOUNT, M_WAITOK | M_ZERO); - mp->mnt_export = nep; - } - if (argp->ex_flags & MNT_EXPUBLIC) { - if ((error = vfs_setpublicfs(mp, nep, argp)) != 0) - goto out; - MNT_ILOCK(mp); - mp->mnt_flag |= MNT_EXPUBLIC; - MNT_IUNLOCK(mp); + default: + return (0); + } + + maj_stat = gss_wrap_size_limit(&min_stat, client->cl_ctx, want_conf, + client->cl_qop, max_tp_unit_len, &max); + + if (maj_stat == GSS_S_COMPLETE) { + result = (int) max; + if (result < 0) + result = 0; + return (result); + } else { + rpc_gss_log_status("gss_wrap_size_limit", client->cl_mech, + maj_stat, min_stat); + return (0); + } +} + +static struct svc_rpc_gss_client * +svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *id) +{ + struct svc_rpc_gss_client *client; + struct svc_rpc_gss_client_list *list; + unsigned long hostid; + + rpc_gss_log_debug("in svc_rpc_gss_find_client(%d)", id->ci_id); + + getcredhostid(curthread->td_ucred, &hostid); + if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) + return (NULL); + + list = &svc_rpc_gss_client_hash[id->ci_id % CLIENT_HASH_SIZE]; + sx_xlock(&svc_rpc_gss_lock); + TAILQ_FOREACH(client, list, cl_link) { + if (client->cl_id.ci_id == id->ci_id) { + /* + * Move this client to the front of the LRU + * list. + */ + TAILQ_REMOVE(&svc_rpc_gss_clients, client, cl_alllink); + TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, + cl_alllink); + refcount_acquire(&client->cl_refs); + break; } - if ((error = vfs_hang_addrlist(mp, nep, argp))) - goto out; - MNT_ILOCK(mp); - mp->mnt_flag |= MNT_EXPORTED; - MNT_IUNLOCK(mp); } + sx_xunlock(&svc_rpc_gss_lock); + + return (client); +} + +static struct svc_rpc_gss_client * +svc_rpc_gss_create_client(void) +{ + struct svc_rpc_gss_client *client; + struct svc_rpc_gss_client_list *list; + unsigned long hostid; + + rpc_gss_log_debug("in svc_rpc_gss_create_client()"); + + client = mem_alloc(sizeof(struct svc_rpc_gss_client)); + memset(client, 0, sizeof(struct svc_rpc_gss_client)); + refcount_init(&client->cl_refs, 1); + sx_init(&client->cl_lock, "GSS-client"); + getcredhostid(curthread->td_ucred, &hostid); + client->cl_id.ci_hostid = hostid; + client->cl_id.ci_boottime = boottime.tv_sec; + client->cl_id.ci_id = svc_rpc_gss_next_clientid++; + list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + sx_xlock(&svc_rpc_gss_lock); + TAILQ_INSERT_HEAD(list, client, cl_link); + TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink); + svc_rpc_gss_client_count++; + sx_xunlock(&svc_rpc_gss_lock); -out: - lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); /* - * Once we have executed the vfs_export() command, we do - * not want to keep the "export" option around in the - * options list, since that will cause subsequent MNT_UPDATE - * calls to fail. The export information is saved in - * mp->mnt_export, so we can safely delete the "export" mount option - * here. - */ - vfs_deleteopt(mp->mnt_optnew, "export"); - vfs_deleteopt(mp->mnt_opt, "export"); - return (error); + * Start the client off with a short expiration time. We will + * try to get a saner value from the client creds later. + */ + client->cl_state = CLIENT_NEW; + client->cl_locked = FALSE; + client->cl_expiration = time_uptime + 5*60; + + return (client); +} + +static void +svc_rpc_gss_destroy_client(struct svc_rpc_gss_client *client) +{ + OM_uint32 min_stat; + + rpc_gss_log_debug("in svc_rpc_gss_destroy_client()"); + + if (client->cl_ctx) + gss_delete_sec_context(&min_stat, + &client->cl_ctx, GSS_C_NO_BUFFER); + + if (client->cl_cname) + gss_release_name(&min_stat, &client->cl_cname); + + if (client->cl_rawcred.client_principal) + mem_free(client->cl_rawcred.client_principal, + sizeof(*client->cl_rawcred.client_principal) + + client->cl_rawcred.client_principal->len); + + if (client->cl_cred) + crfree(client->cl_cred); + + sx_destroy(&client->cl_lock); + mem_free(client, sizeof(*client)); } /* - * Set the publicly exported filesystem (WebNFS). Currently, only - * one public filesystem is possible in the spec (RFC 2054 and 2055) + * Drop a reference to a client and free it if that was the last reference. */ -int -vfs_setpublicfs(struct mount *mp, struct netexport *nep, - struct export_args *argp) +static void +svc_rpc_gss_release_client(struct svc_rpc_gss_client *client) { - int error; - struct vnode *rvp; - char *cp; - - /* - * mp == NULL -> invalidate the current info, the FS is - * no longer exported. May be called from either vfs_export - * or unmount, so check if it hasn't already been done. - */ - if (mp == NULL) { - if (nfs_pub.np_valid) { - nfs_pub.np_valid = 0; - if (nfs_pub.np_index != NULL) { - free(nfs_pub.np_index, M_TEMP); - nfs_pub.np_index = NULL; + + if (!refcount_release(&client->cl_refs)) + return; + svc_rpc_gss_destroy_client(client); +} + +/* + * Remove a client from our global lists and free it if we can. + */ +static void +svc_rpc_gss_forget_client(struct svc_rpc_gss_client *client) +{ + struct svc_rpc_gss_client_list *list; + + list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; + sx_xlock(&svc_rpc_gss_lock); + TAILQ_REMOVE(list, client, cl_link); + TAILQ_REMOVE(&svc_rpc_gss_clients, client, cl_alllink); + svc_rpc_gss_client_count--; + sx_xunlock(&svc_rpc_gss_lock); + svc_rpc_gss_release_client(client); +} + +static void +svc_rpc_gss_timeout_clients(void) +{ + struct svc_rpc_gss_client *client; + struct svc_rpc_gss_client *nclient; + time_t now = time_uptime; + + rpc_gss_log_debug("in svc_rpc_gss_timeout_clients()"); + + /* + * First enforce the max client limit. We keep + * svc_rpc_gss_clients in LRU order. + */ + while (svc_rpc_gss_client_count > CLIENT_MAX) + svc_rpc_gss_forget_client(TAILQ_LAST(&svc_rpc_gss_clients, + svc_rpc_gss_client_list)); + TAILQ_FOREACH_SAFE(client, &svc_rpc_gss_clients, cl_alllink, nclient) { + if (client->cl_state == CLIENT_STALE + || now > client->cl_expiration) { + rpc_gss_log_debug("expiring client %p", client); + svc_rpc_gss_forget_client(client); + } + } +} + +#ifdef DEBUG +/* + * OID<->string routines. These are uuuuugly. + */ +static OM_uint32 +gss_oid_to_str(OM_uint32 *minor_status, gss_OID oid, gss_buffer_t oid_str) +{ + char numstr[128]; + unsigned long number; + int numshift; + size_t string_length; + size_t i; + unsigned char *cp; + char *bp; + + /* Decoded according to krb5/gssapi_krb5.c */ + + /* First determine the size of the string */ + string_length = 0; + number = 0; + numshift = 0; + cp = (unsigned char *) oid->elements; + number = (unsigned long) cp[0]; + sprintf(numstr, "%ld ", number/40); + string_length += strlen(numstr); + sprintf(numstr, "%ld ", number%40); + string_length += strlen(numstr); + for (i=1; ilength; i++) { + if ( (size_t) (numshift+7) < (sizeof(unsigned long)*8)) { + number = (number << 7) | (cp[i] & 0x7f); + numshift += 7; + } + else { + *minor_status = 0; + return(GSS_S_FAILURE); + } + if ((cp[i] & 0x80) == 0) { + sprintf(numstr, "%ld ", number); + string_length += strlen(numstr); + number = 0; + numshift = 0; + } + } + /* + * If we get here, we've calculated the length of "n n n ... n ". Add 4 + * here for "{ " and "}\0". + */ + string_length += 4; + if ((bp = (char *) mem_alloc(string_length))) { + strcpy(bp, "{ "); + number = (unsigned long) cp[0]; + sprintf(numstr, "%ld ", number/40); + strcat(bp, numstr); + sprintf(numstr, "%ld ", number%40); + strcat(bp, numstr); + number = 0; + cp = (unsigned char *) oid->elements; + for (i=1; ilength; i++) { + number = (number << 7) | (cp[i] & 0x7f); + if ((cp[i] & 0x80) == 0) { + sprintf(numstr, "%ld ", number); + strcat(bp, numstr); + number = 0; } } - return (0); + strcat(bp, "}"); + oid_str->length = strlen(bp)+1; + oid_str->value = (void *) bp; + *minor_status = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 18:54:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66C0F1065670; Mon, 28 Sep 2009 18:54:40 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98]) by mx1.freebsd.org (Postfix) with ESMTP id 4ED6E8FC1E; Mon, 28 Sep 2009 18:54:40 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii; format=flowed Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KQP00HZ1373P200@asmtp023.mac.com>; Mon, 28 Sep 2009 11:54:40 -0700 (PDT) From: Marcel Moolenaar In-reply-to: <200909281807.n8SI7GiO061837@svn.freebsd.org> Date: Mon, 28 Sep 2009 11:54:38 -0700 Message-id: <4B5A31F0-B4DC-490E-92BB-75A8D6E6612D@mac.com> References: <200909281807.n8SI7GiO061837@svn.freebsd.org> To: Jamie Gritton X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197581 - in head/sys: kern rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 18:54:40 -0000 On Sep 28, 2009, at 11:07 AM, Jamie Gritton wrote: > Author: jamie > Date: Mon Sep 28 18:07:16 2009 > New Revision: 197581 > URL: http://svn.freebsd.org/changeset/base/197581 > > Log: > Set the prison in NFS anon and GSS SVC creds. > > Reviewed by: marcel > MFC after: 3 days > > Modified: > head/sys/kern/vfs_export.c > head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Did you intend to change so much of svc_rpcsec_gss.c? What was wrong with the 2 line change you posted before? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 18:55:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 795141065695; Mon, 28 Sep 2009 18:55:29 +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 6971F8FC1F; Mon, 28 Sep 2009 18:55:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SItT4x063000; Mon, 28 Sep 2009 18:55:29 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SItTDF062998; Mon, 28 Sep 2009 18:55:29 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200909281855.n8SItTDF062998@svn.freebsd.org> From: Jamie Gritton Date: Mon, 28 Sep 2009 18:55: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: r197584 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 18:55:29 -0000 Author: jamie Date: Mon Sep 28 18:55:29 2009 New Revision: 197584 URL: http://svn.freebsd.org/changeset/base/197584 Log: Set the prison in NFS anon and GSS SVC creds (as I indended to in r197581). Reviewed by: marcel Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:54:26 2009 (r197583) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:55:29 2009 (r197584) @@ -449,6 +449,8 @@ rpc_gss_svc_getcred(struct svc_req *req, cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; cr->cr_rgid = cr->cr_svgid = uc->gid; crsetgroups(cr, uc->gidlen, uc->gidlist); + cr->cr_prison = &prison0; + prison_hold(cr->cr_prison); *crp = crhold(cr); return (TRUE); From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 18:59:05 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 756831065670; Mon, 28 Sep 2009 18:59:05 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from gritton.org (gritton.org [161.58.222.4]) by mx1.freebsd.org (Postfix) with ESMTP id 3CB138FC26; Mon, 28 Sep 2009 18:59:05 +0000 (UTC) Received: from guppy.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by gritton.org (8.13.6.20060614/8.13.6) with ESMTP id n8SIx42t085515; Mon, 28 Sep 2009 12:59:04 -0600 (MDT) Message-ID: <4AC10773.9090907@FreeBSD.org> Date: Mon, 28 Sep 2009 12:58:59 -0600 From: Jamie Gritton User-Agent: Thunderbird 2.0.0.19 (X11/20090109) MIME-Version: 1.0 References: <200909281807.n8SI7GiO061837@svn.freebsd.org> <4B5A31F0-B4DC-490E-92BB-75A8D6E6612D@mac.com> In-Reply-To: <4B5A31F0-B4DC-490E-92BB-75A8D6E6612D@mac.com> Content-Type: text/plain; charset=ISO-8859-1; 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: r197581 - in head/sys: kern rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 18:59:05 -0000 Marcel Moolenaar wrote: > > On Sep 28, 2009, at 11:07 AM, Jamie Gritton wrote: > >> Author: jamie >> Date: Mon Sep 28 18:07:16 2009 >> New Revision: 197581 >> URL: http://svn.freebsd.org/changeset/base/197581 >> >> Log: >> Set the prison in NFS anon and GSS SVC creds. >> >> Reviewed by: marcel >> MFC after: 3 days >> >> Modified: >> head/sys/kern/vfs_export.c >> head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c > > Did you intend to change so much of svc_rpcsec_gss.c? What > was wrong with the 2 line change you posted before? Big goof on my part - sorry to imply that you reviewed that :-). I meant to type "svn commit kern/vfs_export.c sys/rpc/rpcsec_gss/svc_rpcsec_gss.c" but typed "svn export ..." instead. I then saw my mistake and typed the proper commit line instead. What I didn't see was that "svn export" was an actual command that actually did something I didn't want done. - Jamie From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 19:11:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57CC71065676; Mon, 28 Sep 2009 19:11:33 +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 2A1958FC0A; Mon, 28 Sep 2009 19:11:33 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AA8D246B06; Mon, 28 Sep 2009 15:11:32 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E5F9A8A024; Mon, 28 Sep 2009 15:11:31 -0400 (EDT) From: John Baldwin To: Jamie Gritton Date: Mon, 28 Sep 2009 15:11:24 -0400 User-Agent: KMail/1.9.7 References: <200909281855.n8SItTDF062998@svn.freebsd.org> In-Reply-To: <200909281855.n8SItTDF062998@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909281511.25338.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 28 Sep 2009 15:11:31 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197584 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 19:11:33 -0000 On Monday 28 September 2009 2:55:29 pm Jamie Gritton wrote: > Author: jamie > Date: Mon Sep 28 18:55:29 2009 > New Revision: 197584 > URL: http://svn.freebsd.org/changeset/base/197584 > > Log: > Set the prison in NFS anon and GSS SVC creds (as I indended to in r197581). > > Reviewed by: marcel > > Modified: > head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c > > Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c > ============================================================================== > --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:54:26 2009 (r197583) > +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:55:29 2009 (r197584) > @@ -449,6 +449,8 @@ rpc_gss_svc_getcred(struct svc_req *req, > cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; > cr->cr_rgid = cr->cr_svgid = uc->gid; > crsetgroups(cr, uc->gidlen, uc->gidlist); > + cr->cr_prison = &prison0; > + prison_hold(cr->cr_prison); > *crp = crhold(cr); > > return (TRUE); FYI, it would be nice if prison_hold() returned a pointer to the prison as you can then do what crhold() does above: cr->cr_prison = prison_hold(&prison0); I prefer combining the refcount and assignment into one step with the goal of avoiding outright assignments that don't go via foo_hold() or fooref() for refcounted objects. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 19:33:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DEE310656C2; Mon, 28 Sep 2009 19:33:53 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 139448FC12; Mon, 28 Sep 2009 19:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SJXqBq063837; Mon, 28 Sep 2009 19:33:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SJXqmx063835; Mon, 28 Sep 2009 19:33:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909281933.n8SJXqmx063835@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Sep 2009 19:33: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: r197585 - head/sys/dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 19:33:53 -0000 Author: yongari Date: Mon Sep 28 19:33:52 2009 New Revision: 197585 URL: http://svn.freebsd.org/changeset/base/197585 Log: Remove unnecessary device reinitialization. Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Mon Sep 28 18:55:29 2009 (r197584) +++ head/sys/dev/jme/if_jme.c Mon Sep 28 19:33:52 2009 (r197585) @@ -306,6 +306,10 @@ jme_mediastatus(struct ifnet *ifp, struc sc = ifp->if_softc; JME_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + JME_UNLOCK(sc); + return; + } mii = device_get_softc(sc->jme_miibus); mii_pollstat(mii); @@ -1585,8 +1589,10 @@ jme_resume(device_t dev) pmc + PCIR_POWER_STATUS, pmstat, 2); } ifp = sc->jme_ifp; - if ((ifp->if_flags & IFF_UP) != 0) + if ((ifp->if_flags & IFF_UP) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); + } JME_UNLOCK(sc); @@ -1861,6 +1867,7 @@ jme_watchdog(struct jme_softc *sc) if ((sc->jme_flags & JME_FLAG_LINK) == 0) { if_printf(sc->jme_ifp, "watchdog timeout (missed link)\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); return; } @@ -1875,6 +1882,7 @@ jme_watchdog(struct jme_softc *sc) if_printf(sc->jme_ifp, "watchdog timeout\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->jme_tq, &sc->jme_tx_task); @@ -1917,8 +1925,10 @@ jme_ioctl(struct ifnet *ifp, u_long cmd, VLAN_CAPABILITIES(ifp); } ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); + } JME_UNLOCK(sc); } break; @@ -2642,6 +2652,8 @@ jme_init_locked(struct jme_softc *sc) ifp = sc->jme_ifp; mii = device_get_softc(sc->jme_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; /* * Cancel any pending I/O. */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 19:36:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4EF41065672; Mon, 28 Sep 2009 19:36:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1E88FC17; Mon, 28 Sep 2009 19:36:53 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 2F4DC46B03; Mon, 28 Sep 2009 15:36:53 -0400 (EDT) Date: Mon, 28 Sep 2009 20:36:53 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200909281511.25338.jhb@freebsd.org> Message-ID: References: <200909281855.n8SItTDF062998@svn.freebsd.org> <200909281511.25338.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) 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, Jamie Gritton Subject: Re: svn commit: r197584 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 19:36:53 -0000 On Mon, 28 Sep 2009, John Baldwin wrote: > ============================================================================== >> --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:54:26 2009 > (r197583) >> +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:55:29 2009 > (r197584) >> @@ -449,6 +449,8 @@ rpc_gss_svc_getcred(struct svc_req *req, >> cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; >> cr->cr_rgid = cr->cr_svgid = uc->gid; >> crsetgroups(cr, uc->gidlen, uc->gidlist); >> + cr->cr_prison = &prison0; >> + prison_hold(cr->cr_prison); >> *crp = crhold(cr); >> >> return (TRUE); > > FYI, it would be nice if prison_hold() returned a pointer to the prison as > you can then do what crhold() does above: > > cr->cr_prison = prison_hold(&prison0); > > I prefer combining the refcount and assignment into one step with the goal > of avoiding outright assignments that don't go via foo_hold() or fooref() > for refcounted objects. In the long-term, explicit references to proc0, prison0, thread0, filedesc0, ... all make me rather nervous. I'd rather that all these things were linked to either the credentials of the file system mount, the user thread, or perhaps gssd in some cases. From the perspective if virtualization, the file system mount credential seems the most likely candidate. Robert From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 19:40:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67CBB1065692; Mon, 28 Sep 2009 19:40:17 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56D098FC1C; Mon, 28 Sep 2009 19:40:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SJeGm9063983; Mon, 28 Sep 2009 19:40:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SJeGrG063981; Mon, 28 Sep 2009 19:40:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909281940.n8SJeGrG063981@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Sep 2009 19:40: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: r197586 - head/sys/dev/fxp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 19:40:17 -0000 Author: yongari Date: Mon Sep 28 19:40:16 2009 New Revision: 197586 URL: http://svn.freebsd.org/changeset/base/197586 Log: It seems some 82559ER controllers do not support Rx checksum offloading. Datasheet said nothing about the limitation of 82559ER except WOL. Explicitly disable Rx checksum offloading for controllers that is known to lack the capability. PR: kern/138135 Tested by: Gooderum, Mark < mgooderum <> websense dot com > Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Mon Sep 28 19:33:52 2009 (r197585) +++ head/sys/dev/fxp/if_fxp.c Mon Sep 28 19:40:16 2009 (r197586) @@ -631,8 +631,11 @@ fxp_attach(device_t dev) } /* For 82559 or later chips, Rx checksum offload is supported. */ - if (sc->revision >= FXP_REV_82559_A0) - sc->flags |= FXP_FLAG_82559_RXCSUM; + if (sc->revision >= FXP_REV_82559_A0) { + /* 82559ER does not support Rx checksum offloading. */ + if (sc->ident->devid != 0x1209) + sc->flags |= FXP_FLAG_82559_RXCSUM; + } /* * Enable use of extended RFDs and TCBs for 82550 * and later chips. Note: we need extended TXCB support From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 19:46:20 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49C73106568D; Mon, 28 Sep 2009 19:46:20 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from gritton.org (gritton.org [161.58.222.4]) by mx1.freebsd.org (Postfix) with ESMTP id 0C99C8FC0C; Mon, 28 Sep 2009 19:46:19 +0000 (UTC) Received: from guppy.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by gritton.org (8.13.6.20060614/8.13.6) with ESMTP id n8SJkInb092329; Mon, 28 Sep 2009 13:46:18 -0600 (MDT) Message-ID: <4AC11285.5070404@FreeBSD.org> Date: Mon, 28 Sep 2009 13:46:13 -0600 From: Jamie Gritton User-Agent: Thunderbird 2.0.0.19 (X11/20090109) MIME-Version: 1.0 To: Robert Watson References: <200909281855.n8SItTDF062998@svn.freebsd.org> <200909281511.25338.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r197584 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 19:46:20 -0000 Robert Watson wrote: > > On Mon, 28 Sep 2009, John Baldwin wrote: > >> ============================================================================== >> >>> --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:54:26 2009 >> (r197583) >>> +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Sep 28 18:55:29 2009 >> (r197584) >>> @@ -449,6 +449,8 @@ rpc_gss_svc_getcred(struct svc_req *req, >>> cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; >>> cr->cr_rgid = cr->cr_svgid = uc->gid; >>> crsetgroups(cr, uc->gidlen, uc->gidlist); >>> + cr->cr_prison = &prison0; >>> + prison_hold(cr->cr_prison); >>> *crp = crhold(cr); >>> >>> return (TRUE); >> >> FYI, it would be nice if prison_hold() returned a pointer to the >> prison as you can then do what crhold() does above: >> >> cr->cr_prison = prison_hold(&prison0); >> >> I prefer combining the refcount and assignment into one step with the >> goal of avoiding outright assignments that don't go via foo_hold() or >> fooref() for refcounted objects. > > In the long-term, explicit references to proc0, prison0, thread0, > filedesc0, ... all make me rather nervous. I'd rather that all these > things were linked to either the credentials of the file system mount, > the user thread, or perhaps gssd in some cases. From the perspective if > virtualization, the file system mount credential seems the most likely > candidate. Do we want some better standard for creating these daemon creds than hand-rolling them from crget? Both NFS export and GSS seems to have a user and group list passed in, so it's more than a matter of using the current cred - perhaps some superset of change_ruid. - Jamie From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 19:48:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D85A1065672; Mon, 28 Sep 2009 19:48:17 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CBCD8FC08; Mon, 28 Sep 2009 19:48:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SJmH2e064178; Mon, 28 Sep 2009 19:48:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SJmHJq064176; Mon, 28 Sep 2009 19:48:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909281948.n8SJmHJq064176@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Sep 2009 19:48: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: r197587 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 19:48:17 -0000 Author: yongari Date: Mon Sep 28 19:48:17 2009 New Revision: 197587 URL: http://svn.freebsd.org/changeset/base/197587 Log: Don't encode model id twice. Reported by: Kristof Provost sigsegv dot be> Modified: head/sys/dev/mii/e1000phy.c Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Mon Sep 28 19:40:16 2009 (r197586) +++ head/sys/dev/mii/e1000phy.c Mon Sep 28 19:48:17 2009 (r197587) @@ -248,7 +248,7 @@ e1000phy_reset(struct mii_softc *sc) } } - switch (MII_MODEL(esc->mii_model)) { + switch (esc->mii_model) { case MII_MODEL_MARVELL_E3082: case MII_MODEL_MARVELL_E1112: case MII_MODEL_MARVELL_E1118: From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 19:53:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BAD7106566C; Mon, 28 Sep 2009 19:53:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2098FC0A; Mon, 28 Sep 2009 19:53:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SJrsBq064347; Mon, 28 Sep 2009 19:53:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SJrssD064345; Mon, 28 Sep 2009 19:53:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909281953.n8SJrssD064345@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Sep 2009 19:53: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: r197588 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 19:53:54 -0000 Author: yongari Date: Mon Sep 28 19:53:53 2009 New Revision: 197588 URL: http://svn.freebsd.org/changeset/base/197588 Log: Some fiber PHY(88E1112) does not seem to set resolved speed so always assume we've got IFM_1000_SX. Modified: head/sys/dev/mii/e1000phy.c Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Mon Sep 28 19:48:17 2009 (r197587) +++ head/sys/dev/mii/e1000phy.c Mon Sep 28 19:53:53 2009 (r197588) @@ -485,8 +485,11 @@ e1000phy_status(struct mii_softc *sc) return; } } else { - if (ssr & E1000_SSR_1000MBS) - mii->mii_media_active |= IFM_1000_SX; + /* + * Some fiber PHY(88E1112) does not seem to set resolved + * speed so always assume we've got IFM_1000_SX. + */ + mii->mii_media_active |= IFM_1000_SX; } if (ssr & E1000_SSR_DUPLEX) From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 20:03:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D78591065672; Mon, 28 Sep 2009 20:03:37 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C698B8FC08; Mon, 28 Sep 2009 20:03:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SK3bNu064601; Mon, 28 Sep 2009 20:03:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SK3bmn064599; Mon, 28 Sep 2009 20:03:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909282003.n8SK3bmn064599@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Sep 2009 20:03:37 +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: r197589 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 20:03:37 -0000 Author: yongari Date: Mon Sep 28 20:03:37 2009 New Revision: 197589 URL: http://svn.freebsd.org/changeset/base/197589 Log: Fix MIB statistics clear routine. This should fix alignment errors on sparc64. Reported by: Garrett Damore < gdamore <> opensolaris dot org > Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Mon Sep 28 19:53:53 2009 (r197588) +++ head/sys/dev/msk/if_msk.c Mon Sep 28 20:03:37 2009 (r197589) @@ -4188,7 +4188,7 @@ msk_stats_clear(struct msk_if_softc *sc_ gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_PHY_ADDR); GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); /* Read all MIB Counters with Clear Mode set. */ - for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i++) + for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i += sizeof(uint32_t)) reg = MSK_READ_MIB32(sc_if->msk_port, i); /* Clear MIB Clear Counter Mode. */ gmac &= ~GM_PAR_MIB_CLR; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 21:03:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 875AB1065693; Mon, 28 Sep 2009 21:03:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7574B8FC08; Mon, 28 Sep 2009 21:03:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SL3Suw065739; Mon, 28 Sep 2009 21:03:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SL3Scl065734; Mon, 28 Sep 2009 21:03:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909282103.n8SL3Scl065734@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Sep 2009 21:03: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: r197590 - in head/sys/dev: mii msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 21:03:28 -0000 Author: yongari Date: Mon Sep 28 21:03:28 2009 New Revision: 197590 URL: http://svn.freebsd.org/changeset/base/197590 Log: Add hack to pass controller specific information to phy driver. Unlike most other PHYs there is no easy way to know which media type the PHY supports on Marvell PHYs. MIIF_HAVEFIBER flags is now passed via bus-specific instance variable of a device. While I'm here add 88E1112 specific work around to set SIGDET polarity low. Many thanks "Eugene Perevyazko dnepro dot net>" who kindly gave remote access to system with DGE-560SX. Modified: head/sys/dev/mii/e1000phy.c head/sys/dev/mii/e1000phyreg.h head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Mon Sep 28 20:03:37 2009 (r197589) +++ head/sys/dev/mii/e1000phy.c Mon Sep 28 21:03:28 2009 (r197590) @@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include "miidevs.h" #include +/* XXX */ +#include +#include #include "miibus_if.h" @@ -68,6 +71,7 @@ static int e1000phy_attach(device_t); struct e1000phy_softc { struct mii_softc mii_sc; int mii_model; + struct msk_mii_data *mmd; }; static device_method_t e1000phy_methods[] = { @@ -130,6 +134,7 @@ e1000phy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; + struct ifnet *ifp; esc = device_get_softc(dev); sc = &esc->mii_sc; @@ -145,6 +150,16 @@ e1000phy_attach(device_t dev) mii->mii_instance++; esc->mii_model = MII_MODEL(ma->mii_id2); + ifp = sc->mii_pdata->mii_ifp; + if (strcmp(ifp->if_dname, "msk") == 0) { + /* XXX */ + esc->mmd = device_get_ivars( + device_get_parent(device_get_parent(dev))); + if (esc->mmd != NULL && + (esc->mmd->mii_flags & MIIF_HAVEFIBER) != 0) + sc->mii_flags |= MIIF_HAVEFIBER; + } + switch (esc->mii_model) { case MII_MODEL_MARVELL_E1011: case MII_MODEL_MARVELL_E1112: @@ -199,6 +214,13 @@ e1000phy_reset(struct mii_softc *sc) reg &= ~E1000_SCR_MODE_MASK; reg |= E1000_SCR_MODE_1000BX; PHY_WRITE(sc, E1000_SCR, reg); + if (esc->mmd != NULL && esc->mmd->pmd == 'P') { + /* Set SIGDET polarity low for SFP module. */ + PHY_WRITE(sc, E1000_EADR, 1); + reg = PHY_READ(sc, E1000_SCR); + reg |= E1000_SCR_FIB_SIGDET_POLARITY; + PHY_WRITE(sc, E1000_SCR, reg); + } PHY_WRITE(sc, E1000_EADR, page); } } else { Modified: head/sys/dev/mii/e1000phyreg.h ============================================================================== --- head/sys/dev/mii/e1000phyreg.h Mon Sep 28 20:03:37 2009 (r197589) +++ head/sys/dev/mii/e1000phyreg.h Mon Sep 28 21:03:28 2009 (r197590) @@ -248,6 +248,11 @@ #define E1000_SCR_EN_DETECT_MASK 0x0300 +/* 88E1112 page 1 fiber specific control */ +#define E1000_SCR_FIB_TX_DIS 0x0008 +#define E1000_SCR_FIB_SIGDET_POLARITY 0x0200 +#define E1000_SCR_FIB_FORCE_LINK 0x0400 + /* 88E1112 page 2 */ #define E1000_SCR_MODE_MASK 0x0380 #define E1000_SCR_MODE_AUTO 0x0180 Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Mon Sep 28 20:03:37 2009 (r197589) +++ head/sys/dev/msk/if_msk.c Mon Sep 28 21:03:28 2009 (r197590) @@ -1445,6 +1445,7 @@ msk_attach(device_t dev) struct msk_softc *sc; struct msk_if_softc *sc_if; struct ifnet *ifp; + struct msk_mii_data *mmd; int i, port, error; uint8_t eaddr[6]; @@ -1454,7 +1455,8 @@ msk_attach(device_t dev) error = 0; sc_if = device_get_softc(dev); sc = device_get_softc(device_get_parent(dev)); - port = *(int *)device_get_ivars(dev); + mmd = device_get_ivars(dev); + port = mmd->port; sc_if->msk_if_dev = dev; sc_if->msk_port = port; @@ -1600,7 +1602,8 @@ static int mskc_attach(device_t dev) { struct msk_softc *sc; - int error, msic, msir, *port, reg; + struct msk_mii_data *mmd; + int error, msic, msir, reg; sc = device_get_softc(dev); sc->msk_dev = dev; @@ -1669,10 +1672,6 @@ mskc_attach(device_t dev) CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc->msk_pmd = CSR_READ_1(sc, B2_PMD_TYP); - if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S') - sc->msk_coppertype = 0; - else - sc->msk_coppertype = 1; /* Check number of MACs. */ sc->msk_num_port = 1; if ((CSR_READ_1(sc, B2_Y2_HW_RES) & CFG_DUAL_MAC_MSK) == @@ -1812,15 +1811,18 @@ mskc_attach(device_t dev) error = ENXIO; goto fail; } - port = malloc(sizeof(int), M_DEVBUF, M_WAITOK); - if (port == NULL) { + mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); + if (mmd == NULL) { device_printf(dev, "failed to allocate memory for " "ivars of PORT_A\n"); error = ENXIO; goto fail; } - *port = MSK_PORT_A; - device_set_ivars(sc->msk_devs[MSK_PORT_A], port); + mmd->port = MSK_PORT_A; + mmd->pmd = sc->msk_pmd; + if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S' || sc->msk_pmd == 'P') + mmd->mii_flags |= MIIF_HAVEFIBER; + device_set_ivars(sc->msk_devs[MSK_PORT_A], mmd); if (sc->msk_num_port > 1) { sc->msk_devs[MSK_PORT_B] = device_add_child(dev, "msk", -1); @@ -1829,15 +1831,18 @@ mskc_attach(device_t dev) error = ENXIO; goto fail; } - port = malloc(sizeof(int), M_DEVBUF, M_WAITOK); - if (port == NULL) { + mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); + if (mmd == NULL) { device_printf(dev, "failed to allocate memory for " "ivars of PORT_B\n"); error = ENXIO; goto fail; } - *port = MSK_PORT_B; - device_set_ivars(sc->msk_devs[MSK_PORT_B], port); + mmd->port = MSK_PORT_B; + mmd->pmd = sc->msk_pmd; + if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S' || sc->msk_pmd == 'P') + mmd->mii_flags |= MIIF_HAVEFIBER; + device_set_ivars(sc->msk_devs[MSK_PORT_B], mmd); } error = bus_generic_attach(dev); Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Mon Sep 28 20:03:37 2009 (r197589) +++ head/sys/dev/msk/if_mskreg.h Mon Sep 28 21:03:28 2009 (r197590) @@ -2403,6 +2403,12 @@ struct msk_ring_data { #define MSK_TX_TIMEOUT 5 #define MSK_PUT_WM 10 +struct msk_mii_data { + int port; + uint32_t pmd; + int mii_flags; +}; + /* Forward decl. */ struct msk_if_softc; @@ -2466,7 +2472,6 @@ struct msk_softc { uint8_t msk_num_port; int msk_ramsize; /* amount of SRAM on NIC */ uint32_t msk_pmd; /* physical media type */ - uint32_t msk_coppertype; uint32_t msk_intrmask; uint32_t msk_intrhwemask; uint32_t msk_pflags; From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 21:07:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D53E106566C; Mon, 28 Sep 2009 21:07:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C3008FC1C; Mon, 28 Sep 2009 21:07:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SL7Ji9065846; Mon, 28 Sep 2009 21:07:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SL7JXt065844; Mon, 28 Sep 2009 21:07:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909282107.n8SL7JXt065844@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Sep 2009 21: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: r197591 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 21:07:19 -0000 Author: yongari Date: Mon Sep 28 21:07:19 2009 New Revision: 197591 URL: http://svn.freebsd.org/changeset/base/197591 Log: Add workaround for Yukon XL which has hardware bug that can't flush FIFO. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Mon Sep 28 21:03:28 2009 (r197590) +++ head/sys/dev/msk/if_msk.c Mon Sep 28 21:07:19 2009 (r197591) @@ -3799,9 +3799,14 @@ msk_init_locked(struct msk_if_softc *sc_ /* Set receive filter. */ msk_rxfilter(sc_if); - /* Flush Rx MAC FIFO on any flow control or error. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), - GMR_FS_ANY_ERR); + if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { + /* Clear flush mask - HW bug. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), 0); + } else { + /* Flush Rx MAC FIFO on any flow control or error. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), + GMR_FS_ANY_ERR); + } /* * Set Rx FIFO flush threshold to 64 bytes + 1 FIFO word From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 21:11:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44BFD106568D; Mon, 28 Sep 2009 21:11:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 336878FC17; Mon, 28 Sep 2009 21:11:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SLBWVs065986; Mon, 28 Sep 2009 21:11:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SLBWau065983; Mon, 28 Sep 2009 21:11:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909282111.n8SLBWau065983@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Sep 2009 21:11: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: r197592 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 21:11:32 -0000 Author: yongari Date: Mon Sep 28 21:11:31 2009 New Revision: 197592 URL: http://svn.freebsd.org/changeset/base/197592 Log: Add DGE-560SX(Yukon XL) to the supported device list. Many thanks to "Eugene Perevyazko dnepro dot net>" who kindly gave remote access to system with DGE-560SX. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Mon Sep 28 21:07:19 2009 (r197591) +++ head/sys/dev/msk/if_msk.c Mon Sep 28 21:11:31 2009 (r197592) @@ -223,6 +223,8 @@ static struct msk_product { "Marvell Yukon 88E8072 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE550SX, "D-Link 550SX Gigabit Ethernet" }, + { VENDORID_DLINK, DEVICEID_DLINK_DGE560SX, + "D-Link 560SX Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE560T, "D-Link 560T Gigabit Ethernet" } }; Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Mon Sep 28 21:07:19 2009 (r197591) +++ head/sys/dev/msk/if_mskreg.h Mon Sep 28 21:11:31 2009 (r197592) @@ -148,6 +148,7 @@ * D-Link gigabit ethernet device ID */ #define DEVICEID_DLINK_DGE550SX 0x4001 +#define DEVICEID_DLINK_DGE560SX 0x4002 #define DEVICEID_DLINK_DGE560T 0x4b00 #define BIT_31 (1 << 31) From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 21:15:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2A61106566B; Mon, 28 Sep 2009 21:15:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D17068FC18; Mon, 28 Sep 2009 21:15:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SLFvS5066099; Mon, 28 Sep 2009 21:15:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SLFvUT066097; Mon, 28 Sep 2009 21:15:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200909282115.n8SLFvUT066097@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Sep 2009 21: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: r197593 - 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: Mon, 28 Sep 2009 21:15:58 -0000 Author: yongari Date: Mon Sep 28 21:15:57 2009 New Revision: 197593 URL: http://svn.freebsd.org/changeset/base/197593 Log: DGE-560SX is now supported. Modified: head/share/man/man4/msk.4 Modified: head/share/man/man4/msk.4 ============================================================================== --- head/share/man/man4/msk.4 Mon Sep 28 21:11:31 2009 (r197592) +++ head/share/man/man4/msk.4 Mon Sep 28 21:15:57 2009 (r197593) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2009 +.Dd September 28, 2009 .Dt MSK 4 .Os .Sh NAME @@ -158,6 +158,8 @@ Yukon II based Gigabit Ethernet controll .It D-Link 550SX Gigabit Ethernet .It +D-Link 560SX Gigabit Ethernet +.It D-Link 560T Gigabit Ethernet .It Marvell Yukon 88E8021CU Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Mon Sep 28 21:46:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78845106566B; Mon, 28 Sep 2009 21:46:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66BC38FC36; Mon, 28 Sep 2009 21:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SLksAJ066774; Mon, 28 Sep 2009 21:46:54 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SLksXT066771; Mon, 28 Sep 2009 21:46:54 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200909282146.n8SLksXT066771@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 28 Sep 2009 21:46:54 +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: r197594 - vendor/tzdata/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Sep 2009 21:46:54 -0000 Author: edwin Date: Mon Sep 28 21:46:54 2009 New Revision: 197594 URL: http://svn.freebsd.org/changeset/base/197594 Log: Import of tzdata2009n: Pakistan will go out of DST on 1 October 2009. Heads up for upcoming changes in Argentina. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/asia vendor/tzdata/dist/southamerica Modified: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Mon Sep 28 21:15:57 2009 (r197593) +++ vendor/tzdata/dist/asia Mon Sep 28 21:46:54 2009 (r197594) @@ -1,5 +1,5 @@ #
-# @(#)asia	8.40
+# @(#)asia	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1674,8 +1674,15 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # advance clocks in the country by one hour from April 15 to
 # conserve energy"
 
-# From Arthur David Olson (2009-04-10):
-# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
+# From Steffen Thorsen (2009-09-17):
+# "The News International," Pakistan reports that: "The Federal
+# Government has decided to restore the previous time by moving the
+# clocks backward by one hour from October 1. A formal announcement to
+# this effect will be made after the Prime Minister grants approval in
+# this regard." 
+# 
+# http://www.thenews.com.pk/updates.asp?id=87168
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
@@ -1683,7 +1690,7 @@ Rule Pakistan	2002	only	-	Oct	Sun>=2	0:0
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
 Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Oct	1	0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: vendor/tzdata/dist/southamerica
==============================================================================
--- vendor/tzdata/dist/southamerica	Mon Sep 28 21:15:57 2009	(r197593)
+++ vendor/tzdata/dist/southamerica	Mon Sep 28 21:46:54 2009	(r197594)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.36
+# @(#)southamerica	8.37
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -397,7 +397,37 @@ Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:0
 # is that "The province will most likely follow the next daylight saving schedule,
 # which is planned for the second Sunday in October."
 
-#
+# From Alexander Krivenyshev (2009-09-19):
+# Some  Argentinian Provinces (Buenos Aires, Entre Ríos) are opposing to the
+# Daylight Saving Time for the 2009-2010 season.
+#
+# (Spanish)
+# "El cambio de huso horario en Entre Ríos deberá ser aprobado por la
+# Legislatura":
+# 
+# http://www.analisisdigital.com.ar/noticias.php?ed=1&di=0&no=110168
+# 
+# English translation - "The time zone change in Entre Rios must be approved by
+# the Legislature."
+#
+# (Spanish)
+# "Mar del Plata no quiere cambiar la hora."
+# 
+# http://www.mensajeroweb.com.ar/index.php?x=nota/33861/1/mar-del-plata-no-quiere-cambiar-la-hora
+# 
+# English translation - "Mar del Plata is not to change the time"
+#
+# or
+# (some English translation)
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina07.html
+# 
+
+# From Arthur David Olson (2009-09-22):
+# "Mar del Plata no quiere cambiar la hora" translates to
+# "Mar del Plata doesn't want to change the time"
+# (less definitive than "is not to").
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 21:48:17 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E51BF1065676;
	Mon, 28 Sep 2009 21:48:17 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BA6C78FC1F;
	Mon, 28 Sep 2009 21:48:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SLmH2l066848;
	Mon, 28 Sep 2009 21:48:17 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SLmHi5066847;
	Mon, 28 Sep 2009 21:48:17 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200909282148.n8SLmHi5066847@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 28 Sep 2009 21:48:17 +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: r197595 - vendor/tzdata/tzdata2009m/dist
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 21:48:18 -0000

Author: edwin
Date: Mon Sep 28 21:48:17 2009
New Revision: 197595
URL: http://svn.freebsd.org/changeset/base/197595

Log:
  Tag of tzdata2009n.

Added:
  vendor/tzdata/tzdata2009m/dist/
     - copied from r197594, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 21:49:33 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C250E106566B;
	Mon, 28 Sep 2009 21:49:33 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 96F9E8FC18;
	Mon, 28 Sep 2009 21:49:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SLnXFL066910;
	Mon, 28 Sep 2009 21:49:33 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SLnXM9066909;
	Mon, 28 Sep 2009 21:49:33 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200909282149.n8SLnXM9066909@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 28 Sep 2009 21:49:33 +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: r197596 - in vendor/tzdata: tzdata2009m/dist tzdata2009n
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 21:49:33 -0000

Author: edwin
Date: Mon Sep 28 21:49:33 2009
New Revision: 197596
URL: http://svn.freebsd.org/changeset/base/197596

Log:
  Fix faulty tag of tzdata2009n to the right directory.

Added:
  vendor/tzdata/tzdata2009n/
     - copied from r197595, vendor/tzdata/tzdata2009m/dist/
Deleted:
  vendor/tzdata/tzdata2009m/dist/

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 21:53:29 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A04310656A5;
	Mon, 28 Sep 2009 21:53:29 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 283FE8FC1C;
	Mon, 28 Sep 2009 21:53:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SLrT1N067041;
	Mon, 28 Sep 2009 21:53:29 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SLrTR2067038;
	Mon, 28 Sep 2009 21:53:29 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200909282153.n8SLrTR2067038@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 28 Sep 2009 21:53: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: r197597 - head/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 21:53:29 -0000

Author: edwin
Date: Mon Sep 28 21:53:28 2009
New Revision: 197597
URL: http://svn.freebsd.org/changeset/base/197597

Log:
  MFV of tzdata2009n
  
  Pakistan will go out DST on 1 October.
  Headsup for changes in Argentina.

Modified:
  head/share/zoneinfo/   (props changed)
  head/share/zoneinfo/asia
  head/share/zoneinfo/southamerica

Modified: head/share/zoneinfo/asia
==============================================================================
--- head/share/zoneinfo/asia	Mon Sep 28 21:49:33 2009	(r197596)
+++ head/share/zoneinfo/asia	Mon Sep 28 21:53:28 2009	(r197597)
@@ -1,5 +1,5 @@
 # 
-# @(#)asia	8.40
+# @(#)asia	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1674,8 +1674,15 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # advance clocks in the country by one hour from April 15 to
 # conserve energy"
 
-# From Arthur David Olson (2009-04-10):
-# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
+# From Steffen Thorsen (2009-09-17):
+# "The News International," Pakistan reports that: "The Federal
+# Government has decided to restore the previous time by moving the
+# clocks backward by one hour from October 1. A formal announcement to
+# this effect will be made after the Prime Minister grants approval in
+# this regard." 
+# 
+# http://www.thenews.com.pk/updates.asp?id=87168
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
@@ -1683,7 +1690,7 @@ Rule Pakistan	2002	only	-	Oct	Sun>=2	0:0
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
 Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Oct	1	0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: head/share/zoneinfo/southamerica
==============================================================================
--- head/share/zoneinfo/southamerica	Mon Sep 28 21:49:33 2009	(r197596)
+++ head/share/zoneinfo/southamerica	Mon Sep 28 21:53:28 2009	(r197597)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.36
+# @(#)southamerica	8.37
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -397,7 +397,37 @@ Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:0
 # is that "The province will most likely follow the next daylight saving schedule,
 # which is planned for the second Sunday in October."
 
-#
+# From Alexander Krivenyshev (2009-09-19):
+# Some  Argentinian Provinces (Buenos Aires, Entre Ríos) are opposing to the
+# Daylight Saving Time for the 2009-2010 season.
+#
+# (Spanish)
+# "El cambio de huso horario en Entre Ríos deberá ser aprobado por la
+# Legislatura":
+# 
+# http://www.analisisdigital.com.ar/noticias.php?ed=1&di=0&no=110168
+# 
+# English translation - "The time zone change in Entre Rios must be approved by
+# the Legislature."
+#
+# (Spanish)
+# "Mar del Plata no quiere cambiar la hora."
+# 
+# http://www.mensajeroweb.com.ar/index.php?x=nota/33861/1/mar-del-plata-no-quiere-cambiar-la-hora
+# 
+# English translation - "Mar del Plata is not to change the time"
+#
+# or
+# (some English translation)
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina07.html
+# 
+
+# From Arthur David Olson (2009-09-22):
+# "Mar del Plata no quiere cambiar la hora" translates to
+# "Mar del Plata doesn't want to change the time"
+# (less definitive than "is not to").
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 22:03:02 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2427D1065695;
	Mon, 28 Sep 2009 22:03:02 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C55FB8FC19;
	Mon, 28 Sep 2009 22:03:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SM31LF067432;
	Mon, 28 Sep 2009 22:03:01 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SM318J067429;
	Mon, 28 Sep 2009 22:03:01 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200909282203.n8SM318J067429@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 28 Sep 2009 22:03: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: r197598 - stable/7/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 22:03:02 -0000

Author: edwin
Date: Mon Sep 28 22:03:01 2009
New Revision: 197598
URL: http://svn.freebsd.org/changeset/base/197598

Log:
  MFC of r197597
  
  Update to tzdata2009n:
  
  Pakistan will go back from DST at 1 October.
  Headsup for changes in Argentina.

Modified:
  stable/7/share/zoneinfo/   (props changed)
  stable/7/share/zoneinfo/asia
  stable/7/share/zoneinfo/southamerica

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Mon Sep 28 21:53:28 2009	(r197597)
+++ stable/7/share/zoneinfo/asia	Mon Sep 28 22:03:01 2009	(r197598)
@@ -1,5 +1,5 @@
 # 
-# @(#)asia	8.40
+# @(#)asia	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1674,8 +1674,15 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # advance clocks in the country by one hour from April 15 to
 # conserve energy"
 
-# From Arthur David Olson (2009-04-10):
-# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
+# From Steffen Thorsen (2009-09-17):
+# "The News International," Pakistan reports that: "The Federal
+# Government has decided to restore the previous time by moving the
+# clocks backward by one hour from October 1. A formal announcement to
+# this effect will be made after the Prime Minister grants approval in
+# this regard." 
+# 
+# http://www.thenews.com.pk/updates.asp?id=87168
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
@@ -1683,7 +1690,7 @@ Rule Pakistan	2002	only	-	Oct	Sun>=2	0:0
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
 Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Oct	1	0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: stable/7/share/zoneinfo/southamerica
==============================================================================
--- stable/7/share/zoneinfo/southamerica	Mon Sep 28 21:53:28 2009	(r197597)
+++ stable/7/share/zoneinfo/southamerica	Mon Sep 28 22:03:01 2009	(r197598)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.36
+# @(#)southamerica	8.37
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -397,7 +397,37 @@ Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:0
 # is that "The province will most likely follow the next daylight saving schedule,
 # which is planned for the second Sunday in October."
 
-#
+# From Alexander Krivenyshev (2009-09-19):
+# Some  Argentinian Provinces (Buenos Aires, Entre Ríos) are opposing to the
+# Daylight Saving Time for the 2009-2010 season.
+#
+# (Spanish)
+# "El cambio de huso horario en Entre Ríos deberá ser aprobado por la
+# Legislatura":
+# 
+# http://www.analisisdigital.com.ar/noticias.php?ed=1&di=0&no=110168
+# 
+# English translation - "The time zone change in Entre Rios must be approved by
+# the Legislature."
+#
+# (Spanish)
+# "Mar del Plata no quiere cambiar la hora."
+# 
+# http://www.mensajeroweb.com.ar/index.php?x=nota/33861/1/mar-del-plata-no-quiere-cambiar-la-hora
+# 
+# English translation - "Mar del Plata is not to change the time"
+#
+# or
+# (some English translation)
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina07.html
+# 
+
+# From Arthur David Olson (2009-09-22):
+# "Mar del Plata no quiere cambiar la hora" translates to
+# "Mar del Plata doesn't want to change the time"
+# (less definitive than "is not to").
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 22:03:44 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 926291065672;
	Mon, 28 Sep 2009 22:03:44 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 802D08FC19;
	Mon, 28 Sep 2009 22:03:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SM3iws067497;
	Mon, 28 Sep 2009 22:03:44 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SM3i4p067494;
	Mon, 28 Sep 2009 22:03:44 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200909282203.n8SM3i4p067494@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 28 Sep 2009 22:03:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r197599 - stable/6/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 22:03:44 -0000

Author: edwin
Date: Mon Sep 28 22:03:44 2009
New Revision: 197599
URL: http://svn.freebsd.org/changeset/base/197599

Log:
  MFC of r197594
  
  Update to tzdata2009n
  
  Pakistan will go back from DST at 1 October 2009.
  Headsup for changes in Argentina.

Modified:
  stable/6/share/zoneinfo/   (props changed)
  stable/6/share/zoneinfo/asia
  stable/6/share/zoneinfo/southamerica

Modified: stable/6/share/zoneinfo/asia
==============================================================================
--- stable/6/share/zoneinfo/asia	Mon Sep 28 22:03:01 2009	(r197598)
+++ stable/6/share/zoneinfo/asia	Mon Sep 28 22:03:44 2009	(r197599)
@@ -1,5 +1,5 @@
 # 
-# @(#)asia	8.40
+# @(#)asia	8.41
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1674,8 +1674,15 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # advance clocks in the country by one hour from April 15 to
 # conserve energy"
 
-# From Arthur David Olson (2009-04-10):
-# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
+# From Steffen Thorsen (2009-09-17):
+# "The News International," Pakistan reports that: "The Federal
+# Government has decided to restore the previous time by moving the
+# clocks backward by one hour from October 1. A formal announcement to
+# this effect will be made after the Prime Minister grants approval in
+# this regard." 
+# 
+# http://www.thenews.com.pk/updates.asp?id=87168
+# 
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
@@ -1683,7 +1690,7 @@ Rule Pakistan	2002	only	-	Oct	Sun>=2	0:0
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
 Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Oct	1	0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: stable/6/share/zoneinfo/southamerica
==============================================================================
--- stable/6/share/zoneinfo/southamerica	Mon Sep 28 22:03:01 2009	(r197598)
+++ stable/6/share/zoneinfo/southamerica	Mon Sep 28 22:03:44 2009	(r197599)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.36
+# @(#)southamerica	8.37
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -397,7 +397,37 @@ Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:0
 # is that "The province will most likely follow the next daylight saving schedule,
 # which is planned for the second Sunday in October."
 
-#
+# From Alexander Krivenyshev (2009-09-19):
+# Some  Argentinian Provinces (Buenos Aires, Entre Ríos) are opposing to the
+# Daylight Saving Time for the 2009-2010 season.
+#
+# (Spanish)
+# "El cambio de huso horario en Entre Ríos deberá ser aprobado por la
+# Legislatura":
+# 
+# http://www.analisisdigital.com.ar/noticias.php?ed=1&di=0&no=110168
+# 
+# English translation - "The time zone change in Entre Rios must be approved by
+# the Legislature."
+#
+# (Spanish)
+# "Mar del Plata no quiere cambiar la hora."
+# 
+# http://www.mensajeroweb.com.ar/index.php?x=nota/33861/1/mar-del-plata-no-quiere-cambiar-la-hora
+# 
+# English translation - "Mar del Plata is not to change the time"
+#
+# or
+# (some English translation)
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_argentina07.html
+# 
+
+# From Arthur David Olson (2009-09-22):
+# "Mar del Plata no quiere cambiar la hora" translates to
+# "Mar del Plata doesn't want to change the time"
+# (less definitive than "is not to").
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 22:18:39 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 26A071065670;
	Mon, 28 Sep 2009 22:18:39 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 156B88FC14;
	Mon, 28 Sep 2009 22:18:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SMIccV067822;
	Mon, 28 Sep 2009 22:18:38 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SMIcIQ067820;
	Mon, 28 Sep 2009 22:18:38 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200909282218.n8SMIcIQ067820@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Mon, 28 Sep 2009 22:18: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: r197600 - head/sys/dev/alc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 22:18:39 -0000

Author: yongari
Date: Mon Sep 28 22:18:38 2009
New Revision: 197600
URL: http://svn.freebsd.org/changeset/base/197600

Log:
  For AR8132 fast ethernet controller, do not report 1000baseT
  capability to mii(4). Even though AR8132 uses the same model/
  revision number of F1 gigabit PHY, the PHY has no ability to
  establish 1000baseT link. I have no idea why Atheros use the same
  device/model id for this PHY.
  With this change atphy(4) does not report 1000baseT media
  capability and manual 1000baseT configuration is also disabled
  which is more desirable behavior for 10/100Mbps PHY.

Modified:
  head/sys/dev/alc/if_alc.c

Modified: head/sys/dev/alc/if_alc.c
==============================================================================
--- head/sys/dev/alc/if_alc.c	Mon Sep 28 22:03:44 2009	(r197599)
+++ head/sys/dev/alc/if_alc.c	Mon Sep 28 22:18:38 2009	(r197600)
@@ -234,6 +234,16 @@ alc_miibus_readreg(device_t dev, int phy
 	if (phy != sc->alc_phyaddr)
 		return (0);
 
+	/*
+	 * For AR8132 fast ethernet controller, do not report 1000baseT
+	 * capability to mii(4). Even though AR8132 uses the same
+	 * model/revision number of F1 gigabit PHY, the PHY has no
+	 * ability to establish 1000baseT link.
+	 */
+	if ((sc->alc_flags & ALC_FLAG_FASTETHER) != 0 &&
+	    reg == MII_EXTSR)
+		return (0);
+
 	CSR_WRITE_4(sc, ALC_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ |
 	    MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg));
 	for (i = ALC_PHY_TIMEOUT; i > 0; i--) {

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 22:29:29 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3C9C7106568F;
	Mon, 28 Sep 2009 22:29:29 +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 2AAE48FC18;
	Mon, 28 Sep 2009 22:29:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SMTTiQ068089;
	Mon, 28 Sep 2009 22:29:29 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SMTTGM068086;
	Mon, 28 Sep 2009 22:29:29 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200909282229.n8SMTTGM068086@svn.freebsd.org>
From: Xin LI 
Date: Mon, 28 Sep 2009 22:29:29 +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: r197601 - in stable/7/lib/libc: . net resolv
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 22:29:29 -0000

Author: delphij
Date: Mon Sep 28 22:29:28 2009
New Revision: 197601
URL: http://svn.freebsd.org/changeset/base/197601

Log:
  MFC 193023+193024:
  
  Add an option to enforce strict RFC 1034 compliance.
  Document how to enable strict RFC 1034 enforcements.
  
  PR:		kern/129477

Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/net/resolver.3
  stable/7/lib/libc/resolv/res_comp.c

Modified: stable/7/lib/libc/net/resolver.3
==============================================================================
--- stable/7/lib/libc/net/resolver.3	Mon Sep 28 22:18:38 2009	(r197600)
+++ stable/7/lib/libc/net/resolver.3	Mon Sep 28 22:29:28 2009	(r197601)
@@ -28,7 +28,7 @@
 .\"     @(#)resolver.3	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd November 4, 2006
+.Dd May 29, 2009
 .Dt RESOLVER 3
 .Os
 .Sh NAME
@@ -401,6 +401,19 @@ function properly if the programmer atte
 .Va _res
 structure in an attempt to replace the per-thread version referred to
 by that macro.
+.Pp
+The following compile-time option can be specified to change the default
+behavior of resolver routines when necessary.
+.Bl -tag -width RES_ENFORCE_RFC1034
+.It Dv RES_ENFORCE_RFC1034
+If this symbol is defined during compile-time,
+.Fn res_search
+will enforce RFC 1034 check, namely, disallow using of underscore character
+within host names.
+This is used by the standard host lookup routines like
+.Xr gethostbyname 3 .
+For compatibility reasons this option is not enabled by default.
+.El
 .Sh RETURN VALUES
 The
 .Fn res_init

Modified: stable/7/lib/libc/resolv/res_comp.c
==============================================================================
--- stable/7/lib/libc/resolv/res_comp.c	Mon Sep 28 22:18:38 2009	(r197600)
+++ stable/7/lib/libc/resolv/res_comp.c	Mon Sep 28 22:29:28 2009	(r197601)
@@ -148,7 +148,11 @@ dn_skipname(const u_char *ptr, const u_c
 #define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
 
 #define borderchar(c) (alphachar(c) || digitchar(c))
+#ifdef	RES_ENFORCE_RFC1034
+#define middlechar(c) (borderchar(c) || hyphenchar(c))
+#else
 #define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c))
+#endif
 #define	domainchar(c) ((c) > 0x20 && (c) < 0x7f)
 
 int

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 22:31:30 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4BC0F106566B;
	Mon, 28 Sep 2009 22:31:30 +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 209718FC17;
	Mon, 28 Sep 2009 22:31:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SMVUih068200;
	Mon, 28 Sep 2009 22:31:30 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SMVU1b068197;
	Mon, 28 Sep 2009 22:31:30 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200909282231.n8SMVU1b068197@svn.freebsd.org>
From: Xin LI 
Date: Mon, 28 Sep 2009 22:31:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r197602 - in stable/6/lib/libc: . net resolv
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 22:31:30 -0000

Author: delphij
Date: Mon Sep 28 22:31:29 2009
New Revision: 197602
URL: http://svn.freebsd.org/changeset/base/197602

Log:
  MFC 193023+193024:
  
  Add an option to enforce strict RFC 1034 compliance.
  Document how to enable strict RFC 1034 enforcements.
  
  PR:		kern/129477

Modified:
  stable/6/lib/libc/   (props changed)
  stable/6/lib/libc/net/resolver.3
  stable/6/lib/libc/resolv/res_comp.c

Modified: stable/6/lib/libc/net/resolver.3
==============================================================================
--- stable/6/lib/libc/net/resolver.3	Mon Sep 28 22:29:28 2009	(r197601)
+++ stable/6/lib/libc/net/resolver.3	Mon Sep 28 22:31:29 2009	(r197602)
@@ -32,7 +32,7 @@
 .\"     @(#)resolver.3	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd November 4, 2006
+.Dd May 29, 2009
 .Dt RESOLVER 3
 .Os
 .Sh NAME
@@ -405,6 +405,19 @@ function properly if the programmer atte
 .Va _res
 structure in an attempt to replace the per-thread version referred to
 by that macro.
+.Pp
+The following compile-time option can be specified to change the default
+behavior of resolver routines when necessary.
+.Bl -tag -width RES_ENFORCE_RFC1034
+.It Dv RES_ENFORCE_RFC1034
+If this symbol is defined during compile-time,
+.Fn res_search
+will enforce RFC 1034 check, namely, disallow using of underscore character
+within host names.
+This is used by the standard host lookup routines like
+.Xr gethostbyname 3 .
+For compatibility reasons this option is not enabled by default.
+.El
 .Sh RETURN VALUES
 The
 .Fn res_init

Modified: stable/6/lib/libc/resolv/res_comp.c
==============================================================================
--- stable/6/lib/libc/resolv/res_comp.c	Mon Sep 28 22:29:28 2009	(r197601)
+++ stable/6/lib/libc/resolv/res_comp.c	Mon Sep 28 22:31:29 2009	(r197602)
@@ -152,7 +152,11 @@ dn_skipname(const u_char *ptr, const u_c
 #define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
 
 #define borderchar(c) (alphachar(c) || digitchar(c))
+#ifdef	RES_ENFORCE_RFC1034
+#define middlechar(c) (borderchar(c) || hyphenchar(c))
+#else
 #define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c))
+#endif
 #define	domainchar(c) ((c) > 0x20 && (c) < 0x7f)
 
 int

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 22:37:08 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E5161065679;
	Mon, 28 Sep 2009 22:37:08 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AE3868FC25;
	Mon, 28 Sep 2009 22:37:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SMb7gT068338;
	Mon, 28 Sep 2009 22:37:07 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SMb7XF068335;
	Mon, 28 Sep 2009 22:37:07 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200909282237.n8SMb7XF068335@svn.freebsd.org>
From: Robert Noland 
Date: Mon, 28 Sep 2009 22:37: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: r197603 - head/sys/dev/drm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 22:37:08 -0000

Author: rnoland
Date: Mon Sep 28 22:37:07 2009
New Revision: 197603
URL: http://svn.freebsd.org/changeset/base/197603

Log:
  R600 doesn't support IRQs yet, so don't try to use them.
  
  MFC after:	1 week

Modified:
  head/sys/dev/drm/radeon_irq.c
  head/sys/dev/drm/radeon_state.c

Modified: head/sys/dev/drm/radeon_irq.c
==============================================================================
--- head/sys/dev/drm/radeon_irq.c	Mon Sep 28 22:31:29 2009	(r197602)
+++ head/sys/dev/drm/radeon_irq.c	Mon Sep 28 22:37:07 2009	(r197603)
@@ -194,6 +194,9 @@ irqreturn_t radeon_driver_irq_handler(DR
 	u32 r500_disp_int;
 	u32 tmp;
 
+	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
+		return IRQ_NONE;
+
 	/* Only consider the bits we're interested in - others could be used
 	 * outside the DRM
 	 */
@@ -323,6 +326,9 @@ int radeon_irq_emit(struct drm_device *d
 	drm_radeon_irq_emit_t *emit = data;
 	int result;
 
+	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
+		return -EINVAL;
+
 	LOCK_TEST_WITH_RETURN(dev, file_priv);
 
 	if (!dev_priv) {
@@ -363,6 +369,9 @@ void radeon_driver_irq_preinstall(struct
 	    (drm_radeon_private_t *) dev->dev_private;
 	u32 dummy;
 
+	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
+		return;
+
 	/* Disable *all* interrupts */
 	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600)
 		RADEON_WRITE(R500_DxMODE_INT_MASK, 0);
@@ -380,6 +389,9 @@ int radeon_driver_irq_postinstall(struct
 	atomic_set(&dev_priv->swi_emitted, 0);
 	DRM_INIT_WAITQUEUE(&dev_priv->swi_queue);
 
+	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
+		return 0;
+
 	radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1);
 
 	return 0;
@@ -394,6 +406,9 @@ void radeon_driver_irq_uninstall(struct 
 
 	dev_priv->irq_enabled = 0;
 
+	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
+		return;
+
 	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600)
 		RADEON_WRITE(R500_DxMODE_INT_MASK, 0);
 	/* Disable *all* interrupts */

Modified: head/sys/dev/drm/radeon_state.c
==============================================================================
--- head/sys/dev/drm/radeon_state.c	Mon Sep 28 22:31:29 2009	(r197602)
+++ head/sys/dev/drm/radeon_state.c	Mon Sep 28 22:37:07 2009	(r197603)
@@ -3024,7 +3024,10 @@ static int radeon_cp_getparam(struct drm
 		value = GET_SCRATCH(dev_priv, 2);
 		break;
 	case RADEON_PARAM_IRQ_NR:
-		value = dev->irq;
+		if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
+			value = 0;
+		else
+			value = dev->irq;
 		break;
 	case RADEON_PARAM_GART_BASE:
 		value = dev_priv->gart_vm_start;

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 22:38:44 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C702E106566C;
	Mon, 28 Sep 2009 22:38:44 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B62BE8FC1D;
	Mon, 28 Sep 2009 22:38:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SMci8d068397;
	Mon, 28 Sep 2009 22:38:44 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SMciLf068395;
	Mon, 28 Sep 2009 22:38:44 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200909282238.n8SMciLf068395@svn.freebsd.org>
From: Robert Noland 
Date: Mon, 28 Sep 2009 22:38: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: r197604 - head/sys/dev/drm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 22:38:44 -0000

Author: rnoland
Date: Mon Sep 28 22:38:44 2009
New Revision: 197604
URL: http://svn.freebsd.org/changeset/base/197604

Log:
  Fix blit pitch for 4 byte transfers on r600.
  
  MFC after:	1 week

Modified:
  head/sys/dev/drm/r600_blit.c

Modified: head/sys/dev/drm/r600_blit.c
==============================================================================
--- head/sys/dev/drm/r600_blit.c	Mon Sep 28 22:37:07 2009	(r197603)
+++ head/sys/dev/drm/r600_blit.c	Mon Sep 28 22:38:44 2009	(r197604)
@@ -1876,7 +1876,7 @@ r600_blit_copy(struct drm_device *dev,
 
 			/* dst */
 			set_render_target(dev_priv, COLOR_8_8_8_8,
-					  dst_x + cur_size, h,
+					  (dst_x + cur_size) / 4, h,
 					  dst_gpu_addr);
 
 			/* scissors */

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 22:40:30 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39374106566C;
	Mon, 28 Sep 2009 22:40:30 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 287758FC1C;
	Mon, 28 Sep 2009 22:40:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SMeUKr068466;
	Mon, 28 Sep 2009 22:40:30 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SMeUHw068464;
	Mon, 28 Sep 2009 22:40:30 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200909282240.n8SMeUHw068464@svn.freebsd.org>
From: Robert Noland 
Date: Mon, 28 Sep 2009 22:40: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: r197605 - head/sys/dev/drm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 22:40:30 -0000

Author: rnoland
Date: Mon Sep 28 22:40:29 2009
New Revision: 197605
URL: http://svn.freebsd.org/changeset/base/197605

Log:
  radeon_family is an enum, so ordering can be important.
  
  sync up with what amd is shipping.
  
  MFC after:	1 week

Modified:
  head/sys/dev/drm/radeon_drv.h

Modified: head/sys/dev/drm/radeon_drv.h
==============================================================================
--- head/sys/dev/drm/radeon_drv.h	Mon Sep 28 22:38:44 2009	(r197604)
+++ head/sys/dev/drm/radeon_drv.h	Mon Sep 28 22:40:29 2009	(r197605)
@@ -143,15 +143,15 @@ enum radeon_family {
 	CHIP_R600,
 	CHIP_RV610,
 	CHIP_RV630,
+	CHIP_RV670,
 	CHIP_RV620,
 	CHIP_RV635,
-	CHIP_RV670,
 	CHIP_RS780,
 	CHIP_RS880,
 	CHIP_RV770,
-	CHIP_RV740,
 	CHIP_RV730,
 	CHIP_RV710,
+	CHIP_RV740,
 	CHIP_LAST,
 };
 

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 22:41:28 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EFB6F1065670;
	Mon, 28 Sep 2009 22:41:28 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C55FA8FC13;
	Mon, 28 Sep 2009 22:41:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SMfSR2068521;
	Mon, 28 Sep 2009 22:41:28 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SMfSAQ068519;
	Mon, 28 Sep 2009 22:41:28 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200909282241.n8SMfSAQ068519@svn.freebsd.org>
From: Robert Noland 
Date: Mon, 28 Sep 2009 22:41: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: r197606 - head/sys/dev/drm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 22:41:29 -0000

Author: rnoland
Date: Mon Sep 28 22:41:28 2009
New Revision: 197606
URL: http://svn.freebsd.org/changeset/base/197606

Log:
  Fix offset handling
  
  MFC after:	1 week

Modified:
  head/sys/dev/drm/radeon_cs.c

Modified: head/sys/dev/drm/radeon_cs.c
==============================================================================
--- head/sys/dev/drm/radeon_cs.c	Mon Sep 28 22:40:29 2009	(r197605)
+++ head/sys/dev/drm/radeon_cs.c	Mon Sep 28 22:41:28 2009	(r197606)
@@ -403,8 +403,8 @@ static inline int r600_cs_packet3(struct
 			DRM_ERROR("bad DRAW_INDEX\n");
 			break;
 		}
-		ib_chunk->kdata[offset_dw + 1] = (offset & 0xffffffff);
-		ib_chunk->kdata[offset_dw + 2] = (upper_32_bits(offset) & 0xff);
+		ib_chunk->kdata[offset_dw + 1] += (offset & 0xffffffff);
+		ib_chunk->kdata[offset_dw + 2] += (upper_32_bits(offset) & 0xff);
 		break;
 	case R600_IT_DRAW_INDEX_AUTO:
 		//DRM_INFO("R600_IT_DRAW_INDEX_AUTO\n");
@@ -433,8 +433,8 @@ static inline int r600_cs_packet3(struct
 				DRM_ERROR("bad WAIT_REG_MEM\n");
 				break;
 			}
-			ib_chunk->kdata[offset_dw + 2] = (offset & 0xffffffff);
-			ib_chunk->kdata[offset_dw + 3] = (upper_32_bits(offset) & 0xff);
+			ib_chunk->kdata[offset_dw + 2] += (offset & 0xffffffff);
+			ib_chunk->kdata[offset_dw + 3] += (upper_32_bits(offset) & 0xff);
 		}
 		if (ret)
 			DRM_ERROR("bad WAIT_REG_MEM\n");
@@ -469,7 +469,7 @@ static inline int r600_cs_packet3(struct
 				break;
 			}
 			ib_chunk->kdata[offset_dw + 2] += (offset & 0xffffffff);
-			ib_chunk->kdata[offset_dw + 3] |= (upper_32_bits(offset) & 0xff);
+			ib_chunk->kdata[offset_dw + 3] += (upper_32_bits(offset) & 0xff);
 		}
 		if (ret)
 			DRM_ERROR("bad EVENT_WRITE\n");
@@ -488,7 +488,7 @@ static inline int r600_cs_packet3(struct
 			break;
 		}
 		ib_chunk->kdata[offset_dw + 2] += (offset & 0xffffffff);
-		ib_chunk->kdata[offset_dw + 3] |= (upper_32_bits(offset) & 0xff);
+		ib_chunk->kdata[offset_dw + 3] += (upper_32_bits(offset) & 0xff);
 		break;
 	case R600_IT_SET_CONFIG_REG:
 		//DRM_INFO("R600_IT_SET_CONFIG_REG\n");
@@ -628,7 +628,7 @@ static inline int r600_cs_packet3(struct
 					if (ret)
 						break;
 					ib_chunk->kdata[offset_dw + (i * 7) + 0 + 2] += (offset & 0xffffffff);
-					ib_chunk->kdata[offset_dw + (i * 7) + 2 + 2] |= (upper_32_bits(offset) & 0xff);
+					ib_chunk->kdata[offset_dw + (i * 7) + 2 + 2] += (upper_32_bits(offset) & 0xff);
 					break;
 				}
 				if (ret)

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 23:48:16 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AF9D4106566C;
	Mon, 28 Sep 2009 23:48:16 +0000 (UTC)
	(envelope-from gallatin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9C6018FC1E;
	Mon, 28 Sep 2009 23:48:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SNmGD8069860;
	Mon, 28 Sep 2009 23:48:16 GMT
	(envelope-from gallatin@svn.freebsd.org)
Received: (from gallatin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SNmGd7069858;
	Mon, 28 Sep 2009 23:48:16 GMT
	(envelope-from gallatin@svn.freebsd.org)
Message-Id: <200909282348.n8SNmGd7069858@svn.freebsd.org>
From: Andrew Gallatin 
Date: Mon, 28 Sep 2009 23:48: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: r197607 - in stable/8/sys: . amd64/include/xen
	cddl/contrib/opensolaris contrib/dev/acpica contrib/pf
	dev/mxge dev/xen/xenpci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 28 Sep 2009 23:48:16 -0000

Author: gallatin
Date: Mon Sep 28 23:48:16 2009
New Revision: 197607
URL: http://svn.freebsd.org/changeset/base/197607

Log:
  MFC 197395: Improve mxge watchdog routine's ability to reliably reset a failed NIC
  
  Approved by: re (kib)

Modified:
  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/mxge/if_mxge.c
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/mxge/if_mxge.c
==============================================================================
--- stable/8/sys/dev/mxge/if_mxge.c	Mon Sep 28 22:41:28 2009	(r197606)
+++ stable/8/sys/dev/mxge/if_mxge.c	Mon Sep 28 23:48:16 2009	(r197607)
@@ -143,7 +143,7 @@ MODULE_DEPEND(mxge, zlib, 1, 1, 1);
 
 static int mxge_load_firmware(mxge_softc_t *sc, int adopt);
 static int mxge_send_cmd(mxge_softc_t *sc, uint32_t cmd, mxge_cmd_t *data);
-static int mxge_close(mxge_softc_t *sc);
+static int mxge_close(mxge_softc_t *sc, int down);
 static int mxge_open(mxge_softc_t *sc);
 static void mxge_tick(void *arg);
 
@@ -1305,8 +1305,7 @@ mxge_reset(mxge_softc_t *sc, int interru
 		ss->lro_queued = 0;
 		ss->lro_flushed = 0;
 		if (ss->fw_stats != NULL) {
-			ss->fw_stats->valid = 0;
-			ss->fw_stats->send_done_count = 0;
+			bzero(ss->fw_stats, sizeof *ss->fw_stats);
 		}
 	}
 	sc->rdma_tags_available = 15;
@@ -1379,7 +1378,7 @@ mxge_change_lro_locked(mxge_softc_t *sc,
 		ifp->if_capenable |= IFCAP_LRO;
 	sc->lro_cnt = lro_cnt;
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-		mxge_close(sc);
+		mxge_close(sc, 0);
 		err = mxge_open(sc);
 	}
 	return err;
@@ -1495,6 +1494,10 @@ mxge_add_sysctls(mxge_softc_t *sc)
 		       "read_write_dma_MBs",
 		       CTLFLAG_RD, &sc->read_write_dma,
 		       0, "DMA concurrent Read/Write speed in MB/s");
+	SYSCTL_ADD_INT(ctx, children, OID_AUTO, 
+		       "watchdog_resets",
+		       CTLFLAG_RD, &sc->watchdog_resets,
+		       0, "Number of times NIC was reset");
 
 
 	/* performance related tunables */
@@ -3600,7 +3603,7 @@ abort:
 }
 
 static int
-mxge_close(mxge_softc_t *sc)
+mxge_close(mxge_softc_t *sc, int down)
 {
 	mxge_cmd_t cmd;
 	int err, old_down_cnt;
@@ -3617,21 +3620,23 @@ mxge_close(mxge_softc_t *sc)
 	}
 #endif
 	sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-	old_down_cnt = sc->down_cnt;
-	wmb();
-	err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_DOWN, &cmd);
-	if (err) {
-		device_printf(sc->dev, "Couldn't bring down link\n");
-	}
-	if (old_down_cnt == sc->down_cnt) {
-		/* wait for down irq */
-		DELAY(10 * sc->intr_coal_delay);
-	}
-	wmb();
-	if (old_down_cnt == sc->down_cnt) {
-		device_printf(sc->dev, "never got down irq\n");
+	if (!down) {
+		old_down_cnt = sc->down_cnt;
+		wmb();
+		err = mxge_send_cmd(sc, MXGEFW_CMD_ETHERNET_DOWN, &cmd);
+		if (err) {
+			device_printf(sc->dev,
+				      "Couldn't bring down link\n");
+		}
+		if (old_down_cnt == sc->down_cnt) {
+			/* wait for down irq */
+			DELAY(10 * sc->intr_coal_delay);
+		}
+		wmb();
+		if (old_down_cnt == sc->down_cnt) {
+			device_printf(sc->dev, "never got down irq\n");
+		}
 	}
-
 	mxge_free_mbufs(sc);
 
 	return 0;
@@ -3684,8 +3689,9 @@ static int
 mxge_watchdog_reset(mxge_softc_t *sc, int slice)
 {
 	struct pci_devinfo *dinfo;
+	struct mxge_slice_state *ss;
 	mxge_tx_ring_t *tx;
-	int err;
+	int err, running, s, num_tx_slices = 1;
 	uint32_t reboot;
 	uint16_t cmd;
 
@@ -3719,6 +3725,30 @@ mxge_watchdog_reset(mxge_softc_t *sc, in
 		reboot = mxge_read_reboot(sc);
 		device_printf(sc->dev, "NIC rebooted, status = 0x%x\n",
 			      reboot);
+		running = sc->ifp->if_drv_flags & IFF_DRV_RUNNING;
+		if (running) {
+
+			/* 
+			 * quiesce NIC so that TX routines will not try to
+			 * xmit after restoration of BAR
+			 */
+
+			/* Mark the link as down */
+			if (sc->link_state) {
+				sc->link_state = 0;
+				if_link_state_change(sc->ifp,
+						     LINK_STATE_DOWN);
+			}
+#ifdef IFNET_BUF_RING
+			num_tx_slices = sc->num_slices;
+#endif
+			/* grab all TX locks to ensure no tx  */
+			for (s = 0; s < num_tx_slices; s++) {
+				ss = &sc->ss[s];
+				mtx_lock(&ss->tx.mtx);
+			}
+			mxge_close(sc, 1);
+		}
 		/* restore PCI configuration space */
 		dinfo = device_get_ivars(sc->dev);
 		pci_cfg_restore(sc->dev, dinfo);
@@ -3726,10 +3756,22 @@ mxge_watchdog_reset(mxge_softc_t *sc, in
 		/* and redo any changes we made to our config space */
 		mxge_setup_cfg_space(sc);
 
-		if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) {
-			mxge_close(sc);
-			err = mxge_open(sc);
+		/* reload f/w */
+		err = mxge_load_firmware(sc, 0);
+		if (err) {
+			device_printf(sc->dev,
+				      "Unable to re-load f/w\n");
 		}
+		if (running) {
+			if (!err)
+				err = mxge_open(sc);
+			/* release all TX locks */
+			for (s = 0; s < num_tx_slices; s++) {
+				ss = &sc->ss[s];
+				mtx_unlock(&ss->tx.mtx);
+			}
+		}
+		sc->watchdog_resets++;
 	} else {
 		tx = &sc->ss[slice].tx;
 		device_printf(sc->dev,
@@ -3745,6 +3787,9 @@ mxge_watchdog_reset(mxge_softc_t *sc, in
 			      be32toh(sc->ss->fw_stats->send_done_count));
 		device_printf(sc->dev, "not resetting\n");
 	}
+	if (err)
+		device_printf(sc->dev, "watchdog reset failed\n");
+
 	return (err);
 }
 
@@ -3860,11 +3905,11 @@ mxge_change_mtu(mxge_softc_t *sc, int mt
 	old_mtu = ifp->if_mtu;
 	ifp->if_mtu = mtu;
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-		mxge_close(sc);
+		mxge_close(sc, 0);
 		err = mxge_open(sc);
 		if (err != 0) {
 			ifp->if_mtu = old_mtu;
-			mxge_close(sc);
+			mxge_close(sc, 0);
 			(void) mxge_open(sc);
 		}
 	}
@@ -3922,7 +3967,7 @@ mxge_ioctl(struct ifnet *ifp, u_long com
 			}
 		} else {
 			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-				mxge_close(sc);
+				mxge_close(sc, 0);
 			}
 		}
 		mtx_unlock(&sc->driver_mtx);
@@ -4645,7 +4690,7 @@ mxge_detach(device_t dev)
 	mtx_lock(&sc->driver_mtx);
 	sc->dying = 1;
 	if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING)
-		mxge_close(sc);
+		mxge_close(sc, 0);
 	mtx_unlock(&sc->driver_mtx);
 	ether_ifdetach(sc->ifp);
 	callout_drain(&sc->co_hdl);

From owner-svn-src-all@FreeBSD.ORG  Mon Sep 28 23:52:47 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E74B106566B;
	Mon, 28 Sep 2009 23:52:47 +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 4E09F8FC08;
	Mon, 28 Sep 2009 23:52:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8SNqla0069972;
	Mon, 28 Sep 2009 23:52:47 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8SNql1n069970;
	Mon, 28 Sep 2009 23:52:47 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200909282352.n8SNql1n069970@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Mon, 28 Sep 2009 23:52: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: r197608 - 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: Mon, 28 Sep 2009 23:52:47 -0000

Author: marcel
Date: Mon Sep 28 23:52:47 2009
New Revision: 197608
URL: http://svn.freebsd.org/changeset/base/197608

Log:
  The first 96 bytes may not be zeroes. It can contain trivial boot
  code that merely emits an error and waits for a key press before
  rebooting. The error being that extended partitions are not
  bootable. The origin is presumed to be Windows 2000; Windows XP
  does not do this...
  
  For now, ignore the first 96 bytes when checking that the EBR is
  (for the most part) all zeroes.
  
  Tested by:	Mario Lobo 
  MFC after:	1 week

Modified:
  head/sys/geom/part/g_part_ebr.c

Modified: head/sys/geom/part/g_part_ebr.c
==============================================================================
--- head/sys/geom/part/g_part_ebr.c	Mon Sep 28 23:48:16 2009	(r197607)
+++ head/sys/geom/part/g_part_ebr.c	Mon Sep 28 23:52:47 2009	(r197608)
@@ -410,13 +410,13 @@ g_part_ebr_probe(struct g_part_table *ta
 		goto out;
 
 	/*
-	 * The sector is all zeroes, except for the partition entries
-	 * and some signatures or disk serial number. Those can be
-	 * found in the 9 bytes immediately in front of the partition
-	 * table.
+	 * The sector is all zeroes, except for the partition entries,
+	 * pseudo boot code and some signatures or disk serial number.
+	 * The latter can be found in the 9 bytes immediately in front
+	 * of the partition table.
 	 */
 	sum = 0;
-	for (index = 0; index < DOSPARTOFF - 9; index++)
+	for (index = 96; index < DOSPARTOFF - 9; index++)
 		sum += buf[index];
 	if (sum != 0)
 		goto out;

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 09:36:38 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F20761065672;
	Tue, 29 Sep 2009 09:36:38 +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 E19198FC13;
	Tue, 29 Sep 2009 09:36:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8T9acLF080713;
	Tue, 29 Sep 2009 09:36:38 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8T9ac1Q080710;
	Tue, 29 Sep 2009 09:36:38 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200909290936.n8T9ac1Q080710@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 29 Sep 2009 09:36: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: r197611 - 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: Tue, 29 Sep 2009 09:36:39 -0000

Author: mav
Date: Tue Sep 29 09:36:38 2009
New Revision: 197611
URL: http://svn.freebsd.org/changeset/base/197611

Log:
  Add some bits of HDMI/DisplayPort support from later specification updates.
  It may be not enough to make them work, but at least should give some
  information about these beasts.

Modified:
  head/sys/dev/sound/pci/hda/hda_reg.h
  head/sys/dev/sound/pci/hda/hdac.c

Modified: head/sys/dev/sound/pci/hda/hda_reg.h
==============================================================================
--- head/sys/dev/sound/pci/hda/hda_reg.h	Tue Sep 29 08:00:45 2009	(r197610)
+++ head/sys/dev/sound/pci/hda/hda_reg.h	Tue Sep 29 09:36:38 2009	(r197611)
@@ -660,13 +660,49 @@
 #define HDA_CMD_VERB_GET_STRIPE_CONTROL			0xf24
 #define HDA_CMD_VERB_SET_STRIPE_CONTROL			0x724
 
-#define HDA_CMD_SET_STRIPE_CONTROL(cad, nid)				\
+#define HDA_CMD_GET_STRIPE_CONTROL(cad, nid)				\
     (HDA_CMD_12BIT((cad), (nid),					\
     HDA_CMD_VERB_GET_STRIPE_CONTROL, 0x0))
-#define HDA_CMD_GET_STRIPE_CONTROL(cad, nid, payload)			\
+#define HDA_CMD_SET_STRIPE_CONTROL(cad, nid, payload)			\
     (HDA_CMD_12BIT((cad), (nid),					\
     HDA_CMD_VERB_SET_STRIPE_CONTROL, (payload)))
 
+/* Channel Count Control */
+#define HDA_CMD_VERB_GET_CONV_CHAN_COUNT			0xf2d
+#define HDA_CMD_VERB_SET_CONV_CHAN_COUNT			0x72d 
+
+#define HDA_CMD_GET_CONV_CHAN_COUNT(cad, nid)				\
+    (HDA_CMD_12BIT((cad), (nid),					\
+    HDA_CMD_VERB_GET_CONV_CHAN_COUNT, 0x0))
+#define HDA_CMD_SET_CONV_CHAN_COUNT(cad, nid, payload)			\
+    (HDA_CMD_12BIT((cad), (nid),					\
+    HDA_CMD_VERB_SET_CONV_CHAN_COUNT, (payload)))
+
+#define HDA_CMD_VERB_GET_HDMI_DIP_SIZE			0xf2e 
+#define HDA_CMD_VERB_GET_HDMI_ELDD			0xf2f 
+
+#define HDA_CMD_VERB_GET_HDMI_DIP_INDEX			0xf30 
+#define HDA_CMD_VERB_SET_HDMI_DIP_INDEX			0x730 
+
+#define HDA_CMD_VERB_GET_HDMI_DIP_DATA			0xf31 
+#define HDA_CMD_VERB_SET_HDMI_DIP_DATA			0x731 
+
+#define HDA_CMD_VERB_GET_HDMI_DIP_XMIT			0xf32 
+#define HDA_CMD_VERB_SET_HDMI_DIP_XMIT			0x732 
+
+#define HDA_CMD_VERB_GET_HDMI_CP_CTRL			0xf33 
+#define HDA_CMD_VERB_SET_HDMI_CP_CTRL			0x733 
+
+#define HDA_CMD_VERB_GET_HDMI_CHAN_SLOT			0xf34 
+#define HDA_CMD_VERB_SET_HDMI_CHAN_SLOT			0x734 
+
+#define HDA_CMD_GET_HDMI_CHAN_SLOT(cad, nid)				\
+    (HDA_CMD_12BIT((cad), (nid),					\
+    HDA_CMD_VERB_GET_HDMI_CHAN_SLOT, 0x0))
+#define HDA_CMD_SET_HDMI_CHAN_SLOT(cad, nid, payload)			\
+    (HDA_CMD_12BIT((cad), (nid),					\
+    HDA_CMD_VERB_SET_HDMI_CHAN_SLOT, (payload)))
+
 /* Function Reset */
 #define HDA_CMD_VERB_FUNCTION_RESET			0x7ff
 
@@ -779,6 +815,10 @@
 #define HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT		20
 #define HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_MASK		0x000f0000
 #define HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_SHIFT		16
+#define HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_MASK		0x0000e000
+#define HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_SHIFT		13
+#define HDA_PARAM_AUDIO_WIDGET_CAP_CP_MASK		0x00001000
+#define HDA_PARAM_AUDIO_WIDGET_CAP_CP_SHIFT		12
 #define HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_MASK		0x00000800
 #define HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_SHIFT	11
 #define HDA_PARAM_AUDIO_WIDGET_CAP_POWER_CTRL_MASK	0x00000400
@@ -810,6 +850,14 @@
 #define HDA_PARAM_AUDIO_WIDGET_CAP_DELAY(param)				\
     (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_MASK) >>		\
     HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_SHIFT)
+#define HDA_PARAM_AUDIO_WIDGET_CAP_CC(param)				\
+    ((((param) & HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_MASK) >>		\
+    (HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_SHIFT - 1)) |			\
+    (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_MASK) >>		\
+    HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_SHIFT))
+#define HDA_PARAM_AUDIO_WIDGET_CAP_CP(param)				\
+    (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_CP_MASK) >>			\
+    HDA_PARAM_AUDIO_WIDGET_CAP_CP_SHIFT)
 #define HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP(param)			\
     (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_MASK) >>		\
     HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_SHIFT)
@@ -971,6 +1019,10 @@
 /* Pin Capabilities */
 #define HDA_PARAM_PIN_CAP				0x0c
 
+#define HDA_PARAM_PIN_CAP_HBR_MASK			0x08000000
+#define HDA_PARAM_PIN_CAP_HBR_SHIFT			27
+#define HDA_PARAM_PIN_CAP_DP_MASK			0x01000000
+#define HDA_PARAM_PIN_CAP_DP_SHIFT			24
 #define HDA_PARAM_PIN_CAP_EAPD_CAP_MASK			0x00010000
 #define HDA_PARAM_PIN_CAP_EAPD_CAP_SHIFT		16
 #define HDA_PARAM_PIN_CAP_VREF_CTRL_MASK		0x0000ff00
@@ -985,6 +1037,8 @@
 #define HDA_PARAM_PIN_CAP_VREF_CTRL_50_SHIFT		9
 #define HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_MASK		0x00000100
 #define HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_SHIFT		8
+#define HDA_PARAM_PIN_CAP_HDMI_MASK			0x00000080
+#define HDA_PARAM_PIN_CAP_HDMI_SHIFT			7
 #define HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_MASK		0x00000040
 #define HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_SHIFT	6
 #define HDA_PARAM_PIN_CAP_INPUT_CAP_MASK		0x00000020
@@ -1000,6 +1054,12 @@
 #define HDA_PARAM_PIN_CAP_IMP_SENSE_CAP_MASK		0x00000001
 #define HDA_PARAM_PIN_CAP_IMP_SENSE_CAP_SHIFT		0
 
+#define HDA_PARAM_PIN_CAP_HBR(param)					\
+    (((param) & HDA_PARAM_PIN_CAP_HBR_MASK) >>				\
+    HDA_PARAM_PIN_CAP_HBR_SHIFT)
+#define HDA_PARAM_PIN_CAP_DP(param)					\
+    (((param) & HDA_PARAM_PIN_CAP_DP_MASK) >>				\
+    HDA_PARAM_PIN_CAP_DP_SHIFT)
 #define HDA_PARAM_PIN_CAP_EAPD_CAP(param)				\
     (((param) & HDA_PARAM_PIN_CAP_EAPD_CAP_MASK) >>			\
     HDA_PARAM_PIN_CAP_EAPD_CAP_SHIFT)
@@ -1021,6 +1081,9 @@
 #define HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ(param)				\
     (((param) & HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_MASK) >>		\
     HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_SHIFT)
+#define HDA_PARAM_PIN_CAP_HDMI(param)					\
+    (((param) & HDA_PARAM_PIN_CAP_HDMI_MASK) >>				\
+    HDA_PARAM_PIN_CAP_HDMI_SHIFT)
 #define HDA_PARAM_PIN_CAP_BALANCED_IO_PINS(param)			\
     (((param) & HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_MASK) >>		\
     HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_SHIFT)

Modified: head/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdac.c	Tue Sep 29 08:00:45 2009	(r197610)
+++ head/sys/dev/sound/pci/hda/hdac.c	Tue Sep 29 09:36:38 2009	(r197611)
@@ -38,7 +38,6 @@
  *     2) HDA Codecs support, which may include
  *        - HDA
  *        - Modem
- *        - HDMI
  *     3) Widget parser - the real magic of why this driver works on so
  *        many hardwares with minimal vendor specific quirk. The original
  *        parser was written using Ruby and can be found at
@@ -87,7 +86,7 @@
 
 #include "mixer_if.h"
 
-#define HDA_DRV_TEST_REV	"20090624_0136"
+#define HDA_DRV_TEST_REV	"20090929_0137"
 
 SND_DECLARE_FILE("$FreeBSD$");
 
@@ -3485,6 +3484,14 @@ hdac_stream_setup(struct hdac_chan *ch)
 		}
 		hdac_command(sc,
 		    HDA_CMD_SET_CONV_STREAM_CHAN(cad, ch->io[i], c), cad);
+#if 0
+		hdac_command(sc,
+		    HDA_CMD_SET_CONV_CHAN_COUNT(cad, ch->io[i], 1), cad);
+		hdac_command(sc,
+		    HDA_CMD_SET_HDMI_CHAN_SLOT(cad, ch->io[i], 0x00), cad);
+		hdac_command(sc,
+		    HDA_CMD_SET_HDMI_CHAN_SLOT(cad, ch->io[i], 0x11), cad);
+#endif
 		chn +=
 		    HDA_PARAM_AUDIO_WIDGET_CAP_STEREO(w->param.widget_cap) ?
 		    2 : 1;
@@ -4492,7 +4499,7 @@ hdac_audio_as_parse(struct hdac_devinfo 
 	for (i = 0; i < max; i++) {
 		as[i].hpredir = -1;
 		as[i].chan = -1;
-		as[i].digital = 1;
+		as[i].digital = 0;
 	}
 
 	/* Scan associations skipping as=0. */
@@ -4547,8 +4554,14 @@ hdac_audio_as_parse(struct hdac_devinfo 
 				    __func__, w->nid, j);
 				as[cnt].enable = 0;
 			}
-			if (!HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap))
-				as[cnt].digital = 0;
+			if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) {
+				if (HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap))
+					as[cnt].digital = 3;
+				else if (HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap))
+					as[cnt].digital = 2;
+				else
+					as[cnt].digital = 1;
+			}
 			/* Headphones with seq=15 may mean redirection. */
 			if (type == HDA_CONFIG_DEFAULTCONF_DEVICE_HP_OUT &&
 			    seq == 15)
@@ -6548,15 +6561,15 @@ hdac_create_pcms(struct hdac_devinfo *de
 		devinfo->function.audio.devs[i].devinfo = devinfo;
 		devinfo->function.audio.devs[i].play = -1;
 		devinfo->function.audio.devs[i].rec = -1;
-		devinfo->function.audio.devs[i].digital = 2;
+		devinfo->function.audio.devs[i].digital = 255;
 	}
 	for (i = 0; i < devinfo->function.audio.ascnt; i++) {
 		if (as[i].enable == 0)
 			continue;
 		for (j = 0; j < devinfo->function.audio.num_devs; j++) {
-			if (devinfo->function.audio.devs[j].digital != 2 &&
-			    devinfo->function.audio.devs[j].digital !=
-			    as[i].digital)
+			if (devinfo->function.audio.devs[j].digital != 255 &&
+			    (!devinfo->function.audio.devs[j].digital) ==
+			    (!as[i].digital))
 				continue;
 			if (as[i].dir == HDA_CTL_IN) {
 				if (devinfo->function.audio.devs[j].rec >= 0)
@@ -6732,6 +6745,8 @@ hdac_dump_pin(struct hdac_softc *sc, str
 		printf(" IN");
 	if (HDA_PARAM_PIN_CAP_BALANCED_IO_PINS(pincap))
 		printf(" BAL");
+	if (HDA_PARAM_PIN_CAP_HDMI(pincap))
+		printf(" HDMI");
 	if (HDA_PARAM_PIN_CAP_VREF_CTRL(pincap)) {
 		printf(" VREF[");
 		if (HDA_PARAM_PIN_CAP_VREF_CTRL_50(pincap))
@@ -6748,6 +6763,10 @@ hdac_dump_pin(struct hdac_softc *sc, str
 	}
 	if (HDA_PARAM_PIN_CAP_EAPD_CAP(pincap))
 		printf(" EAPD");
+	if (HDA_PARAM_PIN_CAP_DP(pincap))
+		printf(" DP");
+	if (HDA_PARAM_PIN_CAP_HBR(pincap))
+		printf(" HBR");
 	printf("\n");
 	device_printf(sc->dev, "     Pin config: 0x%08x\n",
 	    w->wclass.pin.config);
@@ -6855,8 +6874,11 @@ hdac_dump_nodes(struct hdac_devinfo *dev
 			    printf(" PROC");
 			if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap))
 			    printf(" STRIPE");
-			if (HDA_PARAM_AUDIO_WIDGET_CAP_STEREO(w->param.widget_cap))
+			j = HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap);
+			if (j == 1)
 			    printf(" STEREO");
+			else if (j > 1)
+			    printf(" %dCH", j + 1);
 			printf("\n");
 		}
 		if (w->bindas != -1) {
@@ -7957,7 +7979,9 @@ hdac_pcm_probe(device_t dev)
 	snprintf(buf, sizeof(buf), "HDA %s PCM #%d %s",
 	    hdac_codec_name(pdevinfo->devinfo->codec),
 	    pdevinfo->index,
-	    pdevinfo->digital?"Digital":"Analog");
+	    (pdevinfo->digital == 3)?"DisplayPort":
+	    ((pdevinfo->digital == 2)?"HDMI":
+	    ((pdevinfo->digital)?"Digital":"Analog")));
 	device_set_desc_copy(dev, buf);
 	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 10:50:02 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CC3B11065702;
	Tue, 29 Sep 2009 10:50:02 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BA8D88FC16;
	Tue, 29 Sep 2009 10:50:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TAo2xT083111;
	Tue, 29 Sep 2009 10:50:02 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TAo2eo083109;
	Tue, 29 Sep 2009 10:50:02 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200909291050.n8TAo2eo083109@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Tue, 29 Sep 2009 10:50: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: r197612 - 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, 29 Sep 2009 10:50:02 -0000

Author: ru
Date: Tue Sep 29 10:50:02 2009
New Revision: 197612
URL: http://svn.freebsd.org/changeset/base/197612

Log:
  Fixed markup bugs.

Modified:
  head/share/man/man7/tuning.7

Modified: head/share/man/man7/tuning.7
==============================================================================
--- head/share/man/man7/tuning.7	Tue Sep 29 09:36:38 2009	(r197611)
+++ head/share/man/man7/tuning.7	Tue Sep 29 10:50:02 2009	(r197612)
@@ -407,22 +407,27 @@ The
 .Va vm.overcommit
 sysctl defines the overcommit behaviour of the vm subsystem.
 The virtual memory system always does accounting of the swap space
-reservation, both total for system and per-user. Corresponding values
+reservation, both total for system and per-user.
+Corresponding values
 are available through sysctl
-.Va vm.swap_total,
+.Va vm.swap_total ,
 that gives the total bytes available for swapping, and
-.Va vm.swap_reserved,
+.Va vm.swap_reserved ,
 that gives number of bytes that may be needed to back all currently
 allocated anonymous memory.
 .Pp
 Setting bit 0 of the
 .Va vm.overcommit
 sysctl causes the virtual memory system to return failure
-to the process when allocation of memory causes vm.swap_reserved
-to exceed vm.swap_total.
-Bit 1 of the sysctl enforces RLIMIT_SWAP limit
+to the process when allocation of memory causes
+.Va vm.swap_reserved
+to exceed
+.Va vm.swap_total .
+Bit 1 of the sysctl enforces
+.Dv RLIMIT_SWAP
+limit
 (see
-.Xr getrlimit 2 ).
+.Xr getrlimit 2 ) .
 Root is exempt from this limit.
 Bit 2 allows to count most of the physical
 memory as allocatable, except wired and free reserved pages

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 10:53:06 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9628106566B;
	Tue, 29 Sep 2009 10:53:06 +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 94D2F8FC17;
	Tue, 29 Sep 2009 10:53:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TAr6X8083218;
	Tue, 29 Sep 2009 10:53:06 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TAr6A5083207;
	Tue, 29 Sep 2009 10:53:06 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <200909291053.n8TAr6A5083207@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 29 Sep 2009 10: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: r197613 - in stable/8: cddl/contrib/opensolaris
	cddl/contrib/opensolaris/cmd/zfs sys sys/amd64/include/xen
	sys/cddl/contrib/opensolaris
	sys/cddl/contrib/opensolaris/uts/common/fs sys/cd...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 10:53:06 -0000

Author: pjd
Date: Tue Sep 29 10:53:06 2009
New Revision: 197613
URL: http://svn.freebsd.org/changeset/base/197613

Log:
  MFC r197287, r197289, r197351, r197426, r197458, r197459, r197497, r197498,
  r197512, r197513, r197514, r197515, r197525:
  
  r197287:
  
  Purge namecache for the file system being rolled back, so it doesn't point at
  invalid vnodes after the rollback resulting in EIO errors when trying to access
  files which are in the namecache.
  
  Reported by:	des
  
  r197289:
  
  Purge file system namecache when receiving incremental stream and rolling back
  to it.
  
  r197351:
  
  Purge namecache in the same place OpenSolaris does.
  
  r197426:
  
  Restore BSD behaviour - when creating new directory entry use parent directory
  gid to set group ownership and not process gid.
  
  This was overlooked during v6 -> v13 switch.
  
  PR:	kern/139076
  Reported by:	Sean Winn 
  
  r197458:
  
  Close race in zfs_zget(). We have to increase usecount first and then
  check for VI_DOOMED flag. Before this change vnode could be reclaimed
  between checking for the flag and increasing usecount.
  
  r197459:
  
  Before calling vflush(FORCECLOSE) mark file system as unmounted so the
  following vnops will fail. This is very important, because without this change
  vnode could be reclaimed at any point, even if we increased usecount. The only
  way to ensure that vnode won't be reclaimed was to lock it, which would be very
  hard to do in ZFS without changing a lot of code. With this change simply
  increasing usecount is enough to be sure vnode won't be reclaimed from under
  us. To be precise it can still be reclaimed but we won't be able to see it,
  because every try to enter ZFS through VFS will result in EIO.
  
  The only function that cannot return EIO, because it is needed for vflush() is
  zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks
  z_teardown_lock and never returns EIO.
  
  r197497:
  
  Switch to fletcher4 as the default checksum algorithm. Fletcher2 was proven to
  be a bit weak and OpenSolaris also switched to fletcher4.
  
  r197498:	head/cddl/contrib/opensolaris
  
  Fletcher4 is not the default checksum algorithm.
  
  r197512:
  
  - Don't depend on value returned by gfs_*_inactive(), it doesn't work
    well with forced unmounts when GFS vnodes are referenced.
  - Make other preparations to GFS for forced unmounts.
  
  PR:	kern/139062
  Reported by:	trasz
  
  r197513:
  
  Use traverse() function to find and return mount point's vnode instead of
  covered vnode when snapshot is already mounted.
  
  r197514:
  
  On lookup error VFS expects *vpp to be set to NULL, be sure to do that.
  
  r197515:
  
  Handle cases where virtual (GFS) vnodes are referenced when doing forced
  unmount. In that case we cannot depend on the proper order of invalidating
  vnodes, so we have to free resources when we have a chance.
  
  PR:	kern/139062
  Reported by:	trasz
  
  r197525:
  
  Ensure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object.
  This completes the fix from r185586.
  
  PR:	kern/139059
  Reported by:	Daniel Braniss 
  Submitted by:	Jaakko Heinonen 
  Tested by:	Daniel Braniss 
  
  Approved by:	re (kib)

Modified:
  stable/8/cddl/contrib/opensolaris/   (props changed)
  stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/nfsserver/nfs_serv.c

Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==============================================================================
--- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Sep 29 10:53:06 2009	(r197613)
@@ -535,7 +535,7 @@ This property is not inherited.
 .ad
 .sp .6
 .RS 4n
-Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher2\fR, but this may change in future releases). The value "off" disables integrity
+Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher4\fR, but this may change in future releases). The value "off" disables integrity
 checking on user data. Disabling checksums is NOT a recommended practice.
 .RE
 

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c	Tue Sep 29 10:53:06 2009	(r197613)
@@ -595,7 +595,6 @@ found:
 	if (vp->v_flag & V_XATTRDIR)
 		VI_LOCK(fp->gfs_parent);
 	VI_LOCK(vp);
-	ASSERT(vp->v_count < 2);
 	/*
 	 * Really remove this vnode
 	 */
@@ -607,12 +606,7 @@ found:
 		 */
 		ge->gfse_vnode = NULL;
 	}
-	if (vp->v_count == 1) {
-		vp->v_usecount--;
-		vdropl(vp);
-	} else {
-		VI_UNLOCK(vp);
-	}
+	VI_UNLOCK(vp);
 
 	/*
 	 * Free vnode and release parent
@@ -1084,18 +1078,16 @@ gfs_vop_inactive(ap)
 {
 	vnode_t *vp = ap->a_vp;
 	gfs_file_t *fp = vp->v_data;
-	void *data;
 
 	if (fp->gfs_type == GFS_DIR)
-		data = gfs_dir_inactive(vp);
+		gfs_dir_inactive(vp);
 	else
-		data = gfs_file_inactive(vp);
-
-	if (data != NULL)
-		kmem_free(data, fp->gfs_size);
+		gfs_file_inactive(vp);
 
 	VI_LOCK(vp);
 	vp->v_data = NULL;
 	VI_UNLOCK(vp);
+	kmem_free(fp, fp->gfs_size);
+
 	return (0);
 }

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c	Tue Sep 29 10:53:06 2009	(r197613)
@@ -19,11 +19,111 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+/*
+ * Fletcher Checksums
+ * ------------------
+ *
+ * ZFS's 2nd and 4th order Fletcher checksums are defined by the following
+ * recurrence relations:
+ *
+ *	a  = a    + f
+ *	 i    i-1    i-1
+ *
+ *	b  = b    + a
+ *	 i    i-1    i
+ *
+ *	c  = c    + b		(fletcher-4 only)
+ *	 i    i-1    i
+ *
+ *	d  = d    + c		(fletcher-4 only)
+ *	 i    i-1    i
+ *
+ * Where
+ *	a_0 = b_0 = c_0 = d_0 = 0
+ * and
+ *	f_0 .. f_(n-1) are the input data.
+ *
+ * Using standard techniques, these translate into the following series:
+ *
+ *	     __n_			     __n_
+ *	     \   |			     \   |
+ *	a  =  >     f			b  =  >     i * f
+ *	 n   /___|   n - i		 n   /___|	 n - i
+ *	     i = 1			     i = 1
+ *
+ *
+ *	     __n_			     __n_
+ *	     \   |  i*(i+1)		     \   |  i*(i+1)*(i+2)
+ *	c  =  >     ------- f		d  =  >     ------------- f
+ *	 n   /___|     2     n - i	 n   /___|	  6	   n - i
+ *	     i = 1			     i = 1
+ *
+ * For fletcher-2, the f_is are 64-bit, and [ab]_i are 64-bit accumulators.
+ * Since the additions are done mod (2^64), errors in the high bits may not
+ * be noticed.  For this reason, fletcher-2 is deprecated.
+ *
+ * For fletcher-4, the f_is are 32-bit, and [abcd]_i are 64-bit accumulators.
+ * A conservative estimate of how big the buffer can get before we overflow
+ * can be estimated using f_i = 0xffffffff for all i:
+ *
+ * % bc
+ *  f=2^32-1;d=0; for (i = 1; d<2^64; i++) { d += f*i*(i+1)*(i+2)/6 }; (i-1)*4
+ * 2264
+ *  quit
+ * %
+ *
+ * So blocks of up to 2k will not overflow.  Our largest block size is
+ * 128k, which has 32k 4-byte words, so we can compute the largest possible
+ * accumulators, then divide by 2^64 to figure the max amount of overflow:
+ *
+ * % bc
+ *  a=b=c=d=0; f=2^32-1; for (i=1; i<=32*1024; i++) { a+=f; b+=a; c+=b; d+=c }
+ *  a/2^64;b/2^64;c/2^64;d/2^64
+ * 0
+ * 0
+ * 1365
+ * 11186858
+ *  quit
+ * %
+ *
+ * So a and b cannot overflow.  To make sure each bit of input has some
+ * effect on the contents of c and d, we can look at what the factors of
+ * the coefficients in the equations for c_n and d_n are.  The number of 2s
+ * in the factors determines the lowest set bit in the multiplier.  Running
+ * through the cases for n*(n+1)/2 reveals that the highest power of 2 is
+ * 2^14, and for n*(n+1)*(n+2)/6 it is 2^15.  So while some data may overflow
+ * the 64-bit accumulators, every bit of every f_i effects every accumulator,
+ * even for 128k blocks.
+ *
+ * If we wanted to make a stronger version of fletcher4 (fletcher4c?),
+ * we could do our calculations mod (2^32 - 1) by adding in the carries
+ * periodically, and store the number of carries in the top 32-bits.
+ *
+ * --------------------
+ * Checksum Performance
+ * --------------------
+ *
+ * There are two interesting components to checksum performance: cached and
+ * uncached performance.  With cached data, fletcher-2 is about four times
+ * faster than fletcher-4.  With uncached data, the performance difference is
+ * negligible, since the cost of a cache fill dominates the processing time.
+ * Even though fletcher-4 is slower than fletcher-2, it is still a pretty
+ * efficient pass over the data.
+ *
+ * In normal operation, the data which is being checksummed is in a buffer
+ * which has been filled either by:
+ *
+ *	1. a compression step, which will be mostly cached, or
+ *	2. a bcopy() or copyin(), which will be uncached (because the
+ *	   copy is cache-bypassing).
+ *
+ * For both cached and uncached data, both fletcher checksums are much faster
+ * than sha-256, and slower than 'off', which doesn't touch the data at all.
+ */
 
 #include 
 #include 

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h	Tue Sep 29 10:53:06 2009	(r197613)
@@ -255,6 +255,7 @@ VTOZ(vnode_t *vp)
 
 /*
  * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation.
+ * ZFS_ENTER_NOERROR() is called when we can't return EIO.
  * ZFS_EXIT() must be called before exitting the vop.
  * ZFS_VERIFY_ZP() verifies the znode is valid.
  */
@@ -267,6 +268,9 @@ VTOZ(vnode_t *vp)
 		} \
 	}
 
+#define	ZFS_ENTER_NOERROR(zfsvfs) \
+	rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG)
+
 #define	ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG)
 
 #define	ZFS_VERIFY_ZP(zp) \

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h	Tue Sep 29 10:53:06 2009	(r197613)
@@ -76,7 +76,7 @@ enum zio_checksum {
 	ZIO_CHECKSUM_FUNCTIONS
 };
 
-#define	ZIO_CHECKSUM_ON_VALUE	ZIO_CHECKSUM_FLETCHER_2
+#define	ZIO_CHECKSUM_ON_VALUE	ZIO_CHECKSUM_FLETCHER_4
 #define	ZIO_CHECKSUM_DEFAULT	ZIO_CHECKSUM_ON
 
 enum zio_compress {

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c	Tue Sep 29 10:53:06 2009	(r197613)
@@ -1841,7 +1841,7 @@ zfs_perm_init(znode_t *zp, znode_t *pare
 				fgid = zfs_fuid_create_cred(zfsvfs,
 				    ZFS_GROUP, tx, cr, fuidp);
 #ifdef __FreeBSD__
-				gid = parent->z_phys->zp_gid;
+				gid = fgid = parent->z_phys->zp_gid;
 #else
 				gid = crgetgid(cr);
 #endif

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c	Tue Sep 29 10:53:06 2009	(r197613)
@@ -818,7 +818,11 @@ zfsctl_snapdir_lookup(ap)
 	if ((sep = avl_find(&sdp->sd_snaps, &search, &where)) != NULL) {
 		*vpp = sep->se_root;
 		VN_HOLD(*vpp);
-		if ((*vpp)->v_mountedhere == NULL) {
+		err = traverse(vpp, LK_EXCLUSIVE | LK_RETRY);
+		if (err) {
+			VN_RELE(*vpp);
+			*vpp = NULL;
+		} else if (*vpp == sep->se_root) {
 			/*
 			 * The snapshot was unmounted behind our backs,
 			 * try to remount it.
@@ -832,10 +836,9 @@ zfsctl_snapdir_lookup(ap)
 			 */
 			(*vpp)->v_flag &= ~VROOT;
 		}
-		vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
 		mutex_exit(&sdp->sd_lock);
 		ZFS_EXIT(zfsvfs);
-		return (0);
+		return (err);
 	}
 
 	/*
@@ -895,6 +898,8 @@ domount:
 	}
 	mutex_exit(&sdp->sd_lock);
 	ZFS_EXIT(zfsvfs);
+	if (err != 0)
+		*vpp = NULL;
 	return (err);
 }
 
@@ -1002,15 +1007,24 @@ zfsctl_snapdir_inactive(ap)
 {
 	vnode_t *vp = ap->a_vp;
 	zfsctl_snapdir_t *sdp = vp->v_data;
-	void *private;
+	zfs_snapentry_t *sep;
 
-	private = gfs_dir_inactive(vp);
-	if (private != NULL) {
-		ASSERT(avl_numnodes(&sdp->sd_snaps) == 0);
-		mutex_destroy(&sdp->sd_lock);
-		avl_destroy(&sdp->sd_snaps);
-		kmem_free(private, sizeof (zfsctl_snapdir_t));
+	/*
+	 * On forced unmount we have to free snapshots from here.
+	 */
+	mutex_enter(&sdp->sd_lock);
+	while ((sep = avl_first(&sdp->sd_snaps)) != NULL) {
+		avl_remove(&sdp->sd_snaps, sep);
+		kmem_free(sep->se_name, strlen(sep->se_name) + 1);
+		kmem_free(sep, sizeof (zfs_snapentry_t));
 	}
+	mutex_exit(&sdp->sd_lock);
+	gfs_dir_inactive(vp);
+	ASSERT(avl_numnodes(&sdp->sd_snaps) == 0);
+	mutex_destroy(&sdp->sd_lock);
+	avl_destroy(&sdp->sd_snaps);
+	kmem_free(sdp, sizeof (zfsctl_snapdir_t));
+
 	return (0);
 }
 
@@ -1068,6 +1082,9 @@ zfsctl_snapshot_inactive(ap)
 	int locked;
 	vnode_t *dvp;
 
+	if (vp->v_count > 0)
+		goto end;
+
 	VERIFY(gfs_dir_lookup(vp, "..", &dvp, cr, 0, NULL, NULL) == 0);
 	sdp = dvp->v_data;
 	VOP_UNLOCK(dvp, 0);
@@ -1075,11 +1092,6 @@ zfsctl_snapshot_inactive(ap)
 	if (!(locked = MUTEX_HELD(&sdp->sd_lock)))
 		mutex_enter(&sdp->sd_lock);
 
-	if (vp->v_count > 1) {
-		if (!locked)
-			mutex_exit(&sdp->sd_lock);
-		return (0);
-	}
 	ASSERT(!vn_ismntpt(vp));
 
 	sep = avl_first(&sdp->sd_snaps);
@@ -1099,6 +1111,7 @@ zfsctl_snapshot_inactive(ap)
 	if (!locked)
 		mutex_exit(&sdp->sd_lock);
 	VN_RELE(dvp);
+end:
 	VFS_RELE(vp->v_vfsp);
 
 	/*

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Tue Sep 29 10:53:06 2009	(r197613)
@@ -864,7 +864,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
 	znode_t *rootzp;
 	int error;
 
-	ZFS_ENTER(zfsvfs);
+	ZFS_ENTER_NOERROR(zfsvfs);
 
 	error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp);
 	if (error == 0) {
@@ -898,6 +898,9 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea
 		 * 'z_parent' is self referential for non-snapshots.
 		 */
 		(void) dnlc_purge_vfsp(zfsvfs->z_parent->z_vfs, 0);
+#ifdef FREEBSD_NAMECACHE
+		cache_purgevfs(zfsvfs->z_parent->z_vfs);
+#endif
 	}
 
 	/*
@@ -1027,6 +1030,17 @@ zfs_umount(vfs_t *vfsp, int fflag)
 		ASSERT(zfsvfs->z_ctldir == NULL);
 	}
 
+	if (fflag & MS_FORCE) {
+		/*
+		 * Mark file system as unmounted before calling
+		 * vflush(FORCECLOSE). This way we ensure no future vnops
+		 * will be called and risk operating on DOOMED vnodes.
+		 */
+		rrw_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG);
+		zfsvfs->z_unmounted = B_TRUE;
+		rrw_exit(&zfsvfs->z_teardown_lock, FTAG);
+	}
+
 	/*
 	 * Flush all the files.
 	 */
@@ -1093,8 +1107,7 @@ zfs_umount(vfs_t *vfsp, int fflag)
 	if (zfsvfs->z_issnap) {
 		vnode_t *svp = vfsp->mnt_vnodecovered;
 
-		ASSERT(svp->v_count == 2 || svp->v_count == 1);
-		if (svp->v_count == 2)
+		if (svp->v_count >= 2)
 			VN_RELE(svp);
 	}
 	zfs_freevfs(vfsp);

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Tue Sep 29 10:53:06 2009	(r197613)
@@ -890,17 +890,25 @@ again:
 		if (zp->z_unlinked) {
 			err = ENOENT;
 		} else {
-			if ((vp = ZTOV(zp)) != NULL) {
-				VI_LOCK(vp);
+			int dying = 0;
+
+			vp = ZTOV(zp);
+			if (vp == NULL)
+				dying = 1;
+			else {
+				VN_HOLD(vp);
 				if ((vp->v_iflag & VI_DOOMED) != 0) {
-					VI_UNLOCK(vp);
-					vp = NULL;
-				} else
-					VI_UNLOCK(vp);
+					dying = 1;
+					/*
+					 * Don't VN_RELE() vnode here, because
+					 * it can call vn_lock() which creates
+					 * LOR between vnode lock and znode
+					 * lock. We will VN_RELE() the vnode
+					 * after droping znode lock.
+					 */
+				}
 			}
-			if (vp != NULL)
-				VN_HOLD(vp);
-			else {
+			if (dying) {
 				if (first) {
 					ZFS_LOG(1, "dying znode detected (zp=%p)", zp);
 					first = 0;
@@ -912,6 +920,8 @@ again:
 				dmu_buf_rele(db, NULL);
 				mutex_exit(&zp->z_lock);
 				ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
+				if (vp != NULL)
+					VN_RELE(vp);
 				tsleep(zp, 0, "zcollide", 1);
 				goto again;
 			}

Modified: stable/8/sys/nfsserver/nfs_serv.c
==============================================================================
--- stable/8/sys/nfsserver/nfs_serv.c	Tue Sep 29 10:50:02 2009	(r197612)
+++ stable/8/sys/nfsserver/nfs_serv.c	Tue Sep 29 10:53:06 2009	(r197613)
@@ -1332,7 +1332,7 @@ nfsrv_create(struct nfsrv_descript *nfsd
 			tl = nfsm_dissect_nonblock(u_int32_t *,
 			    NFSX_V3CREATEVERF);
 			/* Unique bytes, endianness is not important. */
-			cverf.tv_sec  = tl[0];
+			cverf.tv_sec  = (int32_t)tl[0];
 			cverf.tv_nsec = tl[1];
 			exclusive_flag = 1;
 			break;

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 11:17:21 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 68590106568B;
	Tue, 29 Sep 2009 11:17:21 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 43C388FC14;
	Tue, 29 Sep 2009 11:17:21 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id CFD2C46B03;
	Tue, 29 Sep 2009 07:17:20 -0400 (EDT)
Date: Tue, 29 Sep 2009 12:17:20 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Ruslan Ermilov 
In-Reply-To: <200909291050.n8TAo2eo083109@svn.freebsd.org>
Message-ID: 
References: <200909291050.n8TAo2eo083109@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
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: r197612 - 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, 29 Sep 2009 11:17:21 -0000


On Tue, 29 Sep 2009, Ruslan Ermilov wrote:

> Author: ru
> Date: Tue Sep 29 10:50:02 2009
> New Revision: 197612
> URL: http://svn.freebsd.org/changeset/base/197612
>
> Log:
>  Fixed markup bugs.

Any chance you'll fix content bugs as well?  tuning(7) is one of several man 
pages that desperately needs a rewrite.

Robert N M Watson
Computer Laboratory
University of Cambridge

>
> Modified:
>  head/share/man/man7/tuning.7
>
> Modified: head/share/man/man7/tuning.7
> ==============================================================================
> --- head/share/man/man7/tuning.7	Tue Sep 29 09:36:38 2009	(r197611)
> +++ head/share/man/man7/tuning.7	Tue Sep 29 10:50:02 2009	(r197612)
> @@ -407,22 +407,27 @@ The
> .Va vm.overcommit
> sysctl defines the overcommit behaviour of the vm subsystem.
> The virtual memory system always does accounting of the swap space
> -reservation, both total for system and per-user. Corresponding values
> +reservation, both total for system and per-user.
> +Corresponding values
> are available through sysctl
> -.Va vm.swap_total,
> +.Va vm.swap_total ,
> that gives the total bytes available for swapping, and
> -.Va vm.swap_reserved,
> +.Va vm.swap_reserved ,
> that gives number of bytes that may be needed to back all currently
> allocated anonymous memory.
> .Pp
> Setting bit 0 of the
> .Va vm.overcommit
> sysctl causes the virtual memory system to return failure
> -to the process when allocation of memory causes vm.swap_reserved
> -to exceed vm.swap_total.
> -Bit 1 of the sysctl enforces RLIMIT_SWAP limit
> +to the process when allocation of memory causes
> +.Va vm.swap_reserved
> +to exceed
> +.Va vm.swap_total .
> +Bit 1 of the sysctl enforces
> +.Dv RLIMIT_SWAP
> +limit
> (see
> -.Xr getrlimit 2 ).
> +.Xr getrlimit 2 ) .
> Root is exempt from this limit.
> Bit 2 allows to count most of the physical
> memory as allocatable, except wired and free reserved pages
>

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 12:04:07 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AFD061065696;
	Tue, 29 Sep 2009 12:04:07 +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 8232A8FC20;
	Tue, 29 Sep 2009 12:04:07 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 10CD246B06;
	Tue, 29 Sep 2009 08:04:07 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 67F898A024;
	Tue, 29 Sep 2009 08:04:06 -0400 (EDT)
From: John Baldwin 
To: Marcel Moolenaar 
Date: Tue, 29 Sep 2009 07:49:07 -0400
User-Agent: KMail/1.9.7
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
In-Reply-To: <200909282352.n8SNql1n069970@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200909290749.08764.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Tue, 29 Sep 2009 08:04:06 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 12:04:07 -0000

On Monday 28 September 2009 7:52:47 pm Marcel Moolenaar wrote:
> Author: marcel
> Date: Mon Sep 28 23:52:47 2009
> New Revision: 197608
> URL: http://svn.freebsd.org/changeset/base/197608
> 
> Log:
>   The first 96 bytes may not be zeroes. It can contain trivial boot
>   code that merely emits an error and waits for a key press before
>   rebooting. The error being that extended partitions are not
>   bootable. The origin is presumed to be Windows 2000; Windows XP
>   does not do this...
>   
>   For now, ignore the first 96 bytes when checking that the EBR is
>   (for the most part) all zeroes.
>   
>   Tested by:	Mario Lobo 
>   MFC after:	1 week
> 
> Modified:
>   head/sys/geom/part/g_part_ebr.c

Why do you check for zeros at all?  AFAIK, the only real check is for AA55 at 
the end of the sector (and having an MBR or other Extended MBR partition 
entry point at the sector in question).  The '96' thing seems rather 
arbitrary in the code, and I think the zero's check is overly restrictive.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 12:18:24 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 53C101065670;
	Tue, 29 Sep 2009 12:18:24 +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 40EC88FC08;
	Tue, 29 Sep 2009 12:18:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TCIN0u085043;
	Tue, 29 Sep 2009 12:18:23 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TCINmv085038;
	Tue, 29 Sep 2009 12:18:23 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200909291218.n8TCINmv085038@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 29 Sep 2009 12: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: r197614 - 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: Tue, 29 Sep 2009 12:18:24 -0000

Author: rpaulo
Date: Tue Sep 29 12:18:23 2009
New Revision: 197614
URL: http://svn.freebsd.org/changeset/base/197614

Log:
  Update 802.11s mesh support to draft 3.03. This includes a revised  frame
  format for peering and changes to the PERR frames.
  Note that this is incompatible with the previous code.
  
  Reviewed by:	sam
  Approved by:	re (kib)

Modified:
  stable/8/sys/net80211/ieee80211.h
  stable/8/sys/net80211/ieee80211_hwmp.c
  stable/8/sys/net80211/ieee80211_mesh.c
  stable/8/sys/net80211/ieee80211_mesh.h

Modified: stable/8/sys/net80211/ieee80211.h
==============================================================================
--- stable/8/sys/net80211/ieee80211.h	Tue Sep 29 10:53:06 2009	(r197613)
+++ stable/8/sys/net80211/ieee80211.h	Tue Sep 29 12:18:23 2009	(r197614)
@@ -708,7 +708,7 @@ enum {
 	IEEE80211_ELEMID_VENDOR		= 221,	/* vendor private */
 
 	/*
-	 * 802.11s IEs based on D3.0 spec and were not assigned by
+	 * 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.
 	 */
@@ -726,10 +726,9 @@ enum {
 	IEEE80211_ELEMID_MESHPREQ	= 68,
 	IEEE80211_ELEMID_MESHPREP	= 69,
 	IEEE80211_ELEMID_MESHPERR	= 70,
-	IEEE80211_ELEMID_MESHPU		= 53,
-	IEEE80211_ELEMID_MESHPUC	= 54,
+	IEEE80211_ELEMID_MESHPXU	= 53,
+	IEEE80211_ELEMID_MESHPXUC	= 54,
 	IEEE80211_ELEMID_MESHAH		= 60, /* Abbreviated Handshake */
-	IEEE80211_ELEMID_MESHPEERVER	= 80, /* Peering Protocol Version */
 };
 
 struct ieee80211_tim_ie {
@@ -925,6 +924,9 @@ enum {
 	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_STATUS_SUCCESS		= 0,
 	IEEE80211_STATUS_UNSPECIFIED		= 1,

Modified: stable/8/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- stable/8/sys/net80211/ieee80211_hwmp.c	Tue Sep 29 10:53:06 2009	(r197613)
+++ stable/8/sys/net80211/ieee80211_hwmp.c	Tue Sep 29 12:18:23 2009	(r197614)
@@ -188,10 +188,7 @@ SYSCTL_PROC(_net_wlan_hwmp, OID_AUTO, ra
 
 #define	IEEE80211_HWMP_DEFAULT_MAXHOPS	31
 
-static	ieee80211_recv_action_func hwmp_recv_action_meshpath_preq;
-static	ieee80211_recv_action_func hwmp_recv_action_meshpath_prep;
-static	ieee80211_recv_action_func hwmp_recv_action_meshpath_perr;
-static	ieee80211_recv_action_func hwmp_recv_action_meshpath_rann;
+static	ieee80211_recv_action_func hwmp_recv_action_meshpath;
 
 static struct ieee80211_mesh_proto_path mesh_proto_hwmp = {
 	.mpp_descr	= "HWMP",
@@ -217,16 +214,10 @@ ieee80211_hwmp_init(void)
 	ieee80211_hwmp_rannint = msecs_to_ticks(1*1000);
 
 	/*
-	 * Register action frame handlers.
+	 * Register action frame handler.
 	 */
 	ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH,
-	    IEEE80211_ACTION_MESHPATH_REQ, hwmp_recv_action_meshpath_preq);
-	ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH,
-	    IEEE80211_ACTION_MESHPATH_REP, hwmp_recv_action_meshpath_prep);
-	ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH,
-	    IEEE80211_ACTION_MESHPATH_ERR, hwmp_recv_action_meshpath_perr);
-	ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH,
-	    IEEE80211_ACTION_MESHPATH_RANN, hwmp_recv_action_meshpath_rann);
+	    IEEE80211_ACTION_MESHPATH_SEL, hwmp_recv_action_meshpath);
 
 	/* NB: default is 5 secs per spec */
 	mesh_proto_hwmp.mpp_inact = msecs_to_ticks(5*1000);
@@ -285,17 +276,23 @@ hwmp_newstate(struct ieee80211vap *vap, 
 }
 
 static int
-hwmp_recv_action_meshpath_preq(struct ieee80211_node *ni,
+hwmp_recv_action_meshpath(struct ieee80211_node *ni,
 	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
 	struct ieee80211_meshpreq_ie preq;
+	struct ieee80211_meshprep_ie prep;
+	struct ieee80211_meshperr_ie perr;
+	struct ieee80211_meshrann_ie rann;
 	const uint8_t *iefrm = frm + 2; /* action + code */
+	int found = 0;
 
 	while (efrm - iefrm > 1) {
 		IEEE80211_VERIFY_LENGTH(efrm - iefrm, iefrm[1] + 2, return 0);
-		if (*iefrm == IEEE80211_ELEMID_MESHPREQ) {
+		switch (*iefrm) {
+		case IEEE80211_ELEMID_MESHPREQ:
+		{
 			const struct ieee80211_meshpreq_ie *mpreq =
 			    (const struct ieee80211_meshpreq_ie *) iefrm;
 			/* XXX > 1 target */
@@ -305,7 +302,7 @@ hwmp_recv_action_meshpath_preq(struct ie
 				    IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP,
 				    wh, NULL, "%s", "PREQ with wrong len");
 				vap->iv_stats.is_rx_mgtdiscard++;
-				return 1;
+				break;
 			}
 			memcpy(&preq, mpreq, sizeof(preq));
 			preq.preq_id = LE_READ_4(&mpreq->preq_id);
@@ -315,28 +312,11 @@ hwmp_recv_action_meshpath_preq(struct ie
 			preq.preq_targets[0].target_seq =
 			    LE_READ_4(&mpreq->preq_targets[0].target_seq);
 			hwmp_recv_preq(vap, ni, wh, &preq);
-			return 0;
+			found++;
+			break;	
 		}
-		iefrm += iefrm[1] + 2;
-	}
-	IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP,
-	    wh, NULL, "%s", "PREQ without IE");
-	vap->iv_stats.is_rx_mgtdiscard++;
-	return 0;
-}
-
-static int
-hwmp_recv_action_meshpath_prep(struct ieee80211_node *ni,
-	const struct ieee80211_frame *wh,
-	const uint8_t *frm, const uint8_t *efrm)
-{
-	struct ieee80211vap *vap = ni->ni_vap;
-	struct ieee80211_meshprep_ie prep;
-	const uint8_t *iefrm = frm + 2; /* action + code */
-
-	while (efrm - iefrm > 1) {
-		IEEE80211_VERIFY_LENGTH(efrm - iefrm, iefrm[1] + 2, return 0);
-		if (*iefrm == IEEE80211_ELEMID_MESHPREP) {
+		case IEEE80211_ELEMID_MESHPREP:
+		{
 			const struct ieee80211_meshprep_ie *mprep =
 			    (const struct ieee80211_meshprep_ie *) iefrm;
 			if (mprep->prep_len !=
@@ -345,7 +325,7 @@ hwmp_recv_action_meshpath_prep(struct ie
 				    IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP,
 				    wh, NULL, "%s", "PREP with wrong len");
 				vap->iv_stats.is_rx_mgtdiscard++;
-				return 1;
+				break;
 			}
 			memcpy(&prep, mprep, sizeof(prep));
 			prep.prep_targetseq = LE_READ_4(&mprep->prep_targetseq);
@@ -353,28 +333,11 @@ hwmp_recv_action_meshpath_prep(struct ie
 			prep.prep_metric = LE_READ_4(&mprep->prep_metric);
 			prep.prep_origseq = LE_READ_4(&mprep->prep_origseq);
 			hwmp_recv_prep(vap, ni, wh, &prep);
-			return 0;
+			found++;
+			break;
 		}
-		iefrm += iefrm[1] + 2;
-	}
-	IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP,
-	    wh, NULL, "%s", "PREP without IE");
-	vap->iv_stats.is_rx_mgtdiscard++;
-	return 0;
-}
-
-static int
-hwmp_recv_action_meshpath_perr(struct ieee80211_node *ni,
-	const struct ieee80211_frame *wh,
-	const uint8_t *frm, const uint8_t *efrm)
-{
-	struct ieee80211_meshperr_ie perr;
-	struct ieee80211vap *vap = ni->ni_vap;
-	const uint8_t *iefrm = frm + 2; /* action + code */
-
-	while (efrm - iefrm > 1) {
-		IEEE80211_VERIFY_LENGTH(efrm - iefrm, iefrm[1] + 2, return 0);
-		if (*iefrm == IEEE80211_ELEMID_MESHPERR) {
+		case IEEE80211_ELEMID_MESHPERR:
+		{
 			const struct ieee80211_meshperr_ie *mperr =
 			    (const struct ieee80211_meshperr_ie *) iefrm;
 			/* XXX > 1 target */
@@ -384,34 +347,17 @@ hwmp_recv_action_meshpath_perr(struct ie
 				    IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP,
 				    wh, NULL, "%s", "PERR with wrong len");
 				vap->iv_stats.is_rx_mgtdiscard++;
-				return 1;
+				break;
 			}
 			memcpy(&perr, mperr, sizeof(perr));
 			perr.perr_dests[0].dest_seq =
 			    LE_READ_4(&mperr->perr_dests[0].dest_seq);
 			hwmp_recv_perr(vap, ni, wh, &perr);
-			return 0;
+			found++;
+			break;
 		}
-		iefrm += iefrm[1] + 2;
-	}
-	IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP,
-	    wh, NULL, "%s", "PERR without IE");
-	vap->iv_stats.is_rx_mgtdiscard++;
-	return 0;
-}
-
-static int
-hwmp_recv_action_meshpath_rann(struct ieee80211_node *ni,
-	const struct ieee80211_frame *wh,
-	const uint8_t *frm, const uint8_t *efrm)
-{
-	struct ieee80211vap *vap = ni->ni_vap;
-	struct ieee80211_meshrann_ie rann;
-	const uint8_t *iefrm = frm + 2; /* action + code */
-
-	while (efrm - iefrm > 1) {
-		IEEE80211_VERIFY_LENGTH(efrm - iefrm, iefrm[1] + 2, return 0);
-		if (*iefrm == IEEE80211_ELEMID_MESHRANN) {
+		case IEEE80211_ELEMID_MESHRANN:
+		{
 			const struct ieee80211_meshrann_ie *mrann =
 			    (const struct ieee80211_meshrann_ie *) iefrm;
 			if (mrann->rann_len !=
@@ -426,13 +372,18 @@ hwmp_recv_action_meshpath_rann(struct ie
 			rann.rann_seq = LE_READ_4(&mrann->rann_seq);
 			rann.rann_metric = LE_READ_4(&mrann->rann_metric);
 			hwmp_recv_rann(vap, ni, wh, &rann);
-			return 0;
+			found++;
+			break;
+		}
 		}
 		iefrm += iefrm[1] + 2;
 	}
-	IEEE80211_DISCARD(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP,
-	    wh, NULL, "%s", "RANN without IE");
-	vap->iv_stats.is_rx_mgtdiscard++;
+	if (!found) {
+		IEEE80211_DISCARD(vap,
+		    IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP,
+		    wh, NULL, "%s", "PATH SEL action without IE");
+		vap->iv_stats.is_rx_mgtdiscard++;
+	}
 	return 0;
 }
 
@@ -480,24 +431,21 @@ hwmp_send_action(struct ieee80211_node *
 		return ENOMEM;
 	}
 	*frm++ = IEEE80211_ACTION_CAT_MESHPATH;
+	*frm++ = IEEE80211_ACTION_MESHPATH_SEL;
 	switch (*ie) {
 	case IEEE80211_ELEMID_MESHPREQ:
-		*frm++ = IEEE80211_ACTION_MESHPATH_REQ;
 		frm = hwmp_add_meshpreq(frm,
 		    (struct ieee80211_meshpreq_ie *)ie);
 		break;
 	case IEEE80211_ELEMID_MESHPREP:
-		*frm++ = IEEE80211_ACTION_MESHPATH_REP;
 		frm = hwmp_add_meshprep(frm,
 		    (struct ieee80211_meshprep_ie *)ie);
 		break;
 	case IEEE80211_ELEMID_MESHPERR:
-		*frm++ = IEEE80211_ACTION_MESHPATH_ERR;
 		frm = hwmp_add_meshperr(frm,
 		    (struct ieee80211_meshperr_ie *)ie);
 		break;
 	case IEEE80211_ELEMID_MESHRANN:
-		*frm++ = IEEE80211_ACTION_MESHPATH_RANN;
 		frm = hwmp_add_meshrann(frm,
 		    (struct ieee80211_meshrann_ie *)ie);
 		break;
@@ -528,6 +476,11 @@ hwmp_send_action(struct ieee80211_node *
 	return ic->ic_raw_xmit(ni, m, ¶ms);
 }
 
+#define ADDSHORT(frm, v) do {		\
+	frm[0] = (v) & 0xff;		\
+	frm[1] = (v) >> 8;		\
+	frm += 2;			\
+} while (0)
 #define ADDWORD(frm, v) do {		\
 	LE_WRITE_4(frm, v);		\
 	frm += 4;			\
@@ -592,12 +545,14 @@ hwmp_add_meshperr(uint8_t *frm, const st
 	*frm++ = IEEE80211_ELEMID_MESHPERR;
 	*frm++ = sizeof(struct ieee80211_meshperr_ie) - 2 +
 	    (perr->perr_ndests - 1) * sizeof(*perr->perr_dests);
-	*frm++ = perr->perr_mode;
+	*frm++ = perr->perr_ttl;
 	*frm++ = perr->perr_ndests;
 	for (i = 0; i < perr->perr_ndests; i++) {
+		*frm += perr->perr_dests[i].dest_flags;
 		IEEE80211_ADDR_COPY(frm, perr->perr_dests[i].dest_addr);
 		frm += 6;
 		ADDWORD(frm, perr->perr_dests[i].dest_seq);
+		ADDSHORT(frm, perr->perr_dests[i].dest_rcode);
 	}
 	return frm;
 }
@@ -1138,12 +1093,15 @@ hwmp_send_prep(struct ieee80211_node *ni
 	    sizeof(struct ieee80211_meshprep_ie));
 }
 
+#define	PERR_DFLAGS(n)	perr.perr_dests[n].dest_flags
 #define	PERR_DADDR(n)	perr.perr_dests[n].dest_addr
 #define	PERR_DSEQ(n)	perr.perr_dests[n].dest_seq
+#define	PERR_DRCODE(n)	perr.perr_dests[n].dest_rcode
 static void
 hwmp_peerdown(struct ieee80211_node *ni)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
+	struct ieee80211_mesh_state *ms = vap->iv_mesh;
 	struct ieee80211_meshperr_ie perr;
 	struct ieee80211_mesh_route *rt;
 	struct ieee80211_hwmp_route *hr;
@@ -1154,19 +1112,27 @@ hwmp_peerdown(struct ieee80211_node *ni)
 	hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route);
 	IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
 	    "%s", "delete route entry");
-	perr.perr_mode = 0;
+	perr.perr_ttl = ms->ms_ttl;
 	perr.perr_ndests = 1;
+	if (hr->hr_seq == 0)
+		PERR_DFLAGS(0) |= IEEE80211_MESHPERR_DFLAGS_USN;
+	PERR_DFLAGS(0) |= IEEE80211_MESHPERR_DFLAGS_RC;
 	IEEE80211_ADDR_COPY(PERR_DADDR(0), rt->rt_dest);
 	PERR_DSEQ(0) = hr->hr_seq;
+	PERR_DRCODE(0) = IEEE80211_REASON_MESH_PERR_DEST_UNREACH;
 	/* NB: flush everything passing through peer */
 	ieee80211_mesh_rt_flush_peer(vap, ni->ni_macaddr);
 	hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &perr);
 }
+#undef	PERR_DFLAGS
 #undef	PERR_DADDR
 #undef	PERR_DSEQ
+#undef	PERR_DRCODE
 
+#define	PERR_DFLAGS(n)	perr->perr_dests[n].dest_flags
 #define	PERR_DADDR(n)	perr->perr_dests[n].dest_addr
 #define	PERR_DSEQ(n)	perr->perr_dests[n].dest_seq
+#define	PERR_DRCODE(n)	perr->perr_dests[n].dest_rcode
 static void
 hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni,
     const struct ieee80211_frame *wh, const struct ieee80211_meshperr_ie *perr)
@@ -1192,9 +1158,9 @@ hwmp_recv_perr(struct ieee80211vap *vap,
 		rt = ieee80211_mesh_rt_find(vap, PERR_DADDR(i));
 		if (rt == NULL)
 			continue;
-		hr = IEEE80211_MESH_ROUTE_PRIV(rt,
-		    struct ieee80211_hwmp_route);
-		if (HWMP_SEQ_GEQ(PERR_DSEQ(i), hr->hr_seq)) {
+		hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route);
+		if (!(PERR_DFLAGS(0) & IEEE80211_MESHPERR_DFLAGS_USN) && 
+		    HWMP_SEQ_GEQ(PERR_DSEQ(i), hr->hr_seq)) {
 			ieee80211_mesh_rt_del(vap, rt->rt_dest);
 			ieee80211_mesh_rt_flush_peer(vap, rt->rt_dest);
 			rt = NULL;
@@ -1205,10 +1171,11 @@ hwmp_recv_perr(struct ieee80211vap *vap,
 	 * Propagate the PERR if we previously found it on our routing table.
 	 * XXX handle ndest > 1
 	 */
-	if (forward) {
+	if (forward && perr->perr_ttl > 1) {
 		IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
 		    "propagate PERR from %s", ether_sprintf(wh->i_addr2));
 		memcpy(&pperr, perr, sizeof(*perr));
+		pperr.perr_ttl--;
 		hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr,
 		    &pperr);
 	}

Modified: stable/8/sys/net80211/ieee80211_mesh.c
==============================================================================
--- stable/8/sys/net80211/ieee80211_mesh.c	Tue Sep 29 10:53:06 2009	(r197613)
+++ stable/8/sys/net80211/ieee80211_mesh.c	Tue Sep 29 12:18:23 2009	(r197614)
@@ -87,10 +87,10 @@ static void	mesh_peer_timeout_backoff(st
 static void	mesh_peer_timeout_cb(void *);
 static __inline void
 		mesh_peer_timeout_stop(struct ieee80211_node *);
-static int	mesh_verify_meshpeerver(struct ieee80211vap *, const uint8_t *);
 static int	mesh_verify_meshid(struct ieee80211vap *, const uint8_t *);
 static int	mesh_verify_meshconf(struct ieee80211vap *, const uint8_t *);
-static int	mesh_verify_meshpeer(struct ieee80211vap *, const uint8_t *);
+static int	mesh_verify_meshpeer(struct ieee80211vap *, uint8_t,
+    		    const uint8_t *);
 uint32_t	mesh_airtime_calc(struct ieee80211_node *);
 
 /*
@@ -1544,19 +1544,16 @@ static const struct ieee80211_meshpeer_i
 mesh_parse_meshpeering_action(struct ieee80211_node *ni,
 	const struct ieee80211_frame *wh,	/* XXX for VERIFY_LENGTH */
 	const uint8_t *frm, const uint8_t *efrm,
-	struct ieee80211_meshpeer_ie *mp)
+	struct ieee80211_meshpeer_ie *mp, uint8_t subtype)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
 	const struct ieee80211_meshpeer_ie *mpie;
-	const uint8_t *meshid, *meshconf, *meshpeerver, *meshpeer;
+	const uint8_t *meshid, *meshconf, *meshpeer;
 
-	meshid = meshconf = meshpeerver = meshpeer = NULL;
+	meshid = meshconf = meshpeer = NULL;
 	while (efrm - frm > 1) {
 		IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return NULL);
 		switch (*frm) {
-		case IEEE80211_ELEMID_MESHPEERVER:
-			meshpeerver = frm;
-			break;
 		case IEEE80211_ELEMID_MESHID:
 			meshid = frm;
 			break;
@@ -1567,12 +1564,10 @@ mesh_parse_meshpeering_action(struct iee
 			meshpeer = frm;
 			mpie = (const struct ieee80211_meshpeer_ie *) frm;
 			memset(mp, 0, sizeof(*mp));
-			mp->peer_subtype = mpie->peer_subtype;
 			mp->peer_llinkid = LE_READ_2(&mpie->peer_llinkid);
 			/* NB: peer link ID is optional on these frames */
-			if (mpie->peer_subtype ==
-			    IEEE80211_MESH_PEER_LINK_CLOSE &&
-			    mpie->peer_len == 5) {
+			if (subtype == IEEE80211_MESH_PEER_LINK_CLOSE &&
+			    mpie->peer_len == 8) {
 				mp->peer_linkid = 0;
 				mp->peer_rcode = LE_READ_2(&mpie->peer_linkid);
 			} else {
@@ -1589,12 +1584,12 @@ mesh_parse_meshpeering_action(struct iee
 	 * close subtype don't have a Mesh Configuration IE.
 	 * If if fails validation, close the peer link.
 	 */
-	KASSERT(meshpeer != NULL && mp->peer_subtype !=
-	    IEEE80211_ACTION_MESHPEERING_CLOSE, ("parsing close action"));
+	KASSERT(meshpeer != NULL &&
+	    subtype != IEEE80211_ACTION_MESHPEERING_CLOSE,
+	    ("parsing close action"));
 
-	if (mesh_verify_meshpeerver(vap, meshpeerver) ||
-	    mesh_verify_meshid(vap, meshid) ||
-	    mesh_verify_meshpeer(vap, meshpeer) ||
+	if (mesh_verify_meshid(vap, meshid) ||
+	    mesh_verify_meshpeer(vap, subtype, meshpeer) ||
 	    mesh_verify_meshconf(vap, meshconf)) {
 		uint16_t args[3];
 
@@ -1638,7 +1633,8 @@ mesh_recv_action_meshpeering_open(struct
 	uint16_t args[3];
 
 	/* +2+2 for action + code + capabilites */
-	meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2, efrm, &ie);
+	meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2, efrm, &ie,
+	    IEEE80211_ACTION_MESHPEERING_OPEN);
 	if (meshpeer == NULL) {
 		return 0;
 	}
@@ -1770,7 +1766,8 @@ mesh_recv_action_meshpeering_confirm(str
 	uint16_t args[3];
 
 	/* +2+2+2+2 for action + code + capabilites + status code + AID */
-	meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2+2+2, efrm, &ie);
+	meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2+2+2, efrm, &ie,
+	    IEEE80211_ACTION_MESHPEERING_CONFIRM);
 	if (meshpeer == NULL) {
 		return 0;
 	}
@@ -1933,7 +1930,6 @@ mesh_send_action_meshpeering_open(struct
 	    ic->ic_headroom + sizeof(struct ieee80211_frame),
 	    sizeof(uint16_t)	/* action+category */
 	    + sizeof(uint16_t)	/* capabilites */
-	    + sizeof(struct ieee80211_meshpeerver_ie)	 
 	    + 2 + IEEE80211_RATE_SIZE	 
 	    + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE)	 
 	    + 2 + IEEE80211_MESHID_LEN
@@ -1946,7 +1942,6 @@ mesh_send_action_meshpeering_open(struct
 		 *   [1] category
 		 *   [1] action
 		 *   [2] capabilities
-		 *   [tlv] mesh peer protocol version
 		 *   [tlv] rates
 		 *   [tlv] xrates
 		 *   [tlv] mesh id
@@ -1956,7 +1951,6 @@ mesh_send_action_meshpeering_open(struct
 		*frm++ = category;
 		*frm++ = action;
 		ADDSHORT(frm, ieee80211_getcapinfo(vap, ni->ni_chan));
-		frm = ieee80211_add_meshpeerver(frm, vap);
 		rs = ieee80211_get_suprates(ic, ic->ic_curchan);
 		frm = ieee80211_add_rates(frm, rs);
 		frm = ieee80211_add_xrates(frm, rs);
@@ -1999,7 +1993,6 @@ mesh_send_action_meshpeering_confirm(str
 	    + sizeof(uint16_t)	/* capabilites */
 	    + sizeof(uint16_t)	/* status code */
 	    + sizeof(uint16_t)	/* AID */
-	    + sizeof(struct ieee80211_meshpeerver_ie)	 
 	    + 2 + IEEE80211_RATE_SIZE	 
 	    + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE)	 
 	    + 2 + IEEE80211_MESHID_LEN
@@ -2014,7 +2007,6 @@ mesh_send_action_meshpeering_confirm(str
 		 *   [2] capabilities
 		 *   [2] status code
 		 *   [2] association id (peer ID)
-		 *   [tlv] mesh peer protocol version
 		 *   [tlv] rates
 		 *   [tlv] xrates
 		 *   [tlv] mesh id
@@ -2026,7 +2018,6 @@ mesh_send_action_meshpeering_confirm(str
 		ADDSHORT(frm, ieee80211_getcapinfo(vap, ni->ni_chan));
 		ADDSHORT(frm, 0);		/* status code */
 		ADDSHORT(frm, args[1]);		/* AID */
-		frm = ieee80211_add_meshpeerver(frm, vap);
 		rs = ieee80211_get_suprates(ic, ic->ic_curchan);
 		frm = ieee80211_add_rates(frm, rs);
 		frm = ieee80211_add_xrates(frm, rs);
@@ -2067,7 +2058,6 @@ mesh_send_action_meshpeering_close(struc
 	    ic->ic_headroom + sizeof(struct ieee80211_frame),
 	    sizeof(uint16_t)	/* action+category */
 	    + sizeof(uint16_t)	/* reason code */
-	    + sizeof(struct ieee80211_meshpeerver_ie)
 	    + 2 + IEEE80211_MESHID_LEN
 	    + sizeof(struct ieee80211_meshpeer_ie) 
 	);
@@ -2077,14 +2067,12 @@ mesh_send_action_meshpeering_close(struc
 		 *   [1] category
 		 *   [1] action
 		 *   [2] reason code
-		 *   [tlv] mesh peer protocol version
 		 *   [tlv] mesh id
 		 *   [tlv] mesh peer link mgmt
 		 */
 		*frm++ = category;
 		*frm++ = action;
 		ADDSHORT(frm, args[2]);		/* reason code */
-		frm = ieee80211_add_meshpeerver(frm, vap);
 		frm = ieee80211_add_meshid(frm, vap);
 		frm = ieee80211_add_meshpeer(frm,
 		    IEEE80211_MESH_PEER_LINK_CLOSE,
@@ -2279,19 +2267,6 @@ mesh_peer_timeout_cb(void *arg)
 }
 
 static int
-mesh_verify_meshpeerver(struct ieee80211vap *vap, const uint8_t *ie)
-{
-	static const uint8_t peer[4] = IEEE80211_MESHPEERVER_PEER;
-	const struct ieee80211_meshpeerver_ie *meshpeerver =
-	    (const struct ieee80211_meshpeerver_ie *) ie;
-
-	if (meshpeerver->peerver_len !=
-	    sizeof(struct ieee80211_meshpeerver_ie) - 2)
-		return 1;
-	return memcmp(meshpeerver->peerver_proto, peer, 4);
-}
-
-static int
 mesh_verify_meshid(struct ieee80211vap *vap, const uint8_t *ie)
 {
 	struct ieee80211_mesh_state *ms = vap->iv_mesh;
@@ -2364,26 +2339,28 @@ mesh_verify_meshconf(struct ieee80211vap
 }
 
 static int
-mesh_verify_meshpeer(struct ieee80211vap *vap, const uint8_t *ie)
+mesh_verify_meshpeer(struct ieee80211vap *vap, uint8_t subtype,
+    const uint8_t *ie)
 {
 	const struct ieee80211_meshpeer_ie *meshpeer =
 	    (const struct ieee80211_meshpeer_ie *) ie;
 
-	if (meshpeer == NULL)
+	if (meshpeer == NULL || meshpeer->peer_len < 6 ||
+	    meshpeer->peer_len > 10)
 		return 1;
-	switch (meshpeer->peer_subtype) {
+	switch (subtype) {
 	case IEEE80211_MESH_PEER_LINK_OPEN:
-		if (meshpeer->peer_len != 3)
+		if (meshpeer->peer_len != 6)
 			return 1;
 		break;
 	case IEEE80211_MESH_PEER_LINK_CONFIRM:
-		if (meshpeer->peer_len != 5)
+		if (meshpeer->peer_len != 8)
 			return 1;
 		break;
 	case IEEE80211_MESH_PEER_LINK_CLOSE:
-		if (meshpeer->peer_len < 5)
+		if (meshpeer->peer_len < 8)
 			return 1;
-		if (meshpeer->peer_len == 5 && meshpeer->peer_linkid != 0)
+		if (meshpeer->peer_len == 8 && meshpeer->peer_linkid != 0)
 			return 1;
 		if (meshpeer->peer_rcode == 0)
 			return 1;
@@ -2449,53 +2426,40 @@ ieee80211_add_meshconf(uint8_t *frm, str
 }
 
 /*
- * Add a Mesh Peer Protocol IE to a frame.
- * XXX: needs to grow support for Abbreviated Handshake
- */
-uint8_t *
-ieee80211_add_meshpeerver(uint8_t *frm, struct ieee80211vap *vap)
-{
-	static struct ieee80211_meshpeerver_ie ie = {
-		.peerver_ie 	= IEEE80211_ELEMID_MESHPEERVER,
-		.peerver_len 	= 4,
-		.peerver_proto	= IEEE80211_MESHPEERVER_PEER,
-	};
-
-	KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap"));
-
-	memcpy(frm, &ie, sizeof(ie));
-	return frm + sizeof(ie);
-}
-
-/*
  * Add a Mesh Peer Management IE to a frame.
  */
 uint8_t *
 ieee80211_add_meshpeer(uint8_t *frm, uint8_t subtype, uint16_t localid,
     uint16_t peerid, uint16_t reason)
 {
+	/* XXX change for AH */
+	static const uint8_t meshpeerproto[4] = IEEE80211_MESH_PEER_PROTO;
+
 	KASSERT(localid != 0, ("localid == 0"));
 
 	*frm++ = IEEE80211_ELEMID_MESHPEER;
 	switch (subtype) {
 	case IEEE80211_MESH_PEER_LINK_OPEN:
-		*frm++ = 3;		/* length */
-		*frm++ = subtype;
+		*frm++ = 6;		/* length */
+		memcpy(frm, meshpeerproto, 4);
+		frm += 4;
 		ADDSHORT(frm, localid);	/* local ID */
 		break;
 	case IEEE80211_MESH_PEER_LINK_CONFIRM:
 		KASSERT(peerid != 0, ("sending peer confirm without peer id"));
-		*frm++ = 5;		/* length */
-		*frm++ = subtype;
+		*frm++ = 8;		/* length */
+		memcpy(frm, meshpeerproto, 4);
+		frm += 4;
 		ADDSHORT(frm, localid);	/* local ID */
 		ADDSHORT(frm, peerid);	/* peer ID */
 		break;
 	case IEEE80211_MESH_PEER_LINK_CLOSE:
 		if (peerid)
-			*frm++ = 7;	/* length */
+			*frm++ = 10;	/* length */
 		else
-			*frm++ = 5;	/* length */
-		*frm++ = subtype;
+			*frm++ = 8;	/* length */
+		memcpy(frm, meshpeerproto, 4);
+		frm += 4;
 		ADDSHORT(frm, localid);	/* local ID */
 		if (peerid)
 			ADDSHORT(frm, peerid);	/* peer ID */

Modified: stable/8/sys/net80211/ieee80211_mesh.h
==============================================================================
--- stable/8/sys/net80211/ieee80211_mesh.h	Tue Sep 29 10:53:06 2009	(r197613)
+++ stable/8/sys/net80211/ieee80211_mesh.h	Tue Sep 29 12:18:23 2009	(r197614)
@@ -34,7 +34,7 @@
 #define	IEEE80211_MESH_DEFAULT_TTL	31
 
 /*
- * NB: all structures are__packed  so sizeof works on arm, et. al.
+ * NB: all structures are __packed  so sizeof works on arm, et. al.
  */
 /*
  * 802.11s Information Elements.
@@ -116,28 +116,11 @@ struct ieee80211_meshcngst_ie {
 					   AC_BE, AC_VI, AC_VO */
 } __packed;
 
-/* Peer Version */
-struct ieee80211_meshpeerver_ie {
-	uint8_t		peerver_ie;	/* IEEE80211_ELEMID_MESHPEERVER */
-	uint8_t		peerver_len;
-	uint8_t		peerver_proto[4];
-} __packed;
-/* Mesh Peering Management Protocol */
-#define	IEEE80211_MESHPEERVER_PEER_OUI		0x00, 0x0f, 0xac
-#define	IEEE80211_MESHPEERVER_PEER_VALUE	0x2a
-#define	IEEE80211_MESHPEERVER_PEER	{ IEEE80211_MESHPEERVER_PEER_OUI, \
-					  IEEE80211_MESHPEERVER_PEER_VALUE }
-/* Abbreviated Handshake Protocol */
-#define	IEEE80211_MESHPEERVER_AH_OUI		0x00, 0x0f, 0xac
-#define	IEEE80211_MESHPEERVER_AH_VALUE		0x2b
-#define	IEEE80211_MESHPEERVER_AH	{ IEEE80211_MESHPEERVER_AH_OUI, \
-					  IEEE80211_MESHPEERVER_AH_VALUE }
-
 /* Peer Link Management */
 struct ieee80211_meshpeer_ie {
 	uint8_t		peer_ie;	/* IEEE80211_ELEMID_MESHPEER */
 	uint8_t		peer_len;
-	uint8_t		peer_subtype;
+	uint8_t		peer_proto[4];	/* Peer Management Protocol */
 	uint16_t	peer_llinkid;	/* Local Link ID */
 	uint16_t	peer_linkid;	/* Peer Link ID */
 	uint16_t	peer_rcode;
@@ -150,6 +133,16 @@ enum {
 	/* values 3-255 are reserved */
 };
 
+/* Mesh Peering Management Protocol */
+#define	IEEE80211_MESH_PEER_PROTO_OUI		0x00, 0x0f, 0xac
+#define	IEEE80211_MESH_PEER_PROTO_VALUE		0x2a
+#define	IEEE80211_MESH_PEER_PROTO	{ IEEE80211_MESH_PEER_PROTO_OUI, \
+					  IEEE80211_MESH_PEER_PROTO_VALUE }
+/* Abbreviated Handshake Protocol */
+#define	IEEE80211_MESH_PEER_PROTO_AH_OUI	0x00, 0x0f, 0xac
+#define	IEEE80211_MESH_PEER_PROTO_AH_VALUE	0x2b
+#define	IEEE80211_MESH_PEER_PROTO_AH	{ IEEE80211_MESH_PEER_PROTO_AH_OUI, \
+					  IEEE80211_MESH_PEER_PROTO_AH_VALUE }
 #ifdef notyet
 /* Mesh Channel Switch Annoucement */
 struct ieee80211_meshcsa_ie {
@@ -256,11 +249,15 @@ struct ieee80211_meshprep_ie {
 struct ieee80211_meshperr_ie {
 	uint8_t		perr_ie;	/* IEEE80211_ELEMID_MESHPERR */
 	uint8_t		perr_len;
-	uint8_t		perr_mode;	/* NB: reserved */
+	uint8_t		perr_ttl;
 	uint8_t		perr_ndests;	/* Number of Destinations */
 	struct {
+		uint8_t		dest_flags;
+#define	IEEE80211_MESHPERR_DFLAGS_USN	0x01
+#define	IEEE80211_MESHPERR_DFLAGS_RC	0x02
 		uint8_t		dest_addr[IEEE80211_ADDR_LEN];
 		uint32_t	dest_seq;	/* HWMP Sequence Number */
+		uint16_t	dest_rcode;
 	} __packed perr_dests[1];		/* NB: variable size */
 } __packed;
 
@@ -310,14 +307,11 @@ enum {
 };
 
 /*
- * Mesh Path Selection Action codes.
+ * Mesh Path Selection Action code.
  */
 enum {
-	IEEE80211_ACTION_MESHPATH_REQ	= 0,
-	IEEE80211_ACTION_MESHPATH_REP	= 1,
-	IEEE80211_ACTION_MESHPATH_ERR	= 2,
-	IEEE80211_ACTION_MESHPATH_RANN	= 3,
-	/* 4-255 reserved */
+	IEEE80211_ACTION_MESHPATH_SEL	= 0,
+	/* 1-255 reserved */
 };
 
 /*
@@ -479,7 +473,6 @@ int		ieee80211_mesh_register_proto_path(
 int		ieee80211_mesh_register_proto_metric(const
 		    struct ieee80211_mesh_proto_metric *);
 
-uint8_t *	ieee80211_add_meshpeerver(uint8_t *, struct ieee80211vap *);
 uint8_t *	ieee80211_add_meshid(uint8_t *, struct ieee80211vap *);
 uint8_t *	ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *);
 uint8_t *	ieee80211_add_meshpeer(uint8_t *, uint8_t, uint16_t, uint16_t,

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 12:20:11 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 19371106566C;
	Tue, 29 Sep 2009 12:20:11 +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 0823F8FC12;
	Tue, 29 Sep 2009 12:20:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TCKA2A085185;
	Tue, 29 Sep 2009 12:20:10 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TCKA7C085183;
	Tue, 29 Sep 2009 12:20:10 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200909291220.n8TCKA7C085183@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 29 Sep 2009 12:20: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: r197615 - 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: Tue, 29 Sep 2009 12:20:11 -0000

Author: rpaulo
Date: Tue Sep 29 12:20:10 2009
New Revision: 197615
URL: http://svn.freebsd.org/changeset/base/197615

Log:
  Mention 802.11s D3.03 support.
  
  Approved by:	re (implicit)

Modified:
  stable/8/UPDATING

Modified: stable/8/UPDATING
==============================================================================
--- stable/8/UPDATING	Tue Sep 29 12:18:23 2009	(r197614)
+++ stable/8/UPDATING	Tue Sep 29 12:20:10 2009	(r197615)
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20090929:
+	802.11s D3.03 support was committed. This is incompatible with
+	the previous code, which was based on D3.0.
+
 20090915:
 	ZFS snapshots are now mounted with MNT_IGNORE flag. Use -v option for
 	mount(8) and -a option for df(1) to see them.

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 12:21:54 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 65826106566B;
	Tue, 29 Sep 2009 12:21:54 +0000 (UTC)
	(envelope-from rpaulo@gmail.com)
Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DC5E8FC15;
	Tue, 29 Sep 2009 12:21:53 +0000 (UTC)
Received: by ey-out-2122.google.com with SMTP id 4so1200084eyf.9
	for ; Tue, 29 Sep 2009 05:21:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:references:in-reply-to
	:mime-version:content-type:message-id:content-transfer-encoding:from
	:subject:date:to:x-mailer;
	bh=umsVUkBqc9wZQqpeIceDTFaO1ipCJ1cXa8JPctf4nck=;
	b=KVavDy2dn01WVQ4RVXun6vwjcHXVh3gCMz7cyxBkcQW81JIHWMcxB2mPap667CNrAp
	pjeoVAm4T3QWggha2JwUHtsqhWXdHwK/e1H4/w3TlqwcGu6d525v+zY8502NZlGUMeJI
	XTHBvH5c5NLsTkV7JZu462aq8kCadhA+l8Blg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:references:in-reply-to:mime-version:content-type:message-id
	:content-transfer-encoding:from:subject:date:to:x-mailer;
	b=oSYGSZ2Pvthr21Hh3JRzLuaVeli49TUQuqjtRp0Uxeqw+cY+N3oxG4GnT7q3JuvEv7
	OtXDcb7AHVsT2QNEzZlb9maMVoFcpek7uxRj5NkmjJCeEu7fPyhOTeMnXG27asNDfWcy
	96WfH6OBpj2UFSXMTBoY5ppmNn+gwl4nuj03I=
Received: by 10.216.53.205 with SMTP id g55mr1054404wec.160.1254226912397;
	Tue, 29 Sep 2009 05:21:52 -0700 (PDT)
Received: from rui-macbook.lan (bl11-195-254.dsl.telepac.pt [85.244.195.254])
	by mx.google.com with ESMTPS id 10sm551126eyd.4.2009.09.29.05.21.51
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Tue, 29 Sep 2009 05:21:51 -0700 (PDT)
Sender: Rui Paulo 
References: <200909291218.n8TCINmv085038@svn.freebsd.org>
In-Reply-To: <200909291218.n8TCINmv085038@svn.freebsd.org>
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
Message-Id: 
Content-Transfer-Encoding: 7bit
From: Rui Paulo 
Date: Tue, 29 Sep 2009 13:21:49 +0100
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-Mailer: Apple Mail (2.1076)
Cc: 
Subject: Re: svn commit: r197614 - 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: Tue, 29 Sep 2009 12:21:54 -0000

On 29 Sep 2009, at 13:18, Rui Paulo wrote:

> Author: rpaulo
> Date: Tue Sep 29 12:18:23 2009
> New Revision: 197614
> URL: http://svn.freebsd.org/changeset/base/197614
>
> Log:
>  Update 802.11s mesh support to draft 3.03. This includes a revised   
> frame
>  format for peering and changes to the PERR frames.
>  Note that this is incompatible with the previous code.

Argh, MFC revision number is missing. This is an MFC for 197413.

Sorry,
--
Rui Paulo


From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 12:56:14 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35ED2106568F;
	Tue, 29 Sep 2009 12:56:14 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com
	[209.85.219.209])
	by mx1.freebsd.org (Postfix) with ESMTP id 4699D8FC23;
	Tue, 29 Sep 2009 12:56:12 +0000 (UTC)
Received: by ewy5 with SMTP id 5so3994928ewy.36
	for ; Tue, 29 Sep 2009 05:56:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:from:date:x-google-sender-auth:message-id:subject:to:cc
	:content-type:content-transfer-encoding;
	bh=Vj17cIEkkjAEvyNnYcfxXoSjt16GbPIkGBwYNwniZDY=;
	b=wFBE7UiIGndA1ZfR1TbMsQxoXtLEB1exuRzyzhpQnd5E7Xr8zuPMiRJG9InQ83Xngm
	KKSlJwRBg89VszQOp0a3uzQh9xbJ99Xef2bB9J6Ns6oaGkgH9UtBAWhkXyEv1L1eVfUa
	X/+xWmNzRfuMf4W8yWeufyf+AgtaySNNuSfnY=
DomainKey-Signature: a=rsa-sha1; c=nofws; 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;
	b=MhhsJu6o0EL5ZiubMcylt7gXhlLHvEjJ7tvBSQZdrFcsgR2ael4VyaBSBdWOBqMHU2
	kau3dyIe0N0wt+uwkhn/utvMo58y7M/U/lNiNAqCSCzP5sekeZRvz/Y0tQTAGwNzzL7E
	gJX8bNFXPCK0kQSQTQoR0eBrPAKSSoTMBXFWI=
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.216.86.206 with SMTP id w56mr246416wee.1.1254228972144; Tue, 
	29 Sep 2009 05:56:12 -0700 (PDT)
In-Reply-To: <200909291220.n8TCKA7C085183@svn.freebsd.org>
References: <200909291220.n8TCKA7C085183@svn.freebsd.org>
From: Ivan Voras 
Date: Tue, 29 Sep 2009 14:55:52 +0200
X-Google-Sender-Auth: 8850a75d1aa5d4fe
Message-ID: <9bbcef730909290555i6ba85783x36d4a9708323f436@mail.gmail.com>
To: src-committers@freebsd.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r197615 - 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: Tue, 29 Sep 2009 12:56:14 -0000

2009/9/29 Rui Paulo :

> --- stable/8/UPDATING =C2=A0 Tue Sep 29 12:18:23 2009 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(r197614)
> +++ stable/8/UPDATING =C2=A0 Tue Sep 29 12:20:10 2009 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0(r197615)
> @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
> =C2=A0 =C2=A0 =C2=A0 =C2=A0to maximize performance. =C2=A0(To disable mal=
loc debugging, run
> =C2=A0 =C2=A0 =C2=A0 =C2=A0ln -s aj /etc/malloc.conf.)

So the "NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW" message is
still here?

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 13:03:10 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD5581065672;
	Tue, 29 Sep 2009 13:03:10 +0000 (UTC)
	(envelope-from rpaulo@gmail.com)
Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com
	[209.85.219.209])
	by mx1.freebsd.org (Postfix) with ESMTP id 929708FC19;
	Tue, 29 Sep 2009 13:03:09 +0000 (UTC)
Received: by ewy5 with SMTP id 5so4001919ewy.36
	for ; Tue, 29 Sep 2009 06:03:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:subject:mime-version
	:content-type:from:in-reply-to:date:cc:content-transfer-encoding
	:message-id:references:to:x-mailer;
	bh=FJQB9pQI7BhL0WUw6/Esnk3tXVqQojdg7j7Nav+wOnU=;
	b=fRTy71XuzZi7/fEjLVyaJOXZWa0xGBKEgzWT9WPZ81W2Ie7qZ/3d7QXrZn44Fwwx5A
	5ioGqUojEccX3iNMi40Tk/w8AbNTuGaxB5eQ+dZk4r49b5w7dETZCobJgi8B0t30Q82z
	1BAwUFXLHUw/qn1WVJXdKWw3EEUyW+HSN/mh0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=dZ+LYLh3wVFYhYcDyeAM6jQit/AHrT3Xc6gwqwb+PsL0j2/lAsrXR4I2xEnQc61vPl
	5uilFB8QdbIQGoXKvQ26PKlktT0lppqsjdxR46Z9BRBZBgNSZnb7oP0r0XOhfU5xLm/K
	c986O7j5fmDWzYPIB3yK7WOyMTUW41MIaxbjE=
Received: by 10.210.3.18 with SMTP id 18mr4359312ebc.80.1254229388660;
	Tue, 29 Sep 2009 06:03:08 -0700 (PDT)
Received: from mac-mini.lan (bl11-195-254.dsl.telepac.pt [85.244.195.254])
	by mx.google.com with ESMTPS id 7sm1116867eyg.41.2009.09.29.06.03.07
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Tue, 29 Sep 2009 06:03:07 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed
From: Rui Paulo 
In-Reply-To: <9bbcef730909290555i6ba85783x36d4a9708323f436@mail.gmail.com>
Date: Tue, 29 Sep 2009 14:03:05 +0100
Content-Transfer-Encoding: 7bit
Message-Id: 
References: <200909291220.n8TCKA7C085183@svn.freebsd.org>
	<9bbcef730909290555i6ba85783x36d4a9708323f436@mail.gmail.com>
To: Ivan Voras 
X-Mailer: Apple Mail (2.1076)
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: r197615 - 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: Tue, 29 Sep 2009 13:03:10 -0000

On 29 Sep 2009, at 13:55, Ivan Voras wrote:

> 2009/9/29 Rui Paulo :
>
>> --- stable/8/UPDATING   Tue Sep 29 12:18:23 2009        (r197614)
>> +++ stable/8/UPDATING   Tue Sep 29 12:20:10 2009        (r197615)
>> @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
>>        to maximize performance.  (To disable malloc debugging, run
>>        ln -s aj /etc/malloc.conf.)
>
> So the "NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW" message is
> still here?

Send a patch to re@ asking for removal :-)

--
Rui Paulo




From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 13:09:16 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4AE35106566C;
	Tue, 29 Sep 2009 13:09:16 +0000 (UTC)
	(envelope-from serenity@exscape.org)
Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net
	[80.76.149.212])
	by mx1.freebsd.org (Postfix) with ESMTP id F20EA8FC14;
	Tue, 29 Sep 2009 13:09:15 +0000 (UTC)
Received: from c83-253-248-99.bredband.comhem.se ([83.253.248.99]:60893
	helo=mx.exscape.org)
	by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68)
	(envelope-from )
	id 1MscS0-0001ob-4Y; Tue, 29 Sep 2009 15:09:06 +0200
Received: from [192.168.1.5] (macbookpro [192.168.1.5])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by mx.exscape.org (Postfix) with ESMTPSA id 0D09C1CF593;
	Tue, 29 Sep 2009 15:08:58 +0200 (CEST)
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
From: Thomas Backman 
In-Reply-To: 
Date: Tue, 29 Sep 2009 15:08:55 +0200
Content-Transfer-Encoding: 7bit
Message-Id: <1BB83399-AEAC-430C-973A-F850ED90E69E@exscape.org>
References: <200909291220.n8TCKA7C085183@svn.freebsd.org>
	<9bbcef730909290555i6ba85783x36d4a9708323f436@mail.gmail.com>
	
To: Rui Paulo 
X-Mailer: Apple Mail (2.1076)
X-Originating-IP: 83.253.248.99
X-Scan-Result: No virus found in message 1MscS0-0001ob-4Y.
X-Scan-Signature: ch-smtp01.sth.basefarm.net 1MscS0-0001ob-4Y
	63becf37275f51a4c86d6bf0ea9d0154
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org,
	Ivan Voras 
Subject: Re: svn commit: r197615 - 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: Tue, 29 Sep 2009 13:09:16 -0000

On Sep 29, 2009, at 3:03 PM, Rui Paulo wrote:

> On 29 Sep 2009, at 13:55, Ivan Voras wrote:
>
>> 2009/9/29 Rui Paulo :
>>
>>> --- stable/8/UPDATING   Tue Sep 29 12:18:23 2009        (r197614)
>>> +++ stable/8/UPDATING   Tue Sep 29 12:20:10 2009        (r197615)
>>> @@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
>>>       to maximize performance.  (To disable malloc debugging, run
>>>       ln -s aj /etc/malloc.conf.)
>>
>> So the "NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW" message is
>> still here?
>
> Send a patch to re@ asking for removal :-)
It should probably be noted that INVARIANTS* are left on ia64 and (as  
far as I understand) everything is left on sun4v.

Regards,
Thomas

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 14:54:49 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA06A106566B;
	Tue, 29 Sep 2009 14:54:49 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 9141D8FC1B;
	Tue, 29 Sep 2009 14:54:49 +0000 (UTC)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.69) (envelope-from )
	id 1Mshpm-0000zO-5f; Tue, 29 Sep 2009 22:53:58 +0400
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id F3739B84D;
	Tue, 29 Sep 2009 18:54:46 +0400 (MSD)
Received: by hades.panopticon (Postfix, from userid 1000)
	id 12B96B849; Tue, 29 Sep 2009 18:54:47 +0400 (MSD)
Date: Tue, 29 Sep 2009 18:54:47 +0400
From: Dmitry Marakasov 
To: John Baldwin 
Message-ID: <20090929145447.GA82539@hades.panopticon>
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <200909290749.08764.jhb@freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar , src-committers@freebsd.org
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 14:54:50 -0000

* John Baldwin (jhb@freebsd.org) wrote:

> Why do you check for zeros at all?  AFAIK, the only real check is for AA55 at 
> the end of the sector (and having an MBR or other Extended MBR partition 
> entry point at the sector in question).  The '96' thing seems rather 
> arbitrary in the code, and I think the zero's check is overly restrictive.

Seconded. I've seen a report of geom_part_ebr unable to detect
partitions which were actually there. Will inquiry the reporter if
this change solved the problem.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 16:18:26 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85D0E106566C;
	Tue, 29 Sep 2009 16:18:26 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104])
	by mx1.freebsd.org (Postfix) with ESMTP id 6CD098FC1C;
	Tue, 29 Sep 2009 16:18:26 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes
Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36])
	by asmtp029.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KQQ0098TQMBYL50@asmtp029.mac.com>; Tue,
	29 Sep 2009 09:18:26 -0700 (PDT)
From: Marcel Moolenaar 
In-reply-to: <200909290749.08764.jhb@freebsd.org>
Date: Tue, 29 Sep 2009 09:18:11 -0700
Message-id: <1F22EA6A-2793-45CE-9669-3FFD550CF4E2@mac.com>
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
To: John Baldwin 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar , src-committers@freebsd.org
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 16:18:26 -0000


On Sep 29, 2009, at 4:49 AM, John Baldwin wrote:

> On Monday 28 September 2009 7:52:47 pm Marcel Moolenaar wrote:
>> Author: marcel
>> Date: Mon Sep 28 23:52:47 2009
>> New Revision: 197608
>> URL: http://svn.freebsd.org/changeset/base/197608
>>
>> Log:
>>  The first 96 bytes may not be zeroes. It can contain trivial boot
>>  code that merely emits an error and waits for a key press before
>>  rebooting. The error being that extended partitions are not
>>  bootable. The origin is presumed to be Windows 2000; Windows XP
>>  does not do this...
>>
>>  For now, ignore the first 96 bytes when checking that the EBR is
>>  (for the most part) all zeroes.
>>
>>  Tested by:	Mario Lobo 
>>  MFC after:	1 week
>>
>> Modified:
>>  head/sys/geom/part/g_part_ebr.c
>
> Why do you check for zeros at all?  AFAIK, the only real check is  
> for AA55 at
> the end of the sector (and having an MBR or other Extended MBR  
> partition
> entry point at the sector in question).  The '96' thing seems rather
> arbitrary in the code, and I think the zero's check is overly  
> restrictive.

Only checking for a signature that 99% of the boot blocks
have isn't enough. The msdos file system has that signature
and the check for all-zeroes is to prevent false positives
there.

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 16:19:49 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 27EBA106566C;
	Tue, 29 Sep 2009 16:19:49 +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 15D058FC15;
	Tue, 29 Sep 2009 16:19:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TGJmOq089761;
	Tue, 29 Sep 2009 16:19:48 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TGJmRg089759;
	Tue, 29 Sep 2009 16:19:48 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200909291619.n8TGJmRg089759@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 29 Sep 2009 16:19:48 +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: r197617 - stable/7/sys/dev/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: Tue, 29 Sep 2009 16:19:49 -0000

Author: mav
Date: Tue Sep 29 16:19:48 2009
New Revision: 197617
URL: http://svn.freebsd.org/changeset/base/197617

Log:
  Partial MFC rev. 191568:
  Do not hide second channel of ATI IXP700 ATA controller.
  While this chip indeed has only one PATA channel, second channel of the
  controller is used by two SATA channels working in legacy emulation mode.

Modified:
  stable/7/sys/dev/ata/ata-chipset.c

Modified: stable/7/sys/dev/ata/ata-chipset.c
==============================================================================
--- stable/7/sys/dev/ata/ata-chipset.c	Tue Sep 29 12:59:31 2009	(r197616)
+++ stable/7/sys/dev/ata/ata-chipset.c	Tue Sep 29 16:19:48 2009	(r197617)
@@ -1406,9 +1406,8 @@ ata_ati_chipinit(device_t dev)
     if (ata_setup_interrupt(dev))
 	return ENXIO;
 
-    /* IXP600 & IXP700 only have 1 PATA channel */
-    if ((ctlr->chip->chipid == ATA_ATI_IXP600) ||
-	(ctlr->chip->chipid == ATA_ATI_IXP700))
+    /* IXP600 only have 1 PATA channel */
+    if (ctlr->chip->chipid == ATA_ATI_IXP600)
 	ctlr->channels = 1;
 
     ctlr->setmode = ata_ati_setmode;

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 16:26:10 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2B926106566C;
	Tue, 29 Sep 2009 16:26:10 +0000 (UTC)
	(envelope-from cperciva@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 190078FC14;
	Tue, 29 Sep 2009 16:26:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TGQ9x8089931;
	Tue, 29 Sep 2009 16:26:09 GMT
	(envelope-from cperciva@svn.freebsd.org)
Received: (from cperciva@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TGQ919089929;
	Tue, 29 Sep 2009 16:26:09 GMT
	(envelope-from cperciva@svn.freebsd.org)
Message-Id: <200909291626.n8TGQ919089929@svn.freebsd.org>
From: Colin Percival 
Date: Tue, 29 Sep 2009 16:26: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: r197618 - head/usr.sbin/freebsd-update
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 16:26:10 -0000

Author: cperciva
Date: Tue Sep 29 16:26:09 2009
New Revision: 197618
URL: http://svn.freebsd.org/changeset/base/197618

Log:
  Special-case "-r X" where X is [0-9.]+ to mean "-r X-RELEASE".
  
  Tripped over by:	too many people to count
  MFC after:	1 month

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==============================================================================
--- head/usr.sbin/freebsd-update/freebsd-update.sh	Tue Sep 29 16:19:48 2009	(r197617)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh	Tue Sep 29 16:26:09 2009	(r197618)
@@ -284,6 +284,9 @@ config_TargetRelease () {
 	else
 		return 1
 	fi
+	if echo ${TARGETRELEASE} | grep -qE '^[0-9.]+$'; then
+		TARGETRELEASE="${TARGETRELEASE}-RELEASE"
+	fi
 }
 
 # Define what happens to output of utilities

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 16:49:10 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E747D1065676;
	Tue, 29 Sep 2009 16:49:10 +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 D68828FC34;
	Tue, 29 Sep 2009 16:49:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TGnATA090424;
	Tue, 29 Sep 2009 16:49:10 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TGnAsb090422;
	Tue, 29 Sep 2009 16:49:10 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200909291649.n8TGnAsb090422@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 29 Sep 2009 16:49: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: r197619 - head/etc/defaults
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 16:49:11 -0000

Author: dougb
Date: Tue Sep 29 16:49:10 2009
New Revision: 197619
URL: http://svn.freebsd.org/changeset/base/197619

Log:
  By popular acclaim, enable "Starting foo:" messages by default

Modified:
  head/etc/defaults/rc.conf

Modified: head/etc/defaults/rc.conf
==============================================================================
--- head/etc/defaults/rc.conf	Tue Sep 29 16:26:09 2009	(r197618)
+++ head/etc/defaults/rc.conf	Tue Sep 29 16:49:10 2009	(r197619)
@@ -23,7 +23,7 @@
 
 rc_debug="NO"		# Set to YES to enable debugging output from rc.d
 rc_info="NO"		# Enables display of informational messages at boot.
-rc_startmsgs="NO" 	# Show "Starting foo:" messages at boot
+rc_startmsgs="YES" 	# Show "Starting foo:" messages at boot
 rcshutdown_timeout="30" # Seconds to wait before terminating rc.shutdown
 early_late_divider="FILESYSTEMS"	# Script that separates early/late
 			# stages of the boot process.  Make sure you know

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 17:00:06 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B7ED1065670;
	Tue, 29 Sep 2009 17:00:06 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 49E008FC1E;
	Tue, 29 Sep 2009 17:00:06 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id DD51946B03;
	Tue, 29 Sep 2009 13:00:05 -0400 (EDT)
Date: Tue, 29 Sep 2009 18:00:05 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Marcel Moolenaar 
In-Reply-To: <1F22EA6A-2793-45CE-9669-3FFD550CF4E2@mac.com>
Message-ID: 
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
	<1F22EA6A-2793-45CE-9669-3FFD550CF4E2@mac.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar ,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 17:00:06 -0000


On Tue, 29 Sep 2009, Marcel Moolenaar wrote:

>> Why do you check for zeros at all?  AFAIK, the only real check is for AA55 
>> at the end of the sector (and having an MBR or other Extended MBR partition 
>> entry point at the sector in question).  The '96' thing seems rather 
>> arbitrary in the code, and I think the zero's check is overly restrictive.
>
> Only checking for a signature that 99% of the boot blocks have isn't enough. 
> The msdos file system has that signature and the check for all-zeroes is to 
> prevent false positives there.

And, as I recall, the msdosfs check has been gradually getting weaker over 
time as the constraints it places on things like cylinder counts become 
obsolete.  It's not quite that we'll mount msdosfs on any random pile of 
bytes, but it might be getting there...

Robert

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 17:23:24 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 21209106568B;
	Tue, 29 Sep 2009 17:23:24 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100])
	by mx1.freebsd.org (Postfix) with ESMTP id 050DB8FC1D;
	Tue, 29 Sep 2009 17:23:23 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes
Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36])
	by asmtp025.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KQQ00C7ATMTXB50@asmtp025.mac.com>; Tue,
	29 Sep 2009 10:23:23 -0700 (PDT)
From: Marcel Moolenaar 
In-reply-to: 
Date: Tue, 29 Sep 2009 10:23:17 -0700
Message-id: 
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
	<1F22EA6A-2793-45CE-9669-3FFD550CF4E2@mac.com>
	
To: Robert Watson 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar ,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 17:23:24 -0000


On Sep 29, 2009, at 10:00 AM, Robert Watson wrote:

>
> On Tue, 29 Sep 2009, Marcel Moolenaar wrote:
>
>>> Why do you check for zeros at all?  AFAIK, the only real check is  
>>> for AA55 at the end of the sector (and having an MBR or other  
>>> Extended MBR partition entry point at the sector in question).   
>>> The '96' thing seems rather arbitrary in the code, and I think the  
>>> zero's check is overly restrictive.
>>
>> Only checking for a signature that 99% of the boot blocks have  
>> isn't enough. The msdos file system has that signature and the  
>> check for all-zeroes is to prevent false positives there.
>
> And, as I recall, the msdosfs check has been gradually getting  
> weaker over time as the constraints it places on things like  
> cylinder counts become obsolete.  It's not quite that we'll mount  
> msdosfs on any random pile of bytes, but it might be getting there...

We really need to get to a point where we treat partition types  
seriously and
use it to help avoid false positives. Reducing or eliminating false  
positives
is critical if we ever want to go towards DWIM or auto-mounting. With  
the
partition type taken into consideration, we may be able to eliminate  
ad hoc
checks, like the zero check in g_part_ebr, without creating false  
positives.

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 17:25:22 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3FA5A106568F;
	Tue, 29 Sep 2009 17:25:22 +0000 (UTC)
	(envelope-from joel@FreeBSD.org)
Received: from mail.vnode.se (mail.vnode.se [62.119.52.82])
	by mx1.freebsd.org (Postfix) with ESMTP id E9F908FC14;
	Tue, 29 Sep 2009 17:25:21 +0000 (UTC)
Received: from iMac.local (pgw.vnode.se [77.110.37.134])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.vnode.se (Postfix) with ESMTPSA id 13B1AE9F42C;
	Tue, 29 Sep 2009 19:25:19 +0200 (CEST)
Message-ID: <4AC242FF.2020601@FreeBSD.org>
Date: Tue, 29 Sep 2009 19:25:19 +0200
From: Joel Dahl 
User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
MIME-Version: 1.0
To: Doug Barton 
References: <200909291649.n8TGnAsb090422@svn.freebsd.org>
In-Reply-To: <200909291649.n8TGnAsb090422@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: r197619 - head/etc/defaults
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 17:25:22 -0000

Doug Barton skrev:
> Author: dougb
> Date: Tue Sep 29 16:49:10 2009
> New Revision: 197619
> URL: http://svn.freebsd.org/changeset/base/197619
> 
> Log:
>   By popular acclaim, enable "Starting foo:" messages by default

Thank you.

-- 
Joel

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 17:33:34 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4A2B9106568D;
	Tue, 29 Sep 2009 17:33:34 +0000 (UTC)
	(envelope-from stas@FreeBSD.org)
Received: from mx0.deglitch.com (backbone.deglitch.com
	[IPv6:2001:16d8:fffb:4::abba])
	by mx1.freebsd.org (Postfix) with ESMTP id E805F8FC12;
	Tue, 29 Sep 2009 17:33:33 +0000 (UTC)
Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227])
	by mx0.deglitch.com (Postfix) with ESMTPSA id 1435A8FC45;
	Tue, 29 Sep 2009 21:33:32 +0400 (MSD)
Date: Tue, 29 Sep 2009 21:33:27 +0400
From: Stanislav Sedov 
To: Doug Barton 
Message-Id: <20090929213327.df62ab92.stas@FreeBSD.org>
In-Reply-To: <200909291649.n8TGnAsb090422@svn.freebsd.org>
References: <200909291649.n8TGnAsb090422@svn.freebsd.org>
Organization: The FreeBSD Project
X-Mailer: carrier-pigeon
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature";
	micalg="PGP-SHA1";
	boundary="Signature=_Tue__29_Sep_2009_21_33_27_+0400_gXO21Wm_I2gLUuHB"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r197619 - head/etc/defaults
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 17:33:34 -0000

--Signature=_Tue__29_Sep_2009_21_33_27_+0400_gXO21Wm_I2gLUuHB
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, 29 Sep 2009 16:49:10 +0000 (UTC)
Doug Barton  mentioned:

> Author: dougb
> Date: Tue Sep 29 16:49:10 2009
> New Revision: 197619
> URL: http://svn.freebsd.org/changeset/base/197619
>=20
> Log:
>   By popular acclaim, enable "Starting foo:" messages by default
>=20

Thanks!

--=20
Stanislav Sedov
ST4096-RIPE

--Signature=_Tue__29_Sep_2009_21_33_27_+0400_gXO21Wm_I2gLUuHB
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----

iQIcBAEBAgAGBQJKwkTsAAoJEKN82nOYvCd0SgQP/iQpAMvkcoCGDUZ+4hiuyxqL
W6i47QrBj56ZuhbDrw/Z5DkcifFYk461PEoNCNwFhXGw1Q71Drar+kb2prMhsZdw
mufMtdFqN7YuDjdNWLQRDnx9JlGLkFOLsqXUMlBubgerU2ApqCneLvkbFAw9svqZ
PkyCOSD0f/dJxsXs0S+CenrDsp+cWKy+reKkClYJXxPlFuZgcI8M+ozK8XtxBNYJ
QsLFfcz2O/rQw5Yeot8etMyCWnHow7YIcJK3HcGUZfAFYm05amQVt9REtW/2/a5O
U6/PQgMnC36zBt09uhk1oEXNxMjJDvB0HDyIv7QvwSp2gXdxnZnp1cwB8bjRYJTF
Yem3x2AMwjgjmuJbkix+uiFJVlQEhQuPN6pI1l81LwWj3i7IzObIO0zkDknLA8IE
n81jx3AK/XAL3M/VciNHFNmFXlN+ljIu9Mq1uqKtaF5ToeDzkktn/qOU2mk4o/bl
KPtK8X42fDA6anUGy8fkyxNV7mkiKuQre5+HShQlnq1UBn+Y2Dx+w9SUStPQAghF
SBYznwDw0v7U3D5/T23vsPAZPD6eZrLBfZaJB4HuEuXb5uTAhSJeT1chMlrNHLNm
DCjqmX8Qlyt6y/MRNS0u/sIN14XJQzIt1vLM/RS1wkbjvqi82t4v1+oKj9Vg9xZs
PcEz6Zyz8jZ6Yo0Hg7zZ
=7GoO
-----END PGP SIGNATURE-----

--Signature=_Tue__29_Sep_2009_21_33_27_+0400_gXO21Wm_I2gLUuHB--

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 17:44:59 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 566C4106566B;
	Tue, 29 Sep 2009 17:44:59 +0000 (UTC) (envelope-from des@des.no)
Received: from tim.des.no (tim.des.no [194.63.250.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 12CEC8FC0A;
	Tue, 29 Sep 2009 17:44:58 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 071A26D41B;
	Tue, 29 Sep 2009 17:44:57 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id B1ADF84549; Tue, 29 Sep 2009 19:44:57 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Doug Barton 
References: <200909291649.n8TGnAsb090422@svn.freebsd.org>
Date: Tue, 29 Sep 2009 19:44:57 +0200
In-Reply-To: <200909291649.n8TGnAsb090422@svn.freebsd.org> (Doug Barton's
	message of "Tue, 29 Sep 2009 16:49:10 +0000 (UTC)")
Message-ID: <86hbulejc6.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix)
MIME-Version: 1.0
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: r197619 - head/etc/defaults
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 17:44:59 -0000

Doug Barton  writes:
> Log:
>   By popular acclaim, enable "Starting foo:" messages by default

My hero!

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 17:55:10 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C7D481065672;
	Tue, 29 Sep 2009 17:55:10 +0000 (UTC) (envelope-from mj@feral.com)
Received: from ns1.feral.com (ns1.feral.com [192.67.166.1])
	by mx1.freebsd.org (Postfix) with ESMTP id 815D08FC26;
	Tue, 29 Sep 2009 17:55:10 +0000 (UTC)
Received: from [10.8.0.2] (remotevpn [10.8.0.2])
	by ns1.feral.com (8.14.3/8.14.3) with ESMTP id n8THQHBu029104
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 29 Sep 2009 10:26:22 -0700 (PDT) (envelope-from mj@feral.com)
Message-ID: <4AC24335.1060306@feral.com>
Date: Tue, 29 Sep 2009 10:26:13 -0700
From: Matthew Jacob 
Organization: Feral Software
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18
MIME-Version: 1.0
To: Marcel Moolenaar 
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
	<1F22EA6A-2793-45CE-9669-3FFD550CF4E2@mac.com>
	
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.3
	(ns1.feral.com [10.8.0.1]); Tue, 29 Sep 2009 10:26:23 -0700 (PDT)
Cc: Marcel Moolenaar , John Baldwin ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org,
	Robert Watson , svn-src-head@FreeBSD.org
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 17:55:10 -0000

Marcel Moolenaar wrote:
>
> We really need to get to a point where we treat partition types 
> seriously and
> use it to help avoid false positives. Reducing or eliminating false 
> positives
> is critical if we ever want to go towards DWIM or auto-mounting. With the
> partition type taken into consideration, we may be able to eliminate 
> ad hoc
> checks, like the zero check in g_part_ebr, without creating false 
> positives.
>
True but keep in mind that partition types are actually getting actually 
less important. The label is not what is in the container- only a 
filesystem checker can really adequately figure out whether something is 
mountable.

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 18:30:09 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6B5D21065676;
	Tue, 29 Sep 2009 18:30:08 +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 3AB298FC20;
	Tue, 29 Sep 2009 18:30:08 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id E022D46B17;
	Tue, 29 Sep 2009 14:30:07 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id E96798A01D;
	Tue, 29 Sep 2009 14:30:06 -0400 (EDT)
From: John Baldwin 
To: Marcel Moolenaar 
Date: Tue, 29 Sep 2009 14:29:56 -0400
User-Agent: KMail/1.9.7
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
	<1F22EA6A-2793-45CE-9669-3FFD550CF4E2@mac.com>
In-Reply-To: <1F22EA6A-2793-45CE-9669-3FFD550CF4E2@mac.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200909291429.56882.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Tue, 29 Sep 2009 14:30:07 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar , src-committers@freebsd.org
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 18:30:09 -0000

On Tuesday 29 September 2009 12:18:11 pm Marcel Moolenaar wrote:
> 
> On Sep 29, 2009, at 4:49 AM, John Baldwin wrote:
> 
> > On Monday 28 September 2009 7:52:47 pm Marcel Moolenaar wrote:
> >> Author: marcel
> >> Date: Mon Sep 28 23:52:47 2009
> >> New Revision: 197608
> >> URL: http://svn.freebsd.org/changeset/base/197608
> >>
> >> Log:
> >>  The first 96 bytes may not be zeroes. It can contain trivial boot
> >>  code that merely emits an error and waits for a key press before
> >>  rebooting. The error being that extended partitions are not
> >>  bootable. The origin is presumed to be Windows 2000; Windows XP
> >>  does not do this...
> >>
> >>  For now, ignore the first 96 bytes when checking that the EBR is
> >>  (for the most part) all zeroes.
> >>
> >>  Tested by:	Mario Lobo 
> >>  MFC after:	1 week
> >>
> >> Modified:
> >>  head/sys/geom/part/g_part_ebr.c
> >
> > Why do you check for zeros at all?  AFAIK, the only real check is  
> > for AA55 at
> > the end of the sector (and having an MBR or other Extended MBR  
> > partition
> > entry point at the sector in question).  The '96' thing seems rather
> > arbitrary in the code, and I think the zero's check is overly  
> > restrictive.
> 
> Only checking for a signature that 99% of the boot blocks
> have isn't enough. The msdos file system has that signature
> and the check for all-zeroes is to prevent false positives
> there.

The signature is only half of what I said.  The more important point is that a 
slice we have already enumerated points to this sector and has the type of 
the slice set to 'extended MBR'.  That is actually the most reliable bit of 
information we have and the AA55 check at that point is just a sanity check 
against a zero'd sector.  However, the slice type of 'extended MBR' in the 
parent partition table should be authoritative.

Much of the PC world (esp. disk labelling crap in DOS-land) is far less 
standardized than GPART seems to expect and using standards that no one else 
expects or adheres to is only going to limit our interoperability.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 18:44:35 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 339C5106568B;
	Tue, 29 Sep 2009 18:44:35 +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 08A2F8FC20;
	Tue, 29 Sep 2009 18:44:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TIiYuk092938;
	Tue, 29 Sep 2009 18:44:34 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TIiYDJ092934;
	Tue, 29 Sep 2009 18:44:34 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200909291844.n8TIiYDJ092934@svn.freebsd.org>
From: Doug Barton 
Date: Tue, 29 Sep 2009 18:44: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: r197620 - in stable/8: etc etc/defaults 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: Tue, 29 Sep 2009 18:44:35 -0000

Author: dougb
Date: Tue Sep 29 18:44:34 2009
New Revision: 197620
URL: http://svn.freebsd.org/changeset/base/197620

Log:
  MFC r197297
  
  Add a knob to show 'Starting foo:' messages when faststart is used,
  such as at boot time.
  
  MFC 197619
  
  By popular acclaim, enable "Starting foo:" messages by default
  
  Approved by:	re (bz)

Modified:
  stable/8/etc/   (props changed)
  stable/8/etc/defaults/rc.conf
  stable/8/etc/rc.subr
  stable/8/share/man/man5/   (props changed)
  stable/8/share/man/man5/rc.conf.5

Modified: stable/8/etc/defaults/rc.conf
==============================================================================
--- stable/8/etc/defaults/rc.conf	Tue Sep 29 16:49:10 2009	(r197619)
+++ stable/8/etc/defaults/rc.conf	Tue Sep 29 18:44:34 2009	(r197620)
@@ -23,6 +23,7 @@
 
 rc_debug="NO"		# Set to YES to enable debugging output from rc.d
 rc_info="NO"		# Enables display of informational messages at boot.
+rc_startmsgs="YES" 	# Show "Starting foo:" messages at boot
 rcshutdown_timeout="30" # Seconds to wait before terminating rc.shutdown
 early_late_divider="FILESYSTEMS"	# Script that separates early/late
 			# stages of the boot process.  Make sure you know

Modified: stable/8/etc/rc.subr
==============================================================================
--- stable/8/etc/rc.subr	Tue Sep 29 16:49:10 2009	(r197619)
+++ stable/8/etc/rc.subr	Tue Sep 29 18:44:34 2009	(r197620)
@@ -680,7 +680,13 @@ run_rc_command()
 
 					# setup the full command to run
 					#
-			[ -z "${rc_quiet}" ] && echo "Starting ${name}."
+			_show_startmsgs=1
+			if [ -n "${rc_quiet}" ]; then
+				if ! checkyesno rc_startmsgs; then
+					unset _show_startmsgs
+				fi
+			fi
+			[ -n "$_show_startmsgs" ] && echo "Starting ${name}."
 			if [ -n "$_chroot" ]; then
 				_doit="\
 ${_nice:+nice -n $_nice }\

Modified: stable/8/share/man/man5/rc.conf.5
==============================================================================
--- stable/8/share/man/man5/rc.conf.5	Tue Sep 29 16:49:10 2009	(r197619)
+++ stable/8/share/man/man5/rc.conf.5	Tue Sep 29 18:44:34 2009	(r197620)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 10, 2009
+.Dd September 17, 2009
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -95,6 +95,13 @@ disable informational messages from the 
 Informational messages are displayed when
 a condition that is not serious enough to warrant a warning or
 an error occurs.
+.It Va rc_startmsgs
+.Pq Vt bool
+If set to
+.Dq Li YES ,
+show
+.Dq Starting foo:
+when faststart is used (e.g., at boot time).
 .It Va early_late_divider
 .Pq Vt str
 The name of the script that should be used as the

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 19:09:17 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D960A106566C;
	Tue, 29 Sep 2009 19:09:17 +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 C943E8FC44;
	Tue, 29 Sep 2009 19:09:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TJ9HD5093415;
	Tue, 29 Sep 2009 19:09:17 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TJ9H8h093413;
	Tue, 29 Sep 2009 19:09:17 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200909291909.n8TJ9H8h093413@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 29 Sep 2009 19: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: r197621 - head/lib/libradius
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 19:09:17 -0000

Author: mav
Date: Tue Sep 29 19:09:17 2009
New Revision: 197621
URL: http://svn.freebsd.org/changeset/base/197621

Log:
  Fix bug, when RADIUS client gave up after single sendto() error, do not
  trying backup servers.
  
  PR:		kern/103764, misc/139214

Modified:
  head/lib/libradius/radlib.c

Modified: head/lib/libradius/radlib.c
==============================================================================
--- head/lib/libradius/radlib.c	Tue Sep 29 18:44:34 2009	(r197620)
+++ head/lib/libradius/radlib.c	Tue Sep 29 19:09:17 2009	(r197621)
@@ -650,17 +650,12 @@ rad_continue_send_request(struct rad_han
 	n = sendto(h->fd, h->out, h->out_len, 0,
 	    (const struct sockaddr *)&h->servers[h->srv].addr,
 	    sizeof h->servers[h->srv].addr);
-	if (n != h->out_len) {
-		if (n == -1)
-			generr(h, "sendto: %s", strerror(errno));
-		else
-			generr(h, "sendto: short write");
-		return -1;
-	}
-
+	if (n != h->out_len)
+		tv->tv_sec = 1; /* Do not wait full timeout if send failed. */
+	else
+		tv->tv_sec = h->servers[h->srv].timeout;
 	h->try++;
 	h->servers[h->srv].num_tries++;
-	tv->tv_sec = h->servers[h->srv].timeout;
 	tv->tv_usec = 0;
 	*fd = h->fd;
 

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 19:57:04 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E67D4106568B;
	Tue, 29 Sep 2009 19:57:04 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 8F2548FC34;
	Tue, 29 Sep 2009 19:57:04 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n8TJt6dm038958;
	Tue, 29 Sep 2009 13:55:06 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Tue, 29 Sep 2009 13:57:07 -0600 (MDT)
Message-Id: <20090929.135707.1888883837.imp@bsdimp.com>
To: rwatson@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: 
References: <200909290749.08764.jhb@freebsd.org>
	<1F22EA6A-2793-45CE-9669-3FFD550CF4E2@mac.com>
	
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: marcel@FreeBSD.org, jhb@FreeBSD.org, svn-src-all@FreeBSD.org,
	xcllnt@mac.com, src-committers@FreeBSD.org, svn-src-head@FreeBSD.org
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 19:57:05 -0000

In message: 
            Robert Watson  writes:
: 
: On Tue, 29 Sep 2009, Marcel Moolenaar wrote:
: 
: >> Why do you check for zeros at all?  AFAIK, the only real check is for AA55 
: >> at the end of the sector (and having an MBR or other Extended MBR partition 
: >> entry point at the sector in question).  The '96' thing seems rather 
: >> arbitrary in the code, and I think the zero's check is overly restrictive.
: >
: > Only checking for a signature that 99% of the boot blocks have isn't enough. 
: > The msdos file system has that signature and the check for all-zeroes is to 
: > prevent false positives there.
: 
: And, as I recall, the msdosfs check has been gradually getting weaker over 
: time as the constraints it places on things like cylinder counts become 
: obsolete.  It's not quite that we'll mount msdosfs on any random pile of 
: bytes, but it might be getting there...

Maybe someday it will be able to mount my old Rainbow disks again :)

Warner

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 19:57:08 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 20AEC106566C;
	Tue, 29 Sep 2009 19:57:08 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0FC508FC1A;
	Tue, 29 Sep 2009 19:57:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TJv7jP094475;
	Tue, 29 Sep 2009 19:57:07 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TJv7bS094474;
	Tue, 29 Sep 2009 19:57:07 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200909291957.n8TJv7bS094474@svn.freebsd.org>
From: Ken Smith 
Date: Tue, 29 Sep 2009 19:57: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: r197623 - 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: Tue, 29 Sep 2009 19:57:08 -0000

Author: kensmith
Date: Tue Sep 29 19:57:06 2009
New Revision: 197623
URL: http://svn.freebsd.org/changeset/base/197623

Log:
  Update description of debugging support.
  
  Submitted by:	ivoras (but heavily modified)
  Pointy hat:	me
  Approved by:	re (implicit)

Modified:
  stable/8/UPDATING

Modified: stable/8/UPDATING
==============================================================================
--- stable/8/UPDATING	Tue Sep 29 19:50:50 2009	(r197622)
+++ stable/8/UPDATING	Tue Sep 29 19:57:06 2009	(r197623)
@@ -8,19 +8,12 @@ Items affecting the ports and packages s
 /usr/ports/UPDATING.  Please read that file before running
 portupgrade.
 
-NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW:
-	FreeBSD 8.x has many debugging features turned on, in
-	both the kernel and userland.  These features attempt to detect
-	incorrect use of system primitives, and encourage loud failure
-	through extra sanity checking and fail stop semantics.  They
-	also substantially impact system performance.  If you want to
-	do performance measurement, benchmarking, and optimization,
-	you'll want to turn them off.  This includes various WITNESS-
-	related kernel options, INVARIANTS, malloc debugging flags
-	in userland, and various verbose features in the kernel.  Many
-	developers choose to disable these features on build machines
-	to maximize performance.  (To disable malloc debugging, run
-	ln -s aj /etc/malloc.conf.)
+NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW ON IA64 OR SUN4V:
+	For ia64 the INVARIANTS and INVARIANTS_SUPPORT kernel options
+	were left in the GENERIC kernel because the kernel does not
+	work properly without them.  For sun4v all of the normal kernel
+	debugging tools present in HEAD were left in place because
+	sun4v support still needs work to become production ready.
 
 20090929:
 	802.11s D3.03 support was committed. This is incompatible with

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 20:13:20 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4F51106566C;
	Tue, 29 Sep 2009 20:13:20 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 60A328FC16;
	Tue, 29 Sep 2009 20:13:20 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n8TKAs3D039060;
	Tue, 29 Sep 2009 14:10:54 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Tue, 29 Sep 2009 14:12:56 -0600 (MDT)
Message-Id: <20090929.141256.-981704958.imp@bsdimp.com>
To: xcllnt@mac.com
From: "M. Warner Losh" 
In-Reply-To: 
References: <1F22EA6A-2793-45CE-9669-3FFD550CF4E2@mac.com>
	
	
X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: marcel@freebsd.org, jhb@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, rwatson@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 20:13:20 -0000

In message: 
            Marcel Moolenaar  writes:
: 
: On Sep 29, 2009, at 10:00 AM, Robert Watson wrote:
: 
: >
: > On Tue, 29 Sep 2009, Marcel Moolenaar wrote:
: >
: >>> Why do you check for zeros at all?  AFAIK, the only real check is  
: >>> for AA55 at the end of the sector (and having an MBR or other  
: >>> Extended MBR partition entry point at the sector in question).   
: >>> The '96' thing seems rather arbitrary in the code, and I think the  
: >>> zero's check is overly restrictive.
: >>
: >> Only checking for a signature that 99% of the boot blocks have  
: >> isn't enough. The msdos file system has that signature and the  
: >> check for all-zeroes is to prevent false positives there.
: >
: > And, as I recall, the msdosfs check has been gradually getting  
: > weaker over time as the constraints it places on things like  
: > cylinder counts become obsolete.  It's not quite that we'll mount  
: > msdosfs on any random pile of bytes, but it might be getting there...
: 
: We really need to get to a point where we treat partition types  
: seriously and
: use it to help avoid false positives. Reducing or eliminating false  
: positives
: is critical if we ever want to go towards DWIM or auto-mounting. With  
: the
: partition type taken into consideration, we may be able to eliminate  
: ad hoc
: checks, like the zero check in g_part_ebr, without creating false  
: positives.

Part of the problem too is that the msdosfs code checks too many
things, making it hard to use on raw images :(  Of course, I'm about
12 sigma from the mean on the images I use, but still...

Warner

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 20:13:59 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 1EACB10656BA; Tue, 29 Sep 2009 20:13:59 +0000 (UTC)
Date: Tue, 29 Sep 2009 20:13:59 +0000
From: Alexey Dokuchaev 
To: Ken Smith 
Message-ID: <20090929201358.GA9988@FreeBSD.org>
References: <200909291957.n8TJv7bS094474@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <200909291957.n8TJv7bS094474@svn.freebsd.org>
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: r197623 - 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: Tue, 29 Sep 2009 20:13:59 -0000

On Tue, Sep 29, 2009 at 07:57:06PM +0000, Ken Smith wrote:
> +NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW ON IA64 OR SUN4V:
> +	For ia64 the INVARIANTS and INVARIANTS_SUPPORT kernel options
					     ^
Shouldn't it be INVARIANT_SUPPORT instead (note the superfluous `S')?

./danfe

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 21:26:00 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 31F71106566B;
	Tue, 29 Sep 2009 21:26:00 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2223F8FC17;
	Tue, 29 Sep 2009 21:26:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TLQ0EJ096227;
	Tue, 29 Sep 2009 21:26:00 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TLQ0Lf096226;
	Tue, 29 Sep 2009 21:26:00 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200909292126.n8TLQ0Lf096226@svn.freebsd.org>
From: Robert Watson 
Date: Tue, 29 Sep 2009 21:25: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: r197624 - head/sys/bsm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 21:26:00 -0000

Author: rwatson
Date: Tue Sep 29 21:25:59 2009
New Revision: 197624
URL: http://svn.freebsd.org/changeset/base/197624

Log:
  Add audit events for process descriptor system calls, which will appear in
  a future OpenBSM release.
  
  Sponsored by:	Google
  Obtained from:	TrustedBSD Project
  MFC after:	3 weeks

Modified:
  head/sys/bsm/audit_kevents.h

Modified: head/sys/bsm/audit_kevents.h
==============================================================================
--- head/sys/bsm/audit_kevents.h	Tue Sep 29 19:57:06 2009	(r197623)
+++ head/sys/bsm/audit_kevents.h	Tue Sep 29 21:25:59 2009	(r197624)
@@ -598,6 +598,10 @@
 #define	AUE_FSCTL		43194	/* Darwin. */
 #define	AUE_FFSCTL		43195	/* Darwin. */
 #define	AUE_LPATHCONF		43196	/* FreeBSD. */
+#define	AUE_PDFORK		43197	/* FreeBSD. */
+#define	AUE_PDKILL		43198	/* FreeBSD. */
+#define	AUE_PDGETPID		43199	/* FreeBSD. */
+#define	AUE_PDWAIT		43200	/* FreeBSD. */
 
 /*
  * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 21:28:32 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EB304106566B;
	Tue, 29 Sep 2009 21:28:32 +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 DB7B38FC08;
	Tue, 29 Sep 2009 21:28:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TLSWQj096331;
	Tue, 29 Sep 2009 21:28:32 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TLSWoC096329;
	Tue, 29 Sep 2009 21:28:32 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200909292128.n8TLSWoC096329@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 29 Sep 2009 21:28: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: r197625 - head/usr.sbin/lpr/lp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 21:28:33 -0000

Author: jilles
Date: Tue Sep 29 21:28:32 2009
New Revision: 197625
URL: http://svn.freebsd.org/changeset/base/197625

Log:
  Fix using lp(1) without the new -t option after r194171.
  
  PR:		standards/129554
  Tested by:	Steve Kargl
  MFC after:	1 week

Modified:
  head/usr.sbin/lpr/lp/lp.sh

Modified: head/usr.sbin/lpr/lp/lp.sh
==============================================================================
--- head/usr.sbin/lpr/lp/lp.sh	Tue Sep 29 21:25:59 2009	(r197624)
+++ head/usr.sbin/lpr/lp/lp.sh	Tue Sep 29 21:28:32 2009	(r197625)
@@ -70,7 +70,7 @@ do
 	s)			# (silent option)
 		: ;;
 	t)			# title for banner page
-		title="-J${OPTARG}";;
+		title="${OPTARG}";;
 	*)			# (error msg printed by getopts)
 		exit 2;;
 	esac
@@ -78,4 +78,4 @@ done
 
 shift $(($OPTIND - 1))
 
-exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} "${title}" "$@"
+exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} ${title:+-J"${title}"} "$@"

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 23:00:44 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06658106568B;
	Tue, 29 Sep 2009 23:00:44 +0000 (UTC)
	(envelope-from rpaulo@gmail.com)
Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com
	[209.85.219.209])
	by mx1.freebsd.org (Postfix) with ESMTP id 0C4478FC14;
	Tue, 29 Sep 2009 23:00:42 +0000 (UTC)
Received: by ewy5 with SMTP id 5so4646898ewy.36
	for ; Tue, 29 Sep 2009 16:00:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:content-type
	:mime-version:subject:from:in-reply-to:date
	:content-transfer-encoding:message-id:references:to:x-mailer;
	bh=N5y6FMje4A1+aRCiUCNzF5cGMYWpOPMsOIxHLcxxolU=;
	b=PD+onHMTQfvxXI39nX03f3ueKtGunONUMaLnokYtJhh8jBfAa5Jszg/zI0Jksw6iqm
	HEmZNCG26LbWDoa66qgn1vIdQ6hYdefQ0MNsICHrF38aGlqnbBamm1wb/lfjrzZwFEB5
	INfkopMLAybhmMa2W90tdvJG2ytZDeM5Fs3Sc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:content-type:mime-version:subject:from:in-reply-to:date
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=KV9li50QxUfx2XOJAqLzGAyB7bQcmL4cuvf/pTDeMot8Y9wy2oNIqglFVGTYedD9At
	qtdLJmSjZ78Lzneysmn3d28g49QwYM7PwLApUozlGtZMpBc1q351qsKa5blCSZKi1C6u
	E1Bo7frOVFhzn4C0d5ou/JTWzlXT9D1i6T0bg=
Received: by 10.211.131.40 with SMTP id i40mr1920900ebn.99.1254265241979;
	Tue, 29 Sep 2009 16:00:41 -0700 (PDT)
Received: from mac-mini.lan (bl11-195-254.dsl.telepac.pt [85.244.195.254])
	by mx.google.com with ESMTPS id 7sm416198eyb.20.2009.09.29.16.00.40
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Tue, 29 Sep 2009 16:00:41 -0700 (PDT)
Sender: Rui Paulo 
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
Mime-Version: 1.0 (Apple Message framework v1076)
From: Rui Paulo 
In-Reply-To: <200909291218.n8TCINmv085038@svn.freebsd.org>
Date: Wed, 30 Sep 2009 00:00:39 +0100
Content-Transfer-Encoding: 7bit
Message-Id: <558A76C2-0F8C-472F-A235-16BDAD15C634@freebsd.org>
References: <200909291218.n8TCINmv085038@svn.freebsd.org>
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-Mailer: Apple Mail (2.1076)
Cc: 
Subject: Re: svn commit: r197614 - 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: Tue, 29 Sep 2009 23:00:44 -0000

On 29 Sep 2009, at 13:18, Rui Paulo wrote:

> Author: rpaulo
> Date: Tue Sep 29 12:18:23 2009
> New Revision: 197614
> URL: http://svn.freebsd.org/changeset/base/197614
>
> Log:
>  Update 802.11s mesh support to draft 3.03. This includes a revised   
> frame
>  format for peering and changes to the PERR frames.
>  Note that this is incompatible with the previous code.
>
>  Reviewed by:	sam
>  Approved by:	re (kib)


Please note that, while these changes are being made very late in the  
release process, they are necessary to keep in sync with the new  
draft.  There should be no impact on ports, mesh support is brand new  
to 8.0.

--
Rui Paulo




From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 23:03:17 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 099C5106566B;
	Tue, 29 Sep 2009 23:03:17 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D4A388FC08;
	Tue, 29 Sep 2009 23:03:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8TN3Gx5098425;
	Tue, 29 Sep 2009 23:03:16 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8TN3G7L098420;
	Tue, 29 Sep 2009 23:03:16 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <200909292303.n8TN3G7L098420@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Tue, 29 Sep 2009 23: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: r197627 - in head/sys/dev: ae age alc ale
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 29 Sep 2009 23:03:17 -0000

Author: yongari
Date: Tue Sep 29 23:03:16 2009
New Revision: 197627
URL: http://svn.freebsd.org/changeset/base/197627

Log:
  Fix multicast handling. All Atheros controllers use big-endian form
  in computing multicast hash.
  
  PR:	kern/139137

Modified:
  head/sys/dev/ae/if_ae.c
  head/sys/dev/age/if_age.c
  head/sys/dev/alc/if_alc.c
  head/sys/dev/ale/if_ale.c

Modified: head/sys/dev/ae/if_ae.c
==============================================================================
--- head/sys/dev/ae/if_ae.c	Tue Sep 29 23:00:28 2009	(r197626)
+++ head/sys/dev/ae/if_ae.c	Tue Sep 29 23:03:16 2009	(r197627)
@@ -2077,7 +2077,7 @@ ae_rxfilter(ae_softc_t *sc)
 	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
 			continue;
-		crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
+		crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
 			ifma->ifma_addr), ETHER_ADDR_LEN);
 		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
 	}

Modified: head/sys/dev/age/if_age.c
==============================================================================
--- head/sys/dev/age/if_age.c	Tue Sep 29 23:00:28 2009	(r197626)
+++ head/sys/dev/age/if_age.c	Tue Sep 29 23:03:16 2009	(r197627)
@@ -3135,7 +3135,7 @@ age_rxfilter(struct age_softc *sc)
 	TAILQ_FOREACH(ifma, &sc->age_ifp->if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
 			continue;
-		crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
+		crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
 		    ifma->ifma_addr), ETHER_ADDR_LEN);
 		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
 	}

Modified: head/sys/dev/alc/if_alc.c
==============================================================================
--- head/sys/dev/alc/if_alc.c	Tue Sep 29 23:00:28 2009	(r197626)
+++ head/sys/dev/alc/if_alc.c	Tue Sep 29 23:03:16 2009	(r197627)
@@ -3476,7 +3476,7 @@ alc_rxfilter(struct alc_softc *sc)
 	TAILQ_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
 			continue;
-		crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
+		crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
 		    ifma->ifma_addr), ETHER_ADDR_LEN);
 		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
 	}

Modified: head/sys/dev/ale/if_ale.c
==============================================================================
--- head/sys/dev/ale/if_ale.c	Tue Sep 29 23:00:28 2009	(r197626)
+++ head/sys/dev/ale/if_ale.c	Tue Sep 29 23:03:16 2009	(r197627)
@@ -3060,7 +3060,7 @@ ale_rxfilter(struct ale_softc *sc)
 	TAILQ_FOREACH(ifma, &sc->ale_ifp->if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
 			continue;
-		crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
+		crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
 		    ifma->ifma_addr), ETHER_ADDR_LEN);
 		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue Sep 29 23:51:49 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 873C21065670;
	Tue, 29 Sep 2009 23:51:49 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 3E6868FC14;
	Tue, 29 Sep 2009 23:51:48 +0000 (UTC)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.69) (envelope-from )
	id 1MsmTz-0001ER-Ev; Wed, 30 Sep 2009 03:51:47 +0400
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id 4A6F5B84D;
	Wed, 30 Sep 2009 03:51:46 +0400 (MSD)
Received: by hades.panopticon (Postfix, from userid 1000)
	id 573D7B849; Wed, 30 Sep 2009 03:51:46 +0400 (MSD)
Date: Wed, 30 Sep 2009 03:51:46 +0400
From: Dmitry Marakasov 
To: John Baldwin 
Message-ID: <20090929235146.GA64567@hades.panopticon>
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
	<20090929145447.GA82539@hades.panopticon>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20090929145447.GA82539@hades.panopticon>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar , src-committers@freebsd.org
Subject: Re: svn commit: r197608 - 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: Tue, 29 Sep 2009 23:51:49 -0000

* Dmitry Marakasov (amdmi3@amdmi3.ru) wrote:

> Seconded. I've seen a report of geom_part_ebr unable to detect
> partitions which were actually there. Will inquiry the reporter if
> this change solved the problem.

Seems like it hasn't. Here's the first sector from that partition:

0000000 48eb 0090 0000 0000 0000 0000 0000 0000                                           
0000010 0000 0000 0000 0000 0000 0000 0000 0000                                           
*                                                                                         
0000030 0000 0000 0000 0000 0000 0000 0000 0203                                           
0000040 0080 8000 8634 0d93 0800 90fa f690 80c2
0000050 0275 80b2 59ea 007c 3100 8ec0 8ed8 bcd0
0000060 2000 a0fb 7c40 ff3c 0274 c288 be52 7d7f
0000070 34e8 f601 80c2 5474 41b4 aabb cd55 5a13
0000080 7252 8149 55fb 75aa a043 7c41 c084 0575
0000090 e183 7401 6637 4c8b be10 7c05 44c6 01ff
00000a0 8b66 441e c77c 1004 c700 0244 0001 8966
00000b0 085c 44c7 0006 6670 c031 4489 6604 4489
00000c0 b40c cd42 7213 bb05 7000 7deb 08b4 13cd
00000d0 0a73 c2f6 0f80 ea84 e900 008d 05be c67c
00000e0 ff44 6600 c031 f088 6640 4489 3104 88d2
00000f0 c1ca 02e2 e888 f488 8940 0844 c031 d088
0000100 e8c0 6602 0489 a166 7c44 3166 66d2 34f7
0000110 5488 660a d231 f766 0474 5488 890b 0c44
0000120 443b 7d08 8a3c 0d54 e2c0 8a06 0a4c c1fe
0000130 d108 6c8a 5a0c 748a bb0b 7000 c38e db31
0000140 01b8 cd02 7213 8c2a 8ec3 4806 607c b91e
0000150 0100 db8e f631 ff31 f3fc 1fa5 ff61 4226
0000160 be7c 7d85 40e8 eb00 be0e 7d8a 38e8 eb00
0000170 be06 7d94 30e8 be00 7d99 2ae8 eb00 47fe
0000180 5552 2042 4700 6f65 006d 6148 6472 4420
0000190 7369 006b 6552 6461 2000 7245 6f72 0072
00001a0 01bb b400 cd0e ac10 003c f475 00c3 0000
00001b0 0000 0000 0000 0000 0000 0000 0000 0100
00001c0 ffc1 fe07 ffff 003f 0000 de25 06b6 fe00
00001d0 ffff fe05 ffff de64 06b6 4ad1 07dc 0000
00001e0 0000 0000 0000 0000 0000 0000 0000 0000
00001f0 0000 0000 0000 0000 0000 0000 0000 aa55

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 08:46:02 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 816741065672;
	Wed, 30 Sep 2009 08:46:02 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 57DAC8FC2B;
	Wed, 30 Sep 2009 08:46:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8U8k2LH009803;
	Wed, 30 Sep 2009 08:46:02 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8U8k2gG009800;
	Wed, 30 Sep 2009 08:46:02 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200909300846.n8U8k2gG009800@svn.freebsd.org>
From: Robert Watson 
Date: Wed, 30 Sep 2009 08:46: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: r197636 - 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: Wed, 30 Sep 2009 08:46:02 -0000

Author: rwatson
Date: Wed Sep 30 08:46:01 2009
New Revision: 197636
URL: http://svn.freebsd.org/changeset/base/197636

Log:
  Reserve system call numbers for Capsicum security framework capabilities,
  capability mode, and process descriptors: cap_new, cap_getrights, cap_enter,
  cap_getmode, pdfork, pdkill, pdgetpid, and pdwait.
  
  Obtained from:	TrustedBSD Project
  Sponsored by:	Google
  MFC after:	3 weeks

Modified:
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master

Modified: head/sys/compat/freebsd32/syscalls.master
==============================================================================
--- head/sys/compat/freebsd32/syscalls.master	Wed Sep 30 04:56:48 2009	(r197635)
+++ head/sys/compat/freebsd32/syscalls.master	Wed Sep 30 08:46:01 2009	(r197636)
@@ -901,3 +901,11 @@
 512	AUE_SHMCTL	STD	{ int freebsd32_shmctl(int shmid, int cmd, \
 				    struct shmid_ds32 *buf); }
 513	AUE_LPATHCONF	NOPROTO	{ int lpathconf(char *path, int name); }
+514	AUE_CAP_NEW	UNIMPL	cap_new
+515	AUE_CAP_GETRIGHTS	UNIMPL	cap_getrights
+516	AUE_CAP_ENTER	UNIMPL	cap_enter
+517	AUE_CAP_GETMODE	UNIMPL	cap_getmode
+518	AUE_PDFORK	UNIMPL	pdfork
+519	AUE_PDKILL	UNIMPL	pdkill
+520	AUE_PDGETPID	UNIMPL	pdgetpid
+521	AUE_PDWAIT	UNIMPL	pdwait

Modified: head/sys/kern/syscalls.master
==============================================================================
--- head/sys/kern/syscalls.master	Wed Sep 30 04:56:48 2009	(r197635)
+++ head/sys/kern/syscalls.master	Wed Sep 30 08:46:01 2009	(r197636)
@@ -911,5 +911,13 @@
 512	AUE_SHMCTL	NOSTD	{ int shmctl(int shmid, int cmd, \
 				    struct shmid_ds *buf); }
 513	AUE_LPATHCONF	STD	{ int lpathconf(char *path, int name); }
+514	AUE_CAP_NEW	UNIMPL	cap_new
+515	AUE_CAP_GETRIGHTS	UNIMPL	cap_getrights
+516	AUE_CAP_ENTER	UNIMPL	cap_enter
+517	AUE_CAP_GETMODE	UNIMPL	cap_getmode
+518	AUE_PDFORK	UNIMPL	pdfork
+519	AUE_PDKILL	UNIMPL	pdkill
+520	AUE_PDGETPID	UNIMPL	pdgetpid
+521	AUE_PDWAIT	UNIMPL	pdwait
 ; Please copy any additions and changes to the following compatability tables:
 ; sys/compat/freebsd32/syscalls.master

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 08:48:59 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B11BD1065695;
	Wed, 30 Sep 2009 08:48:59 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9FC868FC14;
	Wed, 30 Sep 2009 08:48:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8U8mxpc009893;
	Wed, 30 Sep 2009 08:48:59 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8U8mxCu009883;
	Wed, 30 Sep 2009 08:48:59 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200909300848.n8U8mxCu009883@svn.freebsd.org>
From: Robert Watson 
Date: Wed, 30 Sep 2009 08:48: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: r197637 - in head/sys: compat/freebsd32 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: Wed, 30 Sep 2009 08:48:59 -0000

Author: rwatson
Date: Wed Sep 30 08:48:59 2009
New Revision: 197637
URL: http://svn.freebsd.org/changeset/base/197637

Log:
  Regenerate system call files following r197636.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_proto.h	Wed Sep 30 08:46:01 2009	(r197636)
+++ head/sys/compat/freebsd32/freebsd32_proto.h	Wed Sep 30 08:48:59 2009	(r197637)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 195468 2009-07-08 16:26:43Z trasz 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 197636 2009-09-30 08:46:01Z rwatson 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -626,8 +626,7 @@ int	freebsd4_freebsd32_sigreturn(struct 
 #endif /* COMPAT_FREEBSD4 */
 
 
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-	defined(COMPAT_FREEBSD6)
+#ifdef COMPAT_FREEBSD6
 
 struct freebsd6_freebsd32_pread_args {
 	char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
@@ -681,11 +680,10 @@ int	freebsd6_freebsd32_lseek(struct thre
 int	freebsd6_freebsd32_truncate(struct thread *, struct freebsd6_freebsd32_truncate_args *);
 int	freebsd6_freebsd32_ftruncate(struct thread *, struct freebsd6_freebsd32_ftruncate_args *);
 
-#endif /* COMPAT_FREEBSD[456] */
+#endif /* COMPAT_FREEBSD6 */
 
 
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-	defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+#ifdef COMPAT_FREEBSD7
 
 struct freebsd7_freebsd32_semctl_args {
 	char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)];
@@ -707,7 +705,7 @@ int	freebsd7_freebsd32_semctl(struct thr
 int	freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *);
 int	freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *);
 
-#endif /* COMPAT_FREEBSD[4567] */
+#endif /* COMPAT_FREEBSD7 */
 
 #define	FREEBSD32_SYS_AUE_freebsd32_wait4	AUE_WAIT4
 #define	FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat	AUE_GETFSSTAT

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscall.h	Wed Sep 30 08:46:01 2009	(r197636)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h	Wed Sep 30 08:48:59 2009	(r197637)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 195468 2009-07-08 16:26:43Z trasz 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 197636 2009-09-30 08:46:01Z rwatson 
  */
 
 #define	FREEBSD32_SYS_syscall	0
@@ -382,4 +382,4 @@
 #define	FREEBSD32_SYS_freebsd32_msgctl	511
 #define	FREEBSD32_SYS_freebsd32_shmctl	512
 #define	FREEBSD32_SYS_lpathconf	513
-#define	FREEBSD32_SYS_MAXSYSCALL	514
+#define	FREEBSD32_SYS_MAXSYSCALL	522

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Sep 30 08:46:01 2009	(r197636)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c	Wed Sep 30 08:48:59 2009	(r197637)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 195468 2009-07-08 16:26:43Z trasz 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 197636 2009-09-30 08:46:01Z rwatson 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -521,4 +521,12 @@ const char *freebsd32_syscallnames[] = {
 	"freebsd32_msgctl",			/* 511 = freebsd32_msgctl */
 	"freebsd32_shmctl",			/* 512 = freebsd32_shmctl */
 	"lpathconf",			/* 513 = lpathconf */
+	"#514",			/* 514 = cap_new */
+	"#515",			/* 515 = cap_getrights */
+	"#516",			/* 516 = cap_enter */
+	"#517",			/* 517 = cap_getmode */
+	"#518",			/* 518 = pdfork */
+	"#519",			/* 519 = pdkill */
+	"#520",			/* 520 = pdgetpid */
+	"#521",			/* 521 = pdwait */
 };

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_sysent.c	Wed Sep 30 08:46:01 2009	(r197636)
+++ head/sys/compat/freebsd32/freebsd32_sysent.c	Wed Sep 30 08:48:59 2009	(r197637)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 195468 2009-07-08 16:26:43Z trasz 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 197636 2009-09-30 08:46:01Z rwatson 
  */
 
 #include "opt_compat.h"
@@ -558,4 +558,12 @@ struct sysent freebsd32_sysent[] = {
 	{ AS(freebsd32_msgctl_args), (sy_call_t *)freebsd32_msgctl, AUE_MSGCTL, NULL, 0, 0, 0 },	/* 511 = freebsd32_msgctl */
 	{ AS(freebsd32_shmctl_args), (sy_call_t *)freebsd32_shmctl, AUE_SHMCTL, NULL, 0, 0, 0 },	/* 512 = freebsd32_shmctl */
 	{ AS(lpathconf_args), (sy_call_t *)lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0 },	/* 513 = lpathconf */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 514 = cap_new */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 515 = cap_getrights */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 516 = cap_enter */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 517 = cap_getmode */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 518 = pdfork */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 519 = pdkill */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 520 = pdgetpid */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 521 = pdwait */
 };

Modified: head/sys/kern/init_sysent.c
==============================================================================
--- head/sys/kern/init_sysent.c	Wed Sep 30 08:46:01 2009	(r197636)
+++ head/sys/kern/init_sysent.c	Wed Sep 30 08:48:59 2009	(r197637)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz 
+ * created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson 
  */
 
 #include "opt_compat.h"
@@ -548,4 +548,12 @@ struct sysent sysent[] = {
 	{ AS(msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 511 = msgctl */
 	{ AS(shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 },	/* 512 = shmctl */
 	{ AS(lpathconf_args), (sy_call_t *)lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0 },	/* 513 = lpathconf */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 514 = cap_new */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 515 = cap_getrights */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 516 = cap_enter */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 517 = cap_getmode */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 518 = pdfork */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 519 = pdkill */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 520 = pdgetpid */
+	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },			/* 521 = pdwait */
 };

Modified: head/sys/kern/syscalls.c
==============================================================================
--- head/sys/kern/syscalls.c	Wed Sep 30 08:46:01 2009	(r197636)
+++ head/sys/kern/syscalls.c	Wed Sep 30 08:48:59 2009	(r197637)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz 
+ * created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson 
  */
 
 const char *syscallnames[] = {
@@ -521,4 +521,12 @@ const char *syscallnames[] = {
 	"msgctl",			/* 511 = msgctl */
 	"shmctl",			/* 512 = shmctl */
 	"lpathconf",			/* 513 = lpathconf */
+	"#514",			/* 514 = cap_new */
+	"#515",			/* 515 = cap_getrights */
+	"#516",			/* 516 = cap_enter */
+	"#517",			/* 517 = cap_getmode */
+	"#518",			/* 518 = pdfork */
+	"#519",			/* 519 = pdkill */
+	"#520",			/* 520 = pdgetpid */
+	"#521",			/* 521 = pdwait */
 };

Modified: head/sys/sys/syscall.h
==============================================================================
--- head/sys/sys/syscall.h	Wed Sep 30 08:46:01 2009	(r197636)
+++ head/sys/sys/syscall.h	Wed Sep 30 08:48:59 2009	(r197637)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz 
+ * created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson 
  */
 
 #define	SYS_syscall	0
@@ -428,4 +428,4 @@
 #define	SYS_msgctl	511
 #define	SYS_shmctl	512
 #define	SYS_lpathconf	513
-#define	SYS_MAXSYSCALL	514
+#define	SYS_MAXSYSCALL	522

Modified: head/sys/sys/syscall.mk
==============================================================================
--- head/sys/sys/syscall.mk	Wed Sep 30 08:46:01 2009	(r197636)
+++ head/sys/sys/syscall.mk	Wed Sep 30 08:48:59 2009	(r197637)
@@ -1,7 +1,7 @@
 # FreeBSD system call names.
 # DO NOT EDIT-- this file is automatically generated.
 # $FreeBSD$
-# created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz 
+# created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson 
 MIASM =  \
 	syscall.o \
 	exit.o \

Modified: head/sys/sys/sysproto.h
==============================================================================
--- head/sys/sys/sysproto.h	Wed Sep 30 08:46:01 2009	(r197636)
+++ head/sys/sys/sysproto.h	Wed Sep 30 08:48:59 2009	(r197637)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 195458 2009-07-08 15:23:18Z trasz 
+ * created from FreeBSD: head/sys/kern/syscalls.master 197636 2009-09-30 08:46:01Z rwatson 
  */
 
 #ifndef _SYS_SYSPROTO_H_
@@ -2233,21 +2233,13 @@ int	freebsd4_sigreturn(struct thread *, 
 #endif /* COMPAT_FREEBSD4 */
 
 
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5)
+#ifdef COMPAT_FREEBSD6
 
 
-#endif /* COMPAT_FREEBSD[45] */
+#endif /* COMPAT_FREEBSD6 */
 
 
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-	defined(COMPAT_FREEBSD6)
-
-
-#endif /* COMPAT_FREEBSD[456] */
-
-
-#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
-	defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
+#ifdef COMPAT_FREEBSD7
 
 struct freebsd7___semctl_args {
 	char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)];
@@ -2269,7 +2261,7 @@ int	freebsd7___semctl(struct thread *, s
 int	freebsd7_msgctl(struct thread *, struct freebsd7_msgctl_args *);
 int	freebsd7_shmctl(struct thread *, struct freebsd7_shmctl_args *);
 
-#endif /* COMPAT_FREEBSD[4567] */
+#endif /* COMPAT_FREEBSD7 */
 
 #define	SYS_AUE_syscall	AUE_NULL
 #define	SYS_AUE_exit	AUE_EXIT

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 11:05:12 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B96051065670;
	Wed, 30 Sep 2009 11:05:12 +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 A8F288FC1C;
	Wed, 30 Sep 2009 11:05:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UB5C8I013642;
	Wed, 30 Sep 2009 11:05:12 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UB5Cq4013640;
	Wed, 30 Sep 2009 11:05:12 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200909301105.n8UB5Cq4013640@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 30 Sep 2009 11:05: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: r197640 - 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: Wed, 30 Sep 2009 11:05:12 -0000

Author: mav
Date: Wed Sep 30 11:05:12 2009
New Revision: 197640
URL: http://svn.freebsd.org/changeset/base/197640

Log:
  Fix typo in previous commit.
  Add Realtek ALC887 codec ID.

Modified:
  head/sys/dev/sound/pci/hda/hdac.c

Modified: head/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdac.c	Wed Sep 30 10:01:47 2009	(r197639)
+++ head/sys/dev/sound/pci/hda/hdac.c	Wed Sep 30 11:05:12 2009	(r197640)
@@ -622,6 +622,7 @@ static const struct {
 #define HDA_CODEC_ALC882	HDA_CODEC_CONSTRUCT(REALTEK, 0x0882)
 #define HDA_CODEC_ALC883	HDA_CODEC_CONSTRUCT(REALTEK, 0x0883)
 #define HDA_CODEC_ALC885	HDA_CODEC_CONSTRUCT(REALTEK, 0x0885)
+#define HDA_CODEC_ALC887	HDA_CODEC_CONSTRUCT(REALTEK, 0x0887)
 #define HDA_CODEC_ALC888	HDA_CODEC_CONSTRUCT(REALTEK, 0x0888)
 #define HDA_CODEC_ALC889	HDA_CODEC_CONSTRUCT(REALTEK, 0x0889)
 #define HDA_CODEC_ALCXXXX	HDA_CODEC_CONSTRUCT(REALTEK, 0xffff)
@@ -807,6 +808,7 @@ static const struct {
 	{ HDA_CODEC_ALC882,    "Realtek ALC882" },
 	{ HDA_CODEC_ALC883,    "Realtek ALC883" },
 	{ HDA_CODEC_ALC885,    "Realtek ALC885" },
+	{ HDA_CODEC_ALC887,    "Realtek ALC887" },
 	{ HDA_CODEC_ALC888,    "Realtek ALC888" },
 	{ HDA_CODEC_ALC889,    "Realtek ALC889" },
 	{ HDA_CODEC_AD1882,    "Analog Devices AD1882" },
@@ -6568,7 +6570,7 @@ hdac_create_pcms(struct hdac_devinfo *de
 			continue;
 		for (j = 0; j < devinfo->function.audio.num_devs; j++) {
 			if (devinfo->function.audio.devs[j].digital != 255 &&
-			    (!devinfo->function.audio.devs[j].digital) ==
+			    (!devinfo->function.audio.devs[j].digital) !=
 			    (!as[i].digital))
 				continue;
 			if (as[i].dir == HDA_CTL_IN) {

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 11:14:14 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 084AE1065670;
	Wed, 30 Sep 2009 11:14:14 +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 EB7878FC18;
	Wed, 30 Sep 2009 11:14:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UBEDFe013872;
	Wed, 30 Sep 2009 11:14:13 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UBED1P013870;
	Wed, 30 Sep 2009 11:14:13 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200909301114.n8UBED1P013870@svn.freebsd.org>
From: Andriy Gapon 
Date: Wed, 30 Sep 2009 11: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: r197641 - 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, 30 Sep 2009 11:14:14 -0000

Author: avg
Date: Wed Sep 30 11:14:13 2009
New Revision: 197641
URL: http://svn.freebsd.org/changeset/base/197641

Log:
  print_caddr_t: drop incorrect __unused attribute from parameter
  
  seems like a purely cosmetic change
  
  Reviewed by:	jhb, kib
  MFC after:	1 week

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==============================================================================
--- head/sys/kern/init_main.c	Wed Sep 30 11:05:12 2009	(r197640)
+++ head/sys/kern/init_main.c	Wed Sep 30 11:14:13 2009	(r197641)
@@ -284,7 +284,7 @@ restart:
  ***************************************************************************
  */
 static void
-print_caddr_t(void *data __unused)
+print_caddr_t(void *data)
 {
 	printf("%s", (char *)data);
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 12:53:22 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 167DA1065670;
	Wed, 30 Sep 2009 12:53:22 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 043708FC17;
	Wed, 30 Sep 2009 12:53:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UCrL5M015730;
	Wed, 30 Sep 2009 12:53:21 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UCrLwZ015728;
	Wed, 30 Sep 2009 12:53:21 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200909301253.n8UCrLwZ015728@svn.freebsd.org>
From: Ken Smith 
Date: Wed, 30 Sep 2009 12:53: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: r197642 - 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, 30 Sep 2009 12:53:22 -0000

Author: kensmith
Date: Wed Sep 30 12:53:21 2009
New Revision: 197642
URL: http://svn.freebsd.org/changeset/base/197642

Log:
  Remove an extra 'S' that snuck in.
  
  Submitted by:	danfe
  Approved by:	re (implicit)

Modified:
  stable/8/UPDATING

Modified: stable/8/UPDATING
==============================================================================
--- stable/8/UPDATING	Wed Sep 30 11:14:13 2009	(r197641)
+++ stable/8/UPDATING	Wed Sep 30 12:53:21 2009	(r197642)
@@ -9,7 +9,7 @@ Items affecting the ports and packages s
 portupgrade.
 
 NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW ON IA64 OR SUN4V:
-	For ia64 the INVARIANTS and INVARIANTS_SUPPORT kernel options
+	For ia64 the INVARIANTS and INVARIANT_SUPPORT kernel options
 	were left in the GENERIC kernel because the kernel does not
 	work properly without them.  For sun4v all of the normal kernel
 	debugging tools present in HEAD were left in place because

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 13:26:31 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B82181065672;
	Wed, 30 Sep 2009 13:26:31 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A558C8FC14;
	Wed, 30 Sep 2009 13:26:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UDQVuK016401;
	Wed, 30 Sep 2009 13:26:31 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UDQVB1016396;
	Wed, 30 Sep 2009 13:26:31 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200909301326.n8UDQVB1016396@svn.freebsd.org>
From: Attilio Rao 
Date: Wed, 30 Sep 2009 13:26: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: r197643 - 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: Wed, 30 Sep 2009 13:26:31 -0000

Author: attilio
Date: Wed Sep 30 13:26:31 2009
New Revision: 197643
URL: http://svn.freebsd.org/changeset/base/197643

Log:
  When releasing a read/shared lock we need to use a write memory barrier
  in order to avoid, on architectures which doesn't have strong ordered
  writes, CPU instructions reordering.
  
  Diagnosed by:	fabio
  Reviewed by:	jhb
  Tested by:	Giovanni Trematerra
  		

Modified:
  head/sys/kern/kern_rwlock.c
  head/sys/kern/kern_sx.c
  head/sys/sys/rwlock.h
  head/sys/sys/sx.h

Modified: head/sys/kern/kern_rwlock.c
==============================================================================
--- head/sys/kern/kern_rwlock.c	Wed Sep 30 12:53:21 2009	(r197642)
+++ head/sys/kern/kern_rwlock.c	Wed Sep 30 13:26:31 2009	(r197643)
@@ -541,7 +541,7 @@ _rw_runlock(struct rwlock *rw, const cha
 		 */
 		x = rw->rw_lock;
 		if (RW_READERS(x) > 1) {
-			if (atomic_cmpset_ptr(&rw->rw_lock, x,
+			if (atomic_cmpset_rel_ptr(&rw->rw_lock, x,
 			    x - RW_ONE_READER)) {
 				if (LOCK_LOG_TEST(&rw->lock_object, 0))
 					CTR4(KTR_LOCK,
@@ -559,7 +559,8 @@ _rw_runlock(struct rwlock *rw, const cha
 		if (!(x & RW_LOCK_WAITERS)) {
 			MPASS((x & ~RW_LOCK_WRITE_SPINNER) ==
 			    RW_READERS_LOCK(1));
-			if (atomic_cmpset_ptr(&rw->rw_lock, x, RW_UNLOCKED)) {
+			if (atomic_cmpset_rel_ptr(&rw->rw_lock, x,
+			    RW_UNLOCKED)) {
 				if (LOCK_LOG_TEST(&rw->lock_object, 0))
 					CTR2(KTR_LOCK, "%s: %p last succeeded",
 					    __func__, rw);
@@ -597,7 +598,7 @@ _rw_runlock(struct rwlock *rw, const cha
 			x |= (v & RW_LOCK_READ_WAITERS);
 		} else
 			queue = TS_SHARED_QUEUE;
-		if (!atomic_cmpset_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v,
+		if (!atomic_cmpset_rel_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v,
 		    x)) {
 			turnstile_chain_unlock(&rw->lock_object);
 			continue;

Modified: head/sys/kern/kern_sx.c
==============================================================================
--- head/sys/kern/kern_sx.c	Wed Sep 30 12:53:21 2009	(r197642)
+++ head/sys/kern/kern_sx.c	Wed Sep 30 13:26:31 2009	(r197643)
@@ -931,7 +931,7 @@ _sx_sunlock_hard(struct sx *sx, const ch
 		 * so, just drop one and return.
 		 */
 		if (SX_SHARERS(x) > 1) {
-			if (atomic_cmpset_ptr(&sx->sx_lock, x,
+			if (atomic_cmpset_rel_ptr(&sx->sx_lock, x,
 			    x - SX_ONE_SHARER)) {
 				if (LOCK_LOG_TEST(&sx->lock_object, 0))
 					CTR4(KTR_LOCK,
@@ -949,8 +949,8 @@ _sx_sunlock_hard(struct sx *sx, const ch
 		 */
 		if (!(x & SX_LOCK_EXCLUSIVE_WAITERS)) {
 			MPASS(x == SX_SHARERS_LOCK(1));
-			if (atomic_cmpset_ptr(&sx->sx_lock, SX_SHARERS_LOCK(1),
-			    SX_LOCK_UNLOCKED)) {
+			if (atomic_cmpset_rel_ptr(&sx->sx_lock,
+			    SX_SHARERS_LOCK(1), SX_LOCK_UNLOCKED)) {
 				if (LOCK_LOG_TEST(&sx->lock_object, 0))
 					CTR2(KTR_LOCK, "%s: %p last succeeded",
 					    __func__, sx);
@@ -973,7 +973,7 @@ _sx_sunlock_hard(struct sx *sx, const ch
 		 * Note that the state of the lock could have changed,
 		 * so if it fails loop back and retry.
 		 */
-		if (!atomic_cmpset_ptr(&sx->sx_lock,
+		if (!atomic_cmpset_rel_ptr(&sx->sx_lock,
 		    SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS,
 		    SX_LOCK_UNLOCKED)) {
 			sleepq_release(&sx->lock_object);

Modified: head/sys/sys/rwlock.h
==============================================================================
--- head/sys/sys/rwlock.h	Wed Sep 30 12:53:21 2009	(r197642)
+++ head/sys/sys/rwlock.h	Wed Sep 30 13:26:31 2009	(r197643)
@@ -55,13 +55,6 @@
  *
  * When the lock is not locked by any thread, it is encoded as a read lock
  * with zero waiters.
- *
- * A note about memory barriers.  Write locks need to use the same memory
- * barriers as mutexes: _acq when acquiring a write lock and _rel when
- * releasing a write lock.  Read locks also need to use an _acq barrier when
- * acquiring a read lock.  However, since read locks do not update any
- * locked data (modulo bugs of course), no memory barrier is needed when
- * releasing a read lock.
  */
 
 #define	RW_LOCK_READ		0x01

Modified: head/sys/sys/sx.h
==============================================================================
--- head/sys/sys/sx.h	Wed Sep 30 12:53:21 2009	(r197642)
+++ head/sys/sys/sx.h	Wed Sep 30 13:26:31 2009	(r197643)
@@ -63,13 +63,6 @@
  *
  * When the lock is not locked by any thread, it is encoded as a
  * shared lock with zero waiters.
- *
- * A note about memory barriers.  Exclusive locks need to use the same
- * memory barriers as mutexes: _acq when acquiring an exclusive lock
- * and _rel when releasing an exclusive lock.  On the other side,
- * shared lock needs to use an _acq barrier when acquiring the lock
- * but, since they don't update any locked data, no memory barrier is
- * needed when releasing a shared lock.
  */
 
 #define	SX_LOCK_SHARED			0x01
@@ -200,7 +193,7 @@ __sx_sunlock(struct sx *sx, const char *
 	uintptr_t x = sx->sx_lock;
 
 	if (x == (SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS) ||
-	    !atomic_cmpset_ptr(&sx->sx_lock, x, x - SX_ONE_SHARER))
+	    !atomic_cmpset_rel_ptr(&sx->sx_lock, x, x - SX_ONE_SHARER))
 		_sx_sunlock_hard(sx, file, line);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 13:43:41 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EB261106568F;
	Wed, 30 Sep 2009 13:43:41 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com
	[209.85.219.209])
	by mx1.freebsd.org (Postfix) with ESMTP id 0B9588FC0A;
	Wed, 30 Sep 2009 13:43:39 +0000 (UTC)
Received: by ewy5 with SMTP id 5so505081ewy.36
	for ; Wed, 30 Sep 2009 06:43:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:from:date:x-google-sender-auth:message-id:subject:to:cc
	:content-type:content-transfer-encoding;
	bh=uKf6lMKnBOu8mFg6Svt7Hf4FQp9nT1JUpxHViSAqaXU=;
	b=nDYlnPkFltzItPjvvHPr/qxHWLo1uEBZSDrhjqRFb4T/7rk/9HRw99V/6VvVAq+Lz+
	9YVrNgHnqGKX9HotuDFoNF/F6DG2m+Vva4es+snHC0QXL5MZsDY53mg3PyZxp9bhbyMh
	tKLOo2y/mBHZVoU1EhqcNsYUvQKYsDGcCy0p8=
DomainKey-Signature: a=rsa-sha1; c=nofws; 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;
	b=MnEG4CwbLlhz0tTCRDKKba9Qy5Ap+d4flEwTLSZ6lKA0HBZp/QhEcI2bUZlg/40bV7
	SSWKx8vwfligySZ7ipbCmfCHaM0ZnSFfGuWOTcg7Hqs1yCGkBKFcCd5awLiuexvxoZem
	BGADYCJHAqVj6IMq/zMZvPZ0pkKyyu1+aNGK0=
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.216.6.142 with SMTP id 14mr1449895wen.142.1254318219107; Wed, 
	30 Sep 2009 06:43:39 -0700 (PDT)
In-Reply-To: <200909301326.n8UDQVB1016396@svn.freebsd.org>
References: <200909301326.n8UDQVB1016396@svn.freebsd.org>
From: Ivan Voras 
Date: Wed, 30 Sep 2009 15:43:19 +0200
X-Google-Sender-Auth: 43ff06b6ff1f0a53
Message-ID: <9bbcef730909300643k56e40be9xc8b8287dc2971ac3@mail.gmail.com>
To: Attilio Rao 
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: r197643 - 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: Wed, 30 Sep 2009 13:43:42 -0000

2009/9/30 Attilio Rao :
> Author: attilio
> Date: Wed Sep 30 13:26:31 2009
> New Revision: 197643
> URL: http://svn.freebsd.org/changeset/base/197643
>
> Log:
> =C2=A0When releasing a read/shared lock we need to use a write memory bar=
rier
> =C2=A0in order to avoid, on architectures which doesn't have strong order=
ed
> =C2=A0writes, CPU instructions reordering.

Will this influence performance on those architecture that do?

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 13:49:00 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 692F5106568B;
	Wed, 30 Sep 2009 13:49:00 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com
	[209.85.218.227])
	by mx1.freebsd.org (Postfix) with ESMTP id 6848E8FC15;
	Wed, 30 Sep 2009 13:48:58 +0000 (UTC)
Received: by bwz27 with SMTP id 27so4634963bwz.43
	for ; Wed, 30 Sep 2009 06:48:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type; bh=7kazmk04fOpNSms37kRlBHUJkwskBUYNMvu6RRLjWFw=;
	b=mUlkVTWN9Glh+DdXSFuhLhZKBOu7iN+uiTnJNWyP4t8Xtbh198JFGPHphZDIUIJhR8
	cDsP8OVwX7eRxLWyUdfnmFc4k+fcXnodNt96R+MXgJ8rNYdV1W6WpA1bRhtNMJyenfRb
	fuPwa8kqmorXgA/ioIq6/kC2+XM/vH2smKm1I=
DomainKey-Signature: a=rsa-sha1; c=nofws; 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;
	b=rhU2ewYeixVdnZEpuLyOrNwUVqfzdwTpurn2W8SlM9rX4NFNJ4zaUU8PpA92cdD0lU
	XEPGMyfOKkNqKTQFPOIM6s4IiKu31WaAtNRIQySutNOFGsIJb041NpMxrnlmboAq057/
	57aPgZJQ1LlZJbNJ43X3DNYW2y1ShnePTeDw0=
MIME-Version: 1.0
Sender: asmrookie@gmail.com
Received: by 10.223.62.146 with SMTP id x18mr1752576fah.48.1254318538008; Wed, 
	30 Sep 2009 06:48:58 -0700 (PDT)
In-Reply-To: <9bbcef730909300643k56e40be9xc8b8287dc2971ac3@mail.gmail.com>
References: <200909301326.n8UDQVB1016396@svn.freebsd.org>
	<9bbcef730909300643k56e40be9xc8b8287dc2971ac3@mail.gmail.com>
Date: Wed, 30 Sep 2009 15:48:57 +0200
X-Google-Sender-Auth: d9ea16cf538e80ee
Message-ID: <3bbf2fe10909300648v51555353p864dd9682ecd884b@mail.gmail.com>
From: Attilio Rao 
To: Ivan Voras 
Content-Type: text/plain; charset=UTF-8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r197643 - 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: Wed, 30 Sep 2009 13:49:00 -0000

2009/9/30 Ivan Voras :
> 2009/9/30 Attilio Rao :
>> Author: attilio
>> Date: Wed Sep 30 13:26:31 2009
>> New Revision: 197643
>> URL: http://svn.freebsd.org/changeset/base/197643
>>
>> Log:
>>  When releasing a read/shared lock we need to use a write memory barrier
>>  in order to avoid, on architectures which doesn't have strong ordered
>>  writes, CPU instructions reordering.
>
> Will this influence performance on those architecture that do?
>

No.
In those architectures, memory barriers are crafted in the lighter
possible way (aka often are the same operation as a 'simple' atomic,
like the ia32 case).

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 14:28:39 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0CE7C106568F;
	Wed, 30 Sep 2009 14:28:39 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D5D928FC0C;
	Wed, 30 Sep 2009 14:28:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UESckX017688;
	Wed, 30 Sep 2009 14:28:38 GMT (envelope-from cokane@svn.freebsd.org)
Received: (from cokane@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UEScWk017686;
	Wed, 30 Sep 2009 14:28:38 GMT (envelope-from cokane@svn.freebsd.org)
Message-Id: <200909301428.n8UEScWk017686@svn.freebsd.org>
From: Coleman Kane 
Date: Wed, 30 Sep 2009 14:28: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: r197644 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 30 Sep 2009 14:28:39 -0000

Author: cokane
Date: Wed Sep 30 14:28:38 2009
New Revision: 197644
URL: http://svn.freebsd.org/changeset/base/197644

Log:
  Correct a bug that could lead to a kernel panic if a user attempted to
  perform 802.11 operations directly on the ndis0 interface before the
  first VAP (wlan0) had been created. This would lead to a NULL-pointer
  dereference in the kernel.
  
  Submitted by:	Paul B. Mahol 
  MFC after:	3 days

Modified:
  head/sys/dev/if_ndis/if_ndis.c

Modified: head/sys/dev/if_ndis/if_ndis.c
==============================================================================
--- head/sys/dev/if_ndis/if_ndis.c	Wed Sep 30 13:26:31 2009	(r197643)
+++ head/sys/dev/if_ndis/if_ndis.c	Wed Sep 30 14:28:38 2009	(r197644)
@@ -1534,7 +1534,7 @@ ndis_inputtask(dobj, arg)
 		if (m == NULL)
 			break;
 		KeReleaseSpinLock(&sc->ndis_rxlock, irql);
-		if (sc->ndis_80211)
+		if (sc->ndis_80211 && vap)
 			vap->iv_deliver_data(vap, vap->iv_bss, m);
 		else
 			(*ifp->if_input)(ifp, m);
@@ -1746,7 +1746,7 @@ ndis_ticktask(d, xsc)
 	    sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) {
 		sc->ndis_link = 1;
 		NDIS_UNLOCK(sc);
-		if (sc->ndis_80211) {
+		if (sc->ndis_80211 && vap) {
 			ndis_getstate_80211(sc);
 			ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
 		}
@@ -1758,7 +1758,7 @@ ndis_ticktask(d, xsc)
 	    sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) {
 		sc->ndis_link = 0;
 		NDIS_UNLOCK(sc);
-		if (sc->ndis_80211)
+		if (sc->ndis_80211 && vap)
 			ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
 		NDIS_LOCK(sc);
 		if_link_state_change(sc->ifp, LINK_STATE_DOWN);
@@ -2047,9 +2047,6 @@ ndis_init(xsc)
 	/* Setup task offload. */
 	ndis_set_offload(sc);
 
-	if (sc->ndis_80211)
-		ndis_setstate_80211(sc);
-
 	NDIS_LOCK(sc);
 
 	sc->ndis_txidx = 0;
@@ -2297,8 +2294,6 @@ ndis_setstate_80211(sc)
 	ifp = sc->ifp;
 	ic = ifp->if_l2com;
 	vap = TAILQ_FIRST(&ic->ic_vaps);
-	if (vap == NULL)
-		return;
 
 	if (!NDIS_INITIALIZED(sc)) {
 		DPRINTF(("%s: NDIS not initialized\n", __func__));
@@ -2730,8 +2725,6 @@ ndis_getstate_80211(sc)
 	ifp = sc->ifp;
 	ic = ifp->if_l2com;
 	vap = TAILQ_FIRST(&ic->ic_vaps);
-	if (vap == NULL)
-		return;
 	ni = vap->iv_bss;
 
 	if (!NDIS_INITIALIZED(sc))

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 14:42:06 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DFA451065679;
	Wed, 30 Sep 2009 14:42:06 +0000 (UTC)
	(envelope-from gallatin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CDE418FC0A;
	Wed, 30 Sep 2009 14:42:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UEg6G6018027;
	Wed, 30 Sep 2009 14:42:06 GMT
	(envelope-from gallatin@svn.freebsd.org)
Received: (from gallatin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UEg6vK018024;
	Wed, 30 Sep 2009 14:42:06 GMT
	(envelope-from gallatin@svn.freebsd.org)
Message-Id: <200909301442.n8UEg6vK018024@svn.freebsd.org>
From: Andrew Gallatin 
Date: Wed, 30 Sep 2009 14:42: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: r197645 - head/sys/dev/mxge
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 30 Sep 2009 14:42:07 -0000

Author: gallatin
Date: Wed Sep 30 14:42:06 2009
New Revision: 197645
URL: http://svn.freebsd.org/changeset/base/197645

Log:
  Two more mxge watchdog fixes:
  
  1) Restore the PCI Express control register after a watchdog
     reset.  This is required because the device will come out
     of watchdog reset with the pectl reg at its default state,
     and important BIOS configuration (like max payload size)
     could be lost.
  
  2) Call mxge_start_locked() for every tx queue before dropping
     the lock in the watchdog handler.   This is required, as
     the queue's buf ring may have filled during the reset.

Modified:
  head/sys/dev/mxge/if_mxge.c
  head/sys/dev/mxge/if_mxge_var.h

Modified: head/sys/dev/mxge/if_mxge.c
==============================================================================
--- head/sys/dev/mxge/if_mxge.c	Wed Sep 30 14:28:38 2009	(r197644)
+++ head/sys/dev/mxge/if_mxge.c	Wed Sep 30 14:42:06 2009	(r197645)
@@ -3701,10 +3701,16 @@ mxge_setup_cfg_space(mxge_softc_t *sc)
 	if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) {
 		lnk = pci_read_config(dev, reg + 0x12, 2);
 		sc->link_width = (lnk >> 4) & 0x3f;
-		
-		pectl = pci_read_config(dev, reg + 0x8, 2);
-		pectl = (pectl & ~0x7000) | (5 << 12);
-		pci_write_config(dev, reg + 0x8, pectl, 2);
+
+		if (sc->pectl == 0) {
+			pectl = pci_read_config(dev, reg + 0x8, 2);
+			pectl = (pectl & ~0x7000) | (5 << 12);
+			pci_write_config(dev, reg + 0x8, pectl, 2);
+			sc->pectl = pectl;
+		} else {
+			/* restore saved pectl after watchdog reset */
+			pci_write_config(dev, reg + 0x8, sc->pectl, 2);
+		}
 	}
 
 	/* Enable DMA and Memory space access */
@@ -3816,6 +3822,9 @@ mxge_watchdog_reset(mxge_softc_t *sc, in
 			/* release all TX locks */
 			for (s = 0; s < num_tx_slices; s++) {
 				ss = &sc->ss[s];
+#ifdef IFNET_BUF_RING
+				mxge_start_locked(ss);
+#endif
 				mtx_unlock(&ss->tx.mtx);
 			}
 		}

Modified: head/sys/dev/mxge/if_mxge_var.h
==============================================================================
--- head/sys/dev/mxge/if_mxge_var.h	Wed Sep 30 14:28:38 2009	(r197644)
+++ head/sys/dev/mxge/if_mxge_var.h	Wed Sep 30 14:42:06 2009	(r197645)
@@ -274,6 +274,7 @@ struct mxge_softc {
 	struct sysctl_ctx_list slice_sysctl_ctx;
 	char *mac_addr_string;
 	uint8_t	mac_addr[6];		/* eeprom mac address */
+	uint16_t pectl;			/* save PCIe CTL state */
 	char product_code_string[64];
 	char serial_number_string[64];
 	char cmd_mtx_name[16];

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 14:58:10 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8AF6C106568B;
	Wed, 30 Sep 2009 14:58:10 +0000 (UTC) (envelope-from ume@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 79B148FC1A;
	Wed, 30 Sep 2009 14:58:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UEwAtS018450;
	Wed, 30 Sep 2009 14:58:10 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UEwAkp018447;
	Wed, 30 Sep 2009 14:58:10 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <200909301458.n8UEwAkp018447@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Wed, 30 Sep 2009 14:58: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: r197646 - 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: Wed, 30 Sep 2009 14:58:10 -0000

Author: ume
Date: Wed Sep 30 14:58:10 2009
New Revision: 197646
URL: http://svn.freebsd.org/changeset/base/197646

Log:
  Don't do an IPv6 operation when the kernel doesn't have
  an IPv6 support.
  
  Reported by:	Alexander Best 
  Confirmed by:	Paul B. Mahol ,
  		Alexander Best 

Modified:
  head/etc/rc.d/netoptions
  head/etc/rc.d/routing

Modified: head/etc/rc.d/netoptions
==============================================================================
--- head/etc/rc.d/netoptions	Wed Sep 30 14:42:06 2009	(r197645)
+++ head/etc/rc.d/netoptions	Wed Sep 30 14:58:10 2009	(r197646)
@@ -9,6 +9,7 @@
 # KEYWORD: nojail
 
 . /etc/rc.subr
+. /etc/network.subr
 
 name="netoptions"
 start_cmd="netoptions_start"
@@ -66,11 +67,13 @@ netoptions_start()
 		;;
 	esac
 
-	if checkyesno ipv6_ipv4mapping; then
-		${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
-	else
-		echo -n " no-ipv4-mapped-ipv6"
-		${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
+	if afexists inet6; then
+		if checkyesno ipv6_ipv4mapping; then
+			${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
+		else
+			echo -n " no-ipv4-mapped-ipv6"
+			${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
+		fi
 	fi
 
 	[ -n "${_netoptions_initdone}" ] && echo '.'

Modified: head/etc/rc.d/routing
==============================================================================
--- head/etc/rc.d/routing	Wed Sep 30 14:42:06 2009	(r197645)
+++ head/etc/rc.d/routing	Wed Sep 30 14:58:10 2009	(r197646)
@@ -51,7 +51,9 @@ static_start()
 		;;
 	*)
 		do_static inet add
-		do_static inet6 add
+		if afexists inet6; then
+			do_static inet6 add
+		fi
 		do_static atm add
 		;;
 	esac
@@ -74,7 +76,9 @@ static_stop()
 		;;
 	*)
 		do_static inet delete
-		do_static inet6 delete
+		if afexists inet6; then
+			do_static inet6 delete
+		fi
 		do_static atm delete
 		;;
 	esac

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 15:15:43 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 2DB9E1065694; Wed, 30 Sep 2009 15:15:43 +0000 (UTC)
Date: Wed, 30 Sep 2009 15:15:43 +0000
From: Alexey Dokuchaev 
To: Hajimu UMEMOTO 
Message-ID: <20090930151543.GA57530@FreeBSD.org>
References: <200909301458.n8UEwAkp018447@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <200909301458.n8UEwAkp018447@svn.freebsd.org>
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r197646 - 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: Wed, 30 Sep 2009 15:15:43 -0000

On Wed, Sep 30, 2009 at 02:58:10PM +0000, Hajimu UMEMOTO wrote:
> Author: ume
> Date: Wed Sep 30 14:58:10 2009
> New Revision: 197646
> URL: http://svn.freebsd.org/changeset/base/197646
> 
> Log:
>   Don't do an IPv6 operation when the kernel doesn't have
>   an IPv6 support.

Thanks!

./danfe

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 16:34:50 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9036E1065679;
	Wed, 30 Sep 2009 16:34:50 +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 7F6CE8FC13;
	Wed, 30 Sep 2009 16:34:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UGYoFh020459;
	Wed, 30 Sep 2009 16:34:50 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UGYoE6020456;
	Wed, 30 Sep 2009 16:34:50 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200909301634.n8UGYoE6020456@svn.freebsd.org>
From: Andriy Gapon 
Date: Wed, 30 Sep 2009 16:34: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: r197647 - in head/sys: amd64/include i386/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, 30 Sep 2009 16:34:50 -0000

Author: avg
Date: Wed Sep 30 16:34:50 2009
New Revision: 197647
URL: http://svn.freebsd.org/changeset/base/197647

Log:
  cpufunc.h: unify/correct style of c extension names
  
  i386 and amd64 archs only.
  inline => __inline. [1]
  __asm__ => __asm. [2]
  
  Reviewed by:	kib, jhb [1]
  Suggested by:	kib [2]
  MFC after:	1 week

Modified:
  head/sys/amd64/include/cpufunc.h
  head/sys/i386/include/cpufunc.h

Modified: head/sys/amd64/include/cpufunc.h
==============================================================================
--- head/sys/amd64/include/cpufunc.h	Wed Sep 30 14:58:10 2009	(r197646)
+++ head/sys/amd64/include/cpufunc.h	Wed Sep 30 16:34:50 2009	(r197647)
@@ -277,7 +277,7 @@ static __inline void
 mfence(void)
 {
 
-	__asm__ __volatile("mfence" : : : "memory");
+	__asm __volatile("mfence" : : : "memory");
 }
 
 static __inline void
@@ -457,14 +457,14 @@ load_es(u_int sel)
 	__asm __volatile("mov %0,%%es" : : "rm" (sel));
 }
 
-static inline void
+static __inline void
 cpu_monitor(const void *addr, int extensions, int hints)
 {
 	__asm __volatile("monitor;"
 	    : :"a" (addr), "c" (extensions), "d"(hints));
 }
 
-static inline void
+static __inline void
 cpu_mwait(int extensions, int hints)
 {
 	__asm __volatile("mwait;" : :"a" (hints), "c" (extensions));

Modified: head/sys/i386/include/cpufunc.h
==============================================================================
--- head/sys/i386/include/cpufunc.h	Wed Sep 30 14:58:10 2009	(r197646)
+++ head/sys/i386/include/cpufunc.h	Wed Sep 30 16:34:50 2009	(r197647)
@@ -132,14 +132,14 @@ enable_intr(void)
 #endif
 }
 
-static inline void
+static __inline void
 cpu_monitor(const void *addr, int extensions, int hints)
 {
 	__asm __volatile("monitor;"
 	    : :"a" (addr), "c" (extensions), "d"(hints));
 }
 
-static inline void
+static __inline void
 cpu_mwait(int extensions, int hints)
 {
 	__asm __volatile("mwait;" : :"a" (hints), "c" (extensions));

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 16:46:17 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D07901065692;
	Wed, 30 Sep 2009 16:46:17 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194])
	by mx1.freebsd.org (Postfix) with ESMTP id 447EA8FC0C;
	Wed, 30 Sep 2009 16:46:16 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n8UGkDbw024547
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 30 Sep 2009 19:46:13 +0300 (EEST)
	(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.3/8.14.3) with ESMTP id
	n8UGkCCU039123; Wed, 30 Sep 2009 19:46:12 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n8UGkCbu039122; 
	Wed, 30 Sep 2009 19:46:12 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Wed, 30 Sep 2009 19:46:12 +0300
From: Kostik Belousov 
To: Andriy Gapon 
Message-ID: <20090930164612.GJ3130@deviant.kiev.zoral.com.ua>
References: <200909301634.n8UGYoE6020456@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="QxN5xOWGsmh5a4wb"
Content-Disposition: inline
In-Reply-To: <200909301634.n8UGYoE6020456@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 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: r197647 - in head/sys: amd64/include i386/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, 30 Sep 2009 16:46:17 -0000


--QxN5xOWGsmh5a4wb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 30, 2009 at 04:34:50PM +0000, Andriy Gapon wrote:
> Author: avg
> Date: Wed Sep 30 16:34:50 2009
> New Revision: 197647
> URL: http://svn.freebsd.org/changeset/base/197647
>=20
> Log:
>   cpufunc.h: unify/correct style of c extension names
>  =20
>   i386 and amd64 archs only.
>   inline =3D> __inline. [1]
>   __asm__ =3D> __asm. [2]
>  =20
>   Reviewed by:	kib, jhb [1]
>   Suggested by:	kib [2]
And this was pointed out to me by Alan Cox.

--QxN5xOWGsmh5a4wb
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkrDi1QACgkQC3+MBN1Mb4jfjwCgsVzcdAqdY7o65/u5kmbZ/V5r
jN4AoK6ok4e5qOokgyRZQlPb8DKCusXx
=vWup
-----END PGP SIGNATURE-----

--QxN5xOWGsmh5a4wb--

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 16:47:22 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1E16D1065715;
	Wed, 30 Sep 2009 16:47:22 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98])
	by mx1.freebsd.org (Postfix) with ESMTP id 016398FC26;
	Wed, 30 Sep 2009 16:47:21 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii; format=flowed
Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36])
	by asmtp023.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KQS00ENPMMWYW40@asmtp023.mac.com>; Wed,
	30 Sep 2009 09:47:21 -0700 (PDT)
From: Marcel Moolenaar 
In-reply-to: <20090929235146.GA64567@hades.panopticon>
Date: Wed, 30 Sep 2009 09:47:20 -0700
Message-id: 
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
	<20090929145447.GA82539@hades.panopticon>
	<20090929235146.GA64567@hades.panopticon>
To: Dmitry Marakasov 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar ,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r197608 - 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: Wed, 30 Sep 2009 16:47:22 -0000


On Sep 29, 2009, at 4:51 PM, Dmitry Marakasov wrote:

> * Dmitry Marakasov (amdmi3@amdmi3.ru) wrote:
>
>> Seconded. I've seen a report of geom_part_ebr unable to detect
>> partitions which were actually there. Will inquiry the reporter if
>> this change solved the problem.
>
> Seems like it hasn't. Here's the first sector from that partition:

I'll see about checking the partition table more rigorously
so that we can eliminate the check for the unused space.

With what tool was this created?

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 17:05:26 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5A80106566B;
	Wed, 30 Sep 2009 17:05:26 +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 D541B8FC08;
	Wed, 30 Sep 2009 17:05:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UH5Qwj021040;
	Wed, 30 Sep 2009 17:05:26 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UH5Qi8021038;
	Wed, 30 Sep 2009 17:05:26 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200909301705.n8UH5Qi8021038@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 30 Sep 2009 17: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: r197648 - 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: Wed, 30 Sep 2009 17:05:27 -0000

Author: jhb
Date: Wed Sep 30 17:05:26 2009
New Revision: 197648
URL: http://svn.freebsd.org/changeset/base/197648

Log:
  Split the 'video' ACPI lock up into two locks to resolve a LOR with the
  sysctl lock.  The 'video' lock now protects the 'bus' of video output
  devices attached to a graphics adapter.  It is used when iterating over
  the list of outputs, etc.  The 'video_output' lock is used to lock the
  output-specific data similar to a driver lock for the individual video
  outputs.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/acpica/acpi_video.c

Modified: head/sys/dev/acpica/acpi_video.c
==============================================================================
--- head/sys/dev/acpica/acpi_video.c	Wed Sep 30 16:34:50 2009	(r197647)
+++ head/sys/dev/acpica/acpi_video.c	Wed Sep 30 17:05:26 2009	(r197648)
@@ -170,7 +170,13 @@ static struct sysctl_oid	*acpi_video_sys
 static struct acpi_video_output_queue crt_units, tv_units,
     ext_units, lcd_units, other_units;
 
+/*
+ * The 'video' lock protects the hierarchy of video output devices
+ * (the video "bus").  The 'video_output' lock protects per-output
+ * data is equivalent to a softc lock for each video output.
+ */
 ACPI_SERIAL_DECL(video, "ACPI video");
+ACPI_SERIAL_DECL(video_output, "ACPI video output");
 MALLOC_DEFINE(M_ACPIVIDEO, "acpivideo", "ACPI video extension");
 
 static int
@@ -236,12 +242,14 @@ acpi_video_attach(device_t dev)
 	acpi_sc = devclass_get_softc(devclass_find("acpi"), 0);
 	if (acpi_sc == NULL)
 		return (ENXIO);
+	ACPI_SERIAL_BEGIN(video);
 	if (acpi_video_sysctl_tree == NULL) {
 		acpi_video_sysctl_tree = SYSCTL_ADD_NODE(&acpi_video_sysctl_ctx,
 				    SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree),
 				    OID_AUTO, "video", CTLFLAG_RD, 0,
 				    "video extension control");
 	}
+	ACPI_SERIAL_END(video);
 
 	sc->device = dev;
 	sc->handle = acpi_get_handle(dev);
@@ -316,6 +324,7 @@ acpi_video_notify_handler(ACPI_HANDLE ha
 		dss_p = 0;
 		lasthand = NULL;
 		ACPI_SERIAL_BEGIN(video);
+		ACPI_SERIAL_BEGIN(video_output);
 		STAILQ_FOREACH(vo, &sc->vid_outputs, vo_next) {
 			dss = vo_get_graphics_state(vo->handle);
 			dcs = vo_get_device_status(vo->handle);
@@ -331,6 +340,7 @@ acpi_video_notify_handler(ACPI_HANDLE ha
 		}
 		if (lasthand != NULL)
 			vo_set_device_state(lasthand, dss_p|DSS_COMMIT);
+		ACPI_SERIAL_END(video_output);
 		ACPI_SERIAL_END(video);
 		break;
 	case VID_NOTIFY_REPROBE:
@@ -367,12 +377,14 @@ acpi_video_power_profile(void *context)
 		return;
 
 	ACPI_SERIAL_BEGIN(video);
+	ACPI_SERIAL_BEGIN(video_output);
 	STAILQ_FOREACH(vo, &sc->vid_outputs, vo_next) {
 		if (vo->vo_levels != NULL && vo->vo_brightness == -1)
 			vo_set_brightness(vo->handle,
 			    state == POWER_PROFILE_ECONOMY ?
 			    vo->vo_economy : vo->vo_fullpower);
 	}
+	ACPI_SERIAL_END(video_output);
 	ACPI_SERIAL_END(video);
 }
 
@@ -550,7 +562,7 @@ static void
 acpi_video_vo_bind(struct acpi_video_output *vo, ACPI_HANDLE handle)
 {
 
-	ACPI_SERIAL_ASSERT(video);
+	ACPI_SERIAL_BEGIN(video_output);
 	if (vo->vo_levels != NULL)
 		AcpiOsFree(vo->vo_levels);
 	vo->handle = handle;
@@ -565,6 +577,7 @@ acpi_video_vo_bind(struct acpi_video_out
 			/* XXX - see above. */
 			vo->vo_economy = vo->vo_levels[BCL_ECONOMY];
 	}
+	ACPI_SERIAL_END(video_output);
 }
 
 static void
@@ -605,7 +618,7 @@ acpi_video_vo_check_level(struct acpi_vi
 {
 	int i;
 
-	ACPI_SERIAL_ASSERT(video);
+	ACPI_SERIAL_ASSERT(video_output);
 	if (vo->vo_levels == NULL)
 		return (ENODEV);
 	for (i = 0; i < vo->vo_numlevels; i++)
@@ -624,7 +637,7 @@ acpi_video_vo_active_sysctl(SYSCTL_HANDL
 	vo = (struct acpi_video_output *)arg1;
 	if (vo->handle == NULL)
 		return (ENXIO);
-	ACPI_SERIAL_BEGIN(video);
+	ACPI_SERIAL_BEGIN(video_output);
 	state = (vo_get_device_status(vo->handle) & DCS_ACTIVE) ? 1 : 0;
 	err = sysctl_handle_int(oidp, &state, 0, req);
 	if (err != 0 || req->newptr == NULL)
@@ -632,7 +645,7 @@ acpi_video_vo_active_sysctl(SYSCTL_HANDL
 	vo_set_device_state(vo->handle,
 	    DSS_COMMIT | (state ? DSS_ACTIVE : DSS_INACTIVE));
 out:
-	ACPI_SERIAL_END(video);
+	ACPI_SERIAL_END(video_output);
 	return (err);
 }
 
@@ -644,7 +657,7 @@ acpi_video_vo_bright_sysctl(SYSCTL_HANDL
 	int level, preset, err;
 
 	vo = (struct acpi_video_output *)arg1;
-	ACPI_SERIAL_BEGIN(video);
+	ACPI_SERIAL_BEGIN(video_output);
 	if (vo->handle == NULL) {
 		err = ENXIO;
 		goto out;
@@ -674,7 +687,7 @@ acpi_video_vo_bright_sysctl(SYSCTL_HANDL
 	vo_set_brightness(vo->handle, (level == -1) ? preset : level);
 
 out:
-	ACPI_SERIAL_END(video);
+	ACPI_SERIAL_END(video_output);
 	return (err);
 }
 
@@ -686,7 +699,7 @@ acpi_video_vo_presets_sysctl(SYSCTL_HAND
 
 	err = 0;
 	vo = (struct acpi_video_output *)arg1;
-	ACPI_SERIAL_BEGIN(video);
+	ACPI_SERIAL_BEGIN(video_output);
 	if (vo->handle == NULL) {
 		err = ENXIO;
 		goto out;
@@ -717,7 +730,7 @@ acpi_video_vo_presets_sysctl(SYSCTL_HAND
 	*preset = level;
 
 out:
-	ACPI_SERIAL_END(video);
+	ACPI_SERIAL_END(video_output);
 	return (err);
 }
 
@@ -729,7 +742,7 @@ acpi_video_vo_levels_sysctl(SYSCTL_HANDL
 	int err;
 
 	vo = (struct acpi_video_output *)arg1;
-	ACPI_SERIAL_BEGIN(video);
+	ACPI_SERIAL_BEGIN(video_output);
 	if (vo->vo_levels == NULL) {
 		err = ENODEV;
 		goto out;
@@ -742,7 +755,7 @@ acpi_video_vo_levels_sysctl(SYSCTL_HANDL
 	    vo->vo_numlevels * sizeof(*vo->vo_levels), req);
 
 out:
-	ACPI_SERIAL_END(video);
+	ACPI_SERIAL_END(video_output);
 	return (err);
 }
 
@@ -892,6 +905,7 @@ vo_set_brightness(ACPI_HANDLE handle, in
 {
 	ACPI_STATUS status;
 
+	ACPI_SERIAL_ASSERT(video_output);
 	status = acpi_SetInteger(handle, "_BCM", level);
 	if (ACPI_FAILURE(status))
 		printf("can't evaluate %s._BCM - %s\n",
@@ -904,6 +918,7 @@ vo_get_device_status(ACPI_HANDLE handle)
 	UINT32 dcs;
 	ACPI_STATUS status;
 
+	ACPI_SERIAL_ASSERT(video_output);
 	dcs = 0;
 	status = acpi_GetInteger(handle, "_DCS", &dcs);
 	if (ACPI_FAILURE(status))
@@ -933,6 +948,7 @@ vo_set_device_state(ACPI_HANDLE handle, 
 {
 	ACPI_STATUS status;
 
+	ACPI_SERIAL_ASSERT(video_output);
 	status = acpi_SetInteger(handle, "_DSS", state);
 	if (ACPI_FAILURE(status))
 		printf("can't evaluate %s._DSS - %s\n",

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 17:07:50 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 390ED1065670;
	Wed, 30 Sep 2009 17:07:50 +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 2920E8FC08;
	Wed, 30 Sep 2009 17:07:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UH7osQ021121;
	Wed, 30 Sep 2009 17:07:50 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UH7oSm021119;
	Wed, 30 Sep 2009 17:07:50 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200909301707.n8UH7oSm021119@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 30 Sep 2009 17:07: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: r197649 - 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: Wed, 30 Sep 2009 17:07:50 -0000

Author: jhb
Date: Wed Sep 30 17:07:49 2009
New Revision: 197649
URL: http://svn.freebsd.org/changeset/base/197649

Log:
  Do not hold the ACPI A/C adapter lock when changing the power profile.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/acpica/acpi_acad.c

Modified: head/sys/dev/acpica/acpi_acad.c
==============================================================================
--- head/sys/dev/acpica/acpi_acad.c	Wed Sep 30 17:05:26 2009	(r197648)
+++ head/sys/dev/acpica/acpi_acad.c	Wed Sep 30 17:07:49 2009	(r197649)
@@ -109,13 +109,14 @@ acpi_acad_get_status(void *context)
     ACPI_SERIAL_BEGIN(acad);
     if (newstatus != -1 && sc->status != newstatus) {
 	sc->status = newstatus;
+	ACPI_SERIAL_END(acad);
 	power_profile_set_state(newstatus ? POWER_PROFILE_PERFORMANCE :
 	    POWER_PROFILE_ECONOMY);
 	ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
 	    "%s Line\n", newstatus ? "On" : "Off");
 	acpi_UserNotify("ACAD", h, newstatus);
-    }
-    ACPI_SERIAL_END(acad);
+    } else
+	ACPI_SERIAL_END(acad);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 17:37:51 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 661B31065670;
	Wed, 30 Sep 2009 17:37:51 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B9318FC46;
	Wed, 30 Sep 2009 17:37:51 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id E34AD46B09;
	Wed, 30 Sep 2009 13:37:50 -0400 (EDT)
Date: Wed, 30 Sep 2009 18:37:50 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Attilio Rao 
In-Reply-To: <200909301326.n8UDQVB1016396@svn.freebsd.org>
Message-ID: 
References: <200909301326.n8UDQVB1016396@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
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: r197643 - 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: Wed, 30 Sep 2009 17:37:51 -0000

On Wed, 30 Sep 2009, Attilio Rao wrote:

>  When releasing a read/shared lock we need to use a write memory barrier
>  in order to avoid, on architectures which doesn't have strong ordered
>  writes, CPU instructions reordering.

Hi Attilio (Fabio, et al),

Nice catch!  Are we aware of specific reported problems that can be laid at 
the feet of this bug, or was this more of a "wait a moment, shouldn't there be 
a barrier there?".  Could you comment on the scope of this problem across 
architectures we support?

Robert

>
>  Diagnosed by:	fabio
>  Reviewed by:	jhb
>  Tested by:	Giovanni Trematerra
>  		
>
> Modified:
>  head/sys/kern/kern_rwlock.c
>  head/sys/kern/kern_sx.c
>  head/sys/sys/rwlock.h
>  head/sys/sys/sx.h
>
> Modified: head/sys/kern/kern_rwlock.c
> ==============================================================================
> --- head/sys/kern/kern_rwlock.c	Wed Sep 30 12:53:21 2009	(r197642)
> +++ head/sys/kern/kern_rwlock.c	Wed Sep 30 13:26:31 2009	(r197643)
> @@ -541,7 +541,7 @@ _rw_runlock(struct rwlock *rw, const cha
> 		 */
> 		x = rw->rw_lock;
> 		if (RW_READERS(x) > 1) {
> -			if (atomic_cmpset_ptr(&rw->rw_lock, x,
> +			if (atomic_cmpset_rel_ptr(&rw->rw_lock, x,
> 			    x - RW_ONE_READER)) {
> 				if (LOCK_LOG_TEST(&rw->lock_object, 0))
> 					CTR4(KTR_LOCK,
> @@ -559,7 +559,8 @@ _rw_runlock(struct rwlock *rw, const cha
> 		if (!(x & RW_LOCK_WAITERS)) {
> 			MPASS((x & ~RW_LOCK_WRITE_SPINNER) ==
> 			    RW_READERS_LOCK(1));
> -			if (atomic_cmpset_ptr(&rw->rw_lock, x, RW_UNLOCKED)) {
> +			if (atomic_cmpset_rel_ptr(&rw->rw_lock, x,
> +			    RW_UNLOCKED)) {
> 				if (LOCK_LOG_TEST(&rw->lock_object, 0))
> 					CTR2(KTR_LOCK, "%s: %p last succeeded",
> 					    __func__, rw);
> @@ -597,7 +598,7 @@ _rw_runlock(struct rwlock *rw, const cha
> 			x |= (v & RW_LOCK_READ_WAITERS);
> 		} else
> 			queue = TS_SHARED_QUEUE;
> -		if (!atomic_cmpset_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v,
> +		if (!atomic_cmpset_rel_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v,
> 		    x)) {
> 			turnstile_chain_unlock(&rw->lock_object);
> 			continue;
>
> Modified: head/sys/kern/kern_sx.c
> ==============================================================================
> --- head/sys/kern/kern_sx.c	Wed Sep 30 12:53:21 2009	(r197642)
> +++ head/sys/kern/kern_sx.c	Wed Sep 30 13:26:31 2009	(r197643)
> @@ -931,7 +931,7 @@ _sx_sunlock_hard(struct sx *sx, const ch
> 		 * so, just drop one and return.
> 		 */
> 		if (SX_SHARERS(x) > 1) {
> -			if (atomic_cmpset_ptr(&sx->sx_lock, x,
> +			if (atomic_cmpset_rel_ptr(&sx->sx_lock, x,
> 			    x - SX_ONE_SHARER)) {
> 				if (LOCK_LOG_TEST(&sx->lock_object, 0))
> 					CTR4(KTR_LOCK,
> @@ -949,8 +949,8 @@ _sx_sunlock_hard(struct sx *sx, const ch
> 		 */
> 		if (!(x & SX_LOCK_EXCLUSIVE_WAITERS)) {
> 			MPASS(x == SX_SHARERS_LOCK(1));
> -			if (atomic_cmpset_ptr(&sx->sx_lock, SX_SHARERS_LOCK(1),
> -			    SX_LOCK_UNLOCKED)) {
> +			if (atomic_cmpset_rel_ptr(&sx->sx_lock,
> +			    SX_SHARERS_LOCK(1), SX_LOCK_UNLOCKED)) {
> 				if (LOCK_LOG_TEST(&sx->lock_object, 0))
> 					CTR2(KTR_LOCK, "%s: %p last succeeded",
> 					    __func__, sx);
> @@ -973,7 +973,7 @@ _sx_sunlock_hard(struct sx *sx, const ch
> 		 * Note that the state of the lock could have changed,
> 		 * so if it fails loop back and retry.
> 		 */
> -		if (!atomic_cmpset_ptr(&sx->sx_lock,
> +		if (!atomic_cmpset_rel_ptr(&sx->sx_lock,
> 		    SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS,
> 		    SX_LOCK_UNLOCKED)) {
> 			sleepq_release(&sx->lock_object);
>
> Modified: head/sys/sys/rwlock.h
> ==============================================================================
> --- head/sys/sys/rwlock.h	Wed Sep 30 12:53:21 2009	(r197642)
> +++ head/sys/sys/rwlock.h	Wed Sep 30 13:26:31 2009	(r197643)
> @@ -55,13 +55,6 @@
>  *
>  * When the lock is not locked by any thread, it is encoded as a read lock
>  * with zero waiters.
> - *
> - * A note about memory barriers.  Write locks need to use the same memory
> - * barriers as mutexes: _acq when acquiring a write lock and _rel when
> - * releasing a write lock.  Read locks also need to use an _acq barrier when
> - * acquiring a read lock.  However, since read locks do not update any
> - * locked data (modulo bugs of course), no memory barrier is needed when
> - * releasing a read lock.
>  */
>
> #define	RW_LOCK_READ		0x01
>
> Modified: head/sys/sys/sx.h
> ==============================================================================
> --- head/sys/sys/sx.h	Wed Sep 30 12:53:21 2009	(r197642)
> +++ head/sys/sys/sx.h	Wed Sep 30 13:26:31 2009	(r197643)
> @@ -63,13 +63,6 @@
>  *
>  * When the lock is not locked by any thread, it is encoded as a
>  * shared lock with zero waiters.
> - *
> - * A note about memory barriers.  Exclusive locks need to use the same
> - * memory barriers as mutexes: _acq when acquiring an exclusive lock
> - * and _rel when releasing an exclusive lock.  On the other side,
> - * shared lock needs to use an _acq barrier when acquiring the lock
> - * but, since they don't update any locked data, no memory barrier is
> - * needed when releasing a shared lock.
>  */
>
> #define	SX_LOCK_SHARED			0x01
> @@ -200,7 +193,7 @@ __sx_sunlock(struct sx *sx, const char *
> 	uintptr_t x = sx->sx_lock;
>
> 	if (x == (SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS) ||
> -	    !atomic_cmpset_ptr(&sx->sx_lock, x, x - SX_ONE_SHARER))
> +	    !atomic_cmpset_rel_ptr(&sx->sx_lock, x, x - SX_ONE_SHARER))
> 		_sx_sunlock_hard(sx, file, line);
> }
>
>

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 17:56:30 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C958C1065694;
	Wed, 30 Sep 2009 17:56:30 +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 4B2D48FC1D;
	Wed, 30 Sep 2009 17:56:29 +0000 (UTC)
Received: from besplex.bde.org (c122-107-125-150.carlnfd1.nsw.optusnet.com.au
	[122.107.125.150])
	by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n8UHuRKQ025746
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Oct 2009 03:56:28 +1000
Date: Thu, 1 Oct 2009 03:56:27 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Kostik Belousov 
In-Reply-To: <20090930164612.GJ3130@deviant.kiev.zoral.com.ua>
Message-ID: <20091001032216.S3063@besplex.bde.org>
References: <200909301634.n8UGYoE6020456@svn.freebsd.org>
	<20090930164612.GJ3130@deviant.kiev.zoral.com.ua>
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, Andriy Gapon 
Subject: Re: svn commit: r197647 - in head/sys: amd64/include i386/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, 30 Sep 2009 17:56:30 -0000

On Wed, 30 Sep 2009, Kostik Belousov wrote:

> On Wed, Sep 30, 2009 at 04:34:50PM +0000, Andriy Gapon wrote:
>> Author: avg
>> Date: Wed Sep 30 16:34:50 2009
>> New Revision: 197647
>> URL: http://svn.freebsd.org/changeset/base/197647
>>
>> Log:
>>   cpufunc.h: unify/correct style of c extension names
>>
>>   i386 and amd64 archs only.
>>   inline => __inline. [1]
>>   __asm__ => __asm. [2]

Thanks.

>>   Reviewed by:	kib, jhb [1]
>>   Suggested by:	kib [2]
> And this was pointed out to me by Alan Cox.

Didn't I complain about it? :-)

I complained about the recent deunification of __volatile, but you didn't
touch that.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 18:50:51 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0E1541065696;
	Wed, 30 Sep 2009 18:50:51 +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 F2E2E8FC20;
	Wed, 30 Sep 2009 18:50:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UIooQu023117;
	Wed, 30 Sep 2009 18:50:50 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UIoonO023115;
	Wed, 30 Sep 2009 18:50:50 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200909301850.n8UIoonO023115@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 30 Sep 2009 18:50: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: r197650 - head/sys/fs/nfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 30 Sep 2009 18:50:51 -0000

Author: trasz
Date: Wed Sep 30 18:50:50 2009
New Revision: 197650
URL: http://svn.freebsd.org/changeset/base/197650

Log:
  Fix typo in the comment.

Modified:
  head/sys/fs/nfs/nfs_commonacl.c

Modified: head/sys/fs/nfs/nfs_commonacl.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonacl.c	Wed Sep 30 17:07:49 2009	(r197649)
+++ head/sys/fs/nfs/nfs_commonacl.c	Wed Sep 30 18:50:50 2009	(r197650)
@@ -695,7 +695,7 @@ nfsrv_setacl(vnode_t vp, NFSACL_T *aclp,
 	if (nfsrv_useacl == 0 || !NFSHASNFS4ACL(vnode_mount(vp)))
 		return (NFSERR_ATTRNOTSUPP);
 	/*
-	 * With NFS4 ACLs, chmod(2) may need to add additional entries.
+	 * With NFSv4 ACLs, chmod(2) may need to add additional entries.
 	 * Make sure it has enough room for that - splitting every entry
 	 * into two and appending "canonical six" entries at the end.
 	 * Cribbed out of kern/vfs_acl.c - Rick M.

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 19:23:27 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 772271065697
	for ; Wed, 30 Sep 2009 19:23:27 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4])
	by mx1.freebsd.org (Postfix) with ESMTP id C221B8FC1C
	for ; Wed, 30 Sep 2009 19:23:26 +0000 (UTC)
Received: (qmail 4323 invoked by uid 399); 30 Sep 2009 19:23:24 -0000
Received: from localhost (HELO foreign.dougb.net)
	(dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 30 Sep 2009 19:23:24 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Message-ID: <4AC3B02B.90703@FreeBSD.org>
Date: Wed, 30 Sep 2009 12:23:23 -0700
From: Doug Barton 
Organization: http://www.FreeBSD.org/
User-Agent: Thunderbird 2.0.0.23 (X11/20090822)
MIME-Version: 1.0
To: Rui Paulo 
References: <200909291218.n8TCINmv085038@svn.freebsd.org>
	<558A76C2-0F8C-472F-A235-16BDAD15C634@freebsd.org>
In-Reply-To: <558A76C2-0F8C-472F-A235-16BDAD15C634@freebsd.org>
X-Enigmail-Version: 0.96.0
OpenPGP: id=D5B2F0FB
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: r197614 - 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: Wed, 30 Sep 2009 19:23:27 -0000

Rui Paulo wrote:
> On 29 Sep 2009, at 13:18, Rui Paulo wrote:
> 
>> Author: rpaulo
>> Date: Tue Sep 29 12:18:23 2009
>> New Revision: 197614
>> URL: http://svn.freebsd.org/changeset/base/197614
>>
>> Log:
>>  Update 802.11s mesh support to draft 3.03. This includes a revised 
>> frame
>>  format for peering and changes to the PERR frames.
>>  Note that this is incompatible with the previous code.
>>
>>  Reviewed by:    sam
>>  Approved by:    re (kib)
> 
> 
> Please note that, while these changes are being made very late in the
> release process, they are necessary to keep in sync with the new draft. 
> There should be no impact on ports, mesh support is brand new to 8.0.

Is it my imagination, or does GENERIC still refer to D3.0? Perhaps
other places as well?

Doug

-- 

    This .signature sanitized for your protection


From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 19:40:51 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 806001065692;
	Wed, 30 Sep 2009 19:40:51 +0000 (UTC) (envelope-from zml@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 65FCF8FC22;
	Wed, 30 Sep 2009 19:40:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8UJep8j024251;
	Wed, 30 Sep 2009 19:40:51 GMT (envelope-from zml@svn.freebsd.org)
Received: (from zml@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8UJep9X024249;
	Wed, 30 Sep 2009 19:40:51 GMT (envelope-from zml@svn.freebsd.org)
Message-Id: <200909301940.n8UJep9X024249@svn.freebsd.org>
From: Zachary Loafman 
Date: Wed, 30 Sep 2009 19:40:51 +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: r197652 - stable/7/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, 30 Sep 2009 19:40:51 -0000

Author: zml
Date: Wed Sep 30 19:40:51 2009
New Revision: 197652
URL: http://svn.freebsd.org/changeset/base/197652

Log:
  sched_ule in stable/7 has a bug (introduced in r180607) where a thread
  that is running often will appear to not be running much at all.
  
  sched_ule has a much less accurate mechanism for determining how much
  various threads are running.  Every tick, hardclock_cpu() calls
  sched_tick(), and the currently running thread gets it's ts_ticks
  incremented.  Whenever an event of interest happens to a thread, the
  ts_ticks value may be decayed; it's supposed to be a rough running
  average of the last 10 seconds.  So there's a ts_ltick which is the last
  tick we looked at decaying ts_ticks.
  
  The increment in sched_tick() was slightly buggy on SMP, because a
  thread could get incremented on two different CPUs in the rare case
  where it was swapped from one which had run sched_tick() this tick to
  one which hadn't.  The fix that was used relied on ts_ltick and only
  incremented ts_ticks if ts_ltick was not from the current tick.
  This is buggy, because any time the thread began running on a CPU in the
  current tick, we would have set ts_ltick to ticks, so if it was still
  running at sched_tick() we wouldn't increment.
  
  A system with a single process that hogs the CPU and is otherwise idle,
  therefore, would look like all threads were at 0%. The threads not
  running are really at 0%, and the hog is not getting its ts_ticks
  incremented since it went through some other runq stats that set
  ts_ltick.  On a 2-way SMP the thread used to get shuffled regularly
  between CPUs (I think fallout from this bug), so it would appear a
  little over 50% busy.
  
  The fix is to use a separate variable to record when the last
  sched_tick() increment happened.
  
  Submitted by:       Matthew Fleming (matthew.fleming at isilon.com)
  Reviewed by:        zml, dfr
  Approved by:        dfr (mentor)

Modified:
  stable/7/sys/kern/sched_ule.c

Modified: stable/7/sys/kern/sched_ule.c
==============================================================================
--- stable/7/sys/kern/sched_ule.c	Wed Sep 30 19:19:53 2009	(r197651)
+++ stable/7/sys/kern/sched_ule.c	Wed Sep 30 19:40:51 2009	(r197652)
@@ -101,6 +101,7 @@ struct td_sched {	
 	u_int		ts_runtime;	/* Number of ticks we were running */
 	/* The following variables are only used for pctcpu calculation */
 	int		ts_ltick;	/* Last tick that we were running on */
+	int		ts_incrtick;	/* Last tick that we incremented on */
 	int		ts_ftick;	/* First tick that we were running on */
 	int		ts_ticks;	/* Tick count */
 #ifdef SMP
@@ -2075,6 +2076,7 @@ sched_fork_thread(struct thread *td, str
 	 */
 	ts2->ts_ticks = ts->ts_ticks;
 	ts2->ts_ltick = ts->ts_ltick;
+	ts2->ts_incrtick = ts->ts_incrtick;
 	ts2->ts_ftick = ts->ts_ftick;
 	child->td_user_pri = td->td_user_pri;
 	child->td_base_user_pri = td->td_base_user_pri;
@@ -2266,10 +2268,11 @@ sched_tick(void)
 	 * Ticks is updated asynchronously on a single cpu.  Check here to
 	 * avoid incrementing ts_ticks multiple times in a single tick.
 	 */
-	if (ts->ts_ltick == ticks)
+	if (ts->ts_incrtick == ticks)
 		return;
 	/* Adjust ticks for pctcpu */
 	ts->ts_ticks += 1 << SCHED_TICK_SHIFT;
+	ts->ts_incrtick = ticks;
 	ts->ts_ltick = ticks;
 	/*
 	 * Update if we've exceeded our desired tick threshhold by over one

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 19:53:02 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 576AE1065693;
	Wed, 30 Sep 2009 19:53:02 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194])
	by mx1.freebsd.org (Postfix) with ESMTP id DF88A8FC13;
	Wed, 30 Sep 2009 19:53:01 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n8UJqsv9038009
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 30 Sep 2009 22:52:54 +0300 (EEST)
	(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.3/8.14.3) with ESMTP id
	n8UJqsGQ039860; Wed, 30 Sep 2009 22:52:54 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n8UJqsU9039859; 
	Wed, 30 Sep 2009 22:52:54 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Wed, 30 Sep 2009 22:52:54 +0300
From: Kostik Belousov 
To: Zachary Loafman 
Message-ID: <20090930195254.GK3130@deviant.kiev.zoral.com.ua>
References: <200909301940.n8UJep9X024249@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="fLj60tP2PZ34xyqD"
Content-Disposition: inline
In-Reply-To: <200909301940.n8UJep9X024249@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 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-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r197652 - stable/7/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, 30 Sep 2009 19:53:02 -0000


--fLj60tP2PZ34xyqD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 30, 2009 at 07:40:51PM +0000, Zachary Loafman wrote:
> Author: zml
> Date: Wed Sep 30 19:40:51 2009
> New Revision: 197652
> URL: http://svn.freebsd.org/changeset/base/197652
>=20
> Log:
>   sched_ule in stable/7 has a bug (introduced in r180607) where a thread
>   that is running often will appear to not be running much at all.
Why is this not a problem on HEAD ?

>  =20
>   sched_ule has a much less accurate mechanism for determining how much
>   various threads are running.  Every tick, hardclock_cpu() calls
>   sched_tick(), and the currently running thread gets it's ts_ticks
>   incremented.  Whenever an event of interest happens to a thread, the
>   ts_ticks value may be decayed; it's supposed to be a rough running
>   average of the last 10 seconds.  So there's a ts_ltick which is the last
>   tick we looked at decaying ts_ticks.
>  =20
>   The increment in sched_tick() was slightly buggy on SMP, because a
>   thread could get incremented on two different CPUs in the rare case
>   where it was swapped from one which had run sched_tick() this tick to
>   one which hadn't.  The fix that was used relied on ts_ltick and only
>   incremented ts_ticks if ts_ltick was not from the current tick.
>   This is buggy, because any time the thread began running on a CPU in the
>   current tick, we would have set ts_ltick to ticks, so if it was still
>   running at sched_tick() we wouldn't increment.
>  =20
>   A system with a single process that hogs the CPU and is otherwise idle,
>   therefore, would look like all threads were at 0%. The threads not
>   running are really at 0%, and the hog is not getting its ts_ticks
>   incremented since it went through some other runq stats that set
>   ts_ltick.  On a 2-way SMP the thread used to get shuffled regularly
>   between CPUs (I think fallout from this bug), so it would appear a
>   little over 50% busy.
>  =20
>   The fix is to use a separate variable to record when the last
>   sched_tick() increment happened.
>  =20
>   Submitted by:       Matthew Fleming (matthew.fleming at isilon.com)
>   Reviewed by:        zml, dfr
>   Approved by:        dfr (mentor)

--fLj60tP2PZ34xyqD
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkrDtxUACgkQC3+MBN1Mb4hxLwCgkNdUEoc7cNwLLUFe4zy68Qe4
zFEAoOXuU7ZABaWvR/2PbqDjxsy0lRfR
=MzlZ
-----END PGP SIGNATURE-----

--fLj60tP2PZ34xyqD--

From owner-svn-src-all@FreeBSD.ORG  Wed Sep 30 20:01:45 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25B3C106566B;
	Wed, 30 Sep 2009 20:01:45 +0000 (UTC) (envelope-from bms@FreeBSD.org)
Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com
	[66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id D273A8FC1A;
	Wed, 30 Sep 2009 20:01:44 +0000 (UTC)
Received: from compute1.internal (compute1.internal [10.202.2.41])
	by gateway1.messagingengine.com (Postfix) with ESMTP id 0696B7F5B9;
	Wed, 30 Sep 2009 15:44:14 -0400 (EDT)
Received: from heartbeat2.messagingengine.com ([10.202.2.161])
	by compute1.internal (MEProxy); Wed, 30 Sep 2009 15:44:14 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com;
	h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding;
	s=smtpout; bh=WXZHGeOR+k6H+9KFe29DiepQGwE=;
	b=p9aub6QLZ6hQuD0hGAwFfgAVtwJSq05BpkKnS4j9xZ9D8kw1tFHWOJ2uvj5NiSand53qc20ZI6+xRAcxtZQVNwX6hd1hg6R8TJuypRMAEUfsBRwPBp+IClL+rJLAu6oE8r+ViPkhsXyHdaoH6PyLyAPkTN7aSAqYcWq8/UkjY88=
X-Sasl-enc: UIeMoVvKB+HUlXyc3JcbcrFqcwig5KdskpOTGG55QiF4 1254339853
Received: from empiric.lon.incunabulum.net
	(82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254])
	by mail.messagingengine.com (Postfix) with ESMTPSA id 3A3B419F3A;
	Wed, 30 Sep 2009 15:44:13 -0400 (EDT)
Message-ID: <4AC3B50B.60806@FreeBSD.org>
Date: Wed, 30 Sep 2009 20:44:11 +0100
From: Bruce Simpson 
User-Agent: Thunderbird 2.0.0.23 (X11/20090827)
MIME-Version: 1.0
To: Zachary Loafman 
References: <200909301940.n8UJep9X024249@svn.freebsd.org>
In-Reply-To: <200909301940.n8UJep9X024249@svn.freebsd.org>
X-Enigmail-Version: 0.95.6
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r197652 - stable/7/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, 30 Sep 2009 20:01:45 -0000

Nice fix.

Timing problems are the subtlest.

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 02:06:07 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7DD781065670;
	Thu,  1 Oct 2009 02:06:07 +0000 (UTC)
	(envelope-from rpaulo@gmail.com)
Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com
	[209.85.219.209])
	by mx1.freebsd.org (Postfix) with ESMTP id 650AB8FC08;
	Thu,  1 Oct 2009 02:06:06 +0000 (UTC)
Received: by ewy5 with SMTP id 5so1221623ewy.36
	for ; Wed, 30 Sep 2009 19:06:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:subject:mime-version
	:content-type:from:in-reply-to:date:cc:content-transfer-encoding
	:message-id:references:to:x-mailer;
	bh=1AsJSJbd7un45z59OujtTRprc9bz1RsWCxu1gu14i1c=;
	b=vWkQM9PVdx0RqYdeOt9bJT4oxVJ9mv7NoB60GTOCbsojzNMi+C7zjgU0G89Uchqmb5
	hJLLEbH+bEeZPfGr2+35ifK0EbhJtgu1LusNTuCB/ROz6dvEAnyLyMGrUiuKAuw2So7i
	L+cKAG3YwLIPmxdct5vvk0MExfcXy8HQVheVM=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=ITtFpCj7kZ/n/OKN6E+iYKedBc9nmNuufFKP8gtX0y04YIceTMxHMBrWozHIOVWcx0
	dbbk0cz0d+fudWW3R9Rj431gh1dUCesiib2TEcEKVj6GU669TML6pYhsoW8BVWkWeW83
	siXFcGgWyWyBKTuOqQov92AU9FoTTi9XTqKU0=
Received: by 10.211.138.11 with SMTP id q11mr695015ebn.1.1254362765483;
	Wed, 30 Sep 2009 19:06:05 -0700 (PDT)
Received: from mac-mini.lan (bl6-144-180.dsl.telepac.pt [82.155.144.180])
	by mx.google.com with ESMTPS id 28sm671056eyg.35.2009.09.30.19.06.03
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Wed, 30 Sep 2009 19:06:03 -0700 (PDT)
Sender: Rui Paulo 
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
From: Rui Paulo 
In-Reply-To: <4AC3B02B.90703@FreeBSD.org>
Date: Thu, 1 Oct 2009 03:06:01 +0100
Content-Transfer-Encoding: 7bit
Message-Id: 
References: <200909291218.n8TCINmv085038@svn.freebsd.org>
	<558A76C2-0F8C-472F-A235-16BDAD15C634@freebsd.org>
	<4AC3B02B.90703@FreeBSD.org>
To: Doug Barton 
X-Mailer: Apple Mail (2.1076)
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: r197614 - 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, 01 Oct 2009 02:06:07 -0000

On 30 Sep 2009, at 20:23, Doug Barton wrote:

> Rui Paulo wrote:
>> On 29 Sep 2009, at 13:18, Rui Paulo wrote:
>>
>>> Author: rpaulo
>>> Date: Tue Sep 29 12:18:23 2009
>>> New Revision: 197614
>>> URL: http://svn.freebsd.org/changeset/base/197614
>>>
>>> Log:
>>> Update 802.11s mesh support to draft 3.03. This includes a revised
>>> frame
>>> format for peering and changes to the PERR frames.
>>> Note that this is incompatible with the previous code.
>>>
>>> Reviewed by:    sam
>>> Approved by:    re (kib)
>>
>>
>> Please note that, while these changes are being made very late in the
>> release process, they are necessary to keep in sync with the new  
>> draft.
>> There should be no impact on ports, mesh support is brand new to 8.0.
>
> Is it my imagination, or does GENERIC still refer to D3.0? Perhaps
> other places as well?

I'll fix it. Thanks.

--
Rui Paulo




From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 02:08:44 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4AF42106566B;
	Thu,  1 Oct 2009 02:08:43 +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 3A8C48FC14;
	Thu,  1 Oct 2009 02:08:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9128hdX033494;
	Thu, 1 Oct 2009 02:08:43 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9128hbK033492;
	Thu, 1 Oct 2009 02:08:43 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910010208.n9128hbK033492@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 1 Oct 2009 02:08: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: r197653 - in head/sys: amd64/conf i386/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, 01 Oct 2009 02:08:44 -0000

Author: rpaulo
Date: Thu Oct  1 02:08:42 2009
New Revision: 197653
URL: http://svn.freebsd.org/changeset/base/197653

Log:
  Improve 802.11s comment.
  
  Spotted by:	dougb
  MFC after:	1 day

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/i386/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Wed Sep 30 19:40:51 2009	(r197652)
+++ head/sys/amd64/conf/GENERIC	Thu Oct  1 02:08:42 2009	(r197653)
@@ -257,7 +257,7 @@ device		xe		# Xircom pccard Ethernet
 device		wlan		# 802.11 support
 options 	IEEE80211_DEBUG	# enable debug msgs
 options 	IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
-options 	IEEE80211_SUPPORT_MESH	# enable 802.11s D3.0 support
+options 	IEEE80211_SUPPORT_MESH	# enable 802.11s draft support
 device		wlan_wep	# 802.11 WEP support
 device		wlan_ccmp	# 802.11 CCMP support
 device		wlan_tkip	# 802.11 TKIP support

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Wed Sep 30 19:40:51 2009	(r197652)
+++ head/sys/i386/conf/GENERIC	Thu Oct  1 02:08:42 2009	(r197653)
@@ -269,7 +269,7 @@ device		xe		# Xircom pccard Ethernet
 device		wlan		# 802.11 support
 options 	IEEE80211_DEBUG	# enable debug msgs
 options 	IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
-options 	IEEE80211_SUPPORT_MESH	# enable 802.11s D3.0 support
+options 	IEEE80211_SUPPORT_MESH	# enable 802.11s draft support
 device		wlan_wep	# 802.11 WEP support
 device		wlan_ccmp	# 802.11 CCMP support
 device		wlan_tkip	# 802.11 TKIP support

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 02:43:51 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB18C106566B;
	Thu,  1 Oct 2009 02:43:51 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9AFD98FC0C;
	Thu,  1 Oct 2009 02:43:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n912hpah034848;
	Thu, 1 Oct 2009 02:43:51 GMT (envelope-from cokane@svn.freebsd.org)
Received: (from cokane@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n912hpSM034846;
	Thu, 1 Oct 2009 02:43:51 GMT (envelope-from cokane@svn.freebsd.org)
Message-Id: <200910010243.n912hpSM034846@svn.freebsd.org>
From: Coleman Kane 
Date: Thu, 1 Oct 2009 02:43:51 +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: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 02:43:51 -0000

Author: cokane
Date: Thu Oct  1 02:43:51 2009
New Revision: 197654
URL: http://svn.freebsd.org/changeset/base/197654

Log:
  style(9) fixes (always compare pointers to NULL)
  
  Also, the previous commit to sys/dev/if_ndis/if_ndis.c also included the
  removal of a call to ndis_setstate_80211 that is no longer needed.
  
  Submitted by:	sam
  MFC after:	3 days

Modified:
  head/sys/dev/if_ndis/if_ndis.c

Modified: head/sys/dev/if_ndis/if_ndis.c
==============================================================================
--- head/sys/dev/if_ndis/if_ndis.c	Thu Oct  1 02:08:42 2009	(r197653)
+++ head/sys/dev/if_ndis/if_ndis.c	Thu Oct  1 02:43:51 2009	(r197654)
@@ -1534,7 +1534,7 @@ ndis_inputtask(dobj, arg)
 		if (m == NULL)
 			break;
 		KeReleaseSpinLock(&sc->ndis_rxlock, irql);
-		if (sc->ndis_80211 && vap)
+		if ((sc->ndis_80211 != NULL) && (vap != NULL))
 			vap->iv_deliver_data(vap, vap->iv_bss, m);
 		else
 			(*ifp->if_input)(ifp, m);
@@ -1746,7 +1746,7 @@ ndis_ticktask(d, xsc)
 	    sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) {
 		sc->ndis_link = 1;
 		NDIS_UNLOCK(sc);
-		if (sc->ndis_80211 && vap) {
+		if ((sc->ndis_80211 != NULL) && (vap != NULL)) {
 			ndis_getstate_80211(sc);
 			ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
 		}
@@ -1758,7 +1758,7 @@ ndis_ticktask(d, xsc)
 	    sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) {
 		sc->ndis_link = 0;
 		NDIS_UNLOCK(sc);
-		if (sc->ndis_80211 && vap)
+		if ((sc->ndis_80211 != NULL) && (vap != NULL))
 			ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
 		NDIS_LOCK(sc);
 		if_link_state_change(sc->ifp, LINK_STATE_DOWN);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 08:16:47 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6AC71106568B;
	Thu,  1 Oct 2009 08:16:47 +0000 (UTC)
	(envelope-from philip@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F0B08FC15;
	Thu,  1 Oct 2009 08:16:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n918Glpd042458;
	Thu, 1 Oct 2009 08:16:47 GMT (envelope-from philip@svn.freebsd.org)
Received: (from philip@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n918GlT2042456;
	Thu, 1 Oct 2009 08:16:47 GMT (envelope-from philip@svn.freebsd.org)
Message-Id: <200910010816.n918GlT2042456@svn.freebsd.org>
From: Philip Paeps 
Date: Thu, 1 Oct 2009 08:16:47 +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: r197655 - 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, 01 Oct 2009 08:16:47 -0000

Author: philip
Date: Thu Oct  1 08:16:46 2009
New Revision: 197655
URL: http://svn.freebsd.org/changeset/base/197655

Log:
  Take thomas's commit bit into safekeeping per his request.
  
  Approved by:	core

Modified:
  svnadmin/conf/access

Modified: svnadmin/conf/access
==============================================================================
--- svnadmin/conf/access	Thu Oct  1 02:43:51 2009	(r197654)
+++ svnadmin/conf/access	Thu Oct  1 08:16:46 2009	(r197655)
@@ -209,7 +209,6 @@ suz
 syrinx
 takawata
 tanimura
-thomas
 thompsa
 ticso
 trasz

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 10:06:10 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A94D3106566B;
	Thu,  1 Oct 2009 10:06:10 +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 7B9678FC08;
	Thu,  1 Oct 2009 10:06:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91A6AjC047452;
	Thu, 1 Oct 2009 10:06:10 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91A6AFT047448;
	Thu, 1 Oct 2009 10:06:10 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910011006.n91A6AFT047448@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 1 Oct 2009 10:06: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: r197656 - in stable/8/sys: . amd64/conf
	amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica
	contrib/pf dev/xen/xenpci i386/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, 01 Oct 2009 10:06:10 -0000

Author: rpaulo
Date: Thu Oct  1 10:06:09 2009
New Revision: 197656
URL: http://svn.freebsd.org/changeset/base/197656

Log:
  MFC r197653:
    Improve 802.11s comment.
  
  Approved by:	re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/conf/GENERIC
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/i386/conf/GENERIC

Modified: stable/8/sys/amd64/conf/GENERIC
==============================================================================
--- stable/8/sys/amd64/conf/GENERIC	Thu Oct  1 08:16:46 2009	(r197655)
+++ stable/8/sys/amd64/conf/GENERIC	Thu Oct  1 10:06:09 2009	(r197656)
@@ -248,7 +248,7 @@ device		xe		# Xircom pccard Ethernet
 device		wlan		# 802.11 support
 options 	IEEE80211_DEBUG	# enable debug msgs
 options 	IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
-options 	IEEE80211_SUPPORT_MESH	# enable 802.11s D3.0 support
+options 	IEEE80211_SUPPORT_MESH	# enable 802.11s draft support
 device		wlan_wep	# 802.11 WEP support
 device		wlan_ccmp	# 802.11 CCMP support
 device		wlan_tkip	# 802.11 TKIP support

Modified: stable/8/sys/i386/conf/GENERIC
==============================================================================
--- stable/8/sys/i386/conf/GENERIC	Thu Oct  1 08:16:46 2009	(r197655)
+++ stable/8/sys/i386/conf/GENERIC	Thu Oct  1 10:06:09 2009	(r197656)
@@ -260,7 +260,7 @@ device		xe		# Xircom pccard Ethernet
 device		wlan		# 802.11 support
 options 	IEEE80211_DEBUG	# enable debug msgs
 options 	IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
-options 	IEEE80211_SUPPORT_MESH	# enable 802.11s D3.0 support
+options 	IEEE80211_SUPPORT_MESH	# enable 802.11s draft support
 device		wlan_wep	# 802.11 WEP support
 device		wlan_ccmp	# 802.11 CCMP support
 device		wlan_tkip	# 802.11 TKIP support

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 10:30:08 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6481C1065694;
	Thu,  1 Oct 2009 10:30:08 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3])
	by mx1.freebsd.org (Postfix) with ESMTP id 19E018FC1A;
	Thu,  1 Oct 2009 10:30:07 +0000 (UTC)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id D157E41C736;
	Thu,  1 Oct 2009 12:30:06 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([195.88.108.3])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id MTeDMAz3D23A; Thu,  1 Oct 2009 12:30:06 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id 3EBBC41C734; Thu,  1 Oct 2009 12:30:06 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id 325CB4448E6;
	Thu,  1 Oct 2009 10:26:32 +0000 (UTC)
Date: Thu, 1 Oct 2009 10:26:31 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Coleman Kane 
In-Reply-To: <200910010243.n912hpSM034846@svn.freebsd.org>
Message-ID: <20091001102557.E26486@maildrop.int.zabbadoz.net>
References: <200910010243.n912hpSM034846@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
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: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 10:30:08 -0000

On Thu, 1 Oct 2009, Coleman Kane wrote:

> Author: cokane
> Date: Thu Oct  1 02:43:51 2009
> New Revision: 197654
> URL: http://svn.freebsd.org/changeset/base/197654
>
> Log:
>  style(9) fixes (always compare pointers to NULL)
>
>  Also, the previous commit to sys/dev/if_ndis/if_ndis.c also included the
>  removal of a call to ndis_setstate_80211 that is no longer needed.

The problem just is that sc->ndis_80211 is an integer and this broke
the build.



>  Submitted by:	sam
>  MFC after:	3 days
>
> Modified:
>  head/sys/dev/if_ndis/if_ndis.c
>
> Modified: head/sys/dev/if_ndis/if_ndis.c
> ==============================================================================
> --- head/sys/dev/if_ndis/if_ndis.c	Thu Oct  1 02:08:42 2009	(r197653)
> +++ head/sys/dev/if_ndis/if_ndis.c	Thu Oct  1 02:43:51 2009	(r197654)
> @@ -1534,7 +1534,7 @@ ndis_inputtask(dobj, arg)
> 		if (m == NULL)
> 			break;
> 		KeReleaseSpinLock(&sc->ndis_rxlock, irql);
> -		if (sc->ndis_80211 && vap)
> +		if ((sc->ndis_80211 != NULL) && (vap != NULL))
> 			vap->iv_deliver_data(vap, vap->iv_bss, m);
> 		else
> 			(*ifp->if_input)(ifp, m);
> @@ -1746,7 +1746,7 @@ ndis_ticktask(d, xsc)
> 	    sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) {
> 		sc->ndis_link = 1;
> 		NDIS_UNLOCK(sc);
> -		if (sc->ndis_80211 && vap) {
> +		if ((sc->ndis_80211 != NULL) && (vap != NULL)) {
> 			ndis_getstate_80211(sc);
> 			ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
> 		}
> @@ -1758,7 +1758,7 @@ ndis_ticktask(d, xsc)
> 	    sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) {
> 		sc->ndis_link = 0;
> 		NDIS_UNLOCK(sc);
> -		if (sc->ndis_80211 && vap)
> +		if ((sc->ndis_80211 != NULL) && (vap != NULL))
> 			ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
> 		NDIS_LOCK(sc);
> 		if_link_state_change(sc->ifp, LINK_STATE_DOWN);
>

-- 
Bjoern A. Zeeb         It will not break if you know what you are doing.

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 10:33:52 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3DB52106566B;
	Thu,  1 Oct 2009 10:33:52 +0000 (UTC) (envelope-from des@des.no)
Received: from tim.des.no (tim.des.no [194.63.250.121])
	by mx1.freebsd.org (Postfix) with ESMTP id EF11B8FC12;
	Thu,  1 Oct 2009 10:33:51 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id ED3B26D41B;
	Thu,  1 Oct 2009 10:33:50 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id A643984503; Thu,  1 Oct 2009 12:33:50 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Coleman Kane 
References: <200910010243.n912hpSM034846@svn.freebsd.org>
Date: Thu, 01 Oct 2009 12:33:50 +0200
In-Reply-To: <200910010243.n912hpSM034846@svn.freebsd.org> (Coleman Kane's
	message of "Thu, 1 Oct 2009 02:43:51 +0000 (UTC)")
Message-ID: <86eipno12p.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix)
MIME-Version: 1.0
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: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 10:33:52 -0000

Coleman Kane  writes:
> -		if (sc->ndis_80211 && vap)
> +		if ((sc->ndis_80211 !=3D NULL) && (vap !=3D NULL))

sc->ndis_80211 is an int.  NULL is a pointer.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 10:46:23 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 01BC7106568D;
	Thu,  1 Oct 2009 10:46:23 +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 E54DD8FC15;
	Thu,  1 Oct 2009 10:46:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91AkMgD048440;
	Thu, 1 Oct 2009 10:46:22 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91AkMqI048438;
	Thu, 1 Oct 2009 10:46:22 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200910011046.n91AkMqI048438@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 1 Oct 2009 10:46: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: r197657 - 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, 01 Oct 2009 10:46:23 -0000

Author: nyan
Date: Thu Oct  1 10:46:22 2009
New Revision: 197657
URL: http://svn.freebsd.org/changeset/base/197657

Log:
  MFi386: revision 197653
  
    Improve 802.11s comment.
  
  MFC after:	1 day

Modified:
  head/sys/pc98/conf/GENERIC

Modified: head/sys/pc98/conf/GENERIC
==============================================================================
--- head/sys/pc98/conf/GENERIC	Thu Oct  1 10:06:09 2009	(r197656)
+++ head/sys/pc98/conf/GENERIC	Thu Oct  1 10:46:22 2009	(r197657)
@@ -223,7 +223,7 @@ device		xe		# Xircom pccard Ethernet
 #device		wlan		# 802.11 support
 #options 	IEEE80211_DEBUG	# enable debug msgs
 #options 	IEEE80211_AMPDU_AGE	# age frames in AMPDU reorder q's
-#options 	IEEE80211_SUPPORT_MESH	# enable 802.11s D3.0 support
+#options 	IEEE80211_SUPPORT_MESH	# enable 802.11s draft support
 #device		wlan_wep	# 802.11 WEP support
 #device		wlan_ccmp	# 802.11 CCMP support
 #device		wlan_tkip	# 802.11 TKIP support

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 10:53:13 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0EF131065670;
	Thu,  1 Oct 2009 10:53:13 +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 F2C3D8FC18;
	Thu,  1 Oct 2009 10:53:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91ArCai048617;
	Thu, 1 Oct 2009 10:53:12 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91ArCLW048615;
	Thu, 1 Oct 2009 10:53:12 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200910011053.n91ArCLW048615@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 1 Oct 2009 10:53: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: r197658 - 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: Thu, 01 Oct 2009 10:53:13 -0000

Author: avg
Date: Thu Oct  1 10:53:12 2009
New Revision: 197658
URL: http://svn.freebsd.org/changeset/base/197658

Log:
  print machine in kernel boot version string
  
  Discussed with:	gavin, kib, jhb
  PR:		kern/126926
  MFC after:	2 weeks

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==============================================================================
--- head/sys/kern/init_main.c	Thu Oct  1 10:46:22 2009	(r197657)
+++ head/sys/kern/init_main.c	Thu Oct  1 10:53:12 2009	(r197658)
@@ -288,11 +288,24 @@ print_caddr_t(void *data)
 {
 	printf("%s", (char *)data);
 }
+
+static void
+print_version(void *data __unused)
+{
+	int len;
+
+	/* Strip a trailing newline from version. */
+	len = strlen(version);
+	while (len > 0 && version[len - 1] == '\n')
+		len--;
+	printf("%.*s %s\n", len, version, machine);
+}
+
 SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t,
     copyright);
 SYSINIT(trademark, SI_SUB_COPYRIGHT, SI_ORDER_SECOND, print_caddr_t,
     trademark);
-SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, print_caddr_t, version);
+SYSINIT(version, SI_SUB_COPYRIGHT, SI_ORDER_THIRD, print_version, NULL);
 
 #ifdef WITNESS
 static char wit_warn[] =

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 11:52:07 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1B8C1065679;
	Thu,  1 Oct 2009 11:52:07 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 730E08FC18;
	Thu,  1 Oct 2009 11:52:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91Bq7To050050;
	Thu, 1 Oct 2009 11:52:07 GMT (envelope-from cokane@svn.freebsd.org)
Received: (from cokane@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91Bq7lt050048;
	Thu, 1 Oct 2009 11:52:07 GMT (envelope-from cokane@svn.freebsd.org)
Message-Id: <200910011152.n91Bq7lt050048@svn.freebsd.org>
From: Coleman Kane 
Date: Thu, 1 Oct 2009 11:52: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: r197659 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 11:52:07 -0000

Author: cokane
Date: Thu Oct  1 11:52:06 2009
New Revision: 197659
URL: http://svn.freebsd.org/changeset/base/197659

Log:
  Fix a bad use of NULL instead of zero for int comparison. Sorry for the
  breakage.
  
  Submitted by:	bz, des, onemda
  MFC after:	3 days

Modified:
  head/sys/dev/if_ndis/if_ndis.c

Modified: head/sys/dev/if_ndis/if_ndis.c
==============================================================================
--- head/sys/dev/if_ndis/if_ndis.c	Thu Oct  1 10:53:12 2009	(r197658)
+++ head/sys/dev/if_ndis/if_ndis.c	Thu Oct  1 11:52:06 2009	(r197659)
@@ -1534,7 +1534,7 @@ ndis_inputtask(dobj, arg)
 		if (m == NULL)
 			break;
 		KeReleaseSpinLock(&sc->ndis_rxlock, irql);
-		if ((sc->ndis_80211 != NULL) && (vap != NULL))
+		if ((sc->ndis_80211 != 0) && (vap != NULL))
 			vap->iv_deliver_data(vap, vap->iv_bss, m);
 		else
 			(*ifp->if_input)(ifp, m);
@@ -1746,7 +1746,7 @@ ndis_ticktask(d, xsc)
 	    sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) {
 		sc->ndis_link = 1;
 		NDIS_UNLOCK(sc);
-		if ((sc->ndis_80211 != NULL) && (vap != NULL)) {
+		if ((sc->ndis_80211 != 0) && (vap != NULL)) {
 			ndis_getstate_80211(sc);
 			ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
 		}
@@ -1758,7 +1758,7 @@ ndis_ticktask(d, xsc)
 	    sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) {
 		sc->ndis_link = 0;
 		NDIS_UNLOCK(sc);
-		if ((sc->ndis_80211 != NULL) && (vap != NULL))
+		if ((sc->ndis_80211 != 0) && (vap != NULL))
 			ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
 		NDIS_LOCK(sc);
 		if_link_state_change(sc->ifp, LINK_STATE_DOWN);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 12:06:56 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 53D25106566B;
	Thu,  1 Oct 2009 12:06:56 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.104.116])
	by mx1.freebsd.org (Postfix) with ESMTP id 097248FC14;
	Thu,  1 Oct 2009 12:06:55 +0000 (UTC)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.69) (envelope-from )
	id 1MtKQu-0001hd-TE; Thu, 01 Oct 2009 08:06:52 -0400
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id 6D04EB84D;
	Thu,  1 Oct 2009 16:06:52 +0400 (MSD)
Received: by hades.panopticon (Postfix, from userid 1000)
	id A04CCB849; Thu,  1 Oct 2009 16:06:52 +0400 (MSD)
Date: Thu, 1 Oct 2009 16:06:52 +0400
From: Dmitry Marakasov 
To: Marcel Moolenaar 
Message-ID: <20091001120652.GI50565@hades.panopticon>
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
	<20090929145447.GA82539@hades.panopticon>
	<20090929235146.GA64567@hades.panopticon>
	
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar ,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r197608 - 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: Thu, 01 Oct 2009 12:06:56 -0000

* Marcel Moolenaar (xcllnt@mac.com) wrote:

> >> Seconded. I've seen a report of geom_part_ebr unable to detect
> >> partitions which were actually there. Will inquiry the reporter if
> >> this change solved the problem.
> >
> > Seems like it hasn't. Here's the first sector from that partition:
> 
> I'll see about checking the partition table more rigorously
> so that we can eliminate the check for the unused space.
> 
> With what tool was this created?

Dunno. I've pointed the person who had that problem to this thread.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 12:46:58 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5AE0F1065670;
	Thu,  1 Oct 2009 12:46:58 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BD7E8FC26;
	Thu,  1 Oct 2009 12:46:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91Ckw8l051356;
	Thu, 1 Oct 2009 12:46:58 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91Ckw96051354;
	Thu, 1 Oct 2009 12:46:58 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200910011246.n91Ckw96051354@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 1 Oct 2009 12:46:58 +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: r197660 - 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: Thu, 01 Oct 2009 12:46:58 -0000

Author: kib
Date: Thu Oct  1 12:46:58 2009
New Revision: 197660
URL: http://svn.freebsd.org/changeset/base/197660

Log:
  Fix typo.
  
  MFC after:	3 days

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Thu Oct  1 11:52:06 2009	(r197659)
+++ head/sys/kern/kern_sig.c	Thu Oct  1 12:46:58 2009	(r197660)
@@ -1892,7 +1892,7 @@ sigtd(struct proc *p, int sig, int prop)
 
 	/*
 	 * Check if current thread can handle the signal without
-	 * switching conetxt to another thread.
+	 * switching context to another thread.
 	 */
 	if (curproc == p && !SIGISMEMBER(curthread->td_sigmask, sig))
 		return (curthread);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 12:48:35 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF27E106566B;
	Thu,  1 Oct 2009 12:48:35 +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 E01F28FC08;
	Thu,  1 Oct 2009 12:48:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91CmZMl051433;
	Thu, 1 Oct 2009 12:48:35 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91CmZBH051431;
	Thu, 1 Oct 2009 12:48:35 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200910011248.n91CmZBH051431@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 1 Oct 2009 12: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: r197661 - 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: Thu, 01 Oct 2009 12:48:36 -0000

Author: kib
Date: Thu Oct  1 12:48:35 2009
New Revision: 197661
URL: http://svn.freebsd.org/changeset/base/197661

Log:
  Move the annotation for vm_map_startup() immediately before the function.
  
  MFC after:	3 days

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Thu Oct  1 12:46:58 2009	(r197660)
+++ head/sys/vm/vm_map.c	Thu Oct  1 12:48:35 2009	(r197661)
@@ -116,22 +116,6 @@ __FBSDID("$FreeBSD$");
  *	another, and then marking both regions as copy-on-write.
  */
 
-/*
- *	vm_map_startup:
- *
- *	Initialize the vm_map module.  Must be called before
- *	any other vm_map routines.
- *
- *	Map and entry structures are allocated from the general
- *	purpose memory pool with some exceptions:
- *
- *	- The kernel map and kmem submap are allocated statically.
- *	- Kernel map entries are allocated out of a static pool.
- *
- *	These restrictions are necessary since malloc() uses the
- *	maps and requires map entries.
- */
-
 static struct mtx map_sleep_mtx;
 static uma_zone_t mapentzone;
 static uma_zone_t kmapentzone;
@@ -176,6 +160,22 @@ static void vmspace_zdtor(void *mem, int
 			start = end;			\
 		}
 
+/*
+ *	vm_map_startup:
+ *
+ *	Initialize the vm_map module.  Must be called before
+ *	any other vm_map routines.
+ *
+ *	Map and entry structures are allocated from the general
+ *	purpose memory pool with some exceptions:
+ *
+ *	- The kernel map and kmem submap are allocated statically.
+ *	- Kernel map entries are allocated out of a static pool.
+ *
+ *	These restrictions are necessary since malloc() uses the
+ *	maps and requires map entries.
+ */
+
 void
 vm_map_startup(void)
 {

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 12:50:27 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B80211065698;
	Thu,  1 Oct 2009 12:50: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 A8F4C8FC28;
	Thu,  1 Oct 2009 12:50:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91CoQax051513;
	Thu, 1 Oct 2009 12:50:26 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91CoQ5G051511;
	Thu, 1 Oct 2009 12:50:26 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200910011250.n91CoQ5G051511@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 1 Oct 2009 12:50: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: r197662 - 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: Thu, 01 Oct 2009 12:50:27 -0000

Author: kib
Date: Thu Oct  1 12:50:26 2009
New Revision: 197662
URL: http://svn.freebsd.org/changeset/base/197662

Log:
  Do not dereference vp->v_mount without holding vnode lock and checking
  that the vnode is not reclaimed.
  
  Noted by:	Igor Sysoev 
  MFC after:	1 week

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Thu Oct  1 12:48:35 2009	(r197661)
+++ head/sys/kern/uipc_syscalls.c	Thu Oct  1 12:50:26 2009	(r197662)
@@ -2086,9 +2086,11 @@ retry_space:
 				/*
 				 * Get the page from backing store.
 				 */
-				bsize = vp->v_mount->mnt_stat.f_iosize;
 				vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-				vn_lock(vp, LK_SHARED | LK_RETRY);
+				error = vn_lock(vp, LK_SHARED);
+				if (error != 0)
+					goto after_read;
+				bsize = vp->v_mount->mnt_stat.f_iosize;
 
 				/*
 				 * XXXMAC: Because we don't have fp->f_cred
@@ -2101,6 +2103,7 @@ retry_space:
 				    IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT),
 				    td->td_ucred, NOCRED, &resid, td);
 				VOP_UNLOCK(vp, 0);
+			after_read:
 				VFS_UNLOCK_GIANT(vfslocked);
 				VM_OBJECT_LOCK(obj);
 				vm_page_io_finish(pg);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 12:52:49 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1E216106568D;
	Thu,  1 Oct 2009 12:52: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 0EEF28FC1F;
	Thu,  1 Oct 2009 12:52:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91CqmkH051602;
	Thu, 1 Oct 2009 12:52:48 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91Cqmlb051599;
	Thu, 1 Oct 2009 12:52:48 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200910011252.n91Cqmlb051599@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 1 Oct 2009 12:52: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: r197663 - in head/sys: amd64/amd64 i386/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: Thu, 01 Oct 2009 12:52:49 -0000

Author: kib
Date: Thu Oct  1 12:52:48 2009
New Revision: 197663
URL: http://svn.freebsd.org/changeset/base/197663

Log:
  As a workaround, for Intel CPUs, do not use CLFLUSH in
  pmap_invalidate_cache_range() when self-snoop is apparently not reported
  in cpu features. We get a reserved trap when clflushing APIC registers
  window.
  
  XEN in full system virtualization mode removes self-snoop from CPU
  features, making this a problem.
  
  Tested by:	csjp
  Reviewed by:	alc
  MFC after:	3 days

Modified:
  head/sys/amd64/amd64/initcpu.c
  head/sys/i386/i386/initcpu.c

Modified: head/sys/amd64/amd64/initcpu.c
==============================================================================
--- head/sys/amd64/amd64/initcpu.c	Thu Oct  1 12:50:26 2009	(r197662)
+++ head/sys/amd64/amd64/initcpu.c	Thu Oct  1 12:52:48 2009	(r197663)
@@ -165,4 +165,10 @@ initializecpu(void)
 	 */
 	if ((cpu_feature & CPUID_CLFSH) != 0)
 		cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8;
+	/*
+	 * XXXKIB: (temporary) hack to work around traps generated when
+	 * CLFLUSHing APIC registers window.
+	 */
+	if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS))
+		cpu_feature &= ~CPUID_CLFSH;
 }

Modified: head/sys/i386/i386/initcpu.c
==============================================================================
--- head/sys/i386/i386/initcpu.c	Thu Oct  1 12:50:26 2009	(r197662)
+++ head/sys/i386/i386/initcpu.c	Thu Oct  1 12:52:48 2009	(r197663)
@@ -717,6 +717,12 @@ initializecpu(void)
 	 */
 	if ((cpu_feature & CPUID_CLFSH) != 0)
 		cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8;
+	/*
+	 * XXXKIB: (temporary) hack to work around traps generated when
+	 * CLFLUSHing APIC registers window.
+	 */
+	if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS))
+		cpu_feature &= ~CPUID_CLFSH;
 
 #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE)
 	/*

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 13:11:46 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CCEE2106568B;
	Thu,  1 Oct 2009 13:11:46 +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 A148A8FC17;
	Thu,  1 Oct 2009 13:11:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91DBkBd052253;
	Thu, 1 Oct 2009 13:11:46 GMT (envelope-from jamie@svn.freebsd.org)
Received: (from jamie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91DBkOf052250;
	Thu, 1 Oct 2009 13:11:46 GMT (envelope-from jamie@svn.freebsd.org)
Message-Id: <200910011311.n91DBkOf052250@svn.freebsd.org>
From: Jamie Gritton 
Date: Thu, 1 Oct 2009 13:11: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: r197667 - in stable/8/sys: . amd64/include/xen
	cddl/contrib/opensolaris contrib/dev/acpica contrib/pf
	dev/xen/xenpci kern rpc/rpcsec_gss
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 13:11:46 -0000

Author: jamie
Date: Thu Oct  1 13:11:45 2009
New Revision: 197667
URL: http://svn.freebsd.org/changeset/base/197667

Log:
  MFC r197581, r197583, r197584:
  
    Set the prison in NFS anon and GSS SVC creds.
  
  Reviewed by:	marcel
  Approved by:	re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/kern/vfs_export.c
  stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c

Modified: stable/8/sys/kern/vfs_export.c
==============================================================================
--- stable/8/sys/kern/vfs_export.c	Thu Oct  1 13:03:17 2009	(r197666)
+++ stable/8/sys/kern/vfs_export.c	Thu Oct  1 13:11:45 2009	(r197667)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -122,6 +123,8 @@ vfs_hang_addrlist(struct mount *mp, stru
 		np->netc_anon->cr_uid = argp->ex_anon.cr_uid;
 		crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups,
 		    argp->ex_anon.cr_groups);
+		np->netc_anon->cr_prison = &prison0;
+		prison_hold(np->netc_anon->cr_prison);
 		np->netc_numsecflavors = argp->ex_numsecflavors;
 		bcopy(argp->ex_secflavors, np->netc_secflavors,
 		    sizeof(np->netc_secflavors));
@@ -206,6 +209,8 @@ vfs_hang_addrlist(struct mount *mp, stru
 	np->netc_anon->cr_uid = argp->ex_anon.cr_uid;
 	crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups,
 	    np->netc_anon->cr_groups);
+	np->netc_anon->cr_prison = &prison0;
+	prison_hold(np->netc_anon->cr_prison);
 	np->netc_numsecflavors = argp->ex_numsecflavors;
 	bcopy(argp->ex_secflavors, np->netc_secflavors,
 	    sizeof(np->netc_secflavors));

Modified: stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==============================================================================
--- stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c	Thu Oct  1 13:03:17 2009	(r197666)
+++ stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c	Thu Oct  1 13:11:45 2009	(r197667)
@@ -449,6 +449,8 @@ rpc_gss_svc_getcred(struct svc_req *req,
 	cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid;
 	cr->cr_rgid = cr->cr_svgid = uc->gid;
 	crsetgroups(cr, uc->gidlen, uc->gidlist);
+	cr->cr_prison = &prison0;
+	prison_hold(cr->cr_prison);
 	*crp = crhold(cr);
 
 	return (TRUE);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 13:13:08 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ACA28106568B
	for ; Thu,  1 Oct 2009 13:13:08 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from mail-out1.fuse.net (mail-out1.fuse.net [216.68.8.175])
	by mx1.freebsd.org (Postfix) with ESMTP id 6EF988FC16
	for ; Thu,  1 Oct 2009 13:13:08 +0000 (UTC)
X-CNFS-Analysis: v=1.1 cv=Jf3tspjE8XI4z6saXnuFbjgHz4WKruKDsdWNlYDB8z0= c=1
	sm=0 a=YYkPiygOjqcA:10 a=6I5d2MoRAAAA:8
	a=AAr3Z61ZW07-4kdbiQEA:9 a=OFa2qiRyNEw8OjCMMmVQ2D5uWT4A:4
	a=SV7veod9ZcQA:10 a=O5IIhqKZ-maHpabVsXAA:9
	a=j0dHktmAlzG96SuhTk7X2PjxDUQA:4 a=LkYvsgB9u1MH7Ao0BLhsLg==:117
X-CM-Score: 0
X-Scanned-by: Cloudmark Authority Engine
Authentication-Results: ecout1 smtp.mail=cokane@FreeBSD.org; spf=softfail
Received-SPF: softfail (ecout1: transitional domain FreeBSD.org does not
	designate 74.215.227.9 as permitted sender)
Received: from [74.215.227.9] ([74.215.227.9:50208] helo=mail.colemankane.org)
	by ecout1 (envelope-from )
	(ecelerity 2.2.2.43 r()) with ESMTP
	id 9A/56-02412-047A4CA4; Thu, 01 Oct 2009 08:57:37 -0400
Received: from [172.20.0.76] (rrcs-96-11-231-210.central.biz.rr.com
	[96.11.231.210])
	by mail.colemankane.org (Postfix) with ESMTPSA id 4D1EE1143E;
	Thu,  1 Oct 2009 10:02:33 -0400 (EDT)
From: Coleman Kane 
To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= ,
	"Bjoern A. Zeeb" 
In-Reply-To: <86eipno12p.fsf@ds4.des.no>
References: <200910010243.n912hpSM034846@svn.freebsd.org>
	<86eipno12p.fsf@ds4.des.no>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-Y/dW7pGoxMRHIIDsRAQh"
Organization: FreeBSD Project
Date: Thu, 01 Oct 2009 08:56:57 -0400
Message-Id: <1254401817.4255.14.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port 
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 13:13:08 -0000


--=-Y/dW7pGoxMRHIIDsRAQh
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, 2009-10-01 at 12:33 +0200, Dag-Erling Sm=C3=B8rgrav wrote:
> Coleman Kane  writes:
> > -		if (sc->ndis_80211 && vap)
> > +		if ((sc->ndis_80211 !=3D NULL) && (vap !=3D NULL))
>=20
> sc->ndis_80211 is an int.  NULL is a pointer.
>=20
> DES

Thanks, fix committed... I know style(9) says I should have not bothered
with the commit, but the assume-that-zero-is-false logic seemed
egregious enough at the time to warrant correcting it.

I just corrected it improperly in my haste. Enjoy being able to
buildkernel again. I'll be sitting in the corner.

--=20
Coleman Kane


--=-Y/dW7pGoxMRHIIDsRAQh
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEABECAAYFAkrEpxkACgkQcMSxQcXat5eI4gCfSHbYhuNGf1ODEmDWyLVDy1R1
qGIAn2uu7dzSTuNFx5/EsIVSdhp4rxZ9
=Eu+W
-----END PGP SIGNATURE-----

--=-Y/dW7pGoxMRHIIDsRAQh--


From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 13:21:36 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D0A79106568F;
	Thu,  1 Oct 2009 13:21:36 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-fx0-f222.google.com (mail-fx0-f222.google.com
	[209.85.220.222])
	by mx1.freebsd.org (Postfix) with ESMTP id E3C4B8FC15;
	Thu,  1 Oct 2009 13:21:35 +0000 (UTC)
Received: by fxm22 with SMTP id 22so129721fxm.36
	for ; Thu, 01 Oct 2009 06:21:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type; bh=XkSOXWfuEm4u1sOMwrPwvLGt7eAX+OEtyUtLObuxMZU=;
	b=DAMXioZJ8IDiBKV5o7mjAF8WPoxRRNvfb0TS6WHmZvKyv5QJ/QkSVuX9V6sQmEJFM+
	8NjfmWNpmd59UXQ52T6BV1c3lnEXRrLUXIP29KuKsiut5n7Z7/1LOA9YiVom3YKtBftD
	fRgsyt0fXsdiQva2IwCoqAYnN6H75v+PppCLc=
DomainKey-Signature: a=rsa-sha1; c=nofws; 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;
	b=AvnJBWNomNWi3KEOmunpNcA9LRogBF/ZDHpiJvH++B8+EIGXY7gh7Ou8RDmXtKnblI
	0nFBnPg0PDtzTphR+h36lUg/0qaLo3Wm4yM/gqV4UNGjTlEsUMVo7TabfHqM6bOI1lOJ
	nHDV8NKYMDjd47KFkluRdFrb265BBUJELT73g=
MIME-Version: 1.0
Sender: asmrookie@gmail.com
Received: by 10.223.3.137 with SMTP id 9mr332980fan.45.1254403294882; Thu, 01 
	Oct 2009 06:21:34 -0700 (PDT)
In-Reply-To: 
References: <200909301326.n8UDQVB1016396@svn.freebsd.org>
	
Date: Thu, 1 Oct 2009 15:21:34 +0200
X-Google-Sender-Auth: 3e6186589986e703
Message-ID: <3bbf2fe10910010621u72d0f692h8f9c4a783667253d@mail.gmail.com>
From: Attilio Rao 
To: Robert Watson 
Content-Type: text/plain; charset=UTF-8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r197643 - 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: Thu, 01 Oct 2009 13:21:36 -0000

2009/9/30 Robert Watson :
> On Wed, 30 Sep 2009, Attilio Rao wrote:
>
>>  When releasing a read/shared lock we need to use a write memory barrier
>>  in order to avoid, on architectures which doesn't have strong ordered
>>  writes, CPU instructions reordering.
>
> Hi Attilio (Fabio, et al),
>
> Nice catch!  Are we aware of specific reported problems that can be laid at
> the feet of this bug, or was this more of a "wait a moment, shouldn't there
> be a barrier there?".  Could you comment on the scope of this problem across
> architectures we support?

A possible problem related to that would be MD specific and not on
ia32/amd64 because there the barriers and simple atomics are the same.
Given that sun4v suffers of serveral other problems, that MIPS has no
SMP support, you would find it only for arm, ia64 and sparc
eventually. Thus I'm not aware of any problem which can be reconducted
to that.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 13:41:39 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67949106566B;
	Thu,  1 Oct 2009 13:41:39 +0000 (UTC)
	(envelope-from stas@FreeBSD.org)
Received: from mx0.deglitch.com (backbone.deglitch.com
	[IPv6:2001:16d8:fffb:4::abba])
	by mx1.freebsd.org (Postfix) with ESMTP id 0FD438FC08;
	Thu,  1 Oct 2009 13:41:39 +0000 (UTC)
Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227])
	by mx0.deglitch.com (Postfix) with ESMTPSA id E9E618FC45;
	Thu,  1 Oct 2009 17:41:35 +0400 (MSD)
Date: Thu, 1 Oct 2009 17:41:30 +0400
From: Stanislav Sedov 
To: Attilio Rao 
Message-Id: <20091001174130.0d3bec21.stas@FreeBSD.org>
In-Reply-To: <3bbf2fe10910010621u72d0f692h8f9c4a783667253d@mail.gmail.com>
References: <200909301326.n8UDQVB1016396@svn.freebsd.org>
	
	<3bbf2fe10910010621u72d0f692h8f9c4a783667253d@mail.gmail.com>
Organization: The FreeBSD Project
X-Mailer: carrier-pigeon
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature";
	micalg="PGP-SHA1";
	boundary="Signature=_Thu__1_Oct_2009_17_41_30_+0400_z.P.0x57+AK3ERcD"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Robert Watson 
Subject: Re: svn commit: r197643 - 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: Thu, 01 Oct 2009 13:41:39 -0000

--Signature=_Thu__1_Oct_2009_17_41_30_+0400_z.P.0x57+AK3ERcD
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, 1 Oct 2009 15:21:34 +0200
Attilio Rao  mentioned:

> 2009/9/30 Robert Watson :
> > On Wed, 30 Sep 2009, Attilio Rao wrote:
> >
> >>  When releasing a read/shared lock we need to use a write memory barri=
er
> >>  in order to avoid, on architectures which doesn't have strong ordered
> >>  writes, CPU instructions reordering.
> >
> > Hi Attilio (Fabio, et al),
> >
> > Nice catch!  Are we aware of specific reported problems that can be lai=
d at
> > the feet of this bug, or was this more of a "wait a moment, shouldn't t=
here
> > be a barrier there?".  Could you comment on the scope of this problem a=
cross
> > architectures we support?
>=20
> A possible problem related to that would be MD specific and not on
> ia32/amd64 because there the barriers and simple atomics are the same.
> Given that sun4v suffers of serveral other problems, that MIPS has no
> SMP support, you would find it only for arm, ia64 and sparc
> eventually. Thus I'm not aware of any problem which can be reconducted
> to that.
>=20

Actually, MIPS is going to grow SMP support really soon, and ARM cpus
do not do reordering until ARMv7 afaik.  So this should not result in
any real problems on ARM too.

OTOH, I suspect powerpc may be affected.  I'm not sure if any of the models
we support perform OOO, though.

--=20
Stanislav Sedov
ST4096-RIPE

--Signature=_Thu__1_Oct_2009_17_41_30_+0400_z.P.0x57+AK3ERcD
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----

iQIcBAEBAgAGBQJKxLGOAAoJEKN82nOYvCd0QGgQAJJFAhgZf49ily8LdHjGVnQF
WkKOjVanvC3TGbNSaFzc4+qGZZHcfmjqCXlST0OY2szEFyA7G4kQLwuAfWZeYUJ2
x2qYzgctyc/TqsPywsELmUqUnoIeMsQ4sp9lbWMEOTQ8WtXF44y+vkP/OJt42rX4
q3cNIQz+RLYYrBUMIRUweCCJxMpt0FS2RjEE0nM0SMHJ3mmgpOFqpN4XyDbyHZ7D
sYCJXF8bn4NyQy700qyJ8+EXcSyikTsAOJIII4Jtjw5aYb0Wvt9dZhRMHKQ+lxk0
VXN4hI+O+YzYM0Pl1sNDPo9nZd5hhQnF+QoCdwB2AjRi1b6D8UyjJvN1rY5NCPuL
pcYqIRXJ5iQL8PiXTe7lKe+ilV8739BTcw7BPC0NYj1gYjdE/9j1iOraiJhFycLG
/48ooT/tdQIB9drID5ktdRz3lq86Q3APn8qJw+D1UHq+0uEm/pZh7uAA7XlOQEl7
yp8QnH1I3ENCO7V0j340PDKVyt6fd8HDMkQ5MmeeaTFxPp+casxaIAZ7YRCYi+07
G66Py2IiecD/4LcI/qunqX+UugPUEzLvaopdeht5LzOkv+BamEJ0xefmQeZ0Z7GH
qGVHiKC7ppF6AmUBgyhxfXTEhPZeHe90oxLL0TQzoOtTcae4K3mweN1WR0ao3qe7
81Kmeu/SxvGKiOLx3LYZ
=caMA
-----END PGP SIGNATURE-----

--Signature=_Thu__1_Oct_2009_17_41_30_+0400_z.P.0x57+AK3ERcD--

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 13:56:09 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 28AF5106568D;
	Thu,  1 Oct 2009 13:56:09 +0000 (UTC)
	(envelope-from raj@semihalf.com)
Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109])
	by mx1.freebsd.org (Postfix) with ESMTP id C099B8FC24;
	Thu,  1 Oct 2009 13:56:08 +0000 (UTC)
Received: from localhost (unknown [213.17.239.109])
	by smtp.semihalf.com (Postfix) with ESMTP id 1C4D0C4278;
	Thu,  1 Oct 2009 15:55:20 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at semihalf.com
Received: from smtp.semihalf.com ([213.17.239.109])
	by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new,
	port 10024)
	with ESMTP id YeZ-jCX4Y1we; Thu,  1 Oct 2009 15:55:19 +0200 (CEST)
Received: from [10.0.0.34] (cardhu.semihalf.com [213.17.239.108])
	by smtp.semihalf.com (Postfix) with ESMTPSA id 12CBDC4277;
	Thu,  1 Oct 2009 15:55:19 +0200 (CEST)
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
From: Rafal Jaworowski 
In-Reply-To: <20091001174130.0d3bec21.stas@FreeBSD.org>
Date: Thu, 1 Oct 2009 15:56:06 +0200
Content-Transfer-Encoding: 7bit
Message-Id: <2B51434B-9A1D-4711-9648-1A49B125C785@semihalf.com>
References: <200909301326.n8UDQVB1016396@svn.freebsd.org>
	
	<3bbf2fe10910010621u72d0f692h8f9c4a783667253d@mail.gmail.com>
	<20091001174130.0d3bec21.stas@FreeBSD.org>
To: Stanislav Sedov 
X-Mailer: Apple Mail (2.1076)
Cc: Attilio Rao , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	Robert Watson 
Subject: Re: svn commit: r197643 - 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: Thu, 01 Oct 2009 13:56:09 -0000


On 2009-10-01, at 15:41, Stanislav Sedov wrote:

> On Thu, 1 Oct 2009 15:21:34 +0200
> Attilio Rao  mentioned:
>
>> 2009/9/30 Robert Watson :
>>> On Wed, 30 Sep 2009, Attilio Rao wrote:
>>>
>>>> When releasing a read/shared lock we need to use a write memory  
>>>> barrier
>>>> in order to avoid, on architectures which doesn't have strong  
>>>> ordered
>>>> writes, CPU instructions reordering.
>>>
>>> Hi Attilio (Fabio, et al),
>>>
>>> Nice catch!  Are we aware of specific reported problems that can  
>>> be laid at
>>> the feet of this bug, or was this more of a "wait a moment,  
>>> shouldn't there
>>> be a barrier there?".  Could you comment on the scope of this  
>>> problem across
>>> architectures we support?
>>
>> A possible problem related to that would be MD specific and not on
>> ia32/amd64 because there the barriers and simple atomics are the  
>> same.
>> Given that sun4v suffers of serveral other problems, that MIPS has no
>> SMP support, you would find it only for arm, ia64 and sparc
>> eventually. Thus I'm not aware of any problem which can be  
>> reconducted
>> to that.
>>
>
> Actually, MIPS is going to grow SMP support really soon, and ARM cpus
> do not do reordering until ARMv7 afaik.  So this should not result in
> any real problems on ARM too.

Even past generation ARM can do out-of-order execution: see Marvell  
Feroceon cores which are v5 ISA compatible, although their internal  
microarchitecture has extended features like this.

> OTOH, I suspect powerpc may be affected.  I'm not sure if any of the  
> models
> we support perform OOO, though.

PowerPC is inherently OOOE.

Rafal


From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 14:03:22 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 882FA1065693;
	Thu,  1 Oct 2009 14:03:22 +0000 (UTC) (envelope-from des@des.no)
Received: from tim.des.no (tim.des.no [194.63.250.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 466778FC15;
	Thu,  1 Oct 2009 14:03:22 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 719C16D41B;
	Thu,  1 Oct 2009 14:03:20 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 5150F844E4; Thu,  1 Oct 2009 16:03:20 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Coleman Kane 
References: <200910010243.n912hpSM034846@svn.freebsd.org>
	<86eipno12p.fsf@ds4.des.no> <1254401817.4255.14.camel@localhost>
Date: Thu, 01 Oct 2009 16:03:20 +0200
In-Reply-To: <1254401817.4255.14.camel@localhost> (Coleman Kane's message of
	"Thu, 01 Oct 2009 08:56:57 -0400")
Message-ID: <86ab0bnrdj.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	"Bjoern A. Zeeb" , src-committers@freebsd.org
Subject: Re: svn commit: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 14:03:22 -0000

Coleman Kane  writes:
> Thanks, fix committed... I know style(9) says I should have not bothered
> with the commit, but the assume-that-zero-is-false logic seemed
> egregious enough at the time to warrant correcting it.

Depends.  Is ndis_80211 purely a boolean value?  If yes, it should
probably be a bit field; if no, style(9) clearly says that you should
use an explicit comparison.

(a quick perusal of the source says it isn't, so an explicit comparison
is required)

> I just corrected it improperly in my haste. Enjoy being able to
> buildkernel again. I'll be sitting in the corner.

Don't worry, you'll be in good company there :)

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 14:36:15 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 724251065676;
	Thu,  1 Oct 2009 14:36:15 +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 E6DE38FC12;
	Thu,  1 Oct 2009 14:36:14 +0000 (UTC)
Received: from c122-107-125-150.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-150.carlnfd1.nsw.optusnet.com.au [122.107.125.150])
	by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n91Ea6A1015650
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Oct 2009 00:36:09 +1000
Date: Fri, 2 Oct 2009 00:36:06 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
In-Reply-To: <86eipno12p.fsf@ds4.des.no>
Message-ID: <20091002002534.D21507@delplex.bde.org>
References: <200910010243.n912hpSM034846@svn.freebsd.org>
	<86eipno12p.fsf@ds4.des.no>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="0-1094142715-1254407766=:21507"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Coleman Kane 
Subject: Re: svn commit: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 14:36:15 -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-1094142715-1254407766=:21507
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Thu, 1 Oct 2009, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote:

> Coleman Kane  writes:
>> -=09=09if (sc->ndis_80211 && vap)
>> +=09=09if ((sc->ndis_80211 !=3D NULL) && (vap !=3D NULL))
>
> sc->ndis_80211 is an int.  NULL is a pointer.

Also, the number of style bugs was doubled on (almost?) every changed line
by adding 2 sets of unnecessary parentheses.

Bruce
--0-1094142715-1254407766=:21507--

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 14:42:55 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC7BB1065694;
	Thu,  1 Oct 2009 14:42:55 +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 AA6F88FC0A;
	Thu,  1 Oct 2009 14:42:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91Egtfv054379;
	Thu, 1 Oct 2009 14:42:55 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91Egt6A054377;
	Thu, 1 Oct 2009 14:42:55 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200910011442.n91Egt6A054377@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 1 Oct 2009 14:42: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: r197669 - in stable/8/sys: . amd64/include/xen
	cddl/contrib/opensolaris contrib/dev/acpica contrib/pf
	dev/xen/xenpci modules/nfslockd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 14:42:55 -0000

Author: nyan
Date: Thu Oct  1 14:42:55 2009
New Revision: 197669
URL: http://svn.freebsd.org/changeset/base/197669

Log:
  MFC: revision 197535
  
    Add '#define NFSCLIENT' into opt_nfs.h if the NFSCLIENT variable is 1
    (the default is 1).
  
    This makes the nfslockd module works for NFS client.
  
    Reviewed by:	dfr
  
  Approved by:	re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/modules/nfslockd/Makefile

Modified: stable/8/sys/modules/nfslockd/Makefile
==============================================================================
--- stable/8/sys/modules/nfslockd/Makefile	Thu Oct  1 13:16:24 2009	(r197668)
+++ stable/8/sys/modules/nfslockd/Makefile	Thu Oct  1 14:42:55 2009	(r197669)
@@ -14,11 +14,18 @@ SRCS+=	opt_inet6.h opt_nfs.h
 
 .if !defined(KERNBUILDDIR)
 NFS_INET6?=	1	# 0/1 - requires INET6 to be configured in kernel
+NFSCLIENT?=	1	# 0/1 - requires NFSCLIENT to be configured in kernel
 
 .if ${NFS_INET6} > 0
 opt_inet6.h:
 	echo "#define INET6 1" > ${.TARGET}
 .endif
+
+.if ${NFSCLIENT} > 0
+opt_nfs.h:
+	echo "#define NFSCLIENT 1" > ${.TARGET}
+.endif
+
 .endif
 
 .include 

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 15:19:38 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3E3631065679;
	Thu,  1 Oct 2009 15:19:38 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2A37B8FC18;
	Thu,  1 Oct 2009 15:19:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91FJc7x055342;
	Thu, 1 Oct 2009 15:19:38 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91FJbKT055320;
	Thu, 1 Oct 2009 15:19:37 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200910011519.n91FJbKT055320@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 1 Oct 2009 15:19:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor-crypto
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r197670 - in vendor-crypto/openssh/dist: . contrib/aix
	contrib/caldera contrib/cygwin contrib/redhat contrib/suse
	openbsd-compat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 15:19:38 -0000

Author: des
Date: Thu Oct  1 15:19:37 2009
New Revision: 197670
URL: http://svn.freebsd.org/changeset/base/197670

Log:
  Vendor import of OpenSSH 5.3p1

Added:
  vendor-crypto/openssh/dist/roaming.h   (contents, props changed)
  vendor-crypto/openssh/dist/roaming_common.c   (contents, props changed)
  vendor-crypto/openssh/dist/roaming_dummy.c   (contents, props changed)
  vendor-crypto/openssh/dist/schnorr.h   (contents, props changed)
Modified:
  vendor-crypto/openssh/dist/ChangeLog
  vendor-crypto/openssh/dist/Makefile.in
  vendor-crypto/openssh/dist/README
  vendor-crypto/openssh/dist/README.platform
  vendor-crypto/openssh/dist/auth-pam.c
  vendor-crypto/openssh/dist/auth-passwd.c
  vendor-crypto/openssh/dist/auth-sia.c
  vendor-crypto/openssh/dist/auth1.c
  vendor-crypto/openssh/dist/auth2-jpake.c
  vendor-crypto/openssh/dist/auth2-kbdint.c
  vendor-crypto/openssh/dist/auth2-none.c
  vendor-crypto/openssh/dist/auth2-passwd.c
  vendor-crypto/openssh/dist/auth2-pubkey.c
  vendor-crypto/openssh/dist/auth2.c
  vendor-crypto/openssh/dist/canohost.c
  vendor-crypto/openssh/dist/canohost.h
  vendor-crypto/openssh/dist/channels.c
  vendor-crypto/openssh/dist/clientloop.c
  vendor-crypto/openssh/dist/config.h.in
  vendor-crypto/openssh/dist/configure   (contents, props changed)
  vendor-crypto/openssh/dist/configure.ac
  vendor-crypto/openssh/dist/contrib/aix/buildbff.sh
  vendor-crypto/openssh/dist/contrib/caldera/openssh.spec
  vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config
  vendor-crypto/openssh/dist/contrib/cygwin/ssh-user-config
  vendor-crypto/openssh/dist/contrib/redhat/openssh.spec
  vendor-crypto/openssh/dist/contrib/suse/openssh.spec
  vendor-crypto/openssh/dist/defines.h
  vendor-crypto/openssh/dist/gss-genr.c
  vendor-crypto/openssh/dist/includes.h
  vendor-crypto/openssh/dist/jpake.c
  vendor-crypto/openssh/dist/jpake.h
  vendor-crypto/openssh/dist/kex.c
  vendor-crypto/openssh/dist/kex.h
  vendor-crypto/openssh/dist/kexdhs.c
  vendor-crypto/openssh/dist/kexgexs.c
  vendor-crypto/openssh/dist/moduli.0
  vendor-crypto/openssh/dist/monitor.c
  vendor-crypto/openssh/dist/monitor_mm.c
  vendor-crypto/openssh/dist/monitor_wrap.c
  vendor-crypto/openssh/dist/monitor_wrap.h
  vendor-crypto/openssh/dist/openbsd-compat/bsd-cygwin_util.c
  vendor-crypto/openssh/dist/openbsd-compat/bsd-cygwin_util.h
  vendor-crypto/openssh/dist/openbsd-compat/daemon.c
  vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname.c
  vendor-crypto/openssh/dist/openbsd-compat/openssl-compat.c
  vendor-crypto/openssh/dist/openbsd-compat/openssl-compat.h
  vendor-crypto/openssh/dist/openbsd-compat/port-aix.c
  vendor-crypto/openssh/dist/openbsd-compat/port-aix.h
  vendor-crypto/openssh/dist/packet.c
  vendor-crypto/openssh/dist/packet.h
  vendor-crypto/openssh/dist/readconf.c
  vendor-crypto/openssh/dist/readconf.h
  vendor-crypto/openssh/dist/schnorr.c
  vendor-crypto/openssh/dist/scp.0
  vendor-crypto/openssh/dist/servconf.c
  vendor-crypto/openssh/dist/serverloop.c
  vendor-crypto/openssh/dist/session.c
  vendor-crypto/openssh/dist/sftp-client.c
  vendor-crypto/openssh/dist/sftp-server.0
  vendor-crypto/openssh/dist/sftp-server.8
  vendor-crypto/openssh/dist/sftp-server.c
  vendor-crypto/openssh/dist/sftp.0
  vendor-crypto/openssh/dist/ssh-add.0
  vendor-crypto/openssh/dist/ssh-agent.0
  vendor-crypto/openssh/dist/ssh-agent.1
  vendor-crypto/openssh/dist/ssh-agent.c
  vendor-crypto/openssh/dist/ssh-keygen.0
  vendor-crypto/openssh/dist/ssh-keygen.c
  vendor-crypto/openssh/dist/ssh-keyscan.0
  vendor-crypto/openssh/dist/ssh-keysign.0
  vendor-crypto/openssh/dist/ssh-rand-helper.0
  vendor-crypto/openssh/dist/ssh.0
  vendor-crypto/openssh/dist/ssh.1
  vendor-crypto/openssh/dist/ssh.c
  vendor-crypto/openssh/dist/ssh_config.0
  vendor-crypto/openssh/dist/sshconnect.c
  vendor-crypto/openssh/dist/sshconnect.h
  vendor-crypto/openssh/dist/sshconnect2.c
  vendor-crypto/openssh/dist/sshd.0
  vendor-crypto/openssh/dist/sshd.8
  vendor-crypto/openssh/dist/sshd.c
  vendor-crypto/openssh/dist/sshd_config.0
  vendor-crypto/openssh/dist/sshd_config.5
  vendor-crypto/openssh/dist/sshlogin.c
  vendor-crypto/openssh/dist/uuencode.c
  vendor-crypto/openssh/dist/version.h

Modified: vendor-crypto/openssh/dist/ChangeLog
==============================================================================
--- vendor-crypto/openssh/dist/ChangeLog	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/ChangeLog	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,3 +1,282 @@
+20090926
+ - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+         [contrib/suse/openssh.spec] Update for release
+ - (djm) [README] update relnotes URL
+ - (djm) [packet.c] Restore EWOULDBLOCK handling that got lost somewhere
+ - (djm) Release 5.3p1
+
+20090911
+ - (dtucker) [configure.ac] Change the -lresolv check so it works on Mac OS X
+   10.6 (which doesn't have BIND8_COMPAT and thus uses res_9_query).  Patch
+   from jbasney at ncsa uiuc edu.
+
+20090908
+ - (djm) [serverloop.c] Fix test for server-assigned remote forwarding port
+   (-R 0:...); bz#1578, spotted and fix by gavin AT emf.net; ok dtucker@
+
+20090901
+ - (dtucker) [configure.ac] Bug #1639: use AC_PATH_PROG to search the path for
+   krb5-config if it's not in the location specified by --with-kerberos5.
+   Patch from jchadima at redhat.
+
+20090829
+ - (dtucker) [README.platform] Add text about development packages, based on
+   text from Chris Pepper in bug #1631.
+
+20090828
+ - dtucker [auth-sia.c] Roll back the change for bug #1241 as it apparently
+   causes problems in some Tru64 configurations.
+ - (djm) [sshd_config.5] downgrade mention of login.conf to be an example
+   and mention PAM as another provider for ChallengeResponseAuthentication;
+   bz#1408; ok dtucker@
+ - (djm) [sftp-server.c] bz#1535: accept ENOSYS as a fallback error when
+   attempting atomic rename(); ok dtucker@
+ - (djm) [Makefile.in] bz#1505: Solaris make(1) doesn't accept make variables
+   in argv, so pass them in the environment; ok dtucker@
+ - (dtucker) [channels.c configure.ac] Bug #1528: skip the tcgetattr call on
+    the pty master on Solaris, since it never succeeds and can hang if large
+    amounts of data is sent to the slave (eg a copy-paste).  Based on a patch
+    originally from Doke Scott, ok djm@
+ - (dtucker) [clientloop.c configure.ac defines.h] Make the client's IO buffer
+   size a compile-time option and set it to 64k on Cygwin, since Corinna
+   reports that it makes a significant difference to performance.  ok djm@
+ - (dtucker) [configure.ac] Fix the syntax of the Solaris tcgetattr entry.
+
+20090820
+ - (dtucker) [includes.h] Bug #1634: do not include system glob.h if we're not
+   using it since the type conflicts can cause problems on FreeBSD.  Patch
+   from Jonathan Chen.
+ - (dtucker) [session.c openbsd-compat/port-aix.h] Bugs #1249 and #1567: move
+   the setpcred call on AIX to immediately before the permanently_set_uid().
+   Ensures that we still have privileges when we call chroot and
+   pam_open_sesson.  Based on a patch from David Leonard.
+
+20090817
+ - (dtucker) [configure.ac] Check for headers before libraries for openssl an
+   zlib, which should make the errors slightly more meaningful on platforms
+   where there's separate "-devel" packages for those.
+ - (dtucker) [sshlogin.c openbsd-compat/port-aix.{c,h}] Bug #1595: make
+   PrintLastLog work on AIX.  Based in part on a patch from Miguel Sanders.
+
+20090729
+ - (tim) [contrib/cygwin/ssh-user-config] Change script to call correct error
+   function. Patch from Corinna Vinschen.
+
+20090713
+ - (dtucker) [openbsd-compat/getrrsetbyname.c] Reduce answer buffer size so it
+   fits into 16 bits to work around a bug in glibc's resolver where it masks
+   off the buffer size at 16 bits.  Patch from Hauke Lampe, ok djm jakob.
+
+20090712
+ - (dtucker) [configure.ac] Include sys/param.h for the sys/mount.h test,
+   prevents configure complaining on older BSDs.
+ - (dtucker [contrib/cygwin/ssh-{host,user}-config] Add license text. Patch
+   from Corinna Vinschen.
+ - (dtucker) [auth-pam.c] Bug #1534: move the deletion of PAM credentials on
+   logout to after the session close.  Patch from Anicka Bernathova,
+   originally from Andreas Schwab via Novelll ok djm.
+
+20090707
+ - (dtucker) [contrib/cygwin/ssh-host-config] better support for automated
+   scripts and fix usage of eval.  Patch from Corinna Vinschen.
+
+20090705
+ - (dtucker) OpenBSD CVS Sync
+   - andreas@cvs.openbsd.org 2009/06/27 09:29:06
+     [packet.h packet.c]
+     packet_bacup_state() and packet_restore_state() will be used to
+     temporarily save the current state ren resuming a suspended connection.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/06/27 09:32:43
+     [roaming_common.c roaming.h]
+     It may be necessary to retransmit some data when resuming, so add it
+     to a buffer when roaming is enabled.
+     Most of this code was written by Martin Forssen, maf at appgate dot com.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/06/27 09:35:06
+     [readconf.h readconf.c]
+     Add client option UseRoaming. It doesn't do anything yet but will
+     control whether the client tries to use roaming if enabled on the
+     server. From Martin Forssen.
+     ok markus@
+   - markus@cvs.openbsd.org 2009/06/30 14:54:40
+     [version.h]
+     crank version; ok deraadt
+   - dtucker@cvs.openbsd.org 2009/07/02 02:11:47
+     [ssh.c]
+     allow for long home dir paths (bz #1615).  ok deraadt
+     (based in part on a patch from jchadima at redhat)
+   - stevesk@cvs.openbsd.org 2009/07/05 19:28:33
+     [clientloop.c]
+     only send SSH2_MSG_DISCONNECT if we're in compat20; from dtucker@
+     ok deraadt@ markus@
+
+20090622
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2009/06/22 05:39:28
+     [monitor_wrap.c monitor_mm.c ssh-keygen.c auth2.c gss-genr.c sftp-client.c]
+     alphabetize includes; reduces diff vs portable and style(9).
+     ok stevesk djm
+     (Id sync only; these were already in order in -portable)
+
+20090621
+ - (dtucker) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2009/03/17 21:37:00
+     [ssh.c]
+     pass correct argv[0] to openlog(); ok djm@
+  - jmc@cvs.openbsd.org 2009/03/19 15:15:09
+     [ssh.1]
+     for "Ciphers", just point the reader to the keyword in ssh_config(5), just
+     as we do for "MACs": this stops us getting out of sync when the lists
+     change;
+     fixes documentation/6102, submitted by Peter J. Philipp
+     alternative fix proposed by djm
+     ok markus
+   - tobias@cvs.openbsd.org 2009/03/23 08:31:19
+     [ssh-agent.c]
+     Fixed a possible out-of-bounds memory access if the environment variable
+     SHELL is shorter than 3 characters.
+     with input by and ok dtucker
+   - tobias@cvs.openbsd.org 2009/03/23 19:38:04
+     [ssh-agent.c]
+     My previous commit didn't fix the problem at all, so stick at my first
+     version of the fix presented to dtucker.
+     Issue notified by Matthias Barkhoff (matthias dot barkhoff at gmx dot de).
+     ok dtucker
+   - sobrado@cvs.openbsd.org 2009/03/26 08:38:39
+     [sftp-server.8 sshd.8 ssh-agent.1]
+     fix a few typographical errors found by spell(1).
+     ok dtucker@, jmc@
+   - stevesk@cvs.openbsd.org 2009/04/13 19:07:44
+     [sshd_config.5]
+     fix possessive; ok djm@
+   - stevesk@cvs.openbsd.org 2009/04/14 16:33:42
+     [sftp-server.c]
+     remove unused option character from getopt() optstring; ok markus@
+   - jj@cvs.openbsd.org 2009/04/14 21:10:54
+     [servconf.c]
+     Fixed a few the-the misspellings in comments. Skipped a bunch in
+     binutils,gcc and so on. ok jmc@
+   - stevesk@cvs.openbsd.org 2009/04/17 19:23:06
+     [session.c]
+     use INTERNAL_SFTP_NAME for setproctitle() of in-process sftp-server;
+     ok djm@ markus@
+   - stevesk@cvs.openbsd.org 2009/04/17 19:40:17
+     [sshd_config.5]
+     clarify that even internal-sftp needs /dev/log for logging to work; ok
+     markus@
+   - jmc@cvs.openbsd.org 2009/04/18 18:39:10
+     [sshd_config.5]
+     tweak previous; ok stevesk
+   - stevesk@cvs.openbsd.org 2009/04/21 15:13:17
+     [sshd_config.5]
+     clarify we cd to user's home after chroot; ok markus@ on
+     earlier version; tweaks and ok jmc@
+   - andreas@cvs.openbsd.org 2009/05/25 06:48:01
+     [channels.c packet.c clientloop.c packet.h serverloop.c monitor_wrap.c
+     monitor.c]
+     Put the globals in packet.c into a struct and don't access it directly
+     from other files. No functional changes.
+     ok markus@ djm@
+   - andreas@cvs.openbsd.org 2009/05/27 06:31:25
+     [canohost.h canohost.c]
+     Add clear_cached_addr(), needed for upcoming changes allowing the peer
+     address to change.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:33:39
+     [clientloop.c]
+     Send SSH2_MSG_DISCONNECT when the client disconnects. From a larger
+     change from Martin Forssen, maf at appgate dot com.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:34:36
+     [kex.c kex.h]
+     Move the KEX_COOKIE_LEN define to kex.h
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:36:07
+     [packet.h packet.c]
+     Add packet_put_int64() and packet_get_int64(), part of a larger change
+     from Martin Forssen.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:38:16
+     [sshconnect.h sshconnect.c]
+     Un-static ssh_exchange_identification(), part of a larger change from
+     Martin Forssen and needed for upcoming changes.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/28 16:50:16
+     [sshd.c packet.c serverloop.c monitor_wrap.c clientloop.c sshconnect.c
+     monitor.c Added roaming.h roaming_common.c roaming_dummy.c]
+     Keep track of number of bytes read and written. Needed for upcoming
+     changes. Most code from Martin Forssen, maf at appgate dot com.
+     ok markus@
+     Also, applied appropriate changes to Makefile.in
+   - andreas@cvs.openbsd.org 2009/06/12 20:43:22
+     [monitor.c packet.c]
+     Fix warnings found by chl@ and djm@ and change roaming_atomicio's
+     return type to match atomicio's
+     Diff from djm@, ok markus@
+   - andreas@cvs.openbsd.org 2009/06/12 20:58:32
+     [packet.c]
+     Move some more statics into session_state
+     ok markus@ djm@
+   - dtucker@cvs.openbsd.org 2009/06/21 07:37:15
+     [kexdhs.c kexgexs.c]
+     abort if key_sign fails, preventing possible null deref.  Based on report
+     from Paolo Ganci, ok markus@ djm@
+   - dtucker@cvs.openbsd.org 2009/06/21 09:04:03
+     [roaming.h roaming_common.c roaming_dummy.c]
+     Add  tags for the benefit of the sync scripts
+     Also: pull in the changes for 1.1->1.2 missed in the previous sync.
+ - (dtucker) [auth2-jpake.c auth2.c canohost.h session.c] Whitespace and
+   header-order changes to reduce diff vs OpenBSD.
+ - (dtucker) [servconf.c sshd.c] More whitespace sync.
+ - (dtucker) [roaming_common.c roaming_dummy.c] Wrap #include  in
+   ifdef.
+
+20090616
+ - (dtucker) [configure.ac defines.h] Bug #1607: handle the case where fsid_t
+   is a struct with a __val member.  Fixes build on, eg, Redhat 6.2.
+
+20090504
+ - (dtucker) [sshlogin.c] Move the NO_SSH_LASTLOG #ifndef line to include
+   variable declarations.  Should prevent unused warnings anywhere it's set
+   (only Crays as far as I can tell) and be a no-op everywhere else.
+
+20090318
+ - (tim) [configure.ac] Remove setting IP_TOS_IS_BROKEN for Cygwin. The problem
+   that setsockopt(IP_TOS) doesn't work on Cygwin has been fixed since 2005.
+   Based on patch from vinschen at redhat com.
+
+20090308
+ - (dtucker) [auth-passwd.c auth1.c auth2-kbdint.c auth2-none.c auth2-passwd.c
+   auth2-pubkey.c session.c openbsd-compat/bsd-cygwin_util.{c,h}
+   openbsd-compat/daemon.c] Remove support for Windows 95/98/ME and very old
+   version of Cygwin.  Patch from vinschen at redhat com.
+
+20090307
+ - (dtucker) [contrib/aix/buildbff.sh] Only try to rename ssh_prng_cmds if it
+   exists (it's not created if OpenSSL's PRNG is self-seeded, eg if the OS
+   has a /dev/random).
+ - (dtucker) [schnorr.c openbsd-compat/openssl-compat.{c,h}] Add
+   EVP_DigestUpdate to the OLD_EVP compatibility functions and tell schnorr.c
+   to use them.  Allows building with older OpenSSL versions.
+ - (dtucker) [configure.ac defines.h] Check for in_port_t and typedef if needed.
+ - (dtucker) [configure.ac] Missing comma in type list.
+ - (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}]
+   EVP_DigestUpdate does not exactly match the other OLD_EVP functions (eg
+   in openssl 0.9.6) so add an explicit test for it.
+
+20090306
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2009/03/05 07:18:19
+     [auth2-jpake.c jpake.c jpake.h monitor_wrap.c monitor_wrap.h schnorr.c]
+     [sshconnect2.c]
+     refactor the (disabled) Schnorr proof code to make it a little more
+     generally useful
+   - djm@cvs.openbsd.org 2009/03/05 11:30:50
+     [uuencode.c]
+     document what these functions do so I don't ever have to recuse into
+     b64_pton/ntop to remember their return values
+
 20090223
  - (djm) OpenBSD CVS Sync
    - djm@cvs.openbsd.org 2009/02/22 23:50:57

Modified: vendor-crypto/openssh/dist/Makefile.in
==============================================================================
--- vendor-crypto/openssh/dist/Makefile.in	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/Makefile.in	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.298 2008/11/05 05:20:46 djm Exp $
+# $Id: Makefile.in,v 1.300 2009/08/28 00:47:38 djm Exp $
 
 # uncomment if you run a non bourne compatable shell. Ie. csh
 #SHELL = @SH@
@@ -74,7 +74,8 @@ LIBSSH_OBJS=acss.o authfd.o authfile.o b
 	entropy.o scard-opensc.o gss-genr.o umac.o jpake.o schnorr.o
 
 SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \
-	sshconnect.o sshconnect1.o sshconnect2.o mux.o
+	sshconnect.o sshconnect1.o sshconnect2.o mux.o \
+	roaming_common.o
 
 SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \
 	sshpty.o sshlogin.o servconf.o serverloop.o \
@@ -86,7 +87,8 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passw
 	auth-krb5.o \
 	auth2-gss.o gss-serv.o gss-serv-krb5.o \
 	loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \
-	audit.o audit-bsm.o platform.o sftp-server.o sftp-common.o
+	audit.o audit-bsm.o platform.o sftp-server.o sftp-common.o \
+	roaming_common.o
 
 MANPAGES	= moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-rand-helper.8.out ssh-keysign.8.out sshd_config.5.out ssh_config.5.out
 MANPAGES_IN	= moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-rand-helper.8 ssh-keysign.8 sshd_config.5 ssh_config.5
@@ -151,11 +153,11 @@ ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.
 ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o
 	$(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
 
-ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o
-	$(LD) -o $@ ssh-keysign.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
+ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o roaming_dummy.o
+	$(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
 
-ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o
-	$(LD) -o $@ ssh-keyscan.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS)
+ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o
+	$(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS)
 
 sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o
 	$(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
@@ -240,7 +242,7 @@ check-config:
 	-$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config
 
 scard-install:
-	(cd scard && $(MAKE) DESTDIR=$(DESTDIR) install)
+	(cd scard && env DESTDIR=$(DESTDIR) $(MAKE) DESTDIR=$(DESTDIR) install)
 
 install-files: scard-install
 	$(srcdir)/mkinstalldirs $(DESTDIR)$(bindir)

Modified: vendor-crypto/openssh/dist/README
==============================================================================
--- vendor-crypto/openssh/dist/README	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/README	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,4 +1,4 @@
-See http://www.openssh.com/txt/release-5.2 for the release notes.
+See http://www.openssh.com/txt/release-5.3 for the release notes.
 
 - A Japanese translation of this document and of the OpenSSH FAQ is
 - available at http://www.unixuser.org/~haruyama/security/openssh/index.html
@@ -62,4 +62,4 @@ References -
 [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9
 [7] http://www.openssh.com/faq.html
 
-$Id: README,v 1.70 2009/02/23 00:11:57 djm Exp $
+$Id: README,v 1.70.4.1 2009/09/26 04:11:47 djm Exp $

Modified: vendor-crypto/openssh/dist/README.platform
==============================================================================
--- vendor-crypto/openssh/dist/README.platform	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/README.platform	Thu Oct  1 15:19:37 2009	(r197670)
@@ -56,6 +56,18 @@ using a third party driver. More informa
 	http://www-user.rhrk.uni-kl.de/~nissler/tuntap/
 
 
+Linux
+-----
+
+Some Linux distributions (including Red Hat/Fedora/CentOS) include
+headers and library links in the -devel RPMs rather than the main
+binary RPMs. If you get an error about headers, or complaining about a
+missing prerequisite then you may need to install the equivalent
+development packages.  On Redhat based distros these may be openssl-devel,
+zlib-devel and pam-devel, on Debian based distros these may be
+libssl-dev, libz-dev and libpam-dev.
+
+
 Solaris
 -------
 If you enable BSM auditing on Solaris, you need to update audit_event(4)
@@ -81,4 +93,4 @@ account stacks which will prevent authen
 return the output from pam_nologin to the client.
 
 
-$Id: README.platform,v 1.9 2007/08/09 04:31:53 dtucker Exp $
+$Id: README.platform,v 1.10 2009/08/28 23:14:48 dtucker Exp $

Modified: vendor-crypto/openssh/dist/auth-pam.c
==============================================================================
--- vendor-crypto/openssh/dist/auth-pam.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth-pam.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -602,16 +602,16 @@ sshpam_cleanup(void)
 		return;
 	debug("PAM: cleanup");
 	pam_set_item(sshpam_handle, PAM_CONV, (const void *)&null_conv);
-	if (sshpam_cred_established) {
-		debug("PAM: deleting credentials");
-		pam_setcred(sshpam_handle, PAM_DELETE_CRED);
-		sshpam_cred_established = 0;
-	}
 	if (sshpam_session_open) {
 		debug("PAM: closing session");
 		pam_close_session(sshpam_handle, PAM_SILENT);
 		sshpam_session_open = 0;
 	}
+	if (sshpam_cred_established) {
+		debug("PAM: deleting credentials");
+		pam_setcred(sshpam_handle, PAM_DELETE_CRED);
+		sshpam_cred_established = 0;
+	}
 	sshpam_authenticated = 0;
 	pam_end(sshpam_handle, sshpam_err);
 	sshpam_handle = NULL;

Modified: vendor-crypto/openssh/dist/auth-passwd.c
==============================================================================
--- vendor-crypto/openssh/dist/auth-passwd.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth-passwd.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -102,7 +102,7 @@ auth_password(Authctxt *authctxt, const 
 	}
 #endif
 #ifdef HAVE_CYGWIN
-	if (is_winnt) {
+	{
 		HANDLE hToken = cygwin_logon_user(pw, password);
 
 		if (hToken == INVALID_HANDLE_VALUE)

Modified: vendor-crypto/openssh/dist/auth-sia.c
==============================================================================
--- vendor-crypto/openssh/dist/auth-sia.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth-sia.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -34,10 +34,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
 
 #include "ssh.h"
 #include "key.h"
@@ -53,52 +49,6 @@ extern ServerOptions options;
 extern int saved_argc;
 extern char **saved_argv;
 
-static int
-sia_password_change_required(const char *user)
-{
-	struct es_passwd *acct;
-	time_t pw_life;
-	time_t pw_date;
-
-	set_auth_parameters(saved_argc, saved_argv);
-
-	if ((acct = getespwnam(user)) == NULL) {
-		error("Couldn't access protected database entry for %s", user);
-		endprpwent();
-		return (0);
-	}
-
-	/* If forced password change flag is set, honor it */
-	if (acct->uflg->fg_psw_chg_reqd && acct->ufld->fd_psw_chg_reqd) {
-		endprpwent();
-		return (1);
-	}
-
-	/* Obtain password lifetime; if none, it can't have expired */
-	if (acct->uflg->fg_expire)
-		pw_life = acct->ufld->fd_expire;
-	else if (acct->sflg->fg_expire)
-		pw_life = acct->sfld->fd_expire;
-	else {
-		endprpwent();
-		return (0);
-	}
-
-	/* Offset from last change; if none, it must be expired */
-	if (acct->uflg->fg_schange)
-		pw_date = acct->ufld->fd_schange + pw_life;
-	else {
-		endprpwent();
-		return (1);
-	}
-
-	endprpwent();
-
-	/* If expiration date is prior to now, change password */
-	
-	return (pw_date <= time((time_t *) NULL));
-}
-
 int
 sys_auth_passwd(Authctxt *authctxt, const char *pass)
 {
@@ -126,9 +76,6 @@ sys_auth_passwd(Authctxt *authctxt, cons
 
 	sia_ses_release(&ent);
 
-	authctxt->force_pwchange = sia_password_change_required(
-		authctxt->user);
-
 	return (1);
 }
 

Modified: vendor-crypto/openssh/dist/auth1.c
==============================================================================
--- vendor-crypto/openssh/dist/auth1.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth1.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -318,15 +318,7 @@ do_authloop(Authctxt *authctxt)
 		}
 #endif /* _UNICOS */
 
-#ifdef HAVE_CYGWIN
-		if (authenticated &&
-		    !check_nt_auth(type == SSH_CMSG_AUTH_PASSWORD,
-		    authctxt->pw)) {
-			packet_disconnect("Authentication rejected for uid %d.",
-			    authctxt->pw == NULL ? -1 : authctxt->pw->pw_uid);
-			authenticated = 0;
-		}
-#else
+#ifndef HAVE_CYGWIN
 		/* Special handling for root */
 		if (authenticated && authctxt->pw->pw_uid == 0 &&
 		    !auth_root_allowed(meth->name)) {

Modified: vendor-crypto/openssh/dist/auth2-jpake.c
==============================================================================
--- vendor-crypto/openssh/dist/auth2-jpake.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth2-jpake.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-jpake.c,v 1.2 2008/11/07 23:34:48 dtucker Exp $ */
+/* $OpenBSD: auth2-jpake.c,v 1.3 2009/03/05 07:18:19 djm Exp $ */
 /*
  * Copyright (c) 2008 Damien Miller.  All rights reserved.
  *
@@ -42,8 +42,8 @@
 #include "ssh2.h"
 #include "key.h"
 #include "hostfile.h"
-#include "buffer.h"
 #include "auth.h"
+#include "buffer.h"
 #include "packet.h"
 #include "dispatch.h"
 #include "log.h"
@@ -55,6 +55,7 @@
 #endif
 #include "monitor_wrap.h"
 
+#include "schnorr.h"
 #include "jpake.h"
 
 /*
@@ -359,7 +360,7 @@ auth2_jpake_get_pwdata(Authctxt *authctx
 }
 
 /*
- * Being authentication attempt.
+ * Begin authentication attempt.
  * Note, sets authctxt->postponed while in subprotocol
  */
 static int

Modified: vendor-crypto/openssh/dist/auth2-kbdint.c
==============================================================================
--- vendor-crypto/openssh/dist/auth2-kbdint.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth2-kbdint.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -58,10 +58,6 @@ userauth_kbdint(Authctxt *authctxt)
 
 	xfree(devs);
 	xfree(lang);
-#ifdef HAVE_CYGWIN
-	if (check_nt_auth(0, authctxt->pw) == 0)
-		authenticated = 0;
-#endif
 	return authenticated;
 }
 

Modified: vendor-crypto/openssh/dist/auth2-none.c
==============================================================================
--- vendor-crypto/openssh/dist/auth2-none.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth2-none.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -61,10 +61,6 @@ userauth_none(Authctxt *authctxt)
 {
 	none_enabled = 0;
 	packet_check_eom();
-#ifdef HAVE_CYGWIN
-	if (check_nt_auth(1, authctxt->pw) == 0)
-		return (0);
-#endif
 	if (options.password_authentication)
 		return (PRIVSEP(auth_password(authctxt, "")));
 	return (0);

Modified: vendor-crypto/openssh/dist/auth2-passwd.c
==============================================================================
--- vendor-crypto/openssh/dist/auth2-passwd.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth2-passwd.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -68,10 +68,6 @@ userauth_passwd(Authctxt *authctxt)
 		logit("password change not supported");
 	else if (PRIVSEP(auth_password(authctxt, password)) == 1)
 		authenticated = 1;
-#ifdef HAVE_CYGWIN
-	if (check_nt_auth(1, authctxt->pw) == 0)
-		authenticated = 0;
-#endif
 	memset(password, 0, len);
 	xfree(password);
 	return authenticated;

Modified: vendor-crypto/openssh/dist/auth2-pubkey.c
==============================================================================
--- vendor-crypto/openssh/dist/auth2-pubkey.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth2-pubkey.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -170,10 +170,6 @@ done:
 		key_free(key);
 	xfree(pkalg);
 	xfree(pkblob);
-#ifdef HAVE_CYGWIN
-	if (check_nt_auth(0, authctxt->pw) == 0)
-		authenticated = 0;
-#endif
 	return authenticated;
 }
 

Modified: vendor-crypto/openssh/dist/auth2.c
==============================================================================
--- vendor-crypto/openssh/dist/auth2.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/auth2.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2.c,v 1.120 2008/11/04 08:22:12 djm Exp $ */
+/* $OpenBSD: auth2.c,v 1.121 2009/06/22 05:39:28 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -35,8 +35,8 @@
 #include 
 #include 
 
-#include "xmalloc.h"
 #include "atomicio.h"
+#include "xmalloc.h"
 #include "ssh2.h"
 #include "packet.h"
 #include "log.h"

Modified: vendor-crypto/openssh/dist/canohost.c
==============================================================================
--- vendor-crypto/openssh/dist/canohost.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/canohost.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,4 +1,4 @@
-/* $OpenBSD: canohost.c,v 1.64 2009/02/12 03:00:56 djm Exp $ */
+/* $OpenBSD: canohost.c,v 1.65 2009/05/27 06:31:25 andreas Exp $ */
 /*
  * Author: Tatu Ylonen 
  * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland
@@ -35,6 +35,8 @@
 #include "misc.h"
 
 static void check_ip_options(int, char *);
+static char *canonical_host_ip = NULL;
+static int cached_port = -1;
 
 /*
  * Return the canonical name of the host at the other end of the socket. The
@@ -304,6 +306,16 @@ get_local_name(int sock)
 	return get_socket_address(sock, 0, NI_NAMEREQD);
 }
 
+void
+clear_cached_addr(void)
+{
+	if (canonical_host_ip != NULL) {
+		xfree(canonical_host_ip);
+		canonical_host_ip = NULL;
+	}
+	cached_port = -1;
+}
+
 /*
  * Returns the IP-address of the remote host as a string.  The returned
  * string must not be freed.
@@ -312,8 +324,6 @@ get_local_name(int sock)
 const char *
 get_remote_ipaddr(void)
 {
-	static char *canonical_host_ip = NULL;
-
 	/* Check whether we have cached the ipaddr. */
 	if (canonical_host_ip == NULL) {
 		if (packet_connection_is_on_socket()) {
@@ -402,13 +412,11 @@ get_peer_port(int sock)
 int
 get_remote_port(void)
 {
-	static int port = -1;
-
 	/* Cache to avoid getpeername() on a dead connection */
-	if (port == -1)
-		port = get_port(0);
+	if (cached_port == -1)
+		cached_port = get_port(0);
 
-	return port;
+	return cached_port;
 }
 
 int

Modified: vendor-crypto/openssh/dist/canohost.h
==============================================================================
--- vendor-crypto/openssh/dist/canohost.h	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/canohost.h	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,4 +1,4 @@
-/* $OpenBSD: canohost.h,v 1.10 2009/02/12 03:00:56 djm Exp $ */
+/* $OpenBSD: canohost.h,v 1.11 2009/05/27 06:31:25 andreas Exp $ */
 
 /*
  * Author: Tatu Ylonen 
@@ -24,6 +24,6 @@ char		*get_local_name(int);
 int		 get_remote_port(void);
 int		 get_local_port(void);
 int		 get_sock_port(int, int);
-
+void		 clear_cached_addr(void);
 
 void		 ipv64_normalise_mapped(struct sockaddr_storage *, socklen_t *);

Modified: vendor-crypto/openssh/dist/channels.c
==============================================================================
--- vendor-crypto/openssh/dist/channels.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/channels.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.295 2009/02/12 03:00:56 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.296 2009/05/25 06:48:00 andreas Exp $ */
 /*
  * Author: Tatu Ylonen 
  * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland
@@ -1653,6 +1653,7 @@ channel_handle_wfd(Channel *c, fd_set *r
 			}
 			return -1;
 		}
+#ifndef BROKEN_TCGETATTR_ICANON
 		if (compat20 && c->isatty && dlen >= 1 && buf[0] != '\r') {
 			if (tcgetattr(c->wfd, &tio) == 0 &&
 			    !(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
@@ -1666,6 +1667,7 @@ channel_handle_wfd(Channel *c, fd_set *r
 				packet_send();
 			}
 		}
+#endif
 		buffer_consume(&c->output, len);
 		if (compat20 && len > 0) {
 			c->local_consumed += len;
@@ -2431,7 +2433,7 @@ channel_input_status_confirm(int type, u
 	int id;
 
 	/* Reset keepalive timeout */
-	keep_alive_timeouts = 0;
+	packet_set_alive_timeouts(0);
 
 	id = packet_get_int();
 	packet_check_eom();

Modified: vendor-crypto/openssh/dist/clientloop.c
==============================================================================
--- vendor-crypto/openssh/dist/clientloop.c	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/clientloop.c	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.209 2009/02/12 03:00:56 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.213 2009/07/05 19:28:33 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen 
  * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland
@@ -109,6 +109,7 @@
 #include "misc.h"
 #include "match.h"
 #include "msg.h"
+#include "roaming.h"
 
 /* import options */
 extern Options options;
@@ -491,13 +492,13 @@ client_global_request_reply(int type, u_
 		xfree(gc);
 	}
 
-	keep_alive_timeouts = 0;
+	packet_set_alive_timeouts(0);
 }
 
 static void
 server_alive_check(void)
 {
-	if (++keep_alive_timeouts > options.server_alive_count_max) {
+	if (packet_inc_alive_timeouts() > options.server_alive_count_max) {
 		logit("Timeout, server not responding.");
 		cleanup_exit(255);
 	}
@@ -634,8 +635,8 @@ client_suspend_self(Buffer *bin, Buffer 
 static void
 client_process_net_input(fd_set *readset)
 {
-	int len;
-	char buf[8192];
+	int len, cont = 0;
+	char buf[SSH_IOBUFSZ];
 
 	/*
 	 * Read input from the server, and add any such data to the buffer of
@@ -643,8 +644,8 @@ client_process_net_input(fd_set *readset
 	 */
 	if (FD_ISSET(connection_in, readset)) {
 		/* Read as much as possible. */
-		len = read(connection_in, buf, sizeof(buf));
-		if (len == 0) {
+		len = roaming_read(connection_in, buf, sizeof(buf), &cont);
+		if (len == 0 && cont == 0) {
 			/*
 			 * Received EOF.  The remote host has closed the
 			 * connection.
@@ -1128,7 +1129,7 @@ static void
 client_process_input(fd_set *readset)
 {
 	int len;
-	char buf[8192];
+	char buf[SSH_IOBUFSZ];
 
 	/* Read input from stdin. */
 	if (FD_ISSET(fileno(stdin), readset)) {
@@ -1476,6 +1477,14 @@ client_loop(int have_pty, int escape_cha
 	/* Stop watching for window change. */
 	signal(SIGWINCH, SIG_DFL);
 
+	if (compat20) {
+		packet_start(SSH2_MSG_DISCONNECT);
+		packet_put_int(SSH2_DISCONNECT_BY_APPLICATION);
+		packet_put_cstring("disconnected by user");
+		packet_send();
+		packet_write_wait();
+	}
+
 	channel_free_all();
 
 	if (have_pty)

Modified: vendor-crypto/openssh/dist/config.h.in
==============================================================================
--- vendor-crypto/openssh/dist/config.h.in	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/config.h.in	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,5 +1,8 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
 /* Define if you have a getaddrinfo that fails for the all-zeros IPv6 address
    */
 #undef AIX_GETNAMEINFO_HACK
@@ -68,6 +71,9 @@
 /* Define if your snprintf is busted */
 #undef BROKEN_SNPRINTF
 
+/* tcgetattr with ICANON may hang */
+#undef BROKEN_TCGETATTR_ICANON
+
 /* updwtmpx is broken (if present) */
 #undef BROKEN_UPDWTMPX
 
@@ -122,9 +128,12 @@
 /* Builtin PRNG command timeout */
 #undef ENTROPY_TIMEOUT_MSEC
 
-/* f_fsid has members */
+/* fsid_t has member val */
 #undef FSID_HAS_VAL
 
+/* fsid_t has member __val */
+#undef FSID_HAS___VAL
+
 /* Define to 1 if the `getpgrp' function requires zero arguments. */
 #undef GETPGRP_VOID
 
@@ -518,6 +527,9 @@
 /* Define to 1 if the system has the type `in_addr_t'. */
 #undef HAVE_IN_ADDR_T
 
+/* Define to 1 if the system has the type `in_port_t'. */
+#undef HAVE_IN_PORT_T
+
 /* Define to 1 if you have the  header file. */
 #undef HAVE_LASTLOG_H
 
@@ -1226,6 +1238,9 @@
 /* Define if X11 doesn't support AF_UNIX sockets on that system */
 #undef NO_X11_UNIX_SOCKETS
 
+/* Define if EVP_DigestUpdate returns void */
+#undef OPENSSL_EVP_DIGESTUPDATE_VOID
+
 /* libcrypto is missing AES 192 and 256 bit functions */
 #undef OPENSSL_LOBOTOMISED_AES
 
@@ -1309,6 +1324,9 @@
 /* Use audit debugging module */
 #undef SSH_AUDIT_EVENTS
 
+/* Windows is sensitive to read buffer size */
+#undef SSH_IOBUFSZ
+
 /* non-privileged user for privilege separation */
 #undef SSH_PRIVSEP_USER
 
@@ -1397,9 +1415,17 @@
 /* Define if you want SELinux support. */
 #undef WITH_SELINUX
 
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
 
 /* Define if xauth is found in your path */
 #undef XAUTH_PATH

Modified: vendor-crypto/openssh/dist/configure
==============================================================================
--- vendor-crypto/openssh/dist/configure	Thu Oct  1 14:42:55 2009	(r197669)
+++ vendor-crypto/openssh/dist/configure	Thu Oct  1 15:19:37 2009	(r197670)
@@ -1,12 +1,12 @@
 #! /bin/sh
-# From configure.ac Revision: 1.415 .
+# From configure.ac Revision: 1.427 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for OpenSSH Portable.
+# Generated by GNU Autoconf 2.62 for OpenSSH Portable.
 #
 # Report bugs to .
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -18,7 +18,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -40,17 +40,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
   else
-    PATH_SEPARATOR=:
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
   fi
-  rm -f conf$$.sh
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 # Support unset when possible.
@@ -66,8 +94,6 @@ fi
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
@@ -90,7 +116,7 @@ if test "x$as_myself" = x; then
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   { (exit 1); exit 1; }
 fi
 
@@ -103,17 +129,10 @@ PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 15:22:35 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2CC6E106568D;
	Thu,  1 Oct 2009 15:22:35 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 174438FC16;
	Thu,  1 Oct 2009 15:22:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91FMZ7b055521;
	Thu, 1 Oct 2009 15:22:35 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91FMZVG055518;
	Thu, 1 Oct 2009 15:22:35 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200910011522.n91FMZVG055518@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 1 Oct 2009 15:22:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor-crypto
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r197671 - in vendor-crypto/openssh/5.3p1: . contrib/aix
	contrib/caldera contrib/cygwin contrib/redhat contrib/suse
	openbsd-compat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 15:22:35 -0000

Author: des
Date: Thu Oct  1 15:22:34 2009
New Revision: 197671
URL: http://svn.freebsd.org/changeset/base/197671

Log:
  Tag OpenSSH 5.3p1

Added:
  vendor-crypto/openssh/5.3p1/
     - copied from r197669, vendor-crypto/openssh/dist/
  vendor-crypto/openssh/5.3p1/roaming.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/roaming.h
  vendor-crypto/openssh/5.3p1/roaming_common.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/roaming_common.c
  vendor-crypto/openssh/5.3p1/roaming_dummy.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/roaming_dummy.c
  vendor-crypto/openssh/5.3p1/schnorr.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/schnorr.h
Replaced:
  vendor-crypto/openssh/5.3p1/ChangeLog
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ChangeLog
  vendor-crypto/openssh/5.3p1/Makefile.in
     - copied unchanged from r197670, vendor-crypto/openssh/dist/Makefile.in
  vendor-crypto/openssh/5.3p1/README
     - copied unchanged from r197670, vendor-crypto/openssh/dist/README
  vendor-crypto/openssh/5.3p1/README.platform
     - copied unchanged from r197670, vendor-crypto/openssh/dist/README.platform
  vendor-crypto/openssh/5.3p1/auth-pam.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth-pam.c
  vendor-crypto/openssh/5.3p1/auth-passwd.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth-passwd.c
  vendor-crypto/openssh/5.3p1/auth-sia.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth-sia.c
  vendor-crypto/openssh/5.3p1/auth1.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth1.c
  vendor-crypto/openssh/5.3p1/auth2-jpake.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth2-jpake.c
  vendor-crypto/openssh/5.3p1/auth2-kbdint.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth2-kbdint.c
  vendor-crypto/openssh/5.3p1/auth2-none.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth2-none.c
  vendor-crypto/openssh/5.3p1/auth2-passwd.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth2-passwd.c
  vendor-crypto/openssh/5.3p1/auth2-pubkey.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth2-pubkey.c
  vendor-crypto/openssh/5.3p1/auth2.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/auth2.c
  vendor-crypto/openssh/5.3p1/canohost.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/canohost.c
  vendor-crypto/openssh/5.3p1/canohost.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/canohost.h
  vendor-crypto/openssh/5.3p1/channels.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/channels.c
  vendor-crypto/openssh/5.3p1/clientloop.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/clientloop.c
  vendor-crypto/openssh/5.3p1/config.h.in
     - copied unchanged from r197670, vendor-crypto/openssh/dist/config.h.in
  vendor-crypto/openssh/5.3p1/configure
     - copied unchanged from r197670, vendor-crypto/openssh/dist/configure
  vendor-crypto/openssh/5.3p1/configure.ac
     - copied unchanged from r197670, vendor-crypto/openssh/dist/configure.ac
  vendor-crypto/openssh/5.3p1/contrib/aix/buildbff.sh
     - copied unchanged from r197670, vendor-crypto/openssh/dist/contrib/aix/buildbff.sh
  vendor-crypto/openssh/5.3p1/contrib/caldera/openssh.spec
     - copied unchanged from r197670, vendor-crypto/openssh/dist/contrib/caldera/openssh.spec
  vendor-crypto/openssh/5.3p1/contrib/cygwin/ssh-host-config
     - copied unchanged from r197670, vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config
  vendor-crypto/openssh/5.3p1/contrib/cygwin/ssh-user-config
     - copied unchanged from r197670, vendor-crypto/openssh/dist/contrib/cygwin/ssh-user-config
  vendor-crypto/openssh/5.3p1/contrib/redhat/openssh.spec
     - copied unchanged from r197670, vendor-crypto/openssh/dist/contrib/redhat/openssh.spec
  vendor-crypto/openssh/5.3p1/contrib/suse/openssh.spec
     - copied unchanged from r197670, vendor-crypto/openssh/dist/contrib/suse/openssh.spec
  vendor-crypto/openssh/5.3p1/defines.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/defines.h
  vendor-crypto/openssh/5.3p1/gss-genr.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/gss-genr.c
  vendor-crypto/openssh/5.3p1/includes.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/includes.h
  vendor-crypto/openssh/5.3p1/jpake.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/jpake.c
  vendor-crypto/openssh/5.3p1/jpake.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/jpake.h
  vendor-crypto/openssh/5.3p1/kex.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/kex.c
  vendor-crypto/openssh/5.3p1/kex.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/kex.h
  vendor-crypto/openssh/5.3p1/kexdhs.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/kexdhs.c
  vendor-crypto/openssh/5.3p1/kexgexs.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/kexgexs.c
  vendor-crypto/openssh/5.3p1/moduli.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/moduli.0
  vendor-crypto/openssh/5.3p1/monitor.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/monitor.c
  vendor-crypto/openssh/5.3p1/monitor_mm.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/monitor_mm.c
  vendor-crypto/openssh/5.3p1/monitor_wrap.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/monitor_wrap.c
  vendor-crypto/openssh/5.3p1/monitor_wrap.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/monitor_wrap.h
  vendor-crypto/openssh/5.3p1/openbsd-compat/bsd-cygwin_util.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/openbsd-compat/bsd-cygwin_util.c
  vendor-crypto/openssh/5.3p1/openbsd-compat/bsd-cygwin_util.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/openbsd-compat/bsd-cygwin_util.h
  vendor-crypto/openssh/5.3p1/openbsd-compat/daemon.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/openbsd-compat/daemon.c
  vendor-crypto/openssh/5.3p1/openbsd-compat/getrrsetbyname.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname.c
  vendor-crypto/openssh/5.3p1/openbsd-compat/openssl-compat.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/openbsd-compat/openssl-compat.c
  vendor-crypto/openssh/5.3p1/openbsd-compat/openssl-compat.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/openbsd-compat/openssl-compat.h
  vendor-crypto/openssh/5.3p1/openbsd-compat/port-aix.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/openbsd-compat/port-aix.c
  vendor-crypto/openssh/5.3p1/openbsd-compat/port-aix.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/openbsd-compat/port-aix.h
  vendor-crypto/openssh/5.3p1/packet.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/packet.c
  vendor-crypto/openssh/5.3p1/packet.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/packet.h
  vendor-crypto/openssh/5.3p1/readconf.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/readconf.c
  vendor-crypto/openssh/5.3p1/readconf.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/readconf.h
  vendor-crypto/openssh/5.3p1/schnorr.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/schnorr.c
  vendor-crypto/openssh/5.3p1/scp.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/scp.0
  vendor-crypto/openssh/5.3p1/servconf.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/servconf.c
  vendor-crypto/openssh/5.3p1/serverloop.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/serverloop.c
  vendor-crypto/openssh/5.3p1/session.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/session.c
  vendor-crypto/openssh/5.3p1/sftp-client.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sftp-client.c
  vendor-crypto/openssh/5.3p1/sftp-server.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sftp-server.0
  vendor-crypto/openssh/5.3p1/sftp-server.8
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sftp-server.8
  vendor-crypto/openssh/5.3p1/sftp-server.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sftp-server.c
  vendor-crypto/openssh/5.3p1/sftp.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sftp.0
  vendor-crypto/openssh/5.3p1/ssh-add.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh-add.0
  vendor-crypto/openssh/5.3p1/ssh-agent.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh-agent.0
  vendor-crypto/openssh/5.3p1/ssh-agent.1
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh-agent.1
  vendor-crypto/openssh/5.3p1/ssh-agent.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh-agent.c
  vendor-crypto/openssh/5.3p1/ssh-keygen.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh-keygen.0
  vendor-crypto/openssh/5.3p1/ssh-keygen.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh-keygen.c
  vendor-crypto/openssh/5.3p1/ssh-keyscan.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh-keyscan.0
  vendor-crypto/openssh/5.3p1/ssh-keysign.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh-keysign.0
  vendor-crypto/openssh/5.3p1/ssh-rand-helper.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh-rand-helper.0
  vendor-crypto/openssh/5.3p1/ssh.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh.0
  vendor-crypto/openssh/5.3p1/ssh.1
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh.1
  vendor-crypto/openssh/5.3p1/ssh.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh.c
  vendor-crypto/openssh/5.3p1/ssh_config.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/ssh_config.0
  vendor-crypto/openssh/5.3p1/sshconnect.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sshconnect.c
  vendor-crypto/openssh/5.3p1/sshconnect.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sshconnect.h
  vendor-crypto/openssh/5.3p1/sshconnect2.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sshconnect2.c
  vendor-crypto/openssh/5.3p1/sshd.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sshd.0
  vendor-crypto/openssh/5.3p1/sshd.8
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sshd.8
  vendor-crypto/openssh/5.3p1/sshd.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sshd.c
  vendor-crypto/openssh/5.3p1/sshd_config.0
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sshd_config.0
  vendor-crypto/openssh/5.3p1/sshd_config.5
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sshd_config.5
  vendor-crypto/openssh/5.3p1/sshlogin.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/sshlogin.c
  vendor-crypto/openssh/5.3p1/uuencode.c
     - copied unchanged from r197670, vendor-crypto/openssh/dist/uuencode.c
  vendor-crypto/openssh/5.3p1/version.h
     - copied unchanged from r197670, vendor-crypto/openssh/dist/version.h

Copied: vendor-crypto/openssh/5.3p1/ChangeLog (from r197670, vendor-crypto/openssh/dist/ChangeLog)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor-crypto/openssh/5.3p1/ChangeLog	Thu Oct  1 15:22:34 2009	(r197671, copy of r197670, vendor-crypto/openssh/dist/ChangeLog)
@@ -0,0 +1,1648 @@
+20090926
+ - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+         [contrib/suse/openssh.spec] Update for release
+ - (djm) [README] update relnotes URL
+ - (djm) [packet.c] Restore EWOULDBLOCK handling that got lost somewhere
+ - (djm) Release 5.3p1
+
+20090911
+ - (dtucker) [configure.ac] Change the -lresolv check so it works on Mac OS X
+   10.6 (which doesn't have BIND8_COMPAT and thus uses res_9_query).  Patch
+   from jbasney at ncsa uiuc edu.
+
+20090908
+ - (djm) [serverloop.c] Fix test for server-assigned remote forwarding port
+   (-R 0:...); bz#1578, spotted and fix by gavin AT emf.net; ok dtucker@
+
+20090901
+ - (dtucker) [configure.ac] Bug #1639: use AC_PATH_PROG to search the path for
+   krb5-config if it's not in the location specified by --with-kerberos5.
+   Patch from jchadima at redhat.
+
+20090829
+ - (dtucker) [README.platform] Add text about development packages, based on
+   text from Chris Pepper in bug #1631.
+
+20090828
+ - dtucker [auth-sia.c] Roll back the change for bug #1241 as it apparently
+   causes problems in some Tru64 configurations.
+ - (djm) [sshd_config.5] downgrade mention of login.conf to be an example
+   and mention PAM as another provider for ChallengeResponseAuthentication;
+   bz#1408; ok dtucker@
+ - (djm) [sftp-server.c] bz#1535: accept ENOSYS as a fallback error when
+   attempting atomic rename(); ok dtucker@
+ - (djm) [Makefile.in] bz#1505: Solaris make(1) doesn't accept make variables
+   in argv, so pass them in the environment; ok dtucker@
+ - (dtucker) [channels.c configure.ac] Bug #1528: skip the tcgetattr call on
+    the pty master on Solaris, since it never succeeds and can hang if large
+    amounts of data is sent to the slave (eg a copy-paste).  Based on a patch
+    originally from Doke Scott, ok djm@
+ - (dtucker) [clientloop.c configure.ac defines.h] Make the client's IO buffer
+   size a compile-time option and set it to 64k on Cygwin, since Corinna
+   reports that it makes a significant difference to performance.  ok djm@
+ - (dtucker) [configure.ac] Fix the syntax of the Solaris tcgetattr entry.
+
+20090820
+ - (dtucker) [includes.h] Bug #1634: do not include system glob.h if we're not
+   using it since the type conflicts can cause problems on FreeBSD.  Patch
+   from Jonathan Chen.
+ - (dtucker) [session.c openbsd-compat/port-aix.h] Bugs #1249 and #1567: move
+   the setpcred call on AIX to immediately before the permanently_set_uid().
+   Ensures that we still have privileges when we call chroot and
+   pam_open_sesson.  Based on a patch from David Leonard.
+
+20090817
+ - (dtucker) [configure.ac] Check for headers before libraries for openssl an
+   zlib, which should make the errors slightly more meaningful on platforms
+   where there's separate "-devel" packages for those.
+ - (dtucker) [sshlogin.c openbsd-compat/port-aix.{c,h}] Bug #1595: make
+   PrintLastLog work on AIX.  Based in part on a patch from Miguel Sanders.
+
+20090729
+ - (tim) [contrib/cygwin/ssh-user-config] Change script to call correct error
+   function. Patch from Corinna Vinschen.
+
+20090713
+ - (dtucker) [openbsd-compat/getrrsetbyname.c] Reduce answer buffer size so it
+   fits into 16 bits to work around a bug in glibc's resolver where it masks
+   off the buffer size at 16 bits.  Patch from Hauke Lampe, ok djm jakob.
+
+20090712
+ - (dtucker) [configure.ac] Include sys/param.h for the sys/mount.h test,
+   prevents configure complaining on older BSDs.
+ - (dtucker [contrib/cygwin/ssh-{host,user}-config] Add license text. Patch
+   from Corinna Vinschen.
+ - (dtucker) [auth-pam.c] Bug #1534: move the deletion of PAM credentials on
+   logout to after the session close.  Patch from Anicka Bernathova,
+   originally from Andreas Schwab via Novelll ok djm.
+
+20090707
+ - (dtucker) [contrib/cygwin/ssh-host-config] better support for automated
+   scripts and fix usage of eval.  Patch from Corinna Vinschen.
+
+20090705
+ - (dtucker) OpenBSD CVS Sync
+   - andreas@cvs.openbsd.org 2009/06/27 09:29:06
+     [packet.h packet.c]
+     packet_bacup_state() and packet_restore_state() will be used to
+     temporarily save the current state ren resuming a suspended connection.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/06/27 09:32:43
+     [roaming_common.c roaming.h]
+     It may be necessary to retransmit some data when resuming, so add it
+     to a buffer when roaming is enabled.
+     Most of this code was written by Martin Forssen, maf at appgate dot com.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/06/27 09:35:06
+     [readconf.h readconf.c]
+     Add client option UseRoaming. It doesn't do anything yet but will
+     control whether the client tries to use roaming if enabled on the
+     server. From Martin Forssen.
+     ok markus@
+   - markus@cvs.openbsd.org 2009/06/30 14:54:40
+     [version.h]
+     crank version; ok deraadt
+   - dtucker@cvs.openbsd.org 2009/07/02 02:11:47
+     [ssh.c]
+     allow for long home dir paths (bz #1615).  ok deraadt
+     (based in part on a patch from jchadima at redhat)
+   - stevesk@cvs.openbsd.org 2009/07/05 19:28:33
+     [clientloop.c]
+     only send SSH2_MSG_DISCONNECT if we're in compat20; from dtucker@
+     ok deraadt@ markus@
+
+20090622
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2009/06/22 05:39:28
+     [monitor_wrap.c monitor_mm.c ssh-keygen.c auth2.c gss-genr.c sftp-client.c]
+     alphabetize includes; reduces diff vs portable and style(9).
+     ok stevesk djm
+     (Id sync only; these were already in order in -portable)
+
+20090621
+ - (dtucker) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2009/03/17 21:37:00
+     [ssh.c]
+     pass correct argv[0] to openlog(); ok djm@
+  - jmc@cvs.openbsd.org 2009/03/19 15:15:09
+     [ssh.1]
+     for "Ciphers", just point the reader to the keyword in ssh_config(5), just
+     as we do for "MACs": this stops us getting out of sync when the lists
+     change;
+     fixes documentation/6102, submitted by Peter J. Philipp
+     alternative fix proposed by djm
+     ok markus
+   - tobias@cvs.openbsd.org 2009/03/23 08:31:19
+     [ssh-agent.c]
+     Fixed a possible out-of-bounds memory access if the environment variable
+     SHELL is shorter than 3 characters.
+     with input by and ok dtucker
+   - tobias@cvs.openbsd.org 2009/03/23 19:38:04
+     [ssh-agent.c]
+     My previous commit didn't fix the problem at all, so stick at my first
+     version of the fix presented to dtucker.
+     Issue notified by Matthias Barkhoff (matthias dot barkhoff at gmx dot de).
+     ok dtucker
+   - sobrado@cvs.openbsd.org 2009/03/26 08:38:39
+     [sftp-server.8 sshd.8 ssh-agent.1]
+     fix a few typographical errors found by spell(1).
+     ok dtucker@, jmc@
+   - stevesk@cvs.openbsd.org 2009/04/13 19:07:44
+     [sshd_config.5]
+     fix possessive; ok djm@
+   - stevesk@cvs.openbsd.org 2009/04/14 16:33:42
+     [sftp-server.c]
+     remove unused option character from getopt() optstring; ok markus@
+   - jj@cvs.openbsd.org 2009/04/14 21:10:54
+     [servconf.c]
+     Fixed a few the-the misspellings in comments. Skipped a bunch in
+     binutils,gcc and so on. ok jmc@
+   - stevesk@cvs.openbsd.org 2009/04/17 19:23:06
+     [session.c]
+     use INTERNAL_SFTP_NAME for setproctitle() of in-process sftp-server;
+     ok djm@ markus@
+   - stevesk@cvs.openbsd.org 2009/04/17 19:40:17
+     [sshd_config.5]
+     clarify that even internal-sftp needs /dev/log for logging to work; ok
+     markus@
+   - jmc@cvs.openbsd.org 2009/04/18 18:39:10
+     [sshd_config.5]
+     tweak previous; ok stevesk
+   - stevesk@cvs.openbsd.org 2009/04/21 15:13:17
+     [sshd_config.5]
+     clarify we cd to user's home after chroot; ok markus@ on
+     earlier version; tweaks and ok jmc@
+   - andreas@cvs.openbsd.org 2009/05/25 06:48:01
+     [channels.c packet.c clientloop.c packet.h serverloop.c monitor_wrap.c
+     monitor.c]
+     Put the globals in packet.c into a struct and don't access it directly
+     from other files. No functional changes.
+     ok markus@ djm@
+   - andreas@cvs.openbsd.org 2009/05/27 06:31:25
+     [canohost.h canohost.c]
+     Add clear_cached_addr(), needed for upcoming changes allowing the peer
+     address to change.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:33:39
+     [clientloop.c]
+     Send SSH2_MSG_DISCONNECT when the client disconnects. From a larger
+     change from Martin Forssen, maf at appgate dot com.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:34:36
+     [kex.c kex.h]
+     Move the KEX_COOKIE_LEN define to kex.h
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:36:07
+     [packet.h packet.c]
+     Add packet_put_int64() and packet_get_int64(), part of a larger change
+     from Martin Forssen.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:38:16
+     [sshconnect.h sshconnect.c]
+     Un-static ssh_exchange_identification(), part of a larger change from
+     Martin Forssen and needed for upcoming changes.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/28 16:50:16
+     [sshd.c packet.c serverloop.c monitor_wrap.c clientloop.c sshconnect.c
+     monitor.c Added roaming.h roaming_common.c roaming_dummy.c]
+     Keep track of number of bytes read and written. Needed for upcoming
+     changes. Most code from Martin Forssen, maf at appgate dot com.
+     ok markus@
+     Also, applied appropriate changes to Makefile.in
+   - andreas@cvs.openbsd.org 2009/06/12 20:43:22
+     [monitor.c packet.c]
+     Fix warnings found by chl@ and djm@ and change roaming_atomicio's
+     return type to match atomicio's
+     Diff from djm@, ok markus@
+   - andreas@cvs.openbsd.org 2009/06/12 20:58:32
+     [packet.c]
+     Move some more statics into session_state
+     ok markus@ djm@
+   - dtucker@cvs.openbsd.org 2009/06/21 07:37:15
+     [kexdhs.c kexgexs.c]
+     abort if key_sign fails, preventing possible null deref.  Based on report
+     from Paolo Ganci, ok markus@ djm@
+   - dtucker@cvs.openbsd.org 2009/06/21 09:04:03
+     [roaming.h roaming_common.c roaming_dummy.c]
+     Add  tags for the benefit of the sync scripts
+     Also: pull in the changes for 1.1->1.2 missed in the previous sync.
+ - (dtucker) [auth2-jpake.c auth2.c canohost.h session.c] Whitespace and
+   header-order changes to reduce diff vs OpenBSD.
+ - (dtucker) [servconf.c sshd.c] More whitespace sync.
+ - (dtucker) [roaming_common.c roaming_dummy.c] Wrap #include  in
+   ifdef.
+
+20090616
+ - (dtucker) [configure.ac defines.h] Bug #1607: handle the case where fsid_t
+   is a struct with a __val member.  Fixes build on, eg, Redhat 6.2.
+
+20090504
+ - (dtucker) [sshlogin.c] Move the NO_SSH_LASTLOG #ifndef line to include
+   variable declarations.  Should prevent unused warnings anywhere it's set
+   (only Crays as far as I can tell) and be a no-op everywhere else.
+
+20090318
+ - (tim) [configure.ac] Remove setting IP_TOS_IS_BROKEN for Cygwin. The problem
+   that setsockopt(IP_TOS) doesn't work on Cygwin has been fixed since 2005.
+   Based on patch from vinschen at redhat com.
+
+20090308
+ - (dtucker) [auth-passwd.c auth1.c auth2-kbdint.c auth2-none.c auth2-passwd.c
+   auth2-pubkey.c session.c openbsd-compat/bsd-cygwin_util.{c,h}
+   openbsd-compat/daemon.c] Remove support for Windows 95/98/ME and very old
+   version of Cygwin.  Patch from vinschen at redhat com.
+
+20090307
+ - (dtucker) [contrib/aix/buildbff.sh] Only try to rename ssh_prng_cmds if it
+   exists (it's not created if OpenSSL's PRNG is self-seeded, eg if the OS
+   has a /dev/random).
+ - (dtucker) [schnorr.c openbsd-compat/openssl-compat.{c,h}] Add
+   EVP_DigestUpdate to the OLD_EVP compatibility functions and tell schnorr.c
+   to use them.  Allows building with older OpenSSL versions.
+ - (dtucker) [configure.ac defines.h] Check for in_port_t and typedef if needed.
+ - (dtucker) [configure.ac] Missing comma in type list.
+ - (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}]
+   EVP_DigestUpdate does not exactly match the other OLD_EVP functions (eg
+   in openssl 0.9.6) so add an explicit test for it.
+
+20090306
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2009/03/05 07:18:19
+     [auth2-jpake.c jpake.c jpake.h monitor_wrap.c monitor_wrap.h schnorr.c]
+     [sshconnect2.c]
+     refactor the (disabled) Schnorr proof code to make it a little more
+     generally useful
+   - djm@cvs.openbsd.org 2009/03/05 11:30:50
+     [uuencode.c]
+     document what these functions do so I don't ever have to recuse into
+     b64_pton/ntop to remember their return values
+
+20090223
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2009/02/22 23:50:57
+     [ssh_config.5 sshd_config.5]
+     don't advertise experimental options
+   - djm@cvs.openbsd.org 2009/02/22 23:59:25
+     [sshd_config.5]
+     missing period
+   - djm@cvs.openbsd.org 2009/02/23 00:06:15
+     [version.h]
+     openssh-5.2
+ - (djm) [README] update for 5.2
+ - (djm) Release openssh-5.2p1
+
+20090222
+ - (djm) OpenBSD CVS Sync
+   - tobias@cvs.openbsd.org 2009/02/21 19:32:04
+     [misc.c sftp-server-main.c ssh-keygen.c]
+     Added missing newlines in error messages.
+     ok dtucker
+
+20090221
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2009/02/17 01:28:32
+     [ssh_config]
+     sync with revised default ciphers; pointed out by dkrause@
+   - djm@cvs.openbsd.org 2009/02/18 04:31:21
+     [schnorr.c]
+     signature should hash over the entire group, not just the generator
+     (this is still disabled code)
+ - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+   [contrib/suse/openssh.spec] Prepare for 5.2p1
+
+20090216
+ - (djm) [regress/conch-ciphers.sh regress/putty-ciphers.sh]
+   [regress/putty-kex.sh regress/putty-transfer.sh] Downgrade disabled
+   interop tests from FATAL error to a warning. Allows some interop
+   tests to proceed if others are missing necessary prerequisites.
+ - (djm) [configure.ac] support GNU/kFreeBSD and GNU/kOpensolaris
+   systems; patch from Aurelien Jarno via rmh AT aybabtu.com
+
+20090214
+ - (djm) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2009/02/02 11:15:14
+     [sftp.c]
+     Initialize a few variables to prevent spurious "may be used
+     uninitialized" warnings from newer gcc's.  ok djm@
+   - djm@cvs.openbsd.org 2009/02/12 03:00:56
+     [canohost.c canohost.h channels.c channels.h clientloop.c readconf.c]
+     [readconf.h serverloop.c ssh.c]
+     support remote port forwarding with a zero listen port (-R0:...) to
+     dyamically allocate a listen port at runtime (this is actually
+     specified in rfc4254); bz#1003 ok markus@
+   - djm@cvs.openbsd.org 2009/02/12 03:16:01
+     [serverloop.c]
+     tighten check for -R0:... forwarding: only allow dynamic allocation
+     if want_reply is set in the packet
+   - djm@cvs.openbsd.org 2009/02/12 03:26:22
+     [monitor.c]
+     some paranoia: check that the serialised key is really KEY_RSA before
+     diddling its internals
+   - djm@cvs.openbsd.org 2009/02/12 03:42:09
+     [ssh.1]
+     document -R0:... usage
+   - djm@cvs.openbsd.org 2009/02/12 03:44:25
+     [ssh.1]
+     consistency: Dq => Ql
+   - djm@cvs.openbsd.org 2009/02/12 03:46:17
+     [ssh_config.5]
+     document RemoteForward usage with 0 listen port
+   - jmc@cvs.openbsd.org 2009/02/12 07:34:20
+     [ssh_config.5]
+     kill trailing whitespace;
+   - markus@cvs.openbsd.org 2009/02/13 11:50:21
+     [packet.c]
+     check for enc !=NULL in packet_start_discard
+   - djm@cvs.openbsd.org 2009/02/14 06:35:49
+     [PROTOCOL]
+     mention that eow and no-more-sessions extensions are sent only to
+     OpenSSH peers
+
+20090212
+ - (djm) [sshpty.c] bz#1419: OSX uses cloning ptys that automagically
+   set ownership and modes, so avoid explicitly setting them
+ - (djm) [configure.ac loginrec.c] bz#1421: fix lastlog support for OSX.
+   OSX provides a getlastlogxbyname function that automates the reading of
+   a lastlog file. Also, the pututxline function will update lastlog so
+   there is no need for loginrec.c to do it explicitly. Collapse some
+   overly verbose code while I'm in there.
+
+20090201
+ - (dtucker) [defines.h sshconnect.c] INET6_ADDRSTRLEN is now needed in
+   channels.c too, so move the definition for non-IP6 platforms to defines.h
+   where it can be shared.
+
+20090129
+ - (tim) [contrib/cygwin/ssh-host-config] Patch from Corinna Vinschen.
+   If the CYGWIN environment variable is empty, the installer script
+   should not install the service with an empty CYGWIN variable, but
+   rather without setting CYGWNI entirely.
+ - (tim) [contrib/cygwin/ssh-host-config] Whitespace cleanup. No code changes.
+
+20090128
+ - (tim) [contrib/cygwin/ssh-host-config] Patch from Corinna Vinschen.
+   Changes to work on Cygwin 1.5.x as well as on the new Cygwin 1.7.x.
+   The information given for the setting of the CYGWIN environment variable
+   is wrong for both releases so I just removed it, together with the
+   unnecessary (Cygwin 1.5.x) or wrong (Cygwin 1.7.x) default setting.
+
+20081228
+ - (djm) OpenBSD CVS Sync
+   - stevesk@cvs.openbsd.org 2008/12/09 03:20:42
+     [channels.c servconf.c]
+     channel_print_adm_permitted_opens() should deal with all the printing
+     for that config option.  suggested by markus@; ok markus@ djm@
+     dtucker@
+   - djm@cvs.openbsd.org 2008/12/09 04:32:22
+     [auth2-chall.c]
+     replace by-hand string building with xasprinf(); ok deraadt@
+   - sobrado@cvs.openbsd.org 2008/12/09 15:35:00
+     [sftp.1 sftp.c]
+     update for the synopses displayed by the 'help' command, there are a
+     few missing flags; add 'bye' to the output of 'help'; sorting and spacing.
+     jmc@ suggested replacing .Oo/.Oc with a single .Op macro.
+     ok jmc@
+   - stevesk@cvs.openbsd.org 2008/12/09 22:37:33
+     [clientloop.c]
+     fix typo in error message
+   - stevesk@cvs.openbsd.org 2008/12/10 03:55:20
+     [addrmatch.c]
+     o cannot be NULL here but use xfree() to be consistent; ok djm@
+   - stevesk@cvs.openbsd.org 2008/12/29 01:12:36
+     [ssh-keyscan.1]
+     fix example, default key type is rsa for 3+ years; from
+     frederic.perrin@resel.fr
+   - stevesk@cvs.openbsd.org 2008/12/29 02:23:26
+     [pathnames.h]
+     no need to escape single quotes in comments
+   - okan@cvs.openbsd.org 2008/12/30 00:46:56
+     [sshd_config.5]
+     add AllowAgentForwarding to available Match keywords list
+     ok djm
+   - djm@cvs.openbsd.org 2009/01/01 21:14:35
+     [channels.c]
+     call channel destroy callbacks on receipt of open failure messages.
+     fixes client hangs when connecting to a server that has MaxSessions=0
+     set spotted by imorgan AT nas.nasa.gov; ok markus@
+   - djm@cvs.openbsd.org 2009/01/01 21:17:36
+     [kexgexs.c]
+     fix hash calculation for KEXGEX: hash over the original client-supplied
+     values and not the sanity checked versions that we acutally use;
+     bz#1540 reported by john.smith AT arrows.demon.co.uk
+     ok markus@
+   - djm@cvs.openbsd.org 2009/01/14 01:38:06
+     [channels.c]
+     support SOCKS4A protocol, from dwmw2 AT infradead.org via bz#1482;
+     "looks ok" markus@
+   - stevesk@cvs.openbsd.org 2009/01/15 17:38:43
+     [readconf.c]
+     1) use obsolete instead of alias for consistency
+     2) oUserKnownHostsFile not obsolete but oGlobalKnownHostsFile2 is
+        so move the comment.
+     3) reorder so like options are together
+     ok djm@
+   - djm@cvs.openbsd.org 2009/01/22 09:46:01
+     [channels.c channels.h session.c]
+     make Channel->path an allocated string, saving a few bytes here and
+     there and fixing bz#1380 in the process; ok markus@
+   - djm@cvs.openbsd.org 2009/01/22 09:49:57
+     [channels.c]
+     oops! I committed the wrong version of the Channel->path diff,
+     it was missing some tweaks suggested by stevesk@
+   - djm@cvs.openbsd.org 2009/01/22 10:02:34
+     [clientloop.c misc.c readconf.c readconf.h servconf.c servconf.h]
+     [serverloop.c ssh-keyscan.c ssh.c sshd.c]
+     make a2port() return -1 when it encounters an invalid port number
+     rather than 0, which it will now treat as valid (needed for future work)
+     adjust current consumers of a2port() to check its return value is <= 0,
+     which in turn required some things to be converted from u_short => int
+     make use of int vs. u_short consistent in some other places too
+     feedback & ok markus@
+   - djm@cvs.openbsd.org 2009/01/22 10:09:16
+     [auth-options.c]
+     another chunk of a2port() diff that got away. wtfdjm??
+   - djm@cvs.openbsd.org 2009/01/23 07:58:11
+     [myproposal.h]
+     prefer CTR modes and revised arcfour (i.e w/ discard) modes to CBC
+     modes; ok markus@
+   - naddy@cvs.openbsd.org 2009/01/24 17:10:22
+     [ssh_config.5 sshd_config.5]
+     sync list of preferred ciphers; ok djm@
+   - markus@cvs.openbsd.org 2009/01/26 09:58:15
+     [cipher.c cipher.h packet.c]
+     Work around the CPNI-957037 Plaintext Recovery Attack by always
+     reading 256K of data on packet size or HMAC errors (in CBC mode only).
+     Help, feedback and ok djm@
+     Feedback from Martin Albrecht and Paterson Kenny
+
+20090107
+ - (djm) [uidswap.c] bz#1412: Support >16 supplemental groups in OS X.
+   Patch based on one from vgiffin AT apple.com; ok dtucker@
+ - (djm) [channels.c] bz#1419: support "on demand" X11 forwarding via
+   launchd on OS X; patch from vgiffin AT apple.com, slightly tweaked;
+   ok dtucker@
+ - (djm) [contrib/ssh-copy-id.1 contrib/ssh-copy-id] bz#1492: Make
+   ssh-copy-id copy id_rsa.pub by default (instead of the legacy "identity"
+   key). Patch from cjwatson AT debian.org
+
+20090107
+ - (tim) [configure.ac defines.h openbsd-compat/port-uw.c
+   openbsd-compat/xcrypt.c] Add SECUREWARE support to OpenServer 6 SVR5 ABI.
+   OK djm@ dtucker@
+ - (tim) [configure.ac] Move check_for_libcrypt_later=1 in *-*-sysv5*) section.
+   OpenServer 6 doesn't need libcrypt.
+
+20081209
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2008/12/09 02:38:18
+     [clientloop.c]
+     The ~C escape handler does not work correctly for multiplexed sessions -
+     it opens a commandline on the master session, instead of on the slave
+     that requested it. Disable it on slave sessions until such time as it
+     is fixed; bz#1543 report from Adrian Bridgett via Colin Watson
+     ok markus@
+   - djm@cvs.openbsd.org 2008/12/09 02:39:59
+     [sftp.c]
+     Deal correctly with failures in remote stat() operation in sftp,
+     correcting fail-on-error behaviour in batchmode. bz#1541 report and
+     fix from anedvedicky AT gmail.com; ok markus@
+   - djm@cvs.openbsd.org 2008/12/09 02:58:16
+     [readconf.c]
+     don't leave junk (free'd) pointers around in Forward *fwd argument on
+     failure; avoids double-free in ~C -L handler when given an invalid
+     forwarding specification; bz#1539 report from adejong AT debian.org
+     via Colin Watson; ok markus@ dtucker@
+   - djm@cvs.openbsd.org 2008/12/09 03:02:37
+     [sftp.1 sftp.c]
+     correct sftp(1) and corresponding usage syntax;
+     bz#1518 patch from imorgan AT nas.nasa.gov; ok deraadt@ improved diff jmc@
+
+20081208
+ - (djm) [configure.ac] bz#1538: better test for ProPolice/SSP: actually
+   use some stack in main().
+   Report and suggested fix from vapier AT gentoo.org
+ - (djm) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2008/12/02 19:01:07
+     [clientloop.c]
+     we have to use the recipient's channel number (RFC 4254) for
+     SSH2_MSG_CHANNEL_SUCCESS/SSH2_MSG_CHANNEL_FAILURE messages,
+     otherwise we trigger 'Non-public channel' error messages on sshd
+     systems with clientkeepalive enabled; noticed by sturm; ok djm;
+   - markus@cvs.openbsd.org 2008/12/02 19:08:59
+     [serverloop.c]
+     backout 1.149, since it's not necessary and openssh clients send
+     broken CHANNEL_FAILURE/SUCCESS messages since about 2004; ok djm@
+   - markus@cvs.openbsd.org 2008/12/02 19:09:38
+     [channels.c]
+     s/remote_id/id/ to be more consistent with other code; ok djm@
+
+20081201
+ - (dtucker) [contrib/cygwin/{Makefile,ssh-host-config}]  Add new doc files
+   and tweak the is-sshd-running check in ssh-host-config.  Patch from
+   vinschen at redhat com.
+ - (dtucker) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2008/11/21 15:47:38
+     [packet.c]
+     packet_disconnect() on padding error, too.  should reduce the success
+     probability for the CPNI-957037 Plaintext Recovery Attack to 2^-18
+     ok djm@
+   - dtucker@cvs.openbsd.org 2008/11/30 11:59:26
+     [monitor_fdpass.c]
+     Retry sendmsg/recvmsg on EAGAIN and EINTR; ok djm@
+
+20081123
+ - (dtucker) [monitor_fdpass.c] Reduce diff vs OpenBSD by moving some
+    declarations, removing an unnecessary union member and adding whitespace.
+    cmsgbuf.tmp thing spotted by des at des no, ok djm some time ago.
+
+20081118
+ - (tim) [addrmatch.c configure.ac] Some platforms do not have sin6_scope_id
+   member of sockaddr_in6. Also reported in Bug 1491 by David Leonard. OK and
+   feedback by djm@
+
+20081111
+ - (dtucker) OpenBSD CVS Sync
+   - jmc@cvs.openbsd.org 2008/11/05 11:22:54
+     [servconf.c]
+     passord -> password;
+     fixes user/5975 from Rene Maroufi
+   - stevesk@cvs.openbsd.org 2008/11/07 00:42:12
+     [ssh-keygen.c]
+     spelling/typo in comment
+   - stevesk@cvs.openbsd.org 2008/11/07 18:50:18
+     [nchan.c]
+     add space to some log/debug messages for readability; ok djm@ markus@
+   - dtucker@cvs.openbsd.org 2008/11/07 23:34:48
+     [auth2-jpake.c]
+     Move JPAKE define to make life easier for portable.  ok djm@
+   - tobias@cvs.openbsd.org 2008/11/09 12:34:47
+     [session.c ssh.1]
+     typo fixed (overriden -> overridden)
+     ok espie, jmc
+   - stevesk@cvs.openbsd.org 2008/11/11 02:58:09
+     [servconf.c]
+     USE_AFS not referenced so remove #ifdef.  fixes sshd -T not printing
+     kerberosgetafstoken. ok dtucker@
+     (Id sync only, we still want the ifdef in portable)
+   - stevesk@cvs.openbsd.org 2008/11/11 03:55:11
+     [channels.c]
+     for sshd -T print 'permitopen any' vs. 'permitopen' for case of no
+     permitopen's; ok and input dtucker@
+   - djm@cvs.openbsd.org 2008/11/10 02:06:35
+     [regress/putty-ciphers.sh]
+     PuTTY supports AES CTR modes, so interop test against them too
+
+20081105
+ - OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2008/11/03 08:59:41
+     [servconf.c]
+     include MaxSessions in sshd -T output; patch from imorgan AT nas.nasa.gov
+   - djm@cvs.openbsd.org 2008/11/04 07:58:09
+     [auth.c]
+     need unistd.h for close() prototype
+     (ID sync only)
+   - djm@cvs.openbsd.org 2008/11/04 08:22:13
+     [auth.h auth2.c monitor.c monitor.h monitor_wrap.c monitor_wrap.h]
+     [readconf.c readconf.h servconf.c servconf.h ssh2.h ssh_config.5]
+     [sshconnect2.c sshd_config.5 jpake.c jpake.h schnorr.c auth2-jpake.c]
+     [Makefile.in]
+     Add support for an experimental zero-knowledge password authentication
+     method using the J-PAKE protocol described in F. Hao, P. Ryan,
+     "Password Authenticated Key Exchange by Juggling", 16th Workshop on
+     Security Protocols, Cambridge, April 2008.
+     
+     This method allows password-based authentication without exposing
+     the password to the server. Instead, the client and server exchange
+     cryptographic proofs to demonstrate of knowledge of the password while
+     revealing nothing useful to an attacker or compromised endpoint.
+     
+     This is experimental, work-in-progress code and is presently
+     compiled-time disabled (turn on -DJPAKE in Makefile.inc).
+     
+     "just commit it.  It isn't too intrusive." deraadt@
+   - stevesk@cvs.openbsd.org 2008/11/04 19:18:00
+     [readconf.c]
+     because parse_forward() is now used to parse all forward types (DLR),
+     and it malloc's space for host variables, we don't need to malloc
+     here.  fixes small memory leaks.
+     
+     previously dynamic forwards were not parsed in parse_forward() and
+     space was not malloc'd in that case.
+     
+     ok djm@
+   - stevesk@cvs.openbsd.org 2008/11/05 03:23:09
+     [clientloop.c ssh.1]
+     add dynamic forward escape command line; ok djm@
+
+20081103
+ - OpenBSD CVS Sync
+   - sthen@cvs.openbsd.org 2008/07/24 23:55:30
+     [ssh-keygen.1]
+     Add "ssh-keygen -F -l" to synopsis (displays fingerprint from
+     known_hosts).  ok djm@
+   - grunk@cvs.openbsd.org 2008/07/25 06:56:35
+     [ssh_config]
+     Add VisualHostKey to example file, ok djm@
+   - grunk@cvs.openbsd.org 2008/07/25 07:05:16
+     [key.c]
+     In random art visualization, make sure to use the end marker only at the
+     end.  Initial diff by Dirk Loss, tweaks and ok djm@
+  - markus@cvs.openbsd.org 2008/07/31 14:48:28
+     [sshconnect2.c]
+     don't allocate space for empty banners; report t8m at centrum.cz;
+     ok deraadt
+   - krw@cvs.openbsd.org 2008/08/02 04:29:51
+     [ssh_config.5]
+     whitepsace -> whitespace. From Matthew Clarke via bugs@.
+   - djm@cvs.openbsd.org 2008/08/21 04:09:57
+     [session.c]
+     allow ForceCommand internal-sftp with arguments. based on patch from
+     michael.barabanov AT gmail.com; ok markus@
+   - djm@cvs.openbsd.org 2008/09/06 12:24:13
+     [kex.c]
+     OpenSSL 0.9.8h supplies a real EVP_sha256 so we do not need our
+     replacement anymore
+     (ID sync only for portable - we still need this)
+   - markus@cvs.openbsd.org 2008/09/11 14:22:37
+     [compat.c compat.h nchan.c ssh.c]
+     only send eow and no-more-sessions requests to openssh 5 and newer;
+     fixes interop problems with broken ssh v2 implementations; ok djm@
+   - millert@cvs.openbsd.org 2008/10/02 14:39:35
+     [session.c]
+     Convert an unchecked strdup to xstrdup.  OK deraadt@
+  - jmc@cvs.openbsd.org 2008/10/03 13:08:12
+     [sshd.8]
+     do not give an example of how to chmod files: we can presume the user
+     knows that. removes an ambiguity in the permission of authorized_keys;
+     ok deraadt
+   - deraadt@cvs.openbsd.org 2008/10/03 23:56:28
+     [sshconnect2.c]
+     Repair strnvis() buffersize of 4*n+1, with termination gauranteed by the
+     function.
+     spotted by des@freebsd, who commited an incorrect fix to the freebsd tree
+     and (as is fairly typical) did not report the problem to us.  But this fix
+     is correct.
+     ok djm
+   - djm@cvs.openbsd.org 2008/10/08 23:34:03
+     [ssh.1 ssh.c]
+     Add -y option to force logging via syslog rather than stderr.
+     Useful for daemonised ssh connection (ssh -f). Patch originally from
+     and ok'd by markus@
+   - djm@cvs.openbsd.org 2008/10/09 03:50:54
+     [servconf.c sshd_config.5]
+     support setting PermitEmptyPasswords in a Match block
+     requested in PR3891; ok dtucker@
+   - jmc@cvs.openbsd.org 2008/10/09 06:54:22
+     [ssh.c]
+     add -y to usage();
+   - stevesk@cvs.openbsd.org 2008/10/10 04:55:16
+     [scp.c]
+     spelling in comment; ok djm@
+   - stevesk@cvs.openbsd.org 2008/10/10 05:00:12
+     [key.c]
+     typo in error message; ok djm@
+   - stevesk@cvs.openbsd.org 2008/10/10 16:43:27
+     [ssh_config.5]
+     use 'Privileged ports can be forwarded only when logging in as root on
+     the remote machine.' for RemoteForward just like ssh.1 -R.
+     ok djm@ jmc@
+   - stevesk@cvs.openbsd.org 2008/10/14 18:11:33
+     [sshconnect.c]
+     use #define ROQUIET here; no binary change. ok dtucker@
+   - stevesk@cvs.openbsd.org 2008/10/17 18:36:24
+     [ssh_config.5]
+     correct and clarify VisualHostKey; ok jmc@
+   - stevesk@cvs.openbsd.org 2008/10/30 19:31:16
+     [clientloop.c sshd.c]
+     don't need to #include "monitor_fdpass.h"
+   - stevesk@cvs.openbsd.org 2008/10/31 15:05:34
+     [dispatch.c]
+     remove unused #define DISPATCH_MIN; ok markus@
+   - djm@cvs.openbsd.org 2008/11/01 04:50:08
+     [sshconnect2.c]
+     sprinkle ARGSUSED on dispatch handlers
+     nuke stale unusued prototype
+   - stevesk@cvs.openbsd.org 2008/11/01 06:43:33
+     [channels.c]
+     fix some typos in log messages; ok djm@
+   - sobrado@cvs.openbsd.org 2008/11/01 11:14:36
+     [ssh-keyscan.1 ssh-keyscan.c]
+     the ellipsis is not an optional argument; while here, improve spacing.
+   - stevesk@cvs.openbsd.org 2008/11/01 17:40:33
+     [clientloop.c readconf.c readconf.h ssh.c]
+     merge dynamic forward parsing into parse_forward();
+     'i think this is OK' djm@
+   - stevesk@cvs.openbsd.org 2008/11/02 00:16:16
+     [ttymodes.c]
+     protocol 2 tty modes support is now 7.5 years old so remove these
+     debug3()s; ok deraadt@
+   - stevesk@cvs.openbsd.org 2008/11/03 01:07:02
+     [readconf.c]
+     remove valueless comment
+   - stevesk@cvs.openbsd.org 2008/11/03 02:44:41
+     [readconf.c]
+     fix comment
+ - (djm) [contrib/caldera/ssh-host-keygen contrib/suse/rc.sshd]
+   Make example scripts generate keys with default sizes rather than fixed,
+   non-default 1024 bits; patch from imorgan AT nas.nasa.gov
+ - (djm) [contrib/sshd.pam.generic contrib/caldera/sshd.pam]
+   [contrib/redhat/sshd.pam] Move pam_nologin to account group from
+   incorrect auth group in example files;
+   patch from imorgan AT nas.nasa.gov
+
+20080906
+ - (dtucker) [config.guess config.sub] Update to latest versions from
+   http://git.savannah.gnu.org/gitweb/ (2008-04-14 and 2008-06-16
+   respectively).
+
+20080830
+ - (dtucker) [openbsd-compat/bsd-poll.c] correctly check for number of FDs
+   larger than FD_SETSIZE (OpenSSH only ever uses poll with one fd).  Patch
+   from Nicholas Marriott.
+
+20080721
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2008/07/23 07:36:55
+     [servconf.c]
+     do not try to print options that have been compile-time disabled
+     in config test mode (sshd -T); report from nix-corp AT esperi.org.uk
+     ok dtucker@
+ - (djm) [servconf.c] Print UsePAM option in config test mode (when it
+   has been compiled in); report from nix-corp AT esperi.org.uk
+   ok dtucker@
+
+20080721
+ - (djm) OpenBSD CVS Sync
+   - jmc@cvs.openbsd.org 2008/07/18 22:51:01
+     [sftp-server.8]
+     no need for .Pp before or after .Sh;
+   - djm@cvs.openbsd.org 2008/07/21 08:19:07
+     [version.h]
+     openssh-5.1
+ - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+   [contrib/suse/openssh.spec] Update version number in README and RPM specs
+ - (djm) Release OpenSSH-5.1
+
+20080717
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2008/07/17 08:48:00
+     [sshconnect2.c]
+     strnvis preauth banner; pointed out by mpf@ ok markus@
+   - djm@cvs.openbsd.org 2008/07/17 08:51:07
+     [auth2-hostbased.c]
+     strip trailing '.' from hostname when HostbasedUsesNameFromPacketOnly=yes
+     report and patch from res AT qoxp.net (bz#1200); ok markus@
+ - (dtucker) [openbsd-compat/bsd-cygwin_util.c]  Remove long-unneeded compat
+   code, replace with equivalent cygwin library call.  Patch from vinschen
+   at redhat.com, ok djm@.
+ - (djm) [sshconnect2.c] vis.h isn't available everywhere
+
+20080716
+ - OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2008/07/15 02:23:14
+     [sftp.1]
+     number of pipelined requests is now 64;
+     prodded by Iain.Morgan AT nasa.gov
+   - djm@cvs.openbsd.org 2008/07/16 11:51:14
+     [clientloop.c]
+     rename variable first_gc -> last_gc (since it is actually the last
+     in the list).
+   - djm@cvs.openbsd.org 2008/07/16 11:52:19
+     [channels.c]
+     this loop index should be automatic, not static
+
+20080714
+ - (djm) OpenBSD CVS Sync
+   - sthen@cvs.openbsd.org 2008/07/13 21:22:52
+     [ssh-keygen.c]
+     Change "ssh-keygen -F [host] -l" to not display random art unless
+     -v is also specified, making it consistent with the manual and other
+     uses of -l.
+     ok grunk@
+   - djm@cvs.openbsd.org 2008/07/13 22:13:07
+     [channels.c]
+     use struct sockaddr_storage instead of struct sockaddr for accept(2)
+     address argument. from visibilis AT yahoo.com in bz#1485; ok markus@
+   - djm@cvs.openbsd.org 2008/07/13 22:16:03
+     [sftp.c]
+     increase number of piplelined requests so they properly fill the
+     (recently increased) channel window. prompted by rapier AT psc.edu;
+     ok markus@
+   - djm@cvs.openbsd.org 2008/07/14 01:55:56
+     [sftp-server.8]
+     mention requirement for /dev/log inside chroot when using sftp-server
+     with ChrootDirectory
+ - (djm) [openbsd-compat/bindresvport.c] Rename variables s/sin/in/ to
+   avoid clash with sin(3) function; reported by
+   cristian.ionescu-idbohrn AT axis.com
+ - (djm) [openbsd-compat/rresvport.c] Add unistd.h for missing close()
+   prototype; reported by cristian.ionescu-idbohrn AT axis.com
+ - (djm) [umac.c] Rename variable s/buffer_ptr/bufp/ to avoid clash;
+   reported by cristian.ionescu-idbohrn AT axis.com
+ - (djm) [contrib/cygwin/Makefile contrib/cygwin/ssh-host-config]
+   [contrib/cygwin/ssh-user-config contrib/cygwin/sshd-inetd]
+   Revamped and simplified Cygwin ssh-host-config script that uses
+   unified csih configuration tool. Requires recent Cygwin.
+   Patch from vinschen AT redhat.com
+
+20080712
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2008/07/12 04:52:50
+     [channels.c]
+     unbreak; move clearing of cctx struct to before first use
+     reported by dkrause@
+   - djm@cvs.openbsd.org 2008/07/12 05:33:41
+     [scp.1]
+     better description for -i flag:
+     s/RSA authentication/public key authentication/
+ - (djm) [openbsd-compat/fake-rfc2553.c openbsd-compat/fake-rfc2553.h]
+   return EAI_FAMILY when trying to lookup unsupported address family;
+   from vinschen AT redhat.com
+
+20080711
+ - (djm) OpenBSD CVS Sync
+   - stevesk@cvs.openbsd.org 2008/07/07 00:31:41
+     [ttymodes.c]
+     we don't need arg after the debug3() was removed.  from lint.
+     ok djm@
+   - stevesk@cvs.openbsd.org 2008/07/07 23:32:51
+     [key.c]
+     /*NOTREACHED*/ for lint warning:
+       warning: function key_equal falls off bottom without returning value
+     ok djm@
+   - markus@cvs.openbsd.org 2008/07/10 18:05:58
+     [channels.c]
+     missing bzero; from mickey; ok djm@
+   - markus@cvs.openbsd.org 2008/07/10 18:08:11
+     [clientloop.c monitor.c monitor_wrap.c packet.c packet.h sshd.c]
+     sync v1 and v2 traffic accounting; add it to sshd, too;
+     ok djm@, dtucker@
+
+20080709
+ - (djm) [Makefile.in] Print "all tests passed" when all regress tests pass
+ - (djm) [auth1.c] Fix format string vulnerability in protocol 1 PAM
+   account check failure path. The vulnerable format buffer is supplied
+   from PAM and should not contain attacker-supplied data.
+ - (djm) [auth.c] Missing unistd.h for close()
+ - (djm) [configure.ac] Add -Wformat-security to CFLAGS for gcc 3.x and 4.x
+
+20080705
+ - (djm) [auth.c] Fixed test for locked account on HP/UX with shadowed
+   passwords disabled. bz#1083 report & patch from senthilkumar_sen AT
+   hotpop.com, w/ dtucker@
+ - (djm) [atomicio.c configure.ac] Disable poll() fallback in atomiciov for
+   Tru64. readv doesn't seem to be a comparable object there.
+   bz#1386, patch from dtucker@ ok me
+ - (djm) [Makefile.in] Pass though pass to conch for interop tests
+ - (djm) [configure.ac] unbreak: remove extra closing brace
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2008/07/04 23:08:25
+     [packet.c]
+     handle EINTR in packet_write_poll()l ok dtucker@
+   - djm@cvs.openbsd.org 2008/07/04 23:30:16
+     [auth1.c auth2.c]
+     Make protocol 1 MaxAuthTries logic match protocol 2's.
+     Do not treat the first protocol 2 authentication attempt as
+     a failure IFF it is for method "none".
+     Makes MaxAuthTries' user-visible behaviour identical for
+     protocol 1 vs 2.
+     ok dtucker@
+   - djm@cvs.openbsd.org 2008/07/05 05:16:01
+     [PROTOCOL]
+     grammar
+
+20080704
+ - (dtucker) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2008/07/02 13:30:34
+     [auth2.c]
+     really really remove the freebie "none" auth try for protocol 2
+   - djm@cvs.openbsd.org 2008/07/02 13:47:39
+     [ssh.1 ssh.c]
+     When forking after authentication ("ssh -f") with ExitOnForwardFailure
+     enabled, delay the fork until after replies for any -R forwards have
+     been seen. Allows for robust detection of -R forward failure when
+     using -f (similar to bz#92); ok dtucker@
+   - otto@cvs.openbsd.org 2008/07/03 21:46:58
+     [auth2-pubkey.c]
+     avoid nasty double free; ok dtucker@ djm@
+   - djm@cvs.openbsd.org 2008/07/04 03:44:59
+     [servconf.c groupaccess.h groupaccess.c]
+     support negation of groups in "Match group" block (bz#1315); ok dtucker@
+   - dtucker@cvs.openbsd.org 2008/07/04 03:47:02
+     [monitor.c]
+     Make debug a little clearer.  ok djm@
+   - djm@cvs.openbsd.org 2008/06/30 08:07:34
+     [regress/key-options.sh]
+     shell portability: use "=" instead of "==" in test(1) expressions,
+     double-quote string with backslash escaped /
+   - djm@cvs.openbsd.org 2008/06/30 10:31:11
+     [regress/{putty-transfer,putty-kex,putty-ciphers}.sh]
+     remove "set -e" left over from debugging
+   - djm@cvs.openbsd.org 2008/06/30 10:43:03
+     [regress/conch-ciphers.sh]
+     explicitly disable conch options that could interfere with the test
+ - (dtucker) [sftp-server.c] Bug #1447: fall back to racy rename if link
+   returns EXDEV.  Patch from Mike Garrison, ok djm@
+ - (djm) [atomicio.c channels.c clientloop.c defines.h includes.h]
+   [packet.c scp.c serverloop.c sftp-client.c ssh-agent.c ssh-keyscan.c]
+   [sshd.c] Explicitly handle EWOULDBLOCK wherever we handle EAGAIN, on
+   some platforms (HP nonstop) it is a distinct errno;
+   bz#1467 reported by sconeu AT yahoo.com; ok dtucker@
+
+20080702
+ - (dtucker) OpenBSD CVS Sync
+    - djm@cvs.openbsd.org 2008/06/30 08:05:59
+      [PROTOCOL.agent]
+      typo: s/constraint_date/constraint_data/
+   - djm@cvs.openbsd.org 2008/06/30 12:15:39
+     [serverloop.c]
+     only pass channel requests on session channels through to the session
+     channel handler, avoiding spurious log messages; ok! markus@
+   - djm@cvs.openbsd.org 2008/06/30 12:16:02
+     [nchan.c]
+     only send eow@openssh.com notifications for session channels; ok! markus@
+   - djm@cvs.openbsd.org 2008/06/30 12:18:34
+     [PROTOCOL]
+     clarify that eow@openssh.com is only sent on session channels
+   - dtucker@cvs.openbsd.org 2008/07/01 07:20:52
+     [sshconnect.c]
+     Check ExitOnForwardFailure if forwardings are disabled due to a failed
+     host key check.  ok djm@
+   - dtucker@cvs.openbsd.org 2008/07/01 07:24:22
+     [sshconnect.c sshd.c]
+     Send CR LF during protocol banner exchanges, but only for Protocol 2 only,
+     in order to comply with RFC 4253.  bz #1443, ok djm@
+   - stevesk@cvs.openbsd.org 2008/07/01 23:12:47
+     [PROTOCOL.agent]
+     fix some typos; ok djm@
+   - djm@cvs.openbsd.org 2008/07/02 02:24:18
+     [sshd_config sshd_config.5 sshd.8 servconf.c]
+     increase default size of ssh protocol 1 ephemeral key from 768 to 1024
+     bits; prodded by & ok dtucker@ ok deraadt@
+   - dtucker@cvs.openbsd.org 2008/07/02 12:03:51
+     [auth-rsa.c auth.c auth2-pubkey.c auth.h]
+     Merge duplicate host key file checks, based in part on a patch from Rob
+     Holland via bz #1348 .  Also checks for non-regular files during protocol
+     1 RSA auth.  ok djm@
+   - djm@cvs.openbsd.org 2008/07/02 12:36:39
+     [auth2-none.c auth2.c]
+     Make protocol 2 MaxAuthTries behaviour a little more sensible:
+     Check whether client has exceeded MaxAuthTries before running
+     an authentication method and skip it if they have, previously it
+     would always allow one try (for "none" auth).
+     Preincrement failure count before post-auth test - previously this
+     checked and postincremented, also to allow one "none" try.
+     Together, these two changes always count the "none" auth method
+     which could be skipped by a malicious client (e.g. an SSH worm)
+     to get an extra attempt at a real auth method. They also make

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 15:33:53 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A2BD1065670;
	Thu,  1 Oct 2009 15:33:53 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8960D8FC0A;
	Thu,  1 Oct 2009 15:33:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91FXr9C055905;
	Thu, 1 Oct 2009 15:33:53 GMT (envelope-from vanhu@svn.freebsd.org)
Received: (from vanhu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91FXron055903;
	Thu, 1 Oct 2009 15:33:53 GMT (envelope-from vanhu@svn.freebsd.org)
Message-Id: <200910011533.n91FXron055903@svn.freebsd.org>
From: VANHULLEBUS Yvan 
Date: Thu, 1 Oct 2009 15: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: r197674 - head/sys/netipsec
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 15:33:53 -0000

Author: vanhu
Date: Thu Oct  1 15:33:53 2009
New Revision: 197674
URL: http://svn.freebsd.org/changeset/base/197674

Log:
  Changed an IPSEC_ASSERT to a simple test, as such invalid packets
  may come from outside without being discarded before.
  
  Submitted by:	aurelien.ansel@netasq.com
  Reviewed by:	bz (secteam)
  Obtained from:	NETASQ
  MFC after:	1m

Modified:
  head/sys/netipsec/xform_esp.c

Modified: head/sys/netipsec/xform_esp.c
==============================================================================
--- head/sys/netipsec/xform_esp.c	Thu Oct  1 15:28:40 2009	(r197673)
+++ head/sys/netipsec/xform_esp.c	Thu Oct  1 15:33:53 2009	(r197674)
@@ -282,9 +282,15 @@ esp_input(struct mbuf *m, struct secasva
 
 	IPSEC_ASSERT(sav != NULL, ("null SA"));
 	IPSEC_ASSERT(sav->tdb_encalgxform != NULL, ("null encoding xform"));
-	IPSEC_ASSERT((skip&3) == 0 && (m->m_pkthdr.len&3) == 0,
-		("misaligned packet, skip %u pkt len %u",
-			skip, m->m_pkthdr.len));
+
+	/* Valid IP Packet length ? */
+	if ( (skip&3) || (m->m_pkthdr.len&3) ){
+		DPRINTF(("%s: misaligned packet, skip %u pkt len %u",
+				__func__, skip, m->m_pkthdr.len));
+		V_espstat.esps_badilen++;
+		m_freem(m);
+		return EINVAL;
+	}
 
 	/* XXX don't pullup, just copy header */
 	IP6_EXTHDR_GET(esp, struct newesp *, m, skip, sizeof (struct newesp));

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 15:40:09 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E6D2106566B;
	Thu,  1 Oct 2009 15:40:09 +0000 (UTC)
	(envelope-from gallatin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 32B928FC13;
	Thu,  1 Oct 2009 15:40:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91Fe9um056135;
	Thu, 1 Oct 2009 15:40:09 GMT (envelope-from gallatin@svn.freebsd.org)
Received: (from gallatin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91Fe9gg056132;
	Thu, 1 Oct 2009 15:40:09 GMT (envelope-from gallatin@svn.freebsd.org)
Message-Id: <200910011540.n91Fe9gg056132@svn.freebsd.org>
From: Andrew Gallatin 
Date: Thu, 1 Oct 2009 15:40: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: r197675 - in stable/7/sys: . contrib/pf dev/mxge
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 15:40:09 -0000

Author: gallatin
Date: Thu Oct  1 15:40:08 2009
New Revision: 197675
URL: http://svn.freebsd.org/changeset/base/197675

Log:
  MFC: more fixes for mxge watchdog reset handling (194761 197645)
  
  194761: Fix bug where device would loose promisc setting when reset.
  197645: Restore the PCI Express control register after reset

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/mxge/if_mxge.c
  stable/7/sys/dev/mxge/if_mxge_var.h

Modified: stable/7/sys/dev/mxge/if_mxge.c
==============================================================================
--- stable/7/sys/dev/mxge/if_mxge.c	Thu Oct  1 15:33:53 2009	(r197674)
+++ stable/7/sys/dev/mxge/if_mxge.c	Thu Oct  1 15:40:08 2009	(r197675)
@@ -1296,7 +1296,7 @@ mxge_reset(mxge_softc_t *sc, int interru
 	}
 	sc->rdma_tags_available = 15;
 	status = mxge_update_mac_address(sc);
-	mxge_change_promisc(sc, 0);
+	mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC);
 	mxge_change_pause(sc, sc->pause);
 	mxge_set_multicast_list(sc);
 	return status;
@@ -3419,10 +3419,16 @@ mxge_setup_cfg_space(mxge_softc_t *sc)
 	if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) {
 		lnk = pci_read_config(dev, reg + 0x12, 2);
 		sc->link_width = (lnk >> 4) & 0x3f;
-		
-		pectl = pci_read_config(dev, reg + 0x8, 2);
-		pectl = (pectl & ~0x7000) | (5 << 12);
-		pci_write_config(dev, reg + 0x8, pectl, 2);
+
+		if (sc->pectl == 0) {
+			pectl = pci_read_config(dev, reg + 0x8, 2);
+			pectl = (pectl & ~0x7000) | (5 << 12);
+			pci_write_config(dev, reg + 0x8, pectl, 2);
+			sc->pectl = pectl;
+		} else {
+			/* restore saved pectl after watchdog reset */
+			pci_write_config(dev, reg + 0x8, sc->pectl, 2);
+		}
 	}
 
 	/* Enable DMA and Memory space access */
@@ -3533,6 +3539,9 @@ mxge_watchdog_reset(mxge_softc_t *sc)
 			/* release all TX locks */
 			for (s = 0; s < num_tx_slices; s++) {
 				ss = &sc->ss[s];
+#ifdef IFNET_BUF_RING
+				mxge_start_locked(ss);
+#endif
 				mtx_unlock(&ss->tx.mtx);
 			}
 		}
@@ -3795,7 +3804,7 @@ mxge_fetch_tunables(mxge_softc_t *sc)
 		mxge_ticks = hz / 2;
 	sc->pause = mxge_flow_control;
 	if (mxge_rss_hash_type < MXGEFW_RSS_HASH_TYPE_IPV4 
-	    || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_SRC_PORT) {
+	    || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) {
 		mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT;
 	}
 }

Modified: stable/7/sys/dev/mxge/if_mxge_var.h
==============================================================================
--- stable/7/sys/dev/mxge/if_mxge_var.h	Thu Oct  1 15:33:53 2009	(r197674)
+++ stable/7/sys/dev/mxge/if_mxge_var.h	Thu Oct  1 15:40:08 2009	(r197675)
@@ -254,6 +254,7 @@ struct mxge_softc {
 	struct sysctl_ctx_list slice_sysctl_ctx;
 	char *mac_addr_string;
 	uint8_t	mac_addr[6];		/* eeprom mac address */
+	uint16_t pectl;			/* save PCIe CTL state */
 	char product_code_string[64];
 	char serial_number_string[64];
 	char cmd_mtx_name[16];

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 15:41:15 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 48863106566B;
	Thu,  1 Oct 2009 15:41:15 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout027.mac.com (asmtpout027.mac.com [17.148.16.102])
	by mx1.freebsd.org (Postfix) with ESMTP id 2D3B98FC17;
	Thu,  1 Oct 2009 15:41:15 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii; format=flowed
Received: from [172.24.241.233] (natint3.juniper.net [66.129.224.36])
	by asmtp027.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KQU00DP0E8OPD40@asmtp027.mac.com>; Thu,
	01 Oct 2009 08:41:14 -0700 (PDT)
From: Marcel Moolenaar 
In-reply-to: <20091001120652.GI50565@hades.panopticon>
Date: Thu, 01 Oct 2009 08:41:12 -0700
Message-id: 
References: <200909282352.n8SNql1n069970@svn.freebsd.org>
	<200909290749.08764.jhb@freebsd.org>
	<20090929145447.GA82539@hades.panopticon>
	<20090929235146.GA64567@hades.panopticon>
	
	<20091001120652.GI50565@hades.panopticon>
To: Dmitry Marakasov 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar ,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r197608 - 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: Thu, 01 Oct 2009 15:41:15 -0000


On Oct 1, 2009, at 5:06 AM, Dmitry Marakasov wrote:

> * Marcel Moolenaar (xcllnt@mac.com) wrote:
>
>>>> Seconded. I've seen a report of geom_part_ebr unable to detect
>>>> partitions which were actually there. Will inquiry the reporter if
>>>> this change solved the problem.
>>>
>>> Seems like it hasn't. Here's the first sector from that partition:
>>
>> I'll see about checking the partition table more rigorously
>> so that we can eliminate the check for the unused space.
>>
>> With what tool was this created?
>
> Dunno. I've pointed the person who had that problem to this thread.

It should not matter; I was just curious...

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 15:51:29 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9660F106568B;
	Thu,  1 Oct 2009 15:51:29 +0000 (UTC)
	(envelope-from gallatin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7AB198FC1F;
	Thu,  1 Oct 2009 15:51:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91FpTvs056480;
	Thu, 1 Oct 2009 15:51:29 GMT (envelope-from gallatin@svn.freebsd.org)
Received: (from gallatin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91FpTnj056477;
	Thu, 1 Oct 2009 15:51:29 GMT (envelope-from gallatin@svn.freebsd.org)
Message-Id: <200910011551.n91FpTnj056477@svn.freebsd.org>
From: Andrew Gallatin 
Date: Thu, 1 Oct 2009 15:51:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r197676 - in stable/6/sys: . conf contrib/pf dev/cxgb
	dev/mxge
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 15:51:29 -0000

Author: gallatin
Date: Thu Oct  1 15:51:29 2009
New Revision: 197676
URL: http://svn.freebsd.org/changeset/base/197676

Log:
  MFC: more fixes for mxge watchdog reset handling (194761 197645)
  
  194761: Fix bug where device would loose promisc setting when reset.
  197645: Restore the PCI Express control register after reset

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/conf/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/cxgb/   (props changed)
  stable/6/sys/dev/mxge/if_mxge.c
  stable/6/sys/dev/mxge/if_mxge_var.h

Modified: stable/6/sys/dev/mxge/if_mxge.c
==============================================================================
--- stable/6/sys/dev/mxge/if_mxge.c	Thu Oct  1 15:40:08 2009	(r197675)
+++ stable/6/sys/dev/mxge/if_mxge.c	Thu Oct  1 15:51:29 2009	(r197676)
@@ -1296,7 +1296,7 @@ mxge_reset(mxge_softc_t *sc, int interru
 	}
 	sc->rdma_tags_available = 15;
 	status = mxge_update_mac_address(sc);
-	mxge_change_promisc(sc, 0);
+	mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC);
 	mxge_change_pause(sc, sc->pause);
 	mxge_set_multicast_list(sc);
 	return status;
@@ -3420,10 +3420,16 @@ mxge_setup_cfg_space(mxge_softc_t *sc)
 	if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) {
 		lnk = pci_read_config(dev, reg + 0x12, 2);
 		sc->link_width = (lnk >> 4) & 0x3f;
-		
-		pectl = pci_read_config(dev, reg + 0x8, 2);
-		pectl = (pectl & ~0x7000) | (5 << 12);
-		pci_write_config(dev, reg + 0x8, pectl, 2);
+
+		if (sc->pectl == 0) {
+			pectl = pci_read_config(dev, reg + 0x8, 2);
+			pectl = (pectl & ~0x7000) | (5 << 12);
+			pci_write_config(dev, reg + 0x8, pectl, 2);
+			sc->pectl = pectl;
+		} else {
+			/* restore saved pectl after watchdog reset */
+			pci_write_config(dev, reg + 0x8, sc->pectl, 2);
+		}
 	}
 
 	/* Enable DMA and Memory space access */
@@ -3534,6 +3540,9 @@ mxge_watchdog_reset(mxge_softc_t *sc)
 			/* release all TX locks */
 			for (s = 0; s < num_tx_slices; s++) {
 				ss = &sc->ss[s];
+#ifdef IFNET_BUF_RING
+				mxge_start_locked(ss);
+#endif
 				mtx_unlock(&ss->tx.mtx);
 			}
 		}
@@ -3796,7 +3805,7 @@ mxge_fetch_tunables(mxge_softc_t *sc)
 		mxge_ticks = hz / 2;
 	sc->pause = mxge_flow_control;
 	if (mxge_rss_hash_type < MXGEFW_RSS_HASH_TYPE_IPV4 
-	    || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_SRC_PORT) {
+	    || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) {
 		mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT;
 	}
 }

Modified: stable/6/sys/dev/mxge/if_mxge_var.h
==============================================================================
--- stable/6/sys/dev/mxge/if_mxge_var.h	Thu Oct  1 15:40:08 2009	(r197675)
+++ stable/6/sys/dev/mxge/if_mxge_var.h	Thu Oct  1 15:51:29 2009	(r197676)
@@ -253,6 +253,7 @@ struct mxge_softc {
 	struct sysctl_ctx_list slice_sysctl_ctx;
 	char *mac_addr_string;
 	uint8_t	mac_addr[6];		/* eeprom mac address */
+	uint16_t pectl;			/* save PCIe CTL state */
 	char product_code_string[64];
 	char serial_number_string[64];
 	char cmd_mtx_name[16];

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 17:12:53 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3E771106566B;
	Thu,  1 Oct 2009 17:12:53 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 28B4C8FC08;
	Thu,  1 Oct 2009 17:12:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91HCrqV058573;
	Thu, 1 Oct 2009 17:12:53 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91HCqaT058548;
	Thu, 1 Oct 2009 17:12:52 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200910011712.n91HCqaT058548@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 1 Oct 2009 17: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: r197679 - in head: crypto/openssh
	crypto/openssh/openbsd-compat secure/libexec/sftp-server
	secure/libexec/ssh-keysign secure/usr.bin/scp
	secure/usr.bin/sftp secure/usr.bin/ssh secure/us...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 17:12:53 -0000

Author: des
Date: Thu Oct  1 17:12:52 2009
New Revision: 197679
URL: http://svn.freebsd.org/changeset/base/197679

Log:
  Upgrade to OpenSSH 5.3p1.

Added:
  head/crypto/openssh/roaming.h
     - copied unchanged from r197675, vendor-crypto/openssh/dist/roaming.h
  head/crypto/openssh/roaming_common.c
     - copied unchanged from r197675, vendor-crypto/openssh/dist/roaming_common.c
  head/crypto/openssh/roaming_dummy.c
     - copied unchanged from r197675, vendor-crypto/openssh/dist/roaming_dummy.c
  head/crypto/openssh/schnorr.h
     - copied unchanged from r197675, vendor-crypto/openssh/dist/schnorr.h
Modified:
  head/crypto/openssh/   (props changed)
  head/crypto/openssh/ChangeLog
  head/crypto/openssh/README
  head/crypto/openssh/README.platform
  head/crypto/openssh/auth-pam.c
  head/crypto/openssh/auth-passwd.c
  head/crypto/openssh/auth-sia.c
  head/crypto/openssh/auth1.c
  head/crypto/openssh/auth2-jpake.c
  head/crypto/openssh/auth2-kbdint.c
  head/crypto/openssh/auth2-none.c
  head/crypto/openssh/auth2-passwd.c
  head/crypto/openssh/auth2-pubkey.c
  head/crypto/openssh/auth2.c
  head/crypto/openssh/canohost.c
  head/crypto/openssh/canohost.h
  head/crypto/openssh/channels.c
  head/crypto/openssh/clientloop.c
  head/crypto/openssh/config.h
  head/crypto/openssh/config.h.in
  head/crypto/openssh/defines.h
  head/crypto/openssh/gss-genr.c
  head/crypto/openssh/includes.h
  head/crypto/openssh/jpake.c
  head/crypto/openssh/jpake.h
  head/crypto/openssh/kex.c
  head/crypto/openssh/kex.h
  head/crypto/openssh/kexdhs.c
  head/crypto/openssh/kexgexs.c
  head/crypto/openssh/monitor.c
  head/crypto/openssh/monitor_mm.c
  head/crypto/openssh/monitor_wrap.c
  head/crypto/openssh/monitor_wrap.h
  head/crypto/openssh/openbsd-compat/bsd-cygwin_util.c
  head/crypto/openssh/openbsd-compat/bsd-cygwin_util.h
  head/crypto/openssh/openbsd-compat/daemon.c
  head/crypto/openssh/openbsd-compat/getrrsetbyname.c
  head/crypto/openssh/openbsd-compat/openssl-compat.c
  head/crypto/openssh/openbsd-compat/openssl-compat.h
  head/crypto/openssh/openbsd-compat/port-aix.c
  head/crypto/openssh/openbsd-compat/port-aix.h
  head/crypto/openssh/packet.c
  head/crypto/openssh/packet.h
  head/crypto/openssh/readconf.c
  head/crypto/openssh/readconf.h
  head/crypto/openssh/schnorr.c
  head/crypto/openssh/servconf.c
  head/crypto/openssh/serverloop.c
  head/crypto/openssh/session.c
  head/crypto/openssh/sftp-client.c
  head/crypto/openssh/sftp-server.8
  head/crypto/openssh/sftp-server.c
  head/crypto/openssh/ssh-agent.1
  head/crypto/openssh/ssh-agent.c
  head/crypto/openssh/ssh-keygen.c
  head/crypto/openssh/ssh.1
  head/crypto/openssh/ssh.c
  head/crypto/openssh/ssh_config
  head/crypto/openssh/ssh_config.5
  head/crypto/openssh/ssh_namespace.h
  head/crypto/openssh/sshconnect.c
  head/crypto/openssh/sshconnect.h
  head/crypto/openssh/sshconnect2.c
  head/crypto/openssh/sshd.8
  head/crypto/openssh/sshd.c
  head/crypto/openssh/sshd_config
  head/crypto/openssh/sshd_config.5
  head/crypto/openssh/sshlogin.c
  head/crypto/openssh/uuencode.c
  head/crypto/openssh/version.h
  head/secure/libexec/sftp-server/Makefile
  head/secure/libexec/ssh-keysign/Makefile
  head/secure/usr.bin/scp/Makefile
  head/secure/usr.bin/sftp/Makefile
  head/secure/usr.bin/ssh-add/Makefile
  head/secure/usr.bin/ssh-agent/Makefile
  head/secure/usr.bin/ssh-keygen/Makefile
  head/secure/usr.bin/ssh-keyscan/Makefile
  head/secure/usr.bin/ssh/Makefile
  head/secure/usr.sbin/sshd/Makefile

Modified: head/crypto/openssh/ChangeLog
==============================================================================
--- head/crypto/openssh/ChangeLog	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/ChangeLog	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,3 +1,282 @@
+20090926
+ - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
+         [contrib/suse/openssh.spec] Update for release
+ - (djm) [README] update relnotes URL
+ - (djm) [packet.c] Restore EWOULDBLOCK handling that got lost somewhere
+ - (djm) Release 5.3p1
+
+20090911
+ - (dtucker) [configure.ac] Change the -lresolv check so it works on Mac OS X
+   10.6 (which doesn't have BIND8_COMPAT and thus uses res_9_query).  Patch
+   from jbasney at ncsa uiuc edu.
+
+20090908
+ - (djm) [serverloop.c] Fix test for server-assigned remote forwarding port
+   (-R 0:...); bz#1578, spotted and fix by gavin AT emf.net; ok dtucker@
+
+20090901
+ - (dtucker) [configure.ac] Bug #1639: use AC_PATH_PROG to search the path for
+   krb5-config if it's not in the location specified by --with-kerberos5.
+   Patch from jchadima at redhat.
+
+20090829
+ - (dtucker) [README.platform] Add text about development packages, based on
+   text from Chris Pepper in bug #1631.
+
+20090828
+ - dtucker [auth-sia.c] Roll back the change for bug #1241 as it apparently
+   causes problems in some Tru64 configurations.
+ - (djm) [sshd_config.5] downgrade mention of login.conf to be an example
+   and mention PAM as another provider for ChallengeResponseAuthentication;
+   bz#1408; ok dtucker@
+ - (djm) [sftp-server.c] bz#1535: accept ENOSYS as a fallback error when
+   attempting atomic rename(); ok dtucker@
+ - (djm) [Makefile.in] bz#1505: Solaris make(1) doesn't accept make variables
+   in argv, so pass them in the environment; ok dtucker@
+ - (dtucker) [channels.c configure.ac] Bug #1528: skip the tcgetattr call on
+    the pty master on Solaris, since it never succeeds and can hang if large
+    amounts of data is sent to the slave (eg a copy-paste).  Based on a patch
+    originally from Doke Scott, ok djm@
+ - (dtucker) [clientloop.c configure.ac defines.h] Make the client's IO buffer
+   size a compile-time option and set it to 64k on Cygwin, since Corinna
+   reports that it makes a significant difference to performance.  ok djm@
+ - (dtucker) [configure.ac] Fix the syntax of the Solaris tcgetattr entry.
+
+20090820
+ - (dtucker) [includes.h] Bug #1634: do not include system glob.h if we're not
+   using it since the type conflicts can cause problems on FreeBSD.  Patch
+   from Jonathan Chen.
+ - (dtucker) [session.c openbsd-compat/port-aix.h] Bugs #1249 and #1567: move
+   the setpcred call on AIX to immediately before the permanently_set_uid().
+   Ensures that we still have privileges when we call chroot and
+   pam_open_sesson.  Based on a patch from David Leonard.
+
+20090817
+ - (dtucker) [configure.ac] Check for headers before libraries for openssl an
+   zlib, which should make the errors slightly more meaningful on platforms
+   where there's separate "-devel" packages for those.
+ - (dtucker) [sshlogin.c openbsd-compat/port-aix.{c,h}] Bug #1595: make
+   PrintLastLog work on AIX.  Based in part on a patch from Miguel Sanders.
+
+20090729
+ - (tim) [contrib/cygwin/ssh-user-config] Change script to call correct error
+   function. Patch from Corinna Vinschen.
+
+20090713
+ - (dtucker) [openbsd-compat/getrrsetbyname.c] Reduce answer buffer size so it
+   fits into 16 bits to work around a bug in glibc's resolver where it masks
+   off the buffer size at 16 bits.  Patch from Hauke Lampe, ok djm jakob.
+
+20090712
+ - (dtucker) [configure.ac] Include sys/param.h for the sys/mount.h test,
+   prevents configure complaining on older BSDs.
+ - (dtucker [contrib/cygwin/ssh-{host,user}-config] Add license text. Patch
+   from Corinna Vinschen.
+ - (dtucker) [auth-pam.c] Bug #1534: move the deletion of PAM credentials on
+   logout to after the session close.  Patch from Anicka Bernathova,
+   originally from Andreas Schwab via Novelll ok djm.
+
+20090707
+ - (dtucker) [contrib/cygwin/ssh-host-config] better support for automated
+   scripts and fix usage of eval.  Patch from Corinna Vinschen.
+
+20090705
+ - (dtucker) OpenBSD CVS Sync
+   - andreas@cvs.openbsd.org 2009/06/27 09:29:06
+     [packet.h packet.c]
+     packet_bacup_state() and packet_restore_state() will be used to
+     temporarily save the current state ren resuming a suspended connection.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/06/27 09:32:43
+     [roaming_common.c roaming.h]
+     It may be necessary to retransmit some data when resuming, so add it
+     to a buffer when roaming is enabled.
+     Most of this code was written by Martin Forssen, maf at appgate dot com.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/06/27 09:35:06
+     [readconf.h readconf.c]
+     Add client option UseRoaming. It doesn't do anything yet but will
+     control whether the client tries to use roaming if enabled on the
+     server. From Martin Forssen.
+     ok markus@
+   - markus@cvs.openbsd.org 2009/06/30 14:54:40
+     [version.h]
+     crank version; ok deraadt
+   - dtucker@cvs.openbsd.org 2009/07/02 02:11:47
+     [ssh.c]
+     allow for long home dir paths (bz #1615).  ok deraadt
+     (based in part on a patch from jchadima at redhat)
+   - stevesk@cvs.openbsd.org 2009/07/05 19:28:33
+     [clientloop.c]
+     only send SSH2_MSG_DISCONNECT if we're in compat20; from dtucker@
+     ok deraadt@ markus@
+
+20090622
+ - (dtucker) OpenBSD CVS Sync
+   - dtucker@cvs.openbsd.org 2009/06/22 05:39:28
+     [monitor_wrap.c monitor_mm.c ssh-keygen.c auth2.c gss-genr.c sftp-client.c]
+     alphabetize includes; reduces diff vs portable and style(9).
+     ok stevesk djm
+     (Id sync only; these were already in order in -portable)
+
+20090621
+ - (dtucker) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2009/03/17 21:37:00
+     [ssh.c]
+     pass correct argv[0] to openlog(); ok djm@
+  - jmc@cvs.openbsd.org 2009/03/19 15:15:09
+     [ssh.1]
+     for "Ciphers", just point the reader to the keyword in ssh_config(5), just
+     as we do for "MACs": this stops us getting out of sync when the lists
+     change;
+     fixes documentation/6102, submitted by Peter J. Philipp
+     alternative fix proposed by djm
+     ok markus
+   - tobias@cvs.openbsd.org 2009/03/23 08:31:19
+     [ssh-agent.c]
+     Fixed a possible out-of-bounds memory access if the environment variable
+     SHELL is shorter than 3 characters.
+     with input by and ok dtucker
+   - tobias@cvs.openbsd.org 2009/03/23 19:38:04
+     [ssh-agent.c]
+     My previous commit didn't fix the problem at all, so stick at my first
+     version of the fix presented to dtucker.
+     Issue notified by Matthias Barkhoff (matthias dot barkhoff at gmx dot de).
+     ok dtucker
+   - sobrado@cvs.openbsd.org 2009/03/26 08:38:39
+     [sftp-server.8 sshd.8 ssh-agent.1]
+     fix a few typographical errors found by spell(1).
+     ok dtucker@, jmc@
+   - stevesk@cvs.openbsd.org 2009/04/13 19:07:44
+     [sshd_config.5]
+     fix possessive; ok djm@
+   - stevesk@cvs.openbsd.org 2009/04/14 16:33:42
+     [sftp-server.c]
+     remove unused option character from getopt() optstring; ok markus@
+   - jj@cvs.openbsd.org 2009/04/14 21:10:54
+     [servconf.c]
+     Fixed a few the-the misspellings in comments. Skipped a bunch in
+     binutils,gcc and so on. ok jmc@
+   - stevesk@cvs.openbsd.org 2009/04/17 19:23:06
+     [session.c]
+     use INTERNAL_SFTP_NAME for setproctitle() of in-process sftp-server;
+     ok djm@ markus@
+   - stevesk@cvs.openbsd.org 2009/04/17 19:40:17
+     [sshd_config.5]
+     clarify that even internal-sftp needs /dev/log for logging to work; ok
+     markus@
+   - jmc@cvs.openbsd.org 2009/04/18 18:39:10
+     [sshd_config.5]
+     tweak previous; ok stevesk
+   - stevesk@cvs.openbsd.org 2009/04/21 15:13:17
+     [sshd_config.5]
+     clarify we cd to user's home after chroot; ok markus@ on
+     earlier version; tweaks and ok jmc@
+   - andreas@cvs.openbsd.org 2009/05/25 06:48:01
+     [channels.c packet.c clientloop.c packet.h serverloop.c monitor_wrap.c
+     monitor.c]
+     Put the globals in packet.c into a struct and don't access it directly
+     from other files. No functional changes.
+     ok markus@ djm@
+   - andreas@cvs.openbsd.org 2009/05/27 06:31:25
+     [canohost.h canohost.c]
+     Add clear_cached_addr(), needed for upcoming changes allowing the peer
+     address to change.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:33:39
+     [clientloop.c]
+     Send SSH2_MSG_DISCONNECT when the client disconnects. From a larger
+     change from Martin Forssen, maf at appgate dot com.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:34:36
+     [kex.c kex.h]
+     Move the KEX_COOKIE_LEN define to kex.h
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:36:07
+     [packet.h packet.c]
+     Add packet_put_int64() and packet_get_int64(), part of a larger change
+     from Martin Forssen.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/27 06:38:16
+     [sshconnect.h sshconnect.c]
+     Un-static ssh_exchange_identification(), part of a larger change from
+     Martin Forssen and needed for upcoming changes.
+     ok markus@
+   - andreas@cvs.openbsd.org 2009/05/28 16:50:16
+     [sshd.c packet.c serverloop.c monitor_wrap.c clientloop.c sshconnect.c
+     monitor.c Added roaming.h roaming_common.c roaming_dummy.c]
+     Keep track of number of bytes read and written. Needed for upcoming
+     changes. Most code from Martin Forssen, maf at appgate dot com.
+     ok markus@
+     Also, applied appropriate changes to Makefile.in
+   - andreas@cvs.openbsd.org 2009/06/12 20:43:22
+     [monitor.c packet.c]
+     Fix warnings found by chl@ and djm@ and change roaming_atomicio's
+     return type to match atomicio's
+     Diff from djm@, ok markus@
+   - andreas@cvs.openbsd.org 2009/06/12 20:58:32
+     [packet.c]
+     Move some more statics into session_state
+     ok markus@ djm@
+   - dtucker@cvs.openbsd.org 2009/06/21 07:37:15
+     [kexdhs.c kexgexs.c]
+     abort if key_sign fails, preventing possible null deref.  Based on report
+     from Paolo Ganci, ok markus@ djm@
+   - dtucker@cvs.openbsd.org 2009/06/21 09:04:03
+     [roaming.h roaming_common.c roaming_dummy.c]
+     Add  tags for the benefit of the sync scripts
+     Also: pull in the changes for 1.1->1.2 missed in the previous sync.
+ - (dtucker) [auth2-jpake.c auth2.c canohost.h session.c] Whitespace and
+   header-order changes to reduce diff vs OpenBSD.
+ - (dtucker) [servconf.c sshd.c] More whitespace sync.
+ - (dtucker) [roaming_common.c roaming_dummy.c] Wrap #include  in
+   ifdef.
+
+20090616
+ - (dtucker) [configure.ac defines.h] Bug #1607: handle the case where fsid_t
+   is a struct with a __val member.  Fixes build on, eg, Redhat 6.2.
+
+20090504
+ - (dtucker) [sshlogin.c] Move the NO_SSH_LASTLOG #ifndef line to include
+   variable declarations.  Should prevent unused warnings anywhere it's set
+   (only Crays as far as I can tell) and be a no-op everywhere else.
+
+20090318
+ - (tim) [configure.ac] Remove setting IP_TOS_IS_BROKEN for Cygwin. The problem
+   that setsockopt(IP_TOS) doesn't work on Cygwin has been fixed since 2005.
+   Based on patch from vinschen at redhat com.
+
+20090308
+ - (dtucker) [auth-passwd.c auth1.c auth2-kbdint.c auth2-none.c auth2-passwd.c
+   auth2-pubkey.c session.c openbsd-compat/bsd-cygwin_util.{c,h}
+   openbsd-compat/daemon.c] Remove support for Windows 95/98/ME and very old
+   version of Cygwin.  Patch from vinschen at redhat com.
+
+20090307
+ - (dtucker) [contrib/aix/buildbff.sh] Only try to rename ssh_prng_cmds if it
+   exists (it's not created if OpenSSL's PRNG is self-seeded, eg if the OS
+   has a /dev/random).
+ - (dtucker) [schnorr.c openbsd-compat/openssl-compat.{c,h}] Add
+   EVP_DigestUpdate to the OLD_EVP compatibility functions and tell schnorr.c
+   to use them.  Allows building with older OpenSSL versions.
+ - (dtucker) [configure.ac defines.h] Check for in_port_t and typedef if needed.
+ - (dtucker) [configure.ac] Missing comma in type list.
+ - (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}]
+   EVP_DigestUpdate does not exactly match the other OLD_EVP functions (eg
+   in openssl 0.9.6) so add an explicit test for it.
+
+20090306
+ - (djm) OpenBSD CVS Sync
+   - djm@cvs.openbsd.org 2009/03/05 07:18:19
+     [auth2-jpake.c jpake.c jpake.h monitor_wrap.c monitor_wrap.h schnorr.c]
+     [sshconnect2.c]
+     refactor the (disabled) Schnorr proof code to make it a little more
+     generally useful
+   - djm@cvs.openbsd.org 2009/03/05 11:30:50
+     [uuencode.c]
+     document what these functions do so I don't ever have to recuse into
+     b64_pton/ntop to remember their return values
+
 20090223
  - (djm) OpenBSD CVS Sync
    - djm@cvs.openbsd.org 2009/02/22 23:50:57

Modified: head/crypto/openssh/README
==============================================================================
--- head/crypto/openssh/README	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/README	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,4 +1,4 @@
-See http://www.openssh.com/txt/release-5.2 for the release notes.
+See http://www.openssh.com/txt/release-5.3 for the release notes.
 
 - A Japanese translation of this document and of the OpenSSH FAQ is
 - available at http://www.unixuser.org/~haruyama/security/openssh/index.html
@@ -62,4 +62,4 @@ References -
 [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9
 [7] http://www.openssh.com/faq.html
 
-$Id: README,v 1.70 2009/02/23 00:11:57 djm Exp $
+$Id: README,v 1.70.4.1 2009/09/26 04:11:47 djm Exp $

Modified: head/crypto/openssh/README.platform
==============================================================================
--- head/crypto/openssh/README.platform	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/README.platform	Thu Oct  1 17:12:52 2009	(r197679)
@@ -56,6 +56,18 @@ using a third party driver. More informa
 	http://www-user.rhrk.uni-kl.de/~nissler/tuntap/
 
 
+Linux
+-----
+
+Some Linux distributions (including Red Hat/Fedora/CentOS) include
+headers and library links in the -devel RPMs rather than the main
+binary RPMs. If you get an error about headers, or complaining about a
+missing prerequisite then you may need to install the equivalent
+development packages.  On Redhat based distros these may be openssl-devel,
+zlib-devel and pam-devel, on Debian based distros these may be
+libssl-dev, libz-dev and libpam-dev.
+
+
 Solaris
 -------
 If you enable BSM auditing on Solaris, you need to update audit_event(4)
@@ -81,4 +93,4 @@ account stacks which will prevent authen
 return the output from pam_nologin to the client.
 
 
-$Id: README.platform,v 1.9 2007/08/09 04:31:53 dtucker Exp $
+$Id: README.platform,v 1.10 2009/08/28 23:14:48 dtucker Exp $

Modified: head/crypto/openssh/auth-pam.c
==============================================================================
--- head/crypto/openssh/auth-pam.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth-pam.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -602,16 +602,16 @@ sshpam_cleanup(void)
 		return;
 	debug("PAM: cleanup");
 	pam_set_item(sshpam_handle, PAM_CONV, (const void *)&null_conv);
-	if (sshpam_cred_established) {
-		debug("PAM: deleting credentials");
-		pam_setcred(sshpam_handle, PAM_DELETE_CRED);
-		sshpam_cred_established = 0;
-	}
 	if (sshpam_session_open) {
 		debug("PAM: closing session");
 		pam_close_session(sshpam_handle, PAM_SILENT);
 		sshpam_session_open = 0;
 	}
+	if (sshpam_cred_established) {
+		debug("PAM: deleting credentials");
+		pam_setcred(sshpam_handle, PAM_DELETE_CRED);
+		sshpam_cred_established = 0;
+	}
 	sshpam_authenticated = 0;
 	pam_end(sshpam_handle, sshpam_err);
 	sshpam_handle = NULL;

Modified: head/crypto/openssh/auth-passwd.c
==============================================================================
--- head/crypto/openssh/auth-passwd.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth-passwd.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -102,7 +102,7 @@ auth_password(Authctxt *authctxt, const 
 	}
 #endif
 #ifdef HAVE_CYGWIN
-	if (is_winnt) {
+	{
 		HANDLE hToken = cygwin_logon_user(pw, password);
 
 		if (hToken == INVALID_HANDLE_VALUE)

Modified: head/crypto/openssh/auth-sia.c
==============================================================================
--- head/crypto/openssh/auth-sia.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth-sia.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -34,10 +34,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
 
 #include "ssh.h"
 #include "key.h"
@@ -53,52 +49,6 @@ extern ServerOptions options;
 extern int saved_argc;
 extern char **saved_argv;
 
-static int
-sia_password_change_required(const char *user)
-{
-	struct es_passwd *acct;
-	time_t pw_life;
-	time_t pw_date;
-
-	set_auth_parameters(saved_argc, saved_argv);
-
-	if ((acct = getespwnam(user)) == NULL) {
-		error("Couldn't access protected database entry for %s", user);
-		endprpwent();
-		return (0);
-	}
-
-	/* If forced password change flag is set, honor it */
-	if (acct->uflg->fg_psw_chg_reqd && acct->ufld->fd_psw_chg_reqd) {
-		endprpwent();
-		return (1);
-	}
-
-	/* Obtain password lifetime; if none, it can't have expired */
-	if (acct->uflg->fg_expire)
-		pw_life = acct->ufld->fd_expire;
-	else if (acct->sflg->fg_expire)
-		pw_life = acct->sfld->fd_expire;
-	else {
-		endprpwent();
-		return (0);
-	}
-
-	/* Offset from last change; if none, it must be expired */
-	if (acct->uflg->fg_schange)
-		pw_date = acct->ufld->fd_schange + pw_life;
-	else {
-		endprpwent();
-		return (1);
-	}
-
-	endprpwent();
-
-	/* If expiration date is prior to now, change password */
-	
-	return (pw_date <= time((time_t *) NULL));
-}
-
 int
 sys_auth_passwd(Authctxt *authctxt, const char *pass)
 {
@@ -126,9 +76,6 @@ sys_auth_passwd(Authctxt *authctxt, cons
 
 	sia_ses_release(&ent);
 
-	authctxt->force_pwchange = sia_password_change_required(
-		authctxt->user);
-
 	return (1);
 }
 

Modified: head/crypto/openssh/auth1.c
==============================================================================
--- head/crypto/openssh/auth1.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth1.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -318,15 +318,7 @@ do_authloop(Authctxt *authctxt)
 		}
 #endif /* _UNICOS */
 
-#ifdef HAVE_CYGWIN
-		if (authenticated &&
-		    !check_nt_auth(type == SSH_CMSG_AUTH_PASSWORD,
-		    authctxt->pw)) {
-			packet_disconnect("Authentication rejected for uid %d.",
-			    authctxt->pw == NULL ? -1 : authctxt->pw->pw_uid);
-			authenticated = 0;
-		}
-#else
+#ifndef HAVE_CYGWIN
 		/* Special handling for root */
 		if (authenticated && authctxt->pw->pw_uid == 0 &&
 		    !auth_root_allowed(meth->name)) {

Modified: head/crypto/openssh/auth2-jpake.c
==============================================================================
--- head/crypto/openssh/auth2-jpake.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth2-jpake.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-jpake.c,v 1.2 2008/11/07 23:34:48 dtucker Exp $ */
+/* $OpenBSD: auth2-jpake.c,v 1.3 2009/03/05 07:18:19 djm Exp $ */
 /*
  * Copyright (c) 2008 Damien Miller.  All rights reserved.
  *
@@ -42,8 +42,8 @@
 #include "ssh2.h"
 #include "key.h"
 #include "hostfile.h"
-#include "buffer.h"
 #include "auth.h"
+#include "buffer.h"
 #include "packet.h"
 #include "dispatch.h"
 #include "log.h"
@@ -55,6 +55,7 @@
 #endif
 #include "monitor_wrap.h"
 
+#include "schnorr.h"
 #include "jpake.h"
 
 /*
@@ -359,7 +360,7 @@ auth2_jpake_get_pwdata(Authctxt *authctx
 }
 
 /*
- * Being authentication attempt.
+ * Begin authentication attempt.
  * Note, sets authctxt->postponed while in subprotocol
  */
 static int

Modified: head/crypto/openssh/auth2-kbdint.c
==============================================================================
--- head/crypto/openssh/auth2-kbdint.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth2-kbdint.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -58,10 +58,6 @@ userauth_kbdint(Authctxt *authctxt)
 
 	xfree(devs);
 	xfree(lang);
-#ifdef HAVE_CYGWIN
-	if (check_nt_auth(0, authctxt->pw) == 0)
-		authenticated = 0;
-#endif
 	return authenticated;
 }
 

Modified: head/crypto/openssh/auth2-none.c
==============================================================================
--- head/crypto/openssh/auth2-none.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth2-none.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -61,10 +61,6 @@ userauth_none(Authctxt *authctxt)
 {
 	none_enabled = 0;
 	packet_check_eom();
-#ifdef HAVE_CYGWIN
-	if (check_nt_auth(1, authctxt->pw) == 0)
-		return (0);
-#endif
 	if (options.password_authentication)
 		return (PRIVSEP(auth_password(authctxt, "")));
 	return (0);

Modified: head/crypto/openssh/auth2-passwd.c
==============================================================================
--- head/crypto/openssh/auth2-passwd.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth2-passwd.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -68,10 +68,6 @@ userauth_passwd(Authctxt *authctxt)
 		logit("password change not supported");
 	else if (PRIVSEP(auth_password(authctxt, password)) == 1)
 		authenticated = 1;
-#ifdef HAVE_CYGWIN
-	if (check_nt_auth(1, authctxt->pw) == 0)
-		authenticated = 0;
-#endif
 	memset(password, 0, len);
 	xfree(password);
 	return authenticated;

Modified: head/crypto/openssh/auth2-pubkey.c
==============================================================================
--- head/crypto/openssh/auth2-pubkey.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth2-pubkey.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -170,10 +170,6 @@ done:
 		key_free(key);
 	xfree(pkalg);
 	xfree(pkblob);
-#ifdef HAVE_CYGWIN
-	if (check_nt_auth(0, authctxt->pw) == 0)
-		authenticated = 0;
-#endif
 	return authenticated;
 }
 

Modified: head/crypto/openssh/auth2.c
==============================================================================
--- head/crypto/openssh/auth2.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/auth2.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2.c,v 1.120 2008/11/04 08:22:12 djm Exp $ */
+/* $OpenBSD: auth2.c,v 1.121 2009/06/22 05:39:28 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
  *
@@ -36,8 +36,8 @@ __RCSID("$FreeBSD$");
 #include 
 #include 
 
-#include "xmalloc.h"
 #include "atomicio.h"
+#include "xmalloc.h"
 #include "ssh2.h"
 #include "packet.h"
 #include "log.h"

Modified: head/crypto/openssh/canohost.c
==============================================================================
--- head/crypto/openssh/canohost.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/canohost.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,4 +1,4 @@
-/* $OpenBSD: canohost.c,v 1.64 2009/02/12 03:00:56 djm Exp $ */
+/* $OpenBSD: canohost.c,v 1.65 2009/05/27 06:31:25 andreas Exp $ */
 /*
  * Author: Tatu Ylonen 
  * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland
@@ -35,6 +35,8 @@
 #include "misc.h"
 
 static void check_ip_options(int, char *);
+static char *canonical_host_ip = NULL;
+static int cached_port = -1;
 
 /*
  * Return the canonical name of the host at the other end of the socket. The
@@ -304,6 +306,16 @@ get_local_name(int sock)
 	return get_socket_address(sock, 0, NI_NAMEREQD);
 }
 
+void
+clear_cached_addr(void)
+{
+	if (canonical_host_ip != NULL) {
+		xfree(canonical_host_ip);
+		canonical_host_ip = NULL;
+	}
+	cached_port = -1;
+}
+
 /*
  * Returns the IP-address of the remote host as a string.  The returned
  * string must not be freed.
@@ -312,8 +324,6 @@ get_local_name(int sock)
 const char *
 get_remote_ipaddr(void)
 {
-	static char *canonical_host_ip = NULL;
-
 	/* Check whether we have cached the ipaddr. */
 	if (canonical_host_ip == NULL) {
 		if (packet_connection_is_on_socket()) {
@@ -402,13 +412,11 @@ get_peer_port(int sock)
 int
 get_remote_port(void)
 {
-	static int port = -1;
-
 	/* Cache to avoid getpeername() on a dead connection */
-	if (port == -1)
-		port = get_port(0);
+	if (cached_port == -1)
+		cached_port = get_port(0);
 
-	return port;
+	return cached_port;
 }
 
 int

Modified: head/crypto/openssh/canohost.h
==============================================================================
--- head/crypto/openssh/canohost.h	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/canohost.h	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,4 +1,4 @@
-/* $OpenBSD: canohost.h,v 1.10 2009/02/12 03:00:56 djm Exp $ */
+/* $OpenBSD: canohost.h,v 1.11 2009/05/27 06:31:25 andreas Exp $ */
 
 /*
  * Author: Tatu Ylonen 
@@ -24,6 +24,6 @@ char		*get_local_name(int);
 int		 get_remote_port(void);
 int		 get_local_port(void);
 int		 get_sock_port(int, int);
-
+void		 clear_cached_addr(void);
 
 void		 ipv64_normalise_mapped(struct sockaddr_storage *, socklen_t *);

Modified: head/crypto/openssh/channels.c
==============================================================================
--- head/crypto/openssh/channels.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/channels.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.295 2009/02/12 03:00:56 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.296 2009/05/25 06:48:00 andreas Exp $ */
 /*
  * Author: Tatu Ylonen 
  * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland
@@ -1653,6 +1653,7 @@ channel_handle_wfd(Channel *c, fd_set *r
 			}
 			return -1;
 		}
+#ifndef BROKEN_TCGETATTR_ICANON
 		if (compat20 && c->isatty && dlen >= 1 && buf[0] != '\r') {
 			if (tcgetattr(c->wfd, &tio) == 0 &&
 			    !(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
@@ -1666,6 +1667,7 @@ channel_handle_wfd(Channel *c, fd_set *r
 				packet_send();
 			}
 		}
+#endif
 		buffer_consume(&c->output, len);
 		if (compat20 && len > 0) {
 			c->local_consumed += len;
@@ -2431,7 +2433,7 @@ channel_input_status_confirm(int type, u
 	int id;
 
 	/* Reset keepalive timeout */
-	keep_alive_timeouts = 0;
+	packet_set_alive_timeouts(0);
 
 	id = packet_get_int();
 	packet_check_eom();

Modified: head/crypto/openssh/clientloop.c
==============================================================================
--- head/crypto/openssh/clientloop.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/clientloop.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.209 2009/02/12 03:00:56 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.213 2009/07/05 19:28:33 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen 
  * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland
@@ -109,6 +109,7 @@
 #include "misc.h"
 #include "match.h"
 #include "msg.h"
+#include "roaming.h"
 
 /* import options */
 extern Options options;
@@ -491,13 +492,13 @@ client_global_request_reply(int type, u_
 		xfree(gc);
 	}
 
-	keep_alive_timeouts = 0;
+	packet_set_alive_timeouts(0);
 }
 
 static void
 server_alive_check(void)
 {
-	if (++keep_alive_timeouts > options.server_alive_count_max) {
+	if (packet_inc_alive_timeouts() > options.server_alive_count_max) {
 		logit("Timeout, server not responding.");
 		cleanup_exit(255);
 	}
@@ -634,8 +635,8 @@ client_suspend_self(Buffer *bin, Buffer 
 static void
 client_process_net_input(fd_set *readset)
 {
-	int len;
-	char buf[8192];
+	int len, cont = 0;
+	char buf[SSH_IOBUFSZ];
 
 	/*
 	 * Read input from the server, and add any such data to the buffer of
@@ -643,8 +644,8 @@ client_process_net_input(fd_set *readset
 	 */
 	if (FD_ISSET(connection_in, readset)) {
 		/* Read as much as possible. */
-		len = read(connection_in, buf, sizeof(buf));
-		if (len == 0) {
+		len = roaming_read(connection_in, buf, sizeof(buf), &cont);
+		if (len == 0 && cont == 0) {
 			/*
 			 * Received EOF.  The remote host has closed the
 			 * connection.
@@ -1128,7 +1129,7 @@ static void
 client_process_input(fd_set *readset)
 {
 	int len;
-	char buf[8192];
+	char buf[SSH_IOBUFSZ];
 
 	/* Read input from stdin. */
 	if (FD_ISSET(fileno(stdin), readset)) {
@@ -1476,6 +1477,14 @@ client_loop(int have_pty, int escape_cha
 	/* Stop watching for window change. */
 	signal(SIGWINCH, SIG_DFL);
 
+	if (compat20) {
+		packet_start(SSH2_MSG_DISCONNECT);
+		packet_put_int(SSH2_DISCONNECT_BY_APPLICATION);
+		packet_put_cstring("disconnected by user");
+		packet_send();
+		packet_write_wait();
+	}
+
 	channel_free_all();
 
 	if (have_pty)

Modified: head/crypto/openssh/config.h
==============================================================================
--- head/crypto/openssh/config.h	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/config.h	Thu Oct  1 17:12:52 2009	(r197679)
@@ -69,6 +69,9 @@
 /* Define if your snprintf is busted */
 /* #undef BROKEN_SNPRINTF */
 
+/* tcgetattr with ICANON may hang */
+/* #undef BROKEN_TCGETATTR_ICANON */
+
 /* updwtmpx is broken (if present) */
 /* #undef BROKEN_UPDWTMPX */
 
@@ -123,9 +126,12 @@
 /* Builtin PRNG command timeout */
 #define ENTROPY_TIMEOUT_MSEC 200
 
-/* f_fsid has members */
+/* fsid_t has member val */
 /* #undef FSID_HAS_VAL */
 
+/* fsid_t has member __val */
+/* #undef FSID_HAS___VAL */
+
 /* Define to 1 if the `getpgrp' function requires zero arguments. */
 #define GETPGRP_VOID 1
 
@@ -519,6 +525,9 @@
 /* Define to 1 if the system has the type `in_addr_t'. */
 #define HAVE_IN_ADDR_T 1
 
+/* Define to 1 if the system has the type `in_port_t'. */
+#define HAVE_IN_PORT_T 1
+
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_LASTLOG_H */
 
@@ -1227,6 +1236,9 @@
 /* Define if X11 doesn't support AF_UNIX sockets on that system */
 /* #undef NO_X11_UNIX_SOCKETS */
 
+/* Define if EVP_DigestUpdate returns void */
+/* #undef OPENSSL_EVP_DIGESTUPDATE_VOID */
+
 /* libcrypto is missing AES 192 and 256 bit functions */
 /* #undef OPENSSL_LOBOTOMISED_AES */
 
@@ -1310,6 +1322,9 @@
 /* Use audit debugging module */
 /* #undef SSH_AUDIT_EVENTS */
 
+/* Windows is sensitive to read buffer size */
+/* #undef SSH_IOBUFSZ */
+
 /* non-privileged user for privilege separation */
 #define SSH_PRIVSEP_USER "sshd"
 
@@ -1398,9 +1413,13 @@
 /* Define if you want SELinux support. */
 /* #undef WITH_SELINUX */
 
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel and VAX). */
+#if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+#elif ! defined __LITTLE_ENDIAN__
+/* # undef WORDS_BIGENDIAN */
+#endif
 
 /* Define if xauth is found in your path */
 /* #undef XAUTH_PATH */

Modified: head/crypto/openssh/config.h.in
==============================================================================
--- head/crypto/openssh/config.h.in	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/config.h.in	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,5 +1,8 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
 /* Define if you have a getaddrinfo that fails for the all-zeros IPv6 address
    */
 #undef AIX_GETNAMEINFO_HACK
@@ -68,6 +71,9 @@
 /* Define if your snprintf is busted */
 #undef BROKEN_SNPRINTF
 
+/* tcgetattr with ICANON may hang */
+#undef BROKEN_TCGETATTR_ICANON
+
 /* updwtmpx is broken (if present) */
 #undef BROKEN_UPDWTMPX
 
@@ -122,9 +128,12 @@
 /* Builtin PRNG command timeout */
 #undef ENTROPY_TIMEOUT_MSEC
 
-/* f_fsid has members */
+/* fsid_t has member val */
 #undef FSID_HAS_VAL
 
+/* fsid_t has member __val */
+#undef FSID_HAS___VAL
+
 /* Define to 1 if the `getpgrp' function requires zero arguments. */
 #undef GETPGRP_VOID
 
@@ -518,6 +527,9 @@
 /* Define to 1 if the system has the type `in_addr_t'. */
 #undef HAVE_IN_ADDR_T
 
+/* Define to 1 if the system has the type `in_port_t'. */
+#undef HAVE_IN_PORT_T
+
 /* Define to 1 if you have the  header file. */
 #undef HAVE_LASTLOG_H
 
@@ -1226,6 +1238,9 @@
 /* Define if X11 doesn't support AF_UNIX sockets on that system */
 #undef NO_X11_UNIX_SOCKETS
 
+/* Define if EVP_DigestUpdate returns void */
+#undef OPENSSL_EVP_DIGESTUPDATE_VOID
+
 /* libcrypto is missing AES 192 and 256 bit functions */
 #undef OPENSSL_LOBOTOMISED_AES
 
@@ -1309,6 +1324,9 @@
 /* Use audit debugging module */
 #undef SSH_AUDIT_EVENTS
 
+/* Windows is sensitive to read buffer size */
+#undef SSH_IOBUFSZ
+
 /* non-privileged user for privilege separation */
 #undef SSH_PRIVSEP_USER
 
@@ -1397,9 +1415,17 @@
 /* Define if you want SELinux support. */
 #undef WITH_SELINUX
 
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
 
 /* Define if xauth is found in your path */
 #undef XAUTH_PATH

Modified: head/crypto/openssh/defines.h
==============================================================================
--- head/crypto/openssh/defines.h	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/defines.h	Thu Oct  1 17:12:52 2009	(r197679)
@@ -25,7 +25,7 @@
 #ifndef _DEFINES_H
 #define _DEFINES_H
 
-/* $Id: defines.h,v 1.153 2009/02/01 11:19:54 dtucker Exp $ */
+/* $Id: defines.h,v 1.156 2009/08/28 01:21:07 dtucker Exp $ */
 
 
 /* Constants */
@@ -300,6 +300,9 @@ struct	sockaddr_un {
 #ifndef HAVE_IN_ADDR_T
 typedef u_int32_t	in_addr_t;
 #endif
+#ifndef HAVE_IN_PORT_T
+typedef u_int16_t	in_port_t;
+#endif
 
 #if defined(BROKEN_SYS_TERMIO_H) && !defined(_STRUCT_WINSIZE)
 #define _STRUCT_WINSIZE
@@ -591,6 +594,10 @@ struct winsize {
 #define FSID_TO_ULONG(f) \
 	((((u_int64_t)(f).val[0] & 0xffffffffUL) << 32) | \
 	    ((f).val[1] & 0xffffffffUL))
+#elif defined(FSID_HAS___VAL)
+#define FSID_TO_ULONG(f) \
+	((((u_int64_t)(f).__val[0] & 0xffffffffUL) << 32) | \
+	    ((f).__val[1] & 0xffffffffUL))
 #else
 # define FSID_TO_ULONG(f) ((f))
 #endif
@@ -742,4 +749,8 @@ struct winsize {
 #define INET6_ADDRSTRLEN 46
 #endif
 
+#ifndef SSH_IOBUFSZ
+# define SSH_IOBUFSZ 8192
+#endif
+
 #endif /* _DEFINES_H */

Modified: head/crypto/openssh/gss-genr.c
==============================================================================
--- head/crypto/openssh/gss-genr.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/gss-genr.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,4 +1,4 @@
-/* $OpenBSD: gss-genr.c,v 1.19 2007/06/12 11:56:15 dtucker Exp $ */
+/* $OpenBSD: gss-genr.c,v 1.20 2009/06/22 05:39:28 dtucker Exp $ */
 
 /*
  * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved.

Modified: head/crypto/openssh/includes.h
==============================================================================
--- head/crypto/openssh/includes.h	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/includes.h	Thu Oct  1 17:12:52 2009	(r197679)
@@ -31,7 +31,8 @@
 #endif
 #if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \
     defined(GLOB_HAS_GL_MATCHC) && \
-    defined(HAVE_DECL_GLOB_NOMATCH) &&  HAVE_DECL_GLOB_NOMATCH != 0
+    defined(HAVE_DECL_GLOB_NOMATCH) &&  HAVE_DECL_GLOB_NOMATCH != 0 && \
+    !defined(BROKEN_GLOB)
 # include 
 #endif
 #ifdef HAVE_ENDIAN_H

Modified: head/crypto/openssh/jpake.c
==============================================================================
--- head/crypto/openssh/jpake.c	Thu Oct  1 16:25:35 2009	(r197678)
+++ head/crypto/openssh/jpake.c	Thu Oct  1 17:12:52 2009	(r197679)
@@ -1,4 +1,4 @@
-/* $OpenBSD: jpake.c,v 1.1 2008/11/04 08:22:12 djm Exp $ */
+/* $OpenBSD: jpake.c,v 1.2 2009/03/05 07:18:19 djm Exp $ */
 /*
  * Copyright (c) 2008 Damien Miller.  All rights reserved.
  *
@@ -47,6 +47,7 @@
 #include "log.h"
 
 #include "jpake.h"
+#include "schnorr.h"
 
 #ifdef JPAKE
 
@@ -60,165 +61,10 @@
 	"98DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB" \
 	"9ED529077096966D670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF"
 
-struct jpake_group *
+struct modp_group *
 jpake_default_group(void)
 {
-	struct jpake_group *ret;
-
-	ret = xmalloc(sizeof(*ret));
-	ret->p = ret->q = ret->g = NULL;
-	if (BN_hex2bn(&ret->p, JPAKE_GROUP_P) == 0 ||
-	    BN_hex2bn(&ret->g, JPAKE_GROUP_G) == 0)
-		fatal("%s: BN_hex2bn", __func__);
-	/* Subgroup order is p/2 (p is a safe prime) */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 17:22:04 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 97C9A106566B;
	Thu,  1 Oct 2009 17:22:04 +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 859108FC18;
	Thu,  1 Oct 2009 17:22:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91HM41Y058825;
	Thu, 1 Oct 2009 17:22:04 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91HM4Kg058819;
	Thu, 1 Oct 2009 17:22:04 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200910011722.n91HM4Kg058819@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Thu, 1 Oct 2009 17:22: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: r197680 - in head/sys: fs/fifofs 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: Thu, 01 Oct 2009 17:22:04 -0000

Author: trasz
Date: Thu Oct  1 17:22:03 2009
New Revision: 197680
URL: http://svn.freebsd.org/changeset/base/197680

Log:
  Provide default implementation for VOP_ACCESS(9), so that filesystems which
  want to provide VOP_ACCESSX(9) don't have to implement both.  Note that
  this commit makes implementation of either of these two mandatory.
  
  Reviewed by:	kib

Modified:
  head/sys/fs/fifofs/fifo_vnops.c
  head/sys/kern/subr_acl_posix1e.c
  head/sys/kern/vfs_default.c
  head/sys/kern/vfs_subr.c
  head/sys/sys/vnode.h

Modified: head/sys/fs/fifofs/fifo_vnops.c
==============================================================================
--- head/sys/fs/fifofs/fifo_vnops.c	Thu Oct  1 17:12:52 2009	(r197679)
+++ head/sys/fs/fifofs/fifo_vnops.c	Thu Oct  1 17:22:03 2009	(r197680)
@@ -119,7 +119,6 @@ static struct filterops fifo_notsup_filt
 struct vop_vector fifo_specops = {
 	.vop_default =		&default_vnodeops,
 
-	.vop_access =		VOP_EBADF,
 	.vop_advlock =		fifo_advlock,
 	.vop_close =		fifo_close,
 	.vop_create =		VOP_PANIC,

Modified: head/sys/kern/subr_acl_posix1e.c
==============================================================================
--- head/sys/kern/subr_acl_posix1e.c	Thu Oct  1 17:12:52 2009	(r197679)
+++ head/sys/kern/subr_acl_posix1e.c	Thu Oct  1 17:22:03 2009	(r197680)
@@ -61,6 +61,9 @@ vaccess_acl_posix1e(enum vtype type, uid
 	accmode_t acl_mask_granted;
 	int group_matched, i;
 
+	KASSERT((accmode & ~(VEXEC | VWRITE | VREAD | VADMIN | VAPPEND)) == 0,
+	    ("invalid bit in accmode"));
+
 	/*
 	 * Look for a normal, non-privileged way to access the file/directory
 	 * as requested.  If it exists, go with that.  Otherwise, attempt to

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c	Thu Oct  1 17:12:52 2009	(r197679)
+++ head/sys/kern/vfs_default.c	Thu Oct  1 17:22:03 2009	(r197680)
@@ -83,12 +83,17 @@ static int	dirent_exists(struct vnode *v
  *
  * If there is no specific entry here, we will return EOPNOTSUPP.
  *
+ * Note that every filesystem has to implement either vop_access
+ * or vop_accessx; failing to do so will result in immediate crash
+ * due to stack overflow, as vop_stdaccess() calls vop_stdaccessx(),
+ * which calls vop_stdaccess() etc.
  */
 
 struct vop_vector default_vnodeops = {
 	.vop_default =		NULL,
 	.vop_bypass =		VOP_EOPNOTSUPP,
 
+	.vop_access =		vop_stdaccess,
 	.vop_accessx =		vop_stdaccessx,
 	.vop_advlock =		vop_stdadvlock,
 	.vop_advlockasync =	vop_stdadvlockasync,
@@ -326,6 +331,16 @@ out:
 }
 
 int
+vop_stdaccess(struct vop_access_args *ap)
+{
+
+	KASSERT((ap->a_accmode & ~(VEXEC | VWRITE | VREAD | VADMIN |
+	    VAPPEND)) == 0, ("invalid bit in accmode"));
+
+	return (VOP_ACCESSX(ap->a_vp, ap->a_accmode, ap->a_cred, ap->a_td));
+}
+
+int
 vop_stdaccessx(struct vop_accessx_args *ap)
 {
 	int error;

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Thu Oct  1 17:12:52 2009	(r197679)
+++ head/sys/kern/vfs_subr.c	Thu Oct  1 17:22:03 2009	(r197680)
@@ -3520,6 +3520,9 @@ vaccess(enum vtype type, mode_t file_mod
 	accmode_t dac_granted;
 	accmode_t priv_granted;
 
+	KASSERT((accmode & ~(VEXEC | VWRITE | VREAD | VADMIN | VAPPEND)) == 0,
+	    ("invalid bit in accmode"));
+
 	/*
 	 * Look for a normal, non-privileged way to access the file/directory
 	 * as requested.  If it exists, go with that.

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Thu Oct  1 17:12:52 2009	(r197679)
+++ head/sys/sys/vnode.h	Thu Oct  1 17:22:03 2009	(r197680)
@@ -685,6 +685,7 @@ int	vop_stdlock(struct vop_lock1_args *)
 int	vop_stdputpages(struct vop_putpages_args *);
 int	vop_stdunlock(struct vop_unlock_args *);
 int	vop_nopoll(struct vop_poll_args *);
+int	vop_stdaccess(struct vop_access_args *ap);
 int	vop_stdaccessx(struct vop_accessx_args *ap);
 int	vop_stdadvlock(struct vop_advlock_args *ap);
 int	vop_stdadvlockasync(struct vop_advlockasync_args *ap);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 17:33:06 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DE5D6106566B
	for ; Thu,  1 Oct 2009 17:33:06 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from mail-out2.fuse.net (mail-out2.fuse.net [216.68.8.171])
	by mx1.freebsd.org (Postfix) with ESMTP id 9CD2A8FC1D
	for ; Thu,  1 Oct 2009 17:33:06 +0000 (UTC)
X-CNFS-Analysis: v=1.1 cv=Xmf0kUNlEPs5s0ASnO9nu/pAoGSimOtKYqLqs2wbnTI= c=1
	sm=0 a=YYkPiygOjqcA:10 a=6I5d2MoRAAAA:8
	a=Np3HAU8pmarTHa0tFysA:9 a=eqrwBVwXiQLXoHdL3wYA:7
	a=TySv0dik-W_9h2_QBeQ99Uc-eaEA:4 a=SV7veod9ZcQA:10
	a=ZgY7fN_rChvVf6XDDMEA:9 a=sU853Es58JrRFljXahj9cY1f0xMA:4
	a=LkYvsgB9u1MH7Ao0BLhsLg==:117
X-CM-Score: 0
X-Scanned-by: Cloudmark Authority Engine
Authentication-Results: ecout2 smtp.mail=cokane@FreeBSD.org; spf=softfail
Received-SPF: softfail (ecout2: transitional domain FreeBSD.org does not
	designate 74.215.227.9 as permitted sender)
Received: from [74.215.227.9] ([74.215.227.9:50311] helo=mail.colemankane.org)
	by ecout2 (envelope-from )
	(ecelerity 2.2.2.43 r()) with ESMTP
	id C2/B6-05863-0D7E4CA4; Thu, 01 Oct 2009 13:33:05 -0400
Received: from [172.20.0.76] (rrcs-96-11-231-210.central.biz.rr.com
	[96.11.231.210])
	by mail.colemankane.org (Postfix) with ESMTPSA id 4B40E1143E;
	Thu,  1 Oct 2009 14:38:02 -0400 (EDT)
From: Coleman Kane 
To: Bruce Evans 
In-Reply-To: <20091002002534.D21507@delplex.bde.org>
References: <200910010243.n912hpSM034846@svn.freebsd.org>
	<86eipno12p.fsf@ds4.des.no>  <20091002002534.D21507@delplex.bde.org>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-Eb9wi9n/DFmYjo6p2yUi"
Organization: FreeBSD Project
Date: Thu, 01 Oct 2009 13:32:25 -0400
Message-Id: <1254418346.4255.31.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port 
Cc: svn-src-head@freebsd.org,
	Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 17:33:06 -0000


--=-Eb9wi9n/DFmYjo6p2yUi
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2009-10-02 at 00:36 +1000, Bruce Evans wrote:
> On Thu, 1 Oct 2009, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote:
>=20
> > Coleman Kane  writes:
> >> -		if (sc->ndis_80211 && vap)
> >> +		if ((sc->ndis_80211 !=3D NULL) && (vap !=3D NULL))
> >
> > sc->ndis_80211 is an int.  NULL is a pointer.
>=20
> Also, the number of style bugs was doubled on (almost?) every changed lin=
e
> by adding 2 sets of unnecessary parentheses.
>=20
> Bruce

Re-read style(9) more closely.

Yes... the extra parentheses are superfluous, and should therefore be
removed. However, the current rev, which looks like this:

  if ((sc->ndis_80211 !=3D 0) && (vap !=3D NULL))

doesn't help the author shoot themselves in the foot as violating the
"explicitly compare values to zero" rule did in the earlier revision.

I'll heed the request of the second-to-last paragraph of style(9) on
this particular change, not churning the SVN repo further, and make a
mental note for later.

--=20
Coleman Kane

--=-Eb9wi9n/DFmYjo6p2yUi
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEABECAAYFAkrE56kACgkQcMSxQcXat5cXTACfV1aTRY0HckK3TnAhNl4FHqtJ
8LAAnRhOkgNdnlOCO5Nl22wiuqCNWuC5
=wUWs
-----END PGP SIGNATURE-----

--=-Eb9wi9n/DFmYjo6p2yUi--


From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 18:20:31 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0AB541065792;
	Thu,  1 Oct 2009 18:20:31 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au
	[211.29.132.186])
	by mx1.freebsd.org (Postfix) with ESMTP id 952C88FC1E;
	Thu,  1 Oct 2009 18:20:30 +0000 (UTC)
Received: from c122-107-125-150.carlnfd1.nsw.optusnet.com.au
	(c122-107-125-150.carlnfd1.nsw.optusnet.com.au [122.107.125.150])
	by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n91IKMCN004635
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 2 Oct 2009 04:20:23 +1000
Date: Fri, 2 Oct 2009 04:20:22 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Coleman Kane 
In-Reply-To: <1254418346.4255.31.camel@localhost>
Message-ID: <20091002040903.U21917@delplex.bde.org>
References: <200910010243.n912hpSM034846@svn.freebsd.org>
	<86eipno12p.fsf@ds4.des.no> <20091002002534.D21507@delplex.bde.org>
	<1254418346.4255.31.camel@localhost>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="0-971013447-1254421222=:21917"
Cc: svn-src-head@FreeBSD.org,
	Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org,
	Bruce Evans 
Subject: Re: svn commit: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 18:20:31 -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-971013447-1254421222=:21917
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Thu, 1 Oct 2009, Coleman Kane wrote:

> On Fri, 2009-10-02 at 00:36 +1000, Bruce Evans wrote:
>> On Thu, 1 Oct 2009, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote:
>>
>>> Coleman Kane  writes:
>>>> -=09=09if (sc->ndis_80211 && vap)
>>>> +=09=09if ((sc->ndis_80211 !=3D NULL) && (vap !=3D NULL))
>>>
>>> sc->ndis_80211 is an int.  NULL is a pointer.
>>
>> Also, the number of style bugs was doubled on (almost?) every changed li=
ne
>> by adding 2 sets of unnecessary parentheses.
>>
>> Bruce
>
> Re-read style(9) more closely.

Do I need to read it at all :-).

> Yes... the extra parentheses are superfluous, and should therefore be
> removed. However, the current rev, which looks like this:
>
>  if ((sc->ndis_80211 !=3D 0) && (vap !=3D NULL))
>
> doesn't help the author shoot themselves in the foot as violating the
> "explicitly compare values to zero" rule did in the earlier revision.

Actually I needed to count the style bugs more carefully -- 2 implicit
comparisons with 0 or NULL (unless the first one is really boolean),
but I only counted 1, while I counted 2 for the extra parentheses.

> I'll heed the request of the second-to-last paragraph of style(9) on
> this particular change, not churning the SVN repo further, and make a
> mental note for later.

Thanks.  I forgot about that paragraph being there.  I think churning
repos doesn't matter much now if it ever did, but churning sources makes
their history hard to understand.

Bruce
--0-971013447-1254421222=:21917--

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 18:23:50 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F27D8106568D;
	Thu,  1 Oct 2009 18:23:50 +0000 (UTC)
	(envelope-from marcus@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E0A108FC21;
	Thu,  1 Oct 2009 18:23:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91INo3Y060564;
	Thu, 1 Oct 2009 18:23:50 GMT (envelope-from marcus@svn.freebsd.org)
Received: (from marcus@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91INoDU060562;
	Thu, 1 Oct 2009 18:23:50 GMT (envelope-from marcus@svn.freebsd.org)
Message-Id: <200910011823.n91INoDU060562@svn.freebsd.org>
From: Joe Marcus Clarke 
Date: Thu, 1 Oct 2009 18:23: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: r197681 - 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, 01 Oct 2009 18:23:51 -0000

Author: marcus (doc,ports committer)
Date: Thu Oct  1 18:23:50 2009
New Revision: 197681
URL: http://svn.freebsd.org/changeset/base/197681

Log:
  Correct the pthread stub prototype for pthread_mutexattr_settype to allow for
  the type argument.  This is known to fix some pthread_mutexattr_settype()
  invocations, especially when it comes to pulseaudio.
  
  Approved by:	kib
  		deischen (threads)
  MFC after:	3 days

Modified:
  head/lib/libc/gen/_pthread_stubs.c

Modified: head/lib/libc/gen/_pthread_stubs.c
==============================================================================
--- head/lib/libc/gen/_pthread_stubs.c	Thu Oct  1 17:22:03 2009	(r197680)
+++ head/lib/libc/gen/_pthread_stubs.c	Thu Oct  1 18:23:50 2009	(r197681)
@@ -222,7 +222,7 @@ STUB_FUNC1(pthread_mutex_trylock, PJT_MU
 STUB_FUNC1(pthread_mutex_unlock, PJT_MUTEX_UNLOCK, int, void *)
 STUB_FUNC1(pthread_mutexattr_destroy, PJT_MUTEXATTR_DESTROY, int, void *)
 STUB_FUNC1(pthread_mutexattr_init, PJT_MUTEXATTR_INIT, int, void *)
-STUB_FUNC1(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *)
+STUB_FUNC2(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *, int)
 STUB_FUNC2(pthread_once, 	PJT_ONCE, int, void *, void *)
 STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *)
 STUB_FUNC2(pthread_rwlock_init,	PJT_RWLOCK_INIT, int, void *, void *)

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 18:37:17 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 073DD1065676;
	Thu,  1 Oct 2009 18:37:17 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E908C8FC1B;
	Thu,  1 Oct 2009 18:37:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91IbG0L061004;
	Thu, 1 Oct 2009 18:37:16 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91IbGL4061002;
	Thu, 1 Oct 2009 18:37:16 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200910011837.n91IbGL4061002@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 1 Oct 2009 18:37: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: r197682 - head/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: Thu, 01 Oct 2009 18:37:17 -0000

Author: thompsa
Date: Thu Oct  1 18:37:16 2009
New Revision: 197682
URL: http://svn.freebsd.org/changeset/base/197682

Log:
  EHCI Hardware BUG workaround
  
  The EHCI HW can use the qtd_next field instead of qtd_altnext when a short
  packet is received. This contradicts what is stated in the EHCI datasheet.
  Also the total-bytes field in the status field of the following TD gets
  corrupted upon reception of a short packet!  We work this around in software by
  not queueing more than one job/TD at a time of up to 16Kbytes! The bug has been
  seen on multiple INTEL based EHCI chips.  Other vendors have not been tested
  yet.
  
  - Applications using /dev/usb/X.Y.Z, where Z is non-zero are affected, but not
    applications using LibUSB v0.1, v1.2 and v2.0.
  - Mass Storage (umass) is affected.
  
  Submitted by:	Hans Petter Selasky
  MFC after:	3 days

Modified:
  head/sys/dev/usb/controller/ehci.c

Modified: head/sys/dev/usb/controller/ehci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci.c	Thu Oct  1 18:23:50 2009	(r197681)
+++ head/sys/dev/usb/controller/ehci.c	Thu Oct  1 18:37:16 2009	(r197682)
@@ -131,6 +131,7 @@ struct ehci_std_temp {
 	uint8_t	auto_data_toggle;
 	uint8_t	setup_alt_next;
 	uint8_t	last_frame;
+	uint8_t can_use_next;
 };
 
 void
@@ -1207,11 +1208,6 @@ ehci_non_isoc_done_sub(struct usb_xfer *
 
 	xfer->td_transfer_cache = td;
 
-	/* update data toggle */
-
-	xfer->endpoint->toggle_next =
-	    (status & EHCI_QTD_TOGGLE_MASK) ? 1 : 0;
-
 #if USB_DEBUG
 	if (status & EHCI_QTD_STATERRS) {
 		DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x"
@@ -1235,6 +1231,9 @@ ehci_non_isoc_done_sub(struct usb_xfer *
 static void
 ehci_non_isoc_done(struct usb_xfer *xfer)
 {
+	ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
+	ehci_qh_t *qh;
+	uint32_t status;
 	usb_error_t err = 0;
 
 	DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
@@ -1248,6 +1247,17 @@ ehci_non_isoc_done(struct usb_xfer *xfer
 	}
 #endif
 
+	/* extract data toggle directly from the QH's overlay area */
+
+	qh = xfer->qh_start[xfer->flags_int.curr_dma_set];
+
+	usb_pc_cpu_invalidate(qh->page_cache);
+
+	status = hc32toh(sc, qh->qh_qtd.qtd_status);
+
+	xfer->endpoint->toggle_next =
+	    (status & EHCI_QTD_TOGGLE_MASK) ? 1 : 0;
+
 	/* reset scanner */
 
 	xfer->td_transfer_cache = xfer->td_transfer_first;
@@ -1348,6 +1358,7 @@ ehci_check_transfer(struct usb_xfer *xfe
 		}
 	} else {
 		ehci_qtd_t *td;
+		ehci_qh_t *qh;
 
 		/* non-isochronous transfer */
 
@@ -1357,16 +1368,35 @@ ehci_check_transfer(struct usb_xfer *xfe
 		 */
 		td = xfer->td_transfer_cache;
 
+		qh = xfer->qh_start[xfer->flags_int.curr_dma_set];
+
+		usb_pc_cpu_invalidate(qh->page_cache);
+
+		status = hc32toh(sc, qh->qh_qtd.qtd_status);
+		if (status & EHCI_QTD_ACTIVE) {
+			/* transfer is pending */
+			goto done;
+		}
+
 		while (1) {
 			usb_pc_cpu_invalidate(td->page_cache);
 			status = hc32toh(sc, td->qtd_status);
 
 			/*
-			 * if there is an active TD the transfer isn't done
+			 * Check if there is an active TD which
+			 * indicates that the transfer isn't done.
 			 */
 			if (status & EHCI_QTD_ACTIVE) {
 				/* update cache */
-				xfer->td_transfer_cache = td;
+				if (xfer->td_transfer_cache != td) {
+					xfer->td_transfer_cache = td;
+					if (qh->qh_qtd.qtd_next & 
+					    htohc32(sc, EHCI_LINK_TERMINATE)) {
+						/* XXX - manually advance to next frame */
+						qh->qh_qtd.qtd_next = td->qtd_self;
+						usb_pc_cpu_flush(td->page_cache);
+					}
+				}
 				goto done;
 			}
 			/*
@@ -1545,7 +1575,6 @@ ehci_setup_standard_chain_sub(struct ehc
 	ehci_qtd_t *td;
 	ehci_qtd_t *td_next;
 	ehci_qtd_t *td_alt_next;
-	uint32_t qtd_altnext;
 	uint32_t buf_offset;
 	uint32_t average;
 	uint32_t len_old;
@@ -1554,7 +1583,6 @@ ehci_setup_standard_chain_sub(struct ehc
 	uint8_t precompute;
 
 	terminate = htohc32(temp->sc, EHCI_LINK_TERMINATE);
-	qtd_altnext = terminate;
 	td_alt_next = NULL;
 	buf_offset = 0;
 	shortpkt_old = temp->shortpkt;
@@ -1612,7 +1640,8 @@ restart:
 
 		td->qtd_status =
 		    temp->qtd_status |
-		    htohc32(temp->sc, EHCI_QTD_SET_BYTES(average));
+		    htohc32(temp->sc, EHCI_QTD_IOC |
+			EHCI_QTD_SET_BYTES(average));
 
 		if (average == 0) {
 
@@ -1687,11 +1716,23 @@ restart:
 			td->qtd_buffer_hi[x] = 0;
 		}
 
-		if (td_next) {
-			/* link the current TD with the next one */
-			td->qtd_next = td_next->qtd_self;
+		if (temp->can_use_next) {
+			if (td_next) {
+				/* link the current TD with the next one */
+				td->qtd_next = td_next->qtd_self;
+			}
+		} else {
+			/*
+			 * BUG WARNING: The EHCI HW can use the
+			 * qtd_next field instead of qtd_altnext when
+			 * a short packet is received! We work this
+			 * around in software by not queueing more
+			 * than one job/TD at a time!
+			 */
+			td->qtd_next = terminate;
 		}
-		td->qtd_altnext = qtd_altnext;
+
+		td->qtd_altnext = terminate;
 		td->alt_next = td_alt_next;
 
 		usb_pc_cpu_flush(td->page_cache);
@@ -1703,15 +1744,9 @@ restart:
 		/* setup alt next pointer, if any */
 		if (temp->last_frame) {
 			td_alt_next = NULL;
-			qtd_altnext = terminate;
 		} else {
 			/* we use this field internally */
 			td_alt_next = td_next;
-			if (temp->setup_alt_next) {
-				qtd_altnext = td_next->qtd_self;
-			} else {
-				qtd_altnext = terminate;
-			}
 		}
 
 		/* restore */
@@ -1756,6 +1791,8 @@ ehci_setup_standard_chain(struct usb_xfe
 	temp.qtd_status = 0;
 	temp.last_frame = 0;
 	temp.setup_alt_next = xfer->flags_int.short_frames_ok;
+	temp.can_use_next = (xfer->flags_int.control_xfr ||
+	    (UE_GET_DIR(xfer->endpointno) == UE_DIR_OUT));
 
 	if (xfer->flags_int.control_xfr) {
 		if (xfer->endpoint->toggle_next) {
@@ -1889,7 +1926,6 @@ ehci_setup_standard_chain(struct usb_xfe
 	/* the last TD terminates the transfer: */
 	td->qtd_next = htohc32(temp.sc, EHCI_LINK_TERMINATE);
 	td->qtd_altnext = htohc32(temp.sc, EHCI_LINK_TERMINATE);
-	td->qtd_status |= htohc32(temp.sc, EHCI_QTD_IOC);
 
 	usb_pc_cpu_flush(td->page_cache);
 

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 18:44:29 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B516106568D
	for ; Thu,  1 Oct 2009 18:44:29 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from mail-out1.fuse.net (mail-out1.fuse.net [216.68.8.175])
	by mx1.freebsd.org (Postfix) with ESMTP id CB60A8FC18
	for ; Thu,  1 Oct 2009 18:44:28 +0000 (UTC)
X-CNFS-Analysis: v=1.1 cv=Jf3tspjE8XI4z6saXnuFbjgHz4WKruKDsdWNlYDB8z0= c=1
	sm=0 a=YYkPiygOjqcA:10 a=6I5d2MoRAAAA:8
	a=5NRtI-kUalALLSyT6tIA:9 a=_HdLcGZMIcqpDuZqAVcA:7
	a=qn7lfz4Ks5yHYWggAD9Lj9F6cnIA:4 a=SV7veod9ZcQA:10
	a=h4xQxGY_LDVKyn9w1MAA:9 a=agx7ydx-tRjAyvU9kHkxu3eBtUwA:4
	a=LkYvsgB9u1MH7Ao0BLhsLg==:117
X-CM-Score: 0
X-Scanned-by: Cloudmark Authority Engine
Authentication-Results: ecout1 smtp.mail=cokane@FreeBSD.org; spf=softfail
Received-SPF: softfail (ecout1: transitional domain FreeBSD.org does not
	designate 74.215.227.9 as permitted sender)
Received: from [74.215.227.9] ([74.215.227.9:50600] helo=mail.colemankane.org)
	by ecout1 (envelope-from )
	(ecelerity 2.2.2.43 r()) with ESMTP
	id 29/AD-02412-A88F4CA4; Thu, 01 Oct 2009 14:44:28 -0400
Received: from [172.20.0.76] (rrcs-96-11-231-210.central.biz.rr.com
	[96.11.231.210])
	by mail.colemankane.org (Postfix) with ESMTPSA id BF3591143E;
	Thu,  1 Oct 2009 15:49:23 -0400 (EDT)
From: Coleman Kane 
To: Bruce Evans 
In-Reply-To: <20091002040903.U21917@delplex.bde.org>
References: <200910010243.n912hpSM034846@svn.freebsd.org>
	<86eipno12p.fsf@ds4.des.no> <20091002002534.D21507@delplex.bde.org>
	<1254418346.4255.31.camel@localhost>
	<20091002040903.U21917@delplex.bde.org>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-T6DbjhiwI1lJTleeaEDw"
Organization: FreeBSD Project
Date: Thu, 01 Oct 2009 14:43:45 -0400
Message-Id: <1254422625.4255.46.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port 
Cc: svn-src-head@FreeBSD.org,
	Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject: Re: svn commit: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 18:44:29 -0000


--=-T6DbjhiwI1lJTleeaEDw
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2009-10-02 at 04:20 +1000, Bruce Evans wrote:
> On Thu, 1 Oct 2009, Coleman Kane wrote:
>=20
> > On Fri, 2009-10-02 at 00:36 +1000, Bruce Evans wrote:
> >> On Thu, 1 Oct 2009, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote:
> >>
> >>> Coleman Kane  writes:
> >>>> -		if (sc->ndis_80211 && vap)
> >>>> +		if ((sc->ndis_80211 !=3D NULL) && (vap !=3D NULL))
> >>>
> >>> sc->ndis_80211 is an int.  NULL is a pointer.
> >>
> >> Also, the number of style bugs was doubled on (almost?) every changed =
line
> >> by adding 2 sets of unnecessary parentheses.
> >>
> >> Bruce
> >
> > Re-read style(9) more closely.
>=20
> Do I need to read it at all :-).

I meant that in the past-tense first-person manner, sorry, not trying to
tell anyone what to do. ;) Should have written "I re-read style(9)...".

>=20
> > Yes... the extra parentheses are superfluous, and should therefore be
> > removed. However, the current rev, which looks like this:
> >
> >  if ((sc->ndis_80211 !=3D 0) && (vap !=3D NULL))
> >
> > doesn't help the author shoot themselves in the foot as violating the
> > "explicitly compare values to zero" rule did in the earlier revision.
>=20
> Actually I needed to count the style bugs more carefully -- 2 implicit
> comparisons with 0 or NULL (unless the first one is really boolean),
> but I only counted 1, while I counted 2 for the extra parentheses.

I think you're right about the ndis_80211. I got thrown off by the first
usage of it in the file which reads:
        sc->ndis_80211++;

But it looks like 1) It is tested elsewhere as a boolean, and 2) That
statement really means sc->ndis_80211 =3D 1 (or =3D TRUE).

>=20
> > I'll heed the request of the second-to-last paragraph of style(9) on
> > this particular change, not churning the SVN repo further, and make a
> > mental note for later.
>=20
> Thanks.  I forgot about that paragraph being there.  I think churning
> repos doesn't matter much now if it ever did, but churning sources makes
> their history hard to understand.
>=20
> Bruce
--=20
Coleman Kane

--=-T6DbjhiwI1lJTleeaEDw
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEABECAAYFAkrE+GEACgkQcMSxQcXat5ccBACeNFaorAGbJhBRJdEDb8gOKH24
7G4AmwXTnh1TJPOF7OjBXlWxnIH0BVXj
=piNZ
-----END PGP SIGNATURE-----

--=-T6DbjhiwI1lJTleeaEDw--


From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 18:46:37 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C5A8C1065696
	for ; Thu,  1 Oct 2009 18:46:37 +0000 (UTC)
	(envelope-from cokane@FreeBSD.org)
Received: from mail-out1.fuse.net (mail-out1.fuse.net [216.68.8.175])
	by mx1.freebsd.org (Postfix) with ESMTP id 8191F8FC20
	for ; Thu,  1 Oct 2009 18:46:37 +0000 (UTC)
X-CNFS-Analysis: v=1.1 cv=Jf3tspjE8XI4z6saXnuFbjgHz4WKruKDsdWNlYDB8z0= c=1
	sm=0 a=YYkPiygOjqcA:10 a=6I5d2MoRAAAA:8
	a=5NRtI-kUalALLSyT6tIA:9 a=_HdLcGZMIcqpDuZqAVcA:7
	a=qn7lfz4Ks5yHYWggAD9Lj9F6cnIA:4 a=SV7veod9ZcQA:10
	a=h4xQxGY_LDVKyn9w1MAA:9 a=agx7ydx-tRjAyvU9kHkxu3eBtUwA:4
	a=LkYvsgB9u1MH7Ao0BLhsLg==:117
X-CM-Score: 0
X-Scanned-by: Cloudmark Authority Engine
Authentication-Results: ecout1 smtp.mail=cokane@FreeBSD.org; spf=softfail
Received-SPF: softfail (ecout1: transitional domain FreeBSD.org does not
	designate 74.215.227.9 as permitted sender)
Received: from [74.215.227.9] ([74.215.227.9:50818] helo=mail.colemankane.org)
	by ecout1 (envelope-from )
	(ecelerity 2.2.2.43 r()) with ESMTP
	id EC/5E-02412-B09F4CA4; Thu, 01 Oct 2009 14:46:36 -0400
Received: from [172.20.0.76] (rrcs-96-11-231-210.central.biz.rr.com
	[96.11.231.210])
	by mail.colemankane.org (Postfix) with ESMTPSA id 4F1DF1143F;
	Thu,  1 Oct 2009 15:51:33 -0400 (EDT)
From: Coleman Kane 
To: Bruce Evans 
In-Reply-To: <20091002040903.U21917@delplex.bde.org>
References: <200910010243.n912hpSM034846@svn.freebsd.org>
	<86eipno12p.fsf@ds4.des.no> <20091002002534.D21507@delplex.bde.org>
	<1254418346.4255.31.camel@localhost>
	<20091002040903.U21917@delplex.bde.org>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-T6DbjhiwI1lJTleeaEDw"
Organization: FreeBSD Project
Date: Thu, 01 Oct 2009 14:43:45 -0400
Message-Id: <1254422625.4255.46.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port 
Cc: svn-src-head@FreeBSD.org,
	Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject: Re: svn commit: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 18:46:37 -0000


--=-T6DbjhiwI1lJTleeaEDw
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2009-10-02 at 04:20 +1000, Bruce Evans wrote:
> On Thu, 1 Oct 2009, Coleman Kane wrote:
>=20
> > On Fri, 2009-10-02 at 00:36 +1000, Bruce Evans wrote:
> >> On Thu, 1 Oct 2009, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote:
> >>
> >>> Coleman Kane  writes:
> >>>> -		if (sc->ndis_80211 && vap)
> >>>> +		if ((sc->ndis_80211 !=3D NULL) && (vap !=3D NULL))
> >>>
> >>> sc->ndis_80211 is an int.  NULL is a pointer.
> >>
> >> Also, the number of style bugs was doubled on (almost?) every changed =
line
> >> by adding 2 sets of unnecessary parentheses.
> >>
> >> Bruce
> >
> > Re-read style(9) more closely.
>=20
> Do I need to read it at all :-).

I meant that in the past-tense first-person manner, sorry, not trying to
tell anyone what to do. ;) Should have written "I re-read style(9)...".

>=20
> > Yes... the extra parentheses are superfluous, and should therefore be
> > removed. However, the current rev, which looks like this:
> >
> >  if ((sc->ndis_80211 !=3D 0) && (vap !=3D NULL))
> >
> > doesn't help the author shoot themselves in the foot as violating the
> > "explicitly compare values to zero" rule did in the earlier revision.
>=20
> Actually I needed to count the style bugs more carefully -- 2 implicit
> comparisons with 0 or NULL (unless the first one is really boolean),
> but I only counted 1, while I counted 2 for the extra parentheses.

I think you're right about the ndis_80211. I got thrown off by the first
usage of it in the file which reads:
        sc->ndis_80211++;

But it looks like 1) It is tested elsewhere as a boolean, and 2) That
statement really means sc->ndis_80211 =3D 1 (or =3D TRUE).

>=20
> > I'll heed the request of the second-to-last paragraph of style(9) on
> > this particular change, not churning the SVN repo further, and make a
> > mental note for later.
>=20
> Thanks.  I forgot about that paragraph being there.  I think churning
> repos doesn't matter much now if it ever did, but churning sources makes
> their history hard to understand.
>=20
> Bruce
--=20
Coleman Kane

--=-T6DbjhiwI1lJTleeaEDw
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEABECAAYFAkrE+GEACgkQcMSxQcXat5ccBACeNFaorAGbJhBRJdEDb8gOKH24
7G4AmwXTnh1TJPOF7OjBXlWxnIH0BVXj
=piNZ
-----END PGP SIGNATURE-----

--=-T6DbjhiwI1lJTleeaEDw--


From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 18:58:27 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D95C106566B;
	Thu,  1 Oct 2009 18:58:27 +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 EAB608FC13;
	Thu,  1 Oct 2009 18:58:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91IwQWG061713;
	Thu, 1 Oct 2009 18:58:26 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91IwQhM061711;
	Thu, 1 Oct 2009 18:58:26 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200910011858.n91IwQhM061711@svn.freebsd.org>
From: Xin LI 
Date: Thu, 1 Oct 2009 18:58: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: r197683 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/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: Thu, 01 Oct 2009 18:58:27 -0000

Author: delphij
Date: Thu Oct  1 18:58:26 2009
New Revision: 197683
URL: http://svn.freebsd.org/changeset/base/197683

Log:
  Return EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old
  format ZFS, as defined in the manual page.
  
  Submitted by:	pjd (response of my original patch but bugs are mine)
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Thu Oct  1 18:37:16 2009	(r197682)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Thu Oct  1 18:58:26 2009	(r197683)
@@ -4180,8 +4180,12 @@ zfs_freebsd_setattr(ap)
 	zflags = VTOZ(vp)->z_phys->zp_flags;
 
 	if (vap->va_flags != VNOVAL) {
+		zfsvfs_t *zfsvfs = VTOZ(vp)->z_zfsvfs;
 		int error;
 
+		if (zfsvfs->z_use_fuids == B_FALSE)
+			return (EOPNOTSUPP);
+
 		fflags = vap->va_flags;
 		if ((fflags & ~(SF_IMMUTABLE|SF_APPEND|SF_NOUNLINK|UF_NODUMP)) != 0)
 			return (EOPNOTSUPP);

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 19:12:14 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 783F110656F9;
	Thu,  1 Oct 2009 19:12:14 +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 669EB8FC17;
	Thu,  1 Oct 2009 19:12:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91JCEHG062041;
	Thu, 1 Oct 2009 19:12:14 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91JCEoG062039;
	Thu, 1 Oct 2009 19:12:14 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910011912.n91JCEoG062039@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 1 Oct 2009 19:12: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: r197684 - head/sys/ddb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 19:12:14 -0000

Author: jhb
Date: Thu Oct  1 19:12:14 2009
New Revision: 197684
URL: http://svn.freebsd.org/changeset/base/197684

Log:
  Put square backets ([]) around process names for system processes to patch
  the behavior of ps(1).

Modified:
  head/sys/ddb/db_ps.c

Modified: head/sys/ddb/db_ps.c
==============================================================================
--- head/sys/ddb/db_ps.c	Thu Oct  1 18:58:26 2009	(r197683)
+++ head/sys/ddb/db_ps.c	Thu Oct  1 19:12:14 2009	(r197684)
@@ -189,13 +189,19 @@ db_ps(db_expr_t addr, boolean_t hasaddr,
 		if (cred != NULL && jailed(cred))
 			strlcat(state, "J", sizeof(state));
 		db_printf(" %-6.6s ", state);
-		if (p->p_flag & P_HADTHREADS)
+		if (p->p_flag & P_HADTHREADS) {
 #ifdef __LP64__
-			db_printf(" (threaded)                  %s\n",
-			    p->p_comm);
+			db_printf(" (threaded)                  ");
 #else
-			db_printf(" (threaded)          %s\n", p->p_comm);
+			db_printf(" (threaded)          ");
 #endif
+			if (p->p_flag & P_SYSTEM)
+				db_printf("[");
+			db_printf("%s", p->p_comm);
+			if (p->p_flag & P_SYSTEM)
+				db_printf("]");
+			db_printf("\n");
+		}
 		FOREACH_THREAD_IN_PROC(p, td) {
 			dumpthread(p, td, p->p_flag & P_HADTHREADS);
 			if (db_pager_quit)

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 20:32:30 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10C29106568D;
	Thu,  1 Oct 2009 20:32:30 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F36B68FC1C;
	Thu,  1 Oct 2009 20:32:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91KWTmK064115;
	Thu, 1 Oct 2009 20:32:29 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91KWTOa064111;
	Thu, 1 Oct 2009 20:32:29 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <200910012032.n91KWTOa064111@svn.freebsd.org>
From: Qing Li 
Date: Thu, 1 Oct 2009 20:32: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: r197687 - 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: Thu, 01 Oct 2009 20:32:30 -0000

Author: qingli
Date: Thu Oct  1 20:32:29 2009
New Revision: 197687
URL: http://svn.freebsd.org/changeset/base/197687

Log:
  The flow-table associates TCP/UDP flows and IP destinations with
  specific routes. When the routing table changes, for example,
  when a new route with a more specific prefix is inserted into the
  routing table, the flow-table is not updated to reflect that change.
  As such existing connections cannot take advantage of the new path.
  In some cases the path is broken. This patch will update the affected
  flow-table entries when a more specific route is added. The route
  entry is properly marked when a route is deleted from the table.
  In this case, when the flow-table performs a search, the stale
  entry is updated automatically. Therefore this patch is not
  necessary for route deletion.
  
  Submitted by:	simon, phk
  Reviewed by:	bz, kmacy
  MFC after:	3 days

Modified:
  head/sys/net/flowtable.c
  head/sys/net/flowtable.h
  head/sys/net/route.c

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Thu Oct  1 20:11:42 2009	(r197686)
+++ head/sys/net/flowtable.c	Thu Oct  1 20:32:29 2009	(r197687)
@@ -830,7 +830,7 @@ fle_free(struct flentry *fle)
 }
 
 static void
-flowtable_free_stale(struct flowtable *ft)
+flowtable_free_stale(struct flowtable *ft, struct rtentry *rt)
 {
 	int curbit = 0, count;
 	struct flentry *fle,  **flehead, *fleprev;
@@ -866,8 +866,14 @@ flowtable_free_stale(struct flowtable *f
 			    curbit);
 		}
 #endif		
-		while (fle != NULL) {	
-			if (!flow_stale(ft, fle)) {
+		while (fle != NULL) {
+			if (rt != NULL) {
+				if (__DEVOLATILE(struct rtentry *, fle->f_rt) != rt) {
+					fleprev = fle;
+					fle = fle->f_next;
+					continue;
+				}
+			} else if (!flow_stale(ft, fle)) {
 				fleprev = fle;
 				fle = fle->f_next;
 				continue;
@@ -916,6 +922,30 @@ flowtable_free_stale(struct flowtable *f
 		log(LOG_DEBUG, "freed %d flow entries\n", count);
 }
 
+void
+flowtable_route_flush(struct flowtable *ft, struct rtentry *rt)
+{
+	int i;
+	if (ft->ft_flags & FL_PCPU) {
+		for (i = 0; i <= mp_maxid; i++) {
+			if (CPU_ABSENT(i))
+				continue;
+
+			thread_lock(curthread);
+			sched_bind(curthread, i);
+			thread_unlock(curthread);
+
+			flowtable_free_stale(ft, rt);
+
+			thread_lock(curthread);
+			sched_unbind(curthread);
+			thread_unlock(curthread);
+		}
+	} else {
+		flowtable_free_stale(ft, rt);
+	}
+}
+
 static void
 flowtable_clean_vnet(void)
 {
@@ -933,14 +963,14 @@ flowtable_clean_vnet(void)
 				sched_bind(curthread, i);
 				thread_unlock(curthread);
 
-				flowtable_free_stale(ft);
+				flowtable_free_stale(ft, NULL);
 
 				thread_lock(curthread);
 				sched_unbind(curthread);
 				thread_unlock(curthread);
 			}
 		} else {
-			flowtable_free_stale(ft);
+			flowtable_free_stale(ft, NULL);
 		}
 		ft = ft->ft_next;
 	}

Modified: head/sys/net/flowtable.h
==============================================================================
--- head/sys/net/flowtable.h	Thu Oct  1 20:11:42 2009	(r197686)
+++ head/sys/net/flowtable.h	Thu Oct  1 20:32:29 2009	(r197687)
@@ -51,5 +51,7 @@ struct flowtable *flowtable_alloc(int ne
 int flowtable_lookup(struct flowtable *ft, struct mbuf *m,
     struct route *ro, uint32_t fibnum);
 
+void flowtable_route_flush(struct flowtable *ft, struct rtentry *rt);
+
 #endif /* _KERNEL */
 #endif

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Thu Oct  1 20:11:42 2009	(r197686)
+++ head/sys/net/route.c	Thu Oct  1 20:32:29 2009	(r197687)
@@ -56,6 +56,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef RADIX_MPATH
 #include 
@@ -996,6 +997,9 @@ rtrequest1_fib(int req, struct rt_addrin
 {
 	int error = 0, needlock = 0;
 	register struct rtentry *rt;
+#ifdef FLOWTABLE
+	register struct rtentry *rt0;
+#endif
 	register struct radix_node *rn;
 	register struct radix_node_head *rnh;
 	struct ifaddr *ifa;
@@ -1153,6 +1157,53 @@ rtrequest1_fib(int req, struct rt_addrin
 		}
 #endif
 
+#ifdef FLOWTABLE
+		rt0 = NULL;
+		/* XXX
+		 * "flow-table" only support IPv4 at the moment.
+		 */
+		if (dst->sa_family == AF_INET) {
+			rn = rnh->rnh_matchaddr(dst, rnh);
+			if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
+				struct sockaddr *mask;
+				u_char *m, *n;
+				int len;
+				
+				/*
+				 * compare mask to see if the new route is
+				 * more specific than the existing one
+				 */
+				rt0 = RNTORT(rn);
+				RT_LOCK(rt0);
+				RT_ADDREF(rt0);
+				RT_UNLOCK(rt0);
+				/*
+				 * A host route is already present, so 
+				 * leave the flow-table entries as is.
+				 */
+				if (rt0->rt_flags & RTF_HOST) {
+					RTFREE(rt0);
+					rt0 = NULL;
+				} else if (!(flags & RTF_HOST) && netmask) {
+					mask = rt_mask(rt0);
+					len = mask->sa_len;
+					m = (u_char *)mask;
+					n = (u_char *)netmask;
+					while (len-- > 0) {
+						if (*n != *m)
+							break;
+						n++;
+						m++;
+					}
+					if (len == 0 || (*n < *m)) {
+						RTFREE(rt0);
+						rt0 = NULL;
+					}
+				}
+			}
+		}
+#endif
+
 		/* XXX mtu manipulation will be done in rnh_addaddr -- itojun */
 		rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes);
 		/*
@@ -1165,8 +1216,18 @@ rtrequest1_fib(int req, struct rt_addrin
 			Free(rt_key(rt));
 			RT_LOCK_DESTROY(rt);
 			uma_zfree(V_rtzone, rt);
+#ifdef FLOWTABLE
+			if (rt0 != NULL)
+				RTFREE(rt0);
+#endif
 			senderr(EEXIST);
+		} 
+#ifdef FLOWTABLE
+		else if (rt0 != NULL) {
+			flowtable_route_flush(V_ip_ft, rt0);
+			RTFREE(rt0);
 		}
+#endif
 
 		/*
 		 * If this protocol has something to add to this then

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 20:56:15 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82E271065695;
	Thu,  1 Oct 2009 20:56:15 +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 582438FC16;
	Thu,  1 Oct 2009 20:56:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91KuFK5064970;
	Thu, 1 Oct 2009 20:56:15 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91KuFK4064968;
	Thu, 1 Oct 2009 20:56:15 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200910012056.n91KuFK4064968@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 1 Oct 2009 20:56: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: r197688 - head/sys/modules/acpi/acpi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 20:56:15 -0000

Author: jkim
Date: Thu Oct  1 20:56:15 2009
New Revision: 197688
URL: http://svn.freebsd.org/changeset/base/197688

Log:
  Compile ACPI debugger and disassembler for kernel modules unconditionally.
  These files will generate almost empty object files without ACPI_DEBUG/DDB
  options.  As a result, size of acpi.ko will increase slightly.

Modified:
  head/sys/modules/acpi/acpi/Makefile

Modified: head/sys/modules/acpi/acpi/Makefile
==============================================================================
--- head/sys/modules/acpi/acpi/Makefile	Thu Oct  1 20:32:29 2009	(r197687)
+++ head/sys/modules/acpi/acpi/Makefile	Thu Oct  1 20:56:15 2009	(r197688)
@@ -27,6 +27,10 @@
 KMOD=	acpi
 
 # ACPI CA sources
+SRCS+=	dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c dbinput.c dbstats.c
+SRCS+=	dbutils.c dbxface.c
+SRCS+=	dmbuffer.c dmnames.c dmopcode.c dmobject.c dmresrc.c dmresrcl.c
+SRCS+=	dmresrcs.c dmutils.c dmwalk.c
 SRCS+=	dsfield.c dsinit.c dsmethod.c dsmthdat.c dsobject.c dsopcode.c
 SRCS+=	dsutils.c dswexec.c dswload.c dswscope.c dswstate.c
 SRCS+=	evevent.c evgpe.c evgpeblk.c evmisc.c evregion.c evrgnini.c evsci.c
@@ -69,12 +73,6 @@ SRCS+=	cpufreq_if.h device_if.h isa_if.h
 # This obviously needs a better and more structural fix.
 SRCS+=	opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h
 
-# Debugging support
-DBSRC=	dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c dbinput.c dbstats.c
-DBSRC+=	dbutils.c dbxface.c
-DBSRC+=	dmbuffer.c dmnames.c dmopcode.c dmobject.c dmresrc.c dmresrcl.c
-DBSRC+=	dmresrcs.c dmutils.c dmwalk.c
-
 .if !defined(KERNBUILDDIR)
 .if KTR
 CFLAGS+=-DKTR
@@ -87,7 +85,6 @@ CFLAGS+=-DACPI_MAX_THREADS=${ACPI_MAX_TH
 .endif
 .if ACPI_DEBUG
 CFLAGS+=-DACPI_DEBUG
-SRCS+=	${DBSRC}
 opt_ddb.h: Makefile
 	echo "#define DDB 1" > ${.TARGET}
 .else
@@ -98,10 +95,12 @@ opt_ddb.h: Makefile
 
 # Machine-specific code such as sleep/wakeup
 SRCS+=	acpi_machdep.c acpi_wakecode.h acpi_wakeup.c
-.if ${MACHINE} == "i386"
-SRCS+=	madt.c assym.s
+SRCS+=	assym.s madt.c
+CLEANFILES+=	acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o
+.if ${MACHINE_ARCH} == "amd64"
+SRCS+=	opt_global.h
+CLEANFILES+=	acpi_wakedata.h
 .endif
-CLEANFILES+=	acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin ${DBSRC:.c=.o}
 
 acpi_wakecode.h: acpi_wakecode.S assym.s
 	${MAKE} -f ${.CURDIR}/../../../${MACHINE_ARCH}/acpica/Makefile \

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 21:40:08 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B95C1065672;
	Thu,  1 Oct 2009 21:40:08 +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 70CE38FC1B;
	Thu,  1 Oct 2009 21:40:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91Le8Sr071675;
	Thu, 1 Oct 2009 21:40:08 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91Le8Kx071672;
	Thu, 1 Oct 2009 21:40:08 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200910012140.n91Le8Kx071672@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Thu, 1 Oct 2009 21:40: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: r197691 - in head: bin/sh tools/regression/bin/sh/errors
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 21:40:08 -0000

Author: jilles
Date: Thu Oct  1 21:40:08 2009
New Revision: 197691
URL: http://svn.freebsd.org/changeset/base/197691

Log:
  sh: Disallow mismatched quotes in backticks (`...`).
  
  Due to the amount of code removed by this, it seems that allowing unmatched
  quotes was a deliberate imitation of System V sh and real ksh. Most other
  shells do not allow unmatched quotes (e.g. bash, zsh, pdksh, NetBSD /bin/sh,
  dash).
  
  PR:		bin/137657

Added:
  head/tools/regression/bin/sh/errors/backquote-error2.0   (contents, props changed)
Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Thu Oct  1 21:14:40 2009	(r197690)
+++ head/bin/sh/parser.c	Thu Oct  1 21:40:08 2009	(r197691)
@@ -82,7 +82,6 @@ struct heredoc {
 
 
 STATIC struct heredoc *heredoclist;	/* list of here documents to read */
-STATIC int parsebackquote;	/* nonzero if we are inside backquotes */
 STATIC int doprompt;		/* if set, prompt the user */
 STATIC int needprompt;		/* true if interactive and at start of line */
 STATIC int lasttoken;		/* last token read */
@@ -1043,7 +1042,7 @@ readtoken1(int firstc, char const *synta
 endword:
 	if (syntax == ARISYNTAX)
 		synerror("Missing '))'");
-	if (syntax != BASESYNTAX && ! parsebackquote && eofmark == NULL)
+	if (syntax != BASESYNTAX && eofmark == NULL)
 		synerror("Unterminated quoted string");
 	if (varnest != 0) {
 		startlinno = plinno;
@@ -1303,7 +1302,6 @@ parsesub: {
 
 parsebackq: {
 	struct nodelist **nlpp;
-	int savepbq;
 	union node *n;
 	char *volatile str;
 	struct jmploc jmploc;
@@ -1311,11 +1309,9 @@ parsebackq: {
 	int savelen;
 	int saveprompt;
 
-	savepbq = parsebackquote;
 	if (setjmp(jmploc.loc)) {
 		if (str)
 			ckfree(str);
-		parsebackquote = 0;
 		handler = savehandler;
 		longjmp(handler->loc, 1);
 	}
@@ -1397,7 +1393,6 @@ done:
 		nlpp = &(*nlpp)->next;
 	*nlpp = (struct nodelist *)stalloc(sizeof (struct nodelist));
 	(*nlpp)->next = NULL;
-	parsebackquote = oldstyle;
 
 	if (oldstyle) {
 		saveprompt = doprompt;
@@ -1433,7 +1428,6 @@ done:
 		str = NULL;
 		INTON;
 	}
-	parsebackquote = savepbq;
 	handler = savehandler;
 	if (arinest || dblquote)
 		USTPUTC(CTLBACKQ | CTLQUOTE, out);

Added: head/tools/regression/bin/sh/errors/backquote-error2.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/errors/backquote-error2.0	Thu Oct  1 21:40:08 2009	(r197691)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+sh -c 'echo `echo .BA"DCODE.`
+echo ".BAD"CODE.' 2>&1 | grep -q BADCODE && exit 1
+echo '`"`' | sh -n 2>/dev/null && exit 1
+echo '`'"'"'`' | sh -n 2>/dev/null && exit 1
+exit 0

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 21:44:30 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E052A1065693;
	Thu,  1 Oct 2009 21:44: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 CD0A28FC16;
	Thu,  1 Oct 2009 21:44:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91LiUri072603;
	Thu, 1 Oct 2009 21:44:30 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91LiU4X072601;
	Thu, 1 Oct 2009 21:44:30 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <200910012144.n91LiU4X072601@svn.freebsd.org>
From: Ed Maste 
Date: Thu, 1 Oct 2009 21:44: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: r197692 - 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: Thu, 01 Oct 2009 21:44:31 -0000

Author: emaste
Date: Thu Oct  1 21:44:30 2009
New Revision: 197692
URL: http://svn.freebsd.org/changeset/base/197692

Log:
  In fill_kinfo_thread, copy the thread's name into struct kinfo_proc even
  if it is empty.  Otherwise the previous thread's name would remain in the
  struct and then be reported for this thread.
  
  Submitted by:	Ryan Stone
  MFC after:	1 week

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Thu Oct  1 21:40:08 2009	(r197691)
+++ head/sys/kern/kern_proc.c	Thu Oct  1 21:44:30 2009	(r197692)
@@ -847,8 +847,7 @@ fill_kinfo_thread(struct thread *td, str
 		strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg));
 	else
 		bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg));
-	if (td->td_name[0] != '\0')
-		strlcpy(kp->ki_ocomm, td->td_name, sizeof(kp->ki_ocomm));
+	strlcpy(kp->ki_ocomm, td->td_name, sizeof(kp->ki_ocomm));
 	if (TD_ON_LOCK(td)) {
 		kp->ki_kiflag |= KI_LOCKBLOCK;
 		strlcpy(kp->ki_lockname, td->td_lockname,

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 21:51:51 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 404791065672;
	Thu,  1 Oct 2009 21:51:51 +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 138B28FC16;
	Thu,  1 Oct 2009 21:51:51 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id A3AE246B03;
	Thu,  1 Oct 2009 17:51:50 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id CEF918A021;
	Thu,  1 Oct 2009 17:51:49 -0400 (EDT)
From: John Baldwin 
To: src-committers@freebsd.org
Date: Thu, 1 Oct 2009 15:17:49 -0400
User-Agent: KMail/1.9.7
References: <200910011912.n91JCEoG062039@svn.freebsd.org>
In-Reply-To: <200910011912.n91JCEoG062039@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200910011517.50276.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Thu, 01 Oct 2009 17:51:49 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r197684 - head/sys/ddb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 21:51:51 -0000

On Thursday 01 October 2009 3:12:14 pm John Baldwin wrote:
> Author: jhb
> Date: Thu Oct  1 19:12:14 2009
> New Revision: 197684
> URL: http://svn.freebsd.org/changeset/base/197684
> 
> Log:
>   Put square backets ([]) around process names for system processes to patch
>   the behavior of ps(1).

Bah I should clarify that this just fixes the process name for multithreaded
kernel processes.  Single-threaded processes were already handled.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Oct  1 22:05:39 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 107A6106568B;
	Thu,  1 Oct 2009 22:05:39 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0021D8FC0A;
	Thu,  1 Oct 2009 22:05:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91M5cf1076256;
	Thu, 1 Oct 2009 22:05:38 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91M5cTJ076251;
	Thu, 1 Oct 2009 22:05:38 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200910012205.n91M5cTJ076251@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 1 Oct 2009 22: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: r197693 - in head/sys/i386: i386 include xen
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 01 Oct 2009 22:05:39 -0000

Author: kmacy
Date: Thu Oct  1 22:05:38 2009
New Revision: 197693
URL: http://svn.freebsd.org/changeset/base/197693

Log:
  make read_eflags and write_eflags accomplish the same effect on PVM as native,
  simplifying interrupt handling

Modified:
  head/sys/i386/i386/vm_machdep.c
  head/sys/i386/include/cpufunc.h
  head/sys/i386/xen/xen_machdep.c

Modified: head/sys/i386/i386/vm_machdep.c
==============================================================================
--- head/sys/i386/i386/vm_machdep.c	Thu Oct  1 21:44:30 2009	(r197692)
+++ head/sys/i386/i386/vm_machdep.c	Thu Oct  1 22:05:38 2009	(r197693)
@@ -270,11 +270,7 @@ cpu_fork(td1, p2, td2, flags)
 	/*
 	 * XXX XEN need to check on PSL_USER is handled
 	 */
-#ifdef XEN
-	td2->td_md.md_saved_flags = 0;
-#else	
 	td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I;
-#endif
 	/*
 	 * Now, cpu_switch() can schedule the new process.
 	 * pcb_esp is loaded pointing to the cpu_switch() stack frame
@@ -446,11 +442,7 @@ cpu_set_upcall(struct thread *td, struct
 
 	/* Setup to release spin count in fork_exit(). */
 	td->td_md.md_spinlock_count = 1;
-#ifdef XEN	
-	td->td_md.md_saved_flags = 0;	
-#else
 	td->td_md.md_saved_flags = PSL_KERNEL | PSL_I;
-#endif
 }
 
 /*

Modified: head/sys/i386/include/cpufunc.h
==============================================================================
--- head/sys/i386/include/cpufunc.h	Thu Oct  1 21:44:30 2009	(r197692)
+++ head/sys/i386/include/cpufunc.h	Thu Oct  1 22:05:38 2009	(r197693)
@@ -49,8 +49,8 @@ extern u_int xen_rcr2(void);
 extern void xen_load_cr3(u_int data);
 extern void xen_tlb_flush(void);
 extern void xen_invlpg(u_int addr);
-extern int xen_save_and_cli(void);
-extern void xen_restore_flags(u_int eflags);
+extern void write_eflags(u_int eflags);
+extern u_int read_eflags(void);
 #endif
 
 struct region_descriptor;
@@ -293,7 +293,11 @@ ia32_pause(void)
 }
 
 static __inline u_int
+#ifdef XEN
+_read_eflags(void)
+#else	
 read_eflags(void)
+#endif
 {
 	u_int	ef;
 
@@ -335,7 +339,11 @@ wbinvd(void)
 }
 
 static __inline void
+#ifdef XEN
+_write_eflags(u_int ef)
+#else
 write_eflags(u_int ef)
+#endif
 {
 	__asm __volatile("pushl %0; popfl" : : "r" (ef));
 }
@@ -653,23 +661,15 @@ intr_disable(void)
 {
 	register_t eflags;
 
-#ifdef XEN
-	eflags = xen_save_and_cli();
-#else 	
 	eflags = read_eflags();
 	disable_intr();
-#endif	
 	return (eflags);
 }
 
 static __inline void
 intr_restore(register_t eflags)
 {
-#ifdef XEN
-	xen_restore_flags(eflags);
-#else
 	write_eflags(eflags);
-#endif
 }
 
 #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */

Modified: head/sys/i386/xen/xen_machdep.c
==============================================================================
--- head/sys/i386/xen/xen_machdep.c	Thu Oct  1 21:44:30 2009	(r197692)
+++ head/sys/i386/xen/xen_machdep.c	Thu Oct  1 22:05:38 2009	(r197693)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -101,6 +102,7 @@ void ni_sti(void);
 void
 ni_cli(void)
 {
+	CTR0(KTR_SPARE2, "ni_cli disabling interrupts");
 	__asm__("pushl %edx;"
 		"pushl %eax;"
 		);
@@ -345,33 +347,53 @@ xen_load_cr3(u_int val)
 	PANIC_IF(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 }
 
-void
-xen_restore_flags(u_int eflags)
+#ifdef KTR
+static __inline u_int
+rebp(void)
 {
-	if (eflags > 1)
-		eflags = ((eflags & PSL_I) == 0);
+	u_int	data;
 
-	__restore_flags(eflags);
+	__asm __volatile("movl 4(%%ebp),%0" : "=r" (data));	
+	return (data);
 }
+#endif
 
-int
-xen_save_and_cli(void)
+u_int
+read_eflags(void)
 {
-	int eflags;
-	
-	__save_and_cli(eflags);
+        vcpu_info_t *_vcpu;
+	u_int eflags;
+
+	eflags = _read_eflags();
+        _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; 
+	if (_vcpu->evtchn_upcall_mask)
+		eflags &= ~PSL_I;
+
 	return (eflags);
 }
 
 void
+write_eflags(u_int eflags)
+{
+	u_int intr;
+
+	CTR2(KTR_SPARE2, "%x xen_restore_flags eflags %x", rebp(), eflags);
+	intr = ((eflags & PSL_I) == 0);
+	__restore_flags(intr);
+	_write_eflags(eflags);
+}
+
+void
 xen_cli(void)
 {
+	CTR1(KTR_SPARE2, "%x xen_cli disabling interrupts", rebp());
 	__cli();
 }
 
 void
 xen_sti(void)
 {
+	CTR1(KTR_SPARE2, "%x xen_sti enabling interrupts", rebp());
 	__sti();
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 00:42:53 2009
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.ORG
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2A8AA1065679;
	Fri,  2 Oct 2009 00:42:53 +0000 (UTC)
	(envelope-from delphij@delphij.net)
Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net
	[IPv6:2001:470:1f03:2c9::2])
	by mx1.freebsd.org (Postfix) with ESMTP id CB5408FC14;
	Fri,  2 Oct 2009 00:42:52 +0000 (UTC)
Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by tarsier.delphij.net (Postfix) with ESMTPS id DC03D5C025;
	Fri,  2 Oct 2009 08:42:51 +0800 (CST)
Received: from localhost (tarsier.geekcn.org [211.166.10.233])
	by tarsier.geekcn.org (Postfix) with ESMTP id 9EFE855CE30F;
	Fri,  2 Oct 2009 08:42:51 +0800 (CST)
X-Virus-Scanned: amavisd-new at geekcn.org
Received: from tarsier.geekcn.org ([211.166.10.233])
	by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new,
	port 10024)
	with ESMTP id qOEO-mlJD3Cf; Fri,  2 Oct 2009 08:42:46 +0800 (CST)
Received: from charlie.delphij.net (adsl-76-237-33-60.dsl.pltn13.sbcglobal.net
	[76.237.33.60])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by tarsier.geekcn.org (Postfix) with ESMTPSA id 2C68A55CE308;
	Fri,  2 Oct 2009 08:42:44 +0800 (CST)
DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns;
	h=message-id:date:from:reply-to:organization:user-agent:
	mime-version:to:cc:subject:references:in-reply-to:
	x-enigmail-version:openpgp:content-type:content-transfer-encoding;
	b=WUSmyUBKt6lYKcNnn9WbZ2slKYr7dCEy21Ud1C0QxRtinvIc8+t3vF43AuLqW67lh
	Rs2e1bZ2FT6tuQNfsDZ9w==
Message-ID: <4AC54C81.7030201@delphij.net>
Date: Thu, 01 Oct 2009 17:42:41 -0700
From: Xin LI 
Organization: The FreeBSD Project
User-Agent: Thunderbird 2.0.0.22 (X11/20090803)
MIME-Version: 1.0
To: Konstantin Belousov 
References: <200910011250.n91CoQ5G051511@svn.freebsd.org>
In-Reply-To: <200910011250.n91CoQ5G051511@svn.freebsd.org>
X-Enigmail-Version: 0.96.0
OpenPGP: id=18EDEBA0;
	url=http://www.delphij.net/delphij.asc
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: r197662 - head/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: d@delphij.net
List-Id: "SVN commit messages 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, 02 Oct 2009 00:42:53 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Konstantin Belousov wrote:
> Author: kib
> Date: Thu Oct  1 12:50:26 2009
> New Revision: 197662
> URL: http://svn.freebsd.org/changeset/base/197662
> 
> Log:
>   Do not dereference vp->v_mount without holding vnode lock and checking
>   that the vnode is not reclaimed.
>   
>   Noted by:	Igor Sysoev 
>   MFC after:	1 week

Thanks!

> Modified:
>   head/sys/kern/uipc_syscalls.c
> 
> Modified: head/sys/kern/uipc_syscalls.c
> ==============================================================================
> --- head/sys/kern/uipc_syscalls.c	Thu Oct  1 12:48:35 2009	(r197661)
> +++ head/sys/kern/uipc_syscalls.c	Thu Oct  1 12:50:26 2009	(r197662)
> @@ -2086,9 +2086,11 @@ retry_space:
>  				/*
>  				 * Get the page from backing store.
>  				 */
> -				bsize = vp->v_mount->mnt_stat.f_iosize;
>  				vfslocked = VFS_LOCK_GIANT(vp->v_mount);
> -				vn_lock(vp, LK_SHARED | LK_RETRY);
> +				error = vn_lock(vp, LK_SHARED);
> +				if (error != 0)
> +					goto after_read;
> +				bsize = vp->v_mount->mnt_stat.f_iosize;
>  
>  				/*
>  				 * XXXMAC: Because we don't have fp->f_cred
> @@ -2101,6 +2103,7 @@ retry_space:
>  				    IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT),
>  				    td->td_ucred, NOCRED, &resid, td);
>  				VOP_UNLOCK(vp, 0);
> +			after_read:
>  				VFS_UNLOCK_GIANT(vfslocked);
>  				VM_OBJECT_LOCK(obj);
>  				vm_page_io_finish(pg);
> 


- --
Xin LI 	http://www.delphij.net/
FreeBSD - The Power to Serve!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (FreeBSD)

iEYEARECAAYFAkrFTIAACgkQi+vbBBjt66DwFgCgn1DSEwLvKdf05bwSWqe3cKwl
qZEAn28OF2G63pmKDzTB5mm2O9SaGuQB
=7Ae1
-----END PGP SIGNATURE-----

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 01:32:41 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F31DE106566B;
	Fri,  2 Oct 2009 01:32:40 +0000 (UTC)
	(envelope-from tomelite82@gmail.com)
Received: from mail-vw0-f171.google.com (mail-vw0-f171.google.com
	[209.85.212.171])
	by mx1.freebsd.org (Postfix) with ESMTP id 70B828FC1B;
	Fri,  2 Oct 2009 01:32:40 +0000 (UTC)
Received: by vws1 with SMTP id 1so403311vws.27
	for ; Thu, 01 Oct 2009 18:32:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to
	:content-type:content-transfer-encoding;
	bh=LHp8BKTYzlISU317e3Zk90EaVbaprx5p/5ttG/RXR44=;
	b=qyct2uc4sBOLRZ9NkeMUxdkvnQp/DqwofiZyYYt0KG5nFY8ZAUW6WIWfMIh1mn8FA5
	RcuSkOd5qh/PnYXD0sOqTlynwEvFgph3UxfnXdynMvhFPs6H42FvN2hczP/dVLf+j6Cn
	iqm9l40Ok1mKwQMitjlZUP03qdgLqO99Jyuco=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=kZUQd7zy45dMao+nxJNtU9DgJuMjEe13kdjl8YEHLwyuR3ImqjIhA2LaX3KLtjz/Nj
	R/vqtRwtzLezLm+4WKfrCYxM/1jbUwiELUumLXMZibyvLHi8QsyRg9JBM1ipBJN/hZXb
	P9KPgueCqF0Vpx7WnZ8muMNI2PGW8BzJrwc6k=
MIME-Version: 1.0
Sender: tomelite82@gmail.com
Received: by 10.220.17.37 with SMTP id q37mr3440057vca.111.1254447159666; Thu, 
	01 Oct 2009 18:32:39 -0700 (PDT)
In-Reply-To: <200910012032.n91KWTOa064111@svn.freebsd.org>
References: <200910012032.n91KWTOa064111@svn.freebsd.org>
Date: Thu, 1 Oct 2009 18:32:39 -0700
X-Google-Sender-Auth: f22102176f379ce2
Message-ID: <9ace436c0910011832q3fe6d273nbfd3c9a5d8d348ed@mail.gmail.com>
From: Qing Li 
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
	svn-src-head@freebsd.org
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: base64
Cc: 
Subject: Re: svn commit: r197687 - 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: Fri, 02 Oct 2009 01:32:41 -0000

SSBtaXNpbnRlcnByZXRlZCB0aGUgIlN1Ym1pdHRlZCBieToiIGZpZWxkLgoKSSB0aG91Z2h0IEkg
cHV0IGluIHRoZSBuYW1lcyBvZiBwZXJzb25zIHdobyByZXBvcnRlZCB0aGUgYnVnLgoKRGlzcmVn
YXJkIHRoZSAiU3VibWl0dGVkIGJ5IiBmaWVsZCBmb3IgdGhpcyBjaGVja2luLgoKSXQncyBteSBj
b2RlLiBTb21ldGhpbmcgYnJlYWtzLCBteSBmYXVsdCwgZW1haWwgbWUgLi4uCgotLSBRaW5nCgoK
T24gVGh1LCBPY3QgMSwgMjAwOSBhdCAxOjMyIFBNLCBRaW5nIExpIDxxaW5nbGlAZnJlZWJzZC5v
cmc+IHdyb3RlOgo+IEF1dGhvcjogcWluZ2xpCj4gRGF0ZTogVGh1IE9jdCCgMSAyMDozMjoyOSAy
MDA5Cj4gTmV3IFJldmlzaW9uOiAxOTc2ODcKPiBVUkw6IGh0dHA6Ly9zdm4uZnJlZWJzZC5vcmcv
Y2hhbmdlc2V0L2Jhc2UvMTk3Njg3Cj4KPiBMb2c6Cj4goFRoZSBmbG93LXRhYmxlIGFzc29jaWF0
ZXMgVENQL1VEUCBmbG93cyBhbmQgSVAgZGVzdGluYXRpb25zIHdpdGgKPiCgc3BlY2lmaWMgcm91
dGVzLiBXaGVuIHRoZSByb3V0aW5nIHRhYmxlIGNoYW5nZXMsIGZvciBleGFtcGxlLAo+IKB3aGVu
IGEgbmV3IHJvdXRlIHdpdGggYSBtb3JlIHNwZWNpZmljIHByZWZpeCBpcyBpbnNlcnRlZCBpbnRv
IHRoZQo+IKByb3V0aW5nIHRhYmxlLCB0aGUgZmxvdy10YWJsZSBpcyBub3QgdXBkYXRlZCB0byBy
ZWZsZWN0IHRoYXQgY2hhbmdlLgo+IKBBcyBzdWNoIGV4aXN0aW5nIGNvbm5lY3Rpb25zIGNhbm5v
dCB0YWtlIGFkdmFudGFnZSBvZiB0aGUgbmV3IHBhdGguCj4goEluIHNvbWUgY2FzZXMgdGhlIHBh
dGggaXMgYnJva2VuLiBUaGlzIHBhdGNoIHdpbGwgdXBkYXRlIHRoZSBhZmZlY3RlZAo+IKBmbG93
LXRhYmxlIGVudHJpZXMgd2hlbiBhIG1vcmUgc3BlY2lmaWMgcm91dGUgaXMgYWRkZWQuIFRoZSBy
b3V0ZQo+IKBlbnRyeSBpcyBwcm9wZXJseSBtYXJrZWQgd2hlbiBhIHJvdXRlIGlzIGRlbGV0ZWQg
ZnJvbSB0aGUgdGFibGUuCj4goEluIHRoaXMgY2FzZSwgd2hlbiB0aGUgZmxvdy10YWJsZSBwZXJm
b3JtcyBhIHNlYXJjaCwgdGhlIHN0YWxlCj4goGVudHJ5IGlzIHVwZGF0ZWQgYXV0b21hdGljYWxs
eS4gVGhlcmVmb3JlIHRoaXMgcGF0Y2ggaXMgbm90Cj4goG5lY2Vzc2FyeSBmb3Igcm91dGUgZGVs
ZXRpb24uCj4KPiCgU3VibWl0dGVkIGJ5OiBzaW1vbiwgcGhrCj4goFJldmlld2VkIGJ5OiCgYnos
IGttYWN5Cj4goE1GQyBhZnRlcjogoCCgMyBkYXlzCj4KPiBNb2RpZmllZDoKPiCgaGVhZC9zeXMv
bmV0L2Zsb3d0YWJsZS5jCj4goGhlYWQvc3lzL25ldC9mbG93dGFibGUuaAo+IKBoZWFkL3N5cy9u
ZXQvcm91dGUuYwo+Cj4gTW9kaWZpZWQ6IGhlYWQvc3lzL25ldC9mbG93dGFibGUuYwo+ID09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PQo+IC0tLSBoZWFkL3N5cy9uZXQvZmxvd3RhYmxlLmMgoCCgVGh1IE9j
dCCgMSAyMDoxMTo0MiAyMDA5IKAgoCCgIKAocjE5NzY4NikKPiArKysgaGVhZC9zeXMvbmV0L2Zs
b3d0YWJsZS5jIKAgoFRodSBPY3QgoDEgMjA6MzI6MjkgMjAwOSCgIKAgoCCgKHIxOTc2ODcpCj4g
QEAgLTgzMCw3ICs4MzAsNyBAQCBmbGVfZnJlZShzdHJ1Y3QgZmxlbnRyeSAqZmxlKQo+IKB9Cj4K
PiCgc3RhdGljIHZvaWQKPiAtZmxvd3RhYmxlX2ZyZWVfc3RhbGUoc3RydWN0IGZsb3d0YWJsZSAq
ZnQpCj4gK2Zsb3d0YWJsZV9mcmVlX3N0YWxlKHN0cnVjdCBmbG93dGFibGUgKmZ0LCBzdHJ1Y3Qg
cnRlbnRyeSAqcnQpCj4goHsKPiCgIKAgoCCgaW50IGN1cmJpdCA9IDAsIGNvdW50Owo+IKAgoCCg
IKBzdHJ1Y3QgZmxlbnRyeSAqZmxlLCCgKipmbGVoZWFkLCAqZmxlcHJldjsKPiBAQCAtODY2LDgg
Kzg2NiwxNCBAQCBmbG93dGFibGVfZnJlZV9zdGFsZShzdHJ1Y3QgZmxvd3RhYmxlICpmCj4goCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgY3VyYml0KTsKPiCgIKAgoCCgIKAgoCCgIKB9Cj4goCNl
bmRpZgo+IC0goCCgIKAgoCCgIKAgoCB3aGlsZSAoZmxlICE9IE5VTEwpIHsKPiAtIKAgoCCgIKAg
oCCgIKAgoCCgIKAgoCBpZiAoIWZsb3dfc3RhbGUoZnQsIGZsZSkpIHsKPiArIKAgoCCgIKAgoCCg
IKAgd2hpbGUgKGZsZSAhPSBOVUxMKSB7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgaWYgKHJ0
ICE9IE5VTEwpIHsKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIGlmIChfX0RFVk9M
QVRJTEUoc3RydWN0IHJ0ZW50cnkgKiwgZmxlLT5mX3J0KSAhPSBydCkgewo+ICsgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCBmbGVwcmV2ID0gZmxlOwo+ICsgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCBmbGUgPSBmbGUtPmZfbmV4dDsKPiArIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgY29udGludWU7Cj4gKyCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgoCCgIKAgoCB9Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgfSBlbHNlIGlm
ICghZmxvd19zdGFsZShmdCwgZmxlKSkgewo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCg
IKBmbGVwcmV2ID0gZmxlOwo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBmbGUgPSBm
bGUtPmZfbmV4dDsKPiCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgY29udGludWU7Cj4g
QEAgLTkxNiw2ICs5MjIsMzAgQEAgZmxvd3RhYmxlX2ZyZWVfc3RhbGUoc3RydWN0IGZsb3d0YWJs
ZSAqZgo+IKAgoCCgIKAgoCCgIKAgoGxvZyhMT0dfREVCVUcsICJmcmVlZCAlZCBmbG93IGVudHJp
ZXNcbiIsIGNvdW50KTsKPiCgfQo+Cj4gK3ZvaWQKPiArZmxvd3RhYmxlX3JvdXRlX2ZsdXNoKHN0
cnVjdCBmbG93dGFibGUgKmZ0LCBzdHJ1Y3QgcnRlbnRyeSAqcnQpCj4gK3sKPiArIKAgoCCgIGlu
dCBpOwo+ICsgoCCgIKAgaWYgKGZ0LT5mdF9mbGFncyAmIEZMX1BDUFUpIHsKPiArIKAgoCCgIKAg
oCCgIKAgZm9yIChpID0gMDsgaSA8PSBtcF9tYXhpZDsgaSsrKSB7Cj4gKyCgIKAgoCCgIKAgoCCg
IKAgoCCgIKAgaWYgKENQVV9BQlNFTlQoaSkpCj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCg
IKAgoCBjb250aW51ZTsKPiArCj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgdGhyZWFkX2xvY2so
Y3VydGhyZWFkKTsKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCBzY2hlZF9iaW5kKGN1cnRocmVh
ZCwgaSk7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgdGhyZWFkX3VubG9jayhjdXJ0aHJlYWQp
Owo+ICsKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCBmbG93dGFibGVfZnJlZV9zdGFsZShmdCwg
cnQpOwo+ICsKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCB0aHJlYWRfbG9jayhjdXJ0aHJlYWQp
Owo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIHNjaGVkX3VuYmluZChjdXJ0aHJlYWQpOwo+ICsg
oCCgIKAgoCCgIKAgoCCgIKAgoCCgIHRocmVhZF91bmxvY2soY3VydGhyZWFkKTsKPiArIKAgoCCg
IKAgoCCgIKAgfQo+ICsgoCCgIKAgfSBlbHNlIHsKPiArIKAgoCCgIKAgoCCgIKAgZmxvd3RhYmxl
X2ZyZWVfc3RhbGUoZnQsIHJ0KTsKPiArIKAgoCCgIH0KPiArfQo+ICsKPiCgc3RhdGljIHZvaWQK
PiCgZmxvd3RhYmxlX2NsZWFuX3ZuZXQodm9pZCkKPiCgewo+IEBAIC05MzMsMTQgKzk2MywxNCBA
QCBmbG93dGFibGVfY2xlYW5fdm5ldCh2b2lkKQo+IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
oCCgIKBzY2hlZF9iaW5kKGN1cnRocmVhZCwgaSk7Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
oCCgIKAgoHRocmVhZF91bmxvY2soY3VydGhyZWFkKTsKPgo+IC0goCCgIKAgoCCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgZmxvd3RhYmxlX2ZyZWVfc3RhbGUoZnQpOwo+ICsgoCCgIKAgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgZmxvd3RhYmxlX2ZyZWVfc3RhbGUoZnQsIE5VTEwpOwo+Cj4goCCgIKAg
oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoHRocmVhZF9sb2NrKGN1cnRocmVhZCk7Cj4goCCgIKAg
oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoHNjaGVkX3VuYmluZChjdXJ0aHJlYWQpOwo+IKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKB0aHJlYWRfdW5sb2NrKGN1cnRocmVhZCk7Cj4goCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKB9Cj4goCCgIKAgoCCgIKAgoCCgfSBlbHNlIHsKPiAtIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCBmbG93dGFibGVfZnJlZV9zdGFsZShmdCk7Cj4gKyCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgZmxvd3RhYmxlX2ZyZWVfc3RhbGUoZnQsIE5VTEwpOwo+IKAgoCCgIKAgoCCg
IKAgoH0KPiCgIKAgoCCgIKAgoCCgIKBmdCA9IGZ0LT5mdF9uZXh0Owo+IKAgoCCgIKB9Cj4KPiBN
b2RpZmllZDogaGVhZC9zeXMvbmV0L2Zsb3d0YWJsZS5oCj4gPT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
Cj4gLS0tIGhlYWQvc3lzL25ldC9mbG93dGFibGUuaCCgIKBUaHUgT2N0IKAxIDIwOjExOjQyIDIw
MDkgoCCgIKAgoChyMTk3Njg2KQo+ICsrKyBoZWFkL3N5cy9uZXQvZmxvd3RhYmxlLmggoCCgVGh1
IE9jdCCgMSAyMDozMjoyOSAyMDA5IKAgoCCgIKAocjE5NzY4NykKPiBAQCAtNTEsNSArNTEsNyBA
QCBzdHJ1Y3QgZmxvd3RhYmxlICpmbG93dGFibGVfYWxsb2MoaW50IG5lCj4goGludCBmbG93dGFi
bGVfbG9va3VwKHN0cnVjdCBmbG93dGFibGUgKmZ0LCBzdHJ1Y3QgbWJ1ZiAqbSwKPiCgIKAgc3Ry
dWN0IHJvdXRlICpybywgdWludDMyX3QgZmlibnVtKTsKPgo+ICt2b2lkIGZsb3d0YWJsZV9yb3V0
ZV9mbHVzaChzdHJ1Y3QgZmxvd3RhYmxlICpmdCwgc3RydWN0IHJ0ZW50cnkgKnJ0KTsKPiArCj4g
oCNlbmRpZiAvKiBfS0VSTkVMICovCj4goCNlbmRpZgo+Cj4gTW9kaWZpZWQ6IGhlYWQvc3lzL25l
dC9yb3V0ZS5jCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Cj4gLS0tIGhlYWQvc3lzL25ldC9yb3V0
ZS5jIKAgoCCgIKBUaHUgT2N0IKAxIDIwOjExOjQyIDIwMDkgoCCgIKAgoChyMTk3Njg2KQo+ICsr
KyBoZWFkL3N5cy9uZXQvcm91dGUuYyCgIKAgoCCgVGh1IE9jdCCgMSAyMDozMjoyOSAyMDA5IKAg
oCCgIKAocjE5NzY4NykKPiBAQCAtNTYsNiArNTYsNyBAQAo+IKAjaW5jbHVkZSA8bmV0L2lmX2Rs
Lmg+Cj4goCNpbmNsdWRlIDxuZXQvcm91dGUuaD4KPiCgI2luY2x1ZGUgPG5ldC92bmV0Lmg+Cj4g
KyNpbmNsdWRlIDxuZXQvZmxvd3RhYmxlLmg+Cj4KPiCgI2lmZGVmIFJBRElYX01QQVRICj4goCNp
bmNsdWRlIDxuZXQvcmFkaXhfbXBhdGguaD4KPiBAQCAtOTk2LDYgKzk5Nyw5IEBAIHJ0cmVxdWVz
dDFfZmliKGludCByZXEsIHN0cnVjdCBydF9hZGRyaW4KPiCgewo+IKAgoCCgIKBpbnQgZXJyb3Ig
PSAwLCBuZWVkbG9jayA9IDA7Cj4goCCgIKAgoHJlZ2lzdGVyIHN0cnVjdCBydGVudHJ5ICpydDsK
PiArI2lmZGVmIEZMT1dUQUJMRQo+ICsgoCCgIKAgcmVnaXN0ZXIgc3RydWN0IHJ0ZW50cnkgKnJ0
MDsKPiArI2VuZGlmCj4goCCgIKAgoHJlZ2lzdGVyIHN0cnVjdCByYWRpeF9ub2RlICpybjsKPiCg
IKAgoCCgcmVnaXN0ZXIgc3RydWN0IHJhZGl4X25vZGVfaGVhZCAqcm5oOwo+IKAgoCCgIKBzdHJ1
Y3QgaWZhZGRyICppZmE7Cj4gQEAgLTExNTMsNiArMTE1Nyw1MyBAQCBydHJlcXVlc3QxX2ZpYihp
bnQgcmVxLCBzdHJ1Y3QgcnRfYWRkcmluCj4goCCgIKAgoCCgIKAgoCCgfQo+IKAjZW5kaWYKPgo+
ICsjaWZkZWYgRkxPV1RBQkxFCj4gKyCgIKAgoCCgIKAgoCCgIHJ0MCA9IE5VTEw7Cj4gKyCgIKAg
oCCgIKAgoCCgIC8qIFhYWAo+ICsgoCCgIKAgoCCgIKAgoCCgKiAiZmxvdy10YWJsZSIgb25seSBz
dXBwb3J0IElQdjQgYXQgdGhlIG1vbWVudC4KPiArIKAgoCCgIKAgoCCgIKAgoCovCj4gKyCgIKAg
oCCgIKAgoCCgIGlmIChkc3QtPnNhX2ZhbWlseSA9PSBBRl9JTkVUKSB7Cj4gKyCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgcm4gPSBybmgtPnJuaF9tYXRjaGFkZHIoZHN0LCBybmgpOwo+ICsgoCCgIKAg
oCCgIKAgoCCgIKAgoCCgIGlmIChybiAmJiAoKHJuLT5ybl9mbGFncyAmIFJORl9ST09UKSA9PSAw
KSkgewo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgc3RydWN0IHNvY2thZGRyICpt
YXNrOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgdV9jaGFyICptLCAqbjsKPiAr
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIGludCBsZW47Cj4gKwo+ICsgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgLyoKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCg
IKAqIGNvbXBhcmUgbWFzayB0byBzZWUgaWYgdGhlIG5ldyByb3V0ZSBpcwo+ICsgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCogbW9yZSBzcGVjaWZpYyB0aGFuIHRoZSBleGlzdGluZyBv
bmUKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAqLwo+ICsgoCCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgoCCgIKAgcnQwID0gUk5UT1JUKHJuKTsKPiArIKAgoCCgIKAgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIFJUX0xPQ0socnQwKTsKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
oCCgIFJUX0FERFJFRihydDApOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgUlRf
VU5MT0NLKHJ0MCk7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAvKgo+ICsgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCogQSBob3N0IHJvdXRlIGlzIGFscmVhZHkgcHJl
c2VudCwgc28KPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAqIGxlYXZlIHRoZSBm
bG93LXRhYmxlIGVudHJpZXMgYXMgaXMuCj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
oCCgKi8KPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIGlmIChydDAtPnJ0X2ZsYWdz
ICYgUlRGX0hPU1QpIHsKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
UlRGUkVFKHJ0MCk7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIHJ0
MCA9IE5VTEw7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCB9IGVsc2UgaWYgKCEo
ZmxhZ3MgJiBSVEZfSE9TVCkgJiYgbmV0bWFzaykgewo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCBtYXNrID0gcnRfbWFzayhydDApOwo+ICsgoCCgIKAgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCBsZW4gPSBtYXNrLT5zYV9sZW47Cj4gKyCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIG0gPSAodV9jaGFyICopbWFzazsKPiArIKAgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgbiA9ICh1X2NoYXIgKiluZXRtYXNrOwo+
ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCB3aGlsZSAobGVuLS0gPiAw
KSB7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgaWYg
KCpuICE9ICptKQo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgYnJlYWs7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgbisrOwo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
oCCgIKAgoCCgIG0rKzsKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
fQo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCBpZiAobGVuID09IDAg
fHwgKCpuIDwgKm0pKSB7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCg
IKAgoCCgIKAgUlRGUkVFKHJ0MCk7Cj4gKyCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgIKAgcnQwID0gTlVMTDsKPiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgfQo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgfQo+ICsgoCCg
IKAgoCCgIKAgoCCgIKAgoCCgIH0KPiArIKAgoCCgIKAgoCCgIKAgfQo+ICsjZW5kaWYKPiArCj4g
oCCgIKAgoCCgIKAgoCCgLyogWFhYIG10dSBtYW5pcHVsYXRpb24gd2lsbCBiZSBkb25lIGluIHJu
aF9hZGRhZGRyIC0tIGl0b2p1biAqLwo+IKAgoCCgIKAgoCCgIKAgoHJuID0gcm5oLT5ybmhfYWRk
YWRkcihuZHN0LCBuZXRtYXNrLCBybmgsIHJ0LT5ydF9ub2Rlcyk7Cj4goCCgIKAgoCCgIKAgoCCg
LyoKPiBAQCAtMTE2NSw4ICsxMjE2LDE4IEBAIHJ0cmVxdWVzdDFfZmliKGludCByZXEsIHN0cnVj
dCBydF9hZGRyaW4KPiCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoEZyZWUocnRfa2V5KHJ0KSk7Cj4g
oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBSVF9MT0NLX0RFU1RST1kocnQpOwo+IKAgoCCgIKAgoCCg
IKAgoCCgIKAgoCCgdW1hX3pmcmVlKFZfcnR6b25lLCBydCk7Cj4gKyNpZmRlZiBGTE9XVEFCTEUK
PiArIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCBpZiAocnQwICE9IE5VTEwpCj4gKyCgIKAgoCCgIKAg
oCCgIKAgoCCgIKAgoCCgIKAgoCBSVEZSRUUocnQwKTsKPiArI2VuZGlmCj4goCCgIKAgoCCgIKAg
oCCgIKAgoCCgIKBzZW5kZXJyKEVFWElTVCk7Cj4gKyCgIKAgoCCgIKAgoCCgIH0KPiArI2lmZGVm
IEZMT1dUQUJMRQo+ICsgoCCgIKAgoCCgIKAgoCBlbHNlIGlmIChydDAgIT0gTlVMTCkgewo+ICsg
oCCgIKAgoCCgIKAgoCCgIKAgoCCgIGZsb3d0YWJsZV9yb3V0ZV9mbHVzaChWX2lwX2Z0LCBydDAp
Owo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIFJURlJFRShydDApOwo+IKAgoCCgIKAgoCCgIKAg
oH0KPiArI2VuZGlmCj4KPiCgIKAgoCCgIKAgoCCgIKAvKgo+IKAgoCCgIKAgoCCgIKAgoCAqIElm
IHRoaXMgcHJvdG9jb2wgaGFzIHNvbWV0aGluZyB0byBhZGQgdG8gdGhpcyB0aGVuCj4K

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 01:34:55 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA9D61065672;
	Fri,  2 Oct 2009 01:34:55 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CA8EB8FC13;
	Fri,  2 Oct 2009 01:34:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n921YtBC084993;
	Fri, 2 Oct 2009 01:34:55 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n921YtW8084991;
	Fri, 2 Oct 2009 01:34:55 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <200910020134.n921YtW8084991@svn.freebsd.org>
From: Qing Li 
Date: Fri, 2 Oct 2009 01:34: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: r197695 - 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: Fri, 02 Oct 2009 01:34:55 -0000

Author: qingli
Date: Fri Oct  2 01:34:55 2009
New Revision: 197695
URL: http://svn.freebsd.org/changeset/base/197695

Log:
  Previously, if an address alias is configured on an interface, and
  this address alias has a prefix matching that of another address
  configured on the same interface, then the ARP entry for the alias
  is not deleted from the ARP table when that address alias is removed.
  This patch fixes the aforementioned issue.
  
  PR:		kern/139113
  MFC after:	3 days

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==============================================================================
--- head/sys/netinet/in.c	Fri Oct  2 01:07:28 2009	(r197694)
+++ head/sys/netinet/in.c	Fri Oct  2 01:34:55 2009	(r197695)
@@ -1060,6 +1060,8 @@ in_scrubprefix(struct in_ifaddr *target)
 	    !(target->ia_ifp->if_flags & IFF_LOOPBACK)) {
 		error = ifa_del_loopback_route((struct ifaddr *)target,
 				       (struct sockaddr *)&target->ia_addr);
+		/* remove arp cache */
+		arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr);
 	}
 
 	if ((target->ia_flags & IFA_ROUTE) == 0) {
@@ -1082,8 +1084,6 @@ in_scrubprefix(struct in_ifaddr *target)
 		prefix = target->ia_addr.sin_addr;
 		mask = target->ia_sockmask.sin_addr;
 		prefix.s_addr &= mask.s_addr;
-		/* remove arp cache */
-		arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr);
 	}
 
 	IN_IFADDR_RLOCK();

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 01:45:11 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 98B801065679;
	Fri,  2 Oct 2009 01:45:11 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 887458FC1A;
	Fri,  2 Oct 2009 01:45:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n921jBkO085266;
	Fri, 2 Oct 2009 01:45:11 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n921jBwI085264;
	Fri, 2 Oct 2009 01:45:11 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <200910020145.n921jBwI085264@svn.freebsd.org>
From: Qing Li 
Date: Fri, 2 Oct 2009 01: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: r197696 - 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: Fri, 02 Oct 2009 01:45:11 -0000

Author: qingli
Date: Fri Oct  2 01:45:11 2009
New Revision: 197696
URL: http://svn.freebsd.org/changeset/base/197696

Log:
  Remove a log message from production code. This log message can be
  triggered by a misconfigured host that is sending out gratuious ARPs.
  This log message can also be triggered during a network renumbering
  event when multiple prefixes co-exist on a single network segment.
  
  MFC after:	immediately

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==============================================================================
--- head/sys/netinet/in.c	Fri Oct  2 01:34:55 2009	(r197695)
+++ head/sys/netinet/in.c	Fri Oct  2 01:45:11 2009	(r197696)
@@ -1327,8 +1327,10 @@ in_lltable_rtcheck(struct ifnet *ifp, co
 	/* XXX rtalloc1 should take a const param */
 	rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0);
 	if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || rt->rt_ifp != ifp) {
+#ifdef DIAGNOSTICS
 		log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n",
 		    inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr));
+#endif
 		if (rt != NULL)
 			RTFREE_LOCKED(rt);
 		return (EINVAL);

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 02:24:26 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 278931065692;
	Fri,  2 Oct 2009 02:24:26 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 166228FC0C;
	Fri,  2 Oct 2009 02:24:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n922OPpj086121;
	Fri, 2 Oct 2009 02:24:25 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n922OPcG086114;
	Fri, 2 Oct 2009 02:24:25 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200910020224.n922OPcG086114@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 2 Oct 2009 02:24: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: r197697 - in 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: Fri, 02 Oct 2009 02:24:26 -0000

Author: hrs
Date: Fri Oct  2 02:24:25 2009
New Revision: 197697
URL: http://svn.freebsd.org/changeset/base/197697

Log:
  - Add AF_IPX and AF_NATM to afexists().
  
  - Add afexists() check to address family specific rc.d scripts.  A
    script for an AF will be silently ignored if the kernel has no
    support for the AF.

Modified:
  head/etc/network.subr
  head/etc/rc.d/defaultroute
  head/etc/rc.d/faith
  head/etc/rc.d/ip6addrctl
  head/etc/rc.d/static_arp
  head/etc/rc.d/stf

Modified: head/etc/network.subr
==============================================================================
--- head/etc/network.subr	Fri Oct  2 01:45:11 2009	(r197696)
+++ head/etc/network.subr	Fri Oct  2 02:24:25 2009	(r197697)
@@ -356,6 +356,16 @@ afexists()
 	inet6)
 		${SYSCTL_N} net.inet6 > /dev/null 2>&1
 		;;
+	ipx)
+		${SYSCTL_N} net.ipx > /dev/null 2>&1
+		;;
+	atm)
+		if [ -x /sbin/atmconfig ]; then
+			/sbin/atmconfig diag list > /dev/null 2>&1
+		else
+			return 1
+		fi
+		;;
 	*)
 		err 1 "afexists(): Unsupported address family: $_af"
 		;;

Modified: head/etc/rc.d/defaultroute
==============================================================================
--- head/etc/rc.d/defaultroute	Fri Oct  2 01:45:11 2009	(r197696)
+++ head/etc/rc.d/defaultroute	Fri Oct  2 02:24:25 2009	(r197697)
@@ -20,6 +20,8 @@ defaultroute_start()
 {
 	local output carrier nocarrier nl
 
+	afexists inet || return 0
+
 	# Return without waiting if we don't have dhcp interfaces or
 	# if none of the dhcp interfaces is plugged in.
 	dhcp_interfaces=`list_net_interfaces dhcp`

Modified: head/etc/rc.d/faith
==============================================================================
--- head/etc/rc.d/faith	Fri Oct  2 01:45:11 2009	(r197696)
+++ head/etc/rc.d/faith	Fri Oct  2 02:24:25 2009	(r197697)
@@ -15,6 +15,8 @@ stop_cmd="faith_down"
 
 faith_up()
 {
+	afexists inet6 || return 0
+
 	case ${ipv6_faith_prefix} in
 	[Nn][Oo] | '')
 		;;
@@ -48,6 +50,8 @@ faith_up()
 
 faith_down()
 {
+	afexists inet6 || return 0
+
 	echo "Removing IPv6-to-IPv4 TCP relay capturing interface: faith0."
 	ifconfig faith0 destroy
 	${SYSCTL_W} net.inet6.ip6.keepfaith=0

Modified: head/etc/rc.d/ip6addrctl
==============================================================================
--- head/etc/rc.d/ip6addrctl	Fri Oct  2 01:45:11 2009	(r197696)
+++ head/etc/rc.d/ip6addrctl	Fri Oct  2 02:24:25 2009	(r197697)
@@ -9,6 +9,7 @@
 # KEYWORD: nojail
 
 . /etc/rc.subr
+. /etc/network.subr
 
 name="ip6addrctl"
 rcvar=`set_rcvar`
@@ -23,6 +24,8 @@ set_rcvar_obsolete ipv6_enable ipv6_pref
 
 ip6addrctl_prefer_ipv6()
 {
+	afexists inet6 || return 0
+
 	ip6addrctl flush >/dev/null 2>&1
 	ip6addrctl add ::1/128		50	0
 	ip6addrctl add ::/0		40	1
@@ -34,6 +37,8 @@ ip6addrctl_prefer_ipv6()
 
 ip6addrctl_prefer_ipv4()
 {
+	afexists inet6 || return 0
+
 	ip6addrctl flush >/dev/null 2>&1
 	ip6addrctl add ::ffff:0:0/96	50	0
 	ip6addrctl add ::1/128		40	1
@@ -45,30 +50,27 @@ ip6addrctl_prefer_ipv4()
 
 ip6addrctl_start()
 {
-	if ifconfig lo0 inet6 >/dev/null 2>&1; then
-		# We have IPv6 support in kernel.
+	afexists inet6 || return 0
 
-		# install the policy of the address selection algorithm.
-		if [ -f /etc/ip6addrctl.conf ]; then
-			ip6addrctl flush >/dev/null 2>&1
-			ip6addrctl install /etc/ip6addrctl.conf
-			checkyesno ip6addrctl_verbose && ip6addrctl
+	# install the policy of the address selection algorithm.
+	if [ -f /etc/ip6addrctl.conf ]; then
+		ip6addrctl flush >/dev/null 2>&1
+		ip6addrctl install /etc/ip6addrctl.conf
+		checkyesno ip6addrctl_verbose && ip6addrctl
+	else
+		if checkyesno ipv6_prefer; then
+			ip6addrctl_prefer_ipv6
 		else
-			if checkyesno ipv6_prefer; then
-				ip6addrctl_prefer_ipv6
-			else
-				ip6addrctl_prefer_ipv4
-			fi
+			ip6addrctl_prefer_ipv4
 		fi
 	fi
 }
 
 ip6addrctl_stop()
 {
-	if ifconfig lo0 inet6 >/dev/null 2>&1; then
-		# We have IPv6 support in kernel.
-		ip6addrctl flush >/dev/null 2>&1
-	fi
+	afexists inet6 || return 0
+
+	ip6addrctl flush >/dev/null 2>&1
 }
 
 load_rc_config $name

Modified: head/etc/rc.d/static_arp
==============================================================================
--- head/etc/rc.d/static_arp	Fri Oct  2 01:45:11 2009	(r197696)
+++ head/etc/rc.d/static_arp	Fri Oct  2 02:24:25 2009	(r197697)
@@ -34,6 +34,7 @@
 # KEYWORD: nojail
 
 . /etc/rc.subr
+. /etc/network.subr
 
 name="static_arp"
 start_cmd="static_arp_start"
@@ -43,6 +44,8 @@ static_arp_start()
 {
 	local e arp_args
 
+	afexists inet || return 0
+
 	if [ -n "${static_arp_pairs}" ]; then
 		echo -n 'Binding static ARP pair(s):'
 		for e in ${static_arp_pairs}; do
@@ -58,6 +61,8 @@ static_arp_stop()
 {
 	local e arp_args
 
+	afexists inet || return 0
+
 	if [ -n "${static_arp_pairs}" ]; then
 		echo -n 'Unbinding static ARP pair(s):'
 		for e in ${static_arp_pairs}; do

Modified: head/etc/rc.d/stf
==============================================================================
--- head/etc/rc.d/stf	Fri Oct  2 01:45:11 2009	(r197696)
+++ head/etc/rc.d/stf	Fri Oct  2 02:24:25 2009	(r197697)
@@ -15,6 +15,8 @@ stop_cmd="stf_down"
 
 stf_up()
 {
+	afexists inet6 || return 0
+
 	case ${stf_interface_ipv4addr} in
 	[Nn][Oo] | '')
 		;;
@@ -67,6 +69,8 @@ stf_up()
 
 stf_down()
 {
+	afexists inet6 || return 0
+
 	echo "Removing 6to4 tunnel interface: stf0." 
 	ifconfig stf0 destroy
 	route delete -inet6 2002:e000:: -prefixlen 20 ::1

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 02:27:49 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE9ED106566B;
	Fri,  2 Oct 2009 02:27:49 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C42B58FC15;
	Fri,  2 Oct 2009 02:27:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n922Rn8h086219;
	Fri, 2 Oct 2009 02:27:49 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n922RnBd086217;
	Fri, 2 Oct 2009 02:27:49 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200910020227.n922RnBd086217@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 2 Oct 2009 02:27: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: r197698 - 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: Fri, 02 Oct 2009 02:27:50 -0000

Author: hrs
Date: Fri Oct  2 02:27:49 2009
New Revision: 197698
URL: http://svn.freebsd.org/changeset/base/197698

Log:
  - Fix logic inversion bug of net.inet.tcp.rfc1323[*].
  
  - Split netoptions_start() to netoptions_AF() and add afexists() check
    for each address family.
  
  - Display a message only if the user sets a non-default value, and set
    a sysctl explicitly even if it is the default value.
  
  Spotted by:	Pegasus Mc Cleaft[*]

Modified:
  head/etc/rc.d/netoptions

Modified: head/etc/rc.d/netoptions
==============================================================================
--- head/etc/rc.d/netoptions	Fri Oct  2 02:24:25 2009	(r197697)
+++ head/etc/rc.d/netoptions	Fri Oct  2 02:27:49 2009	(r197698)
@@ -26,29 +26,48 @@ netoptions_init()
 
 netoptions_start()
 {
+	local _af
+
+	for _af in inet inet6; do
+		afexists ${_af} && eval netoptions_${_af}
+	done
+	[ -n "${_netoptions_initdone}" ] && echo '.'
+}
+
+netoptions_inet()
+{
 	if checkyesno log_in_vain; then
 		netoptions_init
 		echo -n " log_in_vain=${log_in_vain}"
-		${SYSCTL_W} net.inet.tcp.log_in_vain="${log_in_vain}" >/dev/null
-		${SYSCTL_W} net.inet.udp.log_in_vain="${log_in_vain}" >/dev/null
+		${SYSCTL_W} net.inet.tcp.log_in_vain=1 >/dev/null
+		${SYSCTL_W} net.inet.udp.log_in_vain=1 >/dev/null
+	else
+		${SYSCTL_W} net.inet.tcp.log_in_vain=0 >/dev/null
+		${SYSCTL_W} net.inet.udp.log_in_vain=0 >/dev/null
 	fi
 
 	if checkyesno tcp_extensions; then
+		${SYSCTL_W} net.inet.tcp.rfc1323=1 >/dev/null
+	else
 		netoptions_init
-		echo -n ' rfc1323 extensions=NO'
+		echo -n ' rfc1323 extensions=${tcp_extensions}'
 		${SYSCTL_W} net.inet.tcp.rfc1323=0 >/dev/null
 	fi
 
-	if ! checkyesno tcp_keepalive; then
+	if checkyesno tcp_keepalive; then
+		${SYSCTL_W} net.inet.tcp.always_keepalive=1 >/dev/null
+	else
 		netoptions_init
-		echo -n ' TCP keepalive=NO'
+		echo -n ' TCP keepalive=${tcp_keepalive}'
 		${SYSCTL_W} net.inet.tcp.always_keepalive=0 >/dev/null
 	fi
 
 	if checkyesno tcp_drop_synfin; then
 		netoptions_init
-		echo -n ' drop SYN+FIN packets=YES'
+		echo -n ' drop SYN+FIN packets=${tcp_drop_synfin}'
 		${SYSCTL_W} net.inet.tcp.drop_synfin=1 >/dev/null
+	else
+		${SYSCTL_W} net.inet.tcp.drop_synfin=0 >/dev/null
 	fi
 
 	case ${ip_portrange_first} in
@@ -66,17 +85,17 @@ netoptions_start()
 		${SYSCTL_W} net.inet.ip.portrange.last=$ip_portrange_last >/dev/null
 		;;
 	esac
+}
 
-	if afexists inet6; then
-		if checkyesno ipv6_ipv4mapping; then
-			${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
-		else
-			echo -n " no-ipv4-mapped-ipv6"
-			${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
-		fi
+netoptions_inet6()
+{
+	if checkyesno ipv6_ipv4mapping; then
+		netoptions_init
+		echo -n " ipv4-mapped-ipv6=${ipv6_ipv4mapping}"
+		${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
+	else
+		${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
 	fi
-
-	[ -n "${_netoptions_initdone}" ] && echo '.'
 }
 
 load_rc_config $name

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 02:28:59 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85121106568F;
	Fri,  2 Oct 2009 02:28:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 743338FC08;
	Fri,  2 Oct 2009 02:28:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n922SxrK086279;
	Fri, 2 Oct 2009 02:28:59 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n922SxFT086277;
	Fri, 2 Oct 2009 02:28:59 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200910020228.n922SxFT086277@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 2 Oct 2009 02:28: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: r197699 - 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: Fri, 02 Oct 2009 02:28:59 -0000

Author: hrs
Date: Fri Oct  2 02:28:59 2009
New Revision: 197699
URL: http://svn.freebsd.org/changeset/base/197699

Log:
  - Split routing_*() and option_*() to *_AF() and add afexists() check
    for each address family.  Replace AF_static() with static_AF() for
    consistency.
  
  - Display a message only if the user sets a non-default value, and set
    a sysctl explicitly even if it is the default value.

Modified:
  head/etc/rc.d/routing

Modified: head/etc/rc.d/routing
==============================================================================
--- head/etc/rc.d/routing	Fri Oct  2 02:27:49 2009	(r197698)
+++ head/etc/rc.d/routing	Fri Oct  2 02:28:59 2009	(r197699)
@@ -27,8 +27,24 @@ routing_start()
 
 routing_stop()
 {
+	local _af
+
 	static_stop "$@"
-	route -n flush
+	for _af in inet inet6; do
+		afexists ${_af} && eval routing_stop_${_af}
+	done
+}
+
+routing_stop_inet()
+{
+	route -n flush -inet
+}
+
+routing_stop_inet6()
+{
+	local i
+
+	route -n flush -inet6
 	for i in ${ipv6_network_interfaces}; do
 		ifconfig $i inet6 -defaultif
 	done
@@ -40,21 +56,11 @@ static_start()
 	_af=$1
 
 	case ${_af} in
-	inet)
-		do_static inet add
+	inet|inet6|atm)
+		do_static add ${_af}
 		;;
-	inet6)
-		do_static inet6 add
-		;;
-	atm)
-		do_static atm add
-		;;
-	*)
-		do_static inet add
-		if afexists inet6; then
-			do_static inet6 add
-		fi
-		do_static atm add
+	"")
+		do_static add inet inet6 atm
 		;;
 	esac
 }
@@ -65,21 +71,11 @@ static_stop()
 	_af=$1
 
 	case ${_af} in
-	inet)
-		do_static inet delete
-		;;
-	inet6)
-		do_static inet6 delete
+	inet|inet6|atm)
+		do_static delete ${_af}
 		;;
-	atm)
-		do_static atm delete
-		;;
-	*)
-		do_static inet delete
-		if afexists inet6; then
-			do_static inet6 delete
-		fi
-		do_static atm delete
+	"")
+		do_static delete inet inet6 atm
 		;;
 	esac
 }
@@ -87,13 +83,15 @@ static_stop()
 do_static()
 {
 	local _af _action
-	_af=$1
-	_action=$2
+	_action=$1
 
-	eval $1_static $2
+	shift
+	for _af in "$@"; do
+		afexists ${_af} && eval static_${_af} ${_action}
+	done
 }
 
-inet_static()
+static_inet()
 {
 	local _action
 	_action=$1
@@ -115,7 +113,7 @@ inet_static()
 	fi
 }
 
-inet6_static()
+static_inet6()
 {
 	local _action i
 	_action=$1
@@ -222,9 +220,9 @@ inet6_static()
 	esac
 }
 
-atm_static()
+static_atm()
 {
-	local _action i
+	local _action i route_args
 	_action=$1
 
 	if [ -n "${natm_static_routes}" ]; then
@@ -246,61 +244,93 @@ ropts_init()
 
 options_start()
 {
+	local _af
+
+	for _af in inet inet6 ipx; do
+		afexists ${_af} && eval options_${_af}
+	done
+	 [ -n "${_ropts_initdone}" ] && echo '.'
+}
+
+options_inet()
+{
 	if checkyesno icmp_bmcastecho; then
 		ropts_init
 		echo -n ' broadcast ping responses=YES'
-		sysctl net.inet.icmp.bmcastecho=1 >/dev/null
+		${SYSCTL_W} net.inet.icmp.bmcastecho=1 > /dev/null
+	else
+		${SYSCTL_W} net.inet.icmp.bmcastecho=0 > /dev/null
 	fi
 
 	if checkyesno icmp_drop_redirect; then
 		ropts_init
 		echo -n ' ignore ICMP redirect=YES'
-		sysctl net.inet.icmp.drop_redirect=1 >/dev/null
+		${SYSCTL_W} net.inet.icmp.drop_redirect=1 > /dev/null
+	else
+		${SYSCTL_W} net.inet.icmp.drop_redirect=0 > /dev/null
 	fi
 
 	if checkyesno icmp_log_redirect; then
 		ropts_init
 		echo -n ' log ICMP redirect=YES'
-		sysctl net.inet.icmp.log_redirect=1 >/dev/null
+		${SYSCTL_W} net.inet.icmp.log_redirect=1 > /dev/null
+	else
+		${SYSCTL_W} net.inet.icmp.log_redirect=0 > /dev/null
 	fi
 
 	if checkyesno gateway_enable; then
 		ropts_init
 		echo -n ' IPv4 gateway=YES'
-		sysctl net.inet.ip.forwarding=1 >/dev/null
-	fi
-
-	if checkyesno ipv6_gateway_enable; then
-		ropts_init
-		echo -n ' IPv6 gateway=YES'
-		sysctl net.inet6.ip6.forwarding=1 >/dev/null
+		${SYSCTL_W} net.inet.ip.forwarding=1 > /dev/null
+	else
+		${SYSCTL_W} net.inet.ip.forwarding=0 > /dev/null
 	fi
 
 	if checkyesno forward_sourceroute; then
 		ropts_init
 		echo -n ' do source routing=YES'
-		sysctl net.inet.ip.sourceroute=1 >/dev/null
+		${SYSCTL_W} net.inet.ip.sourceroute=1 > /dev/null
+	else
+		${SYSCTL_W} net.inet.ip.sourceroute=0 > /dev/null
 	fi
 
 	if checkyesno accept_sourceroute; then
 		ropts_init
 		echo -n ' accept source routing=YES'
-		sysctl net.inet.ip.accept_sourceroute=1 >/dev/null
+		${SYSCTL_W} net.inet.ip.accept_sourceroute=1 > /dev/null
+	else
+		${SYSCTL_W} net.inet.ip.accept_sourceroute=0 > /dev/null
 	fi
 
-	if checkyesno ipxgateway_enable; then
+	if checkyesno arpproxy_all; then
 		ropts_init
-		echo -n ' IPX gateway=YES'
-		sysctl net.ipx.ipx.ipxforwarding=1 >/dev/null
+		echo -n ' ARP proxyall=YES'
+		${SYSCTL_W} net.link.ether.inet.proxyall=1 > /dev/null
+	else
+		${SYSCTL_W} net.link.ether.inet.proxyall=0 > /dev/null
 	fi
+}
 
-	if checkyesno arpproxy_all; then
+options_inet6()
+{
+	if checkyesno ipv6_gateway_enable; then
 		ropts_init
-		echo -n ' ARP proxyall=YES'
-		sysctl net.link.ether.inet.proxyall=1 >/dev/null
+		echo -n ' IPv6 gateway=YES'
+		${SYSCTL_W} net.inet6.ip6.forwarding=1 > /dev/null
+	else
+		${SYSCTL_W} net.inet6.ip6.forwarding=0 > /dev/null
 	fi
+}
 
-	 [ -n "${_ropts_initdone}" ] && echo '.'
+options_ipx()
+{
+	if checkyesno ipxgateway_enable; then
+		ropts_init
+		echo -n ' IPX gateway=YES'
+		${SYSCTL_W} net.ipx.ipx.ipxforwarding=1 > /dev/null
+	else
+		${SYSCTL_W} net.ipx.ipx.ipxforwarding=0 > /dev/null
+	fi
 }
 
 load_rc_config $name

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 03:02:02 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F8E61065698;
	Fri,  2 Oct 2009 03:02:02 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from ebb.errno.com (ebb.errno.com [69.12.149.25])
	by mx1.freebsd.org (Postfix) with ESMTP id 27BF18FC16;
	Fri,  2 Oct 2009 03:02:01 +0000 (UTC)
Received: from Macintosh-4.local ([10.0.0.198]) (authenticated bits=0)
	by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n9231woZ027350
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 1 Oct 2009 20:01:58 -0700 (PDT) (envelope-from sam@freebsd.org)
Message-ID: <4AC56D26.4030500@freebsd.org>
Date: Thu, 01 Oct 2009 20:01:58 -0700
From: Sam Leffler 
Organization: FreeBSD Project
User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
MIME-Version: 1.0
To: Bruce Evans 
References: <200910010243.n912hpSM034846@svn.freebsd.org>
	<86eipno12p.fsf@ds4.des.no> <20091002002534.D21507@delplex.bde.org>
In-Reply-To: <20091002002534.D21507@delplex.bde.org>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-DCC-CTc-dcc1-Metrics: ebb.errno.com; whitelist
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r197654 - head/sys/dev/if_ndis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 03:02:02 -0000

Bruce Evans wrote:
> On Thu, 1 Oct 2009, [utf-8] Dag-Erling Smørgrav wrote:
> 
>> Coleman Kane  writes:
>>> -        if (sc->ndis_80211 && vap)
>>> +        if ((sc->ndis_80211 != NULL) && (vap != NULL))
>>
>> sc->ndis_80211 is an int.  NULL is a pointer.
> 
> Also, the number of style bugs was doubled on (almost?) every changed line
> by adding 2 sets of unnecessary parentheses.

FWIW I simply asked he compare ptr's against NULL.  The excessive
paren's hurt my eyes too :-)

	Sam

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 05:11:46 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA9111065676;
	Fri,  2 Oct 2009 05:11:46 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B6DB28FC18;
	Fri,  2 Oct 2009 05:11:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n925Bkkn090099;
	Fri, 2 Oct 2009 05:11:46 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n925BkKY090097;
	Fri, 2 Oct 2009 05:11:46 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <200910020511.n925BkKY090097@svn.freebsd.org>
From: Alan Cox 
Date: Fri, 2 Oct 2009 05:11: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: r197700 - in stable/8/sys: . amd64/amd64
	amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica
	contrib/pf dev/xen/xenpci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 05:11:46 -0000

Author: alc
Date: Fri Oct  2 05:11:46 2009
New Revision: 197700
URL: http://svn.freebsd.org/changeset/base/197700

Log:
  MFC r197580
    Temporarily disable the use of 1GB page mappings by the direct map.
  
  Approved by:	re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/amd64/pmap.c
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/8/sys/amd64/amd64/pmap.c	Fri Oct  2 02:28:59 2009	(r197699)
+++ stable/8/sys/amd64/amd64/pmap.c	Fri Oct  2 05:11:46 2009	(r197700)
@@ -440,7 +440,7 @@ create_pagetables(vm_paddr_t *firstaddr)
 	if (ndmpdp < 4)		/* Minimum 4GB of dirmap */
 		ndmpdp = 4;
 	DMPDPphys = allocpages(firstaddr, NDMPML4E);
-	if ((amd_feature & AMDID_PAGE1GB) == 0)
+	if (TRUE || (amd_feature & AMDID_PAGE1GB) == 0)
 		DMPDphys = allocpages(firstaddr, ndmpdp);
 	dmaplimit = (vm_paddr_t)ndmpdp << PDPSHIFT;
 
@@ -474,7 +474,7 @@ create_pagetables(vm_paddr_t *firstaddr)
 
 	/* Now set up the direct map space using either 2MB or 1GB pages */
 	/* Preset PG_M and PG_A because demotion expects it */
-	if ((amd_feature & AMDID_PAGE1GB) == 0) {
+	if (TRUE || (amd_feature & AMDID_PAGE1GB) == 0) {
 		for (i = 0; i < NPDEPG * ndmpdp; i++) {
 			((pd_entry_t *)DMPDphys)[i] = (vm_paddr_t)i << PDRSHIFT;
 			((pd_entry_t *)DMPDphys)[i] |= PG_RW | PG_V | PG_PS |

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 06:19:34 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C08451065672;
	Fri,  2 Oct 2009 06:19:34 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AF3988FC0C;
	Fri,  2 Oct 2009 06:19:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n926JYHc091505;
	Fri, 2 Oct 2009 06:19:34 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n926JYGK091501;
	Fri, 2 Oct 2009 06:19:34 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200910020619.n926JYGK091501@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 2 Oct 2009 06:19: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: r197701 - 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: Fri, 02 Oct 2009 06:19:34 -0000

Author: hrs
Date: Fri Oct  2 06:19:34 2009
New Revision: 197701
URL: http://svn.freebsd.org/changeset/base/197701

Log:
  Revert the previous afexists() change.  Knobs configured explicitly by
  the user should not be ignored if possible even if the kernel does not
  support the prerequisite feature.
  
  Discussed with:	ume

Modified:
  head/etc/rc.d/faith
  head/etc/rc.d/static_arp
  head/etc/rc.d/stf

Modified: head/etc/rc.d/faith
==============================================================================
--- head/etc/rc.d/faith	Fri Oct  2 05:11:46 2009	(r197700)
+++ head/etc/rc.d/faith	Fri Oct  2 06:19:34 2009	(r197701)
@@ -15,8 +15,6 @@ stop_cmd="faith_down"
 
 faith_up()
 {
-	afexists inet6 || return 0
-
 	case ${ipv6_faith_prefix} in
 	[Nn][Oo] | '')
 		;;
@@ -50,8 +48,6 @@ faith_up()
 
 faith_down()
 {
-	afexists inet6 || return 0
-
 	echo "Removing IPv6-to-IPv4 TCP relay capturing interface: faith0."
 	ifconfig faith0 destroy
 	${SYSCTL_W} net.inet6.ip6.keepfaith=0

Modified: head/etc/rc.d/static_arp
==============================================================================
--- head/etc/rc.d/static_arp	Fri Oct  2 05:11:46 2009	(r197700)
+++ head/etc/rc.d/static_arp	Fri Oct  2 06:19:34 2009	(r197701)
@@ -44,8 +44,6 @@ static_arp_start()
 {
 	local e arp_args
 
-	afexists inet || return 0
-
 	if [ -n "${static_arp_pairs}" ]; then
 		echo -n 'Binding static ARP pair(s):'
 		for e in ${static_arp_pairs}; do
@@ -61,8 +59,6 @@ static_arp_stop()
 {
 	local e arp_args
 
-	afexists inet || return 0
-
 	if [ -n "${static_arp_pairs}" ]; then
 		echo -n 'Unbinding static ARP pair(s):'
 		for e in ${static_arp_pairs}; do

Modified: head/etc/rc.d/stf
==============================================================================
--- head/etc/rc.d/stf	Fri Oct  2 05:11:46 2009	(r197700)
+++ head/etc/rc.d/stf	Fri Oct  2 06:19:34 2009	(r197701)
@@ -15,8 +15,6 @@ stop_cmd="stf_down"
 
 stf_up()
 {
-	afexists inet6 || return 0
-
 	case ${stf_interface_ipv4addr} in
 	[Nn][Oo] | '')
 		;;
@@ -69,8 +67,6 @@ stf_up()
 
 stf_down()
 {
-	afexists inet6 || return 0
-
 	echo "Removing 6to4 tunnel interface: stf0." 
 	ifconfig stf0 destroy
 	route delete -inet6 2002:e000:: -prefixlen 20 ::1

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 06:42:46 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04AD2106566B;
	Fri,  2 Oct 2009 06:42:46 +0000 (UTC)
	(envelope-from tom@tomjudge.com)
Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk
	[80.68.91.100])
	by mx1.freebsd.org (Postfix) with ESMTP id B79F88FC1E;
	Fri,  2 Oct 2009 06:42:45 +0000 (UTC)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 32D624899E;
	Fri,  2 Oct 2009 07:23:38 +0100 (BST)
X-Virus-Scanned: Debian amavisd-new at tomjudge.vm.bytemark.co.uk
Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1])
	by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id FJ3fFGAZpHUU; Fri,  2 Oct 2009 07:23:28 +0100 (BST)
Received: from rita.nodomain (unknown [192.168.205.6])
	by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 4C3BB48881;
	Fri,  2 Oct 2009 07:23:27 +0100 (BST)
Message-ID: <4AC59C42.1030903@tomjudge.com>
Date: Fri, 02 Oct 2009 06:22:58 +0000
From: Tom Judge 
User-Agent: Thunderbird 2.0.0.23 (X11/20090822)
MIME-Version: 1.0
To: Qing Li 
References: <200910012032.n91KWTOa064111@svn.freebsd.org>
In-Reply-To: <200910012032.n91KWTOa064111@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: r197687 - 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: Fri, 02 Oct 2009 06:42:46 -0000

Qing Li wrote:
> Author: qingli
> Date: Thu Oct  1 20:32:29 2009
> New Revision: 197687
> URL: http://svn.freebsd.org/changeset/base/197687
>
> Log:
>   The flow-table associates TCP/UDP flows and IP destinations with
>   specific routes. When the routing table changes, for example,
>   when a new route with a more specific prefix is inserted into the
>   routing table, the flow-table is not updated to reflect that change.
>   As such existing connections cannot take advantage of the new path.
>   In some cases the path is broken. This patch will update the affected
>   flow-table entries when a more specific route is added. The route
>   entry is properly marked when a route is deleted from the table.
>   In this case, when the flow-table performs a search, the stale
>   entry is updated automatically. Therefore this patch is not
>   necessary for route deletion.
>   
Hi,

Will this fix the issue that I see visualising  its self as packet loss 
over a VPN tunnel?

The tunnel is an openvpn (tun mode) tunnel providing a route to 
192.168.201.0/24 however when I ping an address in this network with 
flowtable enabled I see 2-3 out of every 5-6 packets end up being sent 
out of bge0 (IP 172.17.XX.XX/23 GW 172.17.XX.1) to the default gateway 
(which responds with destination host unreachable) rather than down tun0.

Thanks

Tom


From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 06:51:39 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8E4891065672;
	Fri,  2 Oct 2009 06:51:39 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7D30C8FC15;
	Fri,  2 Oct 2009 06:51:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n926pd63092244;
	Fri, 2 Oct 2009 06:51:39 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n926pdFA092242;
	Fri, 2 Oct 2009 06:51:39 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200910020651.n926pdFA092242@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 2 Oct 2009 06:51: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: r197702 - 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: Fri, 02 Oct 2009 06:51:39 -0000

Author: hrs
Date: Fri Oct  2 06:51:39 2009
New Revision: 197702
URL: http://svn.freebsd.org/changeset/base/197702

Log:
  The net.inet.tcp.log_in_vain accepts 0, 1 or 2, not Y/N.

Modified:
  head/etc/rc.d/netoptions

Modified: head/etc/rc.d/netoptions
==============================================================================
--- head/etc/rc.d/netoptions	Fri Oct  2 06:19:34 2009	(r197701)
+++ head/etc/rc.d/netoptions	Fri Oct  2 06:51:39 2009	(r197702)
@@ -36,15 +36,18 @@ netoptions_start()
 
 netoptions_inet()
 {
-	if checkyesno log_in_vain; then
+	case ${log_in_vain} in
+	[12])
 		netoptions_init
 		echo -n " log_in_vain=${log_in_vain}"
-		${SYSCTL_W} net.inet.tcp.log_in_vain=1 >/dev/null
-		${SYSCTL_W} net.inet.udp.log_in_vain=1 >/dev/null
-	else
+		${SYSCTL_W} net.inet.tcp.log_in_vain=${log_in_vain} >/dev/null
+		${SYSCTL_W} net.inet.udp.log_in_vain=${log_in_vain} >/dev/null
+		;;
+	*)
 		${SYSCTL_W} net.inet.tcp.log_in_vain=0 >/dev/null
 		${SYSCTL_W} net.inet.udp.log_in_vain=0 >/dev/null
-	fi
+		;;
+	esac
 
 	if checkyesno tcp_extensions; then
 		${SYSCTL_W} net.inet.tcp.rfc1323=1 >/dev/null

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 07:00:20 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 68705106566B;
	Fri,  2 Oct 2009 07:00:20 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 577CD8FC16;
	Fri,  2 Oct 2009 07:00:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9270Kfr092490;
	Fri, 2 Oct 2009 07:00:20 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9270KiU092488;
	Fri, 2 Oct 2009 07:00:20 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200910020700.n9270KiU092488@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 2 Oct 2009 07:00: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: r197703 - head/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, 02 Oct 2009 07:00:20 -0000

Author: hrs
Date: Fri Oct  2 07:00:20 2009
New Revision: 197703
URL: http://svn.freebsd.org/changeset/base/197703

Log:
  Enable adding a link-local address even if ND6_IFF_IFDISABLED.
  Note that when the interface has ND6_IFF_IFDISABLED, a newly-added
  address is always marked as IN6_IFF_TENTATIVE so that the interface
  can perform DAD after the ND6_IFF_IFDISABLED is cleared.

Modified:
  head/sys/netinet6/in6_ifattach.c

Modified: head/sys/netinet6/in6_ifattach.c
==============================================================================
--- head/sys/netinet6/in6_ifattach.c	Fri Oct  2 06:51:39 2009	(r197702)
+++ head/sys/netinet6/in6_ifattach.c	Fri Oct  2 07:00:20 2009	(r197703)
@@ -751,7 +751,6 @@ in6_ifattach(struct ifnet *ifp, struct i
 	 * assign a link-local address, if there's none.
 	 */
 	if (ifp->if_type != IFT_BRIDGE &&
-	    !(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
 	    ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) {
 		int error;
 

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 07:22:34 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3E60210656B3;
	Fri,  2 Oct 2009 07:22:34 +0000 (UTC)
	(envelope-from tomelite82@gmail.com)
Received: from mail-vw0-f171.google.com (mail-vw0-f171.google.com
	[209.85.212.171])
	by mx1.freebsd.org (Postfix) with ESMTP id B6F3A8FC08;
	Fri,  2 Oct 2009 07:22:33 +0000 (UTC)
Received: by vws1 with SMTP id 1so516624vws.27
	for ; Fri, 02 Oct 2009 00:22:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=Pr4uAL+pHWQM1N9eBjWOAr7hgK3pwH2hPXW4e6DoYzE=;
	b=XYF/7vvo3AZzal7J/nYIjJrL5EZXR8lH9+jKJFLB4bEUSYDTKAz1A49fckeDGq5NZb
	79RICwFIssrUlRT6zr5wEg3VT+4tH94KRrCgrP1RYUDTFzVHoy8Rq0NZHlGWdIXtFOSo
	4v/+YmpS12dKqL/CL4Z026u6qt9ic9jJnfjf8=
DomainKey-Signature: a=rsa-sha1; c=nofws; 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;
	b=DtrBvuhhh7+PRPCMIAcvElSMnCPjwkIbyDnXFJpth8e3AYMtc3KWCenMgQU9PW++my
	wXQQfle2aAYhhofR9UWIrIKO996IxGn+MIdx5lB8ef583QGCj/sK13YNp+0R+q2Dsw+h
	l6CyHxMURb+BF64QZCG7LMkaKgJdE91XHVUd8=
MIME-Version: 1.0
Sender: tomelite82@gmail.com
Received: by 10.220.108.219 with SMTP id g27mr4011117vcp.44.1254468152928; 
	Fri, 02 Oct 2009 00:22:32 -0700 (PDT)
In-Reply-To: <4AC59C42.1030903@tomjudge.com>
References: <200910012032.n91KWTOa064111@svn.freebsd.org>
	<4AC59C42.1030903@tomjudge.com>
Date: Fri, 2 Oct 2009 00:22:32 -0700
X-Google-Sender-Auth: 608c3dc0c3367e63
Message-ID: <9ace436c0910020022mfcc1e9y3dd81796537c2a06@mail.gmail.com>
From: Qing Li 
To: Tom Judge 
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: r197687 - 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: Fri, 02 Oct 2009 07:22:34 -0000

I believe this patch will fix your issue. In fact two other users of
openvpn reports
the exact same problem symptom. Please give it a try and let me know how
it works out for you.

-- Qing


On Thu, Oct 1, 2009 at 11:22 PM, Tom Judge  wrote:
> Qing Li wrote:
>>
>> Author: qingli
>> Date: Thu Oct =A01 20:32:29 2009
>> New Revision: 197687
>> URL: http://svn.freebsd.org/changeset/base/197687
>>
>> Log:
>> =A0The flow-table associates TCP/UDP flows and IP destinations with
>> =A0specific routes. When the routing table changes, for example,
>> =A0when a new route with a more specific prefix is inserted into the
>> =A0routing table, the flow-table is not updated to reflect that change.
>> =A0As such existing connections cannot take advantage of the new path.
>> =A0In some cases the path is broken. This patch will update the affected
>> =A0flow-table entries when a more specific route is added. The route
>> =A0entry is properly marked when a route is deleted from the table.
>> =A0In this case, when the flow-table performs a search, the stale
>> =A0entry is updated automatically. Therefore this patch is not
>> =A0necessary for route deletion.
>>
>
> Hi,
>
> Will this fix the issue that I see visualising =A0its self as packet loss=
 over
> a VPN tunnel?
>
> The tunnel is an openvpn (tun mode) tunnel providing a route to
> 192.168.201.0/24 however when I ping an address in this network with
> flowtable enabled I see 2-3 out of every 5-6 packets end up being sent ou=
t
> of bge0 (IP 172.17.XX.XX/23 GW 172.17.XX.1) to the default gateway (which
> responds with destination host unreachable) rather than down tun0.
>
> Thanks
>
> Tom
>
>

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 10:38:27 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 286891065672;
	Fri,  2 Oct 2009 10:38:27 +0000 (UTC)
	(envelope-from simon@benji.nitro.dk)
Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38])
	by mx1.freebsd.org (Postfix) with ESMTP id D8F158FC17;
	Fri,  2 Oct 2009 10:38:26 +0000 (UTC)
Received: from benji.nitro.dk (unknown [192.168.3.39])
	by mx.nitro.dk (Postfix) with ESMTP id 3EBCC2D48B8;
	Fri,  2 Oct 2009 10:38:25 +0000 (UTC)
Received: by benji.nitro.dk (Postfix, from userid 2000)
	id 12BF810A63; Fri,  2 Oct 2009 12:38:25 +0200 (CEST)
Date: Fri, 2 Oct 2009 12:38:24 +0200
From: "Simon L. Nielsen" 
To: Tom Judge 
Message-ID: <20091002103824.GA1653@zaphod.nitro.dk>
References: <200910012032.n91KWTOa064111@svn.freebsd.org>
	<4AC59C42.1030903@tomjudge.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4AC59C42.1030903@tomjudge.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, Qing Li ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r197687 - 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: Fri, 02 Oct 2009 10:38:27 -0000

On 2009.10.02 06:22:58 +0000, Tom Judge wrote:
> Qing Li wrote:
> > Author: qingli
> > Date: Thu Oct  1 20:32:29 2009
> > New Revision: 197687
> > URL: http://svn.freebsd.org/changeset/base/197687
> >
> > Log:
> >   The flow-table associates TCP/UDP flows and IP destinations with
> >   specific routes. When the routing table changes, for example,
> >   when a new route with a more specific prefix is inserted into the
> >   routing table, the flow-table is not updated to reflect that change.
> >   As such existing connections cannot take advantage of the new path.
> >   In some cases the path is broken. This patch will update the affected
> >   flow-table entries when a more specific route is added. The route
> >   entry is properly marked when a route is deleted from the table.
> >   In this case, when the flow-table performs a search, the stale
> >   entry is updated automatically. Therefore this patch is not
> >   necessary for route deletion.
>
> Hi,
> 
> Will this fix the issue that I see visualising  its self as packet loss 
> over a VPN tunnel?
> 
> The tunnel is an openvpn (tun mode) tunnel providing a route to 
> 192.168.201.0/24 however when I ping an address in this network with 
> flowtable enabled I see 2-3 out of every 5-6 packets end up being sent 
> out of bge0 (IP 172.17.XX.XX/23 GW 172.17.XX.1) to the default gateway 
> (which responds with destination host unreachable) rather than down tun0.

This sounds very similar to the problem I was seeing (also with
OpenVPN), which was fixed by qingli's patch.

The packet is most likely actually not lost, but routed to your
default gateway instead (or whatever it would be sent before the VPN
was created).

-- 
Simon L. Nielsen

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 11:10:06 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5A4671065670;
	Fri,  2 Oct 2009 11:10:06 +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 301568FC0A;
	Fri,  2 Oct 2009 11:10:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92BA5nn099183;
	Fri, 2 Oct 2009 11:10:05 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92BA5fu099181;
	Fri, 2 Oct 2009 11:10:05 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910021110.n92BA5fu099181@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 2 Oct 2009 11:10: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: r197704 - in head/sys/arm: arm xscale
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 11:10:06 -0000

Author: rpaulo
Date: Fri Oct  2 11:10:05 2009
New Revision: 197704
URL: http://svn.freebsd.org/changeset/base/197704

Log:
  Remove performance counter headers. This code came from NetBSD, but our
  hardware perf. counter support is different, so we don't need these
  files.
  
  Reviewed by:	freebsd-arm (no comments)

Deleted:
  head/sys/arm/xscale/xscalereg.h
  head/sys/arm/xscale/xscalevar.h
Modified:
  head/sys/arm/arm/cpufunc.c

Modified: head/sys/arm/arm/cpufunc.c
==============================================================================
--- head/sys/arm/arm/cpufunc.c	Fri Oct  2 07:00:20 2009	(r197703)
+++ head/sys/arm/arm/cpufunc.c	Fri Oct  2 11:10:05 2009	(r197704)
@@ -83,15 +83,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
-#if defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \
-    defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342)
-#include 
-#endif
-
-#if defined(PERFCTRS)
-struct arm_pmc_funcs *arm_pmc;
-#endif
-
 /* PRIMARY CACHE VARIABLES */
 int	arm_picache_size;
 int	arm_picache_line_size;
@@ -1128,10 +1119,6 @@ set_cpufuncs()
 			: "r" (BCUCTL_E0|BCUCTL_E1|BCUCTL_EV));
 
 		cpufuncs = xscale_cpufuncs;
-#if defined(PERFCTRS)
-		xscale_pmu_init();
-#endif
-
 		/*
 		 * i80200 errata: Step-A0 and A1 have a bug where
 		 * D$ dirty bits are not cleared on "invalidate by
@@ -1165,10 +1152,6 @@ set_cpufuncs()
 			       PMNC_CC_IF));
 
 		cpufuncs = xscale_cpufuncs;
-#if defined(PERFCTRS)
-		xscale_pmu_init();
-#endif
-
 		cpu_reset_needs_v4_MMU_disable = 1;	/* XScale needs it */
 		get_cachetype_cp15();
 		pmap_pte_init_xscale();
@@ -1179,10 +1162,6 @@ set_cpufuncs()
 #if defined(CPU_XSCALE_81342)
 	if (cputype == CPU_ID_81342) {
 		cpufuncs = xscalec3_cpufuncs;
-#if defined(PERFCTRS)
-		xscale_pmu_init();
-#endif
-
 		cpu_reset_needs_v4_MMU_disable = 1;	/* XScale needs it */
 		get_cachetype_cp15();
 		pmap_pte_init_xscale();
@@ -1196,10 +1175,6 @@ set_cpufuncs()
 	    (cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA210) {
 
 		cpufuncs = xscale_cpufuncs;
-#if defined(PERFCTRS)
-		xscale_pmu_init();
-#endif
-
 		cpu_reset_needs_v4_MMU_disable = 1;	/* XScale needs it */
 		get_cachetype_cp15();
 		pmap_pte_init_xscale();
@@ -1215,10 +1190,6 @@ set_cpufuncs()
             cputype == CPU_ID_IXP425_266 || cputype == CPU_ID_IXP435) {
 
 		cpufuncs = xscale_cpufuncs;
-#if defined(PERFCTRS)
-		xscale_pmu_init();
-#endif
-
 		cpu_reset_needs_v4_MMU_disable = 1;	/* XScale needs it */
 		get_cachetype_cp15();
 		pmap_pte_init_xscale();

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 11:14:12 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 68ABA1065679;
	Fri,  2 Oct 2009 11:14:12 +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 589CE8FC19;
	Fri,  2 Oct 2009 11:14:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92BECR9099346;
	Fri, 2 Oct 2009 11:14:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92BECKI099344;
	Fri, 2 Oct 2009 11:14:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910021114.n92BECKI099344@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 2 Oct 2009 11:14: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: r197706 - 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: Fri, 02 Oct 2009 11:14:12 -0000

Author: rpaulo
Date: Fri Oct  2 11:14:12 2009
New Revision: 197706
URL: http://svn.freebsd.org/changeset/base/197706

Log:
  Reserve numbers for XScale.
  
  Reviewed by:	jkoshy

Modified:
  head/sys/sys/pmc.h

Modified: head/sys/sys/pmc.h
==============================================================================
--- head/sys/sys/pmc.h	Fri Oct  2 11:10:51 2009	(r197705)
+++ head/sys/sys/pmc.h	Fri Oct  2 11:14:12 2009	(r197706)
@@ -84,7 +84,8 @@
 	__PMC_CPU(INTEL_CORE2,	0x88,	"Intel Core2")		\
 	__PMC_CPU(INTEL_CORE2EXTREME,	0x89,	"Intel Core2 Extreme")	\
 	__PMC_CPU(INTEL_ATOM,	0x8A,	"Intel Atom") \
-	__PMC_CPU(INTEL_COREI7, 0x8B,   "Intel Core i7")
+	__PMC_CPU(INTEL_COREI7, 0x8B,   "Intel Core i7")	\
+	__PMC_CPU(INTEL_XSCALE,	0x100,	"Intel XScale")
 
 enum pmc_cputype {
 #undef	__PMC_CPU
@@ -93,7 +94,7 @@ enum pmc_cputype {
 };
 
 #define	PMC_CPU_FIRST	PMC_CPU_AMD_K7
-#define	PMC_CPU_LAST	PMC_CPU_INTEL_COREI7
+#define	PMC_CPU_LAST	PMC_CPU_INTEL_XSCALE
 
 /*
  * Classes of PMCs
@@ -107,7 +108,8 @@ enum pmc_cputype {
 	__PMC_CLASS(P6)		/* Intel Pentium Pro counters */	\
 	__PMC_CLASS(P4)		/* Intel Pentium-IV counters */		\
 	__PMC_CLASS(IAF)	/* Intel Core2/Atom, fixed function */	\
-	__PMC_CLASS(IAP)	/* Intel Core...Atom, programmable */
+	__PMC_CLASS(IAP)	/* Intel Core...Atom, programmable */	\
+	__PMC_CLASS(XSCALE)	/* Intel XScale counters */
 
 enum pmc_class {
 #undef  __PMC_CLASS
@@ -116,7 +118,7 @@ enum pmc_class {
 };
 
 #define	PMC_CLASS_FIRST	PMC_CLASS_TSC
-#define	PMC_CLASS_LAST	PMC_CLASS_IAP
+#define	PMC_CLASS_LAST	PMC_CLASS_XSCALE
 
 /*
  * A PMC can be in the following states:

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 12:47:01 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A1A651065676;
	Fri,  2 Oct 2009 12:47:01 +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 907848FC12;
	Fri,  2 Oct 2009 12:47:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92Cl1Uh001995;
	Fri, 2 Oct 2009 12:47:01 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92Cl1tb001993;
	Fri, 2 Oct 2009 12:47:01 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200910021247.n92Cl1tb001993@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Fri, 2 Oct 2009 12:47: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: r197709 - head/sys/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: Fri, 02 Oct 2009 12:47:01 -0000

Author: nyan
Date: Fri Oct  2 12:47:01 2009
New Revision: 197709
URL: http://svn.freebsd.org/changeset/base/197709

Log:
  Fix build nfscl and/or nfsd.
  
  MFC after:	3 days

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Fri Oct  2 11:46:01 2009	(r197708)
+++ head/sys/conf/files	Fri Oct  2 12:47:01 2009	(r197709)
@@ -2668,12 +2668,12 @@ vm/vm_reserv.c			standard
 vm/vm_unix.c			standard
 vm/vm_zeroidle.c		standard
 vm/vnode_pager.c		standard
-xdr/xdr.c			optional krpc | nfslockd | nfsclient | nfsserver
-xdr/xdr_array.c			optional krpc | nfslockd | nfsclient | nfsserver
-xdr/xdr_mbuf.c			optional krpc | nfslockd | nfsclient | nfsserver
-xdr/xdr_mem.c			optional krpc | nfslockd | nfsclient | nfsserver
-xdr/xdr_reference.c		optional krpc | nfslockd | nfsclient | nfsserver
-xdr/xdr_sizeof.c		optional krpc | nfslockd | nfsclient | nfsserver
+xdr/xdr.c			optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
+xdr/xdr_array.c			optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
+xdr/xdr_mbuf.c			optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
+xdr/xdr_mem.c			optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
+xdr/xdr_reference.c		optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
+xdr/xdr_sizeof.c		optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
 #
 gnu/fs/xfs/xfs_alloc.c		optional xfs \
 	compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 17:39:24 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A26311065692;
	Fri,  2 Oct 2009 17:39:24 +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 9111F8FC1C;
	Fri,  2 Oct 2009 17:39:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92HdOgf008246;
	Fri, 2 Oct 2009 17:39:24 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92HdOPG008245;
	Fri, 2 Oct 2009 17:39:24 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200910021739.n92HdOPG008245@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 2 Oct 2009 17:39:24 +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: r197710 - 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: Fri, 02 Oct 2009 17:39:24 -0000

Author: trasz
Date: Fri Oct  2 17:39:23 2009
New Revision: 197710
URL: http://svn.freebsd.org/changeset/base/197710

Log:
  Welcome Jaakko Heinonen (jh@) as a src committer.  Jaakko will start
  with bugbusting, mostly in kern and bin categories.  I'll be his mentor,
  with Robert Watson (rwatson@) as co-mentor.
  
  Approved by:	core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==============================================================================
--- svnadmin/conf/access	Fri Oct  2 12:47:01 2009	(r197709)
+++ svnadmin/conf/access	Fri Oct  2 17:39:23 2009	(r197710)
@@ -100,6 +100,7 @@ jasone
 jb
 jeff
 jfv
+jh
 jhay
 jhb
 jilles

Modified: svnadmin/conf/mentors
==============================================================================
--- svnadmin/conf/mentors	Fri Oct  2 12:47:01 2009	(r197709)
+++ svnadmin/conf/mentors	Fri Oct  2 17:39:23 2009	(r197710)
@@ -15,6 +15,7 @@ dchagin		kib
 eri		mlaier		Co-mentor: thompsa
 fabient		jkoshy
 ivoras		gnn
+jh		trasz		Co-mentor: rwatson
 jinmei		gnn
 lstewart	gnn
 neel		imp

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 17:48:52 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3C3A61065670;
	Fri,  2 Oct 2009 17:48:52 +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 200998FC12;
	Fri,  2 Oct 2009 17:48:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92HmqNa008491;
	Fri, 2 Oct 2009 17:48:52 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92Hmprd008488;
	Fri, 2 Oct 2009 17:48:51 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200910021748.n92Hmprd008488@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 2 Oct 2009 17:48:51 +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: r197711 - 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, 02 Oct 2009 17:48:52 -0000

Author: bz
Date: Fri Oct  2 17:48:51 2009
New Revision: 197711
URL: http://svn.freebsd.org/changeset/base/197711

Log:
  Add a mitigation feature that will prevent user mappings at
  virtual address 0, limiting the ability to convert a kernel
  NULL pointer dereference into a privilege escalation attack.
  
  If the sysctl is set to 0 a newly started process will not be able
  to map anything in the address range of the first page (0 to PAGE_SIZE).
  This is the default. Already running processes are not affected by this.
  
  You can either change the sysctl or the tunable from loader in case
  you need to map at a virtual address of 0, for example when running
  any of the extinct species of a set of a.out binaries, vm86 emulation, ..
  In that case set security.bsd.map_at_zero="1".
  
  Superseeds:		r197537
  In collaboration with:	jhb, kib, alc

Modified:
  head/sys/kern/init_main.c
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/init_main.c
==============================================================================
--- head/sys/kern/init_main.c	Fri Oct  2 17:39:23 2009	(r197710)
+++ head/sys/kern/init_main.c	Fri Oct  2 17:48:51 2009	(r197711)
@@ -505,6 +505,11 @@ proc0_init(void *dummy __unused)
 	pmap_pinit0(vmspace_pmap(&vmspace0));
 	p->p_vmspace = &vmspace0;
 	vmspace0.vm_refcnt = 1;
+
+	/*
+	 * proc0 is not expected to enter usermode, so there is no special
+	 * handling for sv_minuser here, like is done for exec_new_vmspace().
+	 */
 	vm_map_init(&vmspace0.vm_map, p->p_sysent->sv_minuser,
 	    p->p_sysent->sv_maxuser);
 	vmspace0.vm_map.pmap = vmspace_pmap(&vmspace0);

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Fri Oct  2 17:39:23 2009	(r197710)
+++ head/sys/kern/kern_exec.c	Fri Oct  2 17:48:51 2009	(r197711)
@@ -122,6 +122,11 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
     &ps_arg_cache_limit, 0, "");
 
+static int map_at_zero = 0;
+TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
+SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
+    "Permit processes to map an object at virtual address 0.");
+
 static int
 sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS)
 {
@@ -999,7 +1004,7 @@ exec_new_vmspace(imgp, sv)
 	int error;
 	struct proc *p = imgp->proc;
 	struct vmspace *vmspace = p->p_vmspace;
-	vm_offset_t stack_addr;
+	vm_offset_t sv_minuser, stack_addr;
 	vm_map_t map;
 	u_long ssiz;
 
@@ -1015,13 +1020,17 @@ exec_new_vmspace(imgp, sv)
 	 * not disrupted
 	 */
 	map = &vmspace->vm_map;
-	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv->sv_minuser &&
+	if (map_at_zero)
+		sv_minuser = sv->sv_minuser;
+	else
+		sv_minuser = MAX(sv->sv_minuser, PAGE_SIZE);
+	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv_minuser &&
 	    vm_map_max(map) == sv->sv_maxuser) {
 		shmexit(vmspace);
 		pmap_remove_pages(vmspace_pmap(vmspace));
 		vm_map_remove(map, vm_map_min(map), vm_map_max(map));
 	} else {
-		error = vmspace_exec(p, sv->sv_minuser, sv->sv_maxuser);
+		error = vmspace_exec(p, sv_minuser, sv->sv_maxuser);
 		if (error)
 			return (error);
 		vmspace = p->p_vmspace;

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 17:51:47 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 284EF1065670;
	Fri,  2 Oct 2009 17:51:47 +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 1797C8FC1E;
	Fri,  2 Oct 2009 17:51:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92HpkXp008600;
	Fri, 2 Oct 2009 17:51:46 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92Hpkrk008597;
	Fri, 2 Oct 2009 17:51:46 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200910021751.n92Hpkrk008597@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 2 Oct 2009 17:51: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: r197712 - 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: Fri, 02 Oct 2009 17:51:47 -0000

Author: bz
Date: Fri Oct  2 17:51:46 2009
New Revision: 197712
URL: http://svn.freebsd.org/changeset/base/197712

Log:
  Back out the functional parts from r197537.  After r197711, affecting all
  user mappings, mmap no longer needs special treatment.

Modified:
  head/sys/vm/vm_mmap.c

Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c	Fri Oct  2 17:48:51 2009	(r197711)
+++ head/sys/vm/vm_mmap.c	Fri Oct  2 17:51:46 2009	(r197712)
@@ -97,14 +97,6 @@ SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap,
     "Maximum number of memory-mapped files per process");
 
 /*
- * 'mmap_zero' determines whether or not MAP_FIXED mmap() requests for
- * virtual address zero are permitted.
- */
-static int mmap_zero;
-SYSCTL_INT(_security_bsd, OID_AUTO, mmap_zero, CTLFLAG_RW, &mmap_zero, 0,
-    "Processes may map an object at virtual address zero");
-
-/*
  * Set the maximum number of vm_map_entry structures per process.  Roughly
  * speaking vm_map_entry structures are tiny, so allowing them to eat 1/100
  * of our KVM malloc space still results in generous limits.  We want a
@@ -277,13 +269,6 @@ mmap(td, uap)
 		if (addr & PAGE_MASK)
 			return (EINVAL);
 
-		/*
-		 * Mapping to address zero is only permitted if
-		 * mmap_zero is enabled.
-		 */
-		if (addr == 0 && !mmap_zero)
-			return (EINVAL);
-
 		/* Address range must be all in user VM space. */
 		if (addr < vm_map_min(&vms->vm_map) ||
 		    addr + size > vm_map_max(&vms->vm_map))

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 17:53:49 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6EFB51065670;
	Fri,  2 Oct 2009 17:53: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 43F798FC13;
	Fri,  2 Oct 2009 17:53:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92Hrm6Q008680;
	Fri, 2 Oct 2009 17:53:48 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92HrmUK008678;
	Fri, 2 Oct 2009 17:53:48 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200910021753.n92HrmUK008678@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 2 Oct 2009 17:53: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: r197713 - head/tools/regression/mmap
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 17:53:49 -0000

Author: bz
Date: Fri Oct  2 17:53:48 2009
New Revision: 197713
URL: http://svn.freebsd.org/changeset/base/197713

Log:
  Replace the name of the sysctl to security.bsd.map_at_zero and to be
  consistent updated the name of the variable as well, after the change
  in r197711.

Modified:
  head/tools/regression/mmap/mmap.c

Modified: head/tools/regression/mmap/mmap.c
==============================================================================
--- head/tools/regression/mmap/mmap.c	Fri Oct  2 17:51:46 2009	(r197712)
+++ head/tools/regression/mmap/mmap.c	Fri Oct  2 17:53:48 2009	(r197713)
@@ -36,7 +36,7 @@
 
 const struct tests {
 	void	*addr;
-	int	ok[2];	/* Depending on security.bsd.mmap_zero {0, !=0}. */
+	int	ok[2];	/* Depending on security.bsd.map_at_zero {0, !=0}. */
 } tests[] = {
 	{ (void *)0,			{ 0, 1 } }, /* Test sysctl. */
 	{ (void *)1,			{ 0, 0 } },
@@ -54,37 +54,37 @@ main(void)
 {
 	void *p;
 	size_t len;
-	int i, error, mib[3], mmap_zero;
+	int i, error, mib[3], map_at_zero;
 
 	error = 0;
 
-	/* Get the current sysctl value of security.bsd.mmap_zero. */
+	/* Get the current sysctl value of security.bsd.map_at_zero. */
 	len = sizeof(mib) / sizeof(*mib);
-	if (sysctlnametomib("security.bsd.mmap_zero", mib, &len) == -1)
-		err(1, "sysctlnametomib(security.bsd.mmap_zero)");
+	if (sysctlnametomib("security.bsd.map_at_zero", mib, &len) == -1)
+		err(1, "sysctlnametomib(security.bsd.map_at_zero)");
 
-	len = sizeof(mmap_zero);
-	if (sysctl(mib, 3, &mmap_zero, &len, NULL, 0) == -1)
-		err(1, "sysctl(security.bsd.mmap_zero)");
+	len = sizeof(map_at_zero);
+	if (sysctl(mib, 3, &map_at_zero, &len, NULL, 0) == -1)
+		err(1, "sysctl(security.bsd.map_at_zero)");
 
 	/* Normalize to 0 or 1 for array access. */
-	mmap_zero = !!mmap_zero;
+	map_at_zero = !!map_at_zero;
 
 	for (i=0; i < (sizeof(tests) / sizeof(*tests)); i++) {
 		p = mmap((void *)tests[i].addr, PAGE_SIZE,
 		    PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_FIXED,
 		    -1, 0);
 		if (p == MAP_FAILED) {
-			if (tests[i].ok[mmap_zero] != 0)
+			if (tests[i].ok[map_at_zero] != 0)
 				error++;
 			warnx("%s: mmap(%p, ...) failed.",
-			    (tests[i].ok[mmap_zero] == 0) ? "OK " : "ERR",
+			    (tests[i].ok[map_at_zero] == 0) ? "OK " : "ERR",
 			     tests[i].addr);
 		} else {
-			if (tests[i].ok[mmap_zero] != 1)
+			if (tests[i].ok[map_at_zero] != 1)
 				error++;
 			warnx("%s: mmap(%p, ...) succeeded: p=%p",
-			    (tests[i].ok[mmap_zero] == 1) ? "OK " : "ERR",
+			    (tests[i].ok[map_at_zero] == 1) ? "OK " : "ERR",
 			    tests[i].addr, p);
 		}
 	}

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 17:58:49 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1DFF31065672;
	Fri,  2 Oct 2009 17:58:49 +0000 (UTC)
	(envelope-from simon@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A7668FC14;
	Fri,  2 Oct 2009 17:58:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92HwmHm008817;
	Fri, 2 Oct 2009 17:58:48 GMT (envelope-from simon@svn.freebsd.org)
Received: (from simon@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92HwmjA008816;
	Fri, 2 Oct 2009 17:58:48 GMT (envelope-from simon@svn.freebsd.org)
Message-Id: <200910021758.n92HwmjA008816@svn.freebsd.org>
From: "Simon L. Nielsen" 
Date: Fri, 2 Oct 2009 17:58: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: r197714 - in stable/8/sys: . amd64/include/xen
	cddl/contrib/opensolaris contrib/dev/acpica contrib/pf
	dev/xen/xenpci 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, 02 Oct 2009 17:58:49 -0000

Author: simon
Date: Fri Oct  2 17:58:47 2009
New Revision: 197714
URL: http://svn.freebsd.org/changeset/base/197714

Log:
  MFC r197711:
  
  Add no zero mapping feature.
  
  NOTE: Unlike in the other branches where this change will be "merged"
  to, the 'no zero mapping' is enabled by default in stable/8.
  
  Errata:		FreeBSD-EN-09:05.null
  Approved by:	re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/kern/init_main.c
  stable/8/sys/kern/kern_exec.c

Modified: stable/8/sys/kern/init_main.c
==============================================================================
--- stable/8/sys/kern/init_main.c	Fri Oct  2 17:53:48 2009	(r197713)
+++ stable/8/sys/kern/init_main.c	Fri Oct  2 17:58:47 2009	(r197714)
@@ -492,6 +492,11 @@ proc0_init(void *dummy __unused)
 	pmap_pinit0(vmspace_pmap(&vmspace0));
 	p->p_vmspace = &vmspace0;
 	vmspace0.vm_refcnt = 1;
+
+	/*
+	 * proc0 is not expected to enter usermode, so there is no special
+	 * handling for sv_minuser here, like is done for exec_new_vmspace().
+	 */
 	vm_map_init(&vmspace0.vm_map, p->p_sysent->sv_minuser,
 	    p->p_sysent->sv_maxuser);
 	vmspace0.vm_map.pmap = vmspace_pmap(&vmspace0);

Modified: stable/8/sys/kern/kern_exec.c
==============================================================================
--- stable/8/sys/kern/kern_exec.c	Fri Oct  2 17:53:48 2009	(r197713)
+++ stable/8/sys/kern/kern_exec.c	Fri Oct  2 17:58:47 2009	(r197714)
@@ -122,6 +122,11 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
     &ps_arg_cache_limit, 0, "");
 
+static int map_at_zero = 0;
+TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
+SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
+    "Permit processes to map an object at virtual address 0.");
+
 static int
 sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS)
 {
@@ -999,7 +1004,7 @@ exec_new_vmspace(imgp, sv)
 	int error;
 	struct proc *p = imgp->proc;
 	struct vmspace *vmspace = p->p_vmspace;
-	vm_offset_t stack_addr;
+	vm_offset_t sv_minuser, stack_addr;
 	vm_map_t map;
 	u_long ssiz;
 
@@ -1015,13 +1020,17 @@ exec_new_vmspace(imgp, sv)
 	 * not disrupted
 	 */
 	map = &vmspace->vm_map;
-	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv->sv_minuser &&
+	if (map_at_zero)
+		sv_minuser = sv->sv_minuser;
+	else
+		sv_minuser = MAX(sv->sv_minuser, PAGE_SIZE);
+	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv_minuser &&
 	    vm_map_max(map) == sv->sv_maxuser) {
 		shmexit(vmspace);
 		pmap_remove_pages(vmspace_pmap(vmspace));
 		vm_map_remove(map, vm_map_min(map), vm_map_max(map));
 	} else {
-		error = vmspace_exec(p, sv->sv_minuser, sv->sv_maxuser);
+		error = vmspace_exec(p, sv_minuser, sv->sv_maxuser);
 		if (error)
 			return (error);
 		vmspace = p->p_vmspace;

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 18:09:57 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 38F821065670;
	Fri,  2 Oct 2009 18:09:57 +0000 (UTC)
	(envelope-from simon@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 23F248FC12;
	Fri,  2 Oct 2009 18:09:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92I9u83009086;
	Fri, 2 Oct 2009 18:09:56 GMT (envelope-from simon@svn.freebsd.org)
Received: (from simon@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92I9u1r009085;
	Fri, 2 Oct 2009 18:09:56 GMT (envelope-from simon@svn.freebsd.org)
Message-Id: <200910021809.n92I9u1r009085@svn.freebsd.org>
From: "Simon L. Nielsen" 
Date: Fri, 2 Oct 2009 18:09:56 +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: r197715 - releng/6.3 releng/6.3/sys/conf
	releng/6.3/sys/fs/devfs releng/6.3/sys/kern
	releng/6.3/sys/sys releng/6.4 releng/6.4/sys/conf
	releng/6.4/sys/fs/devfs releng/6.4/sys/kern releng...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 18:09:57 -0000

Author: simon
Date: Fri Oct  2 18:09:56 2009
New Revision: 197715
URL: http://svn.freebsd.org/changeset/base/197715

Log:
  MFC r197711 (partial) to 6.x and 7.x:
  
  - Add no zero mapping feature, disabled by default. [EN-09:05]
  
  MFC 178913,178914,179242,179243,180336,180340 to 6.x:
  
  - Fix kqueue pipe race conditions. [SA-09:13]
  
  MFC r192301 to 7.x; 6.x has slightly different fix:
  
  - Fix devfs / VFS NULL pointer race condition. [SA-09:14]
  
  Security:	FreeBSD-SA-09:13.pipe
  Security:	FreeBSD-SA-09:14.devfs
  Errata:		FreeBSD-EN-09:05.null
  Submitted by:	kib [SA-09:13] [SA-09:14]
  Submitted by:	bz [EN-09:05]
  In collaboration with:	jhb, kib, alc [EN-09:05]
  Approved by:	so (simon)

Modified:
  stable/7/sys/kern/kern_exec.c

Changes in other areas also in this revision:
Modified:
  releng/6.3/UPDATING
  releng/6.3/sys/conf/newvers.sh
  releng/6.3/sys/fs/devfs/devfs_vnops.c
  releng/6.3/sys/kern/kern_event.c
  releng/6.3/sys/kern/kern_exec.c
  releng/6.3/sys/kern/kern_fork.c
  releng/6.3/sys/kern/sys_pipe.c
  releng/6.3/sys/sys/event.h
  releng/6.3/sys/sys/pipe.h
  releng/6.4/UPDATING
  releng/6.4/sys/conf/newvers.sh
  releng/6.4/sys/fs/devfs/devfs_vnops.c
  releng/6.4/sys/kern/kern_event.c
  releng/6.4/sys/kern/kern_exec.c
  releng/6.4/sys/kern/kern_fork.c
  releng/6.4/sys/kern/sys_pipe.c
  releng/6.4/sys/sys/event.h
  releng/6.4/sys/sys/pipe.h
  releng/7.1/UPDATING
  releng/7.1/sys/conf/newvers.sh
  releng/7.1/sys/fs/devfs/devfs_vnops.c
  releng/7.1/sys/kern/kern_exec.c
  releng/7.2/UPDATING
  releng/7.2/sys/conf/newvers.sh
  releng/7.2/sys/fs/devfs/devfs_vnops.c
  releng/7.2/sys/kern/kern_exec.c
  stable/6/sys/fs/devfs/devfs_vnops.c
  stable/6/sys/kern/kern_event.c
  stable/6/sys/kern/kern_exec.c
  stable/6/sys/kern/kern_fork.c
  stable/6/sys/kern/sys_pipe.c
  stable/6/sys/sys/event.h
  stable/6/sys/sys/pipe.h

Modified: stable/7/sys/kern/kern_exec.c
==============================================================================
--- stable/7/sys/kern/kern_exec.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ stable/7/sys/kern/kern_exec.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -122,6 +122,11 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
     &ps_arg_cache_limit, 0, "");
 
+static int map_at_zero = 1;
+TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
+SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
+    "Permit processes to map an object at virtual address 0.");
+
 static int
 sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS)
 {
@@ -939,7 +944,7 @@ exec_new_vmspace(imgp, sv)
 	int error;
 	struct proc *p = imgp->proc;
 	struct vmspace *vmspace = p->p_vmspace;
-	vm_offset_t stack_addr;
+	vm_offset_t sv_minuser, stack_addr;
 	vm_map_t map;
 	u_long ssiz;
 
@@ -955,13 +960,17 @@ exec_new_vmspace(imgp, sv)
 	 * not disrupted
 	 */
 	map = &vmspace->vm_map;
-	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv->sv_minuser &&
+	if (map_at_zero)
+		sv_minuser = sv->sv_minuser;
+	else
+		sv_minuser = MAX(sv->sv_minuser, PAGE_SIZE);
+	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv_minuser &&
 	    vm_map_max(map) == sv->sv_maxuser) {
 		shmexit(vmspace);
 		pmap_remove_pages(vmspace_pmap(vmspace));
 		vm_map_remove(map, vm_map_min(map), vm_map_max(map));
 	} else {
-		error = vmspace_exec(p, sv->sv_minuser, sv->sv_maxuser);
+		error = vmspace_exec(p, sv_minuser, sv->sv_maxuser);
 		if (error)
 			return (error);
 		vmspace = p->p_vmspace;

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 18:09:57 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6ED581065672;
	Fri,  2 Oct 2009 18:09:57 +0000 (UTC)
	(envelope-from simon@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5961C8FC14;
	Fri,  2 Oct 2009 18:09:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92I9vQV009117;
	Fri, 2 Oct 2009 18:09:57 GMT (envelope-from simon@svn.freebsd.org)
Received: (from simon@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92I9uOs009090;
	Fri, 2 Oct 2009 18:09:56 GMT (envelope-from simon@svn.freebsd.org)
Message-Id: <200910021809.n92I9uOs009090@svn.freebsd.org>
From: "Simon L. Nielsen" 
Date: Fri, 2 Oct 2009 18:09:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-releng@freebsd.org
X-SVN-Group: releng
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r197715 - releng/6.3 releng/6.3/sys/conf
	releng/6.3/sys/fs/devfs releng/6.3/sys/kern
	releng/6.3/sys/sys releng/6.4 releng/6.4/sys/conf
	releng/6.4/sys/fs/devfs releng/6.4/sys/kern releng...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 18:09:57 -0000

Author: simon
Date: Fri Oct  2 18:09:56 2009
New Revision: 197715
URL: http://svn.freebsd.org/changeset/base/197715

Log:
  MFC r197711 (partial) to 6.x and 7.x:
  
  - Add no zero mapping feature, disabled by default. [EN-09:05]
  
  MFC 178913,178914,179242,179243,180336,180340 to 6.x:
  
  - Fix kqueue pipe race conditions. [SA-09:13]
  
  MFC r192301 to 7.x; 6.x has slightly different fix:
  
  - Fix devfs / VFS NULL pointer race condition. [SA-09:14]
  
  Security:	FreeBSD-SA-09:13.pipe
  Security:	FreeBSD-SA-09:14.devfs
  Errata:		FreeBSD-EN-09:05.null
  Submitted by:	kib [SA-09:13] [SA-09:14]
  Submitted by:	bz [EN-09:05]
  In collaboration with:	jhb, kib, alc [EN-09:05]
  Approved by:	so (simon)

Modified:
  releng/6.3/UPDATING
  releng/6.3/sys/conf/newvers.sh
  releng/6.3/sys/fs/devfs/devfs_vnops.c
  releng/6.3/sys/kern/kern_event.c
  releng/6.3/sys/kern/kern_exec.c
  releng/6.3/sys/kern/kern_fork.c
  releng/6.3/sys/kern/sys_pipe.c
  releng/6.3/sys/sys/event.h
  releng/6.3/sys/sys/pipe.h
  releng/6.4/UPDATING
  releng/6.4/sys/conf/newvers.sh
  releng/6.4/sys/fs/devfs/devfs_vnops.c
  releng/6.4/sys/kern/kern_event.c
  releng/6.4/sys/kern/kern_exec.c
  releng/6.4/sys/kern/kern_fork.c
  releng/6.4/sys/kern/sys_pipe.c
  releng/6.4/sys/sys/event.h
  releng/6.4/sys/sys/pipe.h
  releng/7.1/UPDATING
  releng/7.1/sys/conf/newvers.sh
  releng/7.1/sys/fs/devfs/devfs_vnops.c
  releng/7.1/sys/kern/kern_exec.c
  releng/7.2/UPDATING
  releng/7.2/sys/conf/newvers.sh
  releng/7.2/sys/fs/devfs/devfs_vnops.c
  releng/7.2/sys/kern/kern_exec.c

Changes in other areas also in this revision:
Modified:
  stable/6/sys/fs/devfs/devfs_vnops.c
  stable/6/sys/kern/kern_event.c
  stable/6/sys/kern/kern_exec.c
  stable/6/sys/kern/kern_fork.c
  stable/6/sys/kern/sys_pipe.c
  stable/6/sys/sys/event.h
  stable/6/sys/sys/pipe.h
  stable/7/sys/kern/kern_exec.c

Modified: releng/6.3/UPDATING
==============================================================================
--- releng/6.3/UPDATING	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.3/UPDATING	Fri Oct  2 18:09:56 2009	(r197715)
@@ -8,6 +8,14 @@ Items affecting the ports and packages s
 /usr/ports/UPDATING.  Please read that file before running
 portupgrade.
 
+20091002:	p13	FreeBSD-SA-09:13.pipe, FreeBSD-SA-09:14.devfs,
+			FreeBSD-EN-09:05.null
+	Fix kqueue pipe race conditions. [SA-09:13]
+
+	Fix devfs / VFS NULL pointer race condition. [SA-09:14]
+
+	Add no zero mapping feature. [EN-09:05]
+
 20090729:	p12	FreeBSD-SA-09:12.bind
 	Fix BIND named(8) dynamic update message remote DoS.
 

Modified: releng/6.3/sys/conf/newvers.sh
==============================================================================
--- releng/6.3/sys/conf/newvers.sh	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.3/sys/conf/newvers.sh	Fri Oct  2 18:09:56 2009	(r197715)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="6.3"
-BRANCH="RELEASE-p12"
+BRANCH="RELEASE-p13"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/6.3/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- releng/6.3/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.3/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -759,6 +759,9 @@ devfs_open(struct vop_open_args *ap)
 
 	VOP_UNLOCK(vp, 0, td);
 
+	if (ap->a_fdidx >= 0)
+		ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx]->f_vnode = vp;
+
 	if(!(dsw->d_flags & D_NEEDGIANT)) {
 		DROP_GIANT();
 		if (dsw->d_fdopen != NULL)

Modified: releng/6.3/sys/kern/kern_event.c
==============================================================================
--- releng/6.3/sys/kern/kern_event.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.3/sys/kern/kern_event.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -392,30 +392,82 @@ filt_proc(struct knote *kn, long hint)
 		return (1);
 	}
 
-	/*
-	 * process forked, and user wants to track the new process,
-	 * so attach a new knote to it, and immediately report an
-	 * event with the parent's pid.
-	 */
-	if ((event == NOTE_FORK) && (kn->kn_sfflags & NOTE_TRACK)) {
-		struct kevent kev;
-		int error;
+	return (kn->kn_fflags != 0);
+}
+
+/*
+ * Called when the process forked. It mostly does the same as the
+ * knote(), activating all knotes registered to be activated when the
+ * process forked. Additionally, for each knote attached to the
+ * parent, check whether user wants to track the new process. If so
+ * attach a new knote to it, and immediately report an event with the
+ * child's pid.
+ */
+void
+knote_fork(struct knlist *list, int pid)
+{
+	struct kqueue *kq;
+	struct knote *kn;
+	struct kevent kev;
+	int error;
+
+	if (list == NULL)
+		return;
+	list->kl_lock(list->kl_lockarg);
+
+	SLIST_FOREACH(kn, &list->kl_list, kn_selnext) {
+		if ((kn->kn_status & KN_INFLUX) == KN_INFLUX)
+			continue;
+		kq = kn->kn_kq;
+		KQ_LOCK(kq);
+		if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+			KQ_UNLOCK(kq);
+			continue;
+		}
 
 		/*
-		 * register knote with new process.
+		 * The same as knote(), activate the event.
 		 */
-		kev.ident = hint & NOTE_PDATAMASK;	/* pid */
+		if ((kn->kn_sfflags & NOTE_TRACK) == 0) {
+			kn->kn_status |= KN_HASKQLOCK;
+			if (kn->kn_fop->f_event(kn, NOTE_FORK | pid))
+				KNOTE_ACTIVATE(kn, 1);
+			kn->kn_status &= ~KN_HASKQLOCK;
+			KQ_UNLOCK(kq);
+			continue;
+		}
+
+		/*
+		 * The NOTE_TRACK case. In addition to the activation
+		 * of the event, we need to register new event to
+		 * track the child. Drop the locks in preparation for
+		 * the call to kqueue_register().
+		 */
+		kn->kn_status |= KN_INFLUX;
+		KQ_UNLOCK(kq);
+		list->kl_unlock(list->kl_lockarg);
+
+		/*
+		 * Activate existing knote and register a knote with
+		 * new process.
+		 */
+		kev.ident = pid;
 		kev.filter = kn->kn_filter;
 		kev.flags = kn->kn_flags | EV_ADD | EV_ENABLE | EV_FLAG1;
 		kev.fflags = kn->kn_sfflags;
-		kev.data = kn->kn_id;			/* parent */
-		kev.udata = kn->kn_kevent.udata;	/* preserve udata */
-		error = kqueue_register(kn->kn_kq, &kev, NULL, 0);
+		kev.data = kn->kn_id;		/* parent */
+		kev.udata = kn->kn_kevent.udata;/* preserve udata */
+		error = kqueue_register(kq, &kev, NULL, 0);
+		if (kn->kn_fop->f_event(kn, NOTE_FORK | pid))
+			KNOTE_ACTIVATE(kn, 0);
 		if (error)
 			kn->kn_fflags |= NOTE_TRACKERR;
+		KQ_LOCK(kq);
+		kn->kn_status &= ~KN_INFLUX;
+		KQ_UNLOCK_FLUX(kq);
+		list->kl_lock(list->kl_lockarg);
 	}
-
-	return (kn->kn_fflags != 0);
+	list->kl_unlock(list->kl_lockarg);
 }
 
 static int
@@ -1123,7 +1175,7 @@ kqueue_scan(struct kqueue *kq, int maxev
 	struct kevent *kevp;
 	struct timeval atv, rtv, ttv;
 	struct knote *kn, *marker;
-	int count, timeout, nkev, error;
+	int count, timeout, nkev, error, influx;
 	int haskqglobal;
 
 	count = maxevents;
@@ -1193,12 +1245,17 @@ start:
 	}
 
 	TAILQ_INSERT_TAIL(&kq->kq_head, marker, kn_tqe);
+	influx = 0;
 	while (count) {
 		KQ_OWNED(kq);
 		kn = TAILQ_FIRST(&kq->kq_head);
 
 		if ((kn->kn_status == KN_MARKER && kn != marker) ||
 		    (kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+			if (influx) {
+				influx = 0;
+				KQ_FLUX_WAKEUP(kq);
+			}
 			kq->kq_state |= KQ_FLUXWAIT;
 			error = msleep(kq, &kq->kq_lock, PSOCK,
 			    "kqflxwt", 0);
@@ -1248,6 +1305,7 @@ start:
 				    ~(KN_QUEUED | KN_ACTIVE | KN_INFLUX);
 				kq->kq_count--;
 				KN_LIST_UNLOCK(kn);
+				influx = 1;
 				continue;
 			}
 			*kevp = kn->kn_kevent;
@@ -1263,6 +1321,7 @@ start:
 			
 			kn->kn_status &= ~(KN_INFLUX);
 			KN_LIST_UNLOCK(kn);
+			influx = 1;
 		}
 
 		/* we are returning a copy to the user */
@@ -1271,6 +1330,7 @@ start:
 		count--;
 
 		if (nkev == KQ_NEVENTS) {
+			influx = 0;
 			KQ_UNLOCK_FLUX(kq);
 			error = k_ops->k_copyout(k_ops->arg, keva, nkev);
 			nkev = 0;
@@ -1434,8 +1494,11 @@ kqueue_close(struct file *fp, struct thr
 
 	for (i = 0; i < kq->kq_knlistsize; i++) {
 		while ((kn = SLIST_FIRST(&kq->kq_knlist[i])) != NULL) {
-			KASSERT((kn->kn_status & KN_INFLUX) == 0,
-			    ("KN_INFLUX set when not suppose to be"));
+			if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+				kq->kq_state |= KQ_FLUXWAIT;
+				msleep(kq, &kq->kq_lock, PSOCK, "kqclo1", 0);
+				continue;
+			}
 			kn->kn_status |= KN_INFLUX;
 			KQ_UNLOCK(kq);
 			if (!(kn->kn_status & KN_DETACHED))
@@ -1447,8 +1510,12 @@ kqueue_close(struct file *fp, struct thr
 	if (kq->kq_knhashmask != 0) {
 		for (i = 0; i <= kq->kq_knhashmask; i++) {
 			while ((kn = SLIST_FIRST(&kq->kq_knhash[i])) != NULL) {
-				KASSERT((kn->kn_status & KN_INFLUX) == 0,
-				    ("KN_INFLUX set when not suppose to be"));
+				if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+					kq->kq_state |= KQ_FLUXWAIT;
+					msleep(kq, &kq->kq_lock, PSOCK,
+					       "kqclo2", 0);
+					continue;
+				}
 				kn->kn_status |= KN_INFLUX;
 				KQ_UNLOCK(kq);
 				if (!(kn->kn_status & KN_DETACHED))

Modified: releng/6.3/sys/kern/kern_exec.c
==============================================================================
--- releng/6.3/sys/kern/kern_exec.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.3/sys/kern/kern_exec.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -104,6 +104,13 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
     &ps_arg_cache_limit, 0, "");
 
+SYSCTL_DECL(_security_bsd);
+
+static int map_at_zero = 1;
+TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
+SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
+    "Permit processes to map an object at virtual address 0.");
+
 static int
 sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS)
 {
@@ -914,7 +921,7 @@ exec_new_vmspace(imgp, sv)
 	int error;
 	struct proc *p = imgp->proc;
 	struct vmspace *vmspace = p->p_vmspace;
-	vm_offset_t stack_addr;
+	vm_offset_t sv_minuser, stack_addr;
 	vm_map_t map;
 
 	imgp->vmspace_destroyed = 1;
@@ -928,14 +935,18 @@ exec_new_vmspace(imgp, sv)
 	 * not disrupted
 	 */
 	map = &vmspace->vm_map;
-	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv->sv_minuser &&
+	if (map_at_zero)
+		sv_minuser = sv->sv_minuser;
+	else
+		sv_minuser = MAX(sv->sv_minuser, PAGE_SIZE);
+	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv_minuser &&
 	    vm_map_max(map) == sv->sv_maxuser) {
 		shmexit(vmspace);
 		pmap_remove_pages(vmspace_pmap(vmspace), vm_map_min(map),
 		    vm_map_max(map));
 		vm_map_remove(map, vm_map_min(map), vm_map_max(map));
 	} else {
-		vmspace_exec(p, sv->sv_minuser, sv->sv_maxuser);
+		vmspace_exec(p, sv_minuser, sv->sv_maxuser);
 		vmspace = p->p_vmspace;
 		map = &vmspace->vm_map;
 	}

Modified: releng/6.3/sys/kern/kern_fork.c
==============================================================================
--- releng/6.3/sys/kern/kern_fork.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.3/sys/kern/kern_fork.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -699,14 +699,12 @@ again:
 	 */
 	PROC_LOCK(p1);
 	_PRELE(p1);
+	PROC_UNLOCK(p1);
 
 	/*
 	 * Tell any interested parties about the new process.
 	 */
-	KNOTE_LOCKED(&p1->p_klist, NOTE_FORK | p2->p_pid);
-
-	PROC_UNLOCK(p1);
-
+	knote_fork(&p1->p_klist, p2->p_pid);
 	/*
 	 * Preserve synchronization semantics of vfork.  If waiting for
 	 * child to exec or exit, set P_PPWAIT on child, and sleep on our

Modified: releng/6.3/sys/kern/sys_pipe.c
==============================================================================
--- releng/6.3/sys/kern/sys_pipe.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.3/sys/kern/sys_pipe.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -268,8 +268,8 @@ pipe_zone_ctor(void *mem, int size, void
 	 * one at a time.  When both are free'd, then the whole pair
 	 * is released.
 	 */
-	rpipe->pipe_present = 1;
-	wpipe->pipe_present = 1;
+	rpipe->pipe_present = PIPE_ACTIVE;
+	wpipe->pipe_present = PIPE_ACTIVE;
 
 	/*
 	 * Eventually, the MAC Framework may initialize the label
@@ -1003,7 +1003,8 @@ pipe_write(fp, uio, active_cred, flags, 
 	/*
 	 * detect loss of pipe read side, issue SIGPIPE if lost.
 	 */
-	if ((!wpipe->pipe_present) || (wpipe->pipe_state & PIPE_EOF)) {
+	if (wpipe->pipe_present != PIPE_ACTIVE ||
+	    (wpipe->pipe_state & PIPE_EOF)) {
 		pipeunlock(wpipe);
 		PIPE_UNLOCK(rpipe);
 		return (EPIPE);
@@ -1361,13 +1362,14 @@ pipe_poll(fp, events, active_cred, td)
 			revents |= events & (POLLIN | POLLRDNORM);
 
 	if (events & (POLLOUT | POLLWRNORM))
-		if (!wpipe->pipe_present || (wpipe->pipe_state & PIPE_EOF) ||
+		if (wpipe->pipe_present != PIPE_ACTIVE ||
+		    (wpipe->pipe_state & PIPE_EOF) ||
 		    (((wpipe->pipe_state & PIPE_DIRECTW) == 0) &&
 		     (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) >= PIPE_BUF))
 			revents |= events & (POLLOUT | POLLWRNORM);
 
 	if ((rpipe->pipe_state & PIPE_EOF) ||
-	    (!wpipe->pipe_present) ||
+	    wpipe->pipe_present != PIPE_ACTIVE ||
 	    (wpipe->pipe_state & PIPE_EOF))
 		revents |= POLLHUP;
 
@@ -1506,7 +1508,7 @@ pipeclose(cpipe)
 	 * Disconnect from peer, if any.
 	 */
 	ppipe = cpipe->pipe_peer;
-	if (ppipe->pipe_present != 0) {
+	if (ppipe->pipe_present == PIPE_ACTIVE) {
 		pipeselwakeup(ppipe);
 
 		ppipe->pipe_state |= PIPE_EOF;
@@ -1523,16 +1525,23 @@ pipeclose(cpipe)
 	PIPE_UNLOCK(cpipe);
 	pipe_free_kmem(cpipe);
 	PIPE_LOCK(cpipe);
-	cpipe->pipe_present = 0;
+	cpipe->pipe_present = PIPE_CLOSING;
 	pipeunlock(cpipe);
+
+	/*
+	 * knlist_clear() may sleep dropping the PIPE_MTX. Set the
+	 * PIPE_FINALIZED, that allows other end to free the
+	 * pipe_pair, only after the knotes are completely dismantled.
+	 */
 	knlist_clear(&cpipe->pipe_sel.si_note, 1);
+	cpipe->pipe_present = PIPE_FINALIZED;
 	knlist_destroy(&cpipe->pipe_sel.si_note);
 
 	/*
 	 * If both endpoints are now closed, release the memory for the
 	 * pipe pair.  If not, unlock.
 	 */
-	if (ppipe->pipe_present == 0) {
+	if (ppipe->pipe_present == PIPE_FINALIZED) {
 		PIPE_UNLOCK(cpipe);
 #ifdef MAC
 		mac_destroy_pipe(pp);
@@ -1556,7 +1565,7 @@ pipe_kqfilter(struct file *fp, struct kn
 		break;
 	case EVFILT_WRITE:
 		kn->kn_fop = &pipe_wfiltops;
-		if (!cpipe->pipe_peer->pipe_present) {
+		if (cpipe->pipe_peer->pipe_present != PIPE_ACTIVE) {
 			/* other end of pipe has been closed */
 			PIPE_UNLOCK(cpipe);
 			return (EPIPE);
@@ -1579,13 +1588,8 @@ filt_pipedetach(struct knote *kn)
 	struct pipe *cpipe = (struct pipe *)kn->kn_fp->f_data;
 
 	PIPE_LOCK(cpipe);
-	if (kn->kn_filter == EVFILT_WRITE) {
-		if (!cpipe->pipe_peer->pipe_present) {
-			PIPE_UNLOCK(cpipe);
-			return;
-		}
+	if (kn->kn_filter == EVFILT_WRITE)
 		cpipe = cpipe->pipe_peer;
-	}
 	knlist_remove(&cpipe->pipe_sel.si_note, kn, 1);
 	PIPE_UNLOCK(cpipe);
 }
@@ -1604,7 +1608,8 @@ filt_piperead(struct knote *kn, long hin
 		kn->kn_data = rpipe->pipe_map.cnt;
 
 	if ((rpipe->pipe_state & PIPE_EOF) ||
-	    (!wpipe->pipe_present) || (wpipe->pipe_state & PIPE_EOF)) {
+	    wpipe->pipe_present != PIPE_ACTIVE ||
+	    (wpipe->pipe_state & PIPE_EOF)) {
 		kn->kn_flags |= EV_EOF;
 		PIPE_UNLOCK(rpipe);
 		return (1);
@@ -1622,7 +1627,8 @@ filt_pipewrite(struct knote *kn, long hi
 	struct pipe *wpipe = rpipe->pipe_peer;
 
 	PIPE_LOCK(rpipe);
-	if ((!wpipe->pipe_present) || (wpipe->pipe_state & PIPE_EOF)) {
+	if (wpipe->pipe_present != PIPE_ACTIVE ||
+	    (wpipe->pipe_state & PIPE_EOF)) {
 		kn->kn_data = 0;
 		kn->kn_flags |= EV_EOF;
 		PIPE_UNLOCK(rpipe);

Modified: releng/6.3/sys/sys/event.h
==============================================================================
--- releng/6.3/sys/sys/event.h	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.3/sys/sys/event.h	Fri Oct  2 18:09:56 2009	(r197715)
@@ -208,6 +208,7 @@ struct proc;
 struct knlist;
 
 extern void	knote(struct knlist *list, long hint, int islocked);
+extern void	knote_fork(struct knlist *list, int pid);
 extern void	knlist_add(struct knlist *knl, struct knote *kn, int islocked);
 extern void	knlist_remove(struct knlist *knl, struct knote *kn, int islocked);
 extern void	knlist_remove_inevent(struct knlist *knl, struct knote *kn);

Modified: releng/6.3/sys/sys/pipe.h
==============================================================================
--- releng/6.3/sys/sys/pipe.h	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.3/sys/sys/pipe.h	Fri Oct  2 18:09:56 2009	(r197715)
@@ -115,6 +115,13 @@ struct pipe {
 };
 
 /*
+ * Values for the pipe_present.
+ */
+#define PIPE_ACTIVE		1
+#define	PIPE_CLOSING		2
+#define	PIPE_FINALIZED		3
+
+/*
  * Container structure to hold the two pipe endpoints, mutex, and label
  * pointer.
  */

Modified: releng/6.4/UPDATING
==============================================================================
--- releng/6.4/UPDATING	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.4/UPDATING	Fri Oct  2 18:09:56 2009	(r197715)
@@ -8,6 +8,14 @@ Items affecting the ports and packages s
 /usr/ports/UPDATING.  Please read that file before running
 portupgrade.
 
+20091002:	p7	FreeBSD-SA-09:13.pipe, FreeBSD-SA-09:14.devfs,
+			FreeBSD-EN-09:05.null
+	Fix kqueue pipe race conditions. [SA-09:13]
+
+	Fix devfs / VFS NULL pointer race condition. [SA-09:14]
+
+	Add no zero mapping feature. [EN-09:05]
+
 20090729:	p6	FreeBSD-SA-09:12.bind
 	Fix BIND named(8) dynamic update message remote DoS.
 

Modified: releng/6.4/sys/conf/newvers.sh
==============================================================================
--- releng/6.4/sys/conf/newvers.sh	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.4/sys/conf/newvers.sh	Fri Oct  2 18:09:56 2009	(r197715)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="6.4"
-BRANCH="RELEASE-p6"
+BRANCH="RELEASE-p7"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/6.4/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- releng/6.4/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.4/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -759,6 +759,9 @@ devfs_open(struct vop_open_args *ap)
 
 	VOP_UNLOCK(vp, 0, td);
 
+	if (ap->a_fdidx >= 0)
+		ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx]->f_vnode = vp;
+
 	if(!(dsw->d_flags & D_NEEDGIANT)) {
 		DROP_GIANT();
 		if (dsw->d_fdopen != NULL)

Modified: releng/6.4/sys/kern/kern_event.c
==============================================================================
--- releng/6.4/sys/kern/kern_event.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.4/sys/kern/kern_event.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -392,30 +392,82 @@ filt_proc(struct knote *kn, long hint)
 		return (1);
 	}
 
-	/*
-	 * process forked, and user wants to track the new process,
-	 * so attach a new knote to it, and immediately report an
-	 * event with the parent's pid.
-	 */
-	if ((event == NOTE_FORK) && (kn->kn_sfflags & NOTE_TRACK)) {
-		struct kevent kev;
-		int error;
+	return (kn->kn_fflags != 0);
+}
+
+/*
+ * Called when the process forked. It mostly does the same as the
+ * knote(), activating all knotes registered to be activated when the
+ * process forked. Additionally, for each knote attached to the
+ * parent, check whether user wants to track the new process. If so
+ * attach a new knote to it, and immediately report an event with the
+ * child's pid.
+ */
+void
+knote_fork(struct knlist *list, int pid)
+{
+	struct kqueue *kq;
+	struct knote *kn;
+	struct kevent kev;
+	int error;
+
+	if (list == NULL)
+		return;
+	list->kl_lock(list->kl_lockarg);
+
+	SLIST_FOREACH(kn, &list->kl_list, kn_selnext) {
+		if ((kn->kn_status & KN_INFLUX) == KN_INFLUX)
+			continue;
+		kq = kn->kn_kq;
+		KQ_LOCK(kq);
+		if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+			KQ_UNLOCK(kq);
+			continue;
+		}
 
 		/*
-		 * register knote with new process.
+		 * The same as knote(), activate the event.
 		 */
-		kev.ident = hint & NOTE_PDATAMASK;	/* pid */
+		if ((kn->kn_sfflags & NOTE_TRACK) == 0) {
+			kn->kn_status |= KN_HASKQLOCK;
+			if (kn->kn_fop->f_event(kn, NOTE_FORK | pid))
+				KNOTE_ACTIVATE(kn, 1);
+			kn->kn_status &= ~KN_HASKQLOCK;
+			KQ_UNLOCK(kq);
+			continue;
+		}
+
+		/*
+		 * The NOTE_TRACK case. In addition to the activation
+		 * of the event, we need to register new event to
+		 * track the child. Drop the locks in preparation for
+		 * the call to kqueue_register().
+		 */
+		kn->kn_status |= KN_INFLUX;
+		KQ_UNLOCK(kq);
+		list->kl_unlock(list->kl_lockarg);
+
+		/*
+		 * Activate existing knote and register a knote with
+		 * new process.
+		 */
+		kev.ident = pid;
 		kev.filter = kn->kn_filter;
 		kev.flags = kn->kn_flags | EV_ADD | EV_ENABLE | EV_FLAG1;
 		kev.fflags = kn->kn_sfflags;
-		kev.data = kn->kn_id;			/* parent */
-		kev.udata = kn->kn_kevent.udata;	/* preserve udata */
-		error = kqueue_register(kn->kn_kq, &kev, NULL, 0);
+		kev.data = kn->kn_id;		/* parent */
+		kev.udata = kn->kn_kevent.udata;/* preserve udata */
+		error = kqueue_register(kq, &kev, NULL, 0);
+		if (kn->kn_fop->f_event(kn, NOTE_FORK | pid))
+			KNOTE_ACTIVATE(kn, 0);
 		if (error)
 			kn->kn_fflags |= NOTE_TRACKERR;
+		KQ_LOCK(kq);
+		kn->kn_status &= ~KN_INFLUX;
+		KQ_UNLOCK_FLUX(kq);
+		list->kl_lock(list->kl_lockarg);
 	}
-
-	return (kn->kn_fflags != 0);
+	list->kl_unlock(list->kl_lockarg);
 }
 
 static int
@@ -1123,7 +1175,7 @@ kqueue_scan(struct kqueue *kq, int maxev
 	struct kevent *kevp;
 	struct timeval atv, rtv, ttv;
 	struct knote *kn, *marker;
-	int count, timeout, nkev, error;
+	int count, timeout, nkev, error, influx;
 	int haskqglobal;
 
 	count = maxevents;
@@ -1193,12 +1245,17 @@ start:
 	}
 
 	TAILQ_INSERT_TAIL(&kq->kq_head, marker, kn_tqe);
+	influx = 0;
 	while (count) {
 		KQ_OWNED(kq);
 		kn = TAILQ_FIRST(&kq->kq_head);
 
 		if ((kn->kn_status == KN_MARKER && kn != marker) ||
 		    (kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+			if (influx) {
+				influx = 0;
+				KQ_FLUX_WAKEUP(kq);
+			}
 			kq->kq_state |= KQ_FLUXWAIT;
 			error = msleep(kq, &kq->kq_lock, PSOCK,
 			    "kqflxwt", 0);
@@ -1248,6 +1305,7 @@ start:
 				    ~(KN_QUEUED | KN_ACTIVE | KN_INFLUX);
 				kq->kq_count--;
 				KN_LIST_UNLOCK(kn);
+				influx = 1;
 				continue;
 			}
 			*kevp = kn->kn_kevent;
@@ -1263,6 +1321,7 @@ start:
 			
 			kn->kn_status &= ~(KN_INFLUX);
 			KN_LIST_UNLOCK(kn);
+			influx = 1;
 		}
 
 		/* we are returning a copy to the user */
@@ -1271,6 +1330,7 @@ start:
 		count--;
 
 		if (nkev == KQ_NEVENTS) {
+			influx = 0;
 			KQ_UNLOCK_FLUX(kq);
 			error = k_ops->k_copyout(k_ops->arg, keva, nkev);
 			nkev = 0;
@@ -1434,8 +1494,11 @@ kqueue_close(struct file *fp, struct thr
 
 	for (i = 0; i < kq->kq_knlistsize; i++) {
 		while ((kn = SLIST_FIRST(&kq->kq_knlist[i])) != NULL) {
-			KASSERT((kn->kn_status & KN_INFLUX) == 0,
-			    ("KN_INFLUX set when not suppose to be"));
+			if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+				kq->kq_state |= KQ_FLUXWAIT;
+				msleep(kq, &kq->kq_lock, PSOCK, "kqclo1", 0);
+				continue;
+			}
 			kn->kn_status |= KN_INFLUX;
 			KQ_UNLOCK(kq);
 			if (!(kn->kn_status & KN_DETACHED))
@@ -1447,8 +1510,12 @@ kqueue_close(struct file *fp, struct thr
 	if (kq->kq_knhashmask != 0) {
 		for (i = 0; i <= kq->kq_knhashmask; i++) {
 			while ((kn = SLIST_FIRST(&kq->kq_knhash[i])) != NULL) {
-				KASSERT((kn->kn_status & KN_INFLUX) == 0,
-				    ("KN_INFLUX set when not suppose to be"));
+				if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+					kq->kq_state |= KQ_FLUXWAIT;
+					msleep(kq, &kq->kq_lock, PSOCK,
+					       "kqclo2", 0);
+					continue;
+				}
 				kn->kn_status |= KN_INFLUX;
 				KQ_UNLOCK(kq);
 				if (!(kn->kn_status & KN_DETACHED))

Modified: releng/6.4/sys/kern/kern_exec.c
==============================================================================
--- releng/6.4/sys/kern/kern_exec.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.4/sys/kern/kern_exec.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -104,6 +104,13 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
     &ps_arg_cache_limit, 0, "");
 
+SYSCTL_DECL(_security_bsd);
+
+static int map_at_zero = 1;
+TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
+SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
+    "Permit processes to map an object at virtual address 0.");
+
 static int
 sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS)
 {
@@ -914,7 +921,7 @@ exec_new_vmspace(imgp, sv)
 	int error;
 	struct proc *p = imgp->proc;
 	struct vmspace *vmspace = p->p_vmspace;
-	vm_offset_t stack_addr;
+	vm_offset_t sv_minuser, stack_addr;
 	vm_map_t map;
 
 	imgp->vmspace_destroyed = 1;
@@ -928,14 +935,18 @@ exec_new_vmspace(imgp, sv)
 	 * not disrupted
 	 */
 	map = &vmspace->vm_map;
-	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv->sv_minuser &&
+	if (map_at_zero)
+		sv_minuser = sv->sv_minuser;
+	else
+		sv_minuser = MAX(sv->sv_minuser, PAGE_SIZE);
+	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv_minuser &&
 	    vm_map_max(map) == sv->sv_maxuser) {
 		shmexit(vmspace);
 		pmap_remove_pages(vmspace_pmap(vmspace), vm_map_min(map),
 		    vm_map_max(map));
 		vm_map_remove(map, vm_map_min(map), vm_map_max(map));
 	} else {
-		vmspace_exec(p, sv->sv_minuser, sv->sv_maxuser);
+		vmspace_exec(p, sv_minuser, sv->sv_maxuser);
 		vmspace = p->p_vmspace;
 		map = &vmspace->vm_map;
 	}

Modified: releng/6.4/sys/kern/kern_fork.c
==============================================================================
--- releng/6.4/sys/kern/kern_fork.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.4/sys/kern/kern_fork.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -699,14 +699,12 @@ again:
 	 */
 	PROC_LOCK(p1);
 	_PRELE(p1);
+	PROC_UNLOCK(p1);
 
 	/*
 	 * Tell any interested parties about the new process.
 	 */
-	KNOTE_LOCKED(&p1->p_klist, NOTE_FORK | p2->p_pid);
-
-	PROC_UNLOCK(p1);
-
+	knote_fork(&p1->p_klist, p2->p_pid);
 	/*
 	 * Preserve synchronization semantics of vfork.  If waiting for
 	 * child to exec or exit, set P_PPWAIT on child, and sleep on our

Modified: releng/6.4/sys/kern/sys_pipe.c
==============================================================================
--- releng/6.4/sys/kern/sys_pipe.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.4/sys/kern/sys_pipe.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -268,8 +268,8 @@ pipe_zone_ctor(void *mem, int size, void
 	 * one at a time.  When both are free'd, then the whole pair
 	 * is released.
 	 */
-	rpipe->pipe_present = 1;
-	wpipe->pipe_present = 1;
+	rpipe->pipe_present = PIPE_ACTIVE;
+	wpipe->pipe_present = PIPE_ACTIVE;
 
 	/*
 	 * Eventually, the MAC Framework may initialize the label
@@ -1003,7 +1003,8 @@ pipe_write(fp, uio, active_cred, flags, 
 	/*
 	 * detect loss of pipe read side, issue SIGPIPE if lost.
 	 */
-	if ((!wpipe->pipe_present) || (wpipe->pipe_state & PIPE_EOF)) {
+	if (wpipe->pipe_present != PIPE_ACTIVE ||
+	    (wpipe->pipe_state & PIPE_EOF)) {
 		pipeunlock(wpipe);
 		PIPE_UNLOCK(rpipe);
 		return (EPIPE);
@@ -1361,13 +1362,14 @@ pipe_poll(fp, events, active_cred, td)
 			revents |= events & (POLLIN | POLLRDNORM);
 
 	if (events & (POLLOUT | POLLWRNORM))
-		if (!wpipe->pipe_present || (wpipe->pipe_state & PIPE_EOF) ||
+		if (wpipe->pipe_present != PIPE_ACTIVE ||
+		    (wpipe->pipe_state & PIPE_EOF) ||
 		    (((wpipe->pipe_state & PIPE_DIRECTW) == 0) &&
 		     (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) >= PIPE_BUF))
 			revents |= events & (POLLOUT | POLLWRNORM);
 
 	if ((rpipe->pipe_state & PIPE_EOF) ||
-	    (!wpipe->pipe_present) ||
+	    wpipe->pipe_present != PIPE_ACTIVE ||
 	    (wpipe->pipe_state & PIPE_EOF))
 		revents |= POLLHUP;
 
@@ -1506,7 +1508,7 @@ pipeclose(cpipe)
 	 * Disconnect from peer, if any.
 	 */
 	ppipe = cpipe->pipe_peer;
-	if (ppipe->pipe_present != 0) {
+	if (ppipe->pipe_present == PIPE_ACTIVE) {
 		pipeselwakeup(ppipe);
 
 		ppipe->pipe_state |= PIPE_EOF;
@@ -1523,16 +1525,23 @@ pipeclose(cpipe)
 	PIPE_UNLOCK(cpipe);
 	pipe_free_kmem(cpipe);
 	PIPE_LOCK(cpipe);
-	cpipe->pipe_present = 0;
+	cpipe->pipe_present = PIPE_CLOSING;
 	pipeunlock(cpipe);
+
+	/*
+	 * knlist_clear() may sleep dropping the PIPE_MTX. Set the
+	 * PIPE_FINALIZED, that allows other end to free the
+	 * pipe_pair, only after the knotes are completely dismantled.
+	 */
 	knlist_clear(&cpipe->pipe_sel.si_note, 1);
+	cpipe->pipe_present = PIPE_FINALIZED;
 	knlist_destroy(&cpipe->pipe_sel.si_note);
 
 	/*
 	 * If both endpoints are now closed, release the memory for the
 	 * pipe pair.  If not, unlock.
 	 */
-	if (ppipe->pipe_present == 0) {
+	if (ppipe->pipe_present == PIPE_FINALIZED) {
 		PIPE_UNLOCK(cpipe);
 #ifdef MAC
 		mac_destroy_pipe(pp);
@@ -1556,7 +1565,7 @@ pipe_kqfilter(struct file *fp, struct kn
 		break;
 	case EVFILT_WRITE:
 		kn->kn_fop = &pipe_wfiltops;
-		if (!cpipe->pipe_peer->pipe_present) {
+		if (cpipe->pipe_peer->pipe_present != PIPE_ACTIVE) {
 			/* other end of pipe has been closed */
 			PIPE_UNLOCK(cpipe);
 			return (EPIPE);
@@ -1579,13 +1588,8 @@ filt_pipedetach(struct knote *kn)
 	struct pipe *cpipe = (struct pipe *)kn->kn_fp->f_data;
 
 	PIPE_LOCK(cpipe);
-	if (kn->kn_filter == EVFILT_WRITE) {
-		if (!cpipe->pipe_peer->pipe_present) {
-			PIPE_UNLOCK(cpipe);
-			return;
-		}
+	if (kn->kn_filter == EVFILT_WRITE)
 		cpipe = cpipe->pipe_peer;
-	}
 	knlist_remove(&cpipe->pipe_sel.si_note, kn, 1);
 	PIPE_UNLOCK(cpipe);
 }
@@ -1604,7 +1608,8 @@ filt_piperead(struct knote *kn, long hin
 		kn->kn_data = rpipe->pipe_map.cnt;
 
 	if ((rpipe->pipe_state & PIPE_EOF) ||
-	    (!wpipe->pipe_present) || (wpipe->pipe_state & PIPE_EOF)) {
+	    wpipe->pipe_present != PIPE_ACTIVE ||
+	    (wpipe->pipe_state & PIPE_EOF)) {
 		kn->kn_flags |= EV_EOF;
 		PIPE_UNLOCK(rpipe);
 		return (1);
@@ -1622,7 +1627,8 @@ filt_pipewrite(struct knote *kn, long hi
 	struct pipe *wpipe = rpipe->pipe_peer;
 
 	PIPE_LOCK(rpipe);
-	if ((!wpipe->pipe_present) || (wpipe->pipe_state & PIPE_EOF)) {
+	if (wpipe->pipe_present != PIPE_ACTIVE ||
+	    (wpipe->pipe_state & PIPE_EOF)) {
 		kn->kn_data = 0;
 		kn->kn_flags |= EV_EOF;
 		PIPE_UNLOCK(rpipe);

Modified: releng/6.4/sys/sys/event.h
==============================================================================
--- releng/6.4/sys/sys/event.h	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.4/sys/sys/event.h	Fri Oct  2 18:09:56 2009	(r197715)
@@ -208,6 +208,7 @@ struct proc;
 struct knlist;
 
 extern void	knote(struct knlist *list, long hint, int islocked);
+extern void	knote_fork(struct knlist *list, int pid);
 extern void	knlist_add(struct knlist *knl, struct knote *kn, int islocked);
 extern void	knlist_remove(struct knlist *knl, struct knote *kn, int islocked);
 extern void	knlist_remove_inevent(struct knlist *knl, struct knote *kn);

Modified: releng/6.4/sys/sys/pipe.h
==============================================================================
--- releng/6.4/sys/sys/pipe.h	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/6.4/sys/sys/pipe.h	Fri Oct  2 18:09:56 2009	(r197715)
@@ -115,6 +115,13 @@ struct pipe {
 };
 
 /*
+ * Values for the pipe_present.
+ */
+#define PIPE_ACTIVE		1
+#define	PIPE_CLOSING		2
+#define	PIPE_FINALIZED		3
+
+/*
  * Container structure to hold the two pipe endpoints, mutex, and label
  * pointer.
  */

Modified: releng/7.1/UPDATING
==============================================================================
--- releng/7.1/UPDATING	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/7.1/UPDATING	Fri Oct  2 18:09:56 2009	(r197715)
@@ -8,6 +8,11 @@ Items affecting the ports and packages s
 /usr/ports/UPDATING.  Please read that file before running
 portupgrade.
 
+20091002:	p8	FreeBSD-SA-09:14.devfs, FreeBSD-EN-09:05.null
+	Fix devfs / VFS NULL pointer race condition. [SA-09:14]
+
+	Add no zero mapping feature. [EN-09:05]
+
 20090729:	p7	FreeBSD-SA-09:12.bind
 	Fix BIND named(8) dynamic update message remote DoS.
 

Modified: releng/7.1/sys/conf/newvers.sh
==============================================================================
--- releng/7.1/sys/conf/newvers.sh	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/7.1/sys/conf/newvers.sh	Fri Oct  2 18:09:56 2009	(r197715)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="7.1"
-BRANCH="RELEASE-p7"
+BRANCH="RELEASE-p8"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/7.1/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- releng/7.1/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/7.1/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -883,6 +883,7 @@ devfs_open(struct vop_open_args *ap)
 	if (fp != NULL) {
 		FILE_LOCK(fp);
 		fp->f_data = dev;
+		fp->f_vnode = vp;
 		FILE_UNLOCK(fp);
 	}
 	fpop = td->td_fpop;

Modified: releng/7.1/sys/kern/kern_exec.c
==============================================================================
--- releng/7.1/sys/kern/kern_exec.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/7.1/sys/kern/kern_exec.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -121,6 +121,11 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
     &ps_arg_cache_limit, 0, "");
 
+static int map_at_zero = 1;
+TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
+SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
+    "Permit processes to map an object at virtual address 0.");
+
 static int
 sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS)
 {
@@ -933,7 +938,7 @@ exec_new_vmspace(imgp, sv)
 	int error;
 	struct proc *p = imgp->proc;
 	struct vmspace *vmspace = p->p_vmspace;
-	vm_offset_t stack_addr;
+	vm_offset_t sv_minuser, stack_addr;
 	vm_map_t map;
 	u_long ssiz;
 
@@ -949,13 +954,17 @@ exec_new_vmspace(imgp, sv)
 	 * not disrupted
 	 */
 	map = &vmspace->vm_map;
-	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv->sv_minuser &&
+	if (map_at_zero)
+		sv_minuser = sv->sv_minuser;
+	else
+		sv_minuser = MAX(sv->sv_minuser, PAGE_SIZE);
+	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv_minuser &&
 	    vm_map_max(map) == sv->sv_maxuser) {
 		shmexit(vmspace);
 		pmap_remove_pages(vmspace_pmap(vmspace));
 		vm_map_remove(map, vm_map_min(map), vm_map_max(map));
 	} else {
-		error = vmspace_exec(p, sv->sv_minuser, sv->sv_maxuser);
+		error = vmspace_exec(p, sv_minuser, sv->sv_maxuser);
 		if (error)
 			return (error);
 		vmspace = p->p_vmspace;

Modified: releng/7.2/UPDATING
==============================================================================
--- releng/7.2/UPDATING	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/7.2/UPDATING	Fri Oct  2 18:09:56 2009	(r197715)
@@ -8,6 +8,11 @@ Items affecting the ports and packages s
 /usr/ports/UPDATING.  Please read that file before running
 portupgrade.
 
+20091002:	p4	FreeBSD-SA-09:14.devfs FreeBSD-EN-09:05.null
+	Fix devfs / VFS NULL pointer race condition. [SA-09:14]
+
+	Add no zero mapping feature. [EN-09:05]
+
 20090729:	p3	FreeBSD-SA-09:12.bind
 	Fix BIND named(8) dynamic update message remote DoS.
 

Modified: releng/7.2/sys/conf/newvers.sh
==============================================================================
--- releng/7.2/sys/conf/newvers.sh	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/7.2/sys/conf/newvers.sh	Fri Oct  2 18:09:56 2009	(r197715)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="7.2"
-BRANCH="RELEASE-p3"
+BRANCH="RELEASE-p4"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/7.2/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- releng/7.2/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/7.2/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -890,6 +890,7 @@ devfs_open(struct vop_open_args *ap)
 	if (fp != NULL) {
 		FILE_LOCK(fp);
 		fp->f_data = dev;
+		fp->f_vnode = vp;
 		FILE_UNLOCK(fp);
 	}
 	fpop = td->td_fpop;

Modified: releng/7.2/sys/kern/kern_exec.c
==============================================================================
--- releng/7.2/sys/kern/kern_exec.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ releng/7.2/sys/kern/kern_exec.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -122,6 +122,11 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
     &ps_arg_cache_limit, 0, "");
 
+static int map_at_zero = 1;
+TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
+SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
+    "Permit processes to map an object at virtual address 0.");
+
 static int
 sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS)
 {
@@ -939,7 +944,7 @@ exec_new_vmspace(imgp, sv)
 	int error;
 	struct proc *p = imgp->proc;
 	struct vmspace *vmspace = p->p_vmspace;
-	vm_offset_t stack_addr;
+	vm_offset_t sv_minuser, stack_addr;
 	vm_map_t map;
 	u_long ssiz;
 
@@ -955,13 +960,17 @@ exec_new_vmspace(imgp, sv)
 	 * not disrupted
 	 */
 	map = &vmspace->vm_map;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 18:09:57 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8E9CF1065679;
	Fri,  2 Oct 2009 18:09:57 +0000 (UTC)
	(envelope-from simon@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 78D848FC16;
	Fri,  2 Oct 2009 18:09:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92I9vmi009129;
	Fri, 2 Oct 2009 18:09:57 GMT (envelope-from simon@svn.freebsd.org)
Received: (from simon@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92I9v0c009121;
	Fri, 2 Oct 2009 18:09:57 GMT (envelope-from simon@svn.freebsd.org)
Message-Id: <200910021809.n92I9v0c009121@svn.freebsd.org>
From: "Simon L. Nielsen" 
Date: Fri, 2 Oct 2009 18:09:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r197715 - releng/6.3 releng/6.3/sys/conf
	releng/6.3/sys/fs/devfs releng/6.3/sys/kern
	releng/6.3/sys/sys releng/6.4 releng/6.4/sys/conf
	releng/6.4/sys/fs/devfs releng/6.4/sys/kern releng...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 18:09:57 -0000

Author: simon
Date: Fri Oct  2 18:09:56 2009
New Revision: 197715
URL: http://svn.freebsd.org/changeset/base/197715

Log:
  MFC r197711 (partial) to 6.x and 7.x:
  
  - Add no zero mapping feature, disabled by default. [EN-09:05]
  
  MFC 178913,178914,179242,179243,180336,180340 to 6.x:
  
  - Fix kqueue pipe race conditions. [SA-09:13]
  
  MFC r192301 to 7.x; 6.x has slightly different fix:
  
  - Fix devfs / VFS NULL pointer race condition. [SA-09:14]
  
  Security:	FreeBSD-SA-09:13.pipe
  Security:	FreeBSD-SA-09:14.devfs
  Errata:		FreeBSD-EN-09:05.null
  Submitted by:	kib [SA-09:13] [SA-09:14]
  Submitted by:	bz [EN-09:05]
  In collaboration with:	jhb, kib, alc [EN-09:05]
  Approved by:	so (simon)

Modified:
  stable/6/sys/fs/devfs/devfs_vnops.c
  stable/6/sys/kern/kern_event.c
  stable/6/sys/kern/kern_exec.c
  stable/6/sys/kern/kern_fork.c
  stable/6/sys/kern/sys_pipe.c
  stable/6/sys/sys/event.h
  stable/6/sys/sys/pipe.h

Changes in other areas also in this revision:
Modified:
  releng/6.3/UPDATING
  releng/6.3/sys/conf/newvers.sh
  releng/6.3/sys/fs/devfs/devfs_vnops.c
  releng/6.3/sys/kern/kern_event.c
  releng/6.3/sys/kern/kern_exec.c
  releng/6.3/sys/kern/kern_fork.c
  releng/6.3/sys/kern/sys_pipe.c
  releng/6.3/sys/sys/event.h
  releng/6.3/sys/sys/pipe.h
  releng/6.4/UPDATING
  releng/6.4/sys/conf/newvers.sh
  releng/6.4/sys/fs/devfs/devfs_vnops.c
  releng/6.4/sys/kern/kern_event.c
  releng/6.4/sys/kern/kern_exec.c
  releng/6.4/sys/kern/kern_fork.c
  releng/6.4/sys/kern/sys_pipe.c
  releng/6.4/sys/sys/event.h
  releng/6.4/sys/sys/pipe.h
  releng/7.1/UPDATING
  releng/7.1/sys/conf/newvers.sh
  releng/7.1/sys/fs/devfs/devfs_vnops.c
  releng/7.1/sys/kern/kern_exec.c
  releng/7.2/UPDATING
  releng/7.2/sys/conf/newvers.sh
  releng/7.2/sys/fs/devfs/devfs_vnops.c
  releng/7.2/sys/kern/kern_exec.c
  stable/7/sys/kern/kern_exec.c

Modified: stable/6/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- stable/6/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ stable/6/sys/fs/devfs/devfs_vnops.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -759,6 +759,9 @@ devfs_open(struct vop_open_args *ap)
 
 	VOP_UNLOCK(vp, 0, td);
 
+	if (ap->a_fdidx >= 0)
+		ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx]->f_vnode = vp;
+
 	if(!(dsw->d_flags & D_NEEDGIANT)) {
 		DROP_GIANT();
 		if (dsw->d_fdopen != NULL)

Modified: stable/6/sys/kern/kern_event.c
==============================================================================
--- stable/6/sys/kern/kern_event.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ stable/6/sys/kern/kern_event.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -392,30 +392,82 @@ filt_proc(struct knote *kn, long hint)
 		return (1);
 	}
 
-	/*
-	 * process forked, and user wants to track the new process,
-	 * so attach a new knote to it, and immediately report an
-	 * event with the parent's pid.
-	 */
-	if ((event == NOTE_FORK) && (kn->kn_sfflags & NOTE_TRACK)) {
-		struct kevent kev;
-		int error;
+	return (kn->kn_fflags != 0);
+}
+
+/*
+ * Called when the process forked. It mostly does the same as the
+ * knote(), activating all knotes registered to be activated when the
+ * process forked. Additionally, for each knote attached to the
+ * parent, check whether user wants to track the new process. If so
+ * attach a new knote to it, and immediately report an event with the
+ * child's pid.
+ */
+void
+knote_fork(struct knlist *list, int pid)
+{
+	struct kqueue *kq;
+	struct knote *kn;
+	struct kevent kev;
+	int error;
+
+	if (list == NULL)
+		return;
+	list->kl_lock(list->kl_lockarg);
+
+	SLIST_FOREACH(kn, &list->kl_list, kn_selnext) {
+		if ((kn->kn_status & KN_INFLUX) == KN_INFLUX)
+			continue;
+		kq = kn->kn_kq;
+		KQ_LOCK(kq);
+		if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+			KQ_UNLOCK(kq);
+			continue;
+		}
 
 		/*
-		 * register knote with new process.
+		 * The same as knote(), activate the event.
 		 */
-		kev.ident = hint & NOTE_PDATAMASK;	/* pid */
+		if ((kn->kn_sfflags & NOTE_TRACK) == 0) {
+			kn->kn_status |= KN_HASKQLOCK;
+			if (kn->kn_fop->f_event(kn, NOTE_FORK | pid))
+				KNOTE_ACTIVATE(kn, 1);
+			kn->kn_status &= ~KN_HASKQLOCK;
+			KQ_UNLOCK(kq);
+			continue;
+		}
+
+		/*
+		 * The NOTE_TRACK case. In addition to the activation
+		 * of the event, we need to register new event to
+		 * track the child. Drop the locks in preparation for
+		 * the call to kqueue_register().
+		 */
+		kn->kn_status |= KN_INFLUX;
+		KQ_UNLOCK(kq);
+		list->kl_unlock(list->kl_lockarg);
+
+		/*
+		 * Activate existing knote and register a knote with
+		 * new process.
+		 */
+		kev.ident = pid;
 		kev.filter = kn->kn_filter;
 		kev.flags = kn->kn_flags | EV_ADD | EV_ENABLE | EV_FLAG1;
 		kev.fflags = kn->kn_sfflags;
-		kev.data = kn->kn_id;			/* parent */
-		kev.udata = kn->kn_kevent.udata;	/* preserve udata */
-		error = kqueue_register(kn->kn_kq, &kev, NULL, 0);
+		kev.data = kn->kn_id;		/* parent */
+		kev.udata = kn->kn_kevent.udata;/* preserve udata */
+		error = kqueue_register(kq, &kev, NULL, 0);
+		if (kn->kn_fop->f_event(kn, NOTE_FORK | pid))
+			KNOTE_ACTIVATE(kn, 0);
 		if (error)
 			kn->kn_fflags |= NOTE_TRACKERR;
+		KQ_LOCK(kq);
+		kn->kn_status &= ~KN_INFLUX;
+		KQ_UNLOCK_FLUX(kq);
+		list->kl_lock(list->kl_lockarg);
 	}
-
-	return (kn->kn_fflags != 0);
+	list->kl_unlock(list->kl_lockarg);
 }
 
 static int
@@ -1123,7 +1175,7 @@ kqueue_scan(struct kqueue *kq, int maxev
 	struct kevent *kevp;
 	struct timeval atv, rtv, ttv;
 	struct knote *kn, *marker;
-	int count, timeout, nkev, error;
+	int count, timeout, nkev, error, influx;
 	int haskqglobal;
 
 	count = maxevents;
@@ -1193,12 +1245,17 @@ start:
 	}
 
 	TAILQ_INSERT_TAIL(&kq->kq_head, marker, kn_tqe);
+	influx = 0;
 	while (count) {
 		KQ_OWNED(kq);
 		kn = TAILQ_FIRST(&kq->kq_head);
 
 		if ((kn->kn_status == KN_MARKER && kn != marker) ||
 		    (kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+			if (influx) {
+				influx = 0;
+				KQ_FLUX_WAKEUP(kq);
+			}
 			kq->kq_state |= KQ_FLUXWAIT;
 			error = msleep(kq, &kq->kq_lock, PSOCK,
 			    "kqflxwt", 0);
@@ -1248,6 +1305,7 @@ start:
 				    ~(KN_QUEUED | KN_ACTIVE | KN_INFLUX);
 				kq->kq_count--;
 				KN_LIST_UNLOCK(kn);
+				influx = 1;
 				continue;
 			}
 			*kevp = kn->kn_kevent;
@@ -1263,6 +1321,7 @@ start:
 			
 			kn->kn_status &= ~(KN_INFLUX);
 			KN_LIST_UNLOCK(kn);
+			influx = 1;
 		}
 
 		/* we are returning a copy to the user */
@@ -1271,6 +1330,7 @@ start:
 		count--;
 
 		if (nkev == KQ_NEVENTS) {
+			influx = 0;
 			KQ_UNLOCK_FLUX(kq);
 			error = k_ops->k_copyout(k_ops->arg, keva, nkev);
 			nkev = 0;
@@ -1434,8 +1494,11 @@ kqueue_close(struct file *fp, struct thr
 
 	for (i = 0; i < kq->kq_knlistsize; i++) {
 		while ((kn = SLIST_FIRST(&kq->kq_knlist[i])) != NULL) {
-			KASSERT((kn->kn_status & KN_INFLUX) == 0,
-			    ("KN_INFLUX set when not suppose to be"));
+			if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+				kq->kq_state |= KQ_FLUXWAIT;
+				msleep(kq, &kq->kq_lock, PSOCK, "kqclo1", 0);
+				continue;
+			}
 			kn->kn_status |= KN_INFLUX;
 			KQ_UNLOCK(kq);
 			if (!(kn->kn_status & KN_DETACHED))
@@ -1447,8 +1510,12 @@ kqueue_close(struct file *fp, struct thr
 	if (kq->kq_knhashmask != 0) {
 		for (i = 0; i <= kq->kq_knhashmask; i++) {
 			while ((kn = SLIST_FIRST(&kq->kq_knhash[i])) != NULL) {
-				KASSERT((kn->kn_status & KN_INFLUX) == 0,
-				    ("KN_INFLUX set when not suppose to be"));
+				if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) {
+					kq->kq_state |= KQ_FLUXWAIT;
+					msleep(kq, &kq->kq_lock, PSOCK,
+					       "kqclo2", 0);
+					continue;
+				}
 				kn->kn_status |= KN_INFLUX;
 				KQ_UNLOCK(kq);
 				if (!(kn->kn_status & KN_DETACHED))

Modified: stable/6/sys/kern/kern_exec.c
==============================================================================
--- stable/6/sys/kern/kern_exec.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ stable/6/sys/kern/kern_exec.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -104,6 +104,13 @@ u_long ps_arg_cache_limit = PAGE_SIZE / 
 SYSCTL_ULONG(_kern, OID_AUTO, ps_arg_cache_limit, CTLFLAG_RW, 
     &ps_arg_cache_limit, 0, "");
 
+SYSCTL_DECL(_security_bsd);
+
+static int map_at_zero = 1;
+TUNABLE_INT("security.bsd.map_at_zero", &map_at_zero);
+SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RW, &map_at_zero, 0,
+    "Permit processes to map an object at virtual address 0.");
+
 static int
 sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS)
 {
@@ -914,7 +921,7 @@ exec_new_vmspace(imgp, sv)
 	int error;
 	struct proc *p = imgp->proc;
 	struct vmspace *vmspace = p->p_vmspace;
-	vm_offset_t stack_addr;
+	vm_offset_t sv_minuser, stack_addr;
 	vm_map_t map;
 
 	imgp->vmspace_destroyed = 1;
@@ -928,14 +935,18 @@ exec_new_vmspace(imgp, sv)
 	 * not disrupted
 	 */
 	map = &vmspace->vm_map;
-	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv->sv_minuser &&
+	if (map_at_zero)
+		sv_minuser = sv->sv_minuser;
+	else
+		sv_minuser = MAX(sv->sv_minuser, PAGE_SIZE);
+	if (vmspace->vm_refcnt == 1 && vm_map_min(map) == sv_minuser &&
 	    vm_map_max(map) == sv->sv_maxuser) {
 		shmexit(vmspace);
 		pmap_remove_pages(vmspace_pmap(vmspace), vm_map_min(map),
 		    vm_map_max(map));
 		vm_map_remove(map, vm_map_min(map), vm_map_max(map));
 	} else {
-		vmspace_exec(p, sv->sv_minuser, sv->sv_maxuser);
+		vmspace_exec(p, sv_minuser, sv->sv_maxuser);
 		vmspace = p->p_vmspace;
 		map = &vmspace->vm_map;
 	}

Modified: stable/6/sys/kern/kern_fork.c
==============================================================================
--- stable/6/sys/kern/kern_fork.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ stable/6/sys/kern/kern_fork.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -699,14 +699,12 @@ again:
 	 */
 	PROC_LOCK(p1);
 	_PRELE(p1);
+	PROC_UNLOCK(p1);
 
 	/*
 	 * Tell any interested parties about the new process.
 	 */
-	KNOTE_LOCKED(&p1->p_klist, NOTE_FORK | p2->p_pid);
-
-	PROC_UNLOCK(p1);
-
+	knote_fork(&p1->p_klist, p2->p_pid);
 	/*
 	 * Preserve synchronization semantics of vfork.  If waiting for
 	 * child to exec or exit, set P_PPWAIT on child, and sleep on our

Modified: stable/6/sys/kern/sys_pipe.c
==============================================================================
--- stable/6/sys/kern/sys_pipe.c	Fri Oct  2 17:58:47 2009	(r197714)
+++ stable/6/sys/kern/sys_pipe.c	Fri Oct  2 18:09:56 2009	(r197715)
@@ -268,8 +268,8 @@ pipe_zone_ctor(void *mem, int size, void
 	 * one at a time.  When both are free'd, then the whole pair
 	 * is released.
 	 */
-	rpipe->pipe_present = 1;
-	wpipe->pipe_present = 1;
+	rpipe->pipe_present = PIPE_ACTIVE;
+	wpipe->pipe_present = PIPE_ACTIVE;
 
 	/*
 	 * Eventually, the MAC Framework may initialize the label
@@ -1003,7 +1003,8 @@ pipe_write(fp, uio, active_cred, flags, 
 	/*
 	 * detect loss of pipe read side, issue SIGPIPE if lost.
 	 */
-	if ((!wpipe->pipe_present) || (wpipe->pipe_state & PIPE_EOF)) {
+	if (wpipe->pipe_present != PIPE_ACTIVE ||
+	    (wpipe->pipe_state & PIPE_EOF)) {
 		pipeunlock(wpipe);
 		PIPE_UNLOCK(rpipe);
 		return (EPIPE);
@@ -1361,13 +1362,14 @@ pipe_poll(fp, events, active_cred, td)
 			revents |= events & (POLLIN | POLLRDNORM);
 
 	if (events & (POLLOUT | POLLWRNORM))
-		if (!wpipe->pipe_present || (wpipe->pipe_state & PIPE_EOF) ||
+		if (wpipe->pipe_present != PIPE_ACTIVE ||
+		    (wpipe->pipe_state & PIPE_EOF) ||
 		    (((wpipe->pipe_state & PIPE_DIRECTW) == 0) &&
 		     (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) >= PIPE_BUF))
 			revents |= events & (POLLOUT | POLLWRNORM);
 
 	if ((rpipe->pipe_state & PIPE_EOF) ||
-	    (!wpipe->pipe_present) ||
+	    wpipe->pipe_present != PIPE_ACTIVE ||
 	    (wpipe->pipe_state & PIPE_EOF))
 		revents |= POLLHUP;
 
@@ -1506,7 +1508,7 @@ pipeclose(cpipe)
 	 * Disconnect from peer, if any.
 	 */
 	ppipe = cpipe->pipe_peer;
-	if (ppipe->pipe_present != 0) {
+	if (ppipe->pipe_present == PIPE_ACTIVE) {
 		pipeselwakeup(ppipe);
 
 		ppipe->pipe_state |= PIPE_EOF;
@@ -1523,16 +1525,23 @@ pipeclose(cpipe)
 	PIPE_UNLOCK(cpipe);
 	pipe_free_kmem(cpipe);
 	PIPE_LOCK(cpipe);
-	cpipe->pipe_present = 0;
+	cpipe->pipe_present = PIPE_CLOSING;
 	pipeunlock(cpipe);
+
+	/*
+	 * knlist_clear() may sleep dropping the PIPE_MTX. Set the
+	 * PIPE_FINALIZED, that allows other end to free the
+	 * pipe_pair, only after the knotes are completely dismantled.
+	 */
 	knlist_clear(&cpipe->pipe_sel.si_note, 1);
+	cpipe->pipe_present = PIPE_FINALIZED;
 	knlist_destroy(&cpipe->pipe_sel.si_note);
 
 	/*
 	 * If both endpoints are now closed, release the memory for the
 	 * pipe pair.  If not, unlock.
 	 */
-	if (ppipe->pipe_present == 0) {
+	if (ppipe->pipe_present == PIPE_FINALIZED) {
 		PIPE_UNLOCK(cpipe);
 #ifdef MAC
 		mac_destroy_pipe(pp);
@@ -1556,7 +1565,7 @@ pipe_kqfilter(struct file *fp, struct kn
 		break;
 	case EVFILT_WRITE:
 		kn->kn_fop = &pipe_wfiltops;
-		if (!cpipe->pipe_peer->pipe_present) {
+		if (cpipe->pipe_peer->pipe_present != PIPE_ACTIVE) {
 			/* other end of pipe has been closed */
 			PIPE_UNLOCK(cpipe);
 			return (EPIPE);
@@ -1579,13 +1588,8 @@ filt_pipedetach(struct knote *kn)
 	struct pipe *cpipe = (struct pipe *)kn->kn_fp->f_data;
 
 	PIPE_LOCK(cpipe);
-	if (kn->kn_filter == EVFILT_WRITE) {
-		if (!cpipe->pipe_peer->pipe_present) {
-			PIPE_UNLOCK(cpipe);
-			return;
-		}
+	if (kn->kn_filter == EVFILT_WRITE)
 		cpipe = cpipe->pipe_peer;
-	}
 	knlist_remove(&cpipe->pipe_sel.si_note, kn, 1);
 	PIPE_UNLOCK(cpipe);
 }
@@ -1604,7 +1608,8 @@ filt_piperead(struct knote *kn, long hin
 		kn->kn_data = rpipe->pipe_map.cnt;
 
 	if ((rpipe->pipe_state & PIPE_EOF) ||
-	    (!wpipe->pipe_present) || (wpipe->pipe_state & PIPE_EOF)) {
+	    wpipe->pipe_present != PIPE_ACTIVE ||
+	    (wpipe->pipe_state & PIPE_EOF)) {
 		kn->kn_flags |= EV_EOF;
 		PIPE_UNLOCK(rpipe);
 		return (1);
@@ -1622,7 +1627,8 @@ filt_pipewrite(struct knote *kn, long hi
 	struct pipe *wpipe = rpipe->pipe_peer;
 
 	PIPE_LOCK(rpipe);
-	if ((!wpipe->pipe_present) || (wpipe->pipe_state & PIPE_EOF)) {
+	if (wpipe->pipe_present != PIPE_ACTIVE ||
+	    (wpipe->pipe_state & PIPE_EOF)) {
 		kn->kn_data = 0;
 		kn->kn_flags |= EV_EOF;
 		PIPE_UNLOCK(rpipe);

Modified: stable/6/sys/sys/event.h
==============================================================================
--- stable/6/sys/sys/event.h	Fri Oct  2 17:58:47 2009	(r197714)
+++ stable/6/sys/sys/event.h	Fri Oct  2 18:09:56 2009	(r197715)
@@ -208,6 +208,7 @@ struct proc;
 struct knlist;
 
 extern void	knote(struct knlist *list, long hint, int islocked);
+extern void	knote_fork(struct knlist *list, int pid);
 extern void	knlist_add(struct knlist *knl, struct knote *kn, int islocked);
 extern void	knlist_remove(struct knlist *knl, struct knote *kn, int islocked);
 extern void	knlist_remove_inevent(struct knlist *knl, struct knote *kn);

Modified: stable/6/sys/sys/pipe.h
==============================================================================
--- stable/6/sys/sys/pipe.h	Fri Oct  2 17:58:47 2009	(r197714)
+++ stable/6/sys/sys/pipe.h	Fri Oct  2 18:09:56 2009	(r197715)
@@ -115,6 +115,13 @@ struct pipe {
 };
 
 /*
+ * Values for the pipe_present.
+ */
+#define PIPE_ACTIVE		1
+#define	PIPE_CLOSING		2
+#define	PIPE_FINALIZED		3
+
+/*
  * Container structure to hold the two pipe endpoints, mutex, and label
  * pointer.
  */

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 18:13:19 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D1B510656A3;
	Fri,  2 Oct 2009 18:13:19 +0000 (UTC) (envelope-from simon@nitro.dk)
Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38])
	by mx1.freebsd.org (Postfix) with ESMTP id 382478FC28;
	Fri,  2 Oct 2009 18:13:19 +0000 (UTC)
Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3])
	by mx.nitro.dk (Postfix) with ESMTP id 3DBA92D4930;
	Fri,  2 Oct 2009 18:13:18 +0000 (UTC)
Received: by arthur.nitro.dk (Postfix, from userid 1000)
	id 25B9B5C0A; Fri,  2 Oct 2009 20:13:18 +0200 (CEST)
Date: Fri, 2 Oct 2009 20:13:18 +0200
From: "Simon L. Nielsen" 
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Message-ID: <20091002181317.GD1227@arthur.nitro.dk>
References: <200910021809.n92I9u1r009085@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200910021809.n92I9u1r009085@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: 
Subject: Re: svn commit: r197715 - releng/6.3 releng/6.3/sys/conf
 releng/6.3/sys/fs/devfs releng/6.3/sys/kern releng/6.3/sys/sys releng/6.4
 releng/6.4/sys/conf releng/6.4/sys/fs/devfs releng/6.4/sys/kern releng...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 18:13:19 -0000

On 2009.10.02 18:09:56 +0000, Simon L. Nielsen wrote:
> Author: simon
> Date: Fri Oct  2 18:09:56 2009
> New Revision: 197715
> URL: http://svn.freebsd.org/changeset/base/197715
> 
> Log:
>   MFC r197711 (partial) to 6.x and 7.x:
>   
>   - Add no zero mapping feature, disabled by default. [EN-09:05]
>   
>   MFC 178913,178914,179242,179243,180336,180340 to 6.x:
>   
>   - Fix kqueue pipe race conditions. [SA-09:13]
>   
>   MFC r192301 to 7.x; 6.x has slightly different fix:
>   
>   - Fix devfs / VFS NULL pointer race condition. [SA-09:14]
>   
>   Security:	FreeBSD-SA-09:13.pipe
>   Security:	FreeBSD-SA-09:14.devfs
>   Errata:		FreeBSD-EN-09:05.null
>   Submitted by:	kib [SA-09:13] [SA-09:14]
>   Submitted by:	bz [EN-09:05]
>   In collaboration with:	jhb, kib, alc [EN-09:05]
>   Approved by:	so (simon)

Just FYI, I plan to fix up the merge info for the stable/[67]
branches, but I probably won't get to it until Saturday or Sunday.

-- 
Simon L. Nielsen

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 18:33:41 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55DEC106566B;
	Fri,  2 Oct 2009 18:33:41 +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 42B1C8FC1E;
	Fri,  2 Oct 2009 18:33:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92IXfC5009683;
	Fri, 2 Oct 2009 18:33:41 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92IXfAb009681;
	Fri, 2 Oct 2009 18:33:41 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200910021833.n92IXfAb009681@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 2 Oct 2009 18:33: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: r197716 - in stable/8/sys: . amd64/include/xen
	cddl/contrib/opensolaris contrib/dev/acpica contrib/pf
	dev/xen/xenpci sparc64/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: Fri, 02 Oct 2009 18:33:41 -0000

Author: marius
Date: Fri Oct  2 18:33:40 2009
New Revision: 197716
URL: http://svn.freebsd.org/changeset/base/197716

Log:
  MFC: r197490
  
  Merge r194204 from amd64/i386:
  
  Enable PRINTF_BUFR_SIZE by default.
  
  PR:		139134
  Approved by:	re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/sparc64/conf/GENERIC

Modified: stable/8/sys/sparc64/conf/GENERIC
==============================================================================
--- stable/8/sys/sparc64/conf/GENERIC	Fri Oct  2 18:09:56 2009	(r197715)
+++ stable/8/sys/sparc64/conf/GENERIC	Fri Oct  2 18:33:40 2009	(r197716)
@@ -68,6 +68,7 @@ options 	SYSVMSG			# SYSV-style message 
 options 	SYSVSEM			# SYSV-style semaphores
 options 	P1003_1B_SEMAPHORES	# POSIX-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
+options 	PRINTF_BUFR_SIZE=128	# Prevent printf output being interspersed.
 options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
 options 	AUDIT			# Security event auditing
 options 	MAC			# TrustedBSD MAC Framework

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 20:10:29 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D3951065670;
	Fri,  2 Oct 2009 20:10:29 +0000 (UTC) (envelope-from simon@nitro.dk)
Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38])
	by mx1.freebsd.org (Postfix) with ESMTP id EC2978FC0C;
	Fri,  2 Oct 2009 20:10:28 +0000 (UTC)
Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3])
	by mx.nitro.dk (Postfix) with ESMTP id F2D882D4906;
	Fri,  2 Oct 2009 20:10:27 +0000 (UTC)
Received: by arthur.nitro.dk (Postfix, from userid 1000)
	id D3BBC5C0A; Fri,  2 Oct 2009 22:10:27 +0200 (CEST)
Date: Fri, 2 Oct 2009 22:10:27 +0200
From: "Simon L. Nielsen" 
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Message-ID: <20091002201027.GE1227@arthur.nitro.dk>
References: <200910021809.n92I9u1r009085@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200910021809.n92I9u1r009085@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: 
Subject: Re: svn commit: r197715 - releng/6.3 releng/6.3/sys/conf
 releng/6.3/sys/fs/devfs releng/6.3/sys/kern releng/6.3/sys/sys releng/6.4
 releng/6.4/sys/conf releng/6.4/sys/fs/devfs releng/6.4/sys/kern releng...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 20:10:29 -0000

On 2009.10.02 18:09:56 +0000, Simon L. Nielsen wrote:
> Author: simon
> Date: Fri Oct  2 18:09:56 2009
> New Revision: 197715
> URL: http://svn.freebsd.org/changeset/base/197715
> 
> Log:
>   MFC r197711 (partial) to 6.x and 7.x:
>   
>   - Add no zero mapping feature, disabled by default. [EN-09:05]
>   
>   MFC 178913,178914,179242,179243,180336,180340 to 6.x:
>   
>   - Fix kqueue pipe race conditions. [SA-09:13]
>   
>   MFC r192301 to 7.x; 6.x has slightly different fix:
>   
>   - Fix devfs / VFS NULL pointer race condition. [SA-09:14]
>   
>   Security:	FreeBSD-SA-09:13.pipe
>   Security:	FreeBSD-SA-09:14.devfs
>   Errata:		FreeBSD-EN-09:05.null
>   Submitted by:	kib [SA-09:13] [SA-09:14]
>   Submitted by:	bz [EN-09:05]
>   In collaboration with:	jhb, kib, alc [EN-09:05]
>   Approved by:	so (simon)

Oh, and I initially forgot:

Tested by:	pho

(and that was testing both reproducing the problems in the first place
and helping in testing that the patches actually closes the races
etc. - so thanks to pho as well as the other people mentioned above!
:-) )

-- 
Simon L. Nielsen

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 20:19:53 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B28671065695;
	Fri,  2 Oct 2009 20:19:53 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 97D518FC08;
	Fri,  2 Oct 2009 20:19:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92KJrr6012167;
	Fri, 2 Oct 2009 20:19:53 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92KJrRo012165;
	Fri, 2 Oct 2009 20:19:53 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200910022019.n92KJrRo012165@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 2 Oct 2009 20:19: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: r197719 - 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: Fri, 02 Oct 2009 20:19:53 -0000

Author: hrs
Date: Fri Oct  2 20:19:53 2009
New Revision: 197719
URL: http://svn.freebsd.org/changeset/base/197719

Log:
  - Enable an afexists() check only when no AF argument is specified.
  - Simplify helper functions.
  
  Discussed with:	ume

Modified:
  head/etc/rc.d/routing

Modified: head/etc/rc.d/routing
==============================================================================
--- head/etc/rc.d/routing	Fri Oct  2 20:15:47 2009	(r197718)
+++ head/etc/rc.d/routing	Fri Oct  2 20:19:53 2009	(r197719)
@@ -13,26 +13,80 @@
 . /etc/network.subr
 
 name="routing"
-start_cmd="routing_start"
+start_cmd="routing_start doall"
 stop_cmd="routing_stop"
 extra_commands="options static"
-static_cmd="static_start"
-options_cmd="options_start"
+static_cmd="routing_start static"
+options_cmd="routing_start options"
+
+afcheck()
+{
+	case $_af in
+	""|inet|inet6|ipx|atm)
+		;;
+	*)
+		err 1 "Unsupported address family: $_af."
+		;;
+	esac
+}
 
 routing_start()
 {
-	static_start "$@"
-	options_start "$@"
+	local _cmd _af _a
+	_cmd=$1
+	_af=$2
+
+	afcheck
+
+	case $_af in
+	inet|inet6|ipx|atm)
+		setroutes $_cmd $_af
+		;;
+	"")
+		for _a in inet inet6 ipx atm; do
+			afexists $_a && setroutes $_cmd $_a
+		done
+		;;
+	esac
+	[ -n "${_ropts_initdone}" ] && echo '.'
 }
 
 routing_stop()
 {
-	local _af
+	local _af _a
+	_af=$1
 
-	static_stop "$@"
-	for _af in inet inet6; do
-		afexists ${_af} && eval routing_stop_${_af}
-	done
+	afcheck
+
+	case $_af in
+	inet|inet6|ipx|atm)
+		eval static_${_af} delete
+		eval routing_stop_${_af}
+		;;
+	"")
+		for _a in inet inet6 ipx atm; do
+			afexists $_a || continue
+			eval static_${_a} delete
+			eval routing_stop_${_a}
+		done
+		;;
+	esac
+}
+
+setroutes()
+{
+	case $1 in
+	static)
+		static_$2 add
+		;;
+	options)
+		options_$2
+		;;
+	doall)
+		static_$2 add
+		options_$2
+		;;
+	esac
 }
 
 routing_stop_inet()
@@ -50,45 +104,14 @@ routing_stop_inet6()
 	done
 }
 
-static_start()
-{
-	local _af
-	_af=$1
-
-	case ${_af} in
-	inet|inet6|atm)
-		do_static add ${_af}
-		;;
-	"")
-		do_static add inet inet6 atm
-		;;
-	esac
-}
-
-static_stop()
+routing_stop_atm()
 {
-	local _af
-	_af=$1
-
-	case ${_af} in
-	inet|inet6|atm)
-		do_static delete ${_af}
-		;;
-	"")
-		do_static delete inet inet6 atm
-		;;
-	esac
+	return 0
 }
 
-do_static()
+routing_stop_ipx()
 {
-	local _af _action
-	_action=$1
-
-	shift
-	for _af in "$@"; do
-		afexists ${_af} && eval static_${_af} ${_action}
-	done
+	return 0
 }
 
 static_inet()
@@ -233,6 +256,10 @@ static_atm()
 	fi
 }
 
+static_ipx()
+{
+}
+
 _ropts_initdone=
 ropts_init()
 {
@@ -242,16 +269,6 @@ ropts_init()
 	fi
 }
 
-options_start()
-{
-	local _af
-
-	for _af in inet inet6 ipx; do
-		afexists ${_af} && eval options_${_af}
-	done
-	 [ -n "${_ropts_initdone}" ] && echo '.'
-}
-
 options_inet()
 {
 	if checkyesno icmp_bmcastecho; then
@@ -322,6 +339,10 @@ options_inet6()
 	fi
 }
 
+options_atm()
+{
+}
+
 options_ipx()
 {
 	if checkyesno ipxgateway_enable; then

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 20:31:15 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1EA4B10656AD;
	Fri,  2 Oct 2009 20:31:15 +0000 (UTC)
	(envelope-from oliver.pntr@gmail.com)
Received: from mail-yw0-f197.google.com (mail-yw0-f197.google.com
	[209.85.211.197])
	by mx1.freebsd.org (Postfix) with ESMTP id 6C6FA8FC2F;
	Fri,  2 Oct 2009 20:31:13 +0000 (UTC)
Received: by ywh35 with SMTP id 35so3485920ywh.7
	for ; Fri, 02 Oct 2009 13:31:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type;
	bh=JoLWKP8yoSMMZqE3PMsuPzB0lJHFtkmzw/LdV3NZDYY=;
	b=nbkOBpi/8XB6W7ktJ74so43/3xImqQh2vKPvue4aftS0VXaOB/sGQtnoZYuezCkiSL
	R2RQ92Luc1phI81tVCuwUwTsptUJ+LOtDLQLnP+MWPM0AJfPuEGvZUP43vl53IubkuCC
	oC2cD3d6BxVsqN4Zh1RhGO9QVG6swHsXwg1Ws=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=R/Ow23yP3ZWnym+/otd/B5QIVxgMEp+OaQe9IQEKIXHcz+yIPJXB1OQJ2wNHKncpMU
	GHA/qDJX86k2BKcUZ1Ag0UgfZZ4NQpIi9bFBJiHBBNQlo1C26gexJyjBeX1bsjc42/6O
	4Fx72skUSYuOb+dZ8rQeFTtc9nDETUF03p5cg=
MIME-Version: 1.0
Received: by 10.91.19.4 with SMTP id w4mr1670374agi.0.1254515472238; Fri, 02 
	Oct 2009 13:31:12 -0700 (PDT)
In-Reply-To: <20091002201027.GE1227@arthur.nitro.dk>
References: <200910021809.n92I9u1r009085@svn.freebsd.org>
	<20091002201027.GE1227@arthur.nitro.dk>
Date: Fri, 2 Oct 2009 22:31:11 +0200
Message-ID: <6101e8c40910021331g3747f4e1g2b7c2dbfe504712@mail.gmail.com>
From: Oliver Pinter 
To: "Simon L. Nielsen" 
Content-Type: text/plain; charset=ISO-8859-1
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r197715 - releng/6.3 releng/6.3/sys/conf 
	releng/6.3/sys/fs/devfs releng/6.3/sys/kern releng/6.3/sys/sys
	releng/6.4 
	releng/6.4/sys/conf releng/6.4/sys/fs/devfs releng/6.4/sys/kern
	releng...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 20:31:15 -0000

Hi!

And what's the status of these exploits fix:
http://hup.hu/cikkek/200909/freebsd_6.4_es_7.2_local_root_0day-ek

?

On 10/2/09, Simon L. Nielsen  wrote:
> On 2009.10.02 18:09:56 +0000, Simon L. Nielsen wrote:
>> Author: simon
>> Date: Fri Oct  2 18:09:56 2009
>> New Revision: 197715
>> URL: http://svn.freebsd.org/changeset/base/197715
>>
>> Log:
>>   MFC r197711 (partial) to 6.x and 7.x:
>>
>>   - Add no zero mapping feature, disabled by default. [EN-09:05]
>>
>>   MFC 178913,178914,179242,179243,180336,180340 to 6.x:
>>
>>   - Fix kqueue pipe race conditions. [SA-09:13]
>>
>>   MFC r192301 to 7.x; 6.x has slightly different fix:
>>
>>   - Fix devfs / VFS NULL pointer race condition. [SA-09:14]
>>
>>   Security:	FreeBSD-SA-09:13.pipe
>>   Security:	FreeBSD-SA-09:14.devfs
>>   Errata:		FreeBSD-EN-09:05.null
>>   Submitted by:	kib [SA-09:13] [SA-09:14]
>>   Submitted by:	bz [EN-09:05]
>>   In collaboration with:	jhb, kib, alc [EN-09:05]
>>   Approved by:	so (simon)
>
> Oh, and I initially forgot:
>
> Tested by:	pho
>
> (and that was testing both reproducing the problems in the first place
> and helping in testing that the patches actually closes the races
> etc. - so thanks to pho as well as the other people mentioned above!
> :-) )
>
> --
> Simon L. Nielsen
> _______________________________________________
> svn-src-stable@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-stable
> To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org"
>

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 20:41:37 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E7F401065694;
	Fri,  2 Oct 2009 20:41:37 +0000 (UTC)
	(envelope-from remko@elvandar.org)
Received: from websrv01.jr-hosting.nl (websrv01.jr-hosting.nl [78.47.69.233])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F0F18FC2E;
	Fri,  2 Oct 2009 20:41:37 +0000 (UTC)
Received: from a83-163-38-147.adsl.xs4all.nl ([83.163.38.147]
	helo=axantucar.elvandar.int)
	by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES128-SHA:128)
	(Exim 4.69 (FreeBSD)) (envelope-from )
	id 1Mtowa-0002uX-I9; Fri, 02 Oct 2009 22:41:36 +0200
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
From: Remko Lodder 
In-Reply-To: <6101e8c40910021331g3747f4e1g2b7c2dbfe504712@mail.gmail.com>
Date: Fri, 2 Oct 2009 22:41:35 +0200
Content-Transfer-Encoding: 7bit
Message-Id: 
References: <200910021809.n92I9u1r009085@svn.freebsd.org>
	<20091002201027.GE1227@arthur.nitro.dk>
	<6101e8c40910021331g3747f4e1g2b7c2dbfe504712@mail.gmail.com>
To: Oliver Pinter 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org,
	"Simon L. Nielsen" 
Subject: Re: svn commit: r197715 - releng/6.3 releng/6.3/sys/conf
	releng/6.3/sys/fs/devfs releng/6.3/sys/kern
	releng/6.3/sys/sys releng/6.4 releng/6.4/sys/conf
	releng/6.4/sys/fs/devfs releng/6.4/sys/kern releng...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 20:41:38 -0000


Please wait for the advisories to popup and see whether these match  
the question you have.

Thanks,
Remko

On Oct 2, 2009, at 10:31 PM, Oliver Pinter wrote:

> Hi!
>
> And what's the status of these exploits fix:
> http://hup.hu/cikkek/200909/freebsd_6.4_es_7.2_local_root_0day-ek
>
> ?
>
> On 10/2/09, Simon L. Nielsen  wrote:
>> On 2009.10.02 18:09:56 +0000, Simon L. Nielsen wrote:
>>> Author: simon
>>> Date: Fri Oct  2 18:09:56 2009
>>> New Revision: 197715
>>> URL: http://svn.freebsd.org/changeset/base/197715
>>>
>>> Log:
>>>  MFC r197711 (partial) to 6.x and 7.x:
>>>
>>>  - Add no zero mapping feature, disabled by default. [EN-09:05]
>>>
>>>  MFC 178913,178914,179242,179243,180336,180340 to 6.x:
>>>
>>>  - Fix kqueue pipe race conditions. [SA-09:13]
>>>
>>>  MFC r192301 to 7.x; 6.x has slightly different fix:
>>>
>>>  - Fix devfs / VFS NULL pointer race condition. [SA-09:14]
>>>
>>>  Security:	FreeBSD-SA-09:13.pipe
>>>  Security:	FreeBSD-SA-09:14.devfs
>>>  Errata:		FreeBSD-EN-09:05.null
>>>  Submitted by:	kib [SA-09:13] [SA-09:14]
>>>  Submitted by:	bz [EN-09:05]
>>>  In collaboration with:	jhb, kib, alc [EN-09:05]
>>>  Approved by:	so (simon)
>>
>> Oh, and I initially forgot:
>>
>> Tested by:	pho
>>
>> (and that was testing both reproducing the problems in the first  
>> place
>> and helping in testing that the patches actually closes the races
>> etc. - so thanks to pho as well as the other people mentioned above!
>> :-) )
>>
>> --
>> Simon L. Nielsen
>> _______________________________________________
>> svn-src-stable@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/svn-src-stable
>> To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org 
>> "
>>

-- 
/"\   Best regards,                        | remko@FreeBSD.org
\ /   Remko Lodder                      | remko@EFnet
X    http://www.evilcoder.org/    |
/ \   ASCII Ribbon Campaign    | Against HTML Mail and News


From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 20:44:46 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 33B731065695;
	Fri,  2 Oct 2009 20:44:46 +0000 (UTC)
	(envelope-from oliver.pntr@gmail.com)
Received: from mail-yw0-f197.google.com (mail-yw0-f197.google.com
	[209.85.211.197])
	by mx1.freebsd.org (Postfix) with ESMTP id 86C578FC22;
	Fri,  2 Oct 2009 20:44:45 +0000 (UTC)
Received: by ywh35 with SMTP id 35so3532720ywh.7
	for ; Fri, 02 Oct 2009 13:44:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type;
	bh=YzuUyBoI5a0DJCuuEputs1OMjwMQBpmeuCXFiSDIedQ=;
	b=ctlH1JYfKeVlm5RAAJLq0RNl4HQ5gV58D+fbbyRwAWXe3bWFtgn0KiSAd8AkyaKOyP
	6XPozhP+CCLSWo17IIaaoGr7pKle4Y76QZTkoQYbdr1Zse76pxghB0NF0v2zZuEXKsRh
	fVHhoWJSEhlhdQnssoOqm7uUj53/UCpvCr+98=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=x3oR+R1JsY8/yw19IPM9X/pXiWtXZVljrW2XrccK9k0xEmEHfbFyDKfAM7W2Ri7N06
	cJ/gb4zUfyNmExuHhW51KX0SE05ntUB0AH3YujN/eujDNJr4Sbn4fZTqR8wmmadzbht9
	oM/+LaT2eacOXiQR/vmNqTt4/sASoE+/aOVQY=
MIME-Version: 1.0
Received: by 10.91.21.25 with SMTP id y25mr1695285agi.66.1254516283237; Fri, 
	02 Oct 2009 13:44:43 -0700 (PDT)
In-Reply-To: 
References: <200910021809.n92I9u1r009085@svn.freebsd.org>
	<20091002201027.GE1227@arthur.nitro.dk>
	<6101e8c40910021331g3747f4e1g2b7c2dbfe504712@mail.gmail.com>
	
Date: Fri, 2 Oct 2009 22:44:43 +0200
Message-ID: <6101e8c40910021344s514ea9fdg24e1e391efbbf956@mail.gmail.com>
From: Oliver Pinter 
To: Remko Lodder 
Content-Type: text/plain; charset=ISO-8859-1
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org,
	"Simon L. Nielsen" 
Subject: Re: svn commit: r197715 - releng/6.3 releng/6.3/sys/conf 
	releng/6.3/sys/fs/devfs releng/6.3/sys/kern releng/6.3/sys/sys
	releng/6.4 
	releng/6.4/sys/conf releng/6.4/sys/fs/devfs releng/6.4/sys/kern
	releng...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 20:44:46 -0000

After I send the previous mail, see the advisories.

On 10/2/09, Remko Lodder  wrote:
>
> Please wait for the advisories to popup and see whether these match
> the question you have.
>
> Thanks,
> Remko
>
> On Oct 2, 2009, at 10:31 PM, Oliver Pinter wrote:
>
>> Hi!
>>
>> And what's the status of these exploits fix:
>> http://hup.hu/cikkek/200909/freebsd_6.4_es_7.2_local_root_0day-ek
>>
>> ?
>>
>> On 10/2/09, Simon L. Nielsen  wrote:
>>> On 2009.10.02 18:09:56 +0000, Simon L. Nielsen wrote:
>>>> Author: simon
>>>> Date: Fri Oct  2 18:09:56 2009
>>>> New Revision: 197715
>>>> URL: http://svn.freebsd.org/changeset/base/197715
>>>>
>>>> Log:
>>>>  MFC r197711 (partial) to 6.x and 7.x:
>>>>
>>>>  - Add no zero mapping feature, disabled by default. [EN-09:05]
>>>>
>>>>  MFC 178913,178914,179242,179243,180336,180340 to 6.x:
>>>>
>>>>  - Fix kqueue pipe race conditions. [SA-09:13]
>>>>
>>>>  MFC r192301 to 7.x; 6.x has slightly different fix:
>>>>
>>>>  - Fix devfs / VFS NULL pointer race condition. [SA-09:14]
>>>>
>>>>  Security:	FreeBSD-SA-09:13.pipe
>>>>  Security:	FreeBSD-SA-09:14.devfs
>>>>  Errata:		FreeBSD-EN-09:05.null
>>>>  Submitted by:	kib [SA-09:13] [SA-09:14]
>>>>  Submitted by:	bz [EN-09:05]
>>>>  In collaboration with:	jhb, kib, alc [EN-09:05]
>>>>  Approved by:	so (simon)
>>>
>>> Oh, and I initially forgot:
>>>
>>> Tested by:	pho
>>>
>>> (and that was testing both reproducing the problems in the first
>>> place
>>> and helping in testing that the patches actually closes the races
>>> etc. - so thanks to pho as well as the other people mentioned above!
>>> :-) )
>>>
>>> --
>>> Simon L. Nielsen
>>> _______________________________________________
>>> svn-src-stable@freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/svn-src-stable
>>> To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org
>>> "
>>>
>
> --
> /"\   Best regards,                        | remko@FreeBSD.org
> \ /   Remko Lodder                      | remko@EFnet
> X    http://www.evilcoder.org/    |
> / \   ASCII Ribbon Campaign    | Against HTML Mail and News
>
>

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 21:11:35 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 997D9106575E;
	Fri,  2 Oct 2009 21:11:35 +0000 (UTC)
	(envelope-from swell.k@gmail.com)
Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com
	[209.85.219.209])
	by mx1.freebsd.org (Postfix) with ESMTP id AA5BC8FC23;
	Fri,  2 Oct 2009 21:11:34 +0000 (UTC)
Received: by ewy5 with SMTP id 5so529469ewy.36
	for ; Fri, 02 Oct 2009 14:11:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:from:to:cc:subject:references
	:date:in-reply-to:message-id:user-agent:mime-version:content-type;
	bh=y8zf+QM0AMtBpxKDT1llDpw31IWaIq7aZPq+ePMXzOQ=;
	b=DuaQ5RNy7xRVqHsClttFrGiEKZ3Stmi6uZ/ptgqD+gZJFJgvSmDj2PIPJtRLva7XMR
	0ZgMY60zdprHpi8ND7B9pEhASVaJ1vug4BGvEdU0L0j0X+GcfHTY3rpL2MA1p0LPdM1n
	gc+K4B76hTizqZEpjs9PS8Z95dvip0qFvMQns=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type;
	b=YzUbw2jg8VVPRkwStf1oAj4+78cIvHduOoV3PGZkTuuHzpb8SU+h12F/3UNWhEM4Za
	KyYmphLLCusDNwgDESMMCW0OwU3rNcSZqGgWpXQaWzPf0lf9/QqavskIeRNRDO9PWTD5
	z3yBqKKGKWssMoiU8ICx131l+8QlODXOAoQKg=
Received: by 10.210.96.12 with SMTP id t12mr35072ebb.71.1254517893801;
	Fri, 02 Oct 2009 14:11:33 -0700 (PDT)
Received: from localhost (95-24-81-83.broadband.corbina.ru [95.24.81.83])
	by mx.google.com with ESMTPS id 5sm439788eyh.24.2009.10.02.14.11.32
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Fri, 02 Oct 2009 14:11:33 -0700 (PDT)
From: Anonymous 
To: Hiroki Sato 
References: <200910020227.n922RnBd086217__26713.9191426852$1254450512$gmane$org@svn.freebsd.org>
Date: Sat, 03 Oct 2009 01:10:15 +0400
In-Reply-To: <200910020227.n922RnBd086217__26713.9191426852$1254450512$gmane$org@svn.freebsd.org>
	(Hiroki Sato's message of "Fri, 2 Oct 2009 02:27:49 +0000 (UTC)")
Message-ID: <86tyyh4i4o.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix)
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: r197698 - 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: Fri, 02 Oct 2009 21:11:35 -0000

Hiroki Sato  writes:

> Modified: head/etc/rc.d/netoptions
[...]
>  
>  	if checkyesno tcp_extensions; then
> +		${SYSCTL_W} net.inet.tcp.rfc1323=1 >/dev/null
> +	else
>  		netoptions_init
> -		echo -n ' rfc1323 extensions=NO'
> +		echo -n ' rfc1323 extensions=${tcp_extensions}'
                                             ^^^^^^^^^^^^^^^^^
Here.

>  		${SYSCTL_W} net.inet.tcp.rfc1323=0 >/dev/null
>  	fi
>  
> -	if ! checkyesno tcp_keepalive; then
> +	if checkyesno tcp_keepalive; then
> +		${SYSCTL_W} net.inet.tcp.always_keepalive=1 >/dev/null
> +	else
>  		netoptions_init
> -		echo -n ' TCP keepalive=NO'
> +		echo -n ' TCP keepalive=${tcp_keepalive}'
                                        ^^^^^^^^^^^^^^^^
Here.

>  		${SYSCTL_W} net.inet.tcp.always_keepalive=0 >/dev/null
>  	fi
>  
>  	if checkyesno tcp_drop_synfin; then
>  		netoptions_init
> -		echo -n ' drop SYN+FIN packets=YES'
> +		echo -n ' drop SYN+FIN packets=${tcp_drop_synfin}'
                                               ^^^^^^^^^^^^^^^^^^
And here. These are *single* quotes, no parameter expansion can occur.
I keep getting following in `dmesg -a'

    Additional TCP/IP options:
     drop SYN+FIN packets=${tcp_drop_synfin}
    .

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 21:31:16 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 09366106568F;
	Fri,  2 Oct 2009 21:31:16 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ECFF98FC1D;
	Fri,  2 Oct 2009 21:31:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92LVFgJ014116;
	Fri, 2 Oct 2009 21:31:15 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92LVFXO014114;
	Fri, 2 Oct 2009 21:31:15 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200910022131.n92LVFXO014114@svn.freebsd.org>
From: Robert Watson 
Date: Fri, 2 Oct 2009 21: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: r197720 - 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, 02 Oct 2009 21:31:16 -0000

Author: rwatson
Date: Fri Oct  2 21:31:15 2009
New Revision: 197720
URL: http://svn.freebsd.org/changeset/base/197720

Log:
  Don't comment on stream socket handling in sosend_dgram, since that's
  not handled.
  
  MFC after:	3 weeks

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Fri Oct  2 20:19:53 2009	(r197719)
+++ head/sys/kern/uipc_socket.c	Fri Oct  2 21:31:15 2009	(r197720)
@@ -970,9 +970,6 @@ sosend_dgram(struct socket *so, struct s
 	 * must use a signed comparison of space and resid.  On the other
 	 * hand, a negative resid causes us to loop sending 0-length
 	 * segments to the protocol.
-	 *
-	 * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
-	 * type sockets since that's an error.
 	 */
 	if (resid < 0) {
 		error = EINVAL;

From owner-svn-src-all@FreeBSD.ORG  Fri Oct  2 22:30:45 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 53AA9106568F;
	Fri,  2 Oct 2009 22:30:45 +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 42A0B8FC19;
	Fri,  2 Oct 2009 22:30:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92MUjPP015623;
	Fri, 2 Oct 2009 22:30:45 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92MUjZR015619;
	Fri, 2 Oct 2009 22:30:45 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200910022230.n92MUjZR015619@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 2 Oct 2009 22:30: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: r197721 - head/sys/dev/uart
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 02 Oct 2009 22:30:45 -0000

Author: marcel
Date: Fri Oct  2 22:30:44 2009
New Revision: 197721
URL: http://svn.freebsd.org/changeset/base/197721

Log:
  Fix RTS/CTS flow control, broken by the TTY overhaul. The new TTY
  interface is fairly simple WRT dealing with flow control, but
  needed 2 new RX buffer functions with "get-char-from-buf" separated
  from "advance-buf-pointer" so that the pointer could be advanced
  only when ttydisc_rint() succeeded.
  
  MFC after:	1 week

Modified:
  head/sys/dev/uart/uart_bus.h
  head/sys/dev/uart/uart_core.c
  head/sys/dev/uart/uart_tty.c

Modified: head/sys/dev/uart/uart_bus.h
==============================================================================
--- head/sys/dev/uart/uart_bus.h	Fri Oct  2 21:31:15 2009	(r197720)
+++ head/sys/dev/uart/uart_bus.h	Fri Oct  2 22:30:44 2009	(r197721)
@@ -96,6 +96,7 @@ struct uart_softc {
 	int		sc_opened:1;	/* This UART is open for business. */
 	int		sc_polled:1;	/* This UART has no interrupts. */
 	int		sc_txbusy:1;	/* This UART is transmitting. */
+	int		sc_isquelch:1;	/* This UART has input squelched. */
 
 	struct uart_devinfo *sc_sysdev;	/* System device (or NULL). */
 
@@ -141,6 +142,8 @@ int uart_bus_ipend(device_t dev);
 int uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan);
 int uart_bus_sysdev(device_t dev);
 
+void uart_sched_softih(struct uart_softc *, uint32_t);
+
 int uart_tty_attach(struct uart_softc *);
 int uart_tty_detach(struct uart_softc *);
 void uart_tty_intr(void *arg);
@@ -175,6 +178,28 @@ uart_rx_get(struct uart_softc *sc)
 }
 
 static __inline int
+uart_rx_next(struct uart_softc *sc)
+{
+	int ptr;
+
+	ptr = sc->sc_rxget;
+	if (ptr == sc->sc_rxput)
+		return (-1);
+	ptr += 1;
+	sc->sc_rxget = (ptr < sc->sc_rxbufsz) ? ptr : 0;
+	return (0);
+}
+
+static __inline int
+uart_rx_peek(struct uart_softc *sc)
+{
+	int ptr;
+
+	ptr = sc->sc_rxget;
+	return ((ptr == sc->sc_rxput) ? -1 : sc->sc_rxbuf[ptr]);
+}
+
+static __inline int
 uart_rx_put(struct uart_softc *sc, int xc)
 {
 	int ptr;

Modified: head/sys/dev/uart/uart_core.c
==============================================================================
--- head/sys/dev/uart/uart_core.c	Fri Oct  2 21:31:15 2009	(r197720)
+++ head/sys/dev/uart/uart_core.c	Fri Oct  2 22:30:44 2009	(r197721)
@@ -91,7 +91,7 @@ uart_getrange(struct uart_class *uc)
  * Schedule a soft interrupt. We do this on the 0 to !0 transition
  * of the TTY pending interrupt status.
  */
-static void
+void
 uart_sched_softih(struct uart_softc *sc, uint32_t ipend)
 {
 	uint32_t new, old;

Modified: head/sys/dev/uart/uart_tty.c
==============================================================================
--- head/sys/dev/uart/uart_tty.c	Fri Oct  2 21:31:15 2009	(r197720)
+++ head/sys/dev/uart/uart_tty.c	Fri Oct  2 22:30:44 2009	(r197721)
@@ -166,27 +166,6 @@ uart_tty_outwakeup(struct tty *tp)
 	if (sc == NULL || sc->sc_leaving)
 		return;
 
-	/*
-	 * Handle input flow control. Note that if we have hardware support,
-	 * we don't do anything here. We continue to receive until our buffer
-	 * is full. At that time we cannot empty the UART itself and it will
-	 * de-assert RTS for us. In that situation we're completely stuffed.
-	 * Without hardware support, we need to toggle RTS ourselves.
-	 */
-	if ((tp->t_termios.c_cflag & CRTS_IFLOW) && !sc->sc_hwiflow) {
-#if 0
-		/*if ((tp->t_state & TS_TBLOCK) &&
-		    (sc->sc_hwsig & SER_RTS))
-			UART_SETSIG(sc, SER_DRTS);
-		else */ if (/*!(tp->t_state & TS_TBLOCK) &&*/
-		    !(sc->sc_hwsig & SER_RTS))
-			UART_SETSIG(sc, SER_DRTS|SER_RTS);
-#endif
-		/* XXX: we should use inwakeup to implement this! */
-		if (!(sc->sc_hwsig & SER_RTS))
-			UART_SETSIG(sc, SER_DRTS|SER_RTS);
-	}
-
 	if (sc->sc_txbusy)
 		return;
 
@@ -195,6 +174,23 @@ uart_tty_outwakeup(struct tty *tp)
 		UART_TRANSMIT(sc);
 }
 
+static void
+uart_tty_inwakeup(struct tty *tp)
+{
+	struct uart_softc *sc;
+
+	sc = tty_softc(tp);
+	if (sc == NULL || sc->sc_leaving)
+		return;
+
+	if (sc->sc_isquelch) {
+		if ((tp->t_termios.c_cflag & CRTS_IFLOW) && !sc->sc_hwiflow)
+			UART_SETSIG(sc, SER_DRTS|SER_RTS);
+		sc->sc_isquelch = 0;
+		uart_sched_softih(sc, SER_INT_RXREADY);
+	}
+}
+
 static int
 uart_tty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
 {
@@ -252,9 +248,9 @@ uart_tty_param(struct tty *tp, struct te
 	UART_SETSIG(sc, SER_DDTR | SER_DTR);
 	/* Set input flow control state. */
 	if (!sc->sc_hwiflow) {
-		/* if ((t->c_cflag & CRTS_IFLOW) && (tp->t_state & TS_TBLOCK))
+		if ((t->c_cflag & CRTS_IFLOW) && sc->sc_isquelch)
 			UART_SETSIG(sc, SER_DRTS);
-		else */
+		else
 			UART_SETSIG(sc, SER_DRTS | SER_RTS);
 	} else
 		UART_IOCTL(sc, UART_IOCTL_IFLOW, (t->c_cflag & CRTS_IFLOW));
@@ -294,8 +290,8 @@ uart_tty_intr(void *arg)
 	tty_lock(tp);
 
 	if (pend & SER_INT_RXREADY) {
-		while (!uart_rx_empty(sc) /* && !(tp->t_state & TS_TBLOCK)*/) {
-			xc = uart_rx_get(sc);
+		while (!uart_rx_empty(sc) && !sc->sc_isquelch) {
+			xc = uart_rx_peek(sc);
 			c = xc & 0xff;
 			if (xc & UART_STAT_FRAMERR)
 				err |= TRE_FRAMING;
@@ -303,7 +299,13 @@ uart_tty_intr(void *arg)
 				err |= TRE_OVERRUN;
 			if (xc & UART_STAT_PARERR)
 				err |= TRE_PARITY;
-			ttydisc_rint(tp, c, err);
+			if (ttydisc_rint(tp, c, err) != 0) {
+				sc->sc_isquelch = 1;
+				if ((tp->t_termios.c_cflag & CRTS_IFLOW) &&
+				    !sc->sc_hwiflow)
+					UART_SETSIG(sc, SER_DRTS);
+			} else
+				uart_rx_next(sc);
 		}
 	}
 
@@ -344,6 +346,7 @@ static struct ttydevsw uart_tty_class = 
 	.tsw_open	= uart_tty_open,
 	.tsw_close	= uart_tty_close,
 	.tsw_outwakeup	= uart_tty_outwakeup,
+	.tsw_inwakeup	= uart_tty_inwakeup,
 	.tsw_ioctl	= uart_tty_ioctl,
 	.tsw_param	= uart_tty_param,
 	.tsw_modem	= uart_tty_modem,

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 02:28:29 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0BFF8106566B;
	Sat,  3 Oct 2009 02:28:29 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EE9B78FC1A;
	Sat,  3 Oct 2009 02:28:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n932SSY8026602;
	Sat, 3 Oct 2009 02:28:28 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n932SSBs026599;
	Sat, 3 Oct 2009 02:28:28 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200910030228.n932SSBs026599@svn.freebsd.org>
From: Weongyo Jeong 
Date: Sat, 3 Oct 2009 02:28: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: r197724 - 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: Sat, 03 Oct 2009 02:28:29 -0000

Author: weongyo
Date: Sat Oct  3 02:28:28 2009
New Revision: 197724
URL: http://svn.freebsd.org/changeset/base/197724

Log:
  TRENDnet TEW-424UB has multiple revisions so clarify zyd(4) man page and
  adds a device to urtw(4).  The revision informations are as follows:
  
      rev A       ZD1211
      V2          SiS163U
      V2.1R       SiS163U
      V3.xR       RTL8187B
  
  and bump date.
  
  Obtained from:	OpenBSD
  Reported by:	Albert Shih 

Modified:
  head/share/man/man4/urtw.4
  head/share/man/man4/zyd.4

Modified: head/share/man/man4/urtw.4
==============================================================================
--- head/share/man/man4/urtw.4	Fri Oct  2 23:48:42 2009	(r197723)
+++ head/share/man/man4/urtw.4	Sat Oct  3 02:28:28 2009	(r197724)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 25, 2009
+.Dd October 2, 2009
 .Dt URTW 4
 .Os
 .Sh NAME
@@ -73,6 +73,7 @@ driver supports Realtek RTL8187B/L based
 .It "Netgear WG111v2	RTL8225	USB"
 .It "Safehome WLG-1500SMA5	RTL8225	USB"
 .It "Shuttle XPC Accessory PN20	RTL8225	USB"
+.It "TRENDnet TEW-424UB V3.xR	RTL8225	USB"
 .El
 .Sh EXAMPLES
 Join an existing BSS network (i.e., connect to an access point):

Modified: head/share/man/man4/zyd.4
==============================================================================
--- head/share/man/man4/zyd.4	Fri Oct  2 23:48:42 2009	(r197723)
+++ head/share/man/man4/zyd.4	Sat Oct  3 02:28:28 2009	(r197724)
@@ -32,7 +32,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 1, 2008
+.Dd October 2, 2009
 .Dt ZYD 4
 .Os
 .Sh NAME
@@ -113,7 +113,7 @@ driver:
 .It Sweex wireless USB 54 Mbps
 .It Tekram/Siemens USB adapter
 .It Telegent TG54USB
-.It Trendnet TEW-424UB
+.It Trendnet TEW-424UB rev A
 .It Trendnet TEW-429UB
 .It TwinMOS G240
 .It Unicorn WL-54G

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 02:37:22 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 71E58106566B;
	Sat,  3 Oct 2009 02:37:22 +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 46E228FC13;
	Sat,  3 Oct 2009 02:37:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n932bMIh026805;
	Sat, 3 Oct 2009 02:37:22 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n932bMnY026802;
	Sat, 3 Oct 2009 02:37:22 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <200910030237.n932bMnY026802@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 3 Oct 2009 02:37: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: r197725 - head/usr.bin/whois
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 03 Oct 2009 02:37:22 -0000

Author: dougb
Date: Sat Oct  3 02:37:21 2009
New Revision: 197725
URL: http://svn.freebsd.org/changeset/base/197725

Log:
  The 6bone was decommissioned on 6/6/06, so remove references to it.

Modified:
  head/usr.bin/whois/whois.1
  head/usr.bin/whois/whois.c

Modified: head/usr.bin/whois/whois.1
==============================================================================
--- head/usr.bin/whois/whois.1	Sat Oct  3 02:28:28 2009	(r197724)
+++ head/usr.bin/whois/whois.1	Sat Oct  3 02:37:21 2009	(r197725)
@@ -32,7 +32,7 @@
 .\"     From: @(#)whois.1	8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd January 23, 2006
+.Dd October 2, 2009
 .Dt WHOIS 1
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Nd "Internet domain name and network number directory service"
 .Sh SYNOPSIS
 .Nm
-.Op Fl aAbdfgiIklmQrR6
+.Op Fl aAbdfgiIklmQrR
 .Op Fl c Ar country-code | Fl h Ar host
 .Op Fl p Ar port
 .Ar name ...
@@ -212,17 +212,14 @@ This option is deprecated; use the
 option with an argument of
 .Qq Li RU
 instead.
-.It Fl 6
-Use the IPv6 Resource Center
-.Pq Tn 6bone
-database.
-It contains network names and addresses for the IPv6 network.
-.El
 .Pp
 The operands specified to
 .Nm
 are treated independently and may be used
 as queries on different whois servers.
+.El
+.Sh EXIT STATUS
+.Ex -std
 .Sh EXAMPLES
 Most types of data, such as domain names and
 .Tn IP
@@ -255,15 +252,6 @@ but other
 .Tn TLDs
 can be queried by using a similar syntax.)
 .Pp
-The following example demonstrates how to obtain information about an
-.Tn IPv6
-address or hostname using the
-.Fl 6
-option, which directs the query to
-.Tn 6bone .
-.Pp
-.Dl "whois -6 IPv6-IP-Address"
-.Pp
 The following example demonstrates how to query
 a whois server using a non-standard port, where
 .Dq Li query-data

Modified: head/usr.bin/whois/whois.c
==============================================================================
--- head/usr.bin/whois/whois.c	Sat Oct  3 02:28:28 2009	(r197724)
+++ head/usr.bin/whois/whois.c	Sat Oct  3 02:37:21 2009	(r197725)
@@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$");
 #define	PNICHOST	"whois.apnic.net"
 #define	MNICHOST	"whois.ra.net"
 #define	QNICHOST_TAIL	".whois-servers.net"
-#define	SNICHOST	"whois.6bone.net"
 #define	BNICHOST	"whois.registro.br"
 #define NORIDHOST	"whois.norid.no"
 #define	IANAHOST	"whois.iana.org"
@@ -164,8 +163,10 @@ main(int argc, char *argv[])
 			warnx("-R is deprecated; use '-c ru' instead");
 			country = "ru";
 			break;
+		/* Remove in FreeBSD 10 */
 		case '6':
-			host = SNICHOST;
+			errx(EX_USAGE,
+				"-6 is deprecated; use -[aAflr] instead");
 			break;
 		case '?':
 		default:

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 04:27:25 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C309A1065676;
	Sat,  3 Oct 2009 04:27:25 +0000 (UTC)
	(envelope-from tom@tomjudge.com)
Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk
	[80.68.91.100])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E88C8FC08;
	Sat,  3 Oct 2009 04:27:25 +0000 (UTC)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id A5612489D8;
	Sat,  3 Oct 2009 05:27:24 +0100 (BST)
X-Virus-Scanned: Debian amavisd-new at tomjudge.vm.bytemark.co.uk
Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1])
	by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id HTwKy5vqxGRu; Sat,  3 Oct 2009 05:27:14 +0100 (BST)
Received: from rita.nodomain (unknown [192.168.205.6])
	by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 787F5489D2;
	Sat,  3 Oct 2009 05:27:13 +0100 (BST)
Message-ID: <4AC6D283.2080706@tomjudge.com>
Date: Sat, 03 Oct 2009 04:26:43 +0000
From: Tom Judge 
User-Agent: Thunderbird 2.0.0.23 (X11/20090822)
MIME-Version: 1.0
References: <200910021110.n92BA5fu099181@svn.freebsd.org>
In-Reply-To: <200910021110.n92BA5fu099181@svn.freebsd.org>
Content-Type: multipart/mixed; boundary="------------070501040209090105000703"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r197704 - in head/sys/arm: arm xscale
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 03 Oct 2009 04:27:25 -0000

This is a multi-part message in MIME format.
--------------070501040209090105000703
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Rui,

This broke the arm i80219 build.

I hav attached a patch which fixes the build.

Tom

Rui Paulo wrote:
> Author: rpaulo
> Date: Fri Oct  2 11:10:05 2009
> New Revision: 197704
> URL: http://svn.freebsd.org/changeset/base/197704
>
> Log:
>   Remove performance counter headers. This code came from NetBSD, but our
>   hardware perf. counter support is different, so we don't need these
>   files.
>   
>   Reviewed by:	freebsd-arm (no comments)
>
> Deleted:
>   head/sys/arm/xscale/xscalereg.h
>   head/sys/arm/xscale/xscalevar.h
> Modified:
>   head/sys/arm/arm/cpufunc.c
>
>   


--------------070501040209090105000703
Content-Type: text/plain;
 name="perf.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="perf.patch"

SW5kZXg6IGFybS9jcHVmdW5jLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gYXJtL2NwdWZ1bmMuYwko
cmV2aXNpb24gMTk3NzI1KQorKysgYXJtL2NwdWZ1bmMuYwkod29ya2luZyBjb3B5KQpAQCAt
MTEzOSwxNyArMTEzOSw2IEBACiAJaWYgKGNwdXR5cGUgPT0gQ1BVX0lEXzgwMzIxXzQwMCB8
fCBjcHV0eXBlID09IENQVV9JRF84MDMyMV82MDAgfHwKIAkgICAgY3B1dHlwZSA9PSBDUFVf
SURfODAzMjFfNDAwX0IwIHx8IGNwdXR5cGUgPT0gQ1BVX0lEXzgwMzIxXzYwMF9CMCB8fAog
CSAgICBjcHV0eXBlID09IENQVV9JRF84MDIxOV80MDAgfHwgY3B1dHlwZSA9PSBDUFVfSURf
ODAyMTlfNjAwKSB7Ci0JCS8qCi0JCSAqIFJlc2V0IHRoZSBQZXJmb3JtYW5jZSBNb25pdG9y
aW5nIFVuaXQgdG8gYQotCQkgKiBwcmlzdGluZSBzdGF0ZToKLQkJICoJLSBDQ05ULCBQTU4w
LCBQTU4xIHJlc2V0IHRvIDAKLQkJICoJLSBvdmVyZmxvdyBpbmRpY2F0aW9ucyBjbGVhcmVk
Ci0JCSAqCS0gYWxsIGNvdW50ZXJzIGRpc2FibGVkCi0JCSAqLwotCQlfX2FzbSBfX3ZvbGF0
aWxlKCJtY3IgcDE0LCAwLCAlMCwgYzAsIGMwLCAwIgotCQkJOgotCQkJOiAiciIgKFBNTkNf
UHxQTU5DX0N8UE1OQ19QTU4wX0lGfFBNTkNfUE1OMV9JRnwKLQkJCSAgICAgICBQTU5DX0ND
X0lGKSk7CiAKIAkJY3B1ZnVuY3MgPSB4c2NhbGVfY3B1ZnVuY3M7CiAJCWNwdV9yZXNldF9u
ZWVkc192NF9NTVVfZGlzYWJsZSA9IDE7CS8qIFhTY2FsZSBuZWVkcyBpdCAqLwpJbmRleDog
eHNjYWxlL2k4MDMyMS9pODAzMjFfdGltZXIuYwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSB4c2NhbGUv
aTgwMzIxL2k4MDMyMV90aW1lci5jCShyZXZpc2lvbiAxOTc3MjUpCisrKyB4c2NhbGUvaTgw
MzIxL2k4MDMyMV90aW1lci5jCSh3b3JraW5nIGNvcHkpCkBAIC02Niw3ICs2Niw3IEBACiAJ
CQkgICAgICAgZGVmaW5pdGlvbnMgb3ZlcnJpZGVzIHRoZSBvbmVzIGZyb20gaTgwMzIxcmVn
LmgKIAkJCSAgICAgICAqLwogI2VuZGlmCi0jaW5jbHVkZSA8YXJtL3hzY2FsZS94c2NhbGV2
YXIuaD4KKy8vI2luY2x1ZGUgPGFybS94c2NhbGUveHNjYWxldmFyLmg+CiAKICNpbmNsdWRl
ICJvcHRfdGltZXIuaCIKIAo=
--------------070501040209090105000703--

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 10:50:01 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 222CC1065679;
	Sat,  3 Oct 2009 10:50: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 111FE8FC13;
	Sat,  3 Oct 2009 10:50:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n93Ao0us038514;
	Sat, 3 Oct 2009 10:50:00 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n93Ao0th038513;
	Sat, 3 Oct 2009 10:50:00 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200910031050.n93Ao0th038513@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 3 Oct 2009 10:50: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: r197726 - 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: Sat, 03 Oct 2009 10:50:01 -0000

Author: bz
Date: Sat Oct  3 10:50:00 2009
New Revision: 197726
URL: http://svn.freebsd.org/changeset/base/197726

Log:
  Print a warning in case we cannot add more brandinfo because
  we would overflow the MAX_BRANDS sized array.
  
  Reviewed by:	kib
  MFC After:	1 month

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Sat Oct  3 02:37:21 2009	(r197725)
+++ head/sys/kern/imgact_elf.c	Sat Oct  3 10:50:00 2009	(r197726)
@@ -180,8 +180,11 @@ __elfN(insert_brand_entry)(Elf_Brandinfo
 			break;
 		}
 	}
-	if (i == MAX_BRANDS)
+	if (i == MAX_BRANDS) {
+		printf("WARNING: %s: could not insert brandinfo entry: %p\n",
+			__func__, entry);
 		return (-1);
+	}
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 10:56:03 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F18B51065679;
	Sat,  3 Oct 2009 10:56: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 E0DCE8FC08;
	Sat,  3 Oct 2009 10:56:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n93Au3lQ038684;
	Sat, 3 Oct 2009 10:56:03 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n93Au3Zs038682;
	Sat, 3 Oct 2009 10:56:03 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200910031056.n93Au3Zs038682@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 3 Oct 2009 10:56: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: r197727 - 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: Sat, 03 Oct 2009 10:56:04 -0000

Author: bz
Date: Sat Oct  3 10:56:03 2009
New Revision: 197727
URL: http://svn.freebsd.org/changeset/base/197727

Log:
  Put #ifdef INET around parts of the FLOWTABLE code, to unbreak
  nooptions INET kernel builds.
  
  MFC after:	3 days
  X-MFC:		with r197687

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Sat Oct  3 10:50:00 2009	(r197726)
+++ head/sys/net/route.c	Sat Oct  3 10:56:03 2009	(r197727)
@@ -1162,6 +1162,7 @@ rtrequest1_fib(int req, struct rt_addrin
 		/* XXX
 		 * "flow-table" only support IPv4 at the moment.
 		 */
+#ifdef INET
 		if (dst->sa_family == AF_INET) {
 			rn = rnh->rnh_matchaddr(dst, rnh);
 			if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
@@ -1203,6 +1204,7 @@ rtrequest1_fib(int req, struct rt_addrin
 			}
 		}
 #endif
+#endif
 
 		/* XXX mtu manipulation will be done in rnh_addaddr -- itojun */
 		rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes);
@@ -1224,7 +1226,9 @@ rtrequest1_fib(int req, struct rt_addrin
 		} 
 #ifdef FLOWTABLE
 		else if (rt0 != NULL) {
+#ifdef INET
 			flowtable_route_flush(V_ip_ft, rt0);
+#endif
 			RTFREE(rt0);
 		}
 #endif

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 11:02:37 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2A217106566B;
	Sat,  3 Oct 2009 11:02:37 +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 18F978FC13;
	Sat,  3 Oct 2009 11:02:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n93B2ahJ038858;
	Sat, 3 Oct 2009 11:02:36 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n93B2arF038856;
	Sat, 3 Oct 2009 11:02:36 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910031102.n93B2arF038856@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 3 Oct 2009 11:02: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: r197728 - 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: Sat, 03 Oct 2009 11:02:37 -0000

Author: rpaulo
Date: Sat Oct  3 11:02:36 2009
New Revision: 197728
URL: http://svn.freebsd.org/changeset/base/197728

Log:
  Add OpenVPN IANA assigned port number.

Modified:
  head/etc/services

Modified: head/etc/services
==============================================================================
--- head/etc/services	Sat Oct  3 10:56:03 2009	(r197727)
+++ head/etc/services	Sat Oct  3 11:02:36 2009	(r197728)
@@ -1521,6 +1521,8 @@ nfa		1155/tcp   #Network File Access
 nfa		1155/udp   #Network File Access
 phone		1167/udp   #conference calling
 skkserv		1178/tcp   #SKK (kanji input)
+openvpn		1194/tcp   #OpenVPN
+openvpn		1194/udp   #OpenVPN
 lupa		1212/tcp
 lupa		1212/udp
 nerv		1222/tcp   #SNI R&D network

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 11:57:22 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39FDC1065672;
	Sat,  3 Oct 2009 11:57:22 +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 270368FC25;
	Sat,  3 Oct 2009 11:57:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n93BvLkh039975;
	Sat, 3 Oct 2009 11:57:21 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n93BvLhS039965;
	Sat, 3 Oct 2009 11:57:21 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200910031157.n93BvLhS039965@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 3 Oct 2009 11:57: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: r197729 - in head/sys: amd64/amd64 arm/arm compat/ia32
	i386/i386 ia64/ia64 mips/mips powerpc/powerpc sparc64/sparc64
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 03 Oct 2009 11:57:22 -0000

Author: bz
Date: Sat Oct  3 11:57:21 2009
New Revision: 197729
URL: http://svn.freebsd.org/changeset/base/197729

Log:
  Make sure that the primary native brandinfo always gets added
  first and the native ia32 compat as middle (before other things).
  o(ld)brandinfo as well as third party like linux, kfreebsd, etc.
  stays on SI_ORDER_ANY coming last.
  
  The reason for this is only to make sure that even in case we would
  overflow the MAX_BRANDS sized array, the native FreeBSD brandinfo
  would still be there and the system would be operational.
  
  Reviewed by:	kib
  MFC after:	1 month

Modified:
  head/sys/amd64/amd64/elf_machdep.c
  head/sys/arm/arm/elf_machdep.c
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/i386/i386/elf_machdep.c
  head/sys/ia64/ia64/elf_machdep.c
  head/sys/mips/mips/elf64_machdep.c
  head/sys/mips/mips/elf_machdep.c
  head/sys/powerpc/powerpc/elf_machdep.c
  head/sys/sparc64/sparc64/elf_machdep.c

Modified: head/sys/amd64/amd64/elf_machdep.c
==============================================================================
--- head/sys/amd64/amd64/elf_machdep.c	Sat Oct  3 11:02:36 2009	(r197728)
+++ head/sys/amd64/amd64/elf_machdep.c	Sat Oct  3 11:57:21 2009	(r197729)
@@ -89,7 +89,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
-SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
+SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST,
 	(sysinit_cfunc_t) elf64_insert_brand_entry,
 	&freebsd_brand_info);
 

Modified: head/sys/arm/arm/elf_machdep.c
==============================================================================
--- head/sys/arm/arm/elf_machdep.c	Sat Oct  3 11:02:36 2009	(r197728)
+++ head/sys/arm/arm/elf_machdep.c	Sat Oct  3 11:57:21 2009	(r197729)
@@ -88,7 +88,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
-SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
+SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST,
 	(sysinit_cfunc_t) elf32_insert_brand_entry,
 	&freebsd_brand_info);
 

Modified: head/sys/compat/ia32/ia32_sysvec.c
==============================================================================
--- head/sys/compat/ia32/ia32_sysvec.c	Sat Oct  3 11:02:36 2009	(r197728)
+++ head/sys/compat/ia32/ia32_sysvec.c	Sat Oct  3 11:57:21 2009	(r197729)
@@ -152,7 +152,7 @@ static Elf32_Brandinfo ia32_brand_info =
 	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
-SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_ANY,
+SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_MIDDLE,
 	(sysinit_cfunc_t) elf32_insert_brand_entry,
 	&ia32_brand_info);
 

Modified: head/sys/i386/i386/elf_machdep.c
==============================================================================
--- head/sys/i386/i386/elf_machdep.c	Sat Oct  3 11:02:36 2009	(r197728)
+++ head/sys/i386/i386/elf_machdep.c	Sat Oct  3 11:57:21 2009	(r197729)
@@ -88,7 +88,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
-SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
+SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST,
 	(sysinit_cfunc_t) elf32_insert_brand_entry,
 	&freebsd_brand_info);
 

Modified: head/sys/ia64/ia64/elf_machdep.c
==============================================================================
--- head/sys/ia64/ia64/elf_machdep.c	Sat Oct  3 11:02:36 2009	(r197728)
+++ head/sys/ia64/ia64/elf_machdep.c	Sat Oct  3 11:57:21 2009	(r197729)
@@ -95,7 +95,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.brand_note	= &elf64_freebsd_brandnote,
 	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
-SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
+SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST,
     (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info);
 
 static Elf64_Brandinfo freebsd_brand_oinfo = {

Modified: head/sys/mips/mips/elf64_machdep.c
==============================================================================
--- head/sys/mips/mips/elf64_machdep.c	Sat Oct  3 11:02:36 2009	(r197728)
+++ head/sys/mips/mips/elf64_machdep.c	Sat Oct  3 11:57:21 2009	(r197729)
@@ -108,7 +108,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.flags		= BI_BRAND_NOTE
 };
 
-SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
+SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST,
     (sysinit_cfunc_t) elf64_insert_brand_entry,
     &freebsd_brand_info64);
 

Modified: head/sys/mips/mips/elf_machdep.c
==============================================================================
--- head/sys/mips/mips/elf_machdep.c	Sat Oct  3 11:02:36 2009	(r197728)
+++ head/sys/mips/mips/elf_machdep.c	Sat Oct  3 11:57:21 2009	(r197729)
@@ -90,7 +90,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.flags		= BI_BRAND_NOTE
 };
 
-SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
+SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST,
     (sysinit_cfunc_t) elf32_insert_brand_entry,
     &freebsd_brand_info);
 

Modified: head/sys/powerpc/powerpc/elf_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/elf_machdep.c	Sat Oct  3 11:02:36 2009	(r197728)
+++ head/sys/powerpc/powerpc/elf_machdep.c	Sat Oct  3 11:57:21 2009	(r197729)
@@ -91,7 +91,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
-SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
+SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST,
     (sysinit_cfunc_t) elf32_insert_brand_entry,
     &freebsd_brand_info);
 

Modified: head/sys/sparc64/sparc64/elf_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/elf_machdep.c	Sat Oct  3 11:02:36 2009	(r197728)
+++ head/sys/sparc64/sparc64/elf_machdep.c	Sat Oct  3 11:57:21 2009	(r197729)
@@ -103,7 +103,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
-SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
+SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST,
     (sysinit_cfunc_t) elf64_insert_brand_entry,
     &freebsd_brand_info);
 

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 12:22:13 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E14A106568B;
	Sat,  3 Oct 2009 12:22:13 +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 4236D8FC0C;
	Sat,  3 Oct 2009 12:22:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n93CMDbC040561;
	Sat, 3 Oct 2009 12:22:13 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n93CMDnp040558;
	Sat, 3 Oct 2009 12:22:13 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200910031222.n93CMDnp040558@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Sat, 3 Oct 2009 12:22: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: r197730 - in head/sys: modules/nfslockd nlm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 03 Oct 2009 12:22:13 -0000

Author: nyan
Date: Sat Oct  3 12:22:12 2009
New Revision: 197730
URL: http://svn.freebsd.org/changeset/base/197730

Log:
  unifdef NFSCLIENT because the nlm depends on the nfsclient even if NFSCLIENT
  is not defined.
  
  Now the nfslockd module works with the nfsclient module.
  
  Reviewed by:	kib
  MFC after:	3 days

Modified:
  head/sys/modules/nfslockd/Makefile
  head/sys/nlm/nlm_prot_impl.c

Modified: head/sys/modules/nfslockd/Makefile
==============================================================================
--- head/sys/modules/nfslockd/Makefile	Sat Oct  3 11:57:21 2009	(r197729)
+++ head/sys/modules/nfslockd/Makefile	Sat Oct  3 12:22:12 2009	(r197730)
@@ -14,18 +14,12 @@ SRCS+=	opt_inet6.h opt_nfs.h
 
 .if !defined(KERNBUILDDIR)
 NFS_INET6?=	1	# 0/1 - requires INET6 to be configured in kernel
-NFSCLIENT?=	1	# 0/1 - requires NFSCLIENT to be configured in kernel
 
 .if ${NFS_INET6} > 0
 opt_inet6.h:
 	echo "#define INET6 1" > ${.TARGET}
 .endif
 
-.if ${NFSCLIENT} > 0
-opt_nfs.h:
-	echo "#define NFSCLIENT 1" > ${.TARGET}
-.endif
-
 .endif
 
 .include 

Modified: head/sys/nlm/nlm_prot_impl.c
==============================================================================
--- head/sys/nlm/nlm_prot_impl.c	Sat Oct  3 11:57:21 2009	(r197729)
+++ head/sys/nlm/nlm_prot_impl.c	Sat Oct  3 12:22:12 2009	(r197730)
@@ -26,7 +26,6 @@
  */
 
 #include "opt_inet6.h"
-#include "opt_nfs.h"
 
 #include 
 __FBSDID("$FreeBSD$");
@@ -671,8 +670,6 @@ nlm_host_destroy(struct nlm_host *host)
 	free(host, M_NLM);
 }
 
-#ifdef NFSCLIENT
-
 /*
  * Thread start callback for client lock recovery
  */
@@ -695,8 +692,6 @@ nlm_client_recovery_start(void *arg)
 	kthread_exit();
 }
 
-#endif
-
 /*
  * This is called when we receive a host state change notification. We
  * unlock any active locks owned by the host. When rpc.lockd is
@@ -735,7 +730,6 @@ nlm_host_notify(struct nlm_host *host, i
 	lf_clearremotesys(host->nh_sysid);
 	host->nh_state = newstate;
 
-#ifdef NFSCLIENT
 	/*
 	 * If we have any remote locks for this host (i.e. it
 	 * represents a remote NFS server that our local NFS client
@@ -750,7 +744,6 @@ nlm_host_notify(struct nlm_host *host, i
 		kthread_add(nlm_client_recovery_start, host, curproc, &td, 0, 0,
 		    "NFS lock recovery for %s", host->nh_caller_name);
 	}
-#endif
 }
 
 /*
@@ -1479,10 +1472,8 @@ nlm_server_main(int addr_count, char **a
 	enum clnt_stat stat;
 	struct nlm_host *host, *nhost;
 	struct nlm_waiting_lock *nw;
-#ifdef NFSCLIENT
 	vop_advlock_t *old_nfs_advlock;
 	vop_reclaim_t *old_nfs_reclaim;
-#endif
 	int v4_used;
 #ifdef INET6
 	int v6_used;
@@ -1583,20 +1574,16 @@ nlm_server_main(int addr_count, char **a
 	NLM_DEBUG(1, "NLM: local NSM state is %d\n", smstat.state);
 	nlm_nsm_state = smstat.state;
 
-#ifdef NFSCLIENT
 	old_nfs_advlock = nfs_advlock_p;
 	nfs_advlock_p = nlm_advlock;
 	old_nfs_reclaim = nfs_reclaim_p;
 	nfs_reclaim_p = nlm_reclaim;
-#endif
 
 	svc_run(pool);
 	error = 0;
 
-#ifdef NFSCLIENT
 	nfs_advlock_p = old_nfs_advlock;
 	nfs_reclaim_p = old_nfs_reclaim;
-#endif
 
 out:
 	if (pool)

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 13:59:15 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D9DFF1065679;
	Sat,  3 Oct 2009 13:59:15 +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 AF00E8FC16;
	Sat,  3 Oct 2009 13:59:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n93DxFSW042596;
	Sat, 3 Oct 2009 13:59:15 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n93DxFtm042595;
	Sat, 3 Oct 2009 13:59:15 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910031359.n93DxFtm042595@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 3 Oct 2009 13: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: r197733 - in head/sys/arm: arm xscale/i80321
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 03 Oct 2009 13:59:15 -0000

Author: rpaulo
Date: Sat Oct  3 13:59:15 2009
New Revision: 197733
URL: http://svn.freebsd.org/changeset/base/197733

Log:
  Remove remaining bits of performance counter support.
  
  Submitted by:	Tom Judge 

Modified:
  head/sys/arm/arm/cpufunc.c
  head/sys/arm/xscale/i80321/i80321_timer.c

Modified: head/sys/arm/arm/cpufunc.c
==============================================================================
--- head/sys/arm/arm/cpufunc.c	Sat Oct  3 13:17:21 2009	(r197732)
+++ head/sys/arm/arm/cpufunc.c	Sat Oct  3 13:59:15 2009	(r197733)
@@ -1088,18 +1088,6 @@ set_cpufuncs()
 
 		i80200_icu_init();
 
-		/*
-		 * Reset the Performance Monitoring Unit to a
-		 * pristine state:
-		 *	- CCNT, PMN0, PMN1 reset to 0
-		 *	- overflow indications cleared
-		 *	- all counters disabled
-		 */
-		__asm __volatile("mcr p14, 0, %0, c0, c0, 0"
-			:
-			: "r" (PMNC_P|PMNC_C|PMNC_PMN0_IF|PMNC_PMN1_IF|
-			       PMNC_CC_IF));
-
 #if defined(XSCALE_CCLKCFG)
 		/*
 		 * Crank CCLKCFG to maximum legal value.
@@ -1139,18 +1127,6 @@ set_cpufuncs()
 	if (cputype == CPU_ID_80321_400 || cputype == CPU_ID_80321_600 ||
 	    cputype == CPU_ID_80321_400_B0 || cputype == CPU_ID_80321_600_B0 ||
 	    cputype == CPU_ID_80219_400 || cputype == CPU_ID_80219_600) {
-		/*
-		 * Reset the Performance Monitoring Unit to a
-		 * pristine state:
-		 *	- CCNT, PMN0, PMN1 reset to 0
-		 *	- overflow indications cleared
-		 *	- all counters disabled
-		 */
-		__asm __volatile("mcr p14, 0, %0, c0, c0, 0"
-			:
-			: "r" (PMNC_P|PMNC_C|PMNC_PMN0_IF|PMNC_PMN1_IF|
-			       PMNC_CC_IF));
-
 		cpufuncs = xscale_cpufuncs;
 		cpu_reset_needs_v4_MMU_disable = 1;	/* XScale needs it */
 		get_cachetype_cp15();

Modified: head/sys/arm/xscale/i80321/i80321_timer.c
==============================================================================
--- head/sys/arm/xscale/i80321/i80321_timer.c	Sat Oct  3 13:17:21 2009	(r197732)
+++ head/sys/arm/xscale/i80321/i80321_timer.c	Sat Oct  3 13:59:15 2009	(r197733)
@@ -66,8 +66,6 @@ __FBSDID("$FreeBSD$");
 			       definitions overrides the ones from i80321reg.h
 			       */
 #endif
-#include 
-
 #include "opt_timer.h"
 
 void (*i80321_hardclock_hook)(void) = NULL;

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 13:59:25 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5CC0B10656F6;
	Sat,  3 Oct 2009 13:59:24 +0000 (UTC)
	(envelope-from rpaulo@gmail.com)
Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com
	[209.85.219.209])
	by mx1.freebsd.org (Postfix) with ESMTP id DE71E8FC13;
	Sat,  3 Oct 2009 13:59:23 +0000 (UTC)
Received: by ewy5 with SMTP id 5so934761ewy.36
	for ; Sat, 03 Oct 2009 06:59:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:subject:mime-version
	:content-type:from:in-reply-to:date:cc:content-transfer-encoding
	:message-id:references:to:x-mailer;
	bh=pdppisOrDsR7wiyxtfNCJe0i8NMZKXLJnnMuCqDPmLU=;
	b=b1NqfM1jxSPQI2xP/sRQA37Lu7JV22Q+/XQK1rdvPCtaU77XH3c2FoYfSlh/gcb2/z
	5H4vLFfmyDckI1DfMK9J9y/YDdfe+X7fy8xcvsgQR7mksqtq5TbO+eT3LtE5Wh4FOeWm
	zXM1zpMixnc8o/Qs+5Uueiugm3dKjRSHjvcnE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=A/05ZrloJ25tEhrs3HYdVEkh2UcJtfgJvO8h9aAK4iGXJwi9gWAm1hUq7dHc8AZkNd
	GQ85PI1D1H6MY+jq9jblHrLa4YWemZR5qjrL1cq7FLhb7OkeDvjaZt/uN5rmhyof4OS5
	rSnoEn5g0/efQEf+jAAn+O34XRphnEDIM+Lfc=
Received: by 10.211.146.2 with SMTP id y2mr1009296ebn.21.1254578362985;
	Sat, 03 Oct 2009 06:59:22 -0700 (PDT)
Received: from mac-mini.lan (bl6-144-180.dsl.telepac.pt [82.155.144.180])
	by mx.google.com with ESMTPS id 10sm220392eyz.10.2009.10.03.06.59.21
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Sat, 03 Oct 2009 06:59:21 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
From: Rui Paulo 
In-Reply-To: <4AC6D283.2080706@tomjudge.com>
Date: Sat, 3 Oct 2009 14:59:20 +0100
Content-Transfer-Encoding: 7bit
Message-Id: 
References: <200910021110.n92BA5fu099181@svn.freebsd.org>
	<4AC6D283.2080706@tomjudge.com>
To: Tom Judge 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r197704 - in head/sys/arm: arm xscale
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 03 Oct 2009 13:59:25 -0000

Fixed, thanks.

On 3 Oct 2009, at 05:26, Tom Judge wrote:

> Hi Rui,
>
> This broke the arm i80219 build.
>
> I hav attached a patch which fixes the build.
>
> Tom
>
> Rui Paulo wrote:
>> Author: rpaulo
>> Date: Fri Oct  2 11:10:05 2009
>> New Revision: 197704
>> URL: http://svn.freebsd.org/changeset/base/197704
>>
>> Log:
>>  Remove performance counter headers. This code came from NetBSD,  
>> but our
>>  hardware perf. counter support is different, so we don't need these
>>  files.
>>    Reviewed by:	freebsd-arm (no comments)
>>
>> Deleted:
>>  head/sys/arm/xscale/xscalereg.h
>>  head/sys/arm/xscale/xscalevar.h
>> Modified:
>>  head/sys/arm/arm/cpufunc.c
>>
>>
>
> Index: arm/cpufunc.c
> ===================================================================
> --- arm/cpufunc.c	(revision 197725)
> +++ arm/cpufunc.c	(working copy)
> @@ -1139,17 +1139,6 @@
> 	if (cputype == CPU_ID_80321_400 || cputype == CPU_ID_80321_600 ||
> 	    cputype == CPU_ID_80321_400_B0 || cputype ==  
> CPU_ID_80321_600_B0 ||
> 	    cputype == CPU_ID_80219_400 || cputype == CPU_ID_80219_600) {
> -		/*
> -		 * Reset the Performance Monitoring Unit to a
> -		 * pristine state:
> -		 *	- CCNT, PMN0, PMN1 reset to 0
> -		 *	- overflow indications cleared
> -		 *	- all counters disabled
> -		 */
> -		__asm __volatile("mcr p14, 0, %0, c0, c0, 0"
> -			:
> -			: "r" (PMNC_P|PMNC_C|PMNC_PMN0_IF|PMNC_PMN1_IF|
> -			       PMNC_CC_IF));
>
> 		cpufuncs = xscale_cpufuncs;
> 		cpu_reset_needs_v4_MMU_disable = 1;	/* XScale needs it */
> Index: xscale/i80321/i80321_timer.c
> ===================================================================
> --- xscale/i80321/i80321_timer.c	(revision 197725)
> +++ xscale/i80321/i80321_timer.c	(working copy)
> @@ -66,7 +66,7 @@
> 			       definitions overrides the ones from i80321reg.h
> 			       */
> #endif
> -#include 
> +//#include 
>
> #include "opt_timer.h"
>

--
Rui Paulo




From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 14:38:22 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A5C401065670;
	Sat,  3 Oct 2009 14:38:22 +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 921218FC18;
	Sat,  3 Oct 2009 14:38:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n93EcMCu043462;
	Sat, 3 Oct 2009 14:38:22 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n93EcMFE043460;
	Sat, 3 Oct 2009 14:38:22 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200910031438.n93EcMFE043460@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Sat, 3 Oct 2009 14: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: r197734 - in stable/8/sys: . amd64/include/xen
	cddl/contrib/opensolaris contrib/dev/acpica contrib/pf
	dev/xen/xenpci 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: Sat, 03 Oct 2009 14:38:22 -0000

Author: nyan
Date: Sat Oct  3 14:38:22 2009
New Revision: 197734
URL: http://svn.freebsd.org/changeset/base/197734

Log:
  MFC: revision 197657
  
    MFi386: revision 197653
  
      Improve 802.11s comment.
  
  Approved by:	re (bz)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/pc98/conf/GENERIC

Modified: stable/8/sys/pc98/conf/GENERIC
==============================================================================
--- stable/8/sys/pc98/conf/GENERIC	Sat Oct  3 13:59:15 2009	(r197733)
+++ stable/8/sys/pc98/conf/GENERIC	Sat Oct  3 14:38:22 2009	(r197734)
@@ -214,7 +214,7 @@ device		xe		# Xircom pccard Ethernet
 #device		wlan		# 802.11 support
 #options 	IEEE80211_DEBUG	# enable debug msgs
 #options 	IEEE80211_AMPDU_AGE	# age frames in AMPDU reorder q's
-#options 	IEEE80211_SUPPORT_MESH	# enable 802.11s D3.0 support
+#options 	IEEE80211_SUPPORT_MESH	# enable 802.11s draft support
 #device		wlan_wep	# 802.11 WEP support
 #device		wlan_ccmp	# 802.11 CCMP support
 #device		wlan_tkip	# 802.11 TKIP support

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 15:02:55 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 56A4B1065693;
	Sat,  3 Oct 2009 15:02:55 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 457E18FC08;
	Sat,  3 Oct 2009 15:02:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n93F2thT043969;
	Sat, 3 Oct 2009 15:02:55 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n93F2tOp043967;
	Sat, 3 Oct 2009 15:02:55 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200910031502.n93F2tOp043967@svn.freebsd.org>
From: Attilio Rao 
Date: Sat, 3 Oct 2009 15:02: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: r197735 - 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: Sat, 03 Oct 2009 15:02:55 -0000

Author: attilio
Date: Sat Oct  3 15:02:55 2009
New Revision: 197735
URL: http://svn.freebsd.org/changeset/base/197735

Log:
  When releasing a lockmgr held in shared way we need to use a write memory
  barrier in order to avoid, on architectures which doesn't have strong
  ordered writes, CPU instructions reordering.
  
  Diagnosed by:	fabio

Modified:
  head/sys/kern/kern_lock.c

Modified: head/sys/kern/kern_lock.c
==============================================================================
--- head/sys/kern/kern_lock.c	Sat Oct  3 14:38:22 2009	(r197734)
+++ head/sys/kern/kern_lock.c	Sat Oct  3 15:02:55 2009	(r197735)
@@ -241,7 +241,7 @@ wakeupshlk(struct lock *lk, const char *
 		 * and return.
 		 */
 		if (LK_SHARERS(x) > 1) {
-			if (atomic_cmpset_ptr(&lk->lk_lock, x,
+			if (atomic_cmpset_rel_ptr(&lk->lk_lock, x,
 			    x - LK_ONE_SHARER))
 				break;
 			continue;
@@ -254,7 +254,7 @@ wakeupshlk(struct lock *lk, const char *
 		if ((x & LK_ALL_WAITERS) == 0) {
 			MPASS((x & ~LK_EXCLUSIVE_SPINNERS) ==
 			    LK_SHARERS_LOCK(1));
-			if (atomic_cmpset_ptr(&lk->lk_lock, x, LK_UNLOCKED))
+			if (atomic_cmpset_rel_ptr(&lk->lk_lock, x, LK_UNLOCKED))
 				break;
 			continue;
 		}
@@ -280,7 +280,7 @@ wakeupshlk(struct lock *lk, const char *
 			queue = SQ_SHARED_QUEUE;
 		}
 
-		if (!atomic_cmpset_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x,
+		if (!atomic_cmpset_rel_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x,
 		    v)) {
 			sleepq_release(&lk->lock_object);
 			continue;

From owner-svn-src-all@FreeBSD.ORG  Sat Oct  3 16:13:57 2009
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 21A4A106568B;
	Sat,  3 Oct 2009 16:13:57 +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 0F5058FC0C;
	Sat,  3 Oct 2009 16:13:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n93GDuc0045408;
	Sat, 3 Oct 2009 16:13:56 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n93GDucb045406;
	Sat, 3 Oct 2009 16:13:56 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910031613.n93GDucb045406@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 3 Oct 2009 16:13:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r197736 - stable/6/lib/libthread_db/arch/alpha
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 03 Oct 2009 16:13:57 -0000

Author: nwhitehorn
Date: Sat Oct  3 16:13:56 2009
New Revision: 197736
URL: http://svn.freebsd.org/changeset/base/197736

Log:
  Fix world build on alpha, by adding an include now required but only added
  on other platforms.
  
  Note: this is not an MFC due to removal of alpha support in head.

Modified:
  stable/6/lib/libthread_db/arch/alpha/libpthread_md.c

Modified: stable/6/lib/libthread_db/arch/alpha/libpthread_md.c
==============================================================================
--- stable/6/lib/libthread_db/arch/alpha/libpthread_md.c	Sat Oct  3 15:02:55 2009	(r197735)
+++ stable/6/lib/libthread_db/arch/alpha/libpthread_md.c	Sat Oct  3 16:13:56 2009	(r197736)
@@ -28,6 +28,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 
 #include "libpthread_db.h"