fix the use of uninitialized value message when the port number was listed but not defined. Also show a message denoting a bad configuration.

This commit is contained in:
Jordi Sanfeliu 2014-02-20 12:54:27 +01:00
parent 685519ef19
commit 227fd147aa
1 changed files with 4 additions and 0 deletions

View File

@ -269,6 +269,10 @@ EOF
if($g eq "port") {
for($n = 0; $n < $config{port}->{max} && $n < scalar(my @port_list = split(',', $config{port}->{list})); $n++) {
my $num = trim($port_list[$n]);
if(!$config{port}->{desc}->{$num}) {
logger("$myself: port number '$num' listed but not defined.");
next;
}
my $name = trim((split(',', $config{port}->{desc}->{$num}))[0]);
my $pcon = trim((split(',', $config{port}->{desc}->{$num}))[2]);
$gname = "_" . $g;