Chromium Code Reviews| Index: content/renderer/p2p/ipc_network_manager.cc |
| =================================================================== |
| --- content/renderer/p2p/ipc_network_manager.cc (revision 229244) |
| +++ content/renderer/p2p/ipc_network_manager.cc (working copy) |
| @@ -49,15 +49,23 @@ |
| std::vector<talk_base::Network*> networks; |
| for (net::NetworkInterfaceList::const_iterator it = list.begin(); |
| it != list.end(); it++) { |
| - uint32 address; |
| - if (it->address.size() != net::kIPv4AddressSize) |
| - continue; |
| - memcpy(&address, &it->address[0], sizeof(uint32)); |
| - address = talk_base::NetworkToHost32(address); |
| - talk_base::Network* network = new talk_base::Network( |
| - it->name, it->name, talk_base::IPAddress(address), 32); |
| - network->AddIP(talk_base::IPAddress(address)); |
| - networks.push_back(network); |
| + if (it->address.size() == net::kIPv4AddressSize) { |
| + uint32 address; |
| + memcpy(&address, &it->address[0], sizeof(uint32)); |
| + address = talk_base::NetworkToHost32(address); |
| + talk_base::Network* network = new talk_base::Network( |
| + it->name, it->name, talk_base::IPAddress(address), 32); |
|
Ronghua Wu (Left Chromium)
2013/10/18 23:38:28
Should we use NetworkInterface::network_prefix as
Mallinath (Gone from Chromium)
2013/10/19 00:09:39
Now it's more aligned with the libjingle native co
|
| + network->AddIP(talk_base::IPAddress(address)); |
| + networks.push_back(network); |
| + } else if (it->address.size() == net::kIPv6AddressSize) { |
| + in6_addr address; |
| + memcpy(&address, &it->address[0], sizeof(in6_addr)); |
| + talk_base::IPAddress ip6_addr(address); |
| + talk_base::Network* network = new talk_base::Network( |
| + it->name, it->name, ip6_addr, 64); |
|
Ronghua Wu (Left Chromium)
2013/10/18 23:38:28
dito
Mallinath (Gone from Chromium)
2013/10/19 00:09:39
same as above.
On 2013/10/18 23:38:28, Ronghua Wu
|
| + network->AddIP(ip6_addr); |
| + networks.push_back(network); |
| + } |
| } |
| bool changed = false; |