VirtualBox

Ignore:
Timestamp:
Sep 24, 2019 4:17:53 PM (5 years ago)
Author:
vboxsync
Message:

NAT: Do not send TFTP OACK packet if the request had no options.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/tftp.c

    r80983 r80984  
    612612}
    613613
     614
    614615DECLINLINE(int) tftpSendOACK(PNATState pData,
    615616                             PTFTPSESSION pTftpSession,
     
    625626        tftpSendError(pData, pTftpSession, 2, "Option negotiation failure (file not found or inaccessible?)", pcTftpIpHeaderRecv);
    626627        LogFlowFuncLeave();
    627         return -1;
    628     }
     628        return rc;
     629    }
     630
     631    if (rc == VWRN_NOT_FOUND)
     632        return rc;
    629633
    630634    m = slirpTftpMbufAlloc(pData);
    631     if (!m)
    632         return -1;
     635    if (m == NULL)
     636    {
     637        tftpSessionTerminate(pTftpSession);
     638        return VERR_NO_MEMORY;
     639    }
    633640
    634641    m->m_data += if_maxlinkhdr;
     
    647654
    648655    rc = tftpSend(pData, pTftpSession, m, pcTftpIpHeaderRecv);
    649     return RT_SUCCESS(rc) ? 0 : -1;
     656    if (RT_FAILURE(rc))
     657        tftpSessionTerminate(pTftpSession);
     658
     659    return rc;
    650660}
    651661
     
    795805
    796806
    797     tftpSendOACK(pData, pTftpSession, pTftpIpHeader);
     807    rc = tftpSendOACK(pData, pTftpSession, pTftpIpHeader);
     808    if (rc == VWRN_NOT_FOUND)
     809        rc = tftpSendData(pData, pTftpSession, 0, pTftpIpHeader);
     810
    798811    LogFlowFuncLeave();
    799812    return;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette