Skip to content

Commit

Permalink
tcpretrans: ntohs dport (iovisor#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdrayton authored and 4ast committed Jul 31, 2016
1 parent a2d669c commit 8ba998e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/tcpretrans.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@
&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));
Expand All @@ -103,8 +104,9 @@
&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));
}
Expand Down

0 comments on commit 8ba998e

Please sign in to comment.