]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev-builtin-net_id: fix construction of USB specifier-based names
authorJeremy Kerr <jk@codeconstruct.com.au>
Tue, 9 Dec 2025 13:22:55 +0000 (22:22 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 9 Dec 2025 15:24:01 +0000 (00:24 +0900)
commitb10b4303c6332e6432debb6664bc30ceddbe70f1
tree0ebecea5eb3c306510bdf8e9e5a0e07d0ed0f445
parentaf80c9c22459b5051072e5b81cd7db7f4ca4290e
udev-builtin-net_id: fix construction of USB specifier-based names

Commit 0bac1ed242 ("tree-wide: Fix constness issues with newer glibc")
split a temporary var in get_usb_specifier to const and non-const
versions, but missed converting a couple of uses. This means we get
names of with components of:

 port: uN
 config: cC.I
 interface: iC.I

instead of:

 port: uN
 config: cC
 interface: iI

This results in net names like enu1c1.0i1.0, as we also no longer hit
the config==1 and interf==0 elision cases.

Change the config portion handling to start from the correct position,
and the earlier check for NULL.
src/udev/udev-builtin-net_id.c