From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serhey Popovych Subject: [PATCH iproute2-next 0/6] ipaddress: Get rid of print_linkinfo_brief() Date: Tue, 30 Jan 2018 18:52:42 +0200 Message-ID: <1517331168-4132-1-git-send-email-serhe.popovych@gmail.com> To: netdev@vger.kernel.org Return-path: Received: from mail-lf0-f47.google.com ([209.85.215.47]:42247 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751761AbeA3Qwy (ORCPT ); Tue, 30 Jan 2018 11:52:54 -0500 Received: by mail-lf0-f47.google.com with SMTP id q17so16343069lfa.9 for ; Tue, 30 Jan 2018 08:52:54 -0800 (PST) Received: from tuxracer.localdomain ([2a01:6d80::195:20:96:53]) by smtp.gmail.com with ESMTPSA id w143sm3454806lff.52.2018.01.30.08.52.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 08:52:51 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: With this series I propose to get rid of custom print_linkinfo_brief() in favor of print_linkinfo() to avoid code duplication. Changes presented with this series tested using following script: iproute2_dir="$1" iface='eth0.2' pushd "$iproute2_dir" &>/dev/null for i in new old; do DIR="/tmp/$i" mkdir -p "$DIR" ln -snf ip.$i ip/ip # normal ip/ip link show >"$DIR/ip-link-show" ip/ip -4 addr show >"$DIR/ip-4-addr-show" ip/ip -6 addr show >"$DIR/ip-6-addr-show" ip/ip addr show dev "$iface" >"$DIR/ip-addr-show-$iface" # brief ip/ip -br link show >"$DIR/ip-br-link-show" ip/ip -br -4 addr show >"$DIR/ip-br-4-addr-show" ip/ip -br -6 addr show >"$DIR/ip-br-6-addr-show" ip/ip -br addr show dev "$iface" >"$DIR/ip-br-addr-show-$iface" done rm -f ip/ip diff -urN /tmp/{old,new} rc=$? popd &>/dev/null exit $rc Expected results : Actual results : Although test coverage is far from ideal in my opinion it covers most important aspects of the changes presented by the series. All this work is done in prepare of iplink_get() enhancements to support attribute parse that finally will be used to simplify ip/tunnel RTM_GETLINK code. As always reviews, comments, suggestions and criticism is welcome. Thanks, Serhii Serhey Popovych (6): ipaddress: Improve print_linkinfo() ipaddress: Simplify print_linkinfo_brief() and it's usage lib: Correct object file dependencies utils: Introduce and use get_ifname_rta() utils: Introduce and use print_name_and_link() to print name@link ipaddress: Get rid of print_linkinfo_brief() bridge/link.c | 21 ++---- include/utils.h | 5 ++ ip/ip_common.h | 3 - ip/ipaddress.c | 210 ++++++++++++------------------------------------------- ip/iplink.c | 5 +- lib/Makefile | 4 +- lib/utils.c | 70 +++++++++++++++++++ 7 files changed, 129 insertions(+), 189 deletions(-) -- 1.7.10.4