Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for getting interface index from XDP context #1140

Open
gth828r opened this issue Jan 21, 2025 · 1 comment · May be fixed by #1141
Open

Add support for getting interface index from XDP context #1140

gth828r opened this issue Jan 21, 2025 · 1 comment · May be fixed by #1141

Comments

@gth828r
Copy link

gth828r commented Jan 21, 2025

The XdpContext's corresponding C struct xdp_md defined in the Linux headers under include/uapi/linux/bpf.h has a field ingress_ifindex which represents the interface index as determined by the OS. It would be nice if that was also available in Aya's XdpContext.

@gth828r
Copy link
Author

gth828r commented Jan 21, 2025

I'm promoting this to an issue from #1130 in part because I need this functionality for my toy project. I'm going to pull this feature from a fork for now, but I figure I'd offer it upstream as well. I will submit a PR shortly. If there is a legitimate reason for excluding that field in Aya, then my apologies -- I couldn't find much info on it.

gth828r added a commit to gth828r/aya that referenced this issue Jan 21, 2025
This change exposes the ifindex field from the underlying xdp_md
data structure to the XdpContext in Aya. The ifindex represents the
unique OS-provided index for a network interface.

Fixes aya-rs#1140
@gth828r gth828r linked a pull request Jan 21, 2025 that will close this issue
gth828r added a commit to gth828r/aya that referenced this issue Jan 22, 2025
This change exposes the ifindex field from the underlying xdp_md
data structure to the XdpContext in Aya. The ifindex represents the
unique OS-provided index for a network interface.

Fixes aya-rs#1140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant