Changeset 48481 in vbox for trunk/src/VBox/NetworkServices
- Timestamp:
- Sep 16, 2013 2:42:24 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp
r48480 r48481 897 897 m_vecPortForwardRule6.push_back(Rule); 898 898 } 899 900 com::SafeArray<BSTR> strs; 901 int count_strs; 902 hrc = net->COMGETTER(LocalMappings)(ComSafeArrayAsOutParam(strs)); 903 if ( SUCCEEDED(hrc) 904 && (count_strs = strs.size())) 899 } /* if (!fDontLoadRulesOnStartup) */ 900 901 com::SafeArray<BSTR> strs; 902 int count_strs; 903 hrc = net->COMGETTER(LocalMappings)(ComSafeArrayAsOutParam(strs)); 904 if ( SUCCEEDED(hrc) 905 && (count_strs = strs.size())) 906 { 907 unsigned int j = 0; 908 int i; 909 910 for (i = 0; i < count_strs && j < RT_ELEMENTS(m_lo2off); ++i) 905 911 { 906 unsigned int j = 0; 907 int i; 908 909 for (i = 0; i < count_strs && j < RT_ELEMENTS(m_lo2off); ++i) 910 { 911 char aszAddr[17]; 912 RTNETADDRIPV4 ip4addr; 913 char *pszTerm; 914 uint32_t u32Off; 915 com::Utf8Str strLo2Off(strs[i]); 916 const char *pszLo2Off = strLo2Off.c_str(); 917 918 RT_ZERO(aszAddr); 912 char aszAddr[17]; 913 RTNETADDRIPV4 ip4addr; 914 char *pszTerm; 915 uint32_t u32Off; 916 com::Utf8Str strLo2Off(strs[i]); 917 const char *pszLo2Off = strLo2Off.c_str(); 918 919 RT_ZERO(aszAddr); 919 920 920 921 922 923 924 921 pszTerm = RTStrStr(pszLo2Off, "="); 922 923 if ( !pszTerm 924 || (pszTerm - pszLo2Off) >= 17) 925 continue; 925 926 926 927 928 929 930 931 932 933 934 935 936 937 938 927 memcpy(aszAddr, pszLo2Off, (pszTerm - pszLo2Off)); 928 rc = RTNetStrToIPv4Addr(aszAddr, &ip4addr); 929 if (RT_FAILURE(rc)) 930 continue; 931 932 u32Off = RTStrToUInt32(pszTerm + 1); 933 if (u32Off == 0) 934 continue; 935 936 ip4_addr_set_u32(&m_lo2off[j].loaddr, ip4addr.u); 937 m_lo2off[j].off = u32Off; 938 ++j; 939 } 939 940 940 m_loOptDescriptor.lomap = m_lo2off; 941 m_loOptDescriptor.num_lomap = j; 942 m_ProxyOptions.lomap_desc = &m_loOptDescriptor; 943 } 944 945 } /* if (!fDontLoadRulesOnStartup) */ 941 m_loOptDescriptor.lomap = m_lo2off; 942 m_loOptDescriptor.num_lomap = j; 943 m_ProxyOptions.lomap_desc = &m_loOptDescriptor; 944 } 946 945 947 946 hrc = virtualbox->COMGETTER(HomeFolder)(bstr.asOutParam());
Note:
See TracChangeset
for help on using the changeset viewer.