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