From 441ac5966162f2e26ec98f34a2791933fffe9e22 Mon Sep 17 00:00:00 2001 From: Ryan Gasik Date: Wed, 30 Oct 2019 09:03:58 -0700 Subject: [PATCH] Add check for is_arpnipable and is_macsuckable in Util::Device Checks to make sure the device is in storage when checking if L2/L3 is supported on the device. Fixes #669. --- lib/App/Netdisco/Util/Device.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/App/Netdisco/Util/Device.pm b/lib/App/Netdisco/Util/Device.pm index 6c31583a..1e306219 100644 --- a/lib/App/Netdisco/Util/Device.pm +++ b/lib/App/Netdisco/Util/Device.pm @@ -237,7 +237,7 @@ sub is_arpnipable { my $device = get_device($ip) or return 0; return _bail_msg("is_arpnipable: $device has no layer 3 capability") - unless $device->has_layer(3); + unless ($device->has_layer(3) || !$device->in_storage()); return _bail_msg("is_arpnipable: $device matched arpnip_no") if check_acl_no($device, 'arpnip_no'); @@ -288,9 +288,8 @@ Returns false if the host is not permitted to macsuck the target device. sub is_macsuckable { my $ip = shift; my $device = get_device($ip) or return 0; - return _bail_msg("is_macsuckable: $device has no layer 2 capability") - unless $device->has_layer(2); + unless ($device->has_layer(2) || !$device->in_storage()); return _bail_msg("is_macsuckable: $device matched macsuck_no") if check_acl_no($device, 'macsuck_no');