2001-01-16 Eric Norum <eric.norum@usask.ca>

* lib/tftpDriver.clib/tftpDriver.c: Fix TFTP block number checking.
This commit is contained in:
Joel Sherrill
2002-01-16 22:50:04 +00:00
parent 46c109656a
commit cf42e73556
6 changed files with 21 additions and 12 deletions

View File

@@ -1,3 +1,7 @@
2001-01-16 Eric Norum <eric.norum@usask.ca>
* lib/tftpDriver.clib/tftpDriver.c: Fix TFTP block number checking.
2002-02-05 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* pppd/sys-rtems.c: Remove unused variable status from

View File

@@ -721,10 +721,9 @@ static int rtems_tftp_open_worker(
}
if (tp->writing
&& (opcode == TFTP_OPCODE_ACK)
&& ((ntohs (tp->pkbuf.tftpACK.blocknum) == 0)
|| (ntohs (tp->pkbuf.tftpACK.blocknum) == 1))) {
&& (ntohs (tp->pkbuf.tftpACK.blocknum) == 0)) {
tp->nused = 0;
tp->blocknum = ntohs (tp->pkbuf.tftpACK.blocknum);
tp->blocknum = 1;
break;
}
if (opcode == TFTP_OPCODE_ERROR) {
@@ -891,7 +890,7 @@ static int rtems_tftp_flush ( struct tftpStream *tp )
if (rlen >= (int)sizeof tp->pkbuf.tftpACK) {
int opcode = ntohs (tp->pkbuf.tftpACK.opcode);
if ((opcode == TFTP_OPCODE_ACK)
&& (ntohs (tp->pkbuf.tftpACK.blocknum) == (tp->blocknum + 1))) {
&& (ntohs (tp->pkbuf.tftpACK.blocknum) == tp->blocknum)) {
tp->nused = 0;
tp->blocknum++;
return 0;

View File

@@ -1,3 +1,7 @@
2001-01-16 Eric Norum <eric.norum@usask.ca>
* lib/tftpDriver.clib/tftpDriver.c: Fix TFTP block number checking.
2002-02-05 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* pppd/sys-rtems.c: Remove unused variable status from

View File

@@ -721,10 +721,9 @@ static int rtems_tftp_open_worker(
}
if (tp->writing
&& (opcode == TFTP_OPCODE_ACK)
&& ((ntohs (tp->pkbuf.tftpACK.blocknum) == 0)
|| (ntohs (tp->pkbuf.tftpACK.blocknum) == 1))) {
&& (ntohs (tp->pkbuf.tftpACK.blocknum) == 0)) {
tp->nused = 0;
tp->blocknum = ntohs (tp->pkbuf.tftpACK.blocknum);
tp->blocknum = 1;
break;
}
if (opcode == TFTP_OPCODE_ERROR) {
@@ -891,7 +890,7 @@ static int rtems_tftp_flush ( struct tftpStream *tp )
if (rlen >= (int)sizeof tp->pkbuf.tftpACK) {
int opcode = ntohs (tp->pkbuf.tftpACK.opcode);
if ((opcode == TFTP_OPCODE_ACK)
&& (ntohs (tp->pkbuf.tftpACK.blocknum) == (tp->blocknum + 1))) {
&& (ntohs (tp->pkbuf.tftpACK.blocknum) == tp->blocknum)) {
tp->nused = 0;
tp->blocknum++;
return 0;

View File

@@ -1,3 +1,7 @@
2001-01-16 Eric Norum <eric.norum@usask.ca>
* lib/tftpDriver.clib/tftpDriver.c: Fix TFTP block number checking.
2002-02-05 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* pppd/sys-rtems.c: Remove unused variable status from

View File

@@ -721,10 +721,9 @@ static int rtems_tftp_open_worker(
}
if (tp->writing
&& (opcode == TFTP_OPCODE_ACK)
&& ((ntohs (tp->pkbuf.tftpACK.blocknum) == 0)
|| (ntohs (tp->pkbuf.tftpACK.blocknum) == 1))) {
&& (ntohs (tp->pkbuf.tftpACK.blocknum) == 0)) {
tp->nused = 0;
tp->blocknum = ntohs (tp->pkbuf.tftpACK.blocknum);
tp->blocknum = 1;
break;
}
if (opcode == TFTP_OPCODE_ERROR) {
@@ -891,7 +890,7 @@ static int rtems_tftp_flush ( struct tftpStream *tp )
if (rlen >= (int)sizeof tp->pkbuf.tftpACK) {
int opcode = ntohs (tp->pkbuf.tftpACK.opcode);
if ((opcode == TFTP_OPCODE_ACK)
&& (ntohs (tp->pkbuf.tftpACK.blocknum) == (tp->blocknum + 1))) {
&& (ntohs (tp->pkbuf.tftpACK.blocknum) == tp->blocknum)) {
tp->nused = 0;
tp->blocknum++;
return 0;