mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Fix hashmap access in direct_assign.py
This commit is contained in:
@ -26,12 +26,12 @@ def count() -> HashMap:
|
|||||||
@bpf
|
@bpf
|
||||||
@section("xdp")
|
@section("xdp")
|
||||||
def hello_world(ctx: c_void_p) -> c_int64:
|
def hello_world(ctx: c_void_p) -> c_int64:
|
||||||
prev = count().lookup(0)
|
prev = count.lookup(0)
|
||||||
if prev:
|
if prev:
|
||||||
count().update(0, prev + 1)
|
count.update(0, prev + 1)
|
||||||
return XDP_PASS
|
return XDP_PASS
|
||||||
else:
|
else:
|
||||||
count().update(0, 1)
|
count.update(0, 1)
|
||||||
|
|
||||||
return XDP_PASS
|
return XDP_PASS
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user