#512 fix regression in phone/wap discovery exclusion

This commit is contained in:
Oliver Gorwits
2019-03-03 12:26:50 +00:00
parent 2bae91f1b6
commit 09d29954d2
2 changed files with 14 additions and 8 deletions

View File

@@ -154,8 +154,9 @@ the local configuration to discover the device.
The configuration items C<discover_no> and C<discover_only> are checked The configuration items C<discover_no> and C<discover_only> are checked
against the given IP. against the given IP.
If C<$device_type> is also given, then C<discover_no_type> will also be If C<$device_type> is also given, then C<discover_no_type> will be checked.
checked. Also respects C<discover_phones> and C<discover_waps> if either are set to
false.
Returns false if the host is not permitted to discover the target device. 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 ($ip, $remote_type) = @_;
my $device = get_device($ip) or return 0; my $device = get_device($ip) or return 0;
if (match_to_setting($remote_type, 'discover_no_type')) { return _bail_msg("is_discoverable: $device matches wap_platforms but discover_waps is not enabled")
return _bail_msg("is_discoverable: $device matched discover_no_type"); 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") return _bail_msg("is_discoverable: $device matched discover_no")
if check_acl_no($device, 'discover_no'); if check_acl_no($device, 'discover_no');

View File

@@ -229,9 +229,9 @@ devices_no: []
devices_only: [] devices_only: []
discover_no: [] discover_no: []
discover_only: [] discover_only: []
discover_no_type: discover_no_type: []
- '(?i)phone' discover_waps: true
- '(?i)(?:wap|wireless)' discover_phones: false
discover_min_age: 0 discover_min_age: 0
macsuck_no: [] macsuck_no: []
macsuck_only: [] macsuck_only: []