Skip to content

Commit

Permalink
fix, bpf_printk only accept three arg (#1438)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomatopunk authored Dec 10, 2024
1 parent a6d91fd commit 8c771fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bpf/tc_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ static __always_inline void bpf_sock_ops_establish_cb(struct bpf_sock_ops *skops
sk_ops_extract_key_ip4(skops, &conn);
}

bpf_printk("SET %llx:%d -> %llx:%d", conn.s_ip[3], conn.s_port, conn.d_ip[3], conn.d_port);
bpf_printk("SET s_ip[3]: %llx s_port: %d", conn.s_ip[3], conn.s_port);
bpf_printk("SET d_ip[3]: %llx d_port: %d", conn.d_ip[3], conn.d_port);

bpf_sock_hash_update(skops, &sock_dir, &conn, BPF_ANY);
}

Expand Down

0 comments on commit 8c771fb

Please sign in to comment.