release 2.046004

This commit is contained in:
Oliver Gorwits
2020-10-17 14:28:53 +01:00
parent 64d65c72ee
commit 2b72233738
15 changed files with 25 additions and 19 deletions

View File

@@ -1,3 +1,9 @@
2.046004 - 2020-10-17
[ENHANCEMENTS]
* #748 even safer calls to NetAddr::MAC->new()
2.046003 - 2020-10-17 2.046003 - 2020-10-17
[NEW FEATURES] [NEW FEATURES]

View File

@@ -128,7 +128,7 @@
"provides" : { "provides" : {
"App::Netdisco" : { "App::Netdisco" : {
"file" : "lib/App/Netdisco.pm", "file" : "lib/App/Netdisco.pm",
"version" : "2.046003" "version" : "2.046004"
}, },
"App::Netdisco::AnyEvent::Nbtstat" : { "App::Netdisco::AnyEvent::Nbtstat" : {
"file" : "lib/App/Netdisco/AnyEvent/Nbtstat.pm" "file" : "lib/App/Netdisco/AnyEvent/Nbtstat.pm"
@@ -840,6 +840,6 @@
"x_IRC" : "irc://irc.freenode.org/#netdisco", "x_IRC" : "irc://irc.freenode.org/#netdisco",
"x_MailingList" : "https://lists.sourceforge.net/lists/listinfo/netdisco-users" "x_MailingList" : "https://lists.sourceforge.net/lists/listinfo/netdisco-users"
}, },
"version" : "2.046003", "version" : "2.046004",
"x_serialization_backend" : "JSON::PP version 2.97001" "x_serialization_backend" : "JSON::PP version 2.97001"
} }

View File

@@ -23,7 +23,7 @@ name: App-Netdisco
provides: provides:
App::Netdisco: App::Netdisco:
file: lib/App/Netdisco.pm file: lib/App/Netdisco.pm
version: '2.046003' version: '2.046004'
App::Netdisco::AnyEvent::Nbtstat: App::Netdisco::AnyEvent::Nbtstat:
file: lib/App/Netdisco/AnyEvent/Nbtstat.pm file: lib/App/Netdisco/AnyEvent/Nbtstat.pm
App::Netdisco::Backend::Job: App::Netdisco::Backend::Job:
@@ -579,5 +579,5 @@ resources:
homepage: http://netdisco.org/ homepage: http://netdisco.org/
license: http://opensource.org/licenses/BSD-3-Clause license: http://opensource.org/licenses/BSD-3-Clause
repository: https://github.com/netdisco/netdisco repository: https://github.com/netdisco/netdisco
version: '2.046003' version: '2.046004'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018' x_serialization_backend: 'CPAN::Meta::YAML version 0.018'

View File

@@ -4,7 +4,7 @@ use strict;
use warnings; use warnings;
use 5.010_000; use 5.010_000;
our $VERSION = '2.046003'; our $VERSION = '2.046004';
use App::Netdisco::Configuration; use App::Netdisco::Configuration;
=head1 NAME =head1 NAME

View File

@@ -418,7 +418,7 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
=cut =cut
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) } sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
=head2 last_comment =head2 last_comment

View File

@@ -193,6 +193,6 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
=cut =cut
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) } sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
1; 1;

View File

@@ -221,6 +221,6 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
=cut =cut
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) } sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
1; 1;

View File

@@ -178,6 +178,6 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
=cut =cut
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) } sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
1; 1;

View File

@@ -87,6 +87,6 @@ Returns the C<mac> column instantiated into a L<NetAddr::MAC> object.
=cut =cut
sub net_mac { return NetAddr::MAC->new(mac => (shift)->mac) } sub net_mac { return NetAddr::MAC->new(mac => ((shift)->mac) || '') }
1; 1;

View File

