lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ec8def5-a24f-a4ff-d0ae-fb8f11e4acdc@lab.ntt.co.jp>
Date:   Thu, 28 Dec 2017 17:18:28 +0900
From:   Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
To:     Eric Leblond <eric@...it.org>, daniel@...earbox.net
Cc:     Alexei Starovoitov <alexei.starovoitov@...il.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 1/3] libbpf: add function to setup XDP

On 2017/12/28 17:04, Eric Leblond wrote:
> Most of the code is taken from set_link_xdp_fd() in bpf_load.c and
> slightly modified to be library compliant.
> 
> Signed-off-by: Eric Leblond <eric@...it.org>
> Acked-by: Alexei Starovoitov <ast@...nel.org>
> ---
...
> +int bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags)
...
> +	if (bind(sock, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
> +		ret = -errno;
> +		goto cleanup;
> +	}
> +
> +	addrlen = sizeof(sa);
> +	if (getsockname(sock, (struct sockaddr *)&sa, &addrlen) < 0) {
> +		ret = errno;

Still errno is not inverted,

> +		goto cleanup;
> +	}
> +
> +	if (addrlen != sizeof(sa)) {
> +		ret = errno;

And not set here.

> +		goto cleanup;
> +	}

-- 
Toshiaki Makita

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