Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
84900f82
Commit
84900f82
authored
May 30, 2018
by
yonghong-song
Committed by
GitHub
May 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1789 from pchaigno/fix-tcplife-byteorder
tcplife: fix dport filter on tracepoints
parents
09ea9dc7
95b3d8c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tools/tcplife.py
tools/tcplife.py
+2
-1
No files found.
tools/tcplife.py
View file @
84900f82
...
...
@@ -128,6 +128,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
/*
...
...
@@ -366,7 +367,7 @@ if args.pid:
'if (pid != %s) { return 0; }'
%
args
.
pid
)
if
args
.
remoteport
:
dports
=
[
int
(
dport
)
for
dport
in
args
.
remoteport
.
split
(
','
)]
dports_if
=
' && '
.
join
([
'dport != %d'
%
ntohs
(
dport
)
for
dport
in
dports
])
dports_if
=
' && '
.
join
([
'dport != %d'
%
dport
for
dport
in
dports
])
bpf_text
=
bpf_text
.
replace
(
'FILTER_DPORT'
,
'if (%s) { birth.delete(&sk); return 0; }'
%
dports_if
)
if
args
.
localport
:
...
...
Write
Preview
Markdown
is supported
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