From owner-svn-src-stable-7@FreeBSD.ORG Thu Oct 30 15:48:56 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 164631065716; Thu, 30 Oct 2008 15:48:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03BB78FC22; Thu, 30 Oct 2008 15:48:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9UFmtJv055212; Thu, 30 Oct 2008 15:48:55 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9UFmta2055210; Thu, 30 Oct 2008 15:48:55 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200810301548.m9UFmta2055210@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 30 Oct 2008 15:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184474 - in stable/7/sys: . netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2008 15:48:56 -0000 Author: bz Date: Thu Oct 30 15:48:55 2008 New Revision: 184474 URL: http://svn.freebsd.org/changeset/base/184474 Log: MFC: r182855 There is no real consumer of ip6_plen (IPv6 payload length) as set in tcpip_fillheaders(). ip6_output() will calculate it based of the length from the mbuf packet header itself. Initialize the value in tcpip_fillheaders() in correct (network) byte order. With the above change, all places calling tcp_trace() pass in the ip6 header serialized in the mbuf as ipgen and with ip6_plen in network byte order. Thus convert the IPv6 payload length to host byte order before printing. Approved by: re (gnn) Modified: stable/7/sys/ (props changed) stable/7/sys/netinet/tcp_debug.c stable/7/sys/netinet/tcp_subr.c Modified: stable/7/sys/netinet/tcp_debug.c ============================================================================== --- stable/7/sys/netinet/tcp_debug.c Thu Oct 30 15:27:13 2008 (r184473) +++ stable/7/sys/netinet/tcp_debug.c Thu Oct 30 15:48:55 2008 (r184474) @@ -171,7 +171,7 @@ tcp_trace(short act, short ostate, struc ack = th->th_ack; len = #ifdef INET6 - isipv6 ? ((struct ip6_hdr *)ipgen)->ip6_plen : + isipv6 ? ntohs(((struct ip6_hdr *)ipgen)->ip6_plen) : #endif ((struct ip *)ipgen)->ip_len; if (act == TA_OUTPUT) { Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Thu Oct 30 15:27:13 2008 (r184473) +++ stable/7/sys/netinet/tcp_subr.c Thu Oct 30 15:48:55 2008 (r184474) @@ -344,7 +344,7 @@ tcpip_fillheaders(struct inpcb *inp, voi ip6->ip6_vfc = (ip6->ip6_vfc & ~IPV6_VERSION_MASK) | (IPV6_VERSION & IPV6_VERSION_MASK); ip6->ip6_nxt = IPPROTO_TCP; - ip6->ip6_plen = sizeof(struct tcphdr); + ip6->ip6_plen = htons(sizeof(struct tcphdr)); ip6->ip6_src = inp->in6p_laddr; ip6->ip6_dst = inp->in6p_faddr; } else