summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorRob Landley2006-06-18 15:23:13 +0000
committerRob Landley2006-06-18 15:23:13 +0000
commit14d7065ef1eb836d20e13bc25d1b13f0e76185ac (patch)
treec747627780a4340bddd8c2bc292587af934e8e01 /networking
parentb000586d0214491c2b81683c144bdc2bf923612b (diff)
downloadbusybox-14d7065ef1eb836d20e13bc25d1b13f0e76185ac.zip
busybox-14d7065ef1eb836d20e13bc25d1b13f0e76185ac.tar.gz
Make this slightly more readable, and expose the hypocrasy of a comment that
says "our implementation makes it impossible to use blocksizes smaller than 22 octets" right above a check for blocksize < 8.
Diffstat (limited to 'networking')
-rw-r--r--networking/tftp.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index 237609f..b0572c8 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -38,10 +38,6 @@
#define TFTP_TIMEOUT 5 /* seconds */
#define TFTP_NUM_RETRIES 5 /* number of retries */
-/* RFC2348 says between 8 and 65464 */
-#define TFTP_OCTECTS_MIN 8
-#define TFTP_OCTECTS_MAX 65464
-
static const char * const MODE_OCTET = "octet";
#define MODE_OCTET_LEN 6 /* sizeof(MODE_OCTET)*/
@@ -87,7 +83,7 @@ static int tftp_blocksize_check(int blocksize, int bufsize)
*/
if ((bufsize && (blocksize > bufsize)) ||
- (blocksize < TFTP_OCTECTS_MIN) || (blocksize > TFTP_OCTECTS_MAX)) {
+ (blocksize < 8) || (blocksize > 65564)) {
bb_error_msg("bad blocksize");
return 0;
}