From 8c771fb1cc1fdaf2d15f863c7ac407c09f453c54 Mon Sep 17 00:00:00 2001 From: tomato Date: Wed, 11 Dec 2024 01:01:02 +0800 Subject: [PATCH] fix, bpf_printk only accept three arg (#1438) --- bpf/tc_sock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bpf/tc_sock.h b/bpf/tc_sock.h index e8ffd54c3..c71dc3de1 100644 --- a/bpf/tc_sock.h +++ b/bpf/tc_sock.h @@ -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); }