mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-12-06 09:58:34 +00:00
Core: Implement ArrayMap as BPF_MAP_TYPE_ARRAY
process_array_map was a stub raising NotImplementedError while ArrayMap was exported from pythonbpf.maps as if usable. The lowering is the hash map's with a different type constant: the same lookup/update/delete helpers, and the kernel fixes the key at a 4-byte index. The lookup allocation path accepts ARRAY alongside HASH, the audit tool lists ARRAY as supported, and the array_map_lookup_update case is a passing test now instead of a strict xfail. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@ -208,7 +208,7 @@ def _allocate_for_map_method(
|
||||
return
|
||||
|
||||
map_params = map_sym_tab[map_name].params
|
||||
if map_params["type"] != BPFMapType.HASH:
|
||||
if map_params["type"] not in (BPFMapType.HASH, BPFMapType.ARRAY):
|
||||
logger.warning(
|
||||
"Map method lookup used on non-hash map, using fallback allocation"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user