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

Consider using a single value to represent an invalid ID #4098

Open
lmb opened this issue Dec 18, 2024 · 0 comments
Open

Consider using a single value to represent an invalid ID #4098

lmb opened this issue Dec 18, 2024 · 0 comments
Labels
cleanup Affects API usability or code maintainability but not correctness or applicability question Further information is requested

Comments

@lmb
Copy link
Collaborator

lmb commented Dec 18, 2024

The runtime currently reserves two values to mean "invalid ID": 0 and EBPF_ID_NONE (which is the same as MAX_UINT32). This leads to duplicate checks / inconsistencies in code checking IDs for validity.

For reference, Linux uses 0 as the invalid ID. MAX_UINT32 is a valid ID, afaik.

@dthaler suggested that it might make sense to define EBPF_ID_NONE to be 0.

@lmb lmb added cleanup Affects API usability or code maintainability but not correctness or applicability question Further information is requested labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Affects API usability or code maintainability but not correctness or applicability question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant