1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-20 14:03:39 +03:00

resolvctl: only remove protocol after last dot when mangling ifname for resolvconf

ifname_resolvconf_mangle is supposed to remove protocol suffixes like .dhcp
from interface names. But this removed also valid parts of the ifname like
VLAN IDs, e.g. enp2s0u4.72.dhcp -> enp2s0u4 instead of enp2s0u4.72

After this change, everything behind the last dot is removed instead of the first.

(cherry picked from commit e8d0eb3915ac33cc0d3da87a836cee6e61645227)
This commit is contained in:
exploide 2022-08-10 17:35:21 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent a3348ba748
commit 1760559918

View File

@ -138,7 +138,7 @@ int ifname_resolvconf_mangle(const char *s) {
assert(s);
dot = strchr(s, '.');
dot = strrchr(s, '.');
if (dot) {
_cleanup_free_ char *iface = NULL;