[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <42fda2b7-10b0-c28d-13fe-17a18b2d6229@gmail.com>
Date: Tue, 20 Feb 2018 22:13:25 -0700
From: David Ahern <dsahern@...il.com>
To: Serhey Popovych <serhe.popovych@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH iproute2-next v2 1/7] utils: Introduce and use nodev()
helper routine
On 2/20/18 2:37 PM, Serhey Popovych wrote:
> diff --git a/ip/ipneigh.c b/ip/ipneigh.c
> index 0735424..9c9cd23 100644
> --- a/ip/ipneigh.c
> +++ b/ip/ipneigh.c
> @@ -178,11 +178,13 @@ static int ipneigh_modify(int cmd, int flags, int argc, char **argv)
>
> ll_init_map(&rth);
>
> - if (dev && (req.ndm.ndm_ifindex = ll_name_to_index(dev)) == 0) {
> - fprintf(stderr, "Cannot find device \"%s\"\n", dev);
> - return -1;
> + if (dev) {
> + req.ndm.ndm_ifindex = ll_name_to_index(dev);
> + if (!req.ndm.ndm_ifindex)
> + return nodev(dev);
> }
>
> +
> if (rtnl_talk(&rth, &req.n, NULL) < 0)
> exit(2);
>
Remove the extra newline
Powered by blists - more mailing lists