VirtualBox

Changeset 87688 in vbox


Ignore:
Timestamp:
Feb 10, 2021 3:28:46 PM (4 years ago)
Author:
vboxsync
Message:

NAT/Net: Now that VBoxNetNAT gets all its settings via the API, the
only command line parameter we need to pass to it is the network name.
bugref:9929

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/NATNetworkImpl.cpp

    r87635 r87688  
    889889    m->NATRunner.resetArguments();
    890890    m->NATRunner.addArgPair(NetworkServiceRunner::kpszKeyNetwork, Utf8Str(m->s.strNetworkName).c_str());
    891     m->NATRunner.addArgPair(NetworkServiceRunner::kpszKeyTrunkType, Utf8Str(TRUNKTYPE_WHATEVER).c_str());
    892     m->NATRunner.addArgPair(NetworkServiceRunner::kpszIpAddress, Utf8Str(m->IPv4Gateway).c_str());
    893     m->NATRunner.addArgPair(NetworkServiceRunner::kpszIpNetmask, Utf8Str(m->IPv4NetworkMask).c_str());
    894891
    895892    /* No portforwarding rules from command-line, all will be fetched via API */
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp

    r87637 r87688  
    273273    setMacAddress(mac);
    274274
    275     RTNETADDRIPV4 address;
    276     address.u     = RT_MAKE_U32_FROM_U8( 10,  0,  2,  2); // NB: big-endian
    277     setIpv4Address(address);
    278 
    279     address.u     = RT_H2N_U32_C(0xffffff00);
    280     setIpv4Netmask(address);
    281 
    282275    /* tell the base class about our command line options */
    283276    for (PCRTGETOPTDEF pcOpt = &s_aGetOptDef[0]; pcOpt->iShort != 0; ++pcOpt)
     
    577570    AssertReturn(CmdLineMask4.u == 0 || CmdLineMask4.u == Mask4.u,
    578571                 VERR_INVALID_PARAMETER);
     572
     573    /*
     574     * Transitional: tell the base class just in case, though it's not
     575     * used as far as I can tell.
     576     */
     577    if (CmdLineAddr4.u == 0)
     578    {
     579        setIpv4Address(Addr4);
     580        setIpv4Netmask(Mask4);
     581    }
    579582
    580583    memcpy(&m_ProxyOptions.ipv4_addr, &Addr4, sizeof(ip_addr));
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