From 10dac5fcdecd1afee08a3918feb744abeff81432 Mon Sep 17 00:00:00 2001 From: Rosen Date: Wed, 4 Aug 2021 02:26:23 +0800 Subject: [PATCH] tcpstates: incorrect display of dport (#3560) fix incorrect display of dport for kprobe attachment in tcpstates --- tools/tcpstates.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tcpstates.py b/tools/tcpstates.py index 5c04f452..ec5bb7b3 100755 --- a/tools/tcpstates.py +++ b/tools/tcpstates.py @@ -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 -- 2.34.1