diff --git a/lib/App/Netdisco/Util/Device.pm b/lib/App/Netdisco/Util/Device.pm index d14b7a7d..8707fde4 100644 --- a/lib/App/Netdisco/Util/Device.pm +++ b/lib/App/Netdisco/Util/Device.pm @@ -154,8 +154,9 @@ the local configuration to discover the device. The configuration items C and C are checked against the given IP. -If C<$device_type> is also given, then C will also be -checked. +If C<$device_type> is also given, then C will be checked. +Also respects C and C if either are set to +false. Returns false if the host is not permitted to discover the target device. @@ -165,9 +166,14 @@ sub is_discoverable { my ($ip, $remote_type) = @_; my $device = get_device($ip) or return 0; - if (match_to_setting($remote_type, 'discover_no_type')) { - return _bail_msg("is_discoverable: $device matched discover_no_type"); - } + return _bail_msg("is_discoverable: $device matches wap_platforms but discover_waps is not enabled") + if (match_to_setting($remote_type, 'wap_platforms') and not setting('discover_waps')); + + return _bail_msg("is_discoverable: $device matches phone_platforms but discover_phones is not enabled") + if (match_to_setting($remote_type, 'phone_platforms') and not setting('discover_phones')); + + return _bail_msg("is_discoverable: $device matched discover_no_type") + if (match_to_setting($remote_type, 'discover_no_type')); return _bail_msg("is_discoverable: $device matched discover_no") if check_acl_no($device, 'discover_no'); diff --git a/share/config.yml b/share/config.yml index be6950f2..24b31d66 100644 --- a/share/config.yml +++ b/share/config.yml @@ -229,9 +229,9 @@ devices_no: [] devices_only: [] discover_no: [] discover_only: [] -discover_no_type: - - '(?i)phone' - - '(?i)(?:wap|wireless)' +discover_no_type: [] +discover_waps: true +discover_phones: false discover_min_age: 0 macsuck_no: [] macsuck_only: []