Changeset 86d9ca2 in rtems
- Timestamp:
- 12/07/01 12:59:12 (22 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 63bb806
- Parents:
- 85ca769
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libnetworking/ChangeLog
r85ca769 r86d9ca2 1 2001-12-07 Eric Norum <eric.norum@usask.ca> 2 3 * lib/tftpDriver.c: Restore write capability. 4 1 5 2001-11-26 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 6 -
c/src/exec/libnetworking/lib/tftpDriver.c
r85ca769 r86d9ca2 379 379 } 380 380 else { 381 printf ("TFTP: %d 0-byte packet\n", len);381 printf ("TFTP: %d-byte packet\n", len); 382 382 } 383 383 } … … 726 726 if (tp->writing 727 727 && (opcode == TFTP_OPCODE_ACK) 728 && (ntohs (tp->pkbuf.tftpACK.blocknum) == 0)) { 728 && ((ntohs (tp->pkbuf.tftpACK.blocknum) == 0) 729 || (ntohs (tp->pkbuf.tftpACK.blocknum) == 1))) { 729 730 tp->nused = 0; 730 tp->blocknum = 1;731 tp->blocknum = ntohs (tp->pkbuf.tftpACK.blocknum); 731 732 break; 732 733 } … … 880 881 #ifdef RTEMS_TFTP_DRIVER_DEBUG 881 882 if (rtems_tftp_driver_debug) 882 printf ("TFTP: SEND %d \n", tp->blocknum);883 printf ("TFTP: SEND %d (%d)\n", tp->blocknum, tp->nused); 883 884 #endif 884 885 if (sendto (tp->socket, (char *)&tp->pkbuf, wlen, 0, … … 887 888 return EIO; 888 889 rlen = getPacket (tp, retryCount); 890 /* 891 * Our last packet won't necessarily be acknowledged! 892 */ 893 if ((rlen < 0) && (tp->nused < sizeof tp->pkbuf.tftpDATA.data)) 894 return 0; 889 895 if (rlen >= (int)sizeof tp->pkbuf.tftpACK) { 890 896 int opcode = ntohs (tp->pkbuf.tftpACK.opcode); 891 897 if ((opcode == TFTP_OPCODE_ACK) 892 && (ntohs (tp->pkbuf.tftpACK.blocknum) == tp->blocknum)) {898 && (ntohs (tp->pkbuf.tftpACK.blocknum) == (tp->blocknum + 1))) { 893 899 tp->nused = 0; 894 900 tp->blocknum++; … … 994 1000 ) 995 1001 { 996 if (pathloc->node_access == NULL) 1002 if ((pathloc->node_access == NULL) 1003 || (pathloc->node_access == ROOT_NODE_ACCESS)) 997 1004 return RTEMS_FILESYSTEM_MEMORY_FILE; 998 1005 return RTEMS_FILESYSTEM_DIRECTORY; -
c/src/libnetworking/ChangeLog
r85ca769 r86d9ca2 1 2001-12-07 Eric Norum <eric.norum@usask.ca> 2 3 * lib/tftpDriver.c: Restore write capability. 4 1 5 2001-11-26 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 6 -
c/src/libnetworking/lib/tftpDriver.c
r85ca769 r86d9ca2 379 379 } 380 380 else { 381 printf ("TFTP: %d 0-byte packet\n", len);381 printf ("TFTP: %d-byte packet\n", len); 382 382 } 383 383 } … … 726 726 if (tp->writing 727 727 && (opcode == TFTP_OPCODE_ACK) 728 && (ntohs (tp->pkbuf.tftpACK.blocknum) == 0)) { 728 && ((ntohs (tp->pkbuf.tftpACK.blocknum) == 0) 729 || (ntohs (tp->pkbuf.tftpACK.blocknum) == 1))) { 729 730 tp->nused = 0; 730 tp->blocknum = 1;731 tp->blocknum = ntohs (tp->pkbuf.tftpACK.blocknum); 731 732 break; 732 733 } … … 880 881 #ifdef RTEMS_TFTP_DRIVER_DEBUG 881 882 if (rtems_tftp_driver_debug) 882 printf ("TFTP: SEND %d \n", tp->blocknum);883 printf ("TFTP: SEND %d (%d)\n", tp->blocknum, tp->nused); 883 884 #endif 884 885 if (sendto (tp->socket, (char *)&tp->pkbuf, wlen, 0, … … 887 888 return EIO; 888 889 rlen = getPacket (tp, retryCount); 890 /* 891 * Our last packet won't necessarily be acknowledged! 892 */ 893 if ((rlen < 0) && (tp->nused < sizeof tp->pkbuf.tftpDATA.data)) 894 return 0; 889 895 if (rlen >= (int)sizeof tp->pkbuf.tftpACK) { 890 896 int opcode = ntohs (tp->pkbuf.tftpACK.opcode); 891 897 if ((opcode == TFTP_OPCODE_ACK) 892 && (ntohs (tp->pkbuf.tftpACK.blocknum) == tp->blocknum)) {898 && (ntohs (tp->pkbuf.tftpACK.blocknum) == (tp->blocknum + 1))) { 893 899 tp->nused = 0; 894 900 tp->blocknum++; … … 994 1000 ) 995 1001 { 996 if (pathloc->node_access == NULL) 1002 if ((pathloc->node_access == NULL) 1003 || (pathloc->node_access == ROOT_NODE_ACCESS)) 997 1004 return RTEMS_FILESYSTEM_MEMORY_FILE; 998 1005 return RTEMS_FILESYSTEM_DIRECTORY; -
cpukit/libnetworking/ChangeLog
r85ca769 r86d9ca2 1 2001-12-07 Eric Norum <eric.norum@usask.ca> 2 3 * lib/tftpDriver.c: Restore write capability. 4 1 5 2001-11-26 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 6 -
cpukit/libnetworking/lib/tftpDriver.c
r85ca769 r86d9ca2 379 379 } 380 380 else { 381 printf ("TFTP: %d 0-byte packet\n", len);381 printf ("TFTP: %d-byte packet\n", len); 382 382 } 383 383 } … … 726 726 if (tp->writing 727 727 && (opcode == TFTP_OPCODE_ACK) 728 && (ntohs (tp->pkbuf.tftpACK.blocknum) == 0)) { 728 && ((ntohs (tp->pkbuf.tftpACK.blocknum) == 0) 729 || (ntohs (tp->pkbuf.tftpACK.blocknum) == 1))) { 729 730 tp->nused = 0; 730 tp->blocknum = 1;731 tp->blocknum = ntohs (tp->pkbuf.tftpACK.blocknum); 731 732 break; 732 733 } … … 880 881 #ifdef RTEMS_TFTP_DRIVER_DEBUG 881 882 if (rtems_tftp_driver_debug) 882 printf ("TFTP: SEND %d \n", tp->blocknum);883 printf ("TFTP: SEND %d (%d)\n", tp->blocknum, tp->nused); 883 884 #endif 884 885 if (sendto (tp->socket, (char *)&tp->pkbuf, wlen, 0, … … 887 888 return EIO; 888 889 rlen = getPacket (tp, retryCount); 890 /* 891 * Our last packet won't necessarily be acknowledged! 892 */ 893 if ((rlen < 0) && (tp->nused < sizeof tp->pkbuf.tftpDATA.data)) 894 return 0; 889 895 if (rlen >= (int)sizeof tp->pkbuf.tftpACK) { 890 896 int opcode = ntohs (tp->pkbuf.tftpACK.opcode); 891 897 if ((opcode == TFTP_OPCODE_ACK) 892 && (ntohs (tp->pkbuf.tftpACK.blocknum) == tp->blocknum)) {898 && (ntohs (tp->pkbuf.tftpACK.blocknum) == (tp->blocknum + 1))) { 893 899 tp->nused = 0; 894 900 tp->blocknum++; … … 994 1000 ) 995 1001 { 996 if (pathloc->node_access == NULL) 1002 if ((pathloc->node_access == NULL) 1003 || (pathloc->node_access == ROOT_NODE_ACCESS)) 997 1004 return RTEMS_FILESYSTEM_MEMORY_FILE; 998 1005 return RTEMS_FILESYSTEM_DIRECTORY;
Note: See TracChangeset
for help on using the changeset viewer.