summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_debug.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-09-07 20:44:45 +0000
committerbz <bz@FreeBSD.org>2008-09-07 20:44:45 +0000
commit8aa58e5530462a60204cb3e32cd0a1646bcd3580 (patch)
treecabdffa2fcc20b04fa2fa3e781fdd1aeb79eed66 /sys/netinet/tcp_debug.c
parentc609890a53fdaa4762db2916aa386874d4c18f8f (diff)
downloadFreeBSD-src-8aa58e5530462a60204cb3e32cd0a1646bcd3580.zip
FreeBSD-src-8aa58e5530462a60204cb3e32cd0a1646bcd3580.tar.gz
To my reading there are no real consumers 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. So initialize the value in tcpip_fillheaders() in correct (network) byte order. With the above change, to my reading, all places calling tcp_trace() pass in the ip6 header via ipgen as serialized in the mbuf and with ip6_plen in network byte order. Thus convert the IPv6 payload length to host byte order before printing. MFC after: 2 months
Diffstat (limited to 'sys/netinet/tcp_debug.c')
-rw-r--r--sys/netinet/tcp_debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c
index aaeac9d..a82943d 100644
--- a/sys/netinet/tcp_debug.c
+++ b/sys/netinet/tcp_debug.c
@@ -171,7 +171,7 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, void *ipgen,
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) {
OpenPOWER on IntegriCloud