diff options
author | root <root@riffraff.tg14.gathering.org> | 2014-04-20 02:58:05 +0200 |
---|---|---|
committer | root <root@riffraff.tg14.gathering.org> | 2014-04-20 02:58:05 +0200 |
commit | 8f4ae8e5833f0d26be5fad5160ae6ee0479b0712 (patch) | |
tree | da5089e91fbe52fd7da57a1c431c9af64f6ac8af /clients/build-linknets.pl | |
parent | 37a3b5d6ed97367989aecc875f1db1e9eb0458df (diff) | |
parent | 19cd0064816a577b72577b9f21a5a946eb746f64 (diff) |
Merge branch 'master' of https://github.com/tech-server/tgmanage
Diffstat (limited to 'clients/build-linknets.pl')
-rwxr-xr-x | clients/build-linknets.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clients/build-linknets.pl b/clients/build-linknets.pl index b1cd74c..3dc5913 100755 --- a/clients/build-linknets.pl +++ b/clients/build-linknets.pl @@ -79,7 +79,7 @@ while (my $ref = $coregws->fetchrow_hashref) { # Find all LLDP neighbors. for my $neigh (values %$lldp) { - $lldpneigh{$sysname}{$neigh->{'lldpRemSysName'}} = 1; + $lldpneigh{lc($sysname)}{lc($neigh->{'lldpRemSysName'})} = 1; } } @@ -104,14 +104,14 @@ while (my ($sysname, $ipv6) = each %loop_ipv6) { # Now go through each linknet candidate, and see if we can find any # direct LLDP neighbors. my $qexist = $dbh->prepare('SELECT COUNT(*) AS cnt FROM linknets WHERE switch1=? AND switch2=?'); -$dbh->do('DELETE FROM linknets'); +#$dbh->do('DELETE FROM linknets'); while (my ($cidr, $devices) = each %map) { for (my $i = 0; $i < scalar @$devices; ++$i) { my $device_a = $devices->[$i]; for (my $j = $i + 1; $j < scalar @$devices; ++$j) { my $device_b = $devices->[$j]; next if $device_a->[0] eq $device_b->[0]; - next unless exists($lldpneigh{$device_a->[0]}{$device_b->[0]}); + next unless exists($lldpneigh{lc($device_a->[0])}{lc($device_b->[0])}); my $switch_a = $switch_id{$device_a->[0]}; my $switch_b = $switch_id{$device_b->[0]}; |