Skip to content

Commit a6b3db7

Browse files
authored
Autodiscovery: bail early if allowed network list is empty (librenms#17601)
* Autodiscovery: bail early if allowed network list is empty * Apply fixes from StyleCI
1 parent c7111be commit a6b3db7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

includes/discovery/functions.inc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
function discover_new_device($hostname, $device, $method, $interface = null)
4343
{
4444
Log::debug("discovering $hostname\n");
45+
if (empty(Config::get('nets'))) {
46+
Log::debug("Allowed discovery network list is empty - skipping\n");
47+
48+
return false;
49+
}
4550

4651
if (IP::isValid($hostname)) {
4752
$ip = $hostname;

0 commit comments

Comments
 (0)