mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-14 20:37:06 +00:00
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 c3268c23de
)
This commit is contained in:
parent
f7459ca1e7
commit
cc8af47b6d
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue