Re: Bugreport: macvlan device choosing wrong parent device



Hi Beniamino,

On Wed, Sep 27, 2017 at 10:56:30AM +0200, Beniamino Galvani wrote:
On Tue, Sep 26, 2017 at 04:04:38PM +0200, Ulrich Ölmann wrote:
I applied your patch and NetworkManager avoids the unmanaged device eth0 to
instead create the virtual MAC VLAN device on top of eth1 now. Great! :-)
Looking into the journal, however, I still see a warning saying

    manager: (link-local) can't register the device with manager: A device with ifindex 10 already exists

Do we have to expect any side-effects because of this?

This is a bug, however it should be harmless. I'll post some patches
to fix this.

your patches look good to me and applying them results in NM doing the right
thing again. Thanks!

However, if I modify my setup a little bit by _not_ explicitely declaring eth0
to be unmanaged in NetworkManager.conf NM now avoids to touch eth0 as it has
already been configured outside (remeber: I use eth0 for NFS root). Starting NM
with both connections being present it brings up "routable" on eth1 and creates
the new MAC VLAN device link-local now on top of eth0. This is what I would
expect and what I actually want NM to do. Unfortunately it does not start the
connection "link-local" on link-local:

    root@host:~ nmcli
    eth0: connected to eth0
            "eth0"
            ethernet (pch_gbe), 00:13:95:0A:4B:30, hw, mtu 1500
            ip4 default
            inet4 192.168.24.227/16
            inet6 fe80::213:95ff:fe0a:4b30/64
            route6 ff00::/8

    eth1: connected to routable
            "NETGEAR FA120 Adapter"
            ethernet (asix), 00:09:5B:BE:62:71, hw, mtu 1500
            inet4 192.168.24.156/16
            inet6 fe80::209:5bff:febe:6271/64
            route6 ff00::/8

    link-local: disconnected
            "link-local"
            macvlan, sw, mtu 1500

    [...]

The journal now tells me:

    device (eth0): link connected
    manager: (eth0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
    manager: (link-local): new Macvlan device (/org/freedesktop/NetworkManager/Devices/3)
    keyfile: add connection in-memory (132747e6-f1f1-46f3-89d4-aef150234a5d,"eth0")
    device (eth0): state change: unmanaged -> unavailable (reason 'connection-assumed', internal state 
'external')
    device (eth0): state change: unavailable -> disconnected (reason 'connection-assumed', internal state 
'external')
    device (eth0): Activation: starting connection 'eth0' (132747e6-f1f1-46f3-89d4-aef150234a5d)
    device (eth1): link connected
    manager: (eth1): new Ethernet device (/org/freedesktop/NetworkManager/Devices/4)
    device (eth1): state change: unmanaged -> unavailable (reason 'managed', internal state 'external')
    manager: (sit0): new IPTunnel device (/org/freedesktop/NetworkManager/Devices/5)
--> manager: (link-local) can't register the device with manager: A device with ifindex 8 already exists
    device (eth0): state change: disconnected -> prepare (reason 'none', internal state 'external')
    device (link-local): state change: unmanaged -> unavailable (reason 'managed', internal state 'external')
    device (link-local): link connected
    device (eth0): state change: prepare -> config (reason 'none', internal state 'external')
    device (eth1): state change: unavailable -> disconnected (reason 'none', internal state 'managed')
    device (eth0): state change: config -> ip-config (reason 'none', internal state 'external')
    policy: auto-activating connection 'routable'
    device (link-local): state change: unavailable -> disconnected (reason 'none', internal state 'managed')
    device (eth0): state change: ip-config -> ip-check (reason 'none', internal state 'external')
    device (eth1): Activation: starting connection 'routable' (7ac61f21-bf59-4c4c-ae38-51ce131b2afc)
    device (eth0): state change: ip-check -> secondaries (reason 'none', internal state 'external')
    device (eth1): state change: disconnected -> prepare (reason 'none', internal state 'managed')
    manager: NetworkManager state is now CONNECTING
    device (eth0): state change: secondaries -> activated (reason 'none', internal state 'external')
    manager: NetworkManager state is now CONNECTED_SITE
    policy: set 'eth0' (eth0) as default for IPv4 routing and DNS
    device (eth0): Activation: successful, device activated.
    device (eth1): state change: prepare -> config (reason 'none', internal state 'managed')
    device (eth1): state change: config -> ip-config (reason 'none', internal state 'managed')
    dhcp4 (eth1): activation: beginning transaction (timeout in 45 seconds)
    dhcp4 (eth1):   address 192.168.24.156
    [...]
    dhcp4 (eth1): state changed unknown -> bound
    device (eth1): state change: ip-config -> ip-check (reason 'none', internal state 'managed')
    device (eth1): state change: ip-check -> secondaries (reason 'none', internal state 'managed')
    device (eth1): state change: secondaries -> activated (reason 'none', internal state 'managed')
    [...]
    device (eth1): Activation: successful, device activated.
    manager: startup complete

This is expected behaviour now, right? (Because of connection "link-local" using
a UUID inside its parent property and this UUID being found in a connection that
has been applied to a different device than what link-local's actual parent is?)
Again explicitely using "parent=eth0" gives me what I want.

Best regards
Ulrich
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]