systemd-networkd: ActivationPolicy ignored in VLANs

Bug #2000880 reported by Craig Howard
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Low
Unassigned
Kinetic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

The ActivationPolicy property in .network files is ignored for VLANs.

[Test Plan]

* On a Jammy machine with an interface named ens3, create the following configs:

$ cat > /etc/systemd/network/10-vlan18.netdev << EOF
[NetDev]
Name=vlan18
Kind=vlan

[VLAN]
Id=18
EOF

$ cat > /etc/systemd/network/20-vlan18.network << EOF
[Match]
Name=vlan18

[Network]
Address=10.10.1.1/24

[Link]
ActivationPolicy=manual
EOF

$ cat > /etc/systemd/network/30-ens3.network << EOF
[Match]
Name=ens3

[Network]
DHCP=ipv4
VLAN=vlan18
EOF

* Reboot the machine
* On an affected machine, the vlan18@ens3 interface will have a configured IP at boot, despite the ActivationPolicy=manual setting in /etc/systemd/network/20-vlan18.network. On a patched machine, the interface should not have a configured IP.

[Where problems could occur]

The patch adds a condition where a netdev is not yet ready to be created. Specifically, it makes sure stacked netdevs are not created before their underlying link is activated. If we saw any problems, it would be related to netdev creation.

[Original Description]

This has been fixed upstream, see

Upstream bug: https://github.com/systemd/systemd/issues/22593

Any chance of a backport of the fix to 22.04?

Fix: https://github.com/systemd/systemd-stable/pull/211

Related branches

Revision history for this message
Nick Rosbrook (enr0n) wrote :

I have confirmed this is present in Jammy. The fix is present in Kinetic and Lunar.

Changed in systemd (Ubuntu Kinetic):
status: New → Fix Released
Changed in systemd (Ubuntu):
status: New → Fix Released
Changed in systemd (Ubuntu Jammy):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Nick Rosbrook (enr0n) wrote :

This patch does not seem to work as expected in Jammy. The interface is just not created at all, rather than being created but left DOWN/not activated.

I'm not sure we will have time to investigate this further for this upcoming SRU since there are higher-priority issues.

Revision history for this message
Nick Rosbrook (enr0n) wrote :

It turns out the issue I was seeing was caused by a patch I was testing for bug 2003250. Without that, this patch works as expected.

Nick Rosbrook (enr0n)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Craig, or anyone else affected,

Accepted systemd into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/249.11-0ubuntu3.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Jammy):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Craig Howard (mrzx4l98d4tp89jab-ubuntu) wrote :

Thanks so much! I really appreciate the help here.

I can confirm that 249.11-0ubuntu3.8 fixes this bug. A VLAN with ActivationPolicy=manual now no longer comes up at boot, as expected, but can be brought up manually with networkctl.

tags: added: verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Nick Rosbrook (enr0n) wrote :

I also confirmed the fix using systemd 249.11-0ubuntu3.8 from jammy-proposed:

$ apt-cache policy systemd
systemd:
  Installed: 249.11-0ubuntu3.8
  Candidate: 249.11-0ubuntu3.8
  Version table:
 *** 249.11-0ubuntu3.8 500
        500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     249.11-0ubuntu3.7 500
        500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     249.11-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
$ cat /etc/systemd/network/10-vlan18.netdev
[NetDev]
Name=vlan18
Kind=vlan

[VLAN]
Id=18
$ cat /etc/systemd/network/20-vlan18.network
[Match]
Name=vlan18

[Network]
Address=10.10.1.1/24

[Link]
ActivationPolicy=manual
$ cat /etc/systemd/network/30-ens3.network
[Match]
Name=ens3

[Network]
DHCP=ipv4
VLAN=vlan18
$ ip a show vlan18
3: vlan18@ens3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 52:54:00:c6:8b:40 brd ff:ff:ff:ff:ff:ff

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/249.11-0ubuntu3.8)

All autopkgtests for the newly accepted systemd (249.11-0ubuntu3.8) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

