diff options
author | Mark Johnston <markj@FreeBSD.org> | 2024-01-01 21:33:30 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2024-01-09 00:56:57 +0000 |
commit | 775958df04c4c94c69a37e25715efbd97138be0b (patch) | |
tree | d7b1c7a23fcef858210b1898fca1bd961bcde10a | |
parent | 2bfe735277b8858dd7ad937e0bf2286bdfb45182 (diff) | |
download | src-775958df04c4c94c69a37e25715efbd97138be0b.tar.gz src-775958df04c4c94c69a37e25715efbd97138be0b.zip |
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)
-rw-r--r-- | cddl/lib/libdtrace/tcp.d | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cddl/lib/libdtrace/tcp.d b/cddl/lib/libdtrace/tcp.d index ea3a553ebf53..4e1061e6c7c1 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); |