release 2.046004
This commit is contained in:
@@ -418,7 +418,7 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
|
||||
|
||||
=cut
|
||||
|
||||
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) }
|
||||
sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
|
||||
|
||||
=head2 last_comment
|
||||
|
||||
|
||||
@@ -193,6 +193,6 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
|
||||
|
||||
=cut
|
||||
|
||||
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) }
|
||||
sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
|
||||
|
||||
1;
|
||||
|
||||
@@ -221,6 +221,6 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
|
||||
|
||||
=cut
|
||||
|
||||
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) }
|
||||
sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
|
||||
|
||||
1;
|
||||
|
||||
@@ -178,6 +178,6 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
|
||||
|
||||
=cut
|
||||
|
||||
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) }
|
||||
sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
|
||||
|
||||
1;
|
||||
|
||||
@@ -87,6 +87,6 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
|
||||
|
||||
=cut
|
||||
|
||||
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) }
|
||||
sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
|
||||
|
||||
1;
|
||||
|
||||
@@ -288,7 +288,7 @@ sub search_by_field {
|
||||
}
|
||||
|
||||
# get IEEE MAC format
|
||||
my $mac = NetAddr::MAC->new(mac => $p->{mac});
|
||||
my $mac = NetAddr::MAC->new(mac => ($p->{mac} || ''));
|
||||
undef $mac if
|
||||
($mac and $mac->as_ieee
|
||||
and (($mac->as_ieee eq '00:00:00:00:00:00')
|
||||
@@ -401,7 +401,7 @@ sub search_fuzzy {
|
||||
}
|
||||
|
||||
# get IEEE MAC format
|
||||
my $mac = NetAddr::MAC->new(mac => $q);
|
||||
my $mac = NetAddr::MAC->new(mac => ($q || ''));
|
||||
undef $mac if
|
||||
($mac and $mac->as_ieee
|
||||
and (($mac->as_ieee eq '00:00:00:00:00:00')
|
||||
|
||||
@@ -68,7 +68,7 @@ sub check_mac {
|
||||
my ($node, $device, $port_macs) = @_;
|
||||
return 0 if !$node;
|
||||
|
||||
my $mac = NetAddr::MAC->new(mac => $node);
|
||||
my $mac = NetAddr::MAC->new(mac => ($node || ''));
|
||||
my $devip = ($device ? (ref $device ? $device->ip : $device) : '');
|
||||
$port_macs ||= {};
|
||||
|
||||
@@ -168,7 +168,7 @@ sub store_arp {
|
||||
my ($hash_ref, $now) = @_;
|
||||
$now ||= 'now()';
|
||||
my $ip = $hash_ref->{'ip'};
|
||||
my $mac = NetAddr::MAC->new(mac => $hash_ref->{'node'});
|
||||
my $mac = NetAddr::MAC->new(mac => ($hash_ref->{'node'} || ''));
|
||||
my $name = $hash_ref->{'dns'};
|
||||
|
||||
return if !defined $mac or $mac->errstr;
|
||||
|
||||
@@ -69,7 +69,7 @@ get '/ajax/content/search/node' => require_login sub {
|
||||
my $agenot = param('age_invert') || '0';
|
||||
my ( $start, $end ) = param('daterange') =~ m/(\d+-\d+-\d+)/gmx;
|
||||
|
||||
my $mac = NetAddr::MAC->new(mac => $node);
|
||||
my $mac = NetAddr::MAC->new(mac => ($node || ''));
|
||||
undef $mac if
|
||||
($mac and $mac->as_ieee
|
||||
and (($mac->as_ieee eq '00:00:00:00:00:00')
|
||||
|
||||
@@ -60,7 +60,7 @@ get '/ajax/content/search/port' => require_login sub {
|
||||
}
|
||||
else {
|
||||
my ( $likeval, $likeclause ) = sql_match($q);
|
||||
my $mac = NetAddr::MAC->new(mac => $q);
|
||||
my $mac = NetAddr::MAC->new(mac => ($q || ''));
|
||||
|
||||
undef $mac if
|
||||
($mac and $mac->as_ieee
|
||||
|
||||
@@ -38,7 +38,7 @@ get '/search' => require_login sub {
|
||||
else {
|
||||
my $nd = $s->resultset('Device')->search_fuzzy($q);
|
||||
my ($likeval, $likeclause) = sql_match($q);
|
||||
my $mac = NetAddr::MAC->new(mac => $q);
|
||||
my $mac = NetAddr::MAC->new(mac => ($q || ''));
|
||||
|
||||
undef $mac if
|
||||
($mac and $mac->as_ieee
|
||||
|
||||
@@ -203,7 +203,7 @@ sub store_neighbors {
|
||||
}
|
||||
|
||||
if (!defined $neigh) {
|
||||
my $mac = NetAddr::MAC->new(mac => $remote_id);
|
||||
my $mac = NetAddr::MAC->new(mac => ($remote_id || ''));
|
||||
if ($mac and not $mac->errstr) {
|
||||
$neigh = $devices->single({mac => $mac->as_ieee});
|
||||
}
|
||||
@@ -214,7 +214,7 @@ sub store_neighbors {
|
||||
# "myswitchname(012345-012345)"
|
||||
if (!defined $neigh) {
|
||||
(my $tmpid = $remote_id) =~ s/.*\(([0-9a-f]{6})-([0-9a-f]{6})\).*/$1$2/;
|
||||
my $mac = NetAddr::MAC->new(mac => $tmpid);
|
||||
my $mac = NetAddr::MAC->new(mac => ($tmpid || ''));
|
||||
if ($mac and not $mac->errstr) {
|
||||
debug sprintf
|
||||
' [%s] neigh - trying to find neighbor %s by MAC %s',
|
||||
|
||||
Reference in New Issue
Block a user