[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3d270607-6fbb-b56a-ce77-ddc8fc26460d@gmail.com>
Date: Tue, 14 Apr 2020 13:47:21 -0600
From: David Ahern <dsahern@...il.com>
To: Toke Høiland-Jørgensen <toke@...hat.com>,
daniel@...earbox.net, ast@...com
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH bpf 1/2] libbpf: Fix type of old_fd in
bpf_xdp_set_link_opts
On 4/14/20 8:50 AM, Toke Høiland-Jørgensen wrote:
> 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@...il.com>
> Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
> ---
> tools/lib/bpf/libbpf.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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
>
>
int is much better. Thanks,
Acked-by: David Ahern <dsahern@...il.com>
Powered by blists - more mailing lists