Skip to content

Commit

Permalink
tools: Use correct key key when deleting item from map
Browse files Browse the repository at this point in the history
The correct key to use is "tig" instead of "pid".

Signed-off-by: Mauricio Vásquez <[email protected]>
  • Loading branch information
mauriciovasquezbernal authored and yonghong-song committed Oct 8, 2020
1 parent 5e55c22 commit 884799f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/bindsnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
sports = [int(sport) for sport in args.port.split(',')]
sports_if = ' && '.join(['sport != %d' % sport for sport in sports])
bpf_text = bpf_text.replace('FILTER_PORT',
'if (%s) { currsock.delete(&pid); return 0; }' % sports_if)
'if (%s) { currsock.delete(&tid); return 0; }' % sports_if)
if args.uid:
bpf_text = bpf_text.replace('FILTER_UID',
'if (uid != %s) { return 0; }' % args.uid)
Expand Down
2 changes: 1 addition & 1 deletion tools/tcpconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
dports = [int(dport) for dport in args.port.split(',')]
dports_if = ' && '.join(['dport != %d' % ntohs(dport) for dport in dports])
bpf_text = bpf_text.replace('FILTER_PORT',
'if (%s) { currsock.delete(&pid); return 0; }' % dports_if)
'if (%s) { currsock.delete(&tid); return 0; }' % dports_if)
if args.uid:
bpf_text = bpf_text.replace('FILTER_UID',
'if (uid != %s) { return 0; }' % args.uid)
Expand Down

0 comments on commit 884799f

Please sign in to comment.