libbpf: proper XSKMAP cleanup
The bpf_map_update_elem() function, when used on an XSKMAP, will fail if not a valid AF_XDP socket is passed as value. Therefore, this is function cannot be used to clear the XSKMAP. Instead, the bpf_map_delete_elem() function should be used for that. This patch also simplifies the code by breaking up xsk_update_bpf_maps() into three smaller functions. Reported-by: NWilliam Tu <u9012063@gmail.com> Fixes: 1cad0788 ("libbpf: add support for using AF_XDP sockets") Signed-off-by: NBjörn Töpel <bjorn.topel@intel.com> Tested-by: NWilliam Tu <u9012063@gmail.com> Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Showing
想要评论请 注册 或 登录