From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Bianconi Subject: Re: [PATCH net-next] veth: report NEWLINK event when moving the peer device in a new namespace Date: Fri, 31 Aug 2018 18:54:44 +0200 Message-ID: <20180831165444.GE6236@localhost.localdomain> References: <51722660f2ef860779e227541dab77046496f135.1535712096.git.lorenzo.bianconi@redhat.com> <1321a4ad-75c5-358f-3a5d-1ec1549a9474@gmail.com> <20180831161902.GD6236@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: davem@davemloft.net, netdev@vger.kernel.org To: David Ahern Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:33666 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727433AbeHaVDL (ORCPT ); Fri, 31 Aug 2018 17:03:11 -0400 Received: by mail-wm0-f68.google.com with SMTP id r1-v6so1640731wmh.0 for ; Fri, 31 Aug 2018 09:54:48 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: > On 8/31/18 10:19 AM, Lorenzo Bianconi wrote: > >> On 8/31/18 5:43 AM, Lorenzo Bianconi wrote: > >>> When moving a veth device to another namespace, userspace receives a > >>> RTM_DELLINK message indicating the device has been removed from current > >>> netns. However, the other peer does not receive a netlink event > >>> containing new values for IFLA_LINK_NETNSID and IFLA_LINK veth > >>> attributes. > >>> Fix that behaviour sending to userspace a RTM_NEWLINK message in the peer > >>> namespace to report new IFLA_LINK_NETNSID/IFLA_LINK values > >>> > >> > >> A newlink message is generated in the new namespace. What information is > >> missing from that message? > >> > > > > Hi David, > > > > let's assume we have two veth paired devices (veth0 and veth1) on inet > > namespace. When moving a veth1 to another namespace, userspace is notified > > with RTM_DELLINK event on inet namespace to indicate that veth1 has been > > moved to another namespace. However some userspace applications > > (e.g. NetworkManager), listening for events on inet namespace, are interested > > in veth1 ifindex in the new namespace. This patch sends a new RTM_NEWLINK event > > in inet namespace to provide new values for IFLA_LINK_NETNSID/IFLA_LINK > > This is in init namespace > $ ip li set veth2 netns foo > > $ ip monitor > Deleted 20: veth2@veth1: mtu 1500 qdisc > noop state DOWN group default > link/ether c6:d0:d6:c5:23:7d brd ff:ff:ff:ff:ff:ff new-netns foo > new-ifindex 20 > > It shows the new namespace in the delete message. Ops, I have not noticed this info has been already introduced in the commit 38e01b30563a ("dev: advertise the new ifindex when the netns iface changes"). Thanks for the hint. DaveM please drop this patch. Regards, Lorenzo