VirtualBox

Changeset 33866 in vbox


Ignore:
Timestamp:
Nov 8, 2010 5:53:25 PM (14 years ago)
Author:
vboxsync
Message:

Main: don't register with the same name or with the same pair (hostip:hostport).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/NATEngineImpl.cpp

    r33827 r33866  
    282282    if (name.isEmpty())
    283283        name = Utf8StrFmt("%s_%d_%d", proto, aHostPort, aGuestPort);
     284
     285    NATRuleMap::iterator it;
     286    for (it = mNATRules.begin(); it != mNATRules.end(); ++it)
     287    {
     288        r = it->second;
     289        if (   it->first == name
     290            || (   r.strHostIP == Utf8Str(aBindIp)
     291                && r.u16HostPort == aHostPort))
     292        {
     293            return E_INVALIDARG;
     294        }
     295    }
     296
    284297    r.strName = name.c_str();
    285298    r.proto = aProto;
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