From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 03:33:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D6E81065670; Sun, 5 Jun 2011 03:33:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F20E38FC0C; Sun, 5 Jun 2011 03:33:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p553Xk56038340; Sun, 5 Jun 2011 03:33:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p553XkCB038338; Sun, 5 Jun 2011 03:33:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106050333.p553XkCB038338@svn.freebsd.org> From: Adrian Chadd Date: Sun, 5 Jun 2011 03:33: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: r222707 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 03:33:47 -0000 Author: adrian Date: Sun Jun 5 03:33:46 2011 New Revision: 222707 URL: http://svn.freebsd.org/changeset/base/222707 Log: Add a missing call to sync the DMAed buffer before the radar event data is extracted. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jun 5 02:44:04 2011 (r222706) +++ head/sys/dev/ath/if_ath.c Sun Jun 5 03:33:46 2011 (r222707) @@ -3473,7 +3473,15 @@ ath_rx_proc(void *arg, int npending) if (rs->rs_status & HAL_RXERR_PHY) { sc->sc_stats.ast_rx_phyerr++; /* Process DFS radar events */ - ath_dfs_process_phy_err(sc, mtod(m, char *), tsf, rs); + if ((rs->rs_phyerr == HAL_PHYERR_RADAR) || + (rs->rs_phyerr == HAL_PHYERR_FALSE_RADAR_EXT)) { + /* Since we're touching the frame data, sync it */ + bus_dmamap_sync(sc->sc_dmat, + bf->bf_dmamap, + BUS_DMASYNC_POSTREAD); + /* Now pass it to the radar processing code */ + ath_dfs_process_phy_err(sc, mtod(m, char *), tsf, rs); + } /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ if (rs->rs_phyerr < 64) From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 08:20:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69DA21065673; Sun, 5 Jun 2011 08:20:11 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 46BB98FC13; Sun, 5 Jun 2011 08:20:10 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p558K7jN008461 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 5 Jun 2011 01:20:08 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4DEB3C32.9070709@freebsd.org> Date: Sun, 05 Jun 2011 01:20:02 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Robert Watson References: <201106042331.p54NVfC0030751@svn.freebsd.org> In-Reply-To: <201106042331.p54NVfC0030751@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: r222702 - 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, 05 Jun 2011 08:20:11 -0000 On 6/4/11 4:31 PM, Robert Watson wrote: > Author: rwatson > Date: Sat Jun 4 23:31:41 2011 > New Revision: 222702 > URL: http://svn.freebsd.org/changeset/base/222702 > > Log: > Allocate four bits from the mbuf flags field to represent the hash > type of a software- or hardware-generated hash held in the > mbuf.m_pkthdr.flowid field, and provide accessor macros to easily > clear, set, receive, and test for hash values. Some of these > constants correspond to RSS hash types, but we don't want to limit > ourselves to that, as a number of other hashing techniques are in > use on hardware supported by FreeBSD. > > Mark the M_FLOWID flag as deprecated; I hope to remove this before > 9.0, changing drivers and the stack over to using the new > M_HASHTYPEBITS, most likely to use M_HASHTYPE_OPAQUE as we don't yet > want to nail down the KPI for RSS key/bucket management for device > drivers. > > MFC after: 3 days > Reviewed by: bz > Sponsored by: Juniper Networks, Inc. > > Modified: > head/sys/sys/mbuf.h > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Sat Jun 4 23:31:33 2011 (r222701) > +++ head/sys/sys/mbuf.h Sat Jun 4 23:31:41 2011 (r222702) > @@ -199,7 +199,9 @@ struct mbuf { > #define M_PROTO6 0x00080000 /* protocol-specific */ > #define M_PROTO7 0x00100000 /* protocol-specific */ > #define M_PROTO8 0x00200000 /* protocol-specific */ > -#define M_FLOWID 0x00400000 /* flowid is valid */ > +#define M_FLOWID 0x00400000 /* deprecated: flowid is valid */ > +#define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid hash type */ > + > /* > * For RELENG_{6,7} steal these flags for limited multiple routing table > * support. In RELENG_8 and beyond, use just one flag and a tag. > @@ -215,11 +217,45 @@ struct mbuf { > (M_PROTO1|M_PROTO2|M_PROTO3|M_PROTO4|M_PROTO5|M_PROTO6|M_PROTO7|M_PROTO8) > > /* > + * Network interface cards are able to hash protocol fields (such as IPv4 > + * addresses and TCP port numbers) classify packets into flows. These flows > + * can then be used to maintain ordering while delivering packets to the OS > + * via parallel input queues, as well as to provide a stateless affinity > + * model. NIC drivers can pass up the hash via m->m_pkthdr.flowid, and set > + * m_flag fields to indicate how the hash should be interpreted by the > + * network stack. > + * > + * Most NICs support RSS, which provides ordering and explicit affinity, and > + * use the hash m_flag bits to indicate what header fields were covered by > + * the hash. M_HASHTYPE_OPAQUE can be set by non-RSS cards or configurations > + * that provide an opaque flow identifier, allowing for ordering and > + * distribution without explicit affinity. > + */ > +#define M_HASHTYPE_SHIFT 24 > +#define M_HASHTYPE_NONE 0x0 > +#define M_HASHTYPE_RSS_IPV4 0x1 /* IPv4 2-tuple */ > +#define M_HASHTYPE_RSS_TCP_IPV4 0x2 /* TCPv4 4-tuple */ > +#define M_HASHTYPE_RSS_IPV6 0x3 /* IPv6 2-tuple */ > +#define M_HASHTYPE_RSS_TCP_IPV6 0x4 /* TCPv6 4-tuple */ > +#define M_HASHTYPE_RSS_IPV6_EX 0x5 /* IPv6 2-tuple + ext hdrs */ > +#define M_HASHTYPE_RSS_TCP_IPV6_EX 0x6 /* TCPv6 4-tiple + ext hdrs */ > +#define M_HASHTYPE_OPAQUE 0xf /* ordering, not affinity */ > + > +#define M_HASHTYPE_CLEAR(m) (m)->m_flags&= ~(M_HASHTYPEBITS) > +#define M_HASHTYPE_GET(m) (((m)->m_flags& M_HASHTYPEBITS)>> \ > + M_HASHTYPE_SHIFT) > +#define M_HASHTYPE_SET(m, v) do { \ > + (m)->m_flags&= ~M_HASHTYPEBITS; \ > + (m)->m_flags |= ((v)<< M_HASHTYPE_SHIFT); \ > +while (0) > +#define M_HASHTYPE_TEST(m, v) (M_HASHTYPE_GET(m) == (v)) > + > +/* > * Flags preserved when copying m_pkthdr. > */ > #define M_COPYFLAGS \ > (M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_SKIP_FIREWALL|M_BCAST|M_MCAST|\ > - M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_FIB) > + M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_FIB|M_HASHTYPEBITS) > > /* > * External buffer types: identify ext_buf type. > > hmm note that my stealing of 4 bits for FIB was supposed to go away for 8 and beyond. We need to do an mbuf redesign.. at this stage, I guess it's a project for 10. From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 09:20:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 365971065670; Sun, 5 Jun 2011 09:20:35 +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 115C08FC08; Sun, 5 Jun 2011 09:20:35 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7138E46B03; Sun, 5 Jun 2011 05:20:34 -0400 (EDT) Date: Sun, 5 Jun 2011 10:20:34 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Julian Elischer In-Reply-To: <4DEB3C32.9070709@freebsd.org> Message-ID: References: <201106042331.p54NVfC0030751@svn.freebsd.org> <4DEB3C32.9070709@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: r222702 - 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, 05 Jun 2011 09:20:35 -0000 On Sun, 5 Jun 2011, Julian Elischer wrote: > hmm note that my stealing of 4 bits for FIB was supposed to go away for 8 > and beyond. We need to do an mbuf redesign.. at this stage, I guess it's a > project for 10. Indeed -- it would be nice not just to reclaim the FIB bits, but also to support more simultaneous FIBs. We still need to do a KBI analysis of mbuf for 9.0 across various architectures, but it would be pretty late to fix the FIB thing. On a redesign, clearly too late for that as well. I still hope we can get the variable size mbuf cluster in for 10 though. Robert From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 10:07:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43BCB1065678; Sun, 5 Jun 2011 10:07:13 +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 334D98FC12; Sun, 5 Jun 2011 10:07:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55A7DAp050921; Sun, 5 Jun 2011 10:07:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55A7DAn050912; Sun, 5 Jun 2011 10:07:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201106051007.p55A7DAn050912@svn.freebsd.org> From: Robert Watson Date: Sun, 5 Jun 2011 10:07: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: r222709 - 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, 05 Jun 2011 10:07:13 -0000 Author: rwatson Date: Sun Jun 5 10:07:12 2011 New Revision: 222709 URL: http://svn.freebsd.org/changeset/base/222709 Log: Correct a last minute merge error for new M_HASHTYPE macros. This didn't turn up as a build problem because the macros aren't used (yet). MFC after: 3 days Sponsored by: Juniper Networks, Inc. Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sun Jun 5 07:55:51 2011 (r222708) +++ head/sys/sys/mbuf.h Sun Jun 5 10:07:12 2011 (r222709) @@ -247,7 +247,7 @@ struct mbuf { #define M_HASHTYPE_SET(m, v) do { \ (m)->m_flags &= ~M_HASHTYPEBITS; \ (m)->m_flags |= ((v) << M_HASHTYPE_SHIFT); \ -while (0) +} while (0) #define M_HASHTYPE_TEST(m, v) (M_HASHTYPE_GET(m) == (v)) /* From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 11:37:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E4101065674; Sun, 5 Jun 2011 11:37:21 +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 4DC818FC26; Sun, 5 Jun 2011 11:37:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55BbLV2054502; Sun, 5 Jun 2011 11:37:21 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55BbLv5054499; Sun, 5 Jun 2011 11:37:21 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106051137.p55BbLv5054499@svn.freebsd.org> From: Hiroki Sato Date: Sun, 5 Jun 2011 11:37: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: r222711 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 11:37:21 -0000 Author: hrs Date: Sun Jun 5 11:37:20 2011 New Revision: 222711 URL: http://svn.freebsd.org/changeset/base/222711 Log: Add the "nd6 options" line handler as af_other_status() of AF_INET6, not as an own address family. Reviewed by: bz Modified: head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_nd6.c Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Sun Jun 5 11:20:19 2011 (r222710) +++ head/sbin/ifconfig/af_inet6.c Sun Jun 5 11:37:20 2011 (r222711) @@ -69,6 +69,7 @@ static int explicit_prefix = 0; extern void setnd6flags(const char *, int, int, const struct afswtch *); extern void setnd6defif(const char *, int, int, const struct afswtch *); +extern void nd6_status(int); static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ @@ -519,6 +520,7 @@ static struct afswtch af_inet6 = { .af_status = in6_status, .af_getaddr = in6_getaddr, .af_getprefix = in6_getprefix, + .af_other_status = nd6_status, .af_postproc = in6_postproc, .af_status_tunnel = in6_status_tunnel, .af_settunnel = in6_set_tunnel, Modified: head/sbin/ifconfig/af_nd6.c ============================================================================== --- head/sbin/ifconfig/af_nd6.c Sun Jun 5 11:20:19 2011 (r222710) +++ head/sbin/ifconfig/af_nd6.c Sun Jun 5 11:37:20 2011 (r222711) @@ -63,6 +63,7 @@ static const char rcsid[] = static int isnd6defif(int); void setnd6flags(const char *, int, int, const struct afswtch *); void setnd6defif(const char *, int, int, const struct afswtch *); +void nd6_status(int); void setnd6flags(const char *dummyaddr __unused, @@ -136,64 +137,13 @@ isnd6defif(int s) return (ndifreq.ifindex == ifindex); } -static void +void nd6_status(int s) { struct in6_ndireq nd; - struct rt_msghdr *rtm; - size_t needed; - char *buf, *next; - int mib[6], ntry; int s6; int error; - int isinet6, isdefif; - - /* Check if the interface has at least one IPv6 address. */ - mib[0] = CTL_NET; - mib[1] = PF_ROUTE; - mib[2] = 0; - mib[3] = AF_INET6; - mib[4] = NET_RT_IFLIST; - mib[5] = if_nametoindex(ifr.ifr_name); - - /* Try to prevent a race between two sysctls. */ - ntry = 0; - do { - error = sysctl(mib, 6, NULL, &needed, NULL, 0); - if (error) { - warn("sysctl(NET_RT_IFLIST)/estimate"); - return; - } - buf = malloc(needed); - if (buf == NULL) { - warn("malloc for sysctl(NET_RT_IFLIST) failed"); - return; - } - if ((error = sysctl(mib, 6, buf, &needed, NULL, 0)) < 0) { - if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) { - warn("sysctl(NET_RT_IFLIST)/get"); - free(buf); - return; - } - free(buf); - buf = NULL; - } - } while (buf == NULL); - - isinet6 = 0; - for (next = buf; next < buf + needed; next += rtm->rtm_msglen) { - rtm = (struct rt_msghdr *)next; - - if (rtm->rtm_version != RTM_VERSION) - continue; - if (rtm->rtm_type == RTM_NEWADDR) { - isinet6 = 1; - break; - } - } - free(buf); - if (!isinet6) - return; + int isdefif; memset(&nd, 0, sizeof(nd)); strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); @@ -215,19 +165,3 @@ nd6_status(int s) (unsigned int)(nd.ndi.flags | (isdefif << 15)), ND6BITS); putchar('\n'); } - -static struct afswtch af_nd6 = { - .af_name = "nd6", - .af_af = AF_LOCAL, - .af_other_status= nd6_status, -}; - -static __constructor void -nd6_ctor(void) -{ - - if (!feature_present("inet6")) - return; - - af_register(&af_nd6); -} From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 11:40:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B69A1065674; Sun, 5 Jun 2011 11:40:31 +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 EF84E8FC0C; Sun, 5 Jun 2011 11:40:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55BeULS054768; Sun, 5 Jun 2011 11:40:30 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55BeUXV054766; Sun, 5 Jun 2011 11:40:30 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106051140.p55BeUXV054766@svn.freebsd.org> From: Hiroki Sato Date: Sun, 5 Jun 2011 11: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: r222712 - 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: Sun, 05 Jun 2011 11:40:31 -0000 Author: hrs Date: Sun Jun 5 11:40:30 2011 New Revision: 222712 URL: http://svn.freebsd.org/changeset/base/222712 Log: Use uint8_t for sockaddr sa_len. Reviewed by: bz Modified: head/sys/netinet6/send.h Modified: head/sys/netinet6/send.h ============================================================================== --- head/sys/netinet6/send.h Sun Jun 5 11:37:20 2011 (r222711) +++ head/sys/netinet6/send.h Sun Jun 5 11:40:30 2011 (r222712) @@ -33,7 +33,7 @@ #define SND_IN 1 /* Incoming traffic. */ struct sockaddr_send { - unsigned char send_len; /* total length */ + uint8_t send_len; /* total length */ sa_family_t send_family; /* address family */ int send_direction; int send_ifidx; From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 12:46:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEC701065673; Sun, 5 Jun 2011 12:46:26 +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 CDF478FC0C; Sun, 5 Jun 2011 12:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55CkQiB060818; Sun, 5 Jun 2011 12:46:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55CkQ2U060817; Sun, 5 Jun 2011 12:46:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106051246.p55CkQ2U060817@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 5 Jun 2011 12:46: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: r222715 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 12:46:27 -0000 Author: jilles Date: Sun Jun 5 12:46:26 2011 New Revision: 222715 URL: http://svn.freebsd.org/changeset/base/222715 Log: sh: Add already working testcases for $? in here-document. If the here-document is attached to a compound command or subshell, $? already works properly. This is both a workaround for bin/41410 and a requirement for a true fix for bin/41410. PR: bin/41410 MFC after: 1 week Added: head/tools/regression/bin/sh/expansion/heredoc1.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/heredoc1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/heredoc1.0 Sun Jun 5 12:46:26 2011 (r222715) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +f() { return $1; } + +[ `f 42; { cat; } < Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0864106566C; Sun, 5 Jun 2011 12:57:35 +0000 (UTC) (envelope-from bob@immure.com) Received: from maul.immure.com (adsl-66-136-206-1.dsl.austtx.swbell.net [66.136.206.1]) by mx1.freebsd.org (Postfix) with ESMTP id 51D5C8FC08; Sun, 5 Jun 2011 12:57:34 +0000 (UTC) Received: from rancor.immure.com (rancor.immure.com [10.1.132.9]) by maul.immure.com (8.14.4/8.14.4) with ESMTP id p55Cgp0U005220; Sun, 5 Jun 2011 07:42:51 -0500 (CDT) (envelope-from bob@immure.com) Received: (from bob@localhost) by rancor.immure.com (8.14.4/8.14.4/Submit) id p55Cgn3g002820; Sun, 5 Jun 2011 07:42:49 -0500 (CDT) (envelope-from bob) Date: Sun, 5 Jun 2011 07:42:49 -0500 From: Bob Willcox To: Charlie Kester Message-ID: <20110605124249.GA98612@rancor.immure.com> References: <201102052134.p15LYRmw041695@svn.freebsd.org> <20110316135122.GB7185@rancor.immure.com> <4D814AAA.3070801@FreeBSD.org> <20110320141501.GB19338@rancor.immure.com> <4D860C9A.7020600@FreeBSD.org> <20110320163019.GA32910@rancor.immure.com> <20110320170608.GE1019@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110320170608.GE1019@comcast.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-immure-MailScanner-Information: Please contact the ISP for more information X-immure-MailScanner-ID: p55Cgp0U005220 X-immure-MailScanner: Found to be clean X-immure-MailScanner-From: bob@immure.com X-Spam-Status: No Cc: svn-src-stable@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-stable-8@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r218347 - stable/8/sys/dev/ata/chipsets - still fails X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bob Willcox List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 12:57:35 -0000 On Sun, Mar 20, 2011 at 10:06:08AM -0700, Charlie Kester wrote: > On Sun 20 Mar 2011 at 09:30:20 PDT Bob Willcox wrote: > >On Sun, Mar 20, 2011 at 04:18:02PM +0200, Alexander Motin wrote: > >> Bob Willcox wrote: > >> > On Thu, Mar 17, 2011 at 01:41:30AM +0200, Alexander Motin wrote: > >> >> On 16.03.2011 15:51, Bob Willcox wrote: > >> >>> This change has broken SATA disk support on my Intel Atom D525 ITX system. By > >> >>> reverting this change 8.2-STABLE works again on this system. > >> >>> > >> >>> My 'uname -a' output is: > >> >>> > >> >>> FreeBSD maul.immure.com 8.2-STABLE FreeBSD 8.2-STABLE #6: Wed Mar 16 08:15:43 CDT 2011 bob@maul.immure.com:/usr/obj/usr/src/sys/MAUL amd64 > >> >>> > >> >>> When booting the system I get tons of these messages: > >> >>> > >> >>> Mar 16 07:38:19 maul kernel: ad4: WARNING - SETFEATURES ENABLE RCACHE requeued due to channel reset > >> >>> Mar 16 07:38:19 maul kernel: ad4: interrupt on idle channel ignored > >> >> As I can see, it means that channel has some active request, but it is > >> >> in IDLE state. It is strange, but I won't be surprised much if it is the > >> >> result of some locking problem in ata(4) in non-CAM mode. > >> >> > >> >>> repeated over and over, and then lots of these: > >> >>> > >> >>> Mar 16 07:38:21 maul kernel: ad4: WARNING - READ_DMA48 requeued due to channel reset LBA=617964479 > >> >>> Mar 16 07:38:21 maul kernel: ata2: FAILURE - already active DMA on this device > >> >>> Mar 16 07:38:21 maul kernel: ata2: setting up DMA failed > >> >>> > >> >>> for different LBA values. > >> >>> > >> >>> As one might expect, I then start seeing I/O errors on the disk and programs > >> >>> failing > >> >>> > >> >>> I've attached the 'pciconf -lv' output. > >> >> Send me please full verbose log, if you can save it. I am especially > >> >> interested in place around first errors. > >> >> > >> >> You may try to build kernel with `options ATA_CAM` to see if it helps. > >> >> I've mostly tested this patch in that mode. > >> > > >> > I tried setting `options ATA_CAM` but that didn't fix the problem. I still got > >> > continuous ATA error messages spewed out while probing the ATA devices. I'm > >> > not able to capture the verbose output as the system never successfully boots > >> > and I don't have a serial console attached to the system. > >> > >> It's strange. Can you at least show errors you received in that case? I > >> suppose they should be different from the original. > > > >They were similar, though this time there was mention of CAM in them (which I > >assumed was the result of using the CAM interface). The trouble is they roll > >by quite fast and I'm unable to stop them from scrolling. > > > >If this wasn't my most critical system I'd try debugging it more, but I really > >can't afford for this machine to be out of service. I was hoping that someone > >with one of these same motherboards: > > > >http://www.intel.com/Products/Desktop/Motherboards/db-d525mw/D525MW-overview.htm > > > >in a less critical situation might have also seen the problem and been able to > >do more debugging of it than I am inclined to. > > > >Bob > > FWIW, this problem isn't confined to the D525's. I saw the same problem > on my D510MO sometime between 8.2-RC3 and -RELEASE. My mobo has the > NM10 chipset, which is also used on the D525. > > I've since reverted to RC3 and have been postponing an upgrade to > -STABLE until this issue is resolved. Like Bob, I can't afford to have > this machine disabled. > > Nor am I able to gather any logs, etc., because I don't have a serial > terminal and the problem makes any disk io unreliable. Against my better judgement, I decided to give the latest version of ata-intel.c another try on my gateway system yesterday. Unfortunately, the problem still persists. To complicate matters upon installing the new kernel for some reason my old (working) kernel was NOT saved in /boot/kernel.old. I have no idea why, and didn't notice this till after attempting to reboot the old kernel (when the new kernel failed). Several hours of frantic recovery later I finally got my system back up with a new kernel and the old version of ata-intel.c that still works (had some minor adjustments to make on it due to the removal of a symbol that it used, ATA_I82801IB_AH2). I do find it hard to believe that Charlie and I are the only ones out there with systems that fail with this newer version of the driver. I wish I could help debug it more than I've been able to, but this is the only system I have with this hardware and it's my most critical one to be up and running. Bob > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Bob Willcox "In the age of the internet attaching a famous name to bob@immure.com your personal opinion to give more weight to it is a very Austin, TX valid strategy." -- Benjamin Franklin From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 14:02:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FAC51065670; Sun, 5 Jun 2011 14:02:41 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-wy0-f196.google.com (mail-wy0-f196.google.com [74.125.82.196]) by mx1.freebsd.org (Postfix) with ESMTP id A42D58FC0A; Sun, 5 Jun 2011 14:02:39 +0000 (UTC) Received: by wyf28 with SMTP id 28so507808wyf.7 for ; Sun, 05 Jun 2011 07:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=uLjusDGIAoMw12UKXv8CSXxLsXIkzlk8adu9Br1wygY=; b=f1NEbgu5W2C1IaaWtyyTy3cTCw/rL0egQl71R6hLlD2Lkt4ypSxGFBnw7krC00znxY qqXK3+BVTTZ0hOkUpjBrECV5dNZVGblBdp9thnp44Rt4SULo5E+JeBJMZXgQLsyw1fII 51jHx/pC5AEdvAQrCHVqvlZ69SbBSxtmddktQ= 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=icV/Mubbe/KnUXKkgyXmEsB2dwih2/GWR9og02huJu8W0vNkw4/bhaa2RrE3s9BWAa APTb37FetXRcj0wdMGHHihQ4/mt2+dL3oyq/hsWWXBpzPeLYt2dsJqDEdTH/wgrvL3af k/yloplUuzYfhF90riJfbYiZHK9Am45NpZZSo= MIME-Version: 1.0 Received: by 10.227.201.16 with SMTP id ey16mr2299565wbb.30.1307282557091; Sun, 05 Jun 2011 07:02:37 -0700 (PDT) Received: by 10.227.209.209 with HTTP; Sun, 5 Jun 2011 07:02:37 -0700 (PDT) In-Reply-To: <201103060849.p268nitH091290@svn.freebsd.org> References: <201103060849.p268nitH091290@svn.freebsd.org> Date: Sun, 5 Jun 2011 16:02:37 +0200 Message-ID: From: Oliver Pinter To: David Schultz Content-Type: multipart/mixed; boundary=00151758b0ac6fc0e904a4f770a2 Cc: ports@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r219323 - in stable/8/lib/msun: . man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 14:02:41 -0000 --00151758b0ac6fc0e904a4f770a2 Content-Type: text/plain; charset=ISO-8859-1 On 3/6/11, David Schultz wrote: > Author: das > Date: Sun Mar 6 08:49:44 2011 > New Revision: 219323 > URL: http://svn.freebsd.org/changeset/base/219323 > > Log: > MFC > r216210: refactor log(3) > r216211: add log2(3) and log2f(3) > > Added: > stable/8/lib/msun/src/e_log2.c > - copied unchanged from r216211, head/lib/msun/src/e_log2.c > stable/8/lib/msun/src/e_log2f.c > - copied unchanged from r216211, head/lib/msun/src/e_log2f.c > stable/8/lib/msun/src/k_log.h > - copied unchanged from r216210, head/lib/msun/src/k_log.h > stable/8/lib/msun/src/k_logf.h > - copied unchanged from r216210, head/lib/msun/src/k_logf.h > Modified: > stable/8/lib/msun/Makefile > stable/8/lib/msun/Symbol.map > stable/8/lib/msun/man/log.3 > stable/8/lib/msun/man/math.3 > stable/8/lib/msun/src/math.h > stable/8/lib/msun/src/math_private.h > Directory Properties: > stable/8/lib/msun/ (props changed) > > Modified: stable/8/lib/msun/Makefile > ============================================================================== > --- stable/8/lib/msun/Makefile Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/Makefile Sun Mar 6 08:49:44 2011 (r219323) > @@ -45,7 +45,8 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c > e_expf.c e_fmod.c e_fmodf.c e_gamma.c e_gamma_r.c e_gammaf.c \ > e_gammaf_r.c e_hypot.c e_hypotf.c e_j0.c e_j0f.c e_j1.c e_j1f.c \ > e_jn.c e_jnf.c e_lgamma.c e_lgamma_r.c e_lgammaf.c e_lgammaf_r.c \ > - e_log.c e_log10.c e_log10f.c e_logf.c e_pow.c e_powf.c e_rem_pio2.c \ > + e_log.c e_log10.c e_log10f.c e_log2.c e_log2f.c e_logf.c \ > + e_pow.c e_powf.c e_rem_pio2.c \ > e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \ > e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c fenv.c \ > k_cos.c k_cosf.c k_rem_pio2.c k_sin.c k_sinf.c \ > @@ -164,7 +165,7 @@ MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0 > MLINKS+=j0.3 j0f.3 j0.3 j1f.3 j0.3 jnf.3 j0.3 y0f.3 j0.3 ynf.3 > MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 lgammaf.3 \ > lgamma.3 tgamma.3 lgamma.3 tgammaf.3 > -MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log1p.3 log.3 log1pf.3 log.3 > logf.3 > +MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log1p.3 log.3 log1pf.3 log.3 > logf.3 log.3 log2.3 log.3 log2f.3 > MLINKS+=lrint.3 llrint.3 lrint.3 llrintf.3 lrint.3 llrintl.3 \ > lrint.3 lrintf.3 lrint.3 lrintl.3 > MLINKS+=lround.3 llround.3 lround.3 llroundf.3 lround.3 llroundl.3 \ > > Modified: stable/8/lib/msun/Symbol.map > ============================================================================== > --- stable/8/lib/msun/Symbol.map Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/Symbol.map Sun Mar 6 08:49:44 2011 (r219323) > @@ -218,3 +218,10 @@ FBSD_1.1 { > cprojf; > cprojl; > }; > + > +/* First added in 9.0-CURRENT */ > +FBSD_1.2 { > + __isnanf; > + log2; > + log2f; > +}; > > Modified: stable/8/lib/msun/man/log.3 > ============================================================================== > --- stable/8/lib/msun/man/log.3 Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/man/log.3 Sun Mar 6 08:49:44 2011 (r219323) > @@ -1,4 +1,4 @@ > -.\" Copyright (c) 2008 David Schultz > +.\" Copyright (c) 2008-2010 David Schultz > .\" All rights reserved. > .\" > .\" Redistribution and use in source and binary forms, with or without > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 17, 2008 > +.Dd December 5, 2010 > .Dt LOG 3 > .Os > .Sh NAME > @@ -33,6 +33,8 @@ > .Nm logl , > .Nm log10 , > .Nm log10f , > +.Nm log2 , > +.Nm log2f , > .Nm log1p , > .Nm log1pf > .Nd logarithm functions > @@ -49,6 +51,10 @@ > .Ft float > .Fn log10f "float x" > .Ft double > +.Fn log2 "double x" > +.Ft float > +.Fn log2f "float x" > +.Ft double > .Fn log1p "double x" > .Ft float > .Fn log1pf "float x" > @@ -65,6 +71,12 @@ The > and > .Fn log10f > functions compute the logarithm base 10 of > +.Fa x , > +while > +.Fn log2 > +and > +.Fn log2f > +compute the logarithm base 2 of > .Fa x . > .Pp > The > @@ -97,6 +109,8 @@ The > .Fn logf , > .Fn log10 , > .Fn log10f , > +.Fn log2 , > +.Fn log2f , > .Fn log1p , > and > .Fn log1pf > > Modified: stable/8/lib/msun/man/math.3 > ============================================================================== > --- stable/8/lib/msun/man/math.3 Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/man/math.3 Sun Mar 6 08:49:44 2011 (r219323) > @@ -28,7 +28,7 @@ > .\" from: @(#)math.3 6.10 (Berkeley) 5/6/91 > .\" $FreeBSD$ > .\" > -.Dd December 16, 2007 > +.Dd December 5, 2010 > .Dt MATH 3 > .Os > .if n \{\ > @@ -185,7 +185,7 @@ lgamma log gamma function > log natural logarithm > log10 logarithm to base 10 > log1p log(1+x) > -.\" log2 base 2 logarithm > +log2 base 2 logarithm > pow exponential x**y > sin trigonometric function > sinh hyperbolic function > @@ -197,7 +197,7 @@ y1 Bessel function of the second kind of > yn Bessel function of the second kind of the order n > .El > .Pp > -Unlike the algebraic functions listed earlier, the routines > +The routines > in this section may not produce a result that is correctly rounded, > so reproducible results cannot be guaranteed across platforms. > For most of these functions, however, incorrect rounding occurs > @@ -224,18 +224,20 @@ and > values, were written for or imported into subsequent versions of FreeBSD. > .Sh BUGS > The > -.Fn log2 > -function is missing, and many functions are not available in their > +.Fn cbrt > +function and many of the transcendental functions > +are not available in their > .Vt "long double" > variants. > .Pp > Many of the routines to compute transcendental functions produce > inaccurate results in other than the default rounding mode. > .Pp > -On some architectures, trigonometric argument reduction is not > -performed accurately, resulting in errors greater than 1 > +On the i386 platform, trigonometric argument reduction is not > +performed accurately for very large arguments, resulting in errors > +greater than 1 > .Em ulp > -for large arguments to > +for such arguments to > .Fn cos , > .Fn sin , > and > > Copied: stable/8/lib/msun/src/e_log2.c (from r216211, > head/lib/msun/src/e_log2.c) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/lib/msun/src/e_log2.c Sun Mar 6 08:49:44 2011 (r219323, copy > of r216211, head/lib/msun/src/e_log2.c) > @@ -0,0 +1,60 @@ > + > +/* @(#)e_log10.c 1.3 95/01/18 */ > +/* > + * ==================================================== > + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > + * > + * Developed at SunSoft, a Sun Microsystems, Inc. business. > + * Permission to use, copy, modify, and distribute this > + * software is freely granted, provided that this notice > + * is preserved. > + * ==================================================== > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* log2(x) > + * Return the base 2 logarithm of x. > + */ > + > +#include "math.h" > +#include "math_private.h" > +#include "k_log.h" > + > +static const double > +two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ > +ivln2hi = 0x1.71547652000p+0, > +ivln2lo = 0x1.705fc2eefa2p-33; > + > +static const double zero = 0.0; > + > +double > +__ieee754_log2(double x) > +{ > + double f,hi,lo; > + int32_t i,k,hx; > + u_int32_t lx; > + > + EXTRACT_WORDS(hx,lx,x); > + > + k=0; > + if (hx < 0x00100000) { /* x < 2**-1022 */ > + if (((hx&0x7fffffff)|lx)==0) > + return -two54/zero; /* log(+-0)=-inf */ > + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ > + k -= 54; x *= two54; /* subnormal number, scale up x */ > + GET_HIGH_WORD(hx,x); > + } > + if (hx >= 0x7ff00000) return x+x; > + k += (hx>>20)-1023; > + hx &= 0x000fffff; > + i = (hx+0x95f64)&0x100000; > + SET_HIGH_WORD(x,hx|(i^0x3ff00000)); /* normalize x or x/2 */ > + k += (i>>20); > + f = __kernel_log(x); > + hi = x = x - 1; > + SET_LOW_WORD(hi,0); > + lo = x - hi; > + return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; > +} > > Copied: stable/8/lib/msun/src/e_log2f.c (from r216211, > head/lib/msun/src/e_log2f.c) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/lib/msun/src/e_log2f.c Sun Mar 6 08:49:44 2011 (r219323, copy > of r216211, head/lib/msun/src/e_log2f.c) > @@ -0,0 +1,54 @@ > +/* > + * ==================================================== > + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > + * > + * Developed at SunPro, a Sun Microsystems, Inc. business. > + * Permission to use, copy, modify, and distribute this > + * software is freely granted, provided that this notice > + * is preserved. > + * ==================================================== > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include "math.h" > +#include "math_private.h" > +#include "k_logf.h" > + > +static const float > +two25 = 3.3554432000e+07, /* 0x4c000000 */ > +ivln2hi = 0x1.716p+0f, > +ivln2lo = -0x1.7135a8fa03d11p-13; > + > +static const float zero = 0.0; > + > +float > +__ieee754_log2f(float x) > +{ > + float f,hi,lo; > + int32_t i,k,hx; > + > + GET_FLOAT_WORD(hx,x); > + > + k=0; > + if (hx < 0x00800000) { /* x < 2**-126 */ > + if ((hx&0x7fffffff)==0) > + return -two25/zero; /* log(+-0)=-inf */ > + if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ > + k -= 25; x *= two25; /* subnormal number, scale up x */ > + GET_FLOAT_WORD(hx,x); > + } > + if (hx >= 0x7f800000) return x+x; > + k += (hx>>23)-127; > + hx &= 0x007fffff; > + i = (hx+(0x4afb0d))&0x800000; > + SET_FLOAT_WORD(x,hx|(i^0x3f800000)); /* normalize x or x/2 */ > + k += (i>>23); > + f = __kernel_logf(x); > + x = x - 1; > + GET_FLOAT_WORD(hx,x); > + SET_FLOAT_WORD(hi,hx&0xfffff000); > + lo = x - hi; > + return (x+f)*ivln2lo + (lo+f)*ivln2hi + hi*ivln2hi + k; > +} > > Copied: stable/8/lib/msun/src/k_log.h (from r216210, > head/lib/msun/src/k_log.h) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/lib/msun/src/k_log.h Sun Mar 6 08:49:44 2011 (r219323, copy of > r216210, head/lib/msun/src/k_log.h) > @@ -0,0 +1,116 @@ > + > +/* @(#)e_log.c 1.3 95/01/18 */ > +/* > + * ==================================================== > + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > + * > + * Developed at SunSoft, a Sun Microsystems, Inc. business. > + * Permission to use, copy, modify, and distribute this > + * software is freely granted, provided that this notice > + * is preserved. > + * ==================================================== > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* __kernel_log(x) > + * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. > + * > + * The following describes the overall strategy for computing > + * logarithms in base e. The argument reduction and adding the final > + * term of the polynomial are done by the caller for increased accuracy > + * when different bases are used. > + * > + * Method : > + * 1. Argument Reduction: find k and f such that > + * x = 2^k * (1+f), > + * where sqrt(2)/2 < 1+f < sqrt(2) . > + * > + * 2. Approximation of log(1+f). > + * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) > + * = 2s + 2/3 s**3 + 2/5 s**5 + ....., > + * = 2s + s*R > + * We use a special Reme algorithm on [0,0.1716] to generate > + * a polynomial of degree 14 to approximate R The maximum error > + * of this polynomial approximation is bounded by 2**-58.45. In > + * other words, > + * 2 4 6 8 10 12 14 > + * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s > + * (the values of Lg1 to Lg7 are listed in the program) > + * and > + * | 2 14 | -58.45 > + * | Lg1*s +...+Lg7*s - R(z) | <= 2 > + * | | > + * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2. > + * In order to guarantee error in log below 1ulp, we compute log > + * by > + * log(1+f) = f - s*(f - R) (if f is not too large) > + * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy) > + * > + * 3. Finally, log(x) = k*ln2 + log(1+f). > + * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo))) > + * Here ln2 is split into two floating point number: > + * ln2_hi + ln2_lo, > + * where n*ln2_hi is always exact for |n| < 2000. > + * > + * Special cases: > + * log(x) is NaN with signal if x < 0 (including -INF) ; > + * log(+INF) is +INF; log(0) is -INF with signal; > + * log(NaN) is that NaN with no signal. > + * > + * Accuracy: > + * according to an error analysis, the error is always less than > + * 1 ulp (unit in the last place). > + * > + * Constants: > + * The hexadecimal values are the intended ones for the following > + * constants. The decimal values may be used, provided that the > + * compiler will convert from decimal to binary accurately enough > + * to produce the hexadecimal values shown. > + */ > + > +static const double > +Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */ > +Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */ > +Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */ > +Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */ > +Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */ > +Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */ > +Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ > + > +/* > + * We always inline __kernel_log(), since doing so produces a > + * substantial performance improvement (~40% on amd64). > + */ > +static inline double > +__kernel_log(double x) > +{ > + double hfsq,f,s,z,R,w,t1,t2; > + int32_t hx,i,j; > + u_int32_t lx; > + > + EXTRACT_WORDS(hx,lx,x); > + > + f = x-1.0; > + if((0x000fffff&(2+hx))<3) { /* -2**-20 <= f < 2**-20 */ > + if(f==0.0) return 0.0; > + return f*f*(0.33333333333333333*f-0.5); > + } > + s = f/(2.0+f); > + z = s*s; > + hx &= 0x000fffff; > + i = hx-0x6147a; > + w = z*z; > + j = 0x6b851-hx; > + t1= w*(Lg2+w*(Lg4+w*Lg6)); > + t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); > + i |= j; > + R = t2+t1; > + if (i>0) { > + hfsq=0.5*f*f; > + return s*(hfsq+R) - hfsq; > + } else { > + return s*(R-f); > + } > +} > > Copied: stable/8/lib/msun/src/k_logf.h (from r216210, > head/lib/msun/src/k_logf.h) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/lib/msun/src/k_logf.h Sun Mar 6 08:49:44 2011 (r219323, copy > of r216210, head/lib/msun/src/k_logf.h) > @@ -0,0 +1,55 @@ > +/* > + * ==================================================== > + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > + * > + * Developed at SunPro, a Sun Microsystems, Inc. business. > + * Permission to use, copy, modify, and distribute this > + * software is freely granted, provided that this notice > + * is preserved. > + * ==================================================== > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* __kernel_logf(x) > + * Return log(x) - (x-1) for x in ~[sqrt(2)/2, sqrt(2)]. > + */ > + > +static const float > +/* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */ > +Lg1 = 0xaaaaaa.0p-24, /* 0.66666662693 */ > +Lg2 = 0xccce13.0p-25, /* 0.40000972152 */ > +Lg3 = 0x91e9ee.0p-25, /* 0.28498786688 */ > +Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ > + > +static inline float > +__kernel_logf(float x) > +{ > + float hfsq,f,s,z,R,w,t1,t2; > + int32_t ix,i,j; > + > + GET_FLOAT_WORD(ix,x); > + > + f = x-(float)1.0; > + if((0x007fffff&(0x8000+ix))<0xc000) { /* -2**-9 <= f < 2**-9 */ > + if(f==0.0) return 0.0; > + return f*f*((float)0.33333333333333333*f-(float)0.5); > + } > + s = f/((float)2.0+f); > + z = s*s; > + ix &= 0x007fffff; > + i = ix-(0x6147a<<3); > + w = z*z; > + j = (0x6b851<<3)-ix; > + t1= w*(Lg2+w*Lg4); > + t2= z*(Lg1+w*Lg3); > + i |= j; > + R = t2+t1; > + if(i>0) { > + hfsq=(float)0.5*f*f; > + return s*(hfsq+R) - hfsq; > + } else { > + return s*(R-f); > + } > +} > > Modified: stable/8/lib/msun/src/math.h > ============================================================================== > --- stable/8/lib/msun/src/math.h Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/src/math.h Sun Mar 6 08:49:44 2011 (r219323) > @@ -235,6 +235,7 @@ double lgamma(double); > long long llrint(double); > long long llround(double); > double log1p(double); > +double log2(double); > double logb(double); > long lrint(double); > long lround(double); > @@ -318,6 +319,7 @@ int ilogbf(float) __pure2; > float ldexpf(float, int); > float log10f(float); > float log1pf(float); > +float log2f(float); > float logf(float); > float modff(float, float *); /* fundamentally !__pure2 */ > > > Modified: stable/8/lib/msun/src/math_private.h > ============================================================================== > --- stable/8/lib/msun/src/math_private.h Sun Mar 6 08:35:50 2011 (r219322) > +++ stable/8/lib/msun/src/math_private.h Sun Mar 6 08:49:44 2011 (r219323) > @@ -292,6 +292,7 @@ irint(double x) > #define __ieee754_acos acos > #define __ieee754_acosh acosh > #define __ieee754_log log > +#define __ieee754_log2 log2 > #define __ieee754_atanh atanh > #define __ieee754_asin asin > #define __ieee754_atan2 atan2 > @@ -330,6 +331,7 @@ irint(double x) > #define __ieee754_lgammaf_r lgammaf_r > #define __ieee754_gammaf_r gammaf_r > #define __ieee754_log10f log10f > +#define __ieee754_log2f log2f > #define __ieee754_sinhf sinhf > #define __ieee754_hypotf hypotf > #define __ieee754_j0f j0f > _______________________________________________ > 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" > Hi all! Please MFC this commit to 7-STABLE, or apply the attached patch to graphviz... http://www.freebsd.org/cgi/query-pr.cgi?pr=157217&cat= op@pandora-d src> sysctl kern.osreldate kern.osreldate: 704101 op@pandora-d src> find . -iname "*log*" ./e_log.c ./e_log10.c ./e_log10f.c ./e_logf.c ./s_ilogb.c ./s_ilogbf.c ./s_ilogbl.c ./s_log1p.c ./s_log1pf.c ./s_logb.c ./s_logbf.c thanks, Oliver --00151758b0ac6fc0e904a4f770a2 Content-Type: text/x-diff; charset=US-ASCII; name="patch-lib-ortho-trapezoid.c.diff" Content-Disposition: attachment; filename="patch-lib-ortho-trapezoid.c.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 LS0tIC90bXAvcGF0Y2gtbGliLW9ydGhvLXRyYXBlem9pZC5jCTIwMTEtMDYtMDUgMTU6NDc6MDIu MDAwMDAwMDAwICswMjAwCisrKyAvdXNyL3BvcnRzL2dyYXBoaWNzL2dyYXBodml6L2ZpbGVzL3Bh dGNoLWxpYi1vcnRoby10cmFwZXpvaWQuYwkyMDExLTA2LTA1IDE1OjQ3OjM1LjAwMDAwMDAwMCAr MDIwMApAQCAtNSw3ICs1LDcgQEAKICAjZW5kaWYKICAKICsjaW5jbHVkZSA8c3lzL3BhcmFtLmg+ Ci0rI2lmIF9fRnJlZUJTRF92ZXJzaW9uIDw9IDcwNDEwMCB8fCAoX19GcmVlQlNEX3ZlcnNpb24g Pj0gODAwMDAwICYmIF9fRnJlZUJTRF92ZXJzaW9uIDwgODAyNTAyKSB8fCAoX19GcmVlQlNEX3Zl cnNpb24gPj0gOTAwMDAwICYmIF9fRnJlZUJTRF92ZXJzaW9uIDwgOTAwMDI3KQorKyNpZiBfX0Zy ZWVCU0RfdmVyc2lvbiA8PSA3MDQxMDEgfHwgKF9fRnJlZUJTRF92ZXJzaW9uID49IDgwMDAwMCAm JiBfX0ZyZWVCU0RfdmVyc2lvbiA8IDgwMjUwMikgfHwgKF9fRnJlZUJTRF92ZXJzaW9uID49IDkw MDAwMCAmJiBfX0ZyZWVCU0RfdmVyc2lvbiA8IDkwMDAyNykKICsjZGVmaW5lIGxvZzIoeCkgIChs b2coeCkvbG9nKDIpKQogKyNlbmRpZgogKwo= --00151758b0ac6fc0e904a4f770a2-- From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 14:13:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D268106564A; Sun, 5 Jun 2011 14:13:16 +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 5C1DD8FC0A; Sun, 5 Jun 2011 14:13:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55EDGi7084230; Sun, 5 Jun 2011 14:13:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55EDGPD084227; Sun, 5 Jun 2011 14:13:16 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106051413.p55EDGPD084227@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 5 Jun 2011 14:13: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: r222716 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 14:13:16 -0000 Author: jilles Date: Sun Jun 5 14:13:15 2011 New Revision: 222716 URL: http://svn.freebsd.org/changeset/base/222716 Log: sh: Fix $? in heredocs on simple commands. PR: bin/41410 Added: head/tools/regression/bin/sh/expansion/heredoc2.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jun 5 12:46:26 2011 (r222715) +++ head/bin/sh/eval.c Sun Jun 5 14:13:15 2011 (r222716) @@ -409,6 +409,7 @@ evalsubshell(union node *n, int flags) struct job *jp; int backgnd = (n->type == NBACKGND); + oexitstatus = exitstatus; expredir(n->nredir.redirect); if ((!backgnd && flags & EV_EXIT && !have_traps()) || forkshell(jp = makejob(n, 1), n, backgnd) == 0) { @@ -436,6 +437,7 @@ evalredir(union node *n, int flags) struct jmploc *savehandler; volatile int in_redirect = 1; + oexitstatus = exitstatus; expredir(n->nredir.redirect); savehandler = handler; if (setjmp(jmploc.loc)) { @@ -478,7 +480,6 @@ expredir(union node *n) for (redir = n ; redir ; redir = redir->nfile.next) { struct arglist fn; fn.lastp = &fn.list; - oexitstatus = exitstatus; switch (redir->type) { case NFROM: case NTO: Added: head/tools/regression/bin/sh/expansion/heredoc2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/heredoc2.0 Sun Jun 5 14:13:15 2011 (r222716) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +f() { return $1; } + +[ `f 42; cat < Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2315510656D0; Sun, 5 Jun 2011 17:31:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9FC78FC18; Sun, 5 Jun 2011 17:31:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55HViAs090673; Sun, 5 Jun 2011 17:31:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55HVi0h090671; Sun, 5 Jun 2011 17:31:44 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106051731.p55HVi0h090671@svn.freebsd.org> From: Rick Macklem Date: Sun, 5 Jun 2011 17:31: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: r222718 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 17:31:45 -0000 Author: rmacklem Date: Sun Jun 5 17:31:44 2011 New Revision: 222718 URL: http://svn.freebsd.org/changeset/base/222718 Log: Fix the new NFSv4 client so that it doesn't crash when a mount is done for a VIMAGE kernel. Tested by: glz at hidden-powers dot com Reviewed by: bz MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sun Jun 5 14:46:42 2011 (r222717) +++ head/sys/fs/nfsclient/nfs_clport.c Sun Jun 5 17:31:44 2011 (r222718) @@ -943,6 +943,7 @@ nfscl_getmyip(struct nfsmount *nmp, int sad.sin_family = AF_INET; sad.sin_len = sizeof (struct sockaddr_in); sad.sin_addr.s_addr = sin->sin_addr.s_addr; + CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); rt = rtalloc1((struct sockaddr *)&sad, 0, 0UL); if (rt != NULL) { if (rt->rt_ifp != NULL && @@ -956,6 +957,7 @@ nfscl_getmyip(struct nfsmount *nmp, int } RTFREE_LOCKED(rt); } + CURVNET_RESTORE(); #ifdef INET6 } else if (nmp->nm_nam->sa_family == AF_INET6) { struct sockaddr_in6 sad6, *sin6; @@ -966,6 +968,7 @@ nfscl_getmyip(struct nfsmount *nmp, int sad6.sin6_family = AF_INET6; sad6.sin6_len = sizeof (struct sockaddr_in6); sad6.sin6_addr = sin6->sin6_addr; + CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); rt = rtalloc1((struct sockaddr *)&sad6, 0, 0UL); if (rt != NULL) { if (rt->rt_ifp != NULL && @@ -980,6 +983,7 @@ nfscl_getmyip(struct nfsmount *nmp, int } RTFREE_LOCKED(rt); } + CURVNET_RESTORE(); #endif } return (retp); From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 18:17:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBE1E106564A; Sun, 5 Jun 2011 18:17:37 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA4F78FC15; Sun, 5 Jun 2011 18:17:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55IHbYE092052; Sun, 5 Jun 2011 18:17:37 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55IHb0Y092046; Sun, 5 Jun 2011 18:17:37 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106051817.p55IHb0Y092046@svn.freebsd.org> From: Rick Macklem Date: Sun, 5 Jun 2011 18:17: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: r222719 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 18:17:38 -0000 Author: rmacklem Date: Sun Jun 5 18:17:37 2011 New Revision: 222719 URL: http://svn.freebsd.org/changeset/base/222719 Log: The new NFSv4 client was erroneously using "p" instead of "p_leader" for the "id" for POSIX byte range locking. I think this would only have affected processes created by rfork(2) with the RFTHREAD flag specified. This patch fixes that by passing the "id" down through the various functions from nfs_advlock(). MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Sun Jun 5 17:31:44 2011 (r222718) +++ head/sys/fs/nfs/nfs_var.h Sun Jun 5 18:17:37 2011 (r222719) @@ -401,10 +401,10 @@ int nfsrpc_readdirplus(vnode_t, struct u int nfsrpc_commit(vnode_t, u_quad_t, int, struct ucred *, NFSPROC_T *, u_char *, struct nfsvattr *, int *, void *); int nfsrpc_advlock(vnode_t, off_t, int, struct flock *, int, - struct ucred *, NFSPROC_T *); + struct ucred *, NFSPROC_T *, void *, int); int nfsrpc_lockt(struct nfsrv_descript *, vnode_t, struct nfsclclient *, u_int64_t, u_int64_t, struct flock *, - struct ucred *, NFSPROC_T *); + struct ucred *, NFSPROC_T *, void *, int); int nfsrpc_lock(struct nfsrv_descript *, struct nfsmount *, vnode_t, u_int8_t *, int, struct nfscllockowner *, int, int, u_int64_t, u_int64_t, short, struct ucred *, NFSPROC_T *, int); @@ -439,16 +439,16 @@ struct nfsclclient *nfscl_findcl(struct void nfscl_clientrelease(struct nfsclclient *); void nfscl_freelock(struct nfscllock *, int); int nfscl_getbytelock(vnode_t, u_int64_t, u_int64_t, short, - struct ucred *, NFSPROC_T *, struct nfsclclient *, int, u_int8_t *, - u_int8_t *, struct nfscllockowner **, int *, int *); + struct ucred *, NFSPROC_T *, struct nfsclclient *, int, void *, int, + u_int8_t *, u_int8_t *, struct nfscllockowner **, int *, int *); int nfscl_relbytelock(vnode_t, u_int64_t, u_int64_t, struct ucred *, NFSPROC_T *, int, struct nfsclclient *, - struct nfscllockowner **, int *); + void *, int, struct nfscllockowner **, int *); int nfscl_checkwritelocked(vnode_t, struct flock *, - struct ucred *, NFSPROC_T *); + struct ucred *, NFSPROC_T *, void *, int); void nfscl_lockrelease(struct nfscllockowner *, int, int); void nfscl_fillclid(u_int64_t, char *, u_int8_t *, u_int16_t); -void nfscl_filllockowner(NFSPROC_T *, u_int8_t *); +void nfscl_filllockowner(void *, u_int8_t *, int); void nfscl_freeopen(struct nfsclopen *, int); void nfscl_umount(struct nfsmount *, NFSPROC_T *); void nfscl_renewthread(struct nfsclclient *, NFSPROC_T *); @@ -466,9 +466,10 @@ void nfscl_lockexcl(struct nfsv4lock *, void nfscl_lockunlock(struct nfsv4lock *); void nfscl_lockderef(struct nfsv4lock *); void nfscl_docb(struct nfsrv_descript *, NFSPROC_T *); -void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *); +void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *, void *, + int); int nfscl_lockt(vnode_t, struct nfsclclient *, u_int64_t, - u_int64_t, struct flock *, NFSPROC_T *); + u_int64_t, struct flock *, NFSPROC_T *, void *, int); int nfscl_mustflush(vnode_t); int nfscl_nodeleg(vnode_t, int); int nfscl_removedeleg(vnode_t, NFSPROC_T *, nfsv4stateid_t *); Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sun Jun 5 17:31:44 2011 (r222718) +++ head/sys/fs/nfsclient/nfs_clport.c Sun Jun 5 18:17:37 2011 (r222719) @@ -500,7 +500,7 @@ nfscl_fillclid(u_int64_t clval, char *uu * Fill in a lock owner name. For now, pid + the process's creation time. */ void -nfscl_filllockowner(struct thread *td, u_int8_t *cp) +nfscl_filllockowner(void *id, u_int8_t *cp, int flags) { union { u_int32_t lval; @@ -508,37 +508,32 @@ nfscl_filllockowner(struct thread *td, u } tl; struct proc *p; -if (td == NULL) { - printf("NULL td\n"); - bzero(cp, 12); - return; -} - p = td->td_proc; -if (p == NULL) { - printf("NULL pid\n"); - bzero(cp, 12); - return; -} - tl.lval = p->p_pid; - *cp++ = tl.cval[0]; - *cp++ = tl.cval[1]; - *cp++ = tl.cval[2]; - *cp++ = tl.cval[3]; -if (p->p_stats == NULL) { - printf("pstats null\n"); - bzero(cp, 8); - return; -} - tl.lval = p->p_stats->p_start.tv_sec; - *cp++ = tl.cval[0]; - *cp++ = tl.cval[1]; - *cp++ = tl.cval[2]; - *cp++ = tl.cval[3]; - tl.lval = p->p_stats->p_start.tv_usec; - *cp++ = tl.cval[0]; - *cp++ = tl.cval[1]; - *cp++ = tl.cval[2]; - *cp = tl.cval[3]; + if (id == NULL) { + printf("NULL id\n"); + bzero(cp, NFSV4CL_LOCKNAMELEN); + return; + } + if ((flags & F_POSIX) != 0) { + p = (struct proc *)id; + tl.lval = p->p_pid; + *cp++ = tl.cval[0]; + *cp++ = tl.cval[1]; + *cp++ = tl.cval[2]; + *cp++ = tl.cval[3]; + tl.lval = p->p_stats->p_start.tv_sec; + *cp++ = tl.cval[0]; + *cp++ = tl.cval[1]; + *cp++ = tl.cval[2]; + *cp++ = tl.cval[3]; + tl.lval = p->p_stats->p_start.tv_usec; + *cp++ = tl.cval[0]; + *cp++ = tl.cval[1]; + *cp++ = tl.cval[2]; + *cp = tl.cval[3]; + } else { + printf("nfscl_filllockowner: not F_POSIX\n"); + bzero(cp, NFSV4CL_LOCKNAMELEN); + } } /* Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jun 5 17:31:44 2011 (r222718) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jun 5 18:17:37 2011 (r222719) @@ -3459,7 +3459,7 @@ nfsmout: */ APPLESTATIC int nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl, - int reclaim, struct ucred *cred, NFSPROC_T *p) + int reclaim, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { struct nfscllockowner *lp; struct nfsclclient *clp; @@ -3511,11 +3511,11 @@ nfsrpc_advlock(vnode_t vp, off_t size, i error = nfscl_getcl(vp, cred, p, &clp); if (error) return (error); - error = nfscl_lockt(vp, clp, off, len, fl, p); + error = nfscl_lockt(vp, clp, off, len, fl, p, id, flags); if (!error) { clidrev = clp->nfsc_clientidrev; error = nfsrpc_lockt(nd, vp, clp, off, len, fl, cred, - p); + p, id, flags); } else if (error == -1) { error = 0; } @@ -3530,7 +3530,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, i return (error); do { error = nfscl_relbytelock(vp, off, len, cred, p, callcnt, - clp, &lp, &dorpc); + clp, id, flags, &lp, &dorpc); /* * If it returns a NULL lp, we're done. */ @@ -3538,7 +3538,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, i if (callcnt == 0) nfscl_clientrelease(clp); else - nfscl_releasealllocks(clp, vp, p); + nfscl_releasealllocks(clp, vp, p, id, flags); return (error); } if (nmp->nm_clp != NULL) @@ -3572,10 +3572,10 @@ nfsrpc_advlock(vnode_t vp, off_t size, i } callcnt++; } while (error == 0 && nd->nd_repstat == 0); - nfscl_releasealllocks(clp, vp, p); + nfscl_releasealllocks(clp, vp, p, id, flags); } else if (op == F_SETLK) { error = nfscl_getbytelock(vp, off, len, fl->l_type, cred, p, - NULL, 0, NULL, NULL, &lp, &newone, &donelocally); + NULL, 0, id, flags, NULL, NULL, &lp, &newone, &donelocally); if (error || donelocally) { return (error); } @@ -3625,7 +3625,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, i APPLESTATIC int nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp, struct nfsclclient *clp, u_int64_t off, u_int64_t len, struct flock *fl, - struct ucred *cred, NFSPROC_T *p) + struct ucred *cred, NFSPROC_T *p, void *id, int flags) { u_int32_t *tl; int error, type, size; @@ -3643,7 +3643,7 @@ nfsrpc_lockt(struct nfsrv_descript *nd, tl += 2; *tl++ = clp->nfsc_clientid.lval[0]; *tl = clp->nfsc_clientid.lval[1]; - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); (void) nfsm_strtom(nd, own, NFSV4CL_LOCKNAMELEN); error = nfscl_request(nd, vp, p, cred, NULL); if (error) Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sun Jun 5 17:31:44 2011 (r222718) +++ head/sys/fs/nfsclient/nfs_clstate.c Sun Jun 5 18:17:37 2011 (r222719) @@ -226,7 +226,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i * If none found, add the new one or return error, depending upon * "create". */ - nfscl_filllockowner(p, own); + nfscl_filllockowner(p->td_proc, own, F_POSIX); NFSLOCKCLSTATE(); dp = NULL; /* First check the delegation list */ @@ -521,7 +521,7 @@ nfscl_getstateid(vnode_t vp, u_int8_t *n * If p != NULL, we want to search the parentage tree * for a matching OpenOwner and use that. */ - nfscl_filllockowner(p, own); + nfscl_filllockowner(p->td_proc, own, F_POSIX); error = nfscl_getopen(&clp->nfsc_owner, nfhp, fhlen, NULL, p, mode, NULL, &op); if (error == 0) { @@ -596,7 +596,7 @@ nfscl_getopen(struct nfsclownerhead *ohp op = NULL; while (op == NULL && (nproc != NULL || rown != NULL)) { if (nproc != NULL) { - nfscl_filllockowner(nproc, own); + nfscl_filllockowner(nproc->td_proc, own, F_POSIX); ownp = own; } else { ownp = rown; @@ -881,7 +881,7 @@ nfscl_clientrelease(struct nfsclclient * APPLESTATIC int nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, short type, struct ucred *cred, NFSPROC_T *p, struct nfsclclient *rclp, - int recovery, u_int8_t *rownp, u_int8_t *ropenownp, + int recovery, void *id, int flags, u_int8_t *rownp, u_int8_t *ropenownp, struct nfscllockowner **lpp, int *newonep, int *donelocallyp) { struct nfscllockowner *lp; @@ -942,7 +942,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t if (recovery) { ownp = rownp; } else { - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); ownp = own; } if (!recovery) { @@ -1079,7 +1079,8 @@ nfscl_getbytelock(vnode_t vp, u_int64_t APPLESTATIC int nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, __unused struct ucred *cred, NFSPROC_T *p, int callcnt, - struct nfsclclient *clp, struct nfscllockowner **lpp, int *dorpcp) + struct nfsclclient *clp, void *id, int flags, + struct nfscllockowner **lpp, int *dorpcp) { struct nfscllockowner *lp; struct nfsclowner *owp; @@ -1116,7 +1117,7 @@ nfscl_relbytelock(vnode_t vp, u_int64_t sizeof (struct nfscllock), M_NFSCLLOCK, M_WAITOK); *other_lop = *nlop; } - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); dp = NULL; NFSLOCKCLSTATE(); if (callcnt == 0) @@ -1188,7 +1189,8 @@ nfscl_relbytelock(vnode_t vp, u_int64_t * Release all lockowners marked in progess for this process and file. */ APPLESTATIC void -nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p) +nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, + void *id, int flags) { struct nfsclowner *owp; struct nfsclopen *op; @@ -1197,7 +1199,7 @@ nfscl_releasealllocks(struct nfsclclient u_int8_t own[NFSV4CL_LOCKNAMELEN]; np = VTONFS(vp); - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); NFSLOCKCLSTATE(); LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { @@ -1226,7 +1228,7 @@ nfscl_releasealllocks(struct nfsclclient */ APPLESTATIC int nfscl_checkwritelocked(vnode_t vp, struct flock *fl, - struct ucred *cred, NFSPROC_T *p) + struct ucred *cred, NFSPROC_T *p, void *id, int flags) { struct nfsclowner *owp; struct nfscllockowner *lp; @@ -1266,7 +1268,7 @@ nfscl_checkwritelocked(vnode_t vp, struc error = nfscl_getcl(vp, cred, p, &clp); if (error) return (1); - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); NFSLOCKCLSTATE(); /* @@ -1641,7 +1643,7 @@ nfscl_cleanup(NFSPROC_T *p) if (!nfscl_inited) return; - nfscl_filllockowner(p, own); + nfscl_filllockowner(p->td_proc, own, F_POSIX); NFSLOCKCLSTATE(); /* @@ -3322,7 +3324,7 @@ nfscl_checkconflict(struct nfscllockowne */ APPLESTATIC int nfscl_lockt(vnode_t vp, struct nfsclclient *clp, u_int64_t off, - u_int64_t len, struct flock *fl, NFSPROC_T *p) + u_int64_t len, struct flock *fl, NFSPROC_T *p, void *id, int flags) { struct nfscllock *lop, nlck; struct nfscldeleg *dp; @@ -3340,7 +3342,7 @@ nfscl_lockt(vnode_t vp, struct nfsclclie return (NFSERR_INVAL); } np = VTONFS(vp); - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); NFSLOCKCLSTATE(); dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); error = nfscl_localconflict(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, @@ -3615,7 +3617,7 @@ nfscl_relock(vnode_t vp, struct nfsclcli off = lop->nfslo_first; len = lop->nfslo_end - lop->nfslo_first; error = nfscl_getbytelock(vp, off, len, lop->nfslo_type, cred, p, - clp, 1, lp->nfsl_owner, lp->nfsl_openowner, &nlp, &newone, + clp, 1, NULL, 0, lp->nfsl_owner, lp->nfsl_openowner, &nlp, &newone, &donelocally); if (error || donelocally) return (error); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 5 17:31:44 2011 (r222718) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 5 18:17:37 2011 (r222719) @@ -2898,7 +2898,8 @@ nfs_advlock(struct vop_advlock_args *ap) * RFC3530 Sec. 9.3.2. */ if (ap->a_op == F_UNLCK && - nfscl_checkwritelocked(vp, ap->a_fl, cred, td)) + nfscl_checkwritelocked(vp, ap->a_fl, cred, td, ap->a_id, + ap->a_flags)) (void) ncl_flush(vp, MNT_WAIT, cred, td, 1, 0); /* @@ -2907,7 +2908,7 @@ nfs_advlock(struct vop_advlock_args *ap) */ do { ret = nfsrpc_advlock(vp, np->n_size, ap->a_op, - ap->a_fl, 0, cred, td); + ap->a_fl, 0, cred, td, ap->a_id, ap->a_flags); if (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) && ap->a_op == F_SETLK) { VOP_UNLOCK(vp, 0); From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 19:15:11 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8EEA106566C; Sun, 5 Jun 2011 19:15:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 173368FC15; Sun, 5 Jun 2011 19:15:08 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA09408; Sun, 05 Jun 2011 22:15:07 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QTImx-000810-Am; Sun, 05 Jun 2011 22:15:07 +0300 Message-ID: <4DEBD5B9.9040908@FreeBSD.org> Date: Sun, 05 Jun 2011 22:15:05 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Martin Matuska References: <201106040702.p54726O6098336@svn.freebsd.org> <4DEA0785.3040707@FreeBSD.org> In-Reply-To: <4DEA0785.3040707@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r222670 - in head/sys/cddl/compat/opensolaris: 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: Sun, 05 Jun 2011 19:15:11 -0000 on 04/06/2011 13:23 Martin Matuska said the following: > If we are "fixing" this, I am not sure why you used the quotes here. I think that it's a real issue and I believe that this commit is a reasonable fix. > what about following pjd's rules and moving in > direction vendor code (reducing diff)? Or is it too expensive? Well, it seems that the code before the change was not compliant with the rules. I certainly like those rules, but maybe in this case they would be an overkill. > If that way: > > a) the nsec_per_tick is defined in vendor code > "usr/src/uts/common/conf/param.c". > > Maybe we should define it at least in > sys/cddl/compat/opensolaris/sys/param.h and not in time.h > > b) sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c > might contain the functions as in vendor code (uts/common/os/sunddi.c): > > clock_t > ddi_get_lbolt(void) > { > return ((clock_t)lbolt_hybrid()); > } > > int64_t > ddi_get_lbolt64(void) > { > return (lbolt_hybrid()); > } > > c) sys/cddl/compat/opensolaris/sys/time.h: > > extern clock_t ddi_get_lbolt(void); > extern int64_t ddi_get_lbolt64(void); > > d) we might want a new file called > sys/cddl/compat/opensolaris/kern/opensolaris_clock.c > (uts/common/os/clock.c): > > int64_t > lbolt_hybrid(void) > { > return (gethrtime() / nsec_per_tick); > } > > The d) step with lbolt_hybrid might be omitted and the function result > integrated directly into opensolaris_sunddi.c. Bud regardless of that, > notice the clock_t cast in ddi_get_lbolt(). > > mm > > Dňa 04.06.2011 09:02, Andriy Gapon wrote / napísal(a): >> Author: avg >> Date: Sat Jun 4 07:02:06 2011 >> New Revision: 222670 >> URL: http://svn.freebsd.org/changeset/base/222670 >> >> Log: >> opensolaris compat / zfs: avoid early overflow in ddi_get_lbolt* >> >> Reported by: David P. Discher >> Tested by: will >> Reviewed by: art >> Discussed with: dwhite >> MFC after: 2 weeks >> >> Modified: >> head/sys/cddl/compat/opensolaris/kern/opensolaris.c >> head/sys/cddl/compat/opensolaris/sys/time.h >> >> Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris.c >> ============================================================================== >> --- head/sys/cddl/compat/opensolaris/kern/opensolaris.c Sat Jun 4 04:35:12 2011 (r222669) >> +++ head/sys/cddl/compat/opensolaris/kern/opensolaris.c Sat Jun 4 07:02:06 2011 (r222670) >> @@ -40,6 +40,7 @@ >> cpu_core_t cpu_core[MAXCPU]; >> kmutex_t cpu_lock; >> solaris_cpu_t solaris_cpu[MAXCPU]; >> +int nsec_per_tick; >> >> /* >> * OpenSolaris subsystem initialisation. >> @@ -60,6 +61,8 @@ opensolaris_load(void *dummy) >> } >> >> mutex_init(&cpu_lock, "OpenSolaris CPU lock", MUTEX_DEFAULT, NULL); >> + >> + nsec_per_tick = NANOSEC / hz; >> } >> >> SYSINIT(opensolaris_register, SI_SUB_OPENSOLARIS, SI_ORDER_FIRST, opensolaris_load, NULL); >> >> Modified: head/sys/cddl/compat/opensolaris/sys/time.h >> ============================================================================== >> --- head/sys/cddl/compat/opensolaris/sys/time.h Sat Jun 4 04:35:12 2011 (r222669) >> +++ head/sys/cddl/compat/opensolaris/sys/time.h Sat Jun 4 07:02:06 2011 (r222670) >> @@ -62,8 +62,21 @@ gethrtime(void) { >> #define gethrestime(ts) getnanotime(ts) >> #define gethrtime_waitfree() gethrtime() >> >> -#define ddi_get_lbolt() ((gethrtime() * hz) / NANOSEC) >> -#define ddi_get_lbolt64() (int64_t)((gethrtime() * hz) / NANOSEC) >> +extern int nsec_per_tick; /* nanoseconds per clock tick */ >> + >> +static __inline int64_t >> +ddi_get_lbolt64(void) >> +{ >> + >> + return (gethrtime() / nsec_per_tick); >> +} >> + >> +static __inline clock_t >> +ddi_get_lbolt(void) >> +{ >> + >> + return (ddi_get_lbolt64()); >> +} >> >> #else >> -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 19:20:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C707B1065672; Sun, 5 Jun 2011 19:20:39 +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 B697A8FC13; Sun, 5 Jun 2011 19:20:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55JKdro094066; Sun, 5 Jun 2011 19:20:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55JKd9b094064; Sun, 5 Jun 2011 19:20:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106051920.p55JKd9b094064@svn.freebsd.org> From: Andriy Gapon Date: Sun, 5 Jun 2011 19:20: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: r222720 - 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: Sun, 05 Jun 2011 19:20:39 -0000 Author: avg Date: Sun Jun 5 19:20:39 2011 New Revision: 222720 URL: http://svn.freebsd.org/changeset/base/222720 Log: amdsbwd.4: fix spelling of my name Pointed out by: ru MFC after: 3 days Modified: head/share/man/man4/amdsbwd.4 Modified: head/share/man/man4/amdsbwd.4 ============================================================================== --- head/share/man/man4/amdsbwd.4 Sun Jun 5 18:17:37 2011 (r222719) +++ head/share/man/man4/amdsbwd.4 Sun Jun 5 19:20:39 2011 (r222720) @@ -67,6 +67,6 @@ driver first appeared in The .Nm driver was written by -.An Andiry Gapon Aq avg@FreeBSD.org . +.An Andriy Gapon Aq avg@FreeBSD.org . This manual page was written by -.An Andiry Gapon Aq avg@FreeBSD.org . +.An Andriy Gapon Aq avg@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 19:25:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7AF8106566B; Sun, 5 Jun 2011 19:25:30 +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 B73248FC18; Sun, 5 Jun 2011 19:25:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55JPUS9094248; Sun, 5 Jun 2011 19:25:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55JPUgC094246; Sun, 5 Jun 2011 19:25:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106051925.p55JPUgC094246@svn.freebsd.org> From: Andriy Gapon Date: Sun, 5 Jun 2011 19:25: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: r222721 - 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: Sun, 05 Jun 2011 19:25:30 -0000 Author: avg Date: Sun Jun 5 19:25:30 2011 New Revision: 222721 URL: http://svn.freebsd.org/changeset/base/222721 Log: amdsbwd.4: fix history to reflect correct releases Pointed out by: ru MFC after: 4 days Modified: head/share/man/man4/amdsbwd.4 Modified: head/share/man/man4/amdsbwd.4 ============================================================================== --- head/share/man/man4/amdsbwd.4 Sun Jun 5 19:20:39 2011 (r222720) +++ head/share/man/man4/amdsbwd.4 Sun Jun 5 19:25:30 2011 (r222721) @@ -61,7 +61,9 @@ AMD SB600 and SB7xx south bridge chips. The .Nm driver first appeared in -.Fx 9.0 . +.Fx 7.3 +and +.Fx 8.1 . .Sh AUTHORS .An -nosplit The From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 20:19:01 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9880A1065676; Sun, 5 Jun 2011 20:19:01 +0000 (UTC) (envelope-from andreast@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 2DEBF8FC13; Sun, 5 Jun 2011 20:19:00 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-8-131.flashcable.ch [91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id p55JnW7D068670; Sun, 5 Jun 2011 21:49:33 +0200 (CEST) (envelope-from andreast@fgznet.ch) Message-ID: <4DEBDDCC.6090407@fgznet.ch> Date: Sun, 05 Jun 2011 21:49:32 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Nathan Whitehorn References: <201106040322.p543MHXs091626@svn.freebsd.org> In-Reply-To: <201106040322.p543MHXs091626@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r222666 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 20:19:01 -0000 On 04.06.11 05:22, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Jun 4 03:22:16 2011 > New Revision: 222666 > URL: http://svn.freebsd.org/changeset/base/222666 > > Log: > Fix a typo derived from a mismerge from mmu_oea that would cause > pmap_sync_icache() to sync random (possibly uncached or nonexisting!) > memory, causing kernel page faults or machine checks, most easily > triggered by using GDB. While here, add an additional safeguard to only > sync cacheable memory. A big, big thank you!!! The core is working now! Next is fine tuning. ---- [bohrium:head/objdir/gdb] andreast% ./gdb -v GNU gdb (GDB) 7.3.50.20110605-cvs This GDB was configured as "powerpc64-unknown-freebsd9.0". ---- Andreas From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 20:22:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3567106564A; Sun, 5 Jun 2011 20:22:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1A9E8FC0C; Sun, 5 Jun 2011 20:22:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55KMuvi096293; Sun, 5 Jun 2011 20:22:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55KMugI096290; Sun, 5 Jun 2011 20:22:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106052022.p55KMugI096290@svn.freebsd.org> From: Rick Macklem Date: Sun, 5 Jun 2011 20:22: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: r222722 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 20:22:57 -0000 Author: rmacklem Date: Sun Jun 5 20:22:56 2011 New Revision: 222722 URL: http://svn.freebsd.org/changeset/base/222722 Log: Add support for flock(2) locks to the new NFSv4 client. I think this should be ok, since the client now delays NFSv4 Close operations until VOP_INACTIVE()/VOP_RECLAIM(). As such, there should be no risk that the NFSv4 Open is closed while an associated byte range lock still exists. Tested by: avg MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sun Jun 5 19:25:30 2011 (r222721) +++ head/sys/fs/nfsclient/nfs_clport.c Sun Jun 5 20:22:56 2011 (r222722) @@ -530,8 +530,11 @@ nfscl_filllockowner(void *id, u_int8_t * *cp++ = tl.cval[1]; *cp++ = tl.cval[2]; *cp = tl.cval[3]; + } else if ((flags & F_FLOCK) != 0) { + bcopy(&id, cp, sizeof(id)); + bzero(&cp[sizeof(id)], NFSV4CL_LOCKNAMELEN - sizeof(id)); } else { - printf("nfscl_filllockowner: not F_POSIX\n"); + printf("nfscl_filllockowner: not F_POSIX or F_FLOCK\n"); bzero(cp, NFSV4CL_LOCKNAMELEN); } } Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 5 19:25:30 2011 (r222721) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 5 20:22:56 2011 (r222722) @@ -2884,8 +2884,11 @@ nfs_advlock(struct vop_advlock_args *ap) int ret, error = EOPNOTSUPP; u_quad_t size; - if (NFS_ISV4(vp) && (ap->a_flags & F_POSIX)) { - cred = p->p_ucred; + if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) { + if ((ap->a_flags & F_POSIX) != 0) + cred = p->p_ucred; + else + cred = td->td_ucred; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { VOP_UNLOCK(vp, 0); From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 21:01:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F11D106564A; Sun, 5 Jun 2011 21:01:42 +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 F1C688FC1B; Sun, 5 Jun 2011 21:01:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55L1f12097422; Sun, 5 Jun 2011 21:01:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55L1feL097420; Sun, 5 Jun 2011 21:01:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106052101.p55L1feL097420@svn.freebsd.org> From: Andriy Gapon Date: Sun, 5 Jun 2011 21:01: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: r222723 - 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, 05 Jun 2011 21:01:42 -0000 Author: avg Date: Sun Jun 5 21:01:41 2011 New Revision: 222723 URL: http://svn.freebsd.org/changeset/base/222723 Log: add SNDCTL_DSP_HALT specified by OSS This is really a new name for SNDCTL_DSP_RESET. PR: kern/156874 Submitted by: gerald MFC after: 1 week Modified: head/sys/sys/soundcard.h Modified: head/sys/sys/soundcard.h ============================================================================== --- head/sys/sys/soundcard.h Sun Jun 5 20:22:56 2011 (r222722) +++ head/sys/sys/soundcard.h Sun Jun 5 21:01:41 2011 (r222723) @@ -311,7 +311,8 @@ typedef struct _snd_capabilities { * IOCTL Commands for /dev/sequencer */ -#define SNDCTL_SEQ_RESET _IO ('Q', 0) +#define SNDCTL_SEQ_HALT _IO ('Q', 0) +#define SNDCTL_SEQ_RESET SNDCTL_SEQ_HALT /* Historic interface */ #define SNDCTL_SEQ_SYNC _IO ('Q', 1) #define SNDCTL_SYNTH_INFO _IOWR('Q', 2, struct synth_info) #define SNDCTL_SEQ_CTRLRATE _IOWR('Q', 3, int) /* Set/get timer res.(hz) */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 21:23:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C625E106564A; Sun, 5 Jun 2011 21:23:28 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id BF0598FC17; Sun, 5 Jun 2011 21:23:27 +0000 (UTC) Received: by wyf23 with SMTP id 23so3331686wyf.13 for ; Sun, 05 Jun 2011 14:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=Y0IHHGBkskSZXFyGZht0dFISXEfnH3TPVoiD6bjptJo=; b=L6dBMXXR9zu8yiyCeL4r5Zjlmm3/KC0E/RyvRFaoOOtH9R+7ZA+KDZ2w6tdTQJV1ZH aGXkt15k0HSa3sdky1z4NZdN4erFtUYC9Ws5/cVlGV4u36QEtyEke9wS5yLWkqepCC9h uJpAJSsoNxTS+7F4NMW7WWEqPNt9eg3BBDj1g= 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=HG07DXx9zjj1yoKeg7kQflUqLtftPvv57uVlQeOP+KCbaXOGvZ1rv17UUhoNDBhTWp u/wo0ohBef6zRnhUChWgvQHdaIGb8LF03aLwjwV27Rbi7tU71mG6AXA4rBkJZG34t+Jx B01QvXaR5XlqzHAofkXaipTAhDfKvXKFWSbgw= Received: by 10.227.201.142 with SMTP id fa14mr4225225wbb.48.1307309006401; Sun, 05 Jun 2011 14:23:26 -0700 (PDT) Received: from localhost (tor.efferia.fr [46.105.3.188]) by mx.google.com with ESMTPS id fl19sm569381wbb.49.2011.06.05.14.23.24 (version=SSLv3 cipher=OTHER); Sun, 05 Jun 2011 14:23:25 -0700 (PDT) From: Pan Tsu To: Andriy Gapon References: <201106052101.p55L1feL097420@svn.freebsd.org> Date: Mon, 06 Jun 2011 01:23:16 +0400 In-Reply-To: <201106052101.p55L1feL097420@svn.freebsd.org> (Andriy Gapon's message of "Sun, 5 Jun 2011 21:01:41 +0000 (UTC)") Message-ID: <86zklwezwb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222723 - 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, 05 Jun 2011 21:23:28 -0000 Andriy Gapon writes: > Author: avg > Date: Sun Jun 5 21:01:41 2011 > New Revision: 222723 > URL: http://svn.freebsd.org/changeset/base/222723 > > Log: > add SNDCTL_DSP_HALT specified by OSS > > This is really a new name for SNDCTL_DSP_RESET. > > PR: kern/156874 > Submitted by: gerald > MFC after: 1 week > > Modified: > head/sys/sys/soundcard.h > > Modified: head/sys/sys/soundcard.h > ============================================================================== > --- head/sys/sys/soundcard.h Sun Jun 5 20:22:56 2011 (r222722) > +++ head/sys/sys/soundcard.h Sun Jun 5 21:01:41 2011 (r222723) > @@ -311,7 +311,8 @@ typedef struct _snd_capabilities { > * IOCTL Commands for /dev/sequencer > */ > > -#define SNDCTL_SEQ_RESET _IO ('Q', 0) > +#define SNDCTL_SEQ_HALT _IO ('Q', 0) > +#define SNDCTL_SEQ_RESET SNDCTL_SEQ_HALT /* Historic interface */ Apparently, the one for /dev/sequencer is too new to be documented. http://manuals.opensound.com/developer/SNDCTL_SEQ_HALT.html -> "Not found" > #define SNDCTL_SEQ_SYNC _IO ('Q', 1) > #define SNDCTL_SYNTH_INFO _IOWR('Q', 2, struct synth_info) > #define SNDCTL_SEQ_CTRLRATE _IOWR('Q', 3, int) /* Set/get timer res.(hz) */ From owner-svn-src-all@FreeBSD.ORG Sun Jun 5 22:36:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02A94106566C; Sun, 5 Jun 2011 22:36:31 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E46C78FC15; Sun, 5 Jun 2011 22:36:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p55MaUT4000379; Sun, 5 Jun 2011 22:36:30 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p55MaU2L000377; Sun, 5 Jun 2011 22:36:30 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201106052236.p55MaU2L000377@svn.freebsd.org> From: Kirk McKusick Date: Sun, 5 Jun 2011 22:36: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: r222724 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 22:36:31 -0000 Author: mckusick Date: Sun Jun 5 22:36:30 2011 New Revision: 222724 URL: http://svn.freebsd.org/changeset/base/222724 Log: Grammer fix in comment. Eliminate one (of several) possible conflicting buffer locks when trying to reclaim blocks. Rest of fix to be incorporated as part of SUJ update by jeff. Pointed out by: Kostik Belousov Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Jun 5 21:01:41 2011 (r222723) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Jun 5 22:36:30 2011 (r222724) @@ -420,13 +420,13 @@ nospace: */ if (reclaimed == 0) { reclaimed = 1; - softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); UFS_UNLOCK(ump); if (bp) { brelse(bp); bp = NULL; } UFS_LOCK(ump); + softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); goto retry; } UFS_UNLOCK(ump); @@ -2356,8 +2356,8 @@ ffs_fserr(fs, inum, cp) * specified inode by the specified amount. Under normal * operation the count should always go down. Decrementing * the count to zero will cause the inode to be freed. - * adjblkcnt(inode, amt) - adjust the number of blocks used to - * by the specifed amount. + * adjblkcnt(inode, amt) - adjust the number of blocks used by the + * inode by the specified amount. * adjndir, adjbfree, adjifree, adjffree, adjnumclusters(amt) - * adjust the superblock summary. * freedirs(inode, count) - directory inodes [inode..inode + count - 1] From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 01:52:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD34106564A; Mon, 6 Jun 2011 01:52:15 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98B478FC12; Mon, 6 Jun 2011 01:52:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p561qF1p006331; Mon, 6 Jun 2011 01:52:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p561qF5M006329; Mon, 6 Jun 2011 01:52:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106060152.p561qF5M006329@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 6 Jun 2011 01:52: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: r222726 - head/release/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 01:52:15 -0000 Author: marcel Date: Mon Jun 6 01:52:15 2011 New Revision: 222726 URL: http://svn.freebsd.org/changeset/base/222726 Log: Fix ia64 ISO creation: o boot/mfsroot.gz is no more. Copy it only when it exists so as still to be compatible with Makefile.sysinstall. o while here, make ispfw.ko optional as well. o '-b bootimage' is not a valid argument for makefs. What was meant was '-o bootimage'. o create the boot image in the current directory so that makefs can find the file. Previously it had to be created under $BASE because that's how mkisofs wanted it. Modified: head/release/ia64/mkisoimages.sh Modified: head/release/ia64/mkisoimages.sh ============================================================================== --- head/release/ia64/mkisoimages.sh Mon Jun 6 01:18:53 2011 (r222725) +++ head/release/ia64/mkisoimages.sh Mon Jun 6 01:52:15 2011 (r222726) @@ -48,28 +48,32 @@ EFIPART=efipart.sys if [ $bootable = yes ]; then EFISZ=65536 MNT=/mnt - dd if=/dev/zero of=$BASE/$EFIPART count=$EFISZ - md=`mdconfig -a -t vnode -f $BASE/$EFIPART` + dd if=/dev/zero of=$EFIPART count=$EFISZ + md=`mdconfig -a -t vnode -f $EFIPART` newfs_msdos -F 12 -S 512 -h 4 -o 0 -s $EFISZ -u 16 $md mount -t msdosfs /dev/$md $MNT mkdir -p $MNT/efi/boot $MNT/boot $MNT/boot/kernel cp -R $BASE/boot/defaults $MNT/boot cp $BASE/boot/kernel/kernel $MNT/boot/kernel - cp $BASE/boot/kernel/ispfw.ko $MNT/boot/kernel + if [ -s $BASE/boot/kernel/ispfw.ko ]; then + cp $BASE/boot/kernel/ispfw.ko $MNT/boot/kernel + fi cp $BASE/boot/device.hints $MNT/boot cp $BASE/boot/loader.* $MNT/boot - cp $BASE/boot/mfsroot.gz $MNT/boot + if [ -s $BASE/boot/mfsroot.gz ]; then + cp $BASE/boot/mfsroot.gz $MNT/boot + fi cp $BASE/boot/support.4th $MNT/boot mv $MNT/boot/loader.efi $MNT/efi/boot/bootia64.efi umount $MNT mdconfig -d -u $md - BOOTOPTS="-b bootimage=i386;$EFIPART -o no-emul-boot" + BOOTOPTS="-o bootimage=i386;$EFIPART -o no-emul-boot" else BOOTOPTS="" fi echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab makefs -t cd9660 $BOOTOPTS -o rockridge -o label=$LABEL $NAME $BASE $* -rm -f $BASE/$EFIPART +rm -f $EFIPART rm $1/etc/fstab exit 0 From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 02:14:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D352106564A; Mon, 6 Jun 2011 02:14:23 +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 7DE578FC13; Mon, 6 Jun 2011 02:14:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p562ENlY007050; Mon, 6 Jun 2011 02:14:23 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p562EN5G007040; Mon, 6 Jun 2011 02:14:23 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106060214.p562EN5G007040@svn.freebsd.org> From: Hiroki Sato Date: Mon, 6 Jun 2011 02:14: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: r222728 - in head: sbin/ifconfig 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: Mon, 06 Jun 2011 02:14:23 -0000 Author: hrs Date: Mon Jun 6 02:14:23 2011 New Revision: 222728 URL: http://svn.freebsd.org/changeset/base/222728 Log: - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. - A new per-interface knob IFF_ND6_NO_RADR and sysctl IPV6CTL_NO_RADR. This controls if accepting a route in an RA message as the default route. The default value for each interface can be set by net.inet6.ip6.no_radr. The system wide default value is 0. - A new sysctl: net.inet6.ip6.norbit_raif. This controls if setting R-bit in NA on RA accepting interfaces. The default is 0 (R-bit is set based on net.inet6.ip6.forwarding). Background: IPv6 host/router model suggests a router sends an RA and a host accepts it for router discovery. Because of that, KAME implementation does not allow accepting RAs when net.inet6.ip6.forwarding=1. Accepting RAs on a router can make the routing table confused since it can change the default router unintentionally. However, in practice there are cases where we cannot distinguish a host from a router clearly. For example, a customer edge router often works as a host against the ISP, and as a router against the LAN at the same time. Another example is a complex network configurations like an L2TP tunnel for IPv6 connection to Internet over an Ethernet link with another native IPv6 subnet. In this case, the physical interface for the native IPv6 subnet works as a host, and the pseudo-interface for L2TP works as the default IP forwarding route. Problem: Disabling processing RA messages when net.inet6.ip6.forwarding=1 and accepting them when net.inet6.ip6.forward=0 cause the following practical issues: - A router cannot perform SLAAC. It becomes a problem if a box has multiple interfaces and you want to use SLAAC on some of them, for example. A customer edge router for IPv6 Internet access service using an IPv6-over-IPv6 tunnel sometimes needs SLAAC on the physical interface for administration purpose; updating firmware and so on (link-local addresses can be used there, but GUAs by SLAAC are often used for scalability). - When a host has multiple IPv6 interfaces and it receives multiple RAs on them, controlling the default route is difficult. Router preferences defined in RFC 4191 works only when the routers on the links are under your control. Details of Implementation Changes: Router Advertisement messages will be accepted even when net.inet6.ip6.forwarding=1. More precisely, the conditions are as follow: (ACCEPT_RTADV && !NO_RADR && !ip6.forwarding) => Normal RA processing on that interface. (as IPv6 host) (ACCEPT_RTADV && (NO_RADR || ip6.forwarding)) => Accept RA but add the router to the defroute list with rtlifetime=0 unconditionally. This effectively prevents from setting the received router address as the box's default route. (!ACCEPT_RTADV) => No RA processing on that interface. ACCEPT_RTADV and NO_RADR are per-interface knob. In short, all interface are classified as "RA-accepting" or not. An RA-accepting interface always processes RA messages regardless of ip6.forwarding. The difference caused by NO_RADR or ip6.forwarding is whether the RA source address is considered as the default router or not. R-bit in NA on the RA accepting interfaces is set based on net.inet6.ip6.forwarding. While RFC 6204 W-1 rule (for CPE case) suggests a router should disable the R-bit completely even when the box has net.inet6.ip6.forwarding=1, I believe there is no technical reason with doing so. This behavior can be set by a new sysctl net.inet6.ip6.norbit_raif (the default is 0). Usage: # ifconfig fxp0 inet6 accept_rtadv => accept RA on fxp0 # ifconfig fxp0 inet6 accept_rtadv no_radr => accept RA on fxp0 but ignore default route information in it. # sysctl net.inet6.ip6.norbit_no_radr=1 => R-bit in NAs on RA accepting interfaces will always be set to 0. Modified: head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_nd6.c head/sys/netinet6/in6.h head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Mon Jun 6 01:53:31 2011 (r222727) +++ head/sbin/ifconfig/af_inet6.c Mon Jun 6 02:14:23 2011 (r222728) @@ -499,6 +499,8 @@ static struct cmd inet6_cmds[] = { DEF_CMD("-autoconf", -IN6_IFF_AUTOCONF, setip6flags), DEF_CMD("accept_rtadv", ND6_IFF_ACCEPT_RTADV, setnd6flags), DEF_CMD("-accept_rtadv",-ND6_IFF_ACCEPT_RTADV, setnd6flags), + DEF_CMD("no_radr", ND6_IFF_NO_RADR, setnd6flags), + DEF_CMD("-no_radr", -ND6_IFF_NO_RADR, setnd6flags), DEF_CMD("defaultif", 1, setnd6defif), DEF_CMD("-defaultif", -1, setnd6defif), DEF_CMD("ifdisabled", ND6_IFF_IFDISABLED, setnd6flags), Modified: head/sbin/ifconfig/af_nd6.c ============================================================================== --- head/sbin/ifconfig/af_nd6.c Mon Jun 6 01:53:31 2011 (r222727) +++ head/sbin/ifconfig/af_nd6.c Mon Jun 6 02:14:23 2011 (r222728) @@ -58,7 +58,7 @@ static const char rcsid[] = #define MAX_SYSCTL_TRY 5 #define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \ "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \ - "\020DEFAULTIF" + "\007NO_RADR\020DEFAULTIF" static int isnd6defif(int); void setnd6flags(const char *, int, int, const struct afswtch *); Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Mon Jun 6 01:53:31 2011 (r222727) +++ head/sys/netinet6/in6.h Mon Jun 6 02:14:23 2011 (r222728) @@ -611,7 +611,10 @@ struct ip6_mtuinfo { #define IPV6CTL_STEALTH 45 #define ICMPV6CTL_ND6_ONLINKNSRFC4861 47 -#define IPV6CTL_MAXID 48 +#define IPV6CTL_NO_RADR 48 /* No defroute from RA */ +#define IPV6CTL_NORBIT_RAIF 49 /* Disable R-bit in NA on RA + * receiving IF. */ +#define IPV6CTL_MAXID 50 #endif /* __BSD_VISIBLE */ /* Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Mon Jun 6 01:53:31 2011 (r222727) +++ head/sys/netinet6/in6_proto.c Mon Jun 6 02:14:23 2011 (r222728) @@ -409,6 +409,8 @@ VNET_DEFINE(int, ip6_sendredirects) = IP VNET_DEFINE(int, ip6_defhlim) = IPV6_DEFHLIM; VNET_DEFINE(int, ip6_defmcasthlim) = IPV6_DEFAULT_MULTICAST_HOPS; VNET_DEFINE(int, ip6_accept_rtadv) = 0; +VNET_DEFINE(int, ip6_no_radr) = 0; +VNET_DEFINE(int, ip6_norbit_raif) = 0; VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_maxfrags); /* initialized in frag6.c:frag6_init() */ VNET_DEFINE(int, ip6_log_interval) = 5; @@ -537,6 +539,15 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_ CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0, "Default value of per-interface flag for accepting ICMPv6 Router" "Advertisement messages"); +SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_NO_RADR, no_radr, + CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0, + "Default value of per-interface flag to control whether routers " + "sending ICMPv6 RA messages on that interface are added into the " + "default router list."); +SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_NORBIT_RAIF, norbit_raif, CTLFLAG_RW, + &VNET_NAME(ip6_norbit_raif), 0, + "Always set 0 to R flag in ICMPv6 NA messages when accepting RA" + " on the interface."); SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH, keepfaith, CTLFLAG_RW, &VNET_NAME(ip6_keepfaith), 0, ""); SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL, log_interval, Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Mon Jun 6 01:53:31 2011 (r222727) +++ head/sys/netinet6/ip6_var.h Mon Jun 6 02:14:23 2011 (r222728) @@ -316,6 +316,9 @@ VNET_DECLARE(int, ip6_maxfragpackets); / VNET_DECLARE(int, ip6_maxfrags); /* Maximum fragments in reassembly * queue */ VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */ +VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */ +VNET_DECLARE(int, ip6_norbit_raif); /* Disable R-bit in NA on RA + * receiving IF. */ VNET_DECLARE(int, ip6_keepfaith); /* Firewall Aided Internet Translator */ VNET_DECLARE(int, ip6_log_interval); VNET_DECLARE(time_t, ip6_log_time); @@ -327,6 +330,8 @@ VNET_DECLARE(int, ip6_dad_count); /* Dup #define V_ip6_maxfragpackets VNET(ip6_maxfragpackets) #define V_ip6_maxfrags VNET(ip6_maxfrags) #define V_ip6_accept_rtadv VNET(ip6_accept_rtadv) +#define V_ip6_no_radr VNET(ip6_no_radr) +#define V_ip6_norbit_raif VNET(ip6_norbit_raif) #define V_ip6_keepfaith VNET(ip6_keepfaith) #define V_ip6_log_interval VNET(ip6_log_interval) #define V_ip6_log_time VNET(ip6_log_time) Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jun 6 01:53:31 2011 (r222727) +++ head/sys/netinet6/nd6.c Mon Jun 6 02:14:23 2011 (r222728) @@ -193,6 +193,8 @@ nd6_ifattach(struct ifnet *ifp) /* A loopback interface does not need to accept RTADV. */ if (V_ip6_accept_rtadv && !(ifp->if_flags & IFF_LOOPBACK)) nd->flags |= ND6_IFF_ACCEPT_RTADV; + if (V_ip6_no_radr && !(ifp->if_flags & IFF_LOOPBACK)) + nd->flags |= ND6_IFF_NO_RADR; /* XXX: we cannot call nd6_setmtu since ifp is not fully initialized */ nd6_setmtu0(ifp, nd); @@ -825,7 +827,7 @@ nd6_purge(struct ifnet *ifp) if (V_nd6_defifindex == ifp->if_index) nd6_setdefaultiface(0); - if (!V_ip6_forwarding && ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) { + if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) { /* Refresh default router list. */ defrouter_select(); } @@ -958,10 +960,9 @@ nd6_is_new_addr_neighbor(struct sockaddr /* * If the default router list is empty, all addresses are regarded * as on-link, and thus, as a neighbor. - * XXX: we restrict the condition to hosts, because routers usually do - * not have the "default router list". */ - if (!V_ip6_forwarding && TAILQ_FIRST(&V_nd_defrouter) == NULL && + if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && + TAILQ_FIRST(&V_nd_defrouter) == NULL && V_nd6_defifindex == ifp->if_index) { return (1); } @@ -1022,8 +1023,7 @@ nd6_free(struct llentry *ln, int gc) ifp = ln->lle_tbl->llt_ifp; - if (!V_ip6_forwarding) { - + if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) { dr = defrouter_lookup(&L3_ADDR_SIN6(ln)->sin6_addr, ifp); if (dr != NULL && dr->expire && @@ -1340,7 +1340,7 @@ nd6_ioctl(u_long cmd, caddr_t data, stru continue; ia = (struct in6_ifaddr *)ifa; if ((ia->ia6_flags & IN6_IFF_DUPLICATED) && - IN6_IS_ADDR_LINKLOCAL(&ia->ia_addr.sin6_addr)) { + IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia))) { duplicated_linklocal = 1; break; } @@ -1718,7 +1718,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru * for those are not autoconfigured hosts, we explicitly avoid such * cases for safety. */ - if (do_update && router && !V_ip6_forwarding && + if (do_update && router && ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) { /* * guaranteed recursion Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Mon Jun 6 01:53:31 2011 (r222727) +++ head/sys/netinet6/nd6.h Mon Jun 6 02:14:23 2011 (r222728) @@ -85,6 +85,7 @@ struct nd_ifinfo { */ #define ND6_IFF_DONT_SET_IFROUTE 0x10 #define ND6_IFF_AUTO_LINKLOCAL 0x20 +#define ND6_IFF_NO_RADR 0x40 #define ND6_CREATE LLE_CREATE #define ND6_EXCLUSIVE LLE_EXCLUSIVE Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Mon Jun 6 01:53:31 2011 (r222727) +++ head/sys/netinet6/nd6_nbr.c Mon Jun 6 02:14:23 2011 (r222728) @@ -112,10 +112,14 @@ nd6_ns_input(struct mbuf *m, int off, in int lladdrlen = 0; int anycast = 0, proxy = 0, tentative = 0; int tlladdr; + int rflag; union nd_opts ndopts; struct sockaddr_dl proxydl; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + rflag = (V_ip6_forwarding) ? ND_NA_FLAG_ROUTER : 0; + if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && V_ip6_norbit_raif) + rflag = 0; #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, icmp6len,); nd_ns = (struct nd_neighbor_solicit *)((caddr_t)ip6 + off); @@ -339,8 +343,7 @@ nd6_ns_input(struct mbuf *m, int off, in goto bad; nd6_na_output(ifp, &in6_all, &taddr6, ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) | - (V_ip6_forwarding ? ND_NA_FLAG_ROUTER : 0), - tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL); + rflag, tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL); goto freeit; } @@ -349,8 +352,8 @@ nd6_ns_input(struct mbuf *m, int off, in nd6_na_output(ifp, &saddr6, &taddr6, ((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) | - (V_ip6_forwarding ? ND_NA_FLAG_ROUTER : 0) | ND_NA_FLAG_SOLICITED, - tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL); + rflag | ND_NA_FLAG_SOLICITED, tlladdr, + proxy ? (struct sockaddr *)&proxydl : NULL); freeit: if (ifa != NULL) ifa_free(ifa); @@ -862,7 +865,8 @@ nd6_na_input(struct mbuf *m, int off, in dr = defrouter_lookup(in6, ln->lle_tbl->llt_ifp); if (dr) defrtrlist_del(dr); - else if (!V_ip6_forwarding) { + else if (ND_IFINFO(ln->lle_tbl->llt_ifp)->flags & + ND6_IFF_ACCEPT_RTADV) { /* * Even if the neighbor is not in the default * router list, the neighbor may be used Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Mon Jun 6 01:53:31 2011 (r222727) +++ head/sys/netinet6/nd6_rtr.c Mon Jun 6 02:14:23 2011 (r222728) @@ -127,8 +127,11 @@ nd6_rs_input(struct mbuf *m, int off, in union nd_opts ndopts; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; - /* If I'm not a router, ignore it. */ - if (!V_ip6_forwarding) + /* + * Accept RS only when V_ip6_forwarding=1 and the interface has + * no ND6_IFF_ACCEPT_RTADV. + */ + if (!V_ip6_forwarding || ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) goto freeit; /* Sanity checks */ @@ -213,11 +216,10 @@ nd6_ra_input(struct mbuf *m, int off, in char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; /* - * We only accept RAs only when - * the node is not a router and - * per-interface variable allows RAs on the receiving interface. + * We only accept RAs only when the per-interface flag + * ND6_IFF_ACCEPT_RTADV is on the receiving interface. */ - if (V_ip6_forwarding || !(ndi->flags & ND6_IFF_ACCEPT_RTADV)) + if (!(ndi->flags & ND6_IFF_ACCEPT_RTADV)) goto freeit; if (ip6->ip6_hlim != 255) { @@ -266,7 +268,15 @@ nd6_ra_input(struct mbuf *m, int off, in bzero(&dr0, sizeof(dr0)); dr0.rtaddr = saddr6; dr0.flags = nd_ra->nd_ra_flags_reserved; - dr0.rtlifetime = ntohs(nd_ra->nd_ra_router_lifetime); + /* + * Effectively-disable the route in the RA packet + * when ND6_IFF_NO_RADR on the receiving interface or + * ip6.forwarding=1. + */ + if (ndi->flags & ND6_IFF_NO_RADR || V_ip6_forwarding) + dr0.rtlifetime = 0; + else + dr0.rtlifetime = ntohs(nd_ra->nd_ra_router_lifetime); dr0.expire = time_second + dr0.rtlifetime; dr0.ifp = ifp; /* unspecified or not? (RFC 2461 6.3.4) */ @@ -557,7 +567,7 @@ defrtrlist_del(struct nd_defrouter *dr) * Flush all the routing table entries that use the router * as a next hop. */ - if (!V_ip6_forwarding) + if (ND_IFINFO(dr->ifp)->flags & ND6_IFF_ACCEPT_RTADV) rt6_flush(&dr->rtaddr, dr->ifp); if (dr->installed) { @@ -616,20 +626,6 @@ defrouter_select(void) struct llentry *ln = NULL; /* - * This function should be called only when acting as an autoconfigured - * host. Although the remaining part of this function is not effective - * if the node is not an autoconfigured host, we explicitly exclude - * such cases here for safety. - */ - if (V_ip6_forwarding) { - nd6log((LOG_WARNING, - "defrouter_select: called unexpectedly (forwarding=%d)\n", - V_ip6_forwarding)); - splx(s); - return; - } - - /* * Let's handle easy case (3) first: * If default router list is empty, there's nothing to be done. */ From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 02:37:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F9C1106564A; Mon, 6 Jun 2011 02:37: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 2F3298FC08; Mon, 6 Jun 2011 02:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p562bdAf007773; Mon, 6 Jun 2011 02:37:39 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p562bduR007770; Mon, 6 Jun 2011 02:37:39 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106060237.p562bduR007770@svn.freebsd.org> From: Hiroki Sato Date: Mon, 6 Jun 2011 02:37: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: r222730 - 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: Mon, 06 Jun 2011 02:37:39 -0000 Author: hrs Date: Mon Jun 6 02:37:38 2011 New Revision: 222730 URL: http://svn.freebsd.org/changeset/base/222730 Log: - Make the code more proactively clear an ND6_IFF_IFDISABLED flag when an explicit action for INET6 configuration happens. The changes are: 1. When an ND6 flag is changed via SIOCSIFINFO_FLAGS ioctl, setting ND6_IFF_ACCEPT_RTADV and/or ND6_IFF_AUTO_LINKLOCAL now triggers an attempt to clear the ND6_IFF_IFDISABLED flag. 2. When an AF_INET6 address is added successfully to an interface and it is marked as ND6_IFF_IFDISABLED, an attempt to clear the ND6_IFF_IFDISABLED happens. This simplifies ND6_IFF_IFDISABLED flag manipulation by users via ifconfig(8); in most cases manual configuration is no longer needed. - When ND6_IFF_AUTO_LINKLOCAL is set and no link-local address is assigned to an interface, SIOCSIFINFO_FLAGS ioctl now calls in6_ifattach() to configure a link-local address. This change ensures link-local address configuration when "ifconfig IF inet6" command is invoked. For example, "ifconfig IF inet6 auto_linklocal" now always try to configure an LL addr even if ND6_IFF_AUTO_LINKLOCAL is already set to 1 (i.e. down/up cycle is no longer needed). Reviewed by: bz Modified: head/sys/netinet6/in6.c head/sys/netinet6/nd6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Jun 6 02:25:53 2011 (r222729) +++ head/sys/netinet6/in6.c Mon Jun 6 02:37:38 2011 (r222730) @@ -652,8 +652,32 @@ in6_control(struct socket *so, u_long cm * that is, this address might make other addresses detached. */ pfxlist_onlink_check(); - if (error == 0 && ia) + if (error == 0 && ia) { + if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) { + /* + * Try to clear the flag when a new + * IPv6 address is added onto an + * IFDISABLED interface and it + * succeeds. + */ + struct in6_ndireq nd; + + memset(&nd, 0, sizeof(nd)); + nd.ndi.flags = ND_IFINFO(ifp)->flags; + nd.ndi.flags &= ~ND6_IFF_IFDISABLED; + if (nd6_ioctl(SIOCSIFINFO_FLAGS, + (caddr_t)&nd, ifp) < 0) + log(LOG_NOTICE, "SIOCAIFADDR_IN6: " + "SIOCSIFINFO_FLAGS for -ifdisabled " + "failed."); + /* + * Ignore failure of clearing the flag + * intentionally. The failure means + * address duplication was detected. + */ + } EVENTHANDLER_INVOKE(ifaddr_event, ifp); + } break; } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jun 6 02:25:53 2011 (r222729) +++ head/sys/netinet6/nd6.c Mon Jun 6 02:37:38 2011 (r222730) @@ -1322,6 +1322,15 @@ nd6_ioctl(u_long cmd, caddr_t data, stru struct ifaddr *ifa; struct in6_ifaddr *ia; + /* + * Try to clear ifdisabled flag when enabling + * accept_rtadv or auto_linklocal. + */ + if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && + (ND.flags & (ND6_IFF_ACCEPT_RTADV | + ND6_IFF_AUTO_LINKLOCAL))) + ND.flags &= ~ND6_IFF_IFDISABLED; + if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && !(ND.flags & ND6_IFF_IFDISABLED)) { /* ifdisabled 1->0 transision */ @@ -1379,6 +1388,27 @@ nd6_ioctl(u_long cmd, caddr_t data, stru /* If no link-local address on ifp, configure */ ND_IFINFO(ifp)->flags |= ND6_IFF_AUTO_LINKLOCAL; in6_ifattach(ifp, NULL); + } else if (ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) { + /* + * When the IF already has + * ND6_IFF_AUTO_LINKLOCAL and no link-local + * address is assigned, try to assign one. + */ + int haslinklocal = 0; + + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + ia = (struct in6_ifaddr *)ifa; + if (IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia))) { + haslinklocal = 1; + break; + } + } + IF_ADDR_UNLOCK(ifp); + if (!haslinklocal) + in6_ifattach(ifp, NULL); } } ND_IFINFO(ifp)->flags = ND.flags; From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 03:06:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9448A1065670; Mon, 6 Jun 2011 03:06:43 +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 849448FC19; Mon, 6 Jun 2011 03:06:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5636hT7008907; Mon, 6 Jun 2011 03:06:43 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5636hR5008901; Mon, 6 Jun 2011 03:06:43 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106060306.p5636hR5008901@svn.freebsd.org> From: Hiroki Sato Date: Mon, 6 Jun 2011 03:06: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: r222732 - in head: sys/netinet usr.sbin/rtadvd usr.sbin/rtsold X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 03:06:43 -0000 Author: hrs Date: Mon Jun 6 03:06:43 2011 New Revision: 222732 URL: http://svn.freebsd.org/changeset/base/222732 Log: - Implement RDNSS and DNSSL options (RFC 6106, IPv6 Router Advertisement Options for DNS Configuration) into rtadvd(8) and rtsold(8). DNS information received by rtsold(8) will go to resolv.conf(5) by resolvconf(8) script. This is based on work by J.R. Oldroyd (kern/156259) but revised extensively[1]. - rtadvd(8) now supports "noifprefix" to disable gathering on-link prefixes from interfaces when no "addr" is specified[2]. An entry in rtadvd.conf with "noifprefix" + no "addr" generates an RA message with no prefix information option. - rtadvd(8) now supports RTM_IFANNOUNCE message to fix crashes when an interface is added or removed. - Correct bogus ND_OPT_ROUTE_INFO value to one in RFC 4191. Reviewed by: bz[1] PR: kern/156259 [1] PR: bin/152458 [2] Modified: head/sys/netinet/icmp6.h head/usr.sbin/rtadvd/Makefile head/usr.sbin/rtadvd/advcap.c head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/config.h head/usr.sbin/rtadvd/dump.c head/usr.sbin/rtadvd/dump.h head/usr.sbin/rtadvd/if.c head/usr.sbin/rtadvd/if.h head/usr.sbin/rtadvd/pathnames.h head/usr.sbin/rtadvd/rrenum.c head/usr.sbin/rtadvd/rrenum.h head/usr.sbin/rtadvd/rtadvd.8 head/usr.sbin/rtadvd/rtadvd.c head/usr.sbin/rtadvd/rtadvd.conf head/usr.sbin/rtadvd/rtadvd.conf.5 head/usr.sbin/rtadvd/rtadvd.h head/usr.sbin/rtadvd/timer.c head/usr.sbin/rtadvd/timer.h head/usr.sbin/rtsold/Makefile head/usr.sbin/rtsold/dump.c head/usr.sbin/rtsold/if.c head/usr.sbin/rtsold/probe.c head/usr.sbin/rtsold/rtsock.c head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.8 head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Mon Jun 6 02:46:22 2011 (r222731) +++ head/sys/netinet/icmp6.h Mon Jun 6 03:06:43 2011 (r222732) @@ -297,8 +297,9 @@ struct nd_opt_hdr { /* Neighbor discove #define ND_OPT_PREFIX_INFORMATION 3 #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 - -#define ND_OPT_ROUTE_INFO 200 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */ +#define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */ +#define ND_OPT_RDNSS 25 /* RFC 6016 */ +#define ND_OPT_DNSSL 31 /* RFC 6016 */ struct nd_opt_prefix_info { /* prefix information */ u_int8_t nd_opt_pi_type; @@ -338,6 +339,22 @@ struct nd_opt_route_info { /* route info /* prefix follows */ } __packed; +struct nd_opt_rdnss { /* RDNSS option (RFC 6106) */ + u_int8_t nd_opt_rdnss_type; + u_int8_t nd_opt_rdnss_len; + u_int16_t nd_opt_rdnss_reserved; + u_int32_t nd_opt_rdnss_lifetime; + /* followed by list of recursive DNS servers */ +} __packed; + +struct nd_opt_dnssl { /* DNSSL option (RFC 6106) */ + u_int8_t nd_opt_dnssl_type; + u_int8_t nd_opt_dnssl_len; + u_int16_t nd_opt_dnssl_reserved; + u_int32_t nd_opt_dnssl_lifetime; + /* followed by list of DNS search domains */ +} __packed; + /* * icmp6 namelookup */ Modified: head/usr.sbin/rtadvd/Makefile ============================================================================== --- head/usr.sbin/rtadvd/Makefile Mon Jun 6 02:46:22 2011 (r222731) +++ head/usr.sbin/rtadvd/Makefile Mon Jun 6 03:06:43 2011 (r222732) @@ -23,6 +23,6 @@ LDADD= -lutil CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DROUTEINFO -WARNS?= 1 +WARNS?= 6 .include Modified: head/usr.sbin/rtadvd/advcap.c ============================================================================== --- head/usr.sbin/rtadvd/advcap.c Mon Jun 6 02:46:22 2011 (r222731) +++ head/usr.sbin/rtadvd/advcap.c Mon Jun 6 03:06:43 2011 (r222732) @@ -64,8 +64,6 @@ #define V_TERM "HOST" #endif -char *RM; - /* * termcap - routines for dealing with the terminal capability data base * @@ -83,12 +81,11 @@ char *RM; static char *tbuf; static int hopcount; /* detect infinite loops in termcap, init 0 */ -static char *remotefile; - -extern char *conffile; +static const char *remotefile; +extern const char *conffile; int tgetent(char *, char *); -int getent(char *, char *, char *); +int getent(char *, char *, const char *); int tnchktc(void); int tnamatch(char *); static char *tskip(char *); @@ -103,22 +100,18 @@ static char *tdecode(char *, char **); * we just notice escaped newlines. */ int -tgetent(bp, name) - char *bp, *name; +tgetent(char *bp, char *name) { - char *cp; - - remotefile = cp = conffile ? conffile : _PATH_RTADVDCONF; - return (getent(bp, name, cp)); + return (getent(bp, name, conffile)); } int -getent(bp, name, cp) - char *bp, *name, *cp; +getent(char *bp, char *name, const char *cfile) { int c; int i = 0, cnt = 0; char ibuf[BUFSIZ]; + char *cp; int tf; tbuf = bp; @@ -130,9 +123,9 @@ getent(bp, name, cp) * use so we don't have to read the file. In this case it * has to already have the newlines crunched out. */ - if (cp && *cp) { - tf = open(RM = cp, O_RDONLY); - } + if (cfile && *cfile) + tf = open(cfile, O_RDONLY); + if (tf < 0) { syslog(LOG_INFO, "<%s> open: %s", __func__, strerror(errno)); @@ -184,7 +177,7 @@ getent(bp, name, cp) * Note that this works because of the left to right scan. */ int -tnchktc() +tnchktc(void) { char *p, *q; char tcname[16]; /* name of similar terminal */ @@ -233,8 +226,7 @@ tnchktc() * name (before the first field) stops us. */ int -tnamatch(np) - char *np; +tnamatch(char *np) { char *Np, *Bp; @@ -260,8 +252,7 @@ tnamatch(np) * into the termcap file in octal. */ static char * -tskip(bp) - char *bp; +tskip(char *bp) { int dquote; @@ -305,8 +296,7 @@ breakbreak: * Note that we handle octal numbers beginning with 0. */ int64_t -tgetnum(id) - char *id; +tgetnum(char *id) { int64_t i; int base; @@ -341,8 +331,7 @@ tgetnum(id) * not given. */ int -tgetflag(id) - char *id; +tgetflag(char *id) { char *bp = tbuf; @@ -369,8 +358,7 @@ tgetflag(id) * No checking on area overflow. */ char * -tgetstr(id, area) - char *id, **area; +tgetstr(char *id, char **area) { char *bp = tbuf; @@ -395,13 +383,11 @@ tgetstr(id, area) * string capability escapes. */ static char * -tdecode(str, area) - char *str; - char **area; +tdecode(char *str, char **area) { char *cp; int c; - char *dp; + const char *dp; int i; char term; Modified: head/usr.sbin/rtadvd/config.c ============================================================================== --- head/usr.sbin/rtadvd/config.c Mon Jun 6 02:46:22 2011 (r222731) +++ head/usr.sbin/rtadvd/config.c Mon Jun 6 03:06:43 2011 (r222732) @@ -4,7 +4,7 @@ /* * Copyright (C) 1998 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,7 +16,7 @@ * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -53,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -65,29 +65,55 @@ #include "if.h" #include "config.h" +/* label of tcapcode + number + domain name + zero octet */ +static char entbuf[10 + 3 + NI_MAXHOST + 1]; +static char oentbuf[10 + 3 + NI_MAXHOST + 1]; +static char abuf[DNAME_LABELENC_MAXLEN]; + static time_t prefix_timo = (60 * 120); /* 2 hours. * XXX: should be configurable. */ -extern struct rainfo *ralist; static struct rtadvd_timer *prefix_timeout(void *); -static void makeentry(char *, size_t, int, char *); -static int getinet6sysctl(int); +static void makeentry(char *, size_t, int, const char *); +static size_t dname_labelenc(char *, const char *); -void -getconfig(intface) - char *intface; +/* Encode domain name label encoding in RFC 1035 Section 3.1 */ +static size_t +dname_labelenc(char *dst, const char *src) { - int stat, i; - char tbuf[BUFSIZ]; - struct rainfo *tmp; - long val; - int64_t val64; - char buf[BUFSIZ]; - char *bp = buf; - char *addr, *flagstr; - static int forwarding = -1; + char *dst_origin; + char *p; + size_t len; -#define MUSTHAVE(var, cap) \ + dst_origin = dst; + len = strlen(src); + + /* Length fields per 63 octets + '\0' (<= DNAME_LABELENC_MAXLEN) */ + memset(dst, 0, len + len / 64 + 1 + 1); + + syslog(LOG_DEBUG, "<%s> labelenc = %s", __func__, src); + while (src && (len = strlen(src)) != 0) { + /* Put a length field with 63 octet limitation first. */ + p = strchr(src, '.'); + if (p == NULL) + *dst++ = len = MIN(63, len); + else + *dst++ = len = MIN(63, p - src); + /* Copy 63 octets at most. */ + memcpy(dst, src, len); + dst += len; + if (p == NULL) /* the last label */ + break; + src = p + 1; + } + /* Always need a 0-length label at the tail. */ + *dst++ = '\0'; + + syslog(LOG_DEBUG, "<%s> labellen = %d", __func__, dst - dst_origin); + return (dst - dst_origin); +} + +#define MUSTHAVE(var, cap) \ do { \ int64_t t; \ if ((t = agetnum(cap)) < 0) { \ @@ -97,60 +123,158 @@ getconfig(intface) } \ var = t; \ } while (0) -#define MAYHAVE(var, cap, def) \ + +#define MAYHAVE(var, cap, def) \ do { \ if ((var = agetnum(cap)) < 0) \ var = def; \ } while (0) +#define ELM_MALLOC(p,error_action) \ + do { \ + p = malloc(sizeof(*p)); \ + if (p == NULL) { \ + syslog(LOG_ERR, "<%s> malloc failed: %s", \ + __func__, strerror(errno)); \ + error_action; \ + } \ + memset(p, 0, sizeof(*p)); \ + } while(0) + +int +rmconfig(int idx) +{ + struct rainfo *rai; + struct prefix *pfx; + struct soliciter *sol; + struct rdnss *rdn; + struct rdnss_addr *rdna; + struct dnssl *dns; + struct rtinfo *rti; + + rai = if_indextorainfo(idx); + if (rai == NULL) { + syslog(LOG_ERR, "<%s>: rainfo not found (idx=%d)", + __func__, idx); + return (-1); + } + + TAILQ_REMOVE(&railist, rai, rai_next); + syslog(LOG_DEBUG, "<%s>: rainfo (idx=%d) removed.", + __func__, idx); + + /* Free all of allocated memories for this entry. */ + rtadvd_remove_timer(rai->rai_timer); + + if (rai->rai_ra_data != NULL) + free(rai->rai_ra_data); + + if (rai->rai_sdl != NULL) + free(rai->rai_sdl); + + while ((pfx = TAILQ_FIRST(&rai->rai_prefix)) != NULL) { + TAILQ_REMOVE(&rai->rai_prefix, pfx, pfx_next); + free(pfx); + } + while ((sol = TAILQ_FIRST(&rai->rai_soliciter)) != NULL) { + TAILQ_REMOVE(&rai->rai_soliciter, sol, sol_next); + free(sol); + } + while ((rdn = TAILQ_FIRST(&rai->rai_rdnss)) != NULL) { + TAILQ_REMOVE(&rai->rai_rdnss, rdn, rd_next); + while ((rdna = TAILQ_FIRST(&rdn->rd_list)) != NULL) { + TAILQ_REMOVE(&rdn->rd_list, rdna, ra_next); + free(rdna); + } + free(rdn); + } + while ((dns = TAILQ_FIRST(&rai->rai_dnssl)) != NULL) { + TAILQ_REMOVE(&rai->rai_dnssl, dns, dn_next); + free(dns); + } + while ((rti = TAILQ_FIRST(&rai->rai_route)) != NULL) { + TAILQ_REMOVE(&rai->rai_route, rti, rti_next); + free(rti); + } + free(rai); + + return (0); +} + +int +getconfig(int idx) +{ + int stat, i; + char tbuf[BUFSIZ]; + struct rainfo *rai; + long val; + int64_t val64; + char buf[BUFSIZ]; + char *bp = buf; + char *addr, *flagstr; + char intface[IFNAMSIZ]; + + if (if_indextoname(idx, intface) == NULL) { + syslog(LOG_ERR, "<%s> invalid index number (%d)", + __func__, idx); + return (-1); + } + if ((stat = agetent(tbuf, intface)) <= 0) { memset(tbuf, 0, sizeof(tbuf)); syslog(LOG_INFO, - "<%s> %s isn't defined in the configuration file" - " or the configuration file doesn't exist." - " Treat it as default", - __func__, intface); + "<%s> %s isn't defined in the configuration file" + " or the configuration file doesn't exist." + " Treat it as default", + __func__, intface); } - tmp = (struct rainfo *)malloc(sizeof(*ralist)); - if (tmp == NULL) { + rai = malloc(sizeof(*rai)); + if (rai == NULL) { syslog(LOG_INFO, "<%s> %s: can't allocate enough memory", __func__, intface); exit(1); } - memset(tmp, 0, sizeof(*tmp)); - tmp->prefix.next = tmp->prefix.prev = &tmp->prefix; + memset(rai, 0, sizeof(*rai)); + TAILQ_INIT(&rai->rai_prefix); #ifdef ROUTEINFO - tmp->route.next = tmp->route.prev = &tmp->route; + TAILQ_INIT(&rai->rai_route); #endif - - /* check if we are allowed to forward packets (if not determined) */ - if (forwarding < 0) { - if ((forwarding = getinet6sysctl(IPV6CTL_FORWARDING)) < 0) - exit(1); - } + TAILQ_INIT(&rai->rai_rdnss); + TAILQ_INIT(&rai->rai_dnssl); + TAILQ_INIT(&rai->rai_soliciter); + + /* gather on-link prefixes from the network interfaces. */ + if (agetflag("noifprefix")) + rai->rai_advifprefix = 0; + else + rai->rai_advifprefix = 1; /* get interface information */ if (agetflag("nolladdr")) - tmp->advlinkopt = 0; + rai->rai_advlinkopt = 0; else - tmp->advlinkopt = 1; - if (tmp->advlinkopt) { - if ((tmp->sdl = if_nametosdl(intface)) == NULL) { + rai->rai_advlinkopt = 1; + if (rai->rai_advlinkopt) { + if ((rai->rai_sdl = if_nametosdl(intface)) == NULL) { syslog(LOG_ERR, - "<%s> can't get information of %s", - __func__, intface); - exit(1); + "<%s> can't get information of %s", + __func__, intface); + return (-1); } - tmp->ifindex = tmp->sdl->sdl_index; + rai->rai_ifindex = rai->rai_sdl->sdl_index; } else - tmp->ifindex = if_nametoindex(intface); - strncpy(tmp->ifname, intface, sizeof(tmp->ifname)); - if ((tmp->phymtu = if_getmtu(intface)) == 0) { - tmp->phymtu = IPV6_MMTU; + rai->rai_ifindex = if_nametoindex(intface); + strncpy(rai->rai_ifname, intface, sizeof(rai->rai_ifname)); + syslog(LOG_DEBUG, + "<%s> ifindex = %d on %s", __func__, rai->rai_ifindex, + rai->rai_ifname); + + if ((rai->rai_phymtu = if_getmtu(intface)) == 0) { + rai->rai_phymtu = IPV6_MMTU; syslog(LOG_WARNING, - "<%s> can't get interface mtu of %s. Treat as %d", - __func__, intface, IPV6_MMTU); + "<%s> can't get interface mtu of %s. Treat as %d", + __func__, intface, IPV6_MMTU); } /* @@ -159,25 +283,27 @@ getconfig(intface) MAYHAVE(val, "maxinterval", DEF_MAXRTRADVINTERVAL); if (val < MIN_MAXINTERVAL || val > MAX_MAXINTERVAL) { syslog(LOG_ERR, - "<%s> maxinterval (%ld) on %s is invalid " - "(must be between %u and %u)", __func__, val, - intface, MIN_MAXINTERVAL, MAX_MAXINTERVAL); - exit(1); - } - tmp->maxinterval = (u_int)val; - MAYHAVE(val, "mininterval", tmp->maxinterval/3); - if (val < MIN_MININTERVAL || val > (tmp->maxinterval * 3) / 4) { + "<%s> maxinterval (%ld) on %s is invalid " + "(must be between %u and %u)", __func__, val, + intface, MIN_MAXINTERVAL, MAX_MAXINTERVAL); + return (-1); + } + rai->rai_maxinterval = (u_int)val; + + MAYHAVE(val, "mininterval", rai->rai_maxinterval/3); + if ((u_int)val < MIN_MININTERVAL || + (u_int)val > (rai->rai_maxinterval * 3) / 4) { syslog(LOG_ERR, - "<%s> mininterval (%ld) on %s is invalid " - "(must be between %d and %d)", - __func__, val, intface, MIN_MININTERVAL, - (tmp->maxinterval * 3) / 4); - exit(1); + "<%s> mininterval (%ld) on %s is invalid " + "(must be between %d and %d)", + __func__, val, intface, MIN_MININTERVAL, + (rai->rai_maxinterval * 3) / 4); + return (-1); } - tmp->mininterval = (u_int)val; + rai->rai_mininterval = (u_int)val; MAYHAVE(val, "chlim", DEF_ADVCURHOPLIMIT); - tmp->hoplimit = val & 0xff; + rai->rai_hoplimit = val & 0xff; if ((flagstr = (char *)agetstr("raflags", &bp))) { val = 0; @@ -191,77 +317,61 @@ getconfig(intface) if ((val & ND_RA_FLAG_RTPREF_HIGH)) { syslog(LOG_ERR, "<%s> the \'h\' and \'l\'" " router flags are exclusive", __func__); - exit(1); + return (-1); } val |= ND_RA_FLAG_RTPREF_LOW; } - } else { + } else MAYHAVE(val, "raflags", 0); - } - tmp->managedflg = val & ND_RA_FLAG_MANAGED; - tmp->otherflg = val & ND_RA_FLAG_OTHER; + + rai->rai_managedflg = val & ND_RA_FLAG_MANAGED; + rai->rai_otherflg = val & ND_RA_FLAG_OTHER; #ifndef ND_RA_FLAG_RTPREF_MASK #define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */ #define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */ #endif - tmp->rtpref = val & ND_RA_FLAG_RTPREF_MASK; - if (tmp->rtpref == ND_RA_FLAG_RTPREF_RSV) { + rai->rai_rtpref = val & ND_RA_FLAG_RTPREF_MASK; + if (rai->rai_rtpref == ND_RA_FLAG_RTPREF_RSV) { syslog(LOG_ERR, "<%s> invalid router preference (%02x) on %s", - __func__, tmp->rtpref, intface); - exit(1); + __func__, rai->rai_rtpref, intface); + return (-1); } - MAYHAVE(val, "rltime", tmp->maxinterval * 3); - if (val && (val < tmp->maxinterval || val > MAXROUTERLIFETIME)) { - syslog(LOG_ERR, - "<%s> router lifetime (%ld) on %s is invalid " - "(must be 0 or between %d and %d)", - __func__, val, intface, - tmp->maxinterval, - MAXROUTERLIFETIME); - exit(1); - } - /* - * Basically, hosts MUST NOT send Router Advertisement messages at any - * time (RFC 2461, Section 6.2.3). However, it would sometimes be - * useful to allow hosts to advertise some parameters such as prefix - * information and link MTU. Thus, we allow hosts to invoke rtadvd - * only when router lifetime (on every advertising interface) is - * explicitly set zero. (see also the above section) - */ - if (val && forwarding == 0) { + MAYHAVE(val, "rltime", rai->rai_maxinterval * 3); + if ((u_int)val && ((u_int)val < rai->rai_maxinterval || + (u_int)val > MAXROUTERLIFETIME)) { syslog(LOG_ERR, - "<%s> non zero router lifetime is specified for %s, " - "which must not be allowed for hosts. you must " - "change router lifetime or enable IPv6 forwarding.", - __func__, intface); - exit(1); + "<%s> router lifetime (%ld) on %s is invalid " + "(must be 0 or between %d and %d)", + __func__, val, intface, rai->rai_maxinterval, + MAXROUTERLIFETIME); + return (-1); } - tmp->lifetime = val & 0xffff; + rai->rai_lifetime = val & 0xffff; MAYHAVE(val, "rtime", DEF_ADVREACHABLETIME); if (val < 0 || val > MAXREACHABLETIME) { syslog(LOG_ERR, - "<%s> reachable time (%ld) on %s is invalid " - "(must be no greater than %d)", - __func__, val, intface, MAXREACHABLETIME); - exit(1); + "<%s> reachable time (%ld) on %s is invalid " + "(must be no greater than %d)", + __func__, val, intface, MAXREACHABLETIME); + return (-1); } - tmp->reachabletime = (u_int32_t)val; + rai->rai_reachabletime = (u_int32_t)val; MAYHAVE(val64, "retrans", DEF_ADVRETRANSTIMER); if (val64 < 0 || val64 > 0xffffffff) { syslog(LOG_ERR, "<%s> retrans time (%lld) on %s out of range", - __func__, (long long)val64, intface); - exit(1); + __func__, (long long)val64, intface); + return (-1); } - tmp->retranstimer = (u_int32_t)val64; + rai->rai_retranstimer = (u_int32_t)val64; if (agetnum("hapref") != -1 || agetnum("hatime") != -1) { syslog(LOG_ERR, - "<%s> mobile-ip6 configuration not supported", - __func__); - exit(1); + "<%s> mobile-ip6 configuration not supported", + __func__); + return (-1); } /* prefix information */ @@ -271,12 +381,11 @@ getconfig(intface) * checking consistency of advertised lifetimes. */ MAYHAVE(val, "clockskew", 0); - tmp->clockskew = val; + rai->rai_clockskew = val; - tmp->pfxs = 0; + rai->rai_pfxs = 0; for (i = -1; i < MAXPREFIX; i++) { struct prefix *pfx; - char entbuf[256]; makeentry(entbuf, sizeof(entbuf), i, "addr"); addr = (char *)agetstr(entbuf, &bp); @@ -284,49 +393,41 @@ getconfig(intface) continue; /* allocate memory to store prefix information */ - if ((pfx = malloc(sizeof(struct prefix))) == NULL) { - syslog(LOG_ERR, - "<%s> can't allocate enough memory", - __func__); - exit(1); - } - memset(pfx, 0, sizeof(*pfx)); + ELM_MALLOC(pfx, exit(1)); /* link into chain */ - insque(pfx, &tmp->prefix); - tmp->pfxs++; - pfx->rainfo = tmp; - - pfx->origin = PREFIX_FROM_CONFIG; + TAILQ_INSERT_TAIL(&rai->rai_prefix, pfx, pfx_next); + rai->rai_pfxs++; + pfx->pfx_origin = PREFIX_FROM_CONFIG; - if (inet_pton(AF_INET6, addr, &pfx->prefix) != 1) { + if (inet_pton(AF_INET6, addr, &pfx->pfx_prefix) != 1) { syslog(LOG_ERR, - "<%s> inet_pton failed for %s", - __func__, addr); - exit(1); + "<%s> inet_pton failed for %s", + __func__, addr); + return (-1); } - if (IN6_IS_ADDR_MULTICAST(&pfx->prefix)) { + if (IN6_IS_ADDR_MULTICAST(&pfx->pfx_prefix)) { syslog(LOG_ERR, - "<%s> multicast prefix (%s) must " - "not be advertised on %s", - __func__, addr, intface); - exit(1); + "<%s> multicast prefix (%s) must " + "not be advertised on %s", + __func__, addr, intface); + return (-1); } - if (IN6_IS_ADDR_LINKLOCAL(&pfx->prefix)) + if (IN6_IS_ADDR_LINKLOCAL(&pfx->pfx_prefix)) syslog(LOG_NOTICE, - "<%s> link-local prefix (%s) will be" - " advertised on %s", - __func__, addr, intface); + "<%s> link-local prefix (%s) will be" + " advertised on %s", + __func__, addr, intface); makeentry(entbuf, sizeof(entbuf), i, "prefixlen"); MAYHAVE(val, entbuf, 64); if (val < 0 || val > 128) { syslog(LOG_ERR, "<%s> prefixlen (%ld) for %s " - "on %s out of range", - __func__, val, addr, intface); - exit(1); + "on %s out of range", + __func__, val, addr, intface); + return (-1); } - pfx->prefixlen = (int)val; + pfx->pfx_prefixlen = (int)val; makeentry(entbuf, sizeof(entbuf), i, "pinfoflags"); if ((flagstr = (char *)agetstr(entbuf, &bp))) { @@ -339,8 +440,8 @@ getconfig(intface) MAYHAVE(val, entbuf, (ND_OPT_PI_FLAG_ONLINK|ND_OPT_PI_FLAG_AUTO)); } - pfx->onlinkflg = val & ND_OPT_PI_FLAG_ONLINK; - pfx->autoconfflg = val & ND_OPT_PI_FLAG_AUTO; + pfx->pfx_onlinkflg = val & ND_OPT_PI_FLAG_ONLINK; + pfx->pfx_autoconfflg = val & ND_OPT_PI_FLAG_AUTO; makeentry(entbuf, sizeof(entbuf), i, "vltime"); MAYHAVE(val64, entbuf, DEF_ADVVALIDLIFETIME); @@ -348,17 +449,17 @@ getconfig(intface) syslog(LOG_ERR, "<%s> vltime (%lld) for " "%s/%d on %s is out of range", __func__, (long long)val64, - addr, pfx->prefixlen, intface); - exit(1); + addr, pfx->pfx_prefixlen, intface); + return (-1); } - pfx->validlifetime = (u_int32_t)val64; + pfx->pfx_validlifetime = (u_int32_t)val64; makeentry(entbuf, sizeof(entbuf), i, "vltimedecr"); if (agetflag(entbuf)) { struct timeval now; gettimeofday(&now, 0); - pfx->vltimeexpire = - now.tv_sec + pfx->validlifetime; + pfx->pfx_vltimeexpire = + now.tv_sec + pfx->pfx_validlifetime; } makeentry(entbuf, sizeof(entbuf), i, "pltime"); @@ -368,44 +469,45 @@ getconfig(intface) "<%s> pltime (%lld) for %s/%d on %s " "is out of range", __func__, (long long)val64, - addr, pfx->prefixlen, intface); - exit(1); + addr, pfx->pfx_prefixlen, intface); + return (-1); } - pfx->preflifetime = (u_int32_t)val64; + pfx->pfx_preflifetime = (u_int32_t)val64; makeentry(entbuf, sizeof(entbuf), i, "pltimedecr"); if (agetflag(entbuf)) { struct timeval now; gettimeofday(&now, 0); - pfx->pltimeexpire = - now.tv_sec + pfx->preflifetime; + pfx->pfx_pltimeexpire = + now.tv_sec + pfx->pfx_preflifetime; } } - if (tmp->pfxs == 0) - get_prefix(tmp); + if (rai->rai_advifprefix && rai->rai_pfxs == 0) + get_prefix(rai); MAYHAVE(val, "mtu", 0); - if (val < 0 || val > 0xffffffff) { + if (val < 0 || (u_int)val > 0xffffffff) { syslog(LOG_ERR, - "<%s> mtu (%ld) on %s out of range", - __func__, val, intface); - exit(1); + "<%s> mtu (%ld) on %s out of range", + __func__, val, intface); + return (-1); } - tmp->linkmtu = (u_int32_t)val; - if (tmp->linkmtu == 0) { + rai->rai_linkmtu = (u_int32_t)val; + if (rai->rai_linkmtu == 0) { char *mtustr; if ((mtustr = (char *)agetstr("mtu", &bp)) && strcmp(mtustr, "auto") == 0) - tmp->linkmtu = tmp->phymtu; + rai->rai_linkmtu = rai->rai_phymtu; } - else if (tmp->linkmtu < IPV6_MMTU || tmp->linkmtu > tmp->phymtu) { + else if (rai->rai_linkmtu < IPV6_MMTU || + rai->rai_linkmtu > rai->rai_phymtu) { syslog(LOG_ERR, - "<%s> advertised link mtu (%lu) on %s is invalid (must " - "be between least MTU (%d) and physical link MTU (%d)", - __func__, (unsigned long)tmp->linkmtu, intface, - IPV6_MMTU, tmp->phymtu); - exit(1); + "<%s> advertised link mtu (%lu) on %s is invalid (must " + "be between least MTU (%d) and physical link MTU (%d)", + __func__, (unsigned long)rai->rai_linkmtu, intface, + IPV6_MMTU, rai->rai_phymtu); + return (-1); } #ifdef SIOCSIFINFO_IN6 @@ -415,65 +517,56 @@ getconfig(intface) if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { syslog(LOG_ERR, "<%s> socket: %s", __func__, - strerror(errno)); + strerror(errno)); exit(1); } memset(&ndi, 0, sizeof(ndi)); strncpy(ndi.ifname, intface, IFNAMSIZ); - if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&ndi) < 0) { + if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&ndi) < 0) syslog(LOG_INFO, "<%s> ioctl:SIOCGIFINFO_IN6 at %s: %s", - __func__, intface, strerror(errno)); - } + __func__, intface, strerror(errno)); /* reflect the RA info to the host variables in kernel */ - ndi.ndi.chlim = tmp->hoplimit; - ndi.ndi.retrans = tmp->retranstimer; - ndi.ndi.basereachable = tmp->reachabletime; - if (ioctl(s, SIOCSIFINFO_IN6, (caddr_t)&ndi) < 0) { + ndi.ndi.chlim = rai->rai_hoplimit; + ndi.ndi.retrans = rai->rai_retranstimer; + ndi.ndi.basereachable = rai->rai_reachabletime; + if (ioctl(s, SIOCSIFINFO_IN6, (caddr_t)&ndi) < 0) syslog(LOG_INFO, "<%s> ioctl:SIOCSIFINFO_IN6 at %s: %s", - __func__, intface, strerror(errno)); - } + __func__, intface, strerror(errno)); + close(s); } #endif /* route information */ #ifdef ROUTEINFO - tmp->routes = 0; + rai->rai_routes = 0; for (i = -1; i < MAXROUTE; i++) { struct rtinfo *rti; - char entbuf[256], oentbuf[256]; makeentry(entbuf, sizeof(entbuf), i, "rtprefix"); addr = (char *)agetstr(entbuf, &bp); if (addr == NULL) { makeentry(oentbuf, sizeof(oentbuf), i, "rtrprefix"); addr = (char *)agetstr(oentbuf, &bp); - if (addr) { + if (addr) fprintf(stderr, "%s was obsoleted. Use %s.\n", - oentbuf, entbuf); - } + oentbuf, entbuf); } if (addr == NULL) continue; /* allocate memory to store prefix information */ - if ((rti = malloc(sizeof(struct rtinfo))) == NULL) { - syslog(LOG_ERR, - "<%s> can't allocate enough memory", - __func__); - exit(1); - } - memset(rti, 0, sizeof(*rti)); + ELM_MALLOC(rti, exit(1)); /* link into chain */ - insque(rti, &tmp->route); - tmp->routes++; + TAILQ_INSERT_TAIL(&rai->rai_route, rti, rti_next); + rai->rai_routes++; - if (inet_pton(AF_INET6, addr, &rti->prefix) != 1) { + if (inet_pton(AF_INET6, addr, &rti->rti_prefix) != 1) { syslog(LOG_ERR, "<%s> inet_pton failed for %s", - __func__, addr); - exit(1); + __func__, addr); + return (-1); } #if 0 /* @@ -485,17 +578,17 @@ getconfig(intface) MAYHAVE(val64, entbuf, DEF_ADVVALIDLIFETIME); if (IN6_IS_ADDR_MULTICAST(&rti->prefix)) { syslog(LOG_ERR, - "<%s> multicast route (%s) must " - "not be advertised on %s", - __func__, addr, intface); - exit(1); + "<%s> multicast route (%s) must " + "not be advertised on %s", + __func__, addr, intface); + return (-1); } if (IN6_IS_ADDR_LINKLOCAL(&rti->prefix)) { syslog(LOG_NOTICE, - "<%s> link-local route (%s) will " - "be advertised on %s", - __func__, addr, intface); - exit(1); + "<%s> link-local route (%s) will " + "be advertised on %s", + __func__, addr, intface); + return (-1); } #endif @@ -505,19 +598,19 @@ getconfig(intface) if (val == 256) { makeentry(oentbuf, sizeof(oentbuf), i, "rtrplen"); MAYHAVE(val, oentbuf, 256); - if (val != 256) { + if (val != 256) fprintf(stderr, "%s was obsoleted. Use %s.\n", - oentbuf, entbuf); - } else + oentbuf, entbuf); + else val = 64; } if (val < 0 || val > 128) { syslog(LOG_ERR, "<%s> prefixlen (%ld) for %s on %s " - "out of range", - __func__, val, addr, intface); - exit(1); + "out of range", + __func__, val, addr, intface); + return (-1); } - rti->prefixlen = (int)val; + rti->rti_prefixlen = (int)val; makeentry(entbuf, sizeof(entbuf), i, "rtflags"); if ((flagstr = (char *)agetstr(entbuf, &bp))) { @@ -541,17 +634,17 @@ getconfig(intface) MAYHAVE(val, oentbuf, 256); if (val != 256) { fprintf(stderr, "%s was obsoleted. Use %s.\n", - oentbuf, entbuf); + oentbuf, entbuf); } else val = 0; } - rti->rtpref = val & ND_RA_FLAG_RTPREF_MASK; - if (rti->rtpref == ND_RA_FLAG_RTPREF_RSV) { + rti->rti_rtpref = val & ND_RA_FLAG_RTPREF_MASK; + if (rti->rti_rtpref == ND_RA_FLAG_RTPREF_RSV) { syslog(LOG_ERR, "<%s> invalid route preference (%02x) " - "for %s/%d on %s", - __func__, rti->rtpref, addr, - rti->prefixlen, intface); - exit(1); + "for %s/%d on %s", + __func__, rti->rti_rtpref, addr, + rti->rti_prefixlen, intface); + return (-1); } /* @@ -565,60 +658,143 @@ getconfig(intface) if (val64 == -1) { makeentry(oentbuf, sizeof(oentbuf), i, "rtrltime"); MAYHAVE(val64, oentbuf, -1); - if (val64 != -1) { + if (val64 != -1) fprintf(stderr, "%s was obsoleted. Use %s.\n", - oentbuf, entbuf); - } else { + oentbuf, entbuf); + else { fprintf(stderr, "%s should be specified " - "for interface %s.\n", - entbuf, intface); - val64 = tmp->lifetime; + "for interface %s.\n", entbuf, intface); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 03:37:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0453A106564A; Mon, 6 Jun 2011 03:37: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 EAB7C8FC0C; Mon, 6 Jun 2011 03:37:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p563bXlk010023; Mon, 6 Jun 2011 03:37:33 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p563bXeG010021; Mon, 6 Jun 2011 03:37:33 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106060337.p563bXeG010021@svn.freebsd.org> From: Hiroki Sato Date: Mon, 6 Jun 2011 03:37: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: r222733 - 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: Mon, 06 Jun 2011 03:37:34 -0000 Author: hrs Date: Mon Jun 6 03:37:33 2011 New Revision: 222733 URL: http://svn.freebsd.org/changeset/base/222733 Log: Remove "ifconfig IF inet6 -accept_rtadv" when ipv6_gateway_enable=YES because this is no longer needed. Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Jun 6 03:06:43 2011 (r222732) +++ head/etc/network.subr Mon Jun 6 03:37:33 2011 (r222733) @@ -100,25 +100,19 @@ ifconfig_up() # inet6 specific if afexists inet6; then - if ipv6if $1; then - if checkyesno ipv6_gateway_enable; then - _ipv6_opts="-accept_rtadv" - fi + if checkyesno ipv6_activate_all_interfaces; then + _ipv6_opts="-ifdisabled" else - if checkyesno ipv6_activate_all_interfaces; then - _ipv6_opts="-ifdisabled" - else - _ipv6_opts="ifdisabled" - fi - - # backward compatibility: $ipv6_enable - case $ipv6_enable in - [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - _ipv6_opts="${_ipv6_opts} accept_rtadv" - ;; - esac + _ipv6_opts="ifdisabled" fi + # backward compatibility: $ipv6_enable + case $ipv6_enable in + [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + _ipv6_opts="${_ipv6_opts} accept_rtadv" + ;; + esac + if [ -n "${_ipv6_opts}" ]; then ifconfig $1 inet6 ${_ipv6_opts} fi From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 03:40:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 799F2106566C; Mon, 6 Jun 2011 03:40:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 485248FC13; Mon, 6 Jun 2011 03:40:06 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LMC00J00NITMW00@smtpauth2.wiscmail.wisc.edu>; Sun, 05 Jun 2011 22:40:05 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.62.252]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LMC005U8NIRFH10@smtpauth2.wiscmail.wisc.edu>; Sun, 05 Jun 2011 22:40:04 -0500 (CDT) Date: Sun, 05 Jun 2011 22:40:03 -0500 From: Nathan Whitehorn In-reply-to: <201106060152.p561qF5M006329@svn.freebsd.org> To: Marcel Moolenaar Message-id: <4DEC4C13.6040304@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.62.252 X-Spam-PmxInfo: Server=avs-9, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.6.6.32715, SenderIP=76.210.62.252 References: <201106060152.p561qF5M006329@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222726 - head/release/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 03:40:06 -0000 On 06/05/11 20:52, Marcel Moolenaar wrote: > Author: marcel > Date: Mon Jun 6 01:52:15 2011 > New Revision: 222726 > URL: http://svn.freebsd.org/changeset/base/222726 > > Log: > Fix ia64 ISO creation: > o boot/mfsroot.gz is no more. Copy it only when it exists so as still > to be compatible with Makefile.sysinstall. > o while here, make ispfw.ko optional as well. > o '-b bootimage' is not a valid argument for makefs. What was meant > was '-o bootimage'. > o create the boot image in the current directory so that makefs can > find the file. Previously it had to be created under $BASE because > that's how mkisofs wanted it. Sorry to have broken it, and thanks for patching this up! -Nathan From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 04:12:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7082106564A; Mon, 6 Jun 2011 04:12:57 +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 8FCBF8FC1F; Mon, 6 Jun 2011 04:12:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p564Cv1R011172; Mon, 6 Jun 2011 04:12:57 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p564Cvm4011170; Mon, 6 Jun 2011 04:12:57 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106060412.p564Cvm4011170@svn.freebsd.org> From: Hiroki Sato Date: Mon, 6 Jun 2011 04:12: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: r222734 - 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: Mon, 06 Jun 2011 04:12:57 -0000 Author: hrs Date: Mon Jun 6 04:12:57 2011 New Revision: 222734 URL: http://svn.freebsd.org/changeset/base/222734 Log: Do not activate automatic LL addr configuration when 0/1->1 transition of ND6_IFF_IFDISABLED flag. Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Jun 6 03:37:33 2011 (r222733) +++ head/sys/netinet6/nd6.c Mon Jun 6 04:12:57 2011 (r222734) @@ -1327,6 +1327,7 @@ nd6_ioctl(u_long cmd, caddr_t data, stru * accept_rtadv or auto_linklocal. */ if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && + !(ND.flags & ND6_IFF_IFDISABLED) && (ND.flags & (ND6_IFF_ACCEPT_RTADV | ND6_IFF_AUTO_LINKLOCAL))) ND.flags &= ~ND6_IFF_IFDISABLED; @@ -1388,7 +1389,8 @@ nd6_ioctl(u_long cmd, caddr_t data, stru /* If no link-local address on ifp, configure */ ND_IFINFO(ifp)->flags |= ND6_IFF_AUTO_LINKLOCAL; in6_ifattach(ifp, NULL); - } else if (ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) { + } else if ((ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) && + !(ND.flags & ND6_IFF_IFDISABLED)) { /* * When the IF already has * ND6_IFF_AUTO_LINKLOCAL and no link-local From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 05:31:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F39F106566C; Mon, 6 Jun 2011 05:31:06 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 0425A8FC14; Mon, 6 Jun 2011 05:31:05 +0000 (UTC) Received: from dhcp-192-168-2-22.wifi.xcllnt.net (atm.xcllnt.net [70.36.220.6]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p565Ux4p002438 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 5 Jun 2011 22:31:05 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=utf-8 From: Marcel Moolenaar In-Reply-To: <4DEC4C13.6040304@freebsd.org> Date: Sun, 5 Jun 2011 22:30:59 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106060152.p561qF5M006329@svn.freebsd.org> <4DEC4C13.6040304@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r222726 - head/release/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 05:31:06 -0000 On Jun 5, 2011, at 8:40 PM, Nathan Whitehorn wrote: > On 06/05/11 20:52, Marcel Moolenaar wrote: >> Author: marcel >> Date: Mon Jun 6 01:52:15 2011 >> New Revision: 222726 >> URL: http://svn.freebsd.org/changeset/base/222726 >>=20 >> Log: >> Fix ia64 ISO creation: >> o boot/mfsroot.gz is no more. Copy it only when it exists so as = still >> to be compatible with Makefile.sysinstall. >> o while here, make ispfw.ko optional as well. >> o '-b bootimage' is not a valid argument for makefs. What was = meant >> was '-o bootimage'. >> o create the boot image in the current directory so that makefs = can >> find the file. Previously it had to be created under $BASE = because >> that's how mkisofs wanted it. >=20 > Sorry to have broken it, and thanks for patching this up! No worries. I just did a fresh install and the whole process is just a delight. There's only 1 real problem: the new boot menu is crashing the loader, so I'll be removing that. Other than that, only aesthetic "issues": : /etc/rc: WARNING: $hostname is not set -- see rc.conf(5). : FreeBSD Installer = =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80 =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80Archive = Extraction=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =90 =E2=94=82 =E2=94= =82 =20 =E2=94=82 base.txz [ Done ] =E2=94= =82 =20 =E2=94=82 kernel.txz [ Done ] =E2=94= =82 =20 =E2=94=82 games.txz [ Done ] =E2=94= =82 =20 =E2=94=82 ports.txz [ 99% ] =E2=94= =82 =20 =E2=94=82 src.txz [ Pending = ]mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65 = =E2=94=82 =20 mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65 =E2=94=82 =20= mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65 =E2=94=82 =20= mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=90 =E2=94=82 =20 mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65 =E2=94=82 =E2=94= =82 =20 mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=98 =E2=94=82 =20 mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth = 65=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=98 =20 mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65 =20 FreeBSD Installer =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Please select a password for the system management account (root): mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65 mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65 New Password:mpt0: QUEUE FULL EVENT: Bus 0x00 Target 0x03 Depth 65 BTW, one thing to note: my source tree (from which the release was made) wasn't owned by root and some of the file ownership ended up "wrong": eris# ls -al /boot/kernel/ total 41504 drwxr-xr-x 2 root 99 1024 Jun 6 04:55 . drwxr-xr-x 7 root 99 512 Jun 5 22:20 .. -r-xr-xr-x 1 root wheel 21706 Jun 5 22:20 geom_part_apm.ko -r-xr-xr-x 1 root wheel 39239 Jun 5 22:20 = geom_part_apm.ko.symbols -r-xr-xr-x 1 root wheel 21424 Jun 5 22:20 geom_part_bsd.ko -r-xr-xr-x 1 root wheel 44693 Jun 5 22:20 = geom_part_bsd.ko.symbols -r-xr-xr-x 1 root wheel 22771 Jun 5 22:20 geom_part_ebr.ko -r-xr-xr-x 1 root wheel 39400 Jun 5 22:20 = geom_part_ebr.ko.symbols -r-xr-xr-x 1 root wheel 40421 Jun 5 22:20 geom_part_gpt.ko -r-xr-xr-x 1 root wheel 67106 Jun 5 22:20 = geom_part_gpt.ko.symbols -r-xr-xr-x 1 root wheel 21270 Jun 5 22:20 geom_part_mbr.ko -r-xr-xr-x 1 root wheel 37715 Jun 5 22:20 = geom_part_mbr.ko.symbols -r-xr-xr-x 1 root wheel 21995 Jun 5 22:20 geom_part_pc98.ko -r-xr-xr-x 1 root wheel 39225 Jun 5 22:20 = geom_part_pc98.ko.symbols -r-xr-xr-x 1 root wheel 21780 Jun 5 22:20 geom_part_vtoc8.ko -r-xr-xr-x 1 root wheel 47979 Jun 5 22:20 = geom_part_vtoc8.ko.symbols -r-xr-xr-x 1 root wheel 11030943 Jun 5 21:56 kernel -r-xr-xr-x 1 root wheel 21760529 Jun 5 21:56 kernel.symbols -rw-r--r-- 1 root 99 5228 Jun 5 22:20 linker.hints -r-xr-xr-x 1 root wheel 22153 Jun 5 22:20 opensolaris.ko -r-xr-xr-x 1 root wheel 96888 Jun 5 22:20 opensolaris.ko.symbols -r-xr-xr-x 1 root wheel 2472977 Jun 5 22:20 zfs.ko -r-xr-xr-x 1 root wheel 6383611 Jun 5 22:20 zfs.ko.symbols eris# ls -al /usr total 80 drwxr-xr-x 15 root wheel 512 Jun 6 04:55 . drwxr-xr-x 19 root wheel 1024 Jun 6 05:29 .. drwxr-xr-x 2 root wheel 7680 Jun 5 22:12 bin drwxr-xr-x 2 root wheel 512 Jun 6 04:55 games drwxr-xr-x 51 root wheel 5632 Jun 5 22:11 include drwxr-xr-x 7 root wheel 12288 Jun 5 22:12 lib drwxr-xr-x 4 root wheel 512 Jun 5 21:39 lib32 drwxr-xr-x 5 root wheel 512 Jun 5 21:39 libdata drwxr-xr-x 6 root wheel 1536 Jun 5 22:12 libexec drwxr-xr-x 2 root wheel 512 Jun 5 21:39 local drwxr-xr-x 2 root wheel 512 Jun 5 21:39 obj drwxr-xr-x 68 501 99 1536 May 31 03:24 ports drwxr-xr-x 2 root wheel 5120 Jun 5 22:12 sbin drwxr-xr-x 27 root wheel 512 Jun 5 22:12 share drwxrwxr-x 22 501 99 1024 Jun 6 05:00 src --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 05:40:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 050B81065678; Mon, 6 Jun 2011 05:40: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 E70F48FC13; Mon, 6 Jun 2011 05:40:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p565eqNj013782; Mon, 6 Jun 2011 05:40:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p565eq6l013774; Mon, 6 Jun 2011 05:40:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106060540.p565eq6l013774@svn.freebsd.org> From: Xin LI Date: Mon, 6 Jun 2011 05:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222735 - stable/8/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 05:40:53 -0000 Author: delphij Date: Mon Jun 6 05:40:52 2011 New Revision: 222735 URL: http://svn.freebsd.org/changeset/base/222735 Log: MFC r222210, 222211, 222287: - Diff reduction against NetBSD. The most notable change is to zdiff(1) to handle more file formats including bzip2 and xz. - Match symbolic link handling behavior with GNU gzip, bzip2 and xz: When we are operating on a symbolic link pointing to an existing file, bail out by default, but go ahead if -f is specified. Modified: stable/8/usr.bin/gzip/Makefile stable/8/usr.bin/gzip/gzip.1 stable/8/usr.bin/gzip/gzip.c stable/8/usr.bin/gzip/zdiff stable/8/usr.bin/gzip/zdiff.1 stable/8/usr.bin/gzip/zuncompress.c Directory Properties: stable/8/usr.bin/gzip/ (props changed) Modified: stable/8/usr.bin/gzip/Makefile ============================================================================== --- stable/8/usr.bin/gzip/Makefile Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/Makefile Mon Jun 6 05:40:52 2011 (r222735) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2006/05/12 02:01:15 mrg Exp $ +# $NetBSD: Makefile,v 1.13 2009/04/14 22:15:20 lukem Exp $ # $FreeBSD$ .include Modified: stable/8/usr.bin/gzip/gzip.1 ============================================================================== --- stable/8/usr.bin/gzip/gzip.1 Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/gzip.1 Mon Jun 6 05:40:52 2011 (r222735) @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 27, 2010 +.Dd May 23, 2011 .Dt GZIP 1 .Os .Sh NAME @@ -127,9 +127,9 @@ stream, leaving files intact. This option selects decompression rather than compression. .It Fl f , -force This option turns on force mode. -This allows files with multiple links, overwriting of pre-existing -files, reading from or writing to a terminal, and when combined -with the +This allows files with multiple links, symbolic links to regular files, +overwriting of pre-existing files, reading from or writing to a terminal, +and when combined with the .Fl c option, allowing non-compressed data to pass through unchanged. .It Fl h , -help Modified: stable/8/usr.bin/gzip/gzip.c ============================================================================== --- stable/8/usr.bin/gzip/gzip.c Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/gzip.c Mon Jun 6 05:40:52 2011 (r222735) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.97 2009/10/11 09:17:21 mrg Exp $ */ +/* $NetBSD: gzip.c,v 1.99 2011/03/23 12:59:44 tsutsui Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -31,7 +31,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006\ Matthew R. Green. All rights reserved."); -__RCSID("$FreeBSD$"); +__FBSDID("$FreeBSD$"); #endif /* not lint */ /* @@ -146,7 +146,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20100407"; +static const char gzip_version[] = "FreeBSD gzip 20110523"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -314,7 +314,7 @@ main(int argc, char **argv) dflag = cflag = 1; #ifdef SMALL -#define OPT_LIST "123456789cdhltV" +#define OPT_LIST "123456789cdhlV" #else #define OPT_LIST "123456789acdfhklLNnqrS:tVv" #endif @@ -918,6 +918,7 @@ gz_uncompress(int in, int out, char *pre case Z_BUF_ERROR: if (z.avail_out > 0 && !done_reading) continue; + case Z_STREAM_END: case Z_OK: break; @@ -1781,7 +1782,8 @@ handle_pathname(char *path) } retry: - if (stat(path, &sb) != 0) { + if (stat(path, &sb) != 0 || (fflag == 0 && cflag == 0 && + lstat(path, &sb) != 0)) { /* lets try .gz if we're decompressing */ if (dflag && s == NULL && errno == ENOENT) { len = strlen(path); Modified: stable/8/usr.bin/gzip/zdiff ============================================================================== --- stable/8/usr.bin/gzip/zdiff Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/zdiff Mon Jun 6 05:40:52 2011 (r222735) @@ -1,10 +1,12 @@ #!/bin/sh - # -# $NetBSD: zdiff,v 1.3 2004/03/29 10:01:00 wiz Exp $ +# $NetBSD: zdiff,v 1.5 2010/04/14 20:30:28 joerg Exp $ +# # $OpenBSD: zdiff,v 1.2 2003/07/29 07:42:44 otto Exp $ # #- # Copyright (c) 2003 Todd C. Miller +# Copyright (c) 2010 Joerg Sonnenberger # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -31,7 +33,57 @@ case $0 in *) prog=diff ;; esac -USAGE="usage: z$prog [options] file1 [file2]" +USAGE="usage: $0 [options] file1 [file2]" + +check_suffix() { + case "$1" in + *[._-][Zz]) + setvar $2 "${1%??}" + setvar $3 "gzip -cdqf" + ;; + *[._-]bz) + setvar $2 "${1%???}" + setvar $3 "bzip2 -cdqf" + ;; + *[._-]gz) + setvar $2 "${1%???}" + setvar $3 "gzip -cdqf" + ;; + *[._-]xz) + setvar $2 "${1%???}" + setvar $3 "xz -cdqf" + ;; + *[._-]bz2) + setvar $2 "${1%????}" + setvar $3 "bzip2 -cdqf" + ;; + *[._-]lzma) + setvar $2 "${1%?????}" + setvar $3 "xz -cdqf" + ;; + *.t[ag]z) + setvar $2 "${1%??}"ar + setvar $3 "gzip -cdqf" + ;; + *.tbz) + setvar $2 "${1%??}"ar + setvar $3 "bzip2 -cdqf" + ;; + *.tbz2) + setvar $2 "${1%???}"ar + setvar $3 "bzip2 -cdqf" + ;; + *.t[lx]z) + setvar $2 "${1%??}"ar + setvar $3 "xz -cdqf" + ;; + *) + setvar $2 "$1" + setvar $3 "" + ;; + esac +} + # Pull out any command line flags so we can pass them to diff/cmp # XXX - assumes there is no optarg @@ -42,6 +94,9 @@ while test $# -ne 0; do shift break ;; + -) + break + ;; -*) flags="$flags $1" shift @@ -55,52 +110,28 @@ done if [ $# -eq 1 ]; then # One file given, compare compressed to uncompressed files="$1" - case "$1" in - *[._-][Zz]) - files="${1%??}" - ;; - *[._-]gz) - files="${1%???}" - ;; - *.t[ag]z) - files="${1%??}"ar - ;; - *) echo "z$prog: unknown suffix" 1>&2 - exit 1 - esac - gzip -cdfq "$1" | $prog $flags - "$files" + check_suffix "$1" files filt + if [ -z "$filt" ]; then + echo "z$prog: unknown suffix" 1>&2 + exit 1 + fi + $filt -- "$1" | $prog $flags -- - "$files" status=$? elif [ $# -eq 2 ]; then # Two files given, compare the two uncompressing as needed - case "$1" in - *[._-][Zz]|*[._-]gz|*.t[ag]z) - files=- - filt="gzip -cdfq $1" - ;; - *) - files="$1" - ;; - esac - case "$2" in - *[._-][Zz]|*[._-]gz|*.t[ag]z) - if [ "$files" = "-" ]; then - tmp=`mktemp -t z$prog.XXXXXXXXXX` || exit 1 - trap "rm -f $tmp" 0 1 2 3 13 15 - gzip -cdfq "$2" > $tmp - files="$files $tmp" - else - files="$files -" - filt="gzip -cdfq $2" - fi - ;; - *) - files="$files $2" - ;; - esac - if [ -n "$filt" ]; then - $filt | $prog $flags $files + check_suffix "$1" files filt + check_suffix "$2" files2 filt2 + if [ -z "$filt" -a -z "$filt2" ]; then + $prog $flags -- "$1" "$2" + elif [ -z "$filt" -a -n "$filt2" -a "$1" != "-" ]; then + $filt2 -- "$2" | $prog $flags -- "$1" - + elif [ -n "$filt" -a -z "$filt2" -a "$2" != "-" ]; then + $filt -- "$1" | $prog $flags -- - "$2" else - $prog $flags $files + tmp=`mktemp -t z$prog.XXXXXXXXXX` || exit 1 + trap "rm -f $tmp" 0 1 2 3 13 15 + ${filt2:-cat} -- "$2" > $tmp || exit $? + ${filt:-cat} -- "$1" | $prog $flags -- - "$tmp" fi status=$? else Modified: stable/8/usr.bin/gzip/zdiff.1 ============================================================================== --- stable/8/usr.bin/gzip/zdiff.1 Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/zdiff.1 Mon Jun 6 05:40:52 2011 (r222735) @@ -1,7 +1,8 @@ -.\" $NetBSD: zdiff.1,v 1.3 2003/12/28 12:48:03 wiz Exp $ +.\" $NetBSD: zdiff.1,v 1.5 2010/04/14 19:52:05 wiz Exp $ .\" $OpenBSD: zdiff.1,v 1.2 2003/07/13 17:39:14 millert Exp $ .\" .\" Copyright (c) 2003 Todd C. Miller +.\" Copyright (c) 2010 Joerg Sonnenberger .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -20,7 +21,7 @@ .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ -.Dd January 26, 2007 +.Dd May 23, 2011 .Dt ZDIFF 1 .Os .Sh NAME @@ -45,15 +46,6 @@ are filters that invoke or .Xr diff 1 respectively to compare compressed files. -Such files generally have a -.Dq Z -or -.Dq gz -extension (both the -.Xr compress 1 -and -.Xr gzip 1 -formats are supported). Any .Ar options that are specified are passed to @@ -70,6 +62,45 @@ When both or .Ar file2 are specified, either file may be compressed. +.Pp +Extensions handled by +.Xr gzip 1 : +.Bl -bullet -compact +.It +z, Z, +.It +gz, +.It +taz, +.It +tgz. +.El +.Pp +Extensions handled by +.Xr bzip2 1 : +.Bl -bullet -compact +.It +bz, +.It +bz2, +.It +tbz, +.It +tbz2. +.El +.Pp +Extensions handled by +.Xr xz 1 : +.Bl -bullet -compact +.It +lzma, +.It +xz, +.It +tlz, +.It +txz. +.El .Sh ENVIRONMENT .Bl -tag -width "TMPDIR" .It Ev TMPDIR @@ -88,9 +119,11 @@ Temporary file for .Nm zdiff . .El .Sh SEE ALSO +.Xr bzip2 1 , .Xr cmp 1 , -.Xr compress 1 , -.Xr diff 1 +.Xr diff 1 , +.Xr gzip 1 , +.Xr xz 1 .Sh CAVEATS .Nm zcmp and Modified: stable/8/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/8/usr.bin/gzip/zuncompress.c Mon Jun 6 04:12:57 2011 (r222734) +++ stable/8/usr.bin/gzip/zuncompress.c Mon Jun 6 05:40:52 2011 (r222735) @@ -1,4 +1,4 @@ -/* $NetBSD: zuncompress.c,v 1.7 2009/04/12 10:31:14 lukem Exp $ */ +/* $NetBSD: zuncompress.c,v 1.8 2010/11/06 21:42:32 mrg Exp $ */ /*- * Copyright (c) 1985, 1986, 1992, 1993 From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 05:48:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C39A11065673; Mon, 6 Jun 2011 05:48:25 +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 B16608FC12; Mon, 6 Jun 2011 05:48:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p565mPwA014079; Mon, 6 Jun 2011 05:48:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p565mP4C014072; Mon, 6 Jun 2011 05:48:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106060548.p565mP4C014072@svn.freebsd.org> From: Xin LI Date: Mon, 6 Jun 2011 05:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222736 - stable/7/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 05:48:25 -0000 Author: delphij Date: Mon Jun 6 05:48:25 2011 New Revision: 222736 URL: http://svn.freebsd.org/changeset/base/222736 Log: MFC r222210, 222211, 222287: - Diff reduction against NetBSD. The most notable change is to zdiff(1) to handle more file formats including bzip2 and xz. - Match symbolic link handling behavior with GNU gzip, bzip2 and xz: When we are operating on a symbolic link pointing to an existing file, bail out by default, but go ahead if -f is specified. Modified: stable/7/usr.bin/gzip/Makefile stable/7/usr.bin/gzip/gzip.1 stable/7/usr.bin/gzip/gzip.c stable/7/usr.bin/gzip/zdiff stable/7/usr.bin/gzip/zdiff.1 stable/7/usr.bin/gzip/zuncompress.c Directory Properties: stable/7/usr.bin/gzip/ (props changed) Modified: stable/7/usr.bin/gzip/Makefile ============================================================================== --- stable/7/usr.bin/gzip/Makefile Mon Jun 6 05:40:52 2011 (r222735) +++ stable/7/usr.bin/gzip/Makefile Mon Jun 6 05:48:25 2011 (r222736) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2006/05/12 02:01:15 mrg Exp $ +# $NetBSD: Makefile,v 1.13 2009/04/14 22:15:20 lukem Exp $ # $FreeBSD$ .include Modified: stable/7/usr.bin/gzip/gzip.1 ============================================================================== --- stable/7/usr.bin/gzip/gzip.1 Mon Jun 6 05:40:52 2011 (r222735) +++ stable/7/usr.bin/gzip/gzip.1 Mon Jun 6 05:48:25 2011 (r222736) @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 27, 2010 +.Dd May 23, 2011 .Dt GZIP 1 .Os .Sh NAME @@ -127,9 +127,9 @@ stream, leaving files intact. This option selects decompression rather than compression. .It Fl f , -force This option turns on force mode. -This allows files with multiple links, overwriting of pre-existing -files, reading from or writing to a terminal, and when combined -with the +This allows files with multiple links, symbolic links to regular files, +overwriting of pre-existing files, reading from or writing to a terminal, +and when combined with the .Fl c option, allowing non-compressed data to pass through unchanged. .It Fl h , -help Modified: stable/7/usr.bin/gzip/gzip.c ============================================================================== --- stable/7/usr.bin/gzip/gzip.c Mon Jun 6 05:40:52 2011 (r222735) +++ stable/7/usr.bin/gzip/gzip.c Mon Jun 6 05:48:25 2011 (r222736) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.97 2009/10/11 09:17:21 mrg Exp $ */ +/* $NetBSD: gzip.c,v 1.99 2011/03/23 12:59:44 tsutsui Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -31,7 +31,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006\ Matthew R. Green. All rights reserved."); -__RCSID("$FreeBSD$"); +__FBSDID("$FreeBSD$"); #endif /* not lint */ /* @@ -150,7 +150,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20100407"; +static const char gzip_version[] = "FreeBSD gzip 20110523"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -318,7 +318,7 @@ main(int argc, char **argv) dflag = cflag = 1; #ifdef SMALL -#define OPT_LIST "123456789cdhltV" +#define OPT_LIST "123456789cdhlV" #else #define OPT_LIST "123456789acdfhklLNnqrS:tVv" #endif @@ -922,6 +922,7 @@ gz_uncompress(int in, int out, char *pre case Z_BUF_ERROR: if (z.avail_out > 0 && !done_reading) continue; + case Z_STREAM_END: case Z_OK: break; @@ -1781,7 +1782,8 @@ handle_pathname(char *path) } retry: - if (stat(path, &sb) != 0) { + if (stat(path, &sb) != 0 || (fflag == 0 && cflag == 0 && + lstat(path, &sb) != 0)) { /* lets try .gz if we're decompressing */ if (dflag && s == NULL && errno == ENOENT) { len = strlen(path); Modified: stable/7/usr.bin/gzip/zdiff ============================================================================== --- stable/7/usr.bin/gzip/zdiff Mon Jun 6 05:40:52 2011 (r222735) +++ stable/7/usr.bin/gzip/zdiff Mon Jun 6 05:48:25 2011 (r222736) @@ -1,10 +1,12 @@ #!/bin/sh - # -# $NetBSD: zdiff,v 1.3 2004/03/29 10:01:00 wiz Exp $ +# $NetBSD: zdiff,v 1.5 2010/04/14 20:30:28 joerg Exp $ +# # $OpenBSD: zdiff,v 1.2 2003/07/29 07:42:44 otto Exp $ # #- # Copyright (c) 2003 Todd C. Miller +# Copyright (c) 2010 Joerg Sonnenberger # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -31,7 +33,57 @@ case $0 in *) prog=diff ;; esac -USAGE="usage: z$prog [options] file1 [file2]" +USAGE="usage: $0 [options] file1 [file2]" + +check_suffix() { + case "$1" in + *[._-][Zz]) + setvar $2 "${1%??}" + setvar $3 "gzip -cdqf" + ;; + *[._-]bz) + setvar $2 "${1%???}" + setvar $3 "bzip2 -cdqf" + ;; + *[._-]gz) + setvar $2 "${1%???}" + setvar $3 "gzip -cdqf" + ;; + *[._-]xz) + setvar $2 "${1%???}" + setvar $3 "xz -cdqf" + ;; + *[._-]bz2) + setvar $2 "${1%????}" + setvar $3 "bzip2 -cdqf" + ;; + *[._-]lzma) + setvar $2 "${1%?????}" + setvar $3 "xz -cdqf" + ;; + *.t[ag]z) + setvar $2 "${1%??}"ar + setvar $3 "gzip -cdqf" + ;; + *.tbz) + setvar $2 "${1%??}"ar + setvar $3 "bzip2 -cdqf" + ;; + *.tbz2) + setvar $2 "${1%???}"ar + setvar $3 "bzip2 -cdqf" + ;; + *.t[lx]z) + setvar $2 "${1%??}"ar + setvar $3 "xz -cdqf" + ;; + *) + setvar $2 "$1" + setvar $3 "" + ;; + esac +} + # Pull out any command line flags so we can pass them to diff/cmp # XXX - assumes there is no optarg @@ -42,6 +94,9 @@ while test $# -ne 0; do shift break ;; + -) + break + ;; -*) flags="$flags $1" shift @@ -55,52 +110,28 @@ done if [ $# -eq 1 ]; then # One file given, compare compressed to uncompressed files="$1" - case "$1" in - *[._-][Zz]) - files="${1%??}" - ;; - *[._-]gz) - files="${1%???}" - ;; - *.t[ag]z) - files="${1%??}"ar - ;; - *) echo "z$prog: unknown suffix" 1>&2 - exit 1 - esac - gzip -cdfq "$1" | $prog $flags - "$files" + check_suffix "$1" files filt + if [ -z "$filt" ]; then + echo "z$prog: unknown suffix" 1>&2 + exit 1 + fi + $filt -- "$1" | $prog $flags -- - "$files" status=$? elif [ $# -eq 2 ]; then # Two files given, compare the two uncompressing as needed - case "$1" in - *[._-][Zz]|*[._-]gz|*.t[ag]z) - files=- - filt="gzip -cdfq $1" - ;; - *) - files="$1" - ;; - esac - case "$2" in - *[._-][Zz]|*[._-]gz|*.t[ag]z) - if [ "$files" = "-" ]; then - tmp=`mktemp -t z$prog.XXXXXXXXXX` || exit 1 - trap "rm -f $tmp" 0 1 2 3 13 15 - gzip -cdfq "$2" > $tmp - files="$files $tmp" - else - files="$files -" - filt="gzip -cdfq $2" - fi - ;; - *) - files="$files $2" - ;; - esac - if [ -n "$filt" ]; then - $filt | $prog $flags $files + check_suffix "$1" files filt + check_suffix "$2" files2 filt2 + if [ -z "$filt" -a -z "$filt2" ]; then + $prog $flags -- "$1" "$2" + elif [ -z "$filt" -a -n "$filt2" -a "$1" != "-" ]; then + $filt2 -- "$2" | $prog $flags -- "$1" - + elif [ -n "$filt" -a -z "$filt2" -a "$2" != "-" ]; then + $filt -- "$1" | $prog $flags -- - "$2" else - $prog $flags $files + tmp=`mktemp -t z$prog.XXXXXXXXXX` || exit 1 + trap "rm -f $tmp" 0 1 2 3 13 15 + ${filt2:-cat} -- "$2" > $tmp || exit $? + ${filt:-cat} -- "$1" | $prog $flags -- - "$tmp" fi status=$? else Modified: stable/7/usr.bin/gzip/zdiff.1 ============================================================================== --- stable/7/usr.bin/gzip/zdiff.1 Mon Jun 6 05:40:52 2011 (r222735) +++ stable/7/usr.bin/gzip/zdiff.1 Mon Jun 6 05:48:25 2011 (r222736) @@ -1,7 +1,8 @@ -.\" $NetBSD: zdiff.1,v 1.3 2003/12/28 12:48:03 wiz Exp $ +.\" $NetBSD: zdiff.1,v 1.5 2010/04/14 19:52:05 wiz Exp $ .\" $OpenBSD: zdiff.1,v 1.2 2003/07/13 17:39:14 millert Exp $ .\" .\" Copyright (c) 2003 Todd C. Miller +.\" Copyright (c) 2010 Joerg Sonnenberger .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -20,7 +21,7 @@ .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ -.Dd January 26, 2007 +.Dd May 23, 2011 .Dt ZDIFF 1 .Os .Sh NAME @@ -45,15 +46,6 @@ are filters that invoke or .Xr diff 1 respectively to compare compressed files. -Such files generally have a -.Dq Z -or -.Dq gz -extension (both the -.Xr compress 1 -and -.Xr gzip 1 -formats are supported). Any .Ar options that are specified are passed to @@ -70,6 +62,45 @@ When both or .Ar file2 are specified, either file may be compressed. +.Pp +Extensions handled by +.Xr gzip 1 : +.Bl -bullet -compact +.It +z, Z, +.It +gz, +.It +taz, +.It +tgz. +.El +.Pp +Extensions handled by +.Xr bzip2 1 : +.Bl -bullet -compact +.It +bz, +.It +bz2, +.It +tbz, +.It +tbz2. +.El +.Pp +Extensions handled by +.Xr xz 1 : +.Bl -bullet -compact +.It +lzma, +.It +xz, +.It +tlz, +.It +txz. +.El .Sh ENVIRONMENT .Bl -tag -width "TMPDIR" .It Ev TMPDIR @@ -88,9 +119,11 @@ Temporary file for .Nm zdiff . .El .Sh SEE ALSO +.Xr bzip2 1 , .Xr cmp 1 , -.Xr compress 1 , -.Xr diff 1 +.Xr diff 1 , +.Xr gzip 1 , +.Xr xz 1 .Sh CAVEATS .Nm zcmp and Modified: stable/7/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/7/usr.bin/gzip/zuncompress.c Mon Jun 6 05:40:52 2011 (r222735) +++ stable/7/usr.bin/gzip/zuncompress.c Mon Jun 6 05:48:25 2011 (r222736) @@ -1,4 +1,4 @@ -/* $NetBSD: zuncompress.c,v 1.7 2009/04/12 10:31:14 lukem Exp $ */ +/* $NetBSD: zuncompress.c,v 1.8 2010/11/06 21:42:32 mrg Exp $ */ /*- * Copyright (c) 1985, 1986, 1992, 1993 From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 06:32:47 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7F1D1065670; Mon, 6 Jun 2011 06:32:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 79A438FC18; Mon, 6 Jun 2011 06:32:46 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA17641; Mon, 06 Jun 2011 09:32:43 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QTTMg-000Als-QV; Mon, 06 Jun 2011 09:32:42 +0300 Message-ID: <4DEC748A.8000204@FreeBSD.org> Date: Mon, 06 Jun 2011 09:32:42 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Pan Tsu , Gerald Pfeifer References: <201106052101.p55L1feL097420@svn.freebsd.org> <86zklwezwb.fsf@gmail.com> In-Reply-To: <86zklwezwb.fsf@gmail.com> X-Enigmail-Version: 1.1.2 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: r222723 - 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: Mon, 06 Jun 2011 06:32:47 -0000 on 06/06/2011 00:23 Pan Tsu said the following: > Andriy Gapon writes: > >> Author: avg >> Date: Sun Jun 5 21:01:41 2011 >> New Revision: 222723 >> URL: http://svn.freebsd.org/changeset/base/222723 >> >> Log: >> add SNDCTL_DSP_HALT specified by OSS >> >> This is really a new name for SNDCTL_DSP_RESET. >> >> PR: kern/156874 >> Submitted by: gerald >> MFC after: 1 week >> >> Modified: >> head/sys/sys/soundcard.h >> >> Modified: head/sys/sys/soundcard.h >> ============================================================================== >> --- head/sys/sys/soundcard.h Sun Jun 5 20:22:56 2011 (r222722) >> +++ head/sys/sys/soundcard.h Sun Jun 5 21:01:41 2011 (r222723) >> @@ -311,7 +311,8 @@ typedef struct _snd_capabilities { >> * IOCTL Commands for /dev/sequencer >> */ >> >> -#define SNDCTL_SEQ_RESET _IO ('Q', 0) >> +#define SNDCTL_SEQ_HALT _IO ('Q', 0) >> +#define SNDCTL_SEQ_RESET SNDCTL_SEQ_HALT /* Historic interface */ > > Apparently, the one for /dev/sequencer is too new to be documented. > > http://manuals.opensound.com/developer/SNDCTL_SEQ_HALT.html -> "Not found" Woops! I admit I just copied the description and the patch from the PR. How inattentive I could be while doing that? Gerald, should the patch have actually introduced SNDCTL_DSP_HALT as the description says? >> #define SNDCTL_SEQ_SYNC _IO ('Q', 1) >> #define SNDCTL_SYNTH_INFO _IOWR('Q', 2, struct synth_info) >> #define SNDCTL_SEQ_CTRLRATE _IOWR('Q', 3, int) /* Set/get timer res.(hz) */ -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 06:47:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9947B106566B; Mon, 6 Jun 2011 06:47:11 +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 86FF98FC13; Mon, 6 Jun 2011 06:47:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p566lBIL015952; Mon, 6 Jun 2011 06:47:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p566lBVC015949; Mon, 6 Jun 2011 06:47:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106060647.p566lBVC015949@svn.freebsd.org> From: Xin LI Date: Mon, 6 Jun 2011 06:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222737 - stable/8/sys/dev/arcmsr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 06:47:11 -0000 Author: delphij Date: Mon Jun 6 06:47:11 2011 New Revision: 222737 URL: http://svn.freebsd.org/changeset/base/222737 Log: MFC r220403: Update arcmsr(4) to vendor version 1.20.00.21. This release primarily improves command timeout handling. Many thanks to Areca for continuing to support FreeBSD. Submitted by: Ching-Lung Huang Modified: stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Mon Jun 6 05:48:25 2011 (r222736) +++ stable/8/sys/dev/arcmsr/arcmsr.c Mon Jun 6 06:47:11 2011 (r222737) @@ -38,35 +38,42 @@ ** History ** ** REV# DATE NAME DESCRIPTION -** 1.00.00.00 3/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 4/19/2005 Erich Chen add SATA 24 Ports adapter type support +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support ** clean unused function -** 1.20.00.12 9/12/2005 Erich Chen bug fix with abort command handling, +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, ** firmware version check ** and firmware update notify for hardware bug fix ** handling if none zero high part physical address ** of srb resource -** 1.20.00.13 8/18/2006 Erich Chen remove pending srb and report busy +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy ** add iop message xfer ** with scsi pass-through command ** add new device id of sas raid adapters ** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report ** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x ** bus_dmamem_alloc() with BUS_DMA_ZERO ** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 ** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, ** prevent cam_periph_error removing all LUN devices of one Target id ** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it ****************************************************************************************** * $FreeBSD$ */ +#if 0 +#define ARCMSR_DEBUG1 1 +#endif #include #include #include @@ -137,9 +144,16 @@ #define CAM_NEW_TRAN_CODE 1 #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.19 2010-11-11" +#if __FreeBSD_version > 500000 +#define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); +#else +#define arcmsr_callout_init(a) callout_init(a); +#endif + +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.21 2010-03-03" #include -#define ARCMSR_SRBS_POOL_SIZE ((sizeof(struct CommandControlBlock) * ARCMSR_MAX_FREESRB_NUM)) +#define SRB_SIZE ((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0) +#define ARCMSR_SRBS_POOL_SIZE (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM) /* ************************************************************************** ************************************************************************** @@ -150,6 +164,7 @@ ************************************************************************** ************************************************************************** */ +static void arcmsr_free_srb(struct CommandControlBlock *srb); static struct CommandControlBlock * arcmsr_get_freesrb(struct AdapterControlBlock *acb); static u_int8_t arcmsr_seek_cmd2abort(union ccb * abortccb); static int arcmsr_probe(device_t dev); @@ -177,6 +192,10 @@ static int arcmsr_resume(device_t dev); static int arcmsr_suspend(device_t dev); static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb); static void arcmsr_polling_devmap(void* arg); +static void arcmsr_srb_timeout(void* arg); +#ifdef ARCMSR_DEBUG1 +static void arcmsr_dump_data(struct AdapterControlBlock *acb); +#endif /* ************************************************************************** ************************************************************************** @@ -220,17 +239,13 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1); #define BUS_DMA_COHERENT 0x04 /* hint: map memory in a coherent way */ #endif #if __FreeBSD_version >= 501000 - #ifndef D_NEEDGIANT - #define D_NEEDGIANT 0x00400000 /* driver want Giant */ - #endif - #ifndef D_VERSION - #define D_VERSION 0x20011966 - #endif static struct cdevsw arcmsr_cdevsw={ - #if __FreeBSD_version > 502010 + #if __FreeBSD_version >= 503000 .d_version = D_VERSION, #endif + #if (__FreeBSD_version>=503000 && __FreeBSD_version<600034) .d_flags = D_NEEDGIANT, + #endif .d_open = arcmsr_open, /* open */ .d_close = arcmsr_close, /* close */ .d_ioctl = arcmsr_ioctl, /* ioctl */ @@ -671,6 +686,8 @@ static void arcmsr_srb_complete(struct C struct AdapterControlBlock *acb=srb->acb; union ccb * pccb=srb->pccb; + if(srb->srb_flags & SRB_FLAG_TIMER_START) + callout_stop(&srb->ccb_callout); if((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmasync_op_t op; @@ -690,11 +707,11 @@ static void arcmsr_srb_complete(struct C pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } } - srb->startdone=ARCMSR_SRB_DONE; - srb->srb_flags=0; - acb->srbworkingQ[acb->workingsrb_doneindex]=srb; - acb->workingsrb_doneindex++; - acb->workingsrb_doneindex %= ARCMSR_MAX_FREESRB_NUM; + if(srb->srb_state != ARCMSR_SRB_TIMEOUT) + arcmsr_free_srb(srb); +#ifdef ARCMSR_DEBUG1 + acb->pktReturnCount++; +#endif xpt_done(pccb); return; } @@ -761,7 +778,7 @@ static void arcmsr_drain_donequeue(struc /* check if command done with no error*/ switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_C: - srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFF0));/*frame must be 32 bytes aligned*/ + srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0));/*frame must be 32 bytes aligned*/ break; case ACB_ADAPTER_TYPE_A: case ACB_ADAPTER_TYPE_B: @@ -769,22 +786,51 @@ static void arcmsr_drain_donequeue(struc srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ break; } - if((srb->acb!=acb) || (srb->startdone!=ARCMSR_SRB_START)) { - if(srb->startdone==ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: srb='%p' isr got aborted command \n", acb->pci_unit, srb); - srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; - arcmsr_srb_complete(srb, 1); + if((srb->acb!=acb) || (srb->srb_state!=ARCMSR_SRB_START)) { + if(srb->srb_state == ARCMSR_SRB_TIMEOUT) { + arcmsr_free_srb(srb); + printf("arcmsr%d: srb='%p' return srb has been timeouted\n", acb->pci_unit, srb); return; } - printf("arcmsr%d: isr get an illegal srb command done" - "acb='%p' srb='%p' srbacb='%p' startdone=0x%xsrboutstandingcount=%d \n", - acb->pci_unit, acb, srb, srb->acb,srb->startdone, acb->srboutstandingcount); + printf("arcmsr%d: return srb has been completed\n" + "srb='%p' srb_state=0x%x outstanding srb count=%d \n", + acb->pci_unit, srb, srb->srb_state, acb->srboutstandingcount); return; } arcmsr_report_srb_state(acb, srb, error); return; } /* +************************************************************************** +************************************************************************** +*/ +static void arcmsr_srb_timeout(void* arg) +{ + struct CommandControlBlock *srb = (struct CommandControlBlock *)arg; + struct AdapterControlBlock *acb; + int target, lun; + u_int8_t cmd; + + target=srb->pccb->ccb_h.target_id; + lun=srb->pccb->ccb_h.target_lun; + acb = srb->acb; + ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); + if(srb->srb_state == ARCMSR_SRB_START) + { + cmd = srb->pccb->csio.cdb_io.cdb_bytes[0]; + srb->srb_state = ARCMSR_SRB_TIMEOUT; + srb->pccb->ccb_h.status |= CAM_CMD_TIMEOUT; + arcmsr_srb_complete(srb, 1); + printf("arcmsr%d: scsi id %d lun %d cmd=0x%x srb='%p' ccb command time out!\n", + acb->pci_unit, target, lun, cmd, srb); + } + ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); +#ifdef ARCMSR_DEBUG1 + arcmsr_dump_data(acb); +#endif +} + +/* ********************************************************************** ********************************************************************** */ @@ -855,18 +901,25 @@ static void arcmsr_iop_reset(struct Adap arcmsr_abort_allcmd(acb); for(i=0;ipsrb_pool[i]; - if(srb->startdone==ARCMSR_SRB_START) { - srb->startdone=ARCMSR_SRB_ABORTED; + if(srb->srb_state==ARCMSR_SRB_START) { + srb->srb_state=ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); + printf("arcmsr%d: scsi id=%d lun=%d srb='%p' aborted\n" + , acb->pci_unit, srb->pccb->ccb_h.target_id + , srb->pccb->ccb_h.target_lun, srb); } } /* enable all outbound interrupt */ arcmsr_enable_allintr(acb, intmask_org); } - atomic_set_int(&acb->srboutstandingcount, 0); + acb->srboutstandingcount=0; acb->workingsrb_doneindex=0; acb->workingsrb_startindex=0; +#ifdef ARCMSR_DEBUG1 + acb->pktRequestCount = 0; + acb->pktReturnCount = 0; +#endif return; } /* @@ -968,7 +1021,7 @@ static void arcmsr_post_srb(struct Adapt bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, (srb->srb_flags & SRB_FLAG_WRITE) ? BUS_DMASYNC_POSTWRITE:BUS_DMASYNC_POSTREAD); atomic_add_int(&acb->srboutstandingcount, 1); - srb->startdone=ARCMSR_SRB_START; + srb->srb_state=ARCMSR_SRB_START; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { @@ -1242,13 +1295,9 @@ static void arcmsr_poll(struct cam_sim * struct AdapterControlBlock *acb; acb = (struct AdapterControlBlock *)cam_sim_softc(psim); -#if __FreeBSD_version < 700025 ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); -#endif arcmsr_interrupt(acb); -#if __FreeBSD_version < 700025 ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); -#endif return; } /* @@ -1377,13 +1426,14 @@ static void arcmsr_abort_dr_ccbs(struct for (i = 0; i < ARCMSR_MAX_FREESRB_NUM; i++) { srb = acb->psrb_pool[i]; - if (srb->startdone == ARCMSR_SRB_START) + if (srb->srb_state == ARCMSR_SRB_START) { if((target == srb->pccb->ccb_h.target_id) && (lun == srb->pccb->ccb_h.target_lun)) { - srb->startdone = ARCMSR_SRB_ABORTED; + srb->srb_state = ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); + printf("arcmsr%d: abort scsi id %d lun %d srb=%p \n", acb->pci_unit, target, lun, srb); } } } @@ -1461,7 +1511,7 @@ static void arcmsr_dr_handle(struct Adap } else {/* unit arrived */ - printf("arcmsr_dr_handle: Target=%x, lun=%x, ARRIVING!!!\n",target,lun); + printf("arcmsr_dr_handle: Target=%x, lun=%x, Plug-IN!!!\n",target,lun); arcmsr_rescan_lun(acb, target, lun); acb->devstate[target][lun] = ARECA_RAID_GOOD; } @@ -2014,14 +2064,33 @@ u_int32_t arcmsr_iop_ioctlcmd(struct Ada ************************************************************************** ************************************************************************** */ +static void arcmsr_free_srb(struct CommandControlBlock *srb) +{ + struct AdapterControlBlock *acb; + int mutex; + + acb = srb->acb; + mutex = mtx_owned(&acb->qbuffer_lock); + if( mutex == 0 ) + ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); + srb->srb_state=ARCMSR_SRB_DONE; + srb->srb_flags=0; + acb->srbworkingQ[acb->workingsrb_doneindex]=srb; + acb->workingsrb_doneindex++; + acb->workingsrb_doneindex %= ARCMSR_MAX_FREESRB_NUM; + if( mutex == 0 ) + ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); +} +/* +************************************************************************** +************************************************************************** +*/ struct CommandControlBlock * arcmsr_get_freesrb(struct AdapterControlBlock *acb) { struct CommandControlBlock *srb=NULL; u_int32_t workingsrb_startindex, workingsrb_doneindex; -#if __FreeBSD_version < 700025 ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); -#endif workingsrb_doneindex=acb->workingsrb_doneindex; workingsrb_startindex=acb->workingsrb_startindex; srb=acb->srbworkingQ[workingsrb_startindex]; @@ -2032,9 +2101,7 @@ struct CommandControlBlock * arcmsr_get_ } else { srb=NULL; } -#if __FreeBSD_version < 700025 ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); -#endif return(srb); } /* @@ -2250,6 +2317,9 @@ static void arcmsr_execute_srb(void *arg pccb=srb->pccb; target=pccb->ccb_h.target_id; lun=pccb->ccb_h.target_lun; +#ifdef ARCMSR_DEBUG1 + acb->pktRequestCount++; +#endif if(error != 0) { if(error != EFBIG) { printf("arcmsr%d: unexpected error %x" @@ -2274,13 +2344,14 @@ static void arcmsr_execute_srb(void *arg return; } if(acb->devstate[target][lun]==ARECA_RAID_GONE) { - u_int8_t block_cmd; + u_int8_t block_cmd, cmd; - block_cmd=pccb->csio.cdb_io.cdb_bytes[0] & 0x0f; + cmd = pccb->csio.cdb_io.cdb_bytes[0]; + block_cmd= cmd & 0x0f; if(block_cmd==0x08 || block_cmd==0x0a) { printf("arcmsr%d:block 'read/write' command " - "with gone raid volume Cmd=%2x, TargetId=%d, Lun=%d \n" - , acb->pci_unit, block_cmd, target, lun); + "with gone raid volume Cmd=0x%2x, TargetId=%d, Lun=%d \n" + , acb->pci_unit, cmd, target, lun); pccb->ccb_h.status |= CAM_DEV_NOT_THERE; arcmsr_srb_complete(srb, 0); return; @@ -2302,10 +2373,13 @@ static void arcmsr_execute_srb(void *arg } pccb->ccb_h.status |= CAM_SIM_QUEUED; arcmsr_build_srb(srb, dm_segs, nseg); -/* if (pccb->ccb_h.timeout != CAM_TIME_INFINITY) - callout_reset(&srb->ccb_callout, (pccb->ccb_h.timeout * hz) / 1000, arcmsr_srb_timeout, srb); -*/ arcmsr_post_srb(acb, srb); + if (pccb->ccb_h.timeout != CAM_TIME_INFINITY) + { + arcmsr_callout_init(&srb->ccb_callout); + callout_reset(&srb->ccb_callout, (pccb->ccb_h.timeout * hz ) / 1000, arcmsr_srb_timeout, srb); + srb->srb_flags |= SRB_FLAG_TIMER_START; + } return; } /* @@ -2330,28 +2404,28 @@ static u_int8_t arcmsr_seek_cmd2abort(un *************************************************************************** */ if(acb->srboutstandingcount!=0) { + /* disable all outbound interrupt */ + intmask_org=arcmsr_disable_allintr(acb); for(i=0;ipsrb_pool[i]; - if(srb->startdone==ARCMSR_SRB_START) { + if(srb->srb_state==ARCMSR_SRB_START) { if(srb->pccb==abortccb) { - srb->startdone=ARCMSR_SRB_ABORTED; + srb->srb_state=ARCMSR_SRB_ABORTED; printf("arcmsr%d:scsi id=%d lun=%d abort srb '%p'" "outstanding command \n" , acb->pci_unit, abortccb->ccb_h.target_id , abortccb->ccb_h.target_lun, srb); - goto abort_outstanding_cmd; + arcmsr_polling_srbdone(acb, srb); + /* enable outbound Post Queue, outbound doorbell Interrupt */ + arcmsr_enable_allintr(acb, intmask_org); + return (TRUE); } } } + /* enable outbound Post Queue, outbound doorbell Interrupt */ + arcmsr_enable_allintr(acb, intmask_org); } return(FALSE); -abort_outstanding_cmd: - /* disable all outbound interrupt */ - intmask_org=arcmsr_disable_allintr(acb); - arcmsr_polling_srbdone(acb, srb); - /* enable outbound Post Queue, outbound doorbell Interrupt */ - arcmsr_enable_allintr(acb, intmask_org); - return (TRUE); } /* **************************************************************************** @@ -2764,8 +2838,8 @@ polling_ccb_retry: (acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; poll_srb_done = (srb==poll_srb) ? 1:0; - if((srb->acb!=acb) || (srb->startdone!=ARCMSR_SRB_START)) { - if(srb->startdone==ARCMSR_SRB_ABORTED) { + if((srb->acb!=acb) || (srb->srb_state!=ARCMSR_SRB_START)) { + if(srb->srb_state==ARCMSR_SRB_ABORTED) { printf("arcmsr%d: scsi id=%d lun=%d srb='%p'" "poll command abort successfully \n" , acb->pci_unit @@ -2825,8 +2899,8 @@ polling_ccb_retry: (acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; poll_srb_done = (srb==poll_srb) ? 1:0; - if((srb->acb!=acb) || (srb->startdone!=ARCMSR_SRB_START)) { - if(srb->startdone==ARCMSR_SRB_ABORTED) { + if((srb->acb!=acb) || (srb->srb_state!=ARCMSR_SRB_START)) { + if(srb->srb_state==ARCMSR_SRB_ABORTED) { printf("arcmsr%d: scsi id=%d lun=%d srb='%p'" "poll command abort successfully \n" , acb->pci_unit @@ -2877,12 +2951,12 @@ polling_ccb_retry: } flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); /* check if command done with no error*/ - srb=(struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFF0));/*frame must be 32 bytes aligned*/ + srb=(struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0));/*frame must be 32 bytes aligned*/ error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; if (poll_srb != NULL) poll_srb_done = (srb==poll_srb) ? 1:0; - if((srb->acb!=acb) || (srb->startdone!=ARCMSR_SRB_START)) { - if(srb->startdone==ARCMSR_SRB_ABORTED) { + if((srb->acb!=acb) || (srb->srb_state!=ARCMSR_SRB_START)) { + if(srb->srb_state==ARCMSR_SRB_ABORTED) { printf("arcmsr%d: scsi id=%d lun=%d srb='%p'poll command abort successfully \n" , acb->pci_unit, srb->pccb->ccb_h.target_id, srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; @@ -3213,7 +3287,7 @@ static u_int32_t arcmsr_iop_confirm(stru printf( "arcmsr%d: 'set window of post command Q' timeout\n", acb->pci_unit); return FALSE; } - post_queue_phyaddr = srb_phyaddr + ARCMSR_MAX_FREESRB_NUM*sizeof(struct CommandControlBlock) + post_queue_phyaddr = srb_phyaddr + ARCMSR_SRBS_POOL_SIZE + offsetof(struct HBB_MessageUnit, post_qbuffer); CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[0], ARCMSR_SIGNATURE_SET_CONFIG); /* driver "set config" signature */ CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[1], srb_phyaddr_hi32); /* normal should be zero */ @@ -3320,8 +3394,8 @@ static void arcmsr_map_free_srb(void *ar srb_tmp->cdb_shifted_phyaddr=(acb->adapter_type==ACB_ADAPTER_TYPE_C)?srb_phyaddr:(srb_phyaddr >> 5); srb_tmp->acb=acb; acb->srbworkingQ[i]=acb->psrb_pool[i]=srb_tmp; - srb_phyaddr=srb_phyaddr+sizeof(struct CommandControlBlock); - srb_tmp++; + srb_phyaddr=srb_phyaddr+SRB_SIZE; + srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp+SRB_SIZE); } acb->vir2phy_offset=(unsigned long)srb_tmp-(unsigned long)srb_phyaddr; return; @@ -3407,7 +3481,7 @@ static u_int32_t arcmsr_initialize(devic /*nsegments*/ BUS_SPACE_UNRESTRICTED, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ 0, -#if __FreeBSD_version >= 502010 +#if __FreeBSD_version >= 501102 /*lockfunc*/ NULL, /*lockarg*/ NULL, #endif @@ -3421,7 +3495,11 @@ static u_int32_t arcmsr_initialize(devic if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, /*alignment*/ 1, /*boundary*/ 0, +#ifdef PAE + /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT, +#else /*lowaddr*/ BUS_SPACE_MAXADDR, +#endif /*highaddr*/ BUS_SPACE_MAXADDR, /*filter*/ NULL, /*filterarg*/ NULL, @@ -3429,13 +3507,9 @@ static u_int32_t arcmsr_initialize(devic /*nsegments*/ ARCMSR_MAX_SG_ENTRIES, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ 0, -#if __FreeBSD_version >= 502010 +#if __FreeBSD_version >= 501102 /*lockfunc*/ busdma_lock_mutex, - #if __FreeBSD_version >= 700025 /*lockarg*/ &acb->qbuffer_lock, - #else - /*lockarg*/ &Giant, - #endif #endif &acb->dm_segs_dmat) != 0) { @@ -3456,7 +3530,7 @@ static u_int32_t arcmsr_initialize(devic /*nsegments*/ 1, /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, /*flags*/ 0, -#if __FreeBSD_version >= 502010 +#if __FreeBSD_version >= 501102 /*lockfunc*/ NULL, /*lockarg*/ NULL, #endif @@ -3550,7 +3624,8 @@ static u_int32_t arcmsr_initialize(devic acb->bhandle[i]=rman_get_bushandle(acb->sys_res_arcmsr[i]); } freesrb=(struct CommandControlBlock *)acb->uncacheptr; - acb->pmu=(struct MessageUnit_UNION *)&freesrb[ARCMSR_MAX_FREESRB_NUM]; +// acb->pmu=(struct MessageUnit_UNION *)&freesrb[ARCMSR_MAX_FREESRB_NUM]; + acb->pmu=(struct MessageUnit_UNION *)((unsigned long)freesrb+ARCMSR_SRBS_POOL_SIZE); phbbmu=(struct HBB_MessageUnit *)acb->pmu; phbbmu->hbb_doorbell=(struct HBB_DOORBELL *)mem_base[0]; phbbmu->hbb_rwbuffer=(struct HBB_RWBUFFER *)mem_base[1]; @@ -3711,14 +3786,11 @@ static int arcmsr_attach(device_t dev) #if __FreeBSD_version > 500005 (void)make_dev_alias(acb->ioctl_dev, "arc%d", unit); #endif -#if __FreeBSD_version > 500000 - callout_init(&acb->devmap_callout, /*mpsafe*/1); -#else - callout_init(&acb->devmap_callout); -#endif + arcmsr_callout_init(&acb->devmap_callout); callout_reset(&acb->devmap_callout, 60 * hz, arcmsr_polling_devmap, acb); return 0; } + /* ************************************************************************ ************************************************************************ @@ -3802,16 +3874,20 @@ static int arcmsr_shutdown(device_t dev) arcmsr_abort_allcmd(acb); for(i=0;ipsrb_pool[i]; - if(srb->startdone==ARCMSR_SRB_START) { - srb->startdone=ARCMSR_SRB_ABORTED; + if(srb->srb_state==ARCMSR_SRB_START) { + srb->srb_state=ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); } } } - atomic_set_int(&acb->srboutstandingcount, 0); + acb->srboutstandingcount=0; acb->workingsrb_doneindex=0; acb->workingsrb_startindex=0; +#ifdef ARCMSR_DEBUG1 + acb->pktRequestCount = 0; + acb->pktReturnCount = 0; +#endif ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); return (0); } @@ -3842,4 +3918,15 @@ static int arcmsr_detach(device_t dev) return (0); } +#ifdef ARCMSR_DEBUG1 +static void arcmsr_dump_data(struct AdapterControlBlock *acb) +{ + if((acb->pktRequestCount - acb->pktReturnCount) == 0) + return; + printf("Command Request Count =0x%x\n",acb->pktRequestCount); + printf("Command Return Count =0x%x\n",acb->pktReturnCount); + printf("Command (Req-Rtn) Count =0x%x\n",(acb->pktRequestCount - acb->pktReturnCount)); + printf("Queued Command Count =0x%x\n",acb->srboutstandingcount); +} +#endif Modified: stable/8/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.h Mon Jun 6 05:48:25 2011 (r222736) +++ stable/8/sys/dev/arcmsr/arcmsr.h Mon Jun 6 06:47:11 2011 (r222737) @@ -46,7 +46,7 @@ #define ARCMSR_MAX_OUTSTANDING_CMD 256 #define ARCMSR_MAX_START_JOB 257 #define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD -#define ARCMSR_MAX_FREESRB_NUM 320 +#define ARCMSR_MAX_FREESRB_NUM 384 #define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ #define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ #define ARCMSR_MAX_ADAPTER 4 @@ -714,23 +714,13 @@ struct CommandControlBlock { u_int32_t cdb_shifted_phyaddr; /* 504-507 */ u_int32_t arc_cdb_size; /* 508-511 */ /* ======================512+32 bytes============================ */ -#if defined(__x86_64__) || defined(__amd64__) || defined(__ia64__) || defined(__sparc64__) || defined(__powerpc__) union ccb *pccb; /* 512-515 516-519 pointer of freebsd scsi command */ struct AdapterControlBlock *acb; /* 520-523 524-527 */ bus_dmamap_t dm_segs_dmamap; /* 528-531 532-535 */ u_int16_t srb_flags; /* 536-537 */ - u_int16_t startdone; /* 538-539 */ - u_int32_t reserved2; /* 540-543 */ -#else - union ccb *pccb; /* 512-515 pointer of freebsd scsi command */ - struct AdapterControlBlock *acb; /* 516-519 */ - bus_dmamap_t dm_segs_dmamap; /* 520-523 */ - u_int16_t srb_flags; /* 524-525 */ - u_int16_t startdone; /* 526-527 */ - u_int32_t reserved2[4]; /* 528-531 532-535 536-539 540-543 */ -#endif + u_int16_t srb_state; /* 538-539 */ + struct callout ccb_callout; /* ========================================================== */ -/* struct callout ccb_callout; */ }; /* srb_flags */ #define SRB_FLAG_READ 0x0000 @@ -742,7 +732,8 @@ struct CommandControlBlock { #define SRB_FLAG_DMACONSISTENT 0x0020 #define SRB_FLAG_DMAWRITE 0x0040 #define SRB_FLAG_PKTBIND 0x0080 -/* startdone */ +#define SRB_FLAG_TIMER_START 0x0080 +/* srb_state */ #define ARCMSR_SRB_DONE 0x0000 #define ARCMSR_SRB_UNBUILD 0x0000 #define ARCMSR_SRB_TIMEOUT 0x1111 @@ -775,18 +766,18 @@ struct AdapterControlBlock { #if __FreeBSD_version < 503000 dev_t ioctl_dev; #else - struct cdev * ioctl_dev; + struct cdev *ioctl_dev; #endif int pci_unit; - struct resource * sys_res_arcmsr[2]; - struct resource * irqres; - void * ih; /* interrupt handle */ + struct resource *sys_res_arcmsr[2]; + struct resource *irqres; + void *ih; /* interrupt handle */ /* Hooks into the CAM XPT */ struct cam_sim *psim; struct cam_path *ppath; - u_int8_t * uncacheptr; + u_int8_t *uncacheptr; unsigned long vir2phy_offset; union { unsigned long phyaddr; @@ -799,14 +790,14 @@ struct AdapterControlBlock { /* Offset is used in making arc cdb physical to virtual calculations */ u_int32_t outbound_int_enable; - struct MessageUnit_UNION * pmu; /* message unit ATU inbound base address0 */ + struct MessageUnit_UNION *pmu; /* message unit ATU inbound base address0 */ u_int8_t adapter_index; /* */ u_int8_t irq; u_int16_t acb_flags; /* */ - struct CommandControlBlock * psrb_pool[ARCMSR_MAX_FREESRB_NUM]; /* serial srb pointer array */ - struct CommandControlBlock * srbworkingQ[ARCMSR_MAX_FREESRB_NUM]; /* working srb pointer array */ + struct CommandControlBlock *psrb_pool[ARCMSR_MAX_FREESRB_NUM]; /* serial srb pointer array */ + struct CommandControlBlock *srbworkingQ[ARCMSR_MAX_FREESRB_NUM]; /* working srb pointer array */ int32_t workingsrb_doneindex; /* done srb array index */ int32_t workingsrb_startindex; /* start srb array index */ int32_t srboutstandingcount; @@ -835,6 +826,10 @@ struct AdapterControlBlock { char firm_version[20]; /*17,68-83*/ char device_map[20]; /*21,84-99 */ struct callout devmap_callout; +#ifdef ARCMSR_DEBUG1 + u_int32_t pktRequestCount; + u_int32_t pktReturnCount; +#endif };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 07:14:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BA8F106564A; Mon, 6 Jun 2011 07:14:30 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A6208FC13; Mon, 6 Jun 2011 07:14:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p567EUrv016861; Mon, 6 Jun 2011 07:14:30 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p567EUt1016859; Mon, 6 Jun 2011 07:14:30 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201106060714.p567EUt1016859@svn.freebsd.org> From: Benedict Reuschling Date: Mon, 6 Jun 2011 07:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222738 - stable/7/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 07:14:30 -0000 Author: bcr (doc committer) Date: Mon Jun 6 07:14:29 2011 New Revision: 222738 URL: http://svn.freebsd.org/changeset/base/222738 Log: MFC r222492: Add a short description about NO_CHECKSUM. PR: docs/155980 Submitted by KOIE Hidetaka (koie at suri co jp) Modified: stable/7/share/man/man7/ports.7 (contents, props changed) Modified: stable/7/share/man/man7/ports.7 ============================================================================== --- stable/7/share/man/man7/ports.7 Mon Jun 6 06:47:11 2011 (r222737) +++ stable/7/share/man/man7/ports.7 Mon Jun 6 07:14:29 2011 (r222738) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2011 +.Dd May 30, 2011 .Dt PORTS 7 .Os .Sh NAME @@ -479,6 +479,8 @@ Of course, these ports may not work as e what you are doing and are sure about installing a forbidden port, then .Va NO_IGNORE lets you do it. +.It Va NO_CHECKSUM +If defined, skip verifying the port's checksum. .It Va TRYBROKEN If defined, attempt to build a port even if it is marked as .Aq Va BROKEN . From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 07:15:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 626351065677; Mon, 6 Jun 2011 07:15:19 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 514F98FC1D; Mon, 6 Jun 2011 07:15:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p567FJTC016927; Mon, 6 Jun 2011 07:15:19 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p567FJk0016925; Mon, 6 Jun 2011 07:15:19 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201106060715.p567FJk0016925@svn.freebsd.org> From: Benedict Reuschling Date: Mon, 6 Jun 2011 07:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222739 - stable/8/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 07:15:19 -0000 Author: bcr (doc committer) Date: Mon Jun 6 07:15:19 2011 New Revision: 222739 URL: http://svn.freebsd.org/changeset/base/222739 Log: MFC r222492: Add a short description about NO_CHECKSUM. PR: docs/155980 Submitted by KOIE Hidetaka (koie at suri co jp) Modified: stable/8/share/man/man7/ports.7 (contents, props changed) Modified: stable/8/share/man/man7/ports.7 ============================================================================== --- stable/8/share/man/man7/ports.7 Mon Jun 6 07:14:29 2011 (r222738) +++ stable/8/share/man/man7/ports.7 Mon Jun 6 07:15:19 2011 (r222739) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2011 +.Dd May 30, 2011 .Dt PORTS 7 .Os .Sh NAME @@ -479,6 +479,8 @@ Of course, these ports may not work as e what you are doing and are sure about installing a forbidden port, then .Va NO_IGNORE lets you do it. +.It Va NO_CHECKSUM +If defined, skip verifying the port's checksum. .It Va TRYBROKEN If defined, attempt to build a port even if it is marked as .Aq Va BROKEN . From owner-svn-src-all@FreeBSD.ORG Mon Jun 6 07:26:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94BE3106564A; Mon, 6 Jun 2011 07:26:07 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 797EF8FC08; Mon, 6 Jun 2011 07:26:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p567Q7do017335; Mon, 6 Jun 2011 07:26:07 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p567Q77j017333; Mon, 6 Jun 2011 07:26:07 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201106060726.p567Q77j017333@svn.freebsd.org> From: Benedict Reuschling Date: Mon, 6 Jun 2011 07:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222740 - stable/8/usr.sbin/usbdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 07:26:07 -0000 Author: bcr (doc committer) Date: Mon Jun 6 07:26:07 2011 New Revision: 222740 URL: http://svn.freebsd.org/changeset/base/222740 Log: MFC r217358, 222286, 222519: r222519: Minor wording adjustments to usbdump(8). PR: docs/157317 Submitted by: Warren Block (wblock at wonkity dot com) Reviewed by: hps@ r222286: [mdoc] Fixed .Dt call. r217358: Documents OUTPUT formats. While I'm here cleans up styles and words. Reviewed by: brueffer@ Modified: stable/8/usr.sbin/usbdump/usbdump.8 Directory Properties: stable/8/usr.sbin/usbdump/ (props changed) Modified: stable/8/usr.sbin/usbdump/usbdump.8 ============================================================================== --- stable/8/usr.sbin/usbdump/usbdump.8 Mon Jun 6 07:15:19 2011 (r222739) +++ stable/8/usr.sbin/usbdump/usbdump.8 Mon Jun 6 07:26:07 2011 (r222740) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2010 -.Dt usbdump 8 +.Dd May 31, 2011 +.Dt USBDUMP 8 .Os .Sh NAME .Nm usbdump @@ -41,37 +41,92 @@ .Sh DESCRIPTION The .Nm -utility provides a way to dump USB packets on each host controller. +utility provides a way to dump USB packets on host controllers. .Pp -The following options are accepted. +The following options are accepted: .Bl -tag -width ".Fl f Ar file" .It Fl i Ar ifname -Listen on USB bus interface. +Listen on USB bus interface +.Ar ifname . .It Fl r Ar file -Read the raw packets from file. +Read the raw packets from +.Ar file . .It Fl s Ar snaplen -Snapshot bytes from each packet. +Snapshot +.Ar snaplen +bytes from each packet. .It Fl v Enable debugging messages. -When it defined multiple times the verbose level increases. +When defined multiple times the verbosity level increases. .It Fl w Ar file -Write the raw packets to file. +Write the raw packets to +.Ar file . .El .Sh EXAMPLES -Captures the USB raw packets alive on usbus2: +Capture the USB raw packets on usbus2: .Pp .Dl "usbdump -i usbus2 -s 256 -v" .Pp -Dumps the USB raw packets of usbus2 into the file without packet +Dump the USB raw packets of usbus2 into the file without packet size limit: .Pp .Dl "usbdump -i usbus2 -s 0 -w /tmp/dump_pkts" .Pp -Read the USB raw packets from the file: +Read and display the USB raw packets from previous file: .Pp .Dl "usbdump -r /tmp/dump_pkts -v" +.Sh OUTPUT FORMAT +The output format of +.Nm +is as follows: +.Pp +.Dl "