Skip to content

elf: unwrap Typedef qualifiers in map field type assertions#1974

Open
joaquinhuigomez wants to merge 1 commit intocilium:mainfrom
joaquinhuigomez:fix/typedef-wrapped-map-fields
Open

elf: unwrap Typedef qualifiers in map field type assertions#1974
joaquinhuigomez wants to merge 1 commit intocilium:mainfrom
joaquinhuigomez:fix/typedef-wrapped-map-fields

Conversation

@joaquinhuigomez
Copy link
Copy Markdown

Zig-compiled BPF objects wrap map definition struct members in BTF Typedef types, causing type assertions on Pointer to fail during LoadCollectionSpec. Use btf.UnderlyingType() to strip qualifiers before asserting on key, value, and uintFromBTF types.

Fixes #1972

Zig-compiled BPF objects wrap map definition struct members in BTF
Typedef types (e.g. Typedef -> Pointer -> Array), causing type
assertions on Pointer to fail. Use btf.UnderlyingType() to strip
qualifiers before asserting on key, value, and uintFromBTF types.

Fixes cilium#1972
@joaquinhuigomez joaquinhuigomez requested a review from a team as a code owner March 29, 2026 17:27
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 this pull request may close these issues.

LoadCollectionSpec fails on Zig-compiled BPF objects due to Typedef-wrapped map field types

1 participant