VirtualBox

Changeset 48377 in vbox for trunk/src/VBox/NetworkServices


Ignore:
Timestamp:
Sep 9, 2013 7:19:32 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
88806
Message:

lwip-nat: dhcp missed loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp

    r48375 r48377  
    393393            && (count_strs = strs.size()))
    394394        {
    395             char aszAddr[17];
    396             RTNETADDRIPV4 ip4addr;
    397             char *pszTerm;
    398             uint32_t u32Off;
    399             const char *pszLo2Off = com::Utf8Str(strs[i]).c_str();
     395            for (i = 0; i < count_strs; ++i)
     396            {
     397                char aszAddr[17];
     398                RTNETADDRIPV4 ip4addr;
     399                char *pszTerm;
     400                uint32_t u32Off;
     401                const char *pszLo2Off = com::Utf8Str(strs[i]).c_str();
    400402       
    401             RT_ZERO(aszAddr);
     403                RT_ZERO(aszAddr);
    402404               
    403             pszTerm = RTStrStr(pszLo2Off, ";");
    404 
    405             if (   pszTerm
    406                 && (pszTerm - pszLo2Off) >= 17)
    407             {
     405                pszTerm = RTStrStr(pszLo2Off, ";");
     406
     407                if (   pszTerm
     408                       && (pszTerm - pszLo2Off) >= 17)
     409                {
    408410               
    409                 memcpy(aszAddr, pszLo2Off, (pszTerm - pszLo2Off));
    410                 int rc = RTNetStrToIPv4Addr(aszAddr, &ip4addr);
    411                 if (RT_SUCCESS(rc))
    412                 {
    413 
    414                     u32Off = RTStrToUInt32(pszTerm + 1);
    415                     if (u32Off != 0)
    416                         MapIp4Addr2Off.insert(
    417                           std::map<RTNETADDRIPV4,uint32_t>::value_type(ip4addr, u32Off));
     411                    memcpy(aszAddr, pszLo2Off, (pszTerm - pszLo2Off));
     412                    int rc = RTNetStrToIPv4Addr(aszAddr, &ip4addr);
     413                    if (RT_SUCCESS(rc))
     414                    {
     415
     416                        u32Off = RTStrToUInt32(pszTerm + 1);
     417                        if (u32Off != 0)
     418                            MapIp4Addr2Off.insert(
     419                              std::map<RTNETADDRIPV4,uint32_t>::value_type(ip4addr, u32Off));
     420                    }
    418421                }
    419422            }
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