summaryrefslogtreecommitdiff
path: root/src/VBox/Devices/Network/slirp/tftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Devices/Network/slirp/tftp.c')
-rw-r--r--src/VBox/Devices/Network/slirp/tftp.c19
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)