2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-24 15:05:36 +00:00

bug fix in switchdiscover

This commit is contained in:
linggao
2015-06-02 16:34:35 -04:00
parent 6bcca682a3
commit 4751f4746f

View File

@ -206,7 +206,7 @@ sub parse_args {
$globalopt{range} = $opt{range};
my @ips = split /,/, $opt{range};
foreach my $ip (@ips) {
if (($ip =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) ||
if (($ip =~ /^(\d{1,3})(-\d{1,3})?\.(\d{1,3})(-\d{1,3})?\.(\d{1,3})(-\d{1,3})?\.(\d{1,3})(-\d{1,3})?$/) ||
($ip =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d+)$/)) {
push @iprange, $ip;
} else {
@ -517,6 +517,7 @@ sub lldp_scan {
$match = 1;
last;
}
#TODO: handles the case where the range is something like 10.2-3.4.5-6
}
}
if (!$match) {