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