Reputation: 1
Source code: in lb.h
ret = map_update_elem(&LB4_UDP_LB_MAP, &msg_keyindex, &slot, 0);
if (!ret) {
bpfprint("Update success");
}else {
bpfprint("Update failed");
}
myslot = map_lookup_elem(&LB4_UDP_LB_MAP,&msg_keyindex);
if (!myslot) {
bpfprint("Catch slot is %d",\*myslot);
}
bpfprint("Slot is %d",myslot);
Then show: "Update failed", but use
bpftool map dump id` the map updated;
Next, try to lookup the map, no value found.
What is the possible reason?
Can update and lookup the map in funtion defined in lb.h
Upvotes: 0
Views: 20