From: David Ahern <dsahern@gmail.com>
To: Serhey Popovych <serhe.popovych@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2-next 8/9] utils: Introduce and use print_name_and_link() to print name@link
Date: Tue, 6 Feb 2018 22:14:04 -0700 [thread overview]
Message-ID: <7996fb02-c31f-4fce-17c5-f1875298f453@gmail.com> (raw)
In-Reply-To: <1517860174-18333-9-git-send-email-serhe.popovych@gmail.com>
On 2/5/18 12:49 PM, Serhey Popovych wrote:
> There is at least three places implementing same things: two in
> ipaddress.c print_linkinfo() & print_linkinfo_brief() and one in
> bridge/link.c.
>
> They are diverge from each other very little: bridge/link.c does not
> support JSON output at the moment and print_linkinfo_brief() does not
> handle IFLA_LINK_NETNS case.
>
> Introduce and use print_name_and_link() routine to handle name@link
> output in all possible variations; respect IFLA_LINK_NETNS attribute to
> handle case when link is in different namespace; use ll_idx_n2a() for
> interface name instead of "<nil>" to share logic with other code (e.g.
> ll_name_to_index() and ll_index_to_name()) supporting such template.
>
> Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
> ---
> bridge/link.c | 13 +++----------
> include/utils.h | 4 ++++
> ip/ipaddress.c | 44 ++------------------------------------------
> lib/utils.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 58 insertions(+), 52 deletions(-)
>
This patch is causing a diff on my system:
# ip -br add sh > /tmp/1
# ip/ip -br add sh > /tmp/2
# diff /tmp/1 /tmp/2
8c8
< veth-out@br3 UP fe80::18a8:89ff:fee7:55c5/64
---
> veth-out@if7 UP fe80::18a8:89ff:fee7:55c5/64
So the current ip resolves ifindex 7 to br3:
# ip li sh dev br3
7: br3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master
vrf3 state UP mode DEFAULT group default qlen 1000
where your patch causes if%d to be printed.
next prev parent reply other threads:[~2018-02-07 5:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-05 19:49 [PATCH iproute2-next 0/9] ipaddress: Make print_linkinfo_brief() static Serhey Popovych
2018-02-05 19:49 ` [PATCH iproute2-next 1/9] ipaddress: Abstract IFA_LABEL matching code Serhey Popovych
2018-02-05 19:49 ` [PATCH iproute2-next 2/9] ipaddress: ll_map: Replace ll_idx_n2a() with ll_index_to_name() Serhey Popovych
2018-02-05 19:49 ` [PATCH iproute2-next 3/9] utils: Reimplement ll_idx_n2a() and introduce ll_idx_a2n() Serhey Popovych
2018-02-05 19:49 ` [PATCH iproute2-next 4/9] ipaddress: Improve print_linkinfo() Serhey Popovych
2018-02-05 19:49 ` [PATCH iproute2-next 5/9] ipaddress: Simplify print_linkinfo_brief() and it's usage Serhey Popovych
2018-02-05 19:49 ` [PATCH iproute2-next 6/9] lib: Correct object file dependencies Serhey Popovych
2018-02-05 19:49 ` [PATCH iproute2-next 7/9] utils: Introduce and use get_ifname_rta() Serhey Popovych
2018-02-05 19:49 ` [PATCH iproute2-next 8/9] utils: Introduce and use print_name_and_link() to print name@link Serhey Popovych
2018-02-07 5:14 ` David Ahern [this message]
2018-02-07 7:36 ` Serhey Popovych
2018-02-07 15:59 ` David Ahern
2018-02-05 19:49 ` [PATCH iproute2-next 9/9] ipaddress: Make print_linkinfo_brief() static Serhey Popovych
2018-02-14 20:09 ` [PATCH iproute2-next 0/9] " Serhey Popovych
2018-02-14 20:20 ` David Ahern
2018-02-14 21:39 ` Serhey Popovych
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7996fb02-c31f-4fce-17c5-f1875298f453@gmail.com \
--to=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=serhe.popovych@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).