Assigned unused dev numbers

This commit is contained in:
Tom Eastep 2011-05-22 10:18:26 -07:00
parent db6091f101
commit 529e256856

View File

@ -620,12 +620,15 @@ sub validate_tc_device( ) {
$devnumber = hex_value( $number );
fatal_error "Invalid device NUMBER ($number)" unless defined $devnumber && $devnumber && $devnumber < 256;
fatal_error "Duplicate interface number ($number)" if defined $devnums[ $devnumber ];
$devnum = $devnumber if $devnumber > $devnum;
} else {
fatal_error "Missing interface NUMBER";
}
} elsif ( ( $devnumber = ++$devnum ) > 255 ) {
fatal_error "Attempting to assign a device number > 255";
} else {
1 while $devnums[++$devnum];
if ( ( $devnumber = $devnum ) > 255 ) {
fatal_error "Attempting to assign a device number > 255";
}
}
$devnums[ $devnumber ] = $device;