diff options
author | Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org> | 2001-02-02 10:53:02 +0000 |
---|---|---|
committer | Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org> | 2001-02-02 10:53:02 +0000 |
commit | 67034ac6ad0834d9e35cd79dbbb426490c9a4922 (patch) | |
tree | dd5a044998929a530130a2da8c6ce3902ae7e84a | |
parent | 294156a7ffd32f01b83ee84926e899d111e32883 (diff) | |
download | src-67034ac6ad0834d9e35cd79dbbb426490c9a4922.tar.gz src-67034ac6ad0834d9e35cd79dbbb426490c9a4922.zip |
Fix tftpd and tftp to support file transfers of over 65535 blocks
(about 31 MB - 32 MB).
Submitted (partially)
by: Pascal Hofstee <daeron@wit401305.student.utwente.nl>
Notes
Notes:
svn path=/head/; revision=71926
-rw-r--r-- | libexec/tftpd/tftpd.8 | 5 | ||||
-rw-r--r-- | libexec/tftpd/tftpd.c | 4 | ||||
-rw-r--r-- | usr.bin/tftp/tftp.1 | 3 | ||||
-rw-r--r-- | usr.bin/tftp/tftp.c | 6 |
4 files changed, 14 insertions, 4 deletions
diff --git a/libexec/tftpd/tftpd.8 b/libexec/tftpd/tftpd.8 index 41e0a92a37f0..ec3ece5fc6a0 100644 --- a/libexec/tftpd/tftpd.8 +++ b/libexec/tftpd/tftpd.8 @@ -192,3 +192,8 @@ and the .Fl c option was introduced in .Fx 5.0 . +.Sh BUGS +Files larger than 33488896 octets (65535 blocks) cannot be transferred +without client and server supporting blocksize negotiation (RFC1783). +.Pp +Many tftp clients will not transfer files over 16744448 octets (32767 blocks). diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index f0f0ca43ddb1..f219f081bf42 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -501,7 +501,7 @@ xmitfile(pf) struct tftphdr *dp, *r_init(); register struct tftphdr *ap; /* ack packet */ register int size, n; - volatile int block; + volatile unsigned short block; signal(SIGALRM, timer); dp = r_init(); @@ -571,7 +571,7 @@ recvfile(pf) struct tftphdr *dp, *w_init(); register struct tftphdr *ap; /* ack buffer */ register int n, size; - volatile int block; + volatile unsigned short block; signal(SIGALRM, timer); dp = w_init(); diff --git a/usr.bin/tftp/tftp.1 b/usr.bin/tftp/tftp.1 index 15eab9898f50..0c75272fdb34 100644 --- a/usr.bin/tftp/tftp.1 +++ b/usr.bin/tftp/tftp.1 @@ -167,6 +167,9 @@ protocol, the remote site will probably have some sort of file-access restrictions in place. The exact methods are specific to each site and therefore difficult to document here. +.Pp +Files larger than 33488896 octets (65535 blocks) cannot be transferred +without client and server supporting blocksize negotiation (RFC1783). .Sh HISTORY The .Nm diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c index 9dc00afeddba..e7dc82473802 100644 --- a/usr.bin/tftp/tftp.c +++ b/usr.bin/tftp/tftp.c @@ -96,7 +96,8 @@ xmitfile(fd, name, mode) register struct tftphdr *ap; /* data and ack packets */ struct tftphdr *r_init(), *dp; register int n; - volatile int block, size, convert; + volatile unsigned short block; + volatile int size, convert; volatile unsigned long amount; struct sockaddr_in from; int fromlen; @@ -201,7 +202,8 @@ recvfile(fd, name, mode) register struct tftphdr *ap; struct tftphdr *dp, *w_init(); register int n; - volatile int block, size, firsttrip; + volatile unsigned short block; + volatile int size, firsttrip; volatile unsigned long amount; struct sockaddr_in from; int fromlen; |