Skip to content

Commit

Permalink
resolvctl: only remove protocol after last dot when mangling ifname f…
Browse files Browse the repository at this point in the history
…or 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.
  • Loading branch information
exploide authored and poettering committed Aug 11, 2022
1 parent d784a8d commit e8d0eb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/resolve/resolvectl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit e8d0eb3

Please sign in to comment.