diff options
author | 2020-04-14 16:50:24 +0200 | |
---|---|---|
committer | 2020-04-15 13:26:08 +0200 | |
commit | 49b452c382da2c2d1ccee1265cbb92da905c82f7 (patch) | |
tree | 940a104c0547f3aa76fb064ec6f8f44eec5b0914 /tools/lib/bpf | |
parent | libbpf: Always specify expected_attach_type on program load if supported (diff) | |
download | linux-49b452c382da2c2d1ccee1265cbb92da905c82f7.tar.gz linux-49b452c382da2c2d1ccee1265cbb92da905c82f7.tar.bz2 linux-49b452c382da2c2d1ccee1265cbb92da905c82f7.zip |
libbpf: Fix type of old_fd in bpf_xdp_set_link_opts
The 'old_fd' parameter used for atomic replacement of XDP programs is
supposed to be an FD, but was left as a u32 from an earlier iteration of
the patch that added it. It was converted to an int when read, so things
worked correctly even with negative values, but better change the
definition to correctly reflect the intention.
Fixes: bd5ca3ef93cd ("libbpf: Add function to set link XDP fd while specifying old program")
Reported-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: David Ahern <dsahern@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200414145025.182163-1-toke@redhat.com
Diffstat (limited to 'tools/lib/bpf')
-rw-r--r-- | tools/lib/bpf/libbpf.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index 44df1d3e7287..f1dacecb1619 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -458,7 +458,7 @@ struct xdp_link_info { struct bpf_xdp_set_link_opts { size_t sz; - __u32 old_fd; + int old_fd; }; #define bpf_xdp_set_link_opts__last_field old_fd |