From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f50.google.com ([209.85.214.50]:35770 "EHLO mail-it0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750708AbeBUFN2 (ORCPT ); Wed, 21 Feb 2018 00:13:28 -0500 Received: by mail-it0-f50.google.com with SMTP id v194so867107itb.0 for ; Tue, 20 Feb 2018 21:13:27 -0800 (PST) Subject: Re: [PATCH iproute2-next v2 1/7] utils: Introduce and use nodev() helper routine To: Serhey Popovych , netdev@vger.kernel.org References: <1519162649-22449-1-git-send-email-serhe.popovych@gmail.com> <1519162649-22449-2-git-send-email-serhe.popovych@gmail.com> From: David Ahern Message-ID: <42fda2b7-10b0-c28d-13fe-17a18b2d6229@gmail.com> Date: Tue, 20 Feb 2018 22:13:25 -0700 MIME-Version: 1.0 In-Reply-To: <1519162649-22449-2-git-send-email-serhe.popovych@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: 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