tcpstates: incorrect display of dport (#3560)
authorRosen <rosenluov@gmail.com>
Tue, 3 Aug 2021 18:26:23 +0000 (02:26 +0800)
committerGitHub <noreply@github.com>
Tue, 3 Aug 2021 18:26:23 +0000 (11:26 -0700)
fix incorrect display of dport for kprobe attachment in tcpstates

tools/tcpstates.py

index 5c04f4523f8a589be413e619d067300b3890f922..ec5bb7b356975d6264da14db9d2b28cda2ba070d 100755 (executable)
@@ -182,6 +182,7 @@ int kprobe__tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state)
 
     // dport is either used in a filter here, or later
     u16 dport = sk->__sk_common.skc_dport;
+    dport = ntohs(dport);
     FILTER_DPORT
 
     // calculate delta