Fix regexp for HP switches

This commit is contained in:
Max Kosmach
2016-02-23 10:58:01 +03:00
committed by Jeroen van Ingen
parent 31e4d20978
commit 447bb32f33

View File

@@ -760,9 +760,8 @@ sub store_neighbors {
# on default vlan for HP switches remote_ip looks like # on default vlan for HP switches remote_ip looks like
# "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) {
info sprintf info sprintf
'[%s] neigh - found neighbor %s by MAC %s', '[%s] neigh - found neighbor %s by MAC %s',