Commit 2dd148a2 authored by Mauricio Vasquez B's avatar Mauricio Vasquez B

BPFProgTable: allow to remove elements

It is allowed in the kernel from some time ago:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/arraymap.c?h=v4.4#n267Signed-off-by: default avatarMauricio Vasquez B <mauricio.vasquez@polito.it>
parent f2354fa5
......@@ -287,6 +287,12 @@ public:
return StatusTuple(-1, "Error updating value: %s", std::strerror(errno));
return StatusTuple(0);
}
StatusTuple remove_value(const int& index) {
if (!this->remove(const_cast<int*>(&index)))
return StatusTuple(-1, "Error removing value: %s", std::strerror(errno));
return StatusTuple(0);
}
};
} // namespace ebpf
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment