Skip to content

string is not stack allocated: not supported #601

Answered by chenhengqi
houminz asked this question in Q&A
Discussion options

You must be logged in to vote

Your problem is in bpf_sock_ops_ipv4: https://github.com/SimpCosm/godemo/blob/c3d3ab845732d415e4de1df8077c395daa7703f9/sockredir/bpf/sockops.c#L61-L63

Replace bpf_trace_printk with bpf_printk. The latter is a macro that ensures that the format string is allocated on the stack.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lmb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants