forked from mirrors/tftp-hpa-google
(Finally) handle block number wraparound correctly.
This commit is contained in:
parent
52ffc49262
commit
480bee14e9
3 changed files with 14 additions and 5 deletions
|
@ -926,7 +926,7 @@ tftp_sendfile(struct formats *pf, struct tftphdr *oap, int oacklen)
|
|||
{
|
||||
struct tftphdr *dp;
|
||||
struct tftphdr *ap; /* ack packet */
|
||||
static int block = 1; /* Static to avoid longjmp funnies */
|
||||
static u_short block = 1; /* Static to avoid longjmp funnies */
|
||||
int size, n;
|
||||
|
||||
ap = (struct tftphdr *)ackbuf;
|
||||
|
@ -1036,8 +1036,9 @@ tftp_recvfile(struct formats *pf, struct tftphdr *oap, int oacklen)
|
|||
int n, size;
|
||||
/* These are "static" to avoid longjmp funnies */
|
||||
static struct tftphdr *ap; /* ack buffer */
|
||||
static int block = 0, acksize;
|
||||
|
||||
static u_short block = 0;
|
||||
static int acksize;
|
||||
|
||||
dp = w_init();
|
||||
do {
|
||||
timeout = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue