Bug#941636: udev: 73-usb-net-by-mac.rules breaks systemd.link(5) network interface renaming for usb network adapters

Benjamin Poirier benjamin.poirier at gmail.com
Thu Oct 3 09:17:54 BST 2019


Package: udev
Version: 243-2
Severity: normal

/lib/udev/rules.d/73-usb-net-by-mac.rules prevents the renaming of network
interfaces from usb adapters using the systemd.link(5) mechanism.

The latter is implemented using /lib/udev/rules.d/80-net-setup-link.rules
which is ineffective because 73-usb-net-by-mac.rules has previously
unconditionally set a name (based on the mac address).

For example
	ben at f3:~$ cat /etc/systemd/network/10-dock.link
	[Match]
	MACAddress=3c:e1:a1:01:02:03

	[Link]
	Name=dock
does not work (with the related interface being a usb adapter).

I believe that /lib/udev/rules.d/73-usb-net-by-mac.rules should be removed. In
fact, the same functionality can be provided by the systemd.link mechanism
while also allowing users to override the default rule. I tested this by
setting up
	/etc/udev/rules.d/73-usb-net-by-mac.rules -> /dev/null
and adding
	ben at f3:~$ cat /etc/systemd/network/73-usb-net-by-mac.link
	[Match]
	Path=*-usb-*

	[Link]
	NamePolicy=mac

(Ideally the match would be done using something like Type= but DEVTYPE is not
an attribute of the network device. Matching on the ID_BUS udev attribute
would work but is not supported by net_setup_link I think.)

This still used a name based on the mac address by default (instead of based
on the slot) and also allowed me to change the name by adding a file like the
10-dock.link example above.

-- Package-specific info:

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.2.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages udev depends on:
ii  adduser       3.118
ii  dpkg          1.19.7
ii  libacl1       2.2.53-5
ii  libblkid1     2.34-0.1
ii  libc6         2.29-2
ii  libkmod2      26-3
ii  libselinux1   2.9-2+b2
ii  libudev1      243-2
ii  systemd-sysv  242-7
ii  util-linux    2.34-0.1

udev recommends no packages.

udev suggests no packages.

Versions of packages udev is related to:
ii  systemd  242-7

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list