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]
Date:   Wed, 9 Jan 2019 23:25:54 +0000
From:   Matteo Croce <mcroce@...hat.com>
To:     Ioana Ciornei <ioana.ciornei@....com>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "ast@...nel.org" <ast@...nel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>
Subject: Re: [PATCH] samples: bpf: user proper argument index

On Wed, Jan 9, 2019 at 5:07 PM Ioana Ciornei <ioana.ciornei@....com> wrote:
>
> Use optind as index for argv instead of a hardcoded value.
> When the program has options this leads to improper parameter handling.
>
> Fixes: dc378a1ab5b6 ("samples: bpf: get ifindex from ifname")
>
> Signed-off-by: Ioana Ciornei <ioana.ciornei@....com>
> ---
>  samples/bpf/xdp1_user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/samples/bpf/xdp1_user.c b/samples/bpf/xdp1_user.c
> index 0a197f8..8bfda95 100644
> --- a/samples/bpf/xdp1_user.c
> +++ b/samples/bpf/xdp1_user.c
> @@ -103,7 +103,7 @@ int main(int argc, char **argv)
>                 return 1;
>         }
>
> -       ifindex = if_nametoindex(argv[1]);
> +       ifindex = if_nametoindex(argv[optind]);
>         if (!ifindex) {
>                 perror("if_nametoindex");
>                 return 1;
> --
> 1.9.1
>

ACK

-- 
Matteo Croce
per aspera ad upstream

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