Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Scope
Commits
c7888ee0
Commit
c7888ee0
authored
8 years ago
by
Alban Crequy
Committed by
Lorenzo Manacorda
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
tcpv4tracer.py: eBPF: fix tcp dport
parent
4d948a58
demo
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker/tcpv4tracer.py
+3
-2
docker/tcpv4tracer.py
with
3 additions
and
2 deletions
+3
-2
docker/tcpv4tracer.py
+
3
-
2
View file @
c7888ee0
...
...
@@ -169,9 +169,10 @@ int kretprobe__inet_csk_accept(struct pt_regs *ctx)
return 0;
// pull in details
u16 family = 0, lport = 0;
u16 family = 0, lport =
0, dport =
0;
bpf_probe_read(&family, sizeof(family), &newsk->__sk_common.skc_family);
bpf_probe_read(&lport, sizeof(lport), &newsk->__sk_common.skc_num);
bpf_probe_read(&dport, sizeof(dport), &newsk->__sk_common.skc_dport);
if (family == AF_INET) {
struct tcp_event_t evt = {.type = "accept", .pid = pid >> 32};
...
...
@@ -180,7 +181,7 @@ int kretprobe__inet_csk_accept(struct pt_regs *ctx)
bpf_probe_read(&evt.daddr, sizeof(u32),
&newsk->__sk_common.skc_daddr);
evt.sport = lport;
evt.dport =
0
;
evt.dport =
ntohs(dport)
;
tcp_event.perf_submit(ctx, &evt, sizeof(evt));
}
// else drop
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help