VirtualBox

Changeset 64166 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Oct 6, 2016 2:11:46 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111147
Message:

NAT: Don't use user supplied port-forwarding rule names as node names
in CFGM. Instead move all rules under new .../Config/PortForwarding/
node, use (transient) rule index as the node name and put the rule
name into the "Name" leaf value. Note that this is a private
interface between components, so nothing else should be affected by
this layout change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r63478 r64166  
    13701370    RT_NOREF(pNetwork); /** @todo figure why pNetwork isn't used */
    13711371
     1372    PCFGMNODE pPFTree = CFGMR3GetChild(pCfg, "PortForwarding");
     1373    if (pPFTree == NULL)
     1374        return VINF_SUCCESS;
     1375
    13721376    /*
    13731377     * Enumerate redirections.
    13741378     */
    1375     for (PCFGMNODE pNode = CFGMR3GetFirstChild(pCfg); pNode; pNode = CFGMR3GetNextChild(pNode))
    1376     {
    1377 #ifdef VBOX_WITH_DNSMAPPING_IN_HOSTRESOLVER
    1378         char szNodeName[32];
    1379         CFGMR3GetName(pNode, szNodeName, 32);
    1380         if (   !RTStrICmp(szNodeName, "HostResolverMappings")
    1381             || !RTStrICmp(szNodeName, "AttachedDriver"))
    1382             continue;
    1383 #endif
     1379    for (PCFGMNODE pNode = CFGMR3GetFirstChild(pPFTree); pNode; pNode = CFGMR3GetNextChild(pNode))
     1380    {
    13841381        /*
    13851382         * Validate the port forwarding config.
    13861383         */
    1387         if (!CFGMR3AreValuesValid(pNode, "Protocol\0UDP\0HostPort\0GuestPort\0GuestIP\0BindIP\0"))
     1384        if (!CFGMR3AreValuesValid(pNode, "Name\0Protocol\0UDP\0HostPort\0GuestPort\0GuestIP\0BindIP\0"))
    13881385            return PDMDRV_SET_ERROR(pThis->pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES,
    13891386                                    N_("Unknown configuration in port forwarding"));
Note: See TracChangeset for help on using the changeset viewer.

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