[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inetutils-1.3.2 tftp file limit 16MB
From: |
Alain Magloire |
Subject: |
Re: inetutils-1.3.2 tftp file limit 16MB |
Date: |
Tue, 18 Dec 2001 09:53:53 -0500 (EST) |
>
> GNU tftp and/or tftpd has a 16 Mega Byte limit on file transfers, as
> demonstrated by a transfer with the following options
>
> > tftp HOSTNAME
> > bin
> > verbose
> > trace
> > get BIGFILE
> [...]
> received DATA <block=32767, 512 bytes>
> sent ACK <block=32767>
> received DATA <block=-32768, 512 bytes>
> sent ACK <block=32767>
> received DATA <block=-32768, 512 bytes>
> received DATA <block=-32768, 512 bytes>
> sent ACK <block=32767>
> sent ACK <block=32767>
> sent ACK <block=32767>
> Transfer timed out.
>
> tftp>
>
> I believe that changing the data type for tu_block to unsigned short would
> raise the limit to 32M
>
> [inetutils-1.3.2/include/arpa/tftp.h]
> struct tftphdr {
> short th_opcode; /* packet type */
> union {
> short tu_block; /* block # */
> short tu_code; /* error code */
> char tu_stuff[1]; /* request packet stuff */
> } th_u;
> char th_data[1]; /* data or error string */
> };
>
> #define th_block th_u.tu_block
> #define th_code th_u.tu_code
> #define th_stuff th_u.tu_stuff
> #define th_msg th_data
>
> , and changing variable 'block' in tftpd.c/tftp.c functions sendfile/recvfile
> to unsigned short would result in unlimited file size, because both sides of
> comparison would overflow into -32768 at the same time.
Unless I missed the obvious, changing this will make it impossible to work with
other
since you are changing the struct size, tftp.h is an expose file and provided
for
convenience if the platform does not have it in /usr/include/arpa/tftp.h