libbpf: fix to reject unknown flags in xsk_socket__create()
authorMagnus Karlsson <magnus.karlsson@intel.com>
Tue, 12 Mar 2019 08:59:45 +0000 (09:59 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 12 Mar 2019 20:58:18 +0000 (21:58 +0100)
commit6bf21b54a596d60905cfc7e8af8e2fe16d9fe7e9
tree32998f7339acab60393ae7a3fbbb4a303840beec
parentd6f1837107c00fa7b2fdb606acf65b33b455dbfd
libbpf: fix to reject unknown flags in xsk_socket__create()

In xsk_socket__create(), the libbpf_flags field was not checked for
setting currently unused/unknown flags. This patch fixes that by
returning -EINVAL if the user has set any flag that is not in use at
this point in time.

Fixes: 1cad07884239 ("libbpf: add support for using AF_XDP sockets")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Reviewed-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/xsk.c