MACVLAN= in .nspawn file vs command line results in /sys/class/net showing host interfaces

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

 



I'm running Ubuntu bionic, with systemd 237, so I haven't filed a bug report, but I'm wondering if it rings any bells with anyone.. I've tried searching github issues, but my keywords either get too few or too many results to be useful.

I have machine with the following nspawn file:

--
[Network]
MACVLAN=laneth0

[Exec]
PrivateUsers=false
--

if I start it with systemctl start systemd-nspawn@name, all works as expected.

If I start manually with systemd-nspawn -M name -b, I seem to correctly get a new network namespace (ip link output in container is correct), but ls /sys/class/net shows the host's interfaces.

The difference turns out to be that starting with systemctl uses a default command line which includes --private-network; the MACVLAN= in the config file should imply this, but instead it seems I'm getting "half" a private network, with the namespace correctly set but /sys not.

Having a quick poke around, I suspect

https://github.com/systemd/systemd/commit/60f1ec13ed059e412c2a2ee4cc3093e2d520673c

may have 'accidentally' fixed this - it moves

       if (arg_private_network)
                arg_mount_settings |= MOUNT_APPLY_APIVFS_NETNS;

from parse_argv to verify_arguments which is called later - does that sound like a correct interpretation? This bug causes netplan to fail on Ubuntu as it rummages around in /sys/class/net ..

S.
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux