From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f67.google.com ([209.85.215.67]:35690 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752392AbeBZPvr (ORCPT ); Mon, 26 Feb 2018 10:51:47 -0500 Received: by mail-lf0-f67.google.com with SMTP id 70so22933166lfw.2 for ; Mon, 26 Feb 2018 07:51:46 -0800 (PST) Subject: Re: [PATCH iproute2-next v3 6/8] iplink: Perform most of request buffer setups and checks in iplink_parse() To: David Ahern , 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: Serhey Popovych Message-ID: <9e212955-2d33-1644-58e5-76fd951ad145@gmail.com> Date: Mon, 26 Feb 2018 17:51:43 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zV8rJEcIlLxUNNcmmMWMI9V8nK0YSHmwZ" Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --zV8rJEcIlLxUNNcmmMWMI9V8nK0YSHmwZ Content-Type: multipart/mixed; boundary="KDsIscYBzil7dzdEPnDzEXypf6bEZqWL6"; protected-headers="v1" From: Serhey Popovych To: David Ahern , netdev@vger.kernel.org Message-ID: <9e212955-2d33-1644-58e5-76fd951ad145@gmail.com> Subject: Re: [PATCH iproute2-next v3 6/8] iplink: Perform most of request buffer setups and checks in iplink_parse() References: <1519304526-18848-1-git-send-email-serhe.popovych@gmail.com> <1519304526-18848-7-git-send-email-serhe.popovych@gmail.com> In-Reply-To: --KDsIscYBzil7dzdEPnDzEXypf6bEZqWL6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable David Ahern wrote: > 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: the= y >> 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(-) >> >=20 > IMO veth and vxcan should not be re-using iplink_parse since they only > want a subset of the parsing. >=20 In kernel we call rtnl_create_link() and rtnl_configure_link() to configure peer device from VETH_INFO_PEER. Also we use ifla_policy from net/core/rtnetlink.c with lots of parameters. Agree not all of them needed/used for veth, but at the moment dropping iplink_parse() from vxcan and veth in iproute2 without corresponding change may restrict functionality. --KDsIscYBzil7dzdEPnDzEXypf6bEZqWL6-- --zV8rJEcIlLxUNNcmmMWMI9V8nK0YSHmwZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJalC0PAAoJEBTawMmQ61bBTksIAJ7zJjrMhEFh2vysvr9bUbrJ gpZuGbl3j1GRKUxzQwbMRsI8Sv/VRWJCBGLvgmRrTPM2c39irNGL5Wfx1MyN9HOx PfgZzbyHhoX7FtxZPOkMtVOj5n/hDR215iAlEnvgv47RkFO4vklr/acShgxbWbkj P8EGun5cIdq8KC0XKwljDLLktBKKCAbkLAv5sR96IPmey5Hz2rCeryZchmikvWdx NVpFM2vvKa2LsbSPhJYMBSHc6f+A6e5QCjNQGEfWIfP56GhN9BXi7l8gU7BNeQWr awehGOwXxOKgdrp145cyC9TYmh9ZX/HA4idTqnvwRAzZHEFQlEXb9EFf2TCbSnE= =36u0 -----END PGP SIGNATURE----- --zV8rJEcIlLxUNNcmmMWMI9V8nK0YSHmwZ--