udev: introduce NAMING_STABLE_VIRTUAL_MACS (retroactively)

This is for 6d36464065. It turns out that this is causing more problems than
expected. Let's retroactively introduce naming scheme v241 to conditionalize
this change.

Follow-up for #12792 and 6d36464065. See also
https://bugzilla.suse.com/show_bug.cgi?id=1136600.

$ SYSTEMD_LOG_LEVEL=debug NET_NAMING_SCHEME=v240 build/udevadm test-builtin net_setup_link /sys/class/net/br11
$ SYSTEMD_LOG_LEVEL=debug NET_NAMING_SCHEME=v241 build/udevadm test-builtin net_setup_link /sys/class/net/br11
...
@@ -20,11 +20,13 @@
 link_config: could not set ethtool features for br11
 Could not set offload features of br11: Operation not permitted
 br11: Device has name_assign_type=3
-Using interface naming scheme 'v240'.
+Using interface naming scheme 'v241'.
 br11: Policy *keep*: keeping existing userspace name
 br11: Device has addr_assign_type=1
-br11: No stable identifying information found
-br11: Could not generate persistent MAC: No data available
+br11: Using "br11" as stable identifying information
+br11: Using generated persistent MAC address
+Could not set Alias=, MACAddress= or MTU= on br11: Operation not permitted
+br11: Could not apply link config, ignoring: Operation not permitted
 Unload module index
 Unloaded link configuration context.
 ID_NET_DRIVER=bridge
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-06-17 13:43:18 +02:00
parent b889a0ded8
commit 96848152fa
7 changed files with 29 additions and 8 deletions
+15
View File
@@ -305,6 +305,21 @@
for a description of <varname>NamePolicy=</varname>.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>v241</constant></term>
<listitem><para><option>MACAddressPolicy=persistent</option> was extended to set MAC addresses
based on the device name. Previously addresses were only based on the
<varname noindex='true'>ID_NET_NAME_*</varname> attributes, which meant that interface names would
never be generated for virtual devices. Now a persistent address will be generated for most
devices, including in particular bridges.</para>
<para>Note: when userspace does not set a MAC address for a bridge device, the kernel will
initially assign a random address, and then change it when the first device is enslaved to the
bridge. With this naming policy change, bridges get a persistent MAC address based on the bridge
name instead of the first enslaved device.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>v243</constant></term>