Skip to content

Commit

Permalink
Skip unresolved OpenVPN alias DNS entries. Fixes #12984
Browse files Browse the repository at this point in the history
  • Loading branch information
vktg committed Mar 25, 2022
1 parent 65adb19 commit 4533e50
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/etc/inc/openvpn.inc
Expand Up @@ -2284,8 +2284,13 @@ function openvpn_gen_routes($value, $ipproto = "ipv4", $push = false, $iroute =
$recordtypes = array(DNS_AAAA);
$mask = "/128";
}
foreach (resolve_host_addresses($net, $recordtypes, false) as $net) {
$networks[] = $net . $mask;
$domips = resolve_host_addresses($net, $recordtypes, false);
if (!empty($domips)) {
foreach ($domips as $net) {
$networks[] = $net . $mask;
}
} else {
log_error(gettext("Failed to resolve {$net}. Skipping OpenVPN route entry."));
}
}
}
Expand Down

0 comments on commit 4533e50

Please sign in to comment.