All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Subject: Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns
Date: Fri, 6 Dec 2013 12:05:43 -0800	[thread overview]
Message-ID: <20131206120543.0afaafb5@nehalam.linuxnetplumber.net> (raw)

This isn't a iproute2 bug, it is only reporting what the kernel tells it

Begin forwarded message:

Date: Fri, 6 Dec 2013 00:07:15 -0800
From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns


https://bugzilla.kernel.org/show_bug.cgi?id=66691

            Bug ID: 66691
           Summary: iproute2: macvlan: Wrong root device shown if in
                    different netns
           Product: Networking
           Version: 2.5
    Kernel Version: 3.10
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
          Assignee: shemminger@linux-foundation.org
          Reporter: helmut.schaa@googlemail.com
        Regression: No

In the root net namespace if have the following devices:

> ip link
[...]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
mode DEFAULT group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: gre0: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default 
    link/gre 0.0.0.0 brd 0.0.0.0
[...]

Let's add a macvlan on top of eth0:

> ip link
[...]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
mode DEFAULT group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: gre0: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default 
    link/gre 0.0.0.0 brd 0.0.0.0
[...]
17: mac0@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode
DEFAULT group default 
    link/ether 46:aa:b4:fb:44:a6 brd ff:ff:ff:ff:ff:ff

And now lets move it into its own net namespace and list the devices in the new
namespace.

> ip link set mac0 netns myns
> ip netns exec myns ip link
[...]
2: gre0: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default 
    link/gre 0.0.0.0 brd 0.0.0.0
[...]
17: mac0@gre0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN mode
DEFAULT group default 
    link/ether 46:aa:b4:fb:44:a6 brd ff:ff:ff:ff:ff:ff

mac0 shows gre0 as its base device which is not correct. However gre0 has the
same ifindex in the new namespace as eth0 in the root namespace and the ifindex
is used for finding the base device.

commit aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 "net: Make ifindex generation
per-net namespace" changed the ifindex generation to only be unique within a
namespace.

-- 
You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2013-12-06 20:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06 20:05 Stephen Hemminger [this message]
     [not found] ` <CAGXs5wXC+eTZD3sXD4zFtkpY8tcU14Kr6AiA9=kugHups_KCHA@mail.gmail.com>
2013-12-07  9:18   ` Fw: [Bug 66691] New: iproute2: macvlan: Wrong root device shown if in different netns Kevin Wilson
2013-12-09  8:02     ` Michal Kubecek
2013-12-16 10:38 ` Helmut Schaa
2013-12-16 10:41   ` Pavel Emelyanov
2013-12-16 10:47     ` Helmut Schaa
2013-12-16 11:01       ` Pavel Emelyanov

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=20131206120543.0afaafb5@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    /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.