Skip to content

Commit 439fcbe

Browse files
authored
Merge pull request #24 from coroot/non_blocking_tcp_connect
Fix TCP connection timestamp handling
2 parents 461156d + abc9e3c commit 439fcbe

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

containers/container.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ func (c *Container) onL7Request(pid uint32, fd uint64, timestamp uint64, r *ebpf
562562
c.lock.Lock()
563563
defer c.lock.Unlock()
564564
for dest, conn := range c.connectionsActive {
565-
if conn.Pid == pid && conn.Fd == fd && (conn.Timestamp == 0 || conn.Timestamp == timestamp) {
565+
if conn.Pid == pid && conn.Fd == fd && (timestamp == 0 || conn.Timestamp == timestamp) {
566566
key := AddrPair{src: dest.dst, dst: conn.ActualDest}
567567
stats := c.l7Stats[r.Protocol]
568568
if stats == nil {

ebpftracer/ebpf.go

+4-4
Large diffs are not rendered by default.

ebpftracer/ebpf/tcp/state.c

-4
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,6 @@ int sys_enter_connect(void *ctx) {
163163
}
164164
__u64 id = bpf_get_current_pid_tgid();
165165
bpf_map_update_elem(&fd_by_pid_tgid, &id, &args.fd, BPF_ANY);
166-
struct sk_info k = {};
167-
k.pid = id >> 32;
168-
k.fd = args.fd;
169-
bpf_map_delete_elem(&connection_timestamps, &k);
170166
return 0;
171167
}
172168

0 commit comments

Comments
 (0)