Do not add empty $config['mydomain'] when autodiscovering

When \$config['mydomain'] variable is empty, '.' is appended to
the device hostname. This patch adds a check to prevent that."
This commit is contained in:
Tuomas Riihimäki
2015-01-23 18:49:19 +02:00
parent f114d557f2
commit ec802efd3b

View File

@ -16,7 +16,7 @@ function discover_new_device($hostname)
global $config, $debug;
if ($config['autodiscovery']['xdp']) {
if ( isDomainResolves($hostname . "." . $config['mydomain']) ) {
if (!empty($config['mydomain']) && isDomainResolves($hostname . "." . $config['mydomain']) ) {
$dst_host = $hostname . "." . $config['mydomain'];
} else {
$dst_host = $hostname;