From owner-svn-src-stable-9@freebsd.org Sun Dec 20 00:45:36 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A2D4A148E2; Sun, 20 Dec 2015 00:45:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1945A137D; Sun, 20 Dec 2015 00:45:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBK0jZd0016464; Sun, 20 Dec 2015 00:45:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK0jZnr016463; Sun, 20 Dec 2015 00:45:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200045.tBK0jZnr016463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 00:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292482 - stable/9/lib/libc/regex/grot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 00:45:36 -0000 Author: ngie Date: Sun Dec 20 00:45:34 2015 New Revision: 292482 URL: https://svnweb.freebsd.org/changeset/base/292482 Log: MFstable/10 r292481: MFC r292153: Add -static to CFLAGS to unbreak the tests by using a libc.a with the xlocale private symbols exposed which aren't exposed publicly via the DSO PR: 191354 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/regex/grot/Makefile Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/regex/grot/Makefile ============================================================================== --- stable/9/lib/libc/regex/grot/Makefile Sun Dec 20 00:40:33 2015 (r292481) +++ stable/9/lib/libc/regex/grot/Makefile Sun Dec 20 00:45:34 2015 (r292482) @@ -8,7 +8,7 @@ PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include .PATH: ${PATHS} -CFLAGS+= -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) +CFLAGS+= -static -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) .for incpath in ${PATHS} CFLAGS+= -I${incpath} .endfor From owner-svn-src-stable-9@freebsd.org Sun Dec 20 20:58:50 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB13AA4ECED; Sun, 20 Dec 2015 20:58:50 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C19E1FFE; Sun, 20 Dec 2015 20:58:50 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKKwnwL070739; Sun, 20 Dec 2015 20:58:49 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKKwnc3070738; Sun, 20 Dec 2015 20:58:49 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512202058.tBKKwnc3070738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sun, 20 Dec 2015 20:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292520 - stable/9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 20:58:50 -0000 Author: vangyzen Date: Sun Dec 20 20:58:49 2015 New Revision: 292520 URL: https://svnweb.freebsd.org/changeset/base/292520 Log: MFC r289315 (reprise) MFC the man page change from r289315. Thanks for the attention to detail, Jeremy. Pointed out by: Jeremy Chadwick Sponsored by: Dell Inc. Modified: stable/9/share/man/man5/resolver.5 Directory Properties: stable/9/share/man/man5/ (props changed) Modified: stable/9/share/man/man5/resolver.5 ============================================================================== --- stable/9/share/man/man5/resolver.5 Sun Dec 20 19:09:12 2015 (r292519) +++ stable/9/share/man/man5/resolver.5 Sun Dec 20 20:58:49 2015 (r292520) @@ -32,7 +32,7 @@ .\" @(#)resolver.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 9, 2004 +.Dd October 12, 2015 .Dt RESOLVER 5 .Os .Sh NAME @@ -179,6 +179,19 @@ the resolver from obeying the standard and .Sy search rules with the given name. +.It Sy reload-period: Ns Ar n +The resolver checks the modification time of +.Pa /etc/resolv.conf +every +.Ar n +seconds. +If +.Pa /etc/resolv.conf +has changed, it is automatically reloaded. +The default for +.Ar n +is two seconds. +Setting it to zero disables the file check. .El .Pp Options may also be specified as a space or tab separated list using the @@ -195,8 +208,7 @@ If more than one instance of these keywo the last instance will override. .Pp The keyword and value must appear on a single line, and the keyword -(e.g.\& -.Sy nameserver ) +.Pq for example, Sy nameserver must start the line. The value follows the keyword, separated by white space. .Sh FILES From owner-svn-src-stable-9@freebsd.org Mon Dec 21 09:36:46 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5EFAA1470B; Mon, 21 Dec 2015 09:36:46 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 963E414B8; Mon, 21 Dec 2015 09:36:46 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBL9aj07090999; Mon, 21 Dec 2015 09:36:45 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL9aj6t090998; Mon, 21 Dec 2015 09:36:45 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512210936.tBL9aj6t090998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 21 Dec 2015 09:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292535 - stable/9/usr.sbin/ctm/ctm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 09:36:46 -0000 Author: brueffer Date: Mon Dec 21 09:36:45 2015 New Revision: 292535 URL: https://svnweb.freebsd.org/changeset/base/292535 Log: MFH: r292212 Flesh out the SEE ALSO section. PR: 202929 Submitted by: jhs@berklix.com Modified: stable/9/usr.sbin/ctm/ctm/ctm.1 Directory Properties: stable/9/usr.sbin/ctm/ctm/ (props changed) Modified: stable/9/usr.sbin/ctm/ctm/ctm.1 ============================================================================== --- stable/9/usr.sbin/ctm/ctm/ctm.1 Mon Dec 21 09:34:45 2015 (r292534) +++ stable/9/usr.sbin/ctm/ctm/ctm.1 Mon Dec 21 09:36:45 2015 (r292535) @@ -12,7 +12,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 1995 +.Dd December 14, 2015 .Dt CTM 1 .Os .Sh NAME @@ -303,8 +303,19 @@ and .Fl V options. .Sh SEE ALSO +.Xr ctm_dequeue 1 , .Xr ctm_rmail 1 , +.Xr ctm_smail 1 , .Xr ctm 5 +.Rs +.%B "The FreeBSD Handbook" +.%T "Using CTM" +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ctm.html +.Re +.Rs +.%T "Miscellaneous CTM on FreeBSD Resources" +.%U http://ctm.berklix.org +.Re .Sh HISTORY Initial trials were run during the work on .Fx 1.1.5 , From owner-svn-src-stable-9@freebsd.org Tue Dec 22 19:41:42 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01415A4F89E; Tue, 22 Dec 2015 19:41:42 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEDCA1CC6; Tue, 22 Dec 2015 19:41:41 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMJfevi029512; Tue, 22 Dec 2015 19:41:40 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMJfe0S029509; Tue, 22 Dec 2015 19:41:40 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201512221941.tBMJfe0S029509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 22 Dec 2015 19:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292617 - stable/9/sys/dev/qlxgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 19:41:42 -0000 Author: davidcs Date: Tue Dec 22 19:41:40 2015 New Revision: 292617 URL: https://svnweb.freebsd.org/changeset/base/292617 Log: MFC r289635 ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE ql_os.c: removed unnecessary debug printf ql_ver.h: updated version number Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 19:40:34 2015 (r292616) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 19:41:40 2015 (r292617) @@ -387,6 +387,7 @@ ql_hw_add_sysctls(qla_host_t *ha) "Minidump Utility can start minidump process"); #ifdef QL_DBG + ha->err_inject = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "err_inject", @@ -3057,7 +3058,7 @@ ql_hw_check_health(qla_host_t *ha) val = READ_REG32(ha, Q8_FIRMWARE_HEARTBEAT); if ((val != ha->hw.hbeat_value) && - (!(QL_ERR_INJECT(ha, INJCT_TEMPERATURE_FAILURE)))) { + (!(QL_ERR_INJECT(ha, INJCT_HEARTBEAT_FAILURE)))) { ha->hw.hbeat_value = val; return 0; } Modified: stable/9/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_os.c Tue Dec 22 19:40:34 2015 (r292616) +++ stable/9/sys/dev/qlxgbe/ql_os.c Tue Dec 22 19:41:40 2015 (r292617) @@ -289,8 +289,6 @@ qla_pci_attach(device_t dev) int i; uint32_t num_rcvq = 0; - QL_DPRINT2(ha, (dev, "%s: enter\n", __func__)); - if ((ha = device_get_softc(dev)) == NULL) { device_printf(dev, "cannot get softc\n"); return (ENOMEM); Modified: stable/9/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_ver.h Tue Dec 22 19:40:34 2015 (r292616) +++ stable/9/sys/dev/qlxgbe/ql_ver.h Tue Dec 22 19:41:40 2015 (r292617) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 24 +#define QLA_VERSION_BUILD 25 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-stable-9@freebsd.org Wed Dec 23 10:38:45 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A763FA4FF3B; Wed, 23 Dec 2015 10:38:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 670CC1B32; Wed, 23 Dec 2015 10:38:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBNAci7T089843; Wed, 23 Dec 2015 10:38:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNAciKc089840; Wed, 23 Dec 2015 10:38:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512231038.tBNAciKc089840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 10:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292657 - in stable/9/tools/regression/lib/libc: nss resolv X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 10:38:45 -0000 Author: ngie Date: Wed Dec 23 10:38:44 2015 New Revision: 292657 URL: https://svnweb.freebsd.org/changeset/base/292657 Log: MFstable/10 r292652: MFC r292316: Remove hosts that don't resolve properly with the nss and resolv tests Sponsored by: EMC / Isilon Storage Division Modified: stable/9/tools/regression/lib/libc/nss/mach stable/9/tools/regression/lib/libc/resolv/mach Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) stable/9/tools/regression/lib/libc/ (props changed) Modified: stable/9/tools/regression/lib/libc/nss/mach ============================================================================== --- stable/9/tools/regression/lib/libc/nss/mach Wed Dec 23 10:34:11 2015 (r292656) +++ stable/9/tools/regression/lib/libc/nss/mach Wed Dec 23 10:38:44 2015 (r292657) @@ -1,32 +1,17 @@ # $FreeBSD$ localhost -above.warped.net anoncvs.cirr.com -anoncvs.isc.netbsd.org -anoncvs.leo.org -anoncvs.netbsd.lt -anoncvs.netbsd.ro anoncvs.netbsd.se antioche.antioche.eu.org -boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no console.netbsd.org -cvs.fi.netbsd.org -cvs.mikrolahti.fi cvs.netbsd.org -cvsup-netbsd.leo.org cvsup.netbsd.se -cvsup.pasta.cs.uit.no -ftp.bitcon.no ftp.chg.ru -ftp.duth.gr ftp.estpak.ee ftp.fsn.hu ftp.funet.fi -ftp.grondar.za -ftp.leo.org -ftp.netbsd.lt ftp.netbsd.org ftp.nluug.nl ftp.plig.org @@ -34,60 +19,28 @@ ftp.uni-erlangen.de ftp.xgate.co.kr gd.tuwien.ac.at gort.ludd.luth.se -grappa.unix-ag.uni-kl.de -info.wins.uva.nl irc.warped.net knug.youn.co.kr -lala.iri.co.jp mail.jp.netbsd.org -mail.kr.netbsd.org mail.netbsd.org melanoma.cs.rmit.edu.au mirror.aarnet.edu.au -mirror.netbsd.com.br -mirror03.inet.tele.dk moon.vub.ac.be -nbwww.sergei.cc net.bsd.cz netbsd.3miasto.net netbsd.4ka.mipt.ru -netbsd.apk.od.ua netbsd.csie.nctu.edu.tw netbsd.enderunix.org netbsd.ftp.fu-berlin.de -netbsd.netlead.com.au -netbsd.nsysu.edu.tw netbsd.pair.com -netbsd.stevens-tech.edu -netbsd.triada.bg -netbsd.unix.net.nz -netbsd.unixtech.be -netbsd.vejas.lt -netbsd.wagener-consulting.lu -netbsd.zarco.org netbsdiso.interoute.net.uk -netbsdwww.bitcon.no -netbsdwww.cordef.com.pl netbsdwww.cs.rmit.edu.au netbsdwww.interoute.net.uk -news.gw.com ns.netbsd.org -pigu.iri.co.jp -pluto.cdpa.nsysu.edu.tw -projects.slowass.net -server6.pasta.cs.uit.no skeleton.phys.spbu.ru -snoopy.allbsd.org -spike.allbsd.org -sundry.netbsd.org -tanya.sergei.cc -web-a.fi.gw.com -web-a.us.gw.com -web.netbsd.mirror.arhea.net www.en.netbsd.de www.netbsd.cl www.netbsd.nl www.netbsd.org www.netbsd.ro -zathras.netbsd.org zeppo.rediris.es Modified: stable/9/tools/regression/lib/libc/resolv/mach ============================================================================== --- stable/9/tools/regression/lib/libc/resolv/mach Wed Dec 23 10:34:11 2015 (r292656) +++ stable/9/tools/regression/lib/libc/resolv/mach Wed Dec 23 10:38:44 2015 (r292657) @@ -1,32 +1,17 @@ # $FreeBSD$ localhost -above.warped.net anoncvs.cirr.com -anoncvs.isc.netbsd.org -anoncvs.leo.org -anoncvs.netbsd.lt -anoncvs.netbsd.ro anoncvs.netbsd.se antioche.antioche.eu.org -boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no console.netbsd.org -cvs.fi.netbsd.org -cvs.mikrolahti.fi cvs.netbsd.org -cvsup-netbsd.leo.org cvsup.netbsd.se -cvsup.pasta.cs.uit.no -ftp.bitcon.no ftp.chg.ru -ftp.duth.gr ftp.estpak.ee ftp.fsn.hu ftp.funet.fi -ftp.grondar.za -ftp.leo.org -ftp.netbsd.lt ftp.netbsd.org ftp.nluug.nl ftp.plig.org @@ -34,60 +19,28 @@ ftp.uni-erlangen.de ftp.xgate.co.kr gd.tuwien.ac.at gort.ludd.luth.se -grappa.unix-ag.uni-kl.de -info.wins.uva.nl irc.warped.net knug.youn.co.kr -lala.iri.co.jp mail.jp.netbsd.org -mail.kr.netbsd.org mail.netbsd.org melanoma.cs.rmit.edu.au mirror.aarnet.edu.au -mirror.netbsd.com.br -mirror03.inet.tele.dk moon.vub.ac.be -nbwww.sergei.cc net.bsd.cz netbsd.3miasto.net netbsd.4ka.mipt.ru -netbsd.apk.od.ua netbsd.csie.nctu.edu.tw netbsd.enderunix.org netbsd.ftp.fu-berlin.de -netbsd.netlead.com.au -netbsd.nsysu.edu.tw netbsd.pair.com -netbsd.stevens-tech.edu -netbsd.triada.bg -netbsd.unix.net.nz -netbsd.unixtech.be -netbsd.vejas.lt -netbsd.wagener-consulting.lu -netbsd.zarco.org netbsdiso.interoute.net.uk -netbsdwww.bitcon.no -netbsdwww.cordef.com.pl netbsdwww.cs.rmit.edu.au netbsdwww.interoute.net.uk -news.gw.com ns.netbsd.org -pigu.iri.co.jp -pluto.cdpa.nsysu.edu.tw -projects.slowass.net -server6.pasta.cs.uit.no skeleton.phys.spbu.ru -snoopy.allbsd.org -spike.allbsd.org -sundry.netbsd.org -tanya.sergei.cc -web-a.fi.gw.com -web-a.us.gw.com -web.netbsd.mirror.arhea.net www.en.netbsd.de www.netbsd.cl www.netbsd.nl www.netbsd.org www.netbsd.ro -zathras.netbsd.org zeppo.rediris.es From owner-svn-src-stable-9@freebsd.org Thu Dec 24 20:19:51 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65A07A50EEE; Thu, 24 Dec 2015 20:19:51 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A7841973; Thu, 24 Dec 2015 20:19:51 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBOKJo1d091732; Thu, 24 Dec 2015 20:19:50 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOKJoeQ091730; Thu, 24 Dec 2015 20:19:50 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512242019.tBOKJoeQ091730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 24 Dec 2015 20:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292708 - in stable/9: contrib/smbfs tools/debugscripts X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 20:19:51 -0000 Author: brueffer Date: Thu Dec 24 20:19:49 2015 New Revision: 292708 URL: https://svnweb.freebsd.org/changeset/base/292708 Log: MFH: r292263 Assorted grammar, spelling and punctuation fixes. PR: 203336, 203339 Submitted by: espeyb@rpi.edu, themesta@gmail.com Modified: stable/9/contrib/smbfs/README stable/9/tools/debugscripts/README Directory Properties: stable/9/contrib/smbfs/ (props changed) stable/9/tools/ (props changed) Modified: stable/9/contrib/smbfs/README ============================================================================== --- stable/9/contrib/smbfs/README Thu Dec 24 20:15:14 2015 (r292707) +++ stable/9/contrib/smbfs/README Thu Dec 24 20:19:49 2015 (r292708) @@ -15,7 +15,7 @@ It is a complete, kernel side implementa Darwin maintained in the Darwin's tree. - I'm would be very grateful for any feedback, bug reports etc. + I would be very grateful for any feedback, bug reports etc. Supported SMB servers: Samba @@ -23,14 +23,14 @@ It is a complete, kernel side implementa IBM LanManager NetApp - An updated versions of this package can be retrieved from ftp server: + An updated version of this package can be retrieved from ftp server: ftp://ftp.butya.kz/pub/smbfs/smbfs.tar.gz - Perfomance + Performance ========== - There is some perfomance benchmarks over 10Mbit network: + These are some performance benchmarks over a 10Mbit network: Win95 machine as server: IOZONE: auto-test mode Modified: stable/9/tools/debugscripts/README ============================================================================== --- stable/9/tools/debugscripts/README Thu Dec 24 20:15:14 2015 (r292707) +++ stable/9/tools/debugscripts/README Thu Dec 24 20:19:49 2015 (r292708) @@ -14,8 +14,8 @@ perform kernel debugging, you would do: (kgdb) -This directory also contains a kgdb script that given a crash dump number -automatically extract the path to the kernel source, run gdb to extract -information about kernel modules loaded, and then rerun gdb loading the +This directory also contains a kgdb script that, given a crash dump number, +automatically extracts the path to the kernel source, runs gdb to extract +information about kernel modules loaded, and then reruns gdb loading the necessary symbols for the modules. You need to make sure you build the modules w/ debugging symbols separately to get things to work. From owner-svn-src-stable-9@freebsd.org Fri Dec 25 10:55:41 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD537A5042A; Fri, 25 Dec 2015 10:55:40 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B875814C2; Fri, 25 Dec 2015 10:55:40 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPAtdlA050185; Fri, 25 Dec 2015 10:55:39 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPAtdQG050184; Fri, 25 Dec 2015 10:55:39 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512251055.tBPAtdQG050184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 25 Dec 2015 10:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292721 - stable/9/usr.sbin/ypserv X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 10:55:41 -0000 Author: ume Date: Fri Dec 25 10:55:39 2015 New Revision: 292721 URL: https://svnweb.freebsd.org/changeset/base/292721 Log: MFC r292435, r292441: - Keep hosts.by{name,addr} IPv4 only. - Add comment how we handle hosts and ipnodes. - Generate ipnodes.by{addr,name} from /etc/hosts for compatibility with FreeBSD local name resolution. If /var/yp/ipnodes exists, we generate them from it for backward compatibility. Modified: stable/9/usr.sbin/ypserv/Makefile.yp Directory Properties: stable/9/usr.sbin/ypserv/ (props changed) Modified: stable/9/usr.sbin/ypserv/Makefile.yp ============================================================================== --- stable/9/usr.sbin/ypserv/Makefile.yp Fri Dec 25 10:53:30 2015 (r292720) +++ stable/9/usr.sbin/ypserv/Makefile.yp Fri Dec 25 10:55:39 2015 (r292721) @@ -140,6 +140,7 @@ target: # If you want to omit some of them, feel free to comment # them out from this list. TARGETS= servers hosts networks protocols rpc services shells group +TARGETS+= ipnodes #TARGETS+= aliases # Sanity checks: filter out targets we can't build @@ -186,10 +187,8 @@ TARGETS+= amd.map AMDHOST= /dev/null .endif -.if exists($(IPNODES)) -TARGETS+= ipnodes -.else -IPNODES= /dev/null +.if !exists($(IPNODES)) +IPNODES= $(HOSTS) .endif all: $(TARGETS) @@ -353,9 +352,22 @@ netgroup.byuser: $(NETGROUP) .endif +# Solaris 8 does the following: +# - /etc/hosts and hosts.{byname,byaddr} are IPv4 only. +# - /etc/inet/ipnodes and ipnodes.{byname,byaddr} are used for protocol +# independent name-to-address mapping. +# +# For local name resolution, we made /etc/hosts protocol independent. +# For NIS name resolution, we obey Solaris 8 practice. +# - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8 +# clients. +# - ipnodes.{byname,byaddr} is used for protocol independent mapping. +# We generate all the mappings from /etc/hosts unless /var/yp/ipnodes +# exists, for compatibility with FreeBSD local name resolution. +# hosts.byname: $(HOSTS) @echo "Updating $@..." - @$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ + @$(AWK) '/^[0-9.]+[\t ]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -365,7 +377,7 @@ hosts.byname: $(HOSTS) hosts.byaddr: $(HOSTS) @echo "Updating $@..." - @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(HOSTS) \ + @$(AWK) '/^[0-9.]+[\t ]/ { print $$1"\t"$$0 }' $(HOSTS) \ | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -375,30 +387,22 @@ hosts.byaddr: $(HOSTS) ipnodes.byname: $(IPNODES) @echo "Updating $@..." -.if ${IPNODES} == "/dev/null" - @echo "Ipnodes source file not found -- skipping" -.else @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi -.endif ipnodes.byaddr: $(IPNODES) @echo "Updating $@..." -.if ${IPNODES} == "/dev/null" - @echo "Ipnodes source file not found -- skipping" -.else @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \ | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi -.endif networks.byname: $(NETWORKS) From owner-svn-src-stable-9@freebsd.org Fri Dec 25 11:33:10 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1C48A50F89; Fri, 25 Dec 2015 11:33:10 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7200814BE; Fri, 25 Dec 2015 11:33:10 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPBX90T061778; Fri, 25 Dec 2015 11:33:09 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPBX9Hk061775; Fri, 25 Dec 2015 11:33:09 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512251133.tBPBX9Hk061775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 25 Dec 2015 11:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292724 - in stable/9: include lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 11:33:10 -0000 Author: ume Date: Fri Dec 25 11:33:09 2015 New Revision: 292724 URL: https://svnweb.freebsd.org/changeset/base/292724 Log: MFC r292444, r292446: Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3). PR: 198092 Modified: stable/9/include/netdb.h stable/9/lib/libc/net/getaddrinfo.3 stable/9/lib/libc/net/getaddrinfo.c Directory Properties: stable/9/include/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/include/netdb.h ============================================================================== --- stable/9/include/netdb.h Fri Dec 25 11:29:18 2015 (r292723) +++ stable/9/include/netdb.h Fri Dec 25 11:33:09 2015 (r292724) @@ -179,7 +179,7 @@ struct addrinfo { /* valid flags for addrinfo (not a standard def, apps should not use it) */ #define AI_MASK \ (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ - AI_ADDRCONFIG) + AI_ADDRCONFIG | AI_ALL | AI_V4MAPPED) #define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ #define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ Modified: stable/9/lib/libc/net/getaddrinfo.3 ============================================================================== --- stable/9/lib/libc/net/getaddrinfo.3 Fri Dec 25 11:29:18 2015 (r292723) +++ stable/9/lib/libc/net/getaddrinfo.3 Fri Dec 25 11:33:09 2015 (r292724) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2013 +.Dd December 19, 2015 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -126,11 +126,13 @@ field to which the parameter points shall be set to zero or be the bitwise-inclusive OR of one or more of the values .Dv AI_ADDRCONFIG , +.Dv AI_ALL , .Dv AI_CANONNAME , .Dv AI_NUMERICHOST , -.Dv AI_NUMERICSERV +.Dv AI_NUMERICSERV , +.Dv AI_PASSIVE and -.Dv AI_PASSIVE . +.Dv AI_V4MAPPED . .Bl -tag -width "AI_CANONNAMEXX" .It Dv AI_ADDRCONFIG If the @@ -139,6 +141,25 @@ bit is set, IPv4 addresses shall be retu an IPv4 address is configured on the local system, and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system. +.It Dv AI_ALL +If the +.Dv AI_ALL +flag is used with the +.Dv AI_V4MAPPED +flag, then +.Fn getaddrinfo +shall return all matching IPv6 and IPv4 addresses. +.Pp +For example, when using the DNS, queries are made for both AAAA records and A records, and +.Fn getaddrinfo +returns the combined results of both queries. +Any IPv4 addresses found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_ALL +flag without the +.Dv AI_V4MAPPED +flag is ignored. .It Dv AI_CANONNAME If the .Dv AI_CANONNAME @@ -203,6 +224,25 @@ loopback address if is the null pointer and .Dv AI_PASSIVE is not set. +.It Dv AI_V4MAPPED +If the +.Dv AI_V4MAPPED +flag is specified along with an ai_family of +.Dv AF_INET6 , +then +.Fn getaddrinfo +shall return IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses ( +.Fa ai_addrlen +shall be 16). +.Pp +For example, when using the DNS, if no AAAA records are found then a query is made for A records and any found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_V4MAPPED +flag shall be ignored unless +.Fa ai_family +equals +.Dv AF_INET6 . .El .El .Pp Modified: stable/9/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/9/lib/libc/net/getaddrinfo.c Fri Dec 25 11:29:18 2015 (r292723) +++ stable/9/lib/libc/net/getaddrinfo.c Fri Dec 25 11:33:09 2015 (r292724) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "netdb_private.h" #include "libc_private.h" #ifdef NS_CACHING #include "nscache.h" @@ -450,6 +451,24 @@ getaddrinfo(const char *hostname, const } /* + * RFC 3493: AI_ALL and AI_V4MAPPED are effective only against + * AF_INET6 query. They need to be ignored if specified in other + * occassions. + */ + switch (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) { + case AI_V4MAPPED: + case AI_ALL | AI_V4MAPPED: +#ifdef INET6 + if (pai->ai_family != AF_INET6) + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; +#endif + case AI_ALL: + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; + } + + /* * check for special cases. (1) numeric servname is disallowed if * socktype/protocol are left unspecified. (2) servname is disallowed * for raw and other inet{,6} sockets. @@ -840,6 +859,16 @@ set_source(struct ai_order *aio, struct /* open a socket to get the source address for the given dst */ if ((s = _socket(ai.ai_family, ai.ai_socktype, ai.ai_protocol)) < 0) return; /* give up */ +#ifdef INET6 + if (ai.ai_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)ai.ai_addr; + int off = 0; + + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + (void)_setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, + (char *)&off, sizeof(off)); + } +#endif if (_connect(s, ai.ai_addr, ai.ai_addrlen) < 0) goto cleanup; srclen = ai.ai_addrlen; @@ -1175,7 +1204,7 @@ explore_numeric(const struct addrinfo *p const char *servname, struct addrinfo **res, const char *canonname) { const struct afd *afd; - struct addrinfo *ai; + struct addrinfo *ai, ai0; int error; char pton[PTON_MAX]; @@ -1199,8 +1228,17 @@ explore_numeric(const struct addrinfo *p return 0; break; default: - if (inet_pton(afd->a_af, hostname, pton) != 1) - return 0; + if (inet_pton(afd->a_af, hostname, pton) != 1) { + if (pai->ai_family != AF_INET6 || + (pai->ai_flags & AI_V4MAPPED) != AI_V4MAPPED) + return 0; + if (inet_aton(hostname, (struct in_addr *)pton) != 1) + return 0; + afd = &afdl[N_INET]; + ai0 = *pai; + ai0.ai_family = AF_INET; + pai = &ai0; + } break; } @@ -1319,6 +1357,9 @@ get_ai(const struct addrinfo *pai, const char *fp_str; int translate = 0; #endif +#ifdef INET6 + struct in6_addr mapaddr; +#endif #ifdef FAITH /* @@ -1356,6 +1397,14 @@ get_ai(const struct addrinfo *pai, const } #endif +#ifdef INET6 + if (afd->a_af == AF_INET && (pai->ai_flags & AI_V4MAPPED) != 0) { + afd = &afdl[N_INET6]; + _map_v4v6_address(addr, (char *)&mapaddr); + addr = (char *)&mapaddr; + } +#endif + ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + (afd->a_socklen)); if (ai == NULL) @@ -2186,7 +2235,7 @@ addr4sort(struct addrinfo *sentinel, res static int _dns_getaddrinfo(void *rv, void *cb_data, va_list ap) { - struct addrinfo *ai; + struct addrinfo *ai, ai0; querybuf *buf, *buf2; const char *hostname; const struct addrinfo *pai; @@ -2216,6 +2265,13 @@ _dns_getaddrinfo(void *rv, void *cb_data return NS_NOTFOUND; } + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) { + ai0 = *pai; + ai0.ai_family = AF_UNSPEC; + pai = &ai0; + } + switch (pai->ai_family) { case AF_UNSPEC: q.name = hostname; @@ -2271,9 +2327,12 @@ _dns_getaddrinfo(void *rv, void *cb_data cur = cur->ai_next; } } - ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); - if (ai) - cur->ai_next = ai; + if (!ai || pai->ai_family != AF_UNSPEC || + (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) { + ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); + if (ai) + cur->ai_next = ai; + } free(buf); free(buf2); if (sentinel.ai_next == NULL) @@ -2355,6 +2414,9 @@ found: hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = 0; hints.ai_flags = AI_NUMERICHOST; + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) + hints.ai_flags |= AI_V4MAPPED; error = getaddrinfo(addr, "0", &hints, &res0); if (error) goto again; @@ -2382,6 +2444,20 @@ found: return res0; } +static struct addrinfo * +_getht(FILE **hostf, const char *name, const struct addrinfo *pai, + struct addrinfo *cur) +{ + struct addrinfo *p; + + while ((p = _gethtent(hostf, name, pai)) != NULL) { + cur->ai_next = p; + while (cur && cur->ai_next) + cur = cur->ai_next; + } + return (cur); +} + /*ARGSUSED*/ static int _files_getaddrinfo(void *rv, void *cb_data, va_list ap) @@ -2389,7 +2465,6 @@ _files_getaddrinfo(void *rv, void *cb_da const char *name; const struct addrinfo *pai; struct addrinfo sentinel, *cur; - struct addrinfo *p; FILE *hostf = NULL; name = va_arg(ap, char *); @@ -2399,11 +2474,19 @@ _files_getaddrinfo(void *rv, void *cb_da cur = &sentinel; _sethtent(&hostf); - while ((p = _gethtent(&hostf, name, pai)) != NULL) { - cur->ai_next = p; - while (cur && cur->ai_next) - cur = cur->ai_next; - } + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) == AI_V4MAPPED) { + struct addrinfo ai0 = *pai; + + ai0.ai_flags &= ~AI_V4MAPPED; + cur = _getht(&hostf, name, &ai0, cur); + if (sentinel.ai_next == NULL) { + _sethtent(&hostf); + ai0.ai_flags |= AI_V4MAPPED; + cur = _getht(&hostf, name, &ai0, cur); + } + } else + cur = _getht(&hostf, name, pai, cur); _endhtent(&hostf); *((struct addrinfo **)rv) = sentinel.ai_next; @@ -2463,6 +2546,9 @@ nextline: hints = *pai; hints.ai_flags = AI_NUMERICHOST; + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) + hints.ai_flags |= AI_V4MAPPED; error = getaddrinfo(addr, NULL, &hints, &res0); if (error == 0) { for (res = res0; res; res = res->ai_next) { @@ -2510,15 +2596,46 @@ _yp_getaddrinfo(void *rv, void *cb_data, memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + /* ipnodes.byname can hold both IPv4/v6 */ + r = yp_match(ypdomain, "ipnodes.byname", name, + (int)strlen(name), &ypbuf, &ypbuflen); + if (r == 0) { + ai = _yphostent(ypbuf, pai); + if (ai) { + cur->ai_next = ai; + while (cur && cur->ai_next) + cur = cur->ai_next; + } + free(ypbuf); + } + + if (ai != NULL) { + struct sockaddr_in6 *sin6; + + switch (ai->ai_family) { + case AF_INET: + goto done; + case AF_INET6: + sin6 = (struct sockaddr_in6 *)ai->ai_addr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + goto done; + break; + } + } + /* hosts.byname is only for IPv4 (Solaris8) */ - if (pai->ai_family == PF_UNSPEC || pai->ai_family == PF_INET) { + if (pai->ai_family == AF_UNSPEC || pai->ai_family == AF_INET || + ((pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) && + (ai == NULL || (pai->ai_flags & AI_ALL) == AI_ALL))) { r = yp_match(ypdomain, "hosts.byname", name, (int)strlen(name), &ypbuf, &ypbuflen); if (r == 0) { struct addrinfo ai4; ai4 = *pai; - ai4.ai_family = AF_INET; + if (pai->ai_family == AF_UNSPEC) + ai4.ai_family = AF_INET; ai = _yphostent(ypbuf, &ai4); if (ai) { cur->ai_next = ai; @@ -2529,16 +2646,7 @@ _yp_getaddrinfo(void *rv, void *cb_data, } } - /* ipnodes.byname can hold both IPv4/v6 */ - r = yp_match(ypdomain, "ipnodes.byname", name, - (int)strlen(name), &ypbuf, &ypbuflen); - if (r == 0) { - ai = _yphostent(ypbuf, pai); - if (ai) - cur->ai_next = ai; - free(ypbuf); - } - +done: if (sentinel.ai_next == NULL) { RES_SET_H_ERRNO(__res_state(), HOST_NOT_FOUND); return NS_NOTFOUND; From owner-svn-src-stable-9@freebsd.org Fri Dec 25 15:12:13 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AEEBA51059; Fri, 25 Dec 2015 15:12:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46B0817FD; Fri, 25 Dec 2015 15:12:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPFCC7R027552; Fri, 25 Dec 2015 15:12:12 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPFCCfv027548; Fri, 25 Dec 2015 15:12:12 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201512251512.tBPFCCfv027548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 25 Dec 2015 15:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292731 - stable/9/sys/contrib/pf/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 15:12:13 -0000 Author: kp Date: Fri Dec 25 15:12:11 2015 New Revision: 292731 URL: https://svnweb.freebsd.org/changeset/base/292731 Log: pf: Fix TSO issues In certain configurations (mostly but not exclusively as a VM on Xen) pf produced packets with an invalid TCP checksum. The problem was that pf could only handle packets with a full checksum. The FreeBSD IP stack produces TCP packets with a pseudo-header checksum (only addresses, length and protocol). Certain network interfaces expect to see the pseudo-header checksum, so they end up producing packets with invalid checksums. To fix this stop calculating the full checksum and teach pf to only update TCP checksums if TSO is disabled or the change affects the pseudo-header checksum. PR: 154428, 193579, 198868 Sponsored by: RootBSD Modified: stable/9/sys/contrib/pf/net/pf.c stable/9/sys/contrib/pf/net/pf_ioctl.c stable/9/sys/contrib/pf/net/pf_norm.c stable/9/sys/contrib/pf/net/pfvar.h Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Fri Dec 25 14:51:36 2015 (r292730) +++ stable/9/sys/contrib/pf/net/pf.c Fri Dec 25 15:12:11 2015 (r292731) @@ -239,7 +239,7 @@ void pf_init_threshold(struct pf_thre void pf_add_threshold(struct pf_threshold *); int pf_check_threshold(struct pf_threshold *); -void pf_change_ap(struct pf_addr *, u_int16_t *, +void pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *, u_int16_t *, u_int16_t *, struct pf_addr *, u_int16_t, u_int8_t, sa_family_t); int pf_modulate_sack(struct mbuf *, int, struct pf_pdesc *, @@ -2007,6 +2007,22 @@ pf_addr_wrap_neq(struct pf_addr_wrap *aw } } +/** + * Checksum updates are a little complicated because the checksum in the TCP/UDP + * header isn't always a full checksum. In some cases (i.e. output) it's a + * pseudo-header checksum, which is a partial checksum over src/dst IP + * addresses, protocol number and length. + * + * That means we have the following cases: + * * Input or forwarding: we don't have TSO, the checksum fields are full + * checksums, we need to update the checksum whenever we change anything. + * * Output (i.e. the checksum is a pseudo-header checksum): + * x The field being updated is src/dst address or affects the length of + * the packet. We need to update the pseudo-header checksum (note that this + * checksum is not ones' complement). + * x Some other field is being modified (e.g. src/dst port numbers): We + * don't have to update anything. + **/ u_int16_t pf_cksum_fixup(u_int16_t cksum, u_int16_t old, u_int16_t new, u_int8_t udp) { @@ -2022,9 +2038,20 @@ pf_cksum_fixup(u_int16_t cksum, u_int16_ return (l); } +u_int16_t +pf_proto_cksum_fixup(struct mbuf *m, u_int16_t cksum, u_int16_t old, + u_int16_t new, u_int8_t udp) +{ + if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) + return (cksum); + + return (pf_cksum_fixup(cksum, old, new, udp)); +} + void -pf_change_ap(struct pf_addr *a, u_int16_t *p, u_int16_t *ic, u_int16_t *pc, - struct pf_addr *an, u_int16_t pn, u_int8_t u, sa_family_t af) +pf_change_ap(struct mbuf *m, struct pf_addr *a, u_int16_t *p, u_int16_t *ic, + u_int16_t *pc, struct pf_addr *an, u_int16_t pn, u_int8_t u, + sa_family_t af) { struct pf_addr ao; u_int16_t po = *p; @@ -2032,6 +2059,9 @@ pf_change_ap(struct pf_addr *a, u_int16_ PF_ACPY(&ao, a, af); PF_ACPY(a, an, af); + if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) + *pc = ~*pc; + *p = pn; switch (af) { @@ -2041,17 +2071,19 @@ pf_change_ap(struct pf_addr *a, u_int16_ ao.addr16[0], an->addr16[0], 0), ao.addr16[1], an->addr16[1], 0); *p = pn; - *pc = pf_cksum_fixup(pf_cksum_fixup(pf_cksum_fixup(*pc, + + *pc = pf_cksum_fixup(pf_cksum_fixup(*pc, ao.addr16[0], an->addr16[0], u), - ao.addr16[1], an->addr16[1], u), - po, pn, u); + ao.addr16[1], an->addr16[1], u); + + *pc = pf_proto_cksum_fixup(m, *pc, po, pn, u); break; #endif /* INET */ #ifdef INET6 case AF_INET6: *pc = pf_cksum_fixup(pf_cksum_fixup(pf_cksum_fixup( pf_cksum_fixup(pf_cksum_fixup(pf_cksum_fixup( - pf_cksum_fixup(pf_cksum_fixup(pf_cksum_fixup(*pc, + pf_cksum_fixup(pf_cksum_fixup(*pc, ao.addr16[0], an->addr16[0], u), ao.addr16[1], an->addr16[1], u), ao.addr16[2], an->addr16[2], u), @@ -2059,13 +2091,20 @@ pf_change_ap(struct pf_addr *a, u_int16_ ao.addr16[4], an->addr16[4], u), ao.addr16[5], an->addr16[5], u), ao.addr16[6], an->addr16[6], u), - ao.addr16[7], an->addr16[7], u), - po, pn, u); + ao.addr16[7], an->addr16[7], u); + + *pc = pf_proto_cksum_fixup(m, *pc, po, pn, u); break; #endif /* INET6 */ } -} + if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | + CSUM_DELAY_DATA_IPV6)) { + *pc = ~*pc; + if (! *pc) + *pc = 0xffff; + } +} /* Changes a u_int32_t. Uses a void * so there are no align restrictions */ void @@ -2079,6 +2118,19 @@ pf_change_a(void *a, u_int16_t *c, u_int ao % 65536, an % 65536, u); } +void +pf_change_proto_a(struct mbuf *m, void *a, u_int16_t *c, u_int32_t an, u_int8_t udp) +{ + u_int32_t ao; + + memcpy(&ao, a, sizeof(ao)); + memcpy(a, &an, sizeof(u_int32_t)); + + *c = pf_proto_cksum_fixup(m, + pf_proto_cksum_fixup(m, *c, ao / 65536, an / 65536, udp), + ao % 65536, an % 65536, udp); +} + #ifdef INET6 void pf_change_a6(struct pf_addr *a, u_int16_t *c, struct pf_addr *an, u_int8_t u) @@ -2228,12 +2280,10 @@ pf_modulate_sack(struct mbuf *m, int off for (i = 2; i + TCPOLEN_SACK <= olen; i += TCPOLEN_SACK) { memcpy(&sack, &opt[i], sizeof(sack)); - pf_change_a(&sack.start, &th->th_sum, - htonl(ntohl(sack.start) - - dst->seqdiff), 0); - pf_change_a(&sack.end, &th->th_sum, - htonl(ntohl(sack.end) - - dst->seqdiff), 0); + pf_change_proto_a(m, &sack.start, &th->th_sum, + htonl(ntohl(sack.start) - dst->seqdiff), 0); + pf_change_proto_a(m, &sack.end, &th->th_sum, + htonl(ntohl(sack.end) - dst->seqdiff), 0); memcpy(&opt[i], &sack, sizeof(sack)); } copyback = 1; @@ -3400,7 +3450,7 @@ pf_test_rule(struct pf_rule **rm, struct if (PF_ANEQ(saddr, &nk->addr[pd->sidx], af) || nk->port[pd->sidx] != sport) { - pf_change_ap(saddr, &th->th_sport, pd->ip_sum, + pf_change_ap(m, saddr, &th->th_sport, pd->ip_sum, &th->th_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 0, af); pd->sport = &th->th_sport; @@ -3409,7 +3459,7 @@ pf_test_rule(struct pf_rule **rm, struct if (PF_ANEQ(daddr, &nk->addr[pd->didx], af) || nk->port[pd->didx] != dport) { - pf_change_ap(daddr, &th->th_dport, pd->ip_sum, + pf_change_ap(m, daddr, &th->th_dport, pd->ip_sum, &th->th_sum, &nk->addr[pd->didx], nk->port[pd->didx], 0, af); dport = th->th_dport; @@ -3423,7 +3473,7 @@ pf_test_rule(struct pf_rule **rm, struct if (PF_ANEQ(saddr, &nk->addr[pd->sidx], af) || nk->port[pd->sidx] != sport) { - pf_change_ap(saddr, &pd->hdr.udp->uh_sport, + pf_change_ap(m, saddr, &pd->hdr.udp->uh_sport, pd->ip_sum, &pd->hdr.udp->uh_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 1, af); @@ -3433,7 +3483,7 @@ pf_test_rule(struct pf_rule **rm, struct if (PF_ANEQ(daddr, &nk->addr[pd->didx], af) || nk->port[pd->didx] != dport) { - pf_change_ap(daddr, &pd->hdr.udp->uh_dport, + pf_change_ap(m, daddr, &pd->hdr.udp->uh_dport, pd->ip_sum, &pd->hdr.udp->uh_sum, &nk->addr[pd->didx], nk->port[pd->didx], 1, af); @@ -3845,7 +3895,7 @@ pf_create_state(struct pf_rule *r, struc if ((s->src.seqdiff = pf_tcp_iss(pd) - s->src.seqlo) == 0) s->src.seqdiff = 1; - pf_change_a(&th->th_seq, &th->th_sum, + pf_change_proto_a(m, &th->th_seq, &th->th_sum, htonl(s->src.seqlo + s->src.seqdiff), 0); *rewrite = 1; } else @@ -4175,9 +4225,9 @@ pf_tcp_track_full(struct pf_state_peer * while ((src->seqdiff = arc4random() - seq) == 0) ; ack = ntohl(th->th_ack) - dst->seqdiff; - pf_change_a(&th->th_seq, &th->th_sum, htonl(seq + + pf_change_proto_a(m, &th->th_seq, &th->th_sum, htonl(seq + src->seqdiff), 0); - pf_change_a(&th->th_ack, &th->th_sum, htonl(ack), 0); + pf_change_proto_a(m, &th->th_ack, &th->th_sum, htonl(ack), 0); *copyback = 1; } else { ack = ntohl(th->th_ack); @@ -4227,9 +4277,9 @@ pf_tcp_track_full(struct pf_state_peer * ack = ntohl(th->th_ack) - dst->seqdiff; if (src->seqdiff) { /* Modulate sequence numbers */ - pf_change_a(&th->th_seq, &th->th_sum, htonl(seq + + pf_change_proto_a(m, &th->th_seq, &th->th_sum, htonl(seq + src->seqdiff), 0); - pf_change_a(&th->th_ack, &th->th_sum, htonl(ack), 0); + pf_change_proto_a(m, &th->th_ack, &th->th_sum, htonl(ack), 0); *copyback = 1; } end = seq + pd->p_len; @@ -4729,14 +4779,14 @@ pf_test_state_tcp(struct pf_state **stat if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || nk->port[pd->sidx] != th->th_sport) - pf_change_ap(pd->src, &th->th_sport, pd->ip_sum, - &th->th_sum, &nk->addr[pd->sidx], + pf_change_ap(m, pd->src, &th->th_sport, + pd->ip_sum, &th->th_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 0, pd->af); if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af) || nk->port[pd->didx] != th->th_dport) - pf_change_ap(pd->dst, &th->th_dport, pd->ip_sum, - &th->th_sum, &nk->addr[pd->didx], + pf_change_ap(m, pd->dst, &th->th_dport, + pd->ip_sum, &th->th_sum, &nk->addr[pd->didx], nk->port[pd->didx], 0, pd->af); copyback = 1; } @@ -4807,13 +4857,13 @@ pf_test_state_udp(struct pf_state **stat if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || nk->port[pd->sidx] != uh->uh_sport) - pf_change_ap(pd->src, &uh->uh_sport, pd->ip_sum, + pf_change_ap(m, pd->src, &uh->uh_sport, pd->ip_sum, &uh->uh_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 1, pd->af); if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af) || nk->port[pd->didx] != uh->uh_dport) - pf_change_ap(pd->dst, &uh->uh_dport, pd->ip_sum, + pf_change_ap(m, pd->dst, &uh->uh_dport, pd->ip_sum, &uh->uh_sum, &nk->addr[pd->didx], nk->port[pd->didx], 1, pd->af); #ifdef __FreeBSD__ Modified: stable/9/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_ioctl.c Fri Dec 25 14:51:36 2015 (r292730) +++ stable/9/sys/contrib/pf/net/pf_ioctl.c Fri Dec 25 15:12:11 2015 (r292731) @@ -4158,11 +4158,6 @@ pf_check_out(void *arg, struct mbuf **m, struct ip *h = NULL; int chk; - /* We need a proper CSUM befor we start (s. OpenBSD ip_output) */ - if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - in_delayed_cksum(*m); - (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; - } if ((*m)->m_pkthdr.len >= (int)sizeof(*h)) { /* if m_pkthdr.len is less than ip header, pf will handle. */ h = mtod(*m, struct ip *); @@ -4222,14 +4217,6 @@ pf_check6_out(void *arg, struct mbuf **m */ int chk; - /* We need a proper CSUM before we start (s. OpenBSD ip_output) */ - if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { -#ifdef INET - /* XXX-BZ copy&paste error from r126261? */ - in_delayed_cksum(*m); -#endif - (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; - } CURVNET_SET(ifp->if_vnet); chk = pf_test6(PF_OUT, ifp, m, NULL, inp); CURVNET_RESTORE(); Modified: stable/9/sys/contrib/pf/net/pf_norm.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_norm.c Fri Dec 25 14:51:36 2015 (r292730) +++ stable/9/sys/contrib/pf/net/pf_norm.c Fri Dec 25 15:12:11 2015 (r292731) @@ -1657,13 +1657,14 @@ pf_normalize_tcp(int dir, struct pfi_kif th->th_x2 = 0; nv = *(u_int16_t *)(&th->th_ack + 1); - th->th_sum = pf_cksum_fixup(th->th_sum, ov, nv, 0); + th->th_sum = pf_proto_cksum_fixup(m, th->th_sum, ov, nv, 0); rewrite = 1; } /* Remove urgent pointer, if TH_URG is not set */ if (!(flags & TH_URG) && th->th_urp) { - th->th_sum = pf_cksum_fixup(th->th_sum, th->th_urp, 0, 0); + th->th_sum = pf_proto_cksum_fixup(m, th->th_sum, th->th_urp, + 0, 0); th->th_urp = 0; rewrite = 1; } @@ -1889,7 +1890,7 @@ pf_normalize_tcp_stateful(struct mbuf *m (src->scrub->pfss_flags & PFSS_TIMESTAMP)) { tsval = ntohl(tsval); - pf_change_a(&opt[2], + pf_change_proto_a(m, &opt[2], &th->th_sum, htonl(tsval + src->scrub->pfss_ts_mod), @@ -1905,7 +1906,7 @@ pf_normalize_tcp_stateful(struct mbuf *m PFSS_TIMESTAMP)) { tsecr = ntohl(tsecr) - dst->scrub->pfss_ts_mod; - pf_change_a(&opt[6], + pf_change_proto_a(m, &opt[6], &th->th_sum, htonl(tsecr), 0); copyback = 1; @@ -2286,8 +2287,8 @@ pf_normalize_tcpopt(struct pf_rule *r, s case TCPOPT_MAXSEG: mss = (u_int16_t *)(optp + 2); if ((ntohs(*mss)) > r->max_mss) { - th->th_sum = pf_cksum_fixup(th->th_sum, - *mss, htons(r->max_mss), 0); + th->th_sum = pf_proto_cksum_fixup(m, + th->th_sum, *mss, htons(r->max_mss), 0); *mss = htons(r->max_mss); rewrite = 1; } Modified: stable/9/sys/contrib/pf/net/pfvar.h ============================================================================== --- stable/9/sys/contrib/pf/net/pfvar.h Fri Dec 25 14:51:36 2015 (r292730) +++ stable/9/sys/contrib/pf/net/pfvar.h Fri Dec 25 15:12:11 2015 (r292731) @@ -1909,6 +1909,8 @@ extern void pf_print_state(struct pf_ extern void pf_print_flags(u_int8_t); extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t, u_int8_t); +extern u_int16_t pf_proto_cksum_fixup(struct mbuf *, u_int16_t, + u_int16_t, u_int16_t, u_int8_t); #ifdef __FreeBSD__ VNET_DECLARE(struct ifnet *, sync_ifp); @@ -1954,6 +1956,9 @@ u_int32_t pf_new_isn(struct pf_state *); void *pf_pull_hdr(struct mbuf *, int, void *, int, u_short *, u_short *, sa_family_t); void pf_change_a(void *, u_int16_t *, u_int32_t, u_int8_t); +void pf_change_proto_a(struct mbuf *, void *, u_int16_t *, u_int32_t, + u_int8_t); +void pf_change_tcp_a(struct mbuf *, void *, u_int16_t *, u_int32_t); int pflog_packet(struct pfi_kif *, struct mbuf *, sa_family_t, u_int8_t, u_int8_t, struct pf_rule *, struct pf_rule *, struct pf_ruleset *, struct pf_pdesc *); From owner-svn-src-stable-9@freebsd.org Fri Dec 25 15:12:55 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D78B5A510D5; Fri, 25 Dec 2015 15:12:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E7F919C9; Fri, 25 Dec 2015 15:12:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPFCs2a027653; Fri, 25 Dec 2015 15:12:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPFCs4H027650; Fri, 25 Dec 2015 15:12:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201512251512.tBPFCs4H027650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 25 Dec 2015 15:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292732 - in stable/9/sys: contrib/pf/net netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 15:12:55 -0000 Author: kp Date: Fri Dec 25 15:12:54 2015 New Revision: 292732 URL: https://svnweb.freebsd.org/changeset/base/292732 Log: pf: Fix IPv6 checksums with route-to. When using route-to (or reply-to) pf sends the packet directly to the output interface. If that interface doesn't support checksum offloading the checksum has to be calculated in software. That was already done in the IPv4 case, but not for the IPv6 case. As a result we'd emit packets with pseudo-header checksums (i.e. incorrect checksums). This issue was exposed by the changes in r289316 when pf stopped performing full checksum calculations for all packets. Submitted by: Luoqi Chen Modified: stable/9/sys/contrib/pf/net/pf.c stable/9/sys/netinet6/ip6_output.c stable/9/sys/netinet6/ip6_var.h Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Fri Dec 25 15:12:11 2015 (r292731) +++ stable/9/sys/contrib/pf/net/pf.c Fri Dec 25 15:12:54 2015 (r292732) @@ -6340,6 +6340,13 @@ pf_route6(struct mbuf **m, struct pf_rul ip6 = mtod(m0, struct ip6_hdr *); } + if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & + ~ifp->if_hwassist) { + uint32_t plen = m0->m_pkthdr.len - sizeof(*ip6); + in6_delayed_cksum(m0, plen, sizeof(struct ip6_hdr)); + m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } + /* * If the packet is too large for the outgoing interface, * send back an icmp6 error. Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Fri Dec 25 15:12:11 2015 (r292731) +++ stable/9/sys/netinet6/ip6_output.c Fri Dec 25 15:12:54 2015 (r292732) @@ -184,7 +184,7 @@ static int copypktopts(struct ip6_pktopt }\ } while (/*CONSTCOND*/ 0) -static void +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) { u_short csum; Modified: stable/9/sys/netinet6/ip6_var.h ============================================================================== --- stable/9/sys/netinet6/ip6_var.h Fri Dec 25 15:12:11 2015 (r292731) +++ stable/9/sys/netinet6/ip6_var.h Fri Dec 25 15:12:54 2015 (r292732) @@ -455,6 +455,7 @@ int in6_selectroute_fib(struct sockaddr_ struct rtentry **, u_int); u_int32_t ip6_randomid(void); u_int32_t ip6_randomflowlabel(void); +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset); #endif /* _KERNEL */ #endif /* !_NETINET6_IP6_VAR_H_ */ From owner-svn-src-stable-9@freebsd.org Sat Dec 26 18:38:11 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D875A53EF6; Sat, 26 Dec 2015 18:38:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2E701BEE; Sat, 26 Dec 2015 18:38:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBQIcAbS025666; Sat, 26 Dec 2015 18:38:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQIcAeM025665; Sat, 26 Dec 2015 18:38:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512261838.tBQIcAeM025665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 26 Dec 2015 18:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292755 - stable/9/bin/ed X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 18:38:11 -0000 Author: pfg Date: Sat Dec 26 18:38:09 2015 New Revision: 292755 URL: https://svnweb.freebsd.org/changeset/base/292755 Log: MFC r292454, r292455 ed(1): Prevent possible string overflows Use strlcpy to guarantee NULL termination. With hint from: imp, cem, ngie CID: 1007252 Modified: stable/9/bin/ed/main.c Directory Properties: stable/9/bin/ed/ (props changed) Modified: stable/9/bin/ed/main.c ============================================================================== --- stable/9/bin/ed/main.c Sat Dec 26 18:37:01 2015 (r292754) +++ stable/9/bin/ed/main.c Sat Dec 26 18:38:09 2015 (r292755) @@ -504,7 +504,8 @@ exec_command(void) return ERR; else if (open_sbuf() < 0) return FATAL; - if (*fnp && *fnp != '!') strcpy(old_filename, fnp); + if (*fnp && *fnp != '!') + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -531,7 +532,8 @@ exec_command(void) return ERR; } GET_COMMAND_SUFFIX(); - if (*fnp) strcpy(old_filename, fnp); + if (*fnp) + strlcpy(old_filename, fnp, PATH_MAX); printf("%s\n", strip_escapes(old_filename)); break; case 'g': @@ -662,7 +664,7 @@ exec_command(void) GET_COMMAND_SUFFIX(); if (!isglobal) clear_undo_stack(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -796,7 +798,7 @@ exec_command(void) return ERR; GET_COMMAND_SUFFIX(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename";