Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jan 2024 01:01:09 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: cc8af47b6d4c - stable/13 - libdtrace: Fix TCP data offset handling in the tcpinfo_t translator
Message-ID:  <202401090101.409119Yf075092@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=cc8af47b6d4ce9c40ed03ace7c130409fe0962a0

commit cc8af47b6d4ce9c40ed03ace7c130409fe0962a0
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-01-01 21:33:30 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-01-09 01:00:30 +0000

    libdtrace: Fix TCP data offset handling in the tcpinfo_t translator
    
    The header gives an offset in 32-bit words, and the translator is
    supposed to convert that to a byte count.  But, the conversion was
    incorrect.
    
    Reviewed by:    tuexen, rscheff
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D43264
    
    (cherry picked from commit c3268c23de45b75b44102a02e96f44b0ff2f6ba7)
---
 cddl/lib/libdtrace/tcp.d | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cddl/lib/libdtrace/tcp.d b/cddl/lib/libdtrace/tcp.d
index 2ccbd574055d..32a1afce9ae2 100644
--- a/cddl/lib/libdtrace/tcp.d
+++ b/cddl/lib/libdtrace/tcp.d
@@ -263,7 +263,7 @@ translator tcpinfo_t < struct tcphdr *p > {
 	tcp_dport =	p == NULL ? 0  : ntohs(p->th_dport);
 	tcp_seq =	p == NULL ? -1 : ntohl(p->th_seq);
 	tcp_ack =	p == NULL ? -1 : ntohl(p->th_ack);
-	tcp_offset =	p == NULL ? -1 : (p->th_off >> 2);
+	tcp_offset =	p == NULL ? -1 : (p->th_off << 2);
 	tcp_flags =	p == NULL ? 0  : p->th_flags;
 	tcp_window =	p == NULL ? 0  : ntohs(p->th_win);
 	tcp_checksum =	p == NULL ? 0  : ntohs(p->th_sum);
@@ -282,7 +282,7 @@ translator tcpinfoh_t < struct tcphdr *p > {
 	tcp_dport =	p == NULL ? 0  : ntohs(p->th_dport);
 	tcp_seq =	p == NULL ? -1 : p->th_seq;
 	tcp_ack =	p == NULL ? -1 : p->th_ack;
-	tcp_offset =	p == NULL ? -1 : (p->th_off >> 2);
+	tcp_offset =	p == NULL ? -1 : (p->th_off << 2);
 	tcp_flags =	p == NULL ? 0  : p->th_flags;
 	tcp_window =	p == NULL ? 0  : p->th_win;
 	tcp_checksum =	p == NULL ? 0  : ntohs(p->th_sum);



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