Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Oct 2008 15:48:55 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r184474 - in stable/7/sys: . netinet
Message-ID:  <200810301548.m9UFmta2055210@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810301548.m9UFmta2055210>