From patchwork Tue Feb 20 21:37:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serhey Popovych X-Patchwork-Id: 875708 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UsDdqvdS"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zmDW80KqDz9ryC for ; Wed, 21 Feb 2018 08:38:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750866AbeBTVhk (ORCPT ); Tue, 20 Feb 2018 16:37:40 -0500 Received: from mail-lf0-f44.google.com ([209.85.215.44]:41568 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbeBTVhj (ORCPT ); Tue, 20 Feb 2018 16:37:39 -0500 Received: by mail-lf0-f44.google.com with SMTP id f136so6299544lff.8 for ; Tue, 20 Feb 2018 13:37:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=QM6W6fKIWTXdmJgU5SPp/OasR3ueD0OkPiltSy6aOvI=; b=UsDdqvdSsOFeZyX4UqEA3mB06ekrbsDE4ytVV65CTz/tuUM3QaIOloniVO62CXEk0X J/f5LOdSSBOZTqzXwhdtGTbxoXYQ3Y/ic4hGdHf7p1YRUMC94fX14rvpK8ICKHzFpiiG jxYYC52vFNA+6tig8xvk2QG/yTvKxZiAGZCm7BN5zktyN1NbQegJtplZEXj67pnr8ac0 6LMgrgQlHaAfwreTI6OSKlBvcImqiuNoS4SkDtBmecSRaahEDS0NCtMK+Gu7Ags0lzBx agbCkAwne0NgzoIth5q3QTLgLrbQkQCqyLPLsHmFH2j9jyXMM3RGmrpxwhUFErIIp+bh KPbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QM6W6fKIWTXdmJgU5SPp/OasR3ueD0OkPiltSy6aOvI=; b=VUUQKeFeukwfwfQymg6fA3nIHyannNRIc5bLwXuVPNCqo4xVtyhihxTHffPg0Z4avj BwLVPQQuTnY8x4J07E/FhhU6ukFNf9KPINr8Kk82EYNNjcH9I+LQoIXYrv/ThPUAFvDA 2cHVtdI9Oz5MufNDpH1a4JE3sx6vJDrfKEgrmiykePGYXOdrdITZj64HobP/3AGJwz/O 9ycdLJDxThv0h6NvugY1WFQjbH6U2rx+RhsfCanBnoZezlal8NtS2ug1PzRaPb4YS+8S f3PRGhqNFbCs/YIe8j46RzooT5Al6DFHxnflH5Y0siQ/tYIFgyenaut8seYr67F6oTuc RUMA== X-Gm-Message-State: APf1xPC7E33UfLeLQJ3wN+B/c5CAKZntttKC0taxMOQtUFgBPDLlghfS zn6i2zcHvatUPpMU4IkbV0Ymrw== X-Google-Smtp-Source: AH8x224c1rEUVXViRfH+DXdD5kxXAHks9bG7rAQ57a1wdNtcZ19ZG95AkjmkEisp8121kT8da9gUEg== X-Received: by 10.46.108.6 with SMTP id h6mr666278ljc.125.1519162657928; Tue, 20 Feb 2018 13:37:37 -0800 (PST) Received: from tuxracer.localdomain ([2a01:6d80::195:20:96:53]) by smtp.gmail.com with ESMTPSA id t69sm3485486ljb.36.2018.02.20.13.37.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 13:37:36 -0800 (PST) From: Serhey Popovych To: netdev@vger.kernel.org Cc: dsahern@gmail.com Subject: [PATCH iproute2-next v2 0/7] iplink: Improve iplink_parse() Date: Tue, 20 Feb 2018 23:37:22 +0200 Message-Id: <1519162649-22449-1-git-send-email-serhe.popovych@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This is main routine to parse ip-link(8) configuration parameters. Main reason to improve it is to pass network device @name, @dev and other parameters to kind specific ->parse_opt() function so they can use this information. For example later we will extend iplink_get() to parse netlink attributes deeper and replace open coded rtnl_talk() in ip/tunnel modules to simplify getting existing tunnel information. Among main change there is a number of patches to prepare for it that improve iplink_parse() in some way. See individual patch description message for more information. v2 Terminate via exit() when failing to parse command line arguments to help identify failing line in batch mode. Thanks, Serhii Serhey Popovych (7): utils: Introduce and use nodev() helper routine iplink: Correctly report error when network device isn't found iplink: Use "dev" and "name" parameters interchangeable when possible iplink: Follow documented behaviour when "index" is given iplink: Perform most of request buffer setups and checks in iplink_parse() iplink: Move data structures to block of their users iplink: Reduce number of arguments to iplink_parse() bridge/fdb.c | 17 ++-- bridge/link.c | 8 +- bridge/mdb.c | 19 ++--- bridge/vlan.c | 7 +- include/utils.h | 1 + ip/ip6tunnel.c | 6 +- ip/ip_common.h | 17 +++- ip/ipaddress.c | 7 +- ip/iplink.c | 200 +++++++++++++++++++++++++++------------------- ip/iplink_bond.c | 8 +- ip/iplink_bond_slave.c | 4 +- ip/iplink_bridge.c | 11 ++- ip/iplink_bridge_slave.c | 4 +- ip/iplink_can.c | 4 +- ip/iplink_geneve.c | 4 +- ip/iplink_hsr.c | 4 +- ip/iplink_ipoib.c | 4 +- ip/iplink_ipvlan.c | 4 +- ip/iplink_macvlan.c | 4 +- ip/iplink_vlan.c | 4 +- ip/iplink_vrf.c | 5 +- ip/iplink_vxcan.c | 39 +++------ ip/iplink_vxlan.c | 11 ++- ip/iplink_xdp.c | 7 +- ip/ipmacsec.c | 4 +- ip/ipmroute.c | 7 +- ip/ipneigh.c | 15 ++-- ip/ipntable.c | 6 +- ip/iproute.c | 36 +++------ ip/iproute_lwtunnel.c | 4 +- ip/iptunnel.c | 6 +- ip/link_gre.c | 43 +++++----- ip/link_gre6.c | 43 +++++----- ip/link_ip6tnl.c | 40 +++++----- ip/link_iptnl.c | 40 +++++----- ip/link_veth.c | 39 +++------ ip/link_vti.c | 43 +++++----- ip/link_vti6.c | 43 +++++----- lib/utils.c | 6 ++ tc/m_mirred.c | 6 +- tc/tc_class.c | 14 ++-- tc/tc_filter.c | 18 ++--- tc/tc_qdisc.c | 12 +-- 43 files changed, 405 insertions(+), 419 deletions(-)