]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg-quick: linux: deal with resolvconf migration more gracefully
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 23 May 2025 18:59:38 +0000 (20:59 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 23 May 2025 19:01:53 +0000 (21:01 +0200)
When Ubuntu systems upgrade from Debian's atrocious resolvconf to the
systemd-resolve symlink, they sometimes leave around
/etc/resolvconf/interface-order, which then winds up breaking the
detection and passing the bogus 'tun.' prefix to systemd's resolvconf,
resulting in failure. Work around this by only doing the 'tun.' prefix
hack if resolvconf isn't a symlink. This is ugly but so it goes.

Reported-by: Andrei Borzenkov <arvidjaar@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/wg-quick/linux.bash

index f56f6e4a53091d2ddc382379c71792ec93c884b3..af255af928d21f61fc1bd03db9c3484630da2e02 100755 (executable)
@@ -143,7 +143,7 @@ set_mtu_up() {
 }
 
 resolvconf_iface_prefix() {
-       [[ -f /etc/resolvconf/interface-order ]] || return 0
+       [[ -f /etc/resolvconf/interface-order && ! -L $(type -P resolvconf) ]] || return 0
        local iface
        while read -r iface; do
                [[ $iface =~ ^([A-Za-z0-9-]+)\*$ ]] || continue