Changeset 42020 in vbox
- Timestamp:
- Jul 4, 2012 2:16:39 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/tftp.c
r42014 r42020 69 69 int iTimestamp; 70 70 uint64_t cbTransfered; 71 uint16_t cTftpAck; 71 72 ENMTFTPSESSIONFMT enmTftpFmt; 72 73 TFPTPSESSIONOPTDESC OptionBlkSize; … … 620 621 static int tftpSendData(PNATState pData, 621 622 PTFTPSESSION pTftpSession, 622 u _int16_t block_nr,623 uint16_t u16Block, 623 624 PCTFTPIPHDR pcTftpIpHeaderRecv) 624 625 { … … 627 628 int cbRead; 628 629 int rc = VINF_SUCCESS; 630 631 if (u16Block == pTftpSession->cTftpAck) 632 pTftpSession->cTftpAck++; 633 else 634 { 635 tftpSendError(pData, pTftpSession, 6, "ACK is wrong", pcTftpIpHeaderRecv); 636 tftpSessionTerminate(pTftpSession); 637 return -1; 638 } 629 639 630 640 m = slirpTftpMbufAlloc(pData); … … 638 648 639 649 pTftpIpHeader->u16TftpOpType = RT_H2N_U16_C(TFTP_DATA); 640 pTftpIpHeader->Core.u16TftpOpCode = RT_H2N_U16( block_nr);650 pTftpIpHeader->Core.u16TftpOpCode = RT_H2N_U16(pTftpSession->cTftpAck); 641 651 642 652 rc = tftpReadDataBlock(pData, pTftpSession, (uint8_t *)&pTftpIpHeader->Core.u16TftpOpCode + sizeof(uint16_t), &cbRead); … … 729 739 AssertReturnVoid(tftpSendData(pData, 730 740 pTftpSession, 731 RT_N2H_U16(pTftpIpHeader->Core.u16TftpOpCode) + 1, pTftpIpHeader) == 0);741 RT_N2H_U16(pTftpIpHeader->Core.u16TftpOpCode), pTftpIpHeader) == 0); 732 742 } 733 743
Note:
See TracChangeset
for help on using the changeset viewer.