I'm writing code in libbpf
to get the entire data packet content (not address) by funtion bpf_probe_read_kernel
.
For example, bpf_probe_read_kernel(my_struct, 512, skb->data);
But there's an error: invalid mem access 'inv'
which probably tells me that I don't have access directly to skb->data
.
But if I add an &
before, let's say bpf_probe_read_kernel(my_struct, 512, &skb->data);
, there's no error but I can only get the address which is not what I want.
So any ideas on this issue?