All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
	Ulrich Gemkow <ulrich.gemkow@ikr.uni-stuttgart.de>,
	netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: displayed name changed in ip link show for bridge- and other interfaces
Date: Mon, 15 Jun 2015 11:13:12 +0200	[thread overview]
Message-ID: <557E9728.7080208@6wind.com> (raw)
In-Reply-To: <557E7D89.30301@6wind.com>

Le 15/06/2015 09:23, Nicolas Dichtel a écrit :
> Le 14/06/2015 21:12, Oliver Hartkopp a écrit :
>> @Nicolas: Just saw that you were not responsible for the @NONE m)
>>
>> Sorry.
>>
>> Btw. do you know why this @NONE stuff just emerged in 4.1-rc ?
> Yes, it comes from the iflink cleanup in kernel:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/net/core/dev.c?id=e1622baf54df8cc958bf29d71de5ad545ea7d93c
>
Theoretically, virtual interfaces should advertise an IFLA_LINK to 0.
I don't know what is the best fix:
  - patching iproute2 to avoid this '@NONE'
  - patching the kernel (see below).

As told in the commit log (see e1622baf54df) some other virtual interfaces
are also impacted.

---8<---

 From c9e1d93960365cc5005e1b6c3ad73a8e5687824c Mon Sep 17 00:00:00 2001
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Mon, 15 Jun 2015 10:52:16 +0200
Subject: [PATCH] bridge: don't set IFLA_LINK attribute for bridge ifaces

Since commit e1622baf54df ("dev: set iflink to 0 for virtual interfaces"),
this attribute is set for bridge interface. A side effect is that iproute2
now displays '@NONE' after the interface name, which may break existing
scripts:
13: br0@NONE: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT 
group default
     link/ether d2:b3:db:d6:d5:e1 brd ff:ff:ff:ff:ff:ff

To avoid that, let's set iflink to the interface ifindex.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
  net/bridge/br_device.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 4ff77a16956c..3576a257709c 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -314,6 +314,11 @@ static const struct ethtool_ops br_ethtool_ops = {
  	.get_link	= ethtool_op_get_link,
  };

+int br_get_iflink(const struct net_device *dev)
+{
+	return dev->ifindex;
+}
+
  static const struct net_device_ops br_netdev_ops = {
  	.ndo_open		 = br_dev_open,
  	.ndo_stop		 = br_dev_stop,
@@ -339,6 +344,7 @@ static const struct net_device_ops br_netdev_ops = {
  	.ndo_bridge_getlink	 = br_getlink,
  	.ndo_bridge_setlink	 = br_setlink,
  	.ndo_bridge_dellink	 = br_dellink,
+	.ndo_get_iflink		 = br_get_iflink,
  };

  static void br_dev_free(struct net_device *dev)
-- 
2.4.2

  reply	other threads:[~2015-06-15  9:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 10:00 displayed name changed in ip link show for bridge- and other interfaces Ulrich Gemkow
2015-06-14 18:50 ` Oliver Hartkopp
2015-06-14 19:12   ` Oliver Hartkopp
2015-06-15  7:23     ` Nicolas Dichtel
2015-06-15  9:13       ` Nicolas Dichtel [this message]
2015-06-15 15:54         ` Stephen Hemminger
2015-06-16 17:35           ` Oliver Hartkopp
2015-06-16 17:47             ` Oliver Hartkopp
2015-06-17  7:26             ` Nicolas Dichtel
2015-06-20 22:58               ` Oliver Hartkopp
2015-06-23 12:48                 ` Nicolas Dichtel
2015-06-23 17:21                   ` Oliver Hartkopp
2015-07-06 15:25                     ` [PATCH net] Revert "dev: set iflink to 0 for virtual interfaces" Nicolas Dichtel
2015-07-06 16:38                       ` Oliver Hartkopp
2015-07-07  7:44                         ` [PATCH net v2] " Nicolas Dichtel
2015-07-08 22:52                       ` [PATCH net] " David Miller

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=557E9728.7080208@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=stephen@networkplumber.org \
    --cc=ulrich.gemkow@ikr.uni-stuttgart.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.