Skip to content

Commit

Permalink
handle return value in kretprobe handler for tcpv4connect
Browse files Browse the repository at this point in the history
Signed-off-by: Yonghong Song <[email protected]>
  • Loading branch information
yonghong-song committed Oct 7, 2015
1 parent 99dced7 commit 366eb2e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/tcpv4connect
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ int kretprobe__tcp_v4_connect(struct pt_regs *ctx)
return 0; // missed entry
}
if (ret != 0) {
// failed to send SYNC packet, socket __sk_common.{skc_rcv_saddr, ...}
// may not be populated properly.
currsock.delete(&pid);
return 0;
}
// pull in details
struct sock *skp = *skpp;
u32 saddr = 0, daddr = 0;
Expand Down

0 comments on commit 366eb2e

Please sign in to comment.