defs had 'short block' for blocksize; changed defs to be unsigned.

added note to tftpd.8 that this bug hits multiple tftp clients.
This commit is contained in:
dogcow 2000-10-18 01:35:45 +00:00
parent 9b22175a26
commit 90c3bfc9b0
4 changed files with 16 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tftp.h,v 1.5 1998/02/10 00:32:59 perry Exp $ */
/* $NetBSD: tftp.h,v 1.6 2000/10/18 01:35:46 dogcow Exp $ */
/*
* Copyright (c) 1983, 1993
@ -55,7 +55,7 @@
struct tftphdr {
short th_opcode; /* packet type */
union {
short tu_block; /* block # */
unsigned short tu_block; /* block # */
short tu_code; /* error code */
char tu_stuff[1]; /* request packet stuff */
} th_u;

View File

@ -1,4 +1,4 @@
.\" $NetBSD: tftpd.8,v 1.12 1999/07/12 20:25:35 itojun Exp $
.\" $NetBSD: tftpd.8,v 1.13 2000/10/18 01:35:45 dogcow Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -171,6 +171,11 @@ flags appeared in
.Nx 1.4 .
.Pp
IPv6 support was implemented by WIDE/KAME project in 1999.
.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).
.Sh SECURITY CONSIDERATIONS
You are
.Em strongly

View File

@ -1,4 +1,4 @@
/* $NetBSD: tftpd.c,v 1.18 1999/07/12 20:17:09 itojun Exp $ */
/* $NetBSD: tftpd.c,v 1.19 2000/10/18 01:35:46 dogcow Exp $ */
/*
* Copyright (c) 1983, 1993
@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)tftpd.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: tftpd.c,v 1.18 1999/07/12 20:17:09 itojun Exp $");
__RCSID("$NetBSD: tftpd.c,v 1.19 2000/10/18 01:35:46 dogcow Exp $");
#endif
#endif /* not lint */
@ -592,7 +592,7 @@ sendfile(pf)
struct tftphdr *dp;
struct tftphdr *ap; /* ack packet */
int size, n;
volatile int block;
volatile unsigned int block;
signal(SIGALRM, timer);
dp = r_init();
@ -662,7 +662,7 @@ recvfile(pf)
struct tftphdr *dp;
struct tftphdr *ap; /* ack buffer */
int n, size;
volatile int block;
volatile unsigned int block;
signal(SIGALRM, timer);
dp = w_init();

View File

@ -1,4 +1,4 @@
/* $NetBSD: tftp.c,v 1.11 2000/01/21 17:08:36 mycroft Exp $ */
/* $NetBSD: tftp.c,v 1.12 2000/10/18 01:35:45 dogcow Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)tftp.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: tftp.c,v 1.11 2000/01/21 17:08:36 mycroft Exp $");
__RCSID("$NetBSD: tftp.c,v 1.12 2000/10/18 01:35:45 dogcow Exp $");
#endif
#endif /* not lint */
@ -99,7 +99,7 @@ sendfile(fd, name, mode)
struct tftphdr *ap; /* data and ack packets */
struct tftphdr *dp;
int n;
volatile int block, size, convert;
volatile unsigned int block, size, convert;
volatile unsigned long amount;
struct sockaddr_storage from;
int fromlen;
@ -218,7 +218,7 @@ recvfile(fd, name, mode)
struct tftphdr *ap;
struct tftphdr *dp;
int n;
volatile int block, size, firsttrip;
volatile unsigned int block, size, firsttrip;
volatile unsigned long amount;
struct sockaddr_storage from;
int fromlen;