@@ -288,7 +288,7 @@ sub search_by_field {
} }
# get IEEE MAC format # get IEEE MAC format
my $mac = NetAddr::MAC->new(mac => $p->{mac}); my $mac = NetAddr::MAC->new(mac => ($p->{mac} || ''));
undef $mac if undef $mac if
($mac and $mac->as_ieee ($mac and $mac->as_ieee
and (($mac->as_ieee eq '00:00:00:00:00:00') and (($mac->as_ieee eq '00:00:00:00:00:00')
@@ -401,7 +401,7 @@ sub search_fuzzy {
} }
# get IEEE MAC format # get IEEE MAC format
my $mac = NetAddr::MAC->new(mac => $q); my $mac = NetAddr::MAC->new(mac => ($q || ''));
undef $mac if undef $mac if
($mac and $mac->as_ieee ($mac and $mac->as_ieee
and (($mac->as_ieee eq '00:00:00:00:00:00') and (($mac->as_ieee eq '00:00:00:00:00:00')

View File

@@ -68,7 +68,7 @@ sub check_mac {
my ($node, $device, $port_macs) = @_; my ($node, $device, $port_macs) = @_;
return 0 if !$node; 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) : ''); my $devip = ($device ? (ref $device ? $device->ip : $device) : '');
$port_macs ||= {}; $port_macs ||= {};
@@ -168,7 +168,7 @@ sub store_arp {
my ($hash_ref, $now) = @_; my ($hash_ref, $now) = @_;
$now ||= 'now()'; $now ||= 'now()';
my $ip = $hash_ref->{'ip'}; 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'}; my $name = $hash_ref->{'dns'};
return if !defined $mac or $mac->errstr; return if !defined $mac or $mac->errstr;

View File

@@ -69,7 +69,7 @@ get '/ajax/content/search/node' => require_login sub {
my $agenot = param('age_invert') || '0'; my $agenot = param('age_invert') || '0';
my ( $start, $end ) = param('daterange') =~ m/(\d+-\d+-\d+)/gmx; 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 undef $mac if
($mac and $mac->as_ieee ($mac and $mac->as_ieee
and (($mac->as_ieee eq '00:00:00:00:00:00') and (($mac->as_ieee eq '00:00:00:00:00:00')

View File

@@ -60,7 +60,7 @@ get '/ajax/content/search/port' => require_login sub {
} }
else { else {
my ( $likeval, $likeclause ) = sql_match($q); my ( $likeval, $likeclause ) = sql_match($q);
my $mac = NetAddr::MAC->new(mac => $q); my $mac = NetAddr::MAC->new(mac => ($q || ''));
undef $mac if undef $mac if
($mac and $mac->as_ieee ($mac and $mac->as_ieee

View File

@@ -38,7 +38,7 @@ get '/search' => require_login sub {
else { else {
my $nd = $s->resultset('Device')->search_fuzzy($q); my $nd = $s->resultset('Device')->search_fuzzy($q);
my ($likeval, $likeclause) = sql_match($q); my ($likeval, $likeclause) = sql_match($q);
my $mac = NetAddr::MAC->new(mac => $q); my $mac = NetAddr::MAC->new(mac => ($q || ''));
undef $mac if undef $mac if
($mac and $mac->as_ieee ($mac and $mac->as_ieee

View File

@@ -203,7 +203,7 @@ sub store_neighbors {
} }
if (!defined $neigh) { 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) { if ($mac and not $mac->errstr) {
$neigh = $devices->single({mac => $mac->as_ieee}); $neigh = $devices->single({mac => $mac->as_ieee});
} }
@@ -214,7 +214,7 @@ sub store_neighbors {
# "myswitchname(012345-012345)" # "myswitchname(012345-012345)"
if (!defined $neigh) { if (!defined $neigh) {
(my $tmpid = $remote_id) =~ s/.*\(([0-9a-f]{6})-([0-9a-f]{6})\).*/$1$2/; (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) { if ($mac and not $mac->errstr) {
debug sprintf debug sprintf
' [%s] neigh - trying to find neighbor %s by MAC %s', ' [%s] neigh - trying to find neighbor %s by MAC %s',