- Timestamp:
- Oct 12, 2016 10:28:37 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
r64215 r64218 118 118 static int hostDnsServers(const ComHostPtr& host, 119 119 const RTNETADDRIPV4& networkid, 120 /* const */AddressToOffsetMapping& mapping,120 const AddressToOffsetMapping& mapping, 121 121 AddressList& servers); 122 122 int fetchAndUpdateDnsInfo(); … … 617 617 618 618 619 /**620 * @note: const dropped here, because of map<K,V>::operator[] which621 * isn't const, map<K,V>::at() has const variant but it's C++11.622 */623 619 int VBoxNetDhcp::hostDnsServers(const ComHostPtr& host, 624 620 const RTNETADDRIPV4& networkid, 625 /* const */AddressToOffsetMapping& mapping,621 const AddressToOffsetMapping& mapping, 626 622 AddressList& servers) 627 623 { … … 650 646 if (addr.au8[0] == 127) 651 647 { 652 /* XXX: here we want map<K,V>::at(const K& k) const */ 653 if (mapping[addr] != 0) 648 AddressToOffsetMapping::const_iterator remap(mapping.find(addr)); 649 650 if (remap != mapping.end()) 654 651 { 655 addr.u = RT_H2N_U32(RT_N2H_U32(networkid.u)656 + mapping[addr]);652 int offset = remap->second; 653 addr.u = RT_H2N_U32(RT_N2H_U32(networkid.u) + offset); 657 654 } 658 655 else
Note:
See TracChangeset
for help on using the changeset viewer.