apply upstream fixes

This commit is contained in:
Trevor Cooper 2023-08-21 19:27:56 -07:00
parent 072fc78d73
commit daea3a6985
Signed by: tcooper
GPG Key ID: 52364D7BBCEB35B8

View File

@ -56,14 +56,12 @@ sub setup_tap_static {
} }
sub get_host_dns { sub get_host_dns {
# get DNS server addresses from the host # get DNS server addresses from the host. Assumes host uses
my @forwards; # systemd-resolved and doesn't use IPv6, for now
open(FH, '<', "/etc/resolv.conf"); my $result = `/usr/bin/resolvectl status | grep Servers | tail -1 | cut -d: -f2-`;
while (<FH>) { # FIXME this is gonna break when we have IPv6 DNS servers on the
if ($_ =~ m/^nameserver +(.+)/) { # worker hosts
push @forwards, $1; my @forwards = split(' ', $result);
}
}
return @forwards; return @forwards;
} }