linux-intel-iotg/5.15.0-1027.32 (amd64)
linux-lowlatency/5.15.0-68.75 (arm64, amd64)
systemd/249.11-0ubuntu3.8 (arm64, ppc64el)
openrazer/3.2.0+dfsg-3 (i386)
multipath-tools/0.8.8-1ubuntu1.22.04.1 (s390x)
netplan.io/0.105-0ubuntu2~22.04.1 (amd64)
fwupd/1.7.9-1~22.04.1 (armhf)
udisks2/2.9.4-1ubuntu2 (amd64)
zfs-linux/unknown (s390x)
dbus/1.12.20-2ubuntu4.1 (s390x)
linux-ibm/5.15.0-1027.30 (amd64)
samba/unknown (s390x)
tang/11-1 (arm64)
gvfs/1.48.2-0ubuntu1 (arm64)
php8.1/unknown (s390x)
linux-nvidia/5.15.0-1018.18 (amd64)
csync2/2.0-25-gc0faaf9-1 (s390x)
tinyssh/20190101-1ubuntu1 (s390x)
mosquitto/2.0.11-1ubuntu1 (amd64)
casync/2+20201210-1build1 (ppc64el)
linux-gke/5.15.0-1029.34 (arm64, amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Craig, or anyone else affected,

Accepted systemd into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/249.11-0ubuntu3.9 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-jammy
removed: verification-done-jammy
Revision history for this message
Nick Rosbrook (enr0n) wrote :

I re-confirmed the fix using systemd 249.11-0ubuntu3.9 from jammy-proposed:

$ apt-cache policy systemd
systemd:
  Installed: 249.11-0ubuntu3.9
  Candidate: 249.11-0ubuntu3.9
  Version table:
 *** 249.11-0ubuntu3.9 500
        500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     249.11-0ubuntu3.7 500
        500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     249.11-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
$ cat /etc/systemd/network/10-vlan18.netdev
[NetDev]
Name=vlan18
Kind=vlan

[VLAN]
Id=18
$ cat /etc/systemd/network/20-vlan18.network
[Match]
Name=vlan18

[Network]
Address=10.10.1.1/24

[Link]
ActivationPolicy=manual
$ cat /etc/systemd/network/30-ens3.network
[Match]
Name=ens3

[Network]
DHCP=ipv4
$ ip a show vlan18
3: vlan18@ens3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 52:54:00:c6:8b:40 brd ff:ff:ff:ff:ff:ff

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/249.11-0ubuntu3.9)

All autopkgtests for the newly accepted systemd (249.11-0ubuntu3.9) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

casync/2+20201210-1build1 (ppc64el)
dpdk/21.11.3-0ubuntu0.22.04.1 (arm64)
fwupd/1.7.9-1~22.04.1 (armhf)
init-system-helpers/unknown (s390x)
initramfs-tools/0.140ubuntu13.1 (amd64)
libsdl2/2.0.20+dfsg-2ubuntu1.22.04.1 (s390x)
libsoup3/3.0.7-0ubuntu1 (s390x)
libvirt/8.0.0-1ubuntu7.4 (s390x)
linux-lowlatency-hwe-5.19/5.19.0-1021.22~22.04.1 (amd64, arm64)
linux-nvidia/5.15.0-1018.18 (amd64)
mutter/42.5-0ubuntu1 (amd64)
netplan.io/0.105-0ubuntu2~22.04.3 (arm64, s390x)
network-manager/1.36.6-0ubuntu2 (s390x)
nextepc/unknown (s390x)
open-iscsi/2.1.5-1ubuntu1 (s390x)
openrazer/3.2.0+dfsg-3 (i386)
pdns-recursor/unknown (s390x)
postgresql-14/unknown (s390x)
pystemd/0.7.0-5build1 (s390x)
samba/unknown (s390x)
strongswan/unknown (s390x)
systemd/249.11-0ubuntu3.9 (s390x)
umockdev/0.17.7-1 (s390x)
zfs-linux/unknown (s390x)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 249.11-0ubuntu3.9

---------------
systemd (249.11-0ubuntu3.9) jammy; urgency=medium

  * udev: gracefully handle rename failures (LP: #2002445)
    Files:
    - debian/patches/lp2002445/core-device-ignore-failed-uevents.patch
    - debian/patches/lp2002445/sd-device-introduce-device_get_property_int.patch
    - debian/patches/lp2002445/sd-device-make-device_set_syspath-clear-sysname-and-sysnu.patch
    - debian/patches/lp2002445/udev-restore-syspath-and-properties-on-failure.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=a7ad4a9fc708500c61e3b8127f112d8c90049b2c

systemd (249.11-0ubuntu3.8) jammy; urgency=medium

  * network/dhcp4: accept local subnet routes from DHCP (LP: #2004478)
    File: debian/patches/lp2004478-network-dhcp4-accept-local-subnet-routes-from-DHCP.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=96928d5f45ebbfe682b47e842d63506fa0ac9583
  * udev: avoid NIC renaming race with kernel (LP: #2002445)
    Files:
    - debian/patches/lp2002445/sd-netlink-add-a-test-for-rtnl_set_link_name.patch
    - debian/patches/lp2002445/sd-netlink-do-not-swap-old-name-and-alternative-name.patch
    - debian/patches/lp2002445/sd-netlink-restore-altname-on-error-in-rtnl_set_link_name.patch
    - debian/patches/lp2002445/udev-attempt-device-rename-even-if-interface-is-up.patch
    - debian/patches/lp2002445/udev-net-allow-new-link-name-as-an-altname-before-renamin.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=20dc4d51a340669c26c446c23b5a84516e82ea74
  * network: create stacked netdevs after the underlying link is (LP: #2000880)
    File: debian/patches/lp2000880-network-create-stacked-netdevs-after-the-underlying-link-.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=ab620e709f3f62eda86af26fd66c00d6e5165a25
  * Enable /dev/sgx_vepc access for the group 'sgx' (LP: #2009502)
    File: debian/patches/lp2009502-Enable-dev-sgx_vepc-access-for-the-group-sgx.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=434480ae4059a16ccbde9613be0c26ff1983cc3a

 -- Nick Rosbrook <email address hidden> Mon, 20 Mar 2023 10:32:08 -0400

Changed in systemd (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.