From patchwork Thu May 31 14:28:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dichtel X-Patchwork-Id: 923394 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@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; dmarc=none (p=none dis=none) header.from=6wind.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40xVG03dgCz9s0W for ; Fri, 1 Jun 2018 00:29:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755329AbeEaO3J (ORCPT ); Thu, 31 May 2018 10:29:09 -0400 Received: from host.76.145.23.62.rev.coltfrance.com ([62.23.145.76]:37303 "EHLO proxy.6wind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755299AbeEaO3I (ORCPT ); Thu, 31 May 2018 10:29:08 -0400 Received: from bretzel.dev.6wind.com (unknown [10.16.0.19]) by proxy.6wind.com (Postfix) with ESMTPS id ABA9A183A8A; Thu, 31 May 2018 16:25:14 +0200 (CEST) Received: from dichtel by bretzel.dev.6wind.com with local (Exim 4.89) (envelope-from ) id 1fOOZQ-0000QM-6A; Thu, 31 May 2018 16:28:52 +0200 From: Nicolas Dichtel To: shemminger@vyatta.com Cc: netdev@vger.kernel.org, Nicolas Dichtel Subject: [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support Date: Thu, 31 May 2018 16:28:48 +0200 Message-Id: <20180531142848.377-1-nicolas.dichtel@6wind.com> X-Mailer: git-send-email 2.15.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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,