svn commit: r184474 - in stable/7/sys: . netinet

Bjoern A. Zeeb bz at FreeBSD.org
Thu Oct 30 08:48:56 PDT 2008


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


More information about the svn-src-stable-7 mailing list