From: Mark Drayton Date: Sun, 31 Jul 2016 16:51:52 +0000 (+0100) Subject: tcpretrans: ntohs dport (#639) X-Git-Tag: v0.2.0~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ba998ed18ecfa6a40f8af81032e1d0c280b6dc7;p=platform%2Fupstream%2Fbcc.git tcpretrans: ntohs dport (#639) --- diff --git a/tools/tcpretrans.py b/tools/tcpretrans.py index 01de704..47857de 100755 --- a/tools/tcpretrans.py +++ b/tools/tcpretrans.py @@ -92,8 +92,9 @@ static int trace_event(struct pt_regs *ctx, struct sock *sk, int type) &skp->__sk_common.skc_rcv_saddr); bpf_probe_read(&data4.daddr, sizeof(u32), &skp->__sk_common.skc_daddr); + // lport is host order data4.lport = lport; - data4.dport = dport; + data4.dport = ntohs(dport); data4.state = state; ipv4_events.perf_submit(ctx, &data4, sizeof(data4)); @@ -103,8 +104,9 @@ static int trace_event(struct pt_regs *ctx, struct sock *sk, int type) &skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); bpf_probe_read(&data6.daddr, sizeof(data6.daddr), &skp->__sk_common.skc_v6_daddr.in6_u.u6_addr32); + // lport is host order data6.lport = lport; - data6.dport = dport; + data6.dport = ntohs(dport); data6.state = state; ipv6_events.perf_submit(ctx, &data6, sizeof(data6)); }