]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix type of old_fd in bpf_xdp_set_link_opts
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 14 Apr 2020 14:50:24 +0000 (16:50 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 15 Apr 2020 11:26:08 +0000 (13:26 +0200)
commit1f4192fbc57259e1717fbb07ea56040e7c9f99b8
tree940a104c0547f3aa76fb064ec6f8f44eec5b0914
parent4bc51a484dacd1ceec70167cc51533fbe06cc7f5
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: e1e641a9c2de ("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
tools/lib/bpf/libbpf.h