protect against undef mac (l.e. ferguson)

This commit is contained in:
Oliver Gorwits
2018-04-08 00:09:46 +01:00
parent 97d5501ba0
commit 8e30dec24f

View File

@@ -65,6 +65,8 @@ MAC address does not belong to an interface on any known Device
sub check_mac { sub check_mac {
my ($device, $node, $port_macs) = @_; my ($device, $node, $port_macs) = @_;
return 0 if !$device or !$node;
my $mac = NetAddr::MAC->new(mac => $node); my $mac = NetAddr::MAC->new(mac => $node);
my $devip = (ref $device ? $device->ip : ''); my $devip = (ref $device ? $device->ip : '');
$port_macs ||= {}; $port_macs ||= {};