From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Dichtel Subject: Re: [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support Date: Thu, 31 May 2018 16:31:32 +0200 Message-ID: <44989021-9199-28e4-57a0-86ec968f8685@6wind.com> References: <20180531142848.377-1-nicolas.dichtel@6wind.com> Reply-To: nicolas.dichtel@6wind.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org To: Stephen Hemminger Return-path: Received: from mail-wm0-f44.google.com ([74.125.82.44]:40853 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755274AbeEaObf (ORCPT ); Thu, 31 May 2018 10:31:35 -0400 Received: by mail-wm0-f44.google.com with SMTP id x2-v6so46937009wmh.5 for ; Thu, 31 May 2018 07:31:35 -0700 (PDT) In-Reply-To: <20180531142848.377-1-nicolas.dichtel@6wind.com> Content-Language: fr Sender: netdev-owner@vger.kernel.org List-ID: Oops, I use an old email for Stephen, sorry. Regards, Nicolas Le 31/05/2018 à 16:28, Nicolas Dichtel a écrit : > Parse and display those attributes. > Example: > ip l a type dummy > ip netns add foo > ip monitor link& > ip l s dummy1 netns foo > Deleted 6: dummy1: mtu 1500 qdisc noop state DOWN group default > link/ether 66:af:3a:3f:a0:89 brd ff:ff:ff:ff:ff:ff new-nsid 0 new-ifindex 6 > > Signed-off-by: Nicolas Dichtel > --- > ip/ipaddress.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/ip/ipaddress.c b/ip/ipaddress.c > index 00da14c6f97c..c7c7e7df4e81 100644 > --- a/ip/ipaddress.c > +++ b/ip/ipaddress.c > @@ -964,6 +964,17 @@ int print_linkinfo(const struct sockaddr_nl *who, > } > } > > + if (tb[IFLA_NEW_NETNSID]) { > + int id = rta_getattr_u32(tb[IFLA_NEW_NETNSID]); > + > + print_int(PRINT_FP, NULL, " new-nsid %d", id); > + } > + if (tb[IFLA_NEW_IFINDEX]) { > + int id = rta_getattr_u32(tb[IFLA_NEW_IFINDEX]); > + > + print_int(PRINT_FP, NULL, " new-ifindex %d", id); > + } > + > if (tb[IFLA_PROTO_DOWN]) { > if (rta_getattr_u8(tb[IFLA_PROTO_DOWN])) > print_bool(PRINT_ANY, >