|
|
|
|
279
|
* length is an exact multiple of the blocksize will have a
|
279
|
* length is an exact multiple of the blocksize will have a
|
280
|
* trailing zero-length block, which must be included.
|
280
|
* trailing zero-length block, which must be included.
|
281
|
*/
|
281
|
*/
|
|
|
282
|
+ if ( tftp->blksize == 0 )
|
|
|
283
|
+ return -EINVAL;
|
282
|
num_blocks = ( ( filesize / tftp->blksize ) + 1 );
|
284
|
num_blocks = ( ( filesize / tftp->blksize ) + 1 );
|
283
|
if ( ( rc = bitmap_resize ( &tftp->bitmap, num_blocks ) ) != 0 ) {
|
285
|
if ( ( rc = bitmap_resize ( &tftp->bitmap, num_blocks ) ) != 0 ) {
|
284
|
DBGC ( tftp, "TFTP %p could not resize bitmap to %d blocks: "
|
286
|
DBGC ( tftp, "TFTP %p could not resize bitmap to %d blocks: "
|