diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
---|---|---|
committer | <> | 2014-05-08 15:03:54 +0000 |
commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Devices/Network/slirp/tftp.c | |
parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
download | VirtualBox-master.tar.gz |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Devices/Network/slirp/tftp.c')
-rw-r--r-- | src/VBox/Devices/Network/slirp/tftp.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/VBox/Devices/Network/slirp/tftp.c b/src/VBox/Devices/Network/slirp/tftp.c index 42e25690..2e3ef8e8 100644 --- a/src/VBox/Devices/Network/slirp/tftp.c +++ b/src/VBox/Devices/Network/slirp/tftp.c @@ -433,7 +433,7 @@ DECLINLINE(int) tftpSessionEvaluateOptions(PNATState pData, PTFTPSESSION pTftpSe rc = pftpSessionOpenFile(pData, pTftpSession, &hSessionFile); if (RT_FAILURE(rc)) { - LogFlowFuncLeave(); + LogFlowFuncLeaveRC(rc); return rc; } @@ -441,13 +441,13 @@ DECLINLINE(int) tftpSessionEvaluateOptions(PNATState pData, PTFTPSESSION pTftpSe RTFileClose(hSessionFile); if (RT_FAILURE(rc)) { - LogFlowFuncLeave(); + LogFlowFuncLeaveRC(rc); return rc; } if (pTftpSession->OptionTSize.fRequested) { - pTftpSession->OptionTSize.u64Value = cbSessionFile; + pTftpSession->OptionTSize.u64Value = cbSessionFile; } if ( !pTftpSession->OptionBlkSize.u64Value && !pTftpSession->OptionBlkSize.fRequested) @@ -546,7 +546,7 @@ DECLINLINE(int) tftpAddOptionToOACK(PNATState pData, struct mbuf *pMBuf, const c RT_ZERO(aszOptionBuffer); iOptLength += RTStrPrintf(aszOptionBuffer, 256 , "%s", pszOptName) + 1; - iOptLength += RTStrPrintf(aszOptionBuffer + iOptLength, 256 - iOptLength , "%u", u64OptValue) + 1; + iOptLength += RTStrPrintf(aszOptionBuffer + iOptLength, 256 - iOptLength , "%llu", u64OptValue) + 1; if (iOptLength > M_TRAILINGSPACE(pMBuf)) rc = VERR_BUFFER_OVERFLOW; /* buffer too small */ else @@ -569,7 +569,7 @@ DECLINLINE(int) tftpSendOACK(PNATState pData, rc = tftpSessionEvaluateOptions(pData, pTftpSession); if (RT_FAILURE(rc)) { - tftpSendError(pData, pTftpSession, 2, "Internal Error (blksize evaluation)", pcTftpIpHeaderRecv); + tftpSendError(pData, pTftpSession, 2, "Option negotiation failure (file not found or inaccessible?)", pcTftpIpHeaderRecv); LogFlowFuncLeave(); return -1; } @@ -578,8 +578,6 @@ DECLINLINE(int) tftpSendOACK(PNATState pData, if (!m) return -1; - - m->m_data += if_maxlinkhdr; m->m_pkthdr.header = mtod(m, void *); pTftpIpHeader = mtod(m, PTFTPIPHDR); @@ -756,9 +754,10 @@ static void tftpProcessACK(PNATState pData, PTFTPIPHDR pTftpIpHeader) if (RT_FAILURE(rc)) return; - AssertReturnVoid(tftpSendData(pData, - pTftpSession, - RT_N2H_U16(pTftpIpHeader->Core.u16TftpOpCode), pTftpIpHeader) == 0); + if (tftpSendData(pData, pTftpSession, + RT_N2H_U16(pTftpIpHeader->Core.u16TftpOpCode), + pTftpIpHeader)) + LogRel(("NAT TFTP: failure\n")); } int slirpTftpInit(PNATState pData) |