From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f66.google.com ([209.85.160.66]:45024 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751958AbeBZDb4 (ORCPT ); Sun, 25 Feb 2018 22:31:56 -0500 Received: by mail-pl0-f66.google.com with SMTP id w21so8518813plp.11 for ; Sun, 25 Feb 2018 19:31:56 -0800 (PST) Subject: Re: [PATCH iproute2-next v3 6/8] iplink: Perform most of request buffer setups and checks in iplink_parse() To: Serhey Popovych , netdev@vger.kernel.org References: <1519304526-18848-1-git-send-email-serhe.popovych@gmail.com> <1519304526-18848-7-git-send-email-serhe.popovych@gmail.com> From: David Ahern Message-ID: Date: Sun, 25 Feb 2018 20:31:53 -0700 MIME-Version: 1.0 In-Reply-To: <1519304526-18848-7-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/22/18 6:02 AM, Serhey Popovych wrote: > To benefit other users (e.g. link_veth.c) of iplink_parse() from > additional attribute checks and setups made in iplink_modify(). This > catches most of weired cobination of parameters to peer device > configuration. > > Drop @link, @group and @index from iplink_parse() parameters list: they > are not needed outside. > > While there change return -1 to exit(-1) for group parsing errors: we > want to stop further command processing unless -force option is given > to get error line easily. > > Signed-off-by: Serhey Popovych > --- > ip/ip_common.h | 3 +- > ip/iplink.c | 118 +++++++++++++++++++++++++---------------------------- > ip/iplink_vxcan.c | 13 +----- > ip/link_veth.c | 13 +----- > 4 files changed, 59 insertions(+), 88 deletions(-) > IMO veth and vxcan should not be re-using iplink_parse since they only want a subset of the parsing.