Fix map access syntax in examples/xdp_pass

This commit is contained in:
Pragyansh Chaturvedi
2025-10-22 20:07:38 +05:30
parent 99b92e44e3
commit beaad996db

View File

@ -23,14 +23,14 @@ def count() -> HashMap:
def hello_world(ctx: c_void_p) -> c_int64: def hello_world(ctx: c_void_p) -> c_int64:
key = 0 key = 0
one = 1 one = 1
prev = count().lookup(key) prev = count.lookup(key)
if prev: if prev:
prevval = prev + 1 prevval = prev + 1
print(f"count: {prevval}") print(f"count: {prevval}")
count().update(key, prevval) count.update(key, prevval)
return XDP_PASS return XDP_PASS
else: else:
count().update(key, one) count.update(key, one)
return XDP_PASS return XDP_PASS