Skip to content

Problem with bpf_redirect_map from userspace #892

Answered by ti-mo
bewing asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @bewing, this doesn't look related to anything in the library specifically, but I'll try to give some pointers because everything's so clearly presented. :)

When dealing with undocumented bpf features (as most of them are), the kernel selftests usually contain an example use case or two that can provide some clarity. In the case of devmap, there's https://elixir.bootlin.com/linux/latest/source/samples/bpf/xdp_redirect_map.bpf.c (and xdp_redirect_map_user.c for the userspace counterpart)

The way you populate the map from userspace seems fine, there's not really a possibility for mismatching byte order (ifindex is pulled from the kernel, processed in a native Go program and written back…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bewing
Comment options

@ti-mo
Comment options

@bewing
Comment options

Answer selected by bewing
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