OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/client/plugin/pepper_network_manager.h" | 5 #include "remoting/client/plugin/pepper_network_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 for (size_t i = 0; i < count; i++) { | 69 for (size_t i = 0; i < count; i++) { |
70 std::vector<pp::NetAddress> addresses; | 70 std::vector<pp::NetAddress> addresses; |
71 list.GetIpAddresses(i, &addresses); | 71 list.GetIpAddresses(i, &addresses); |
72 | 72 |
73 if (addresses.size() == 0) | 73 if (addresses.size() == 0) |
74 continue; | 74 continue; |
75 | 75 |
76 for (size_t i = 0; i < addresses.size(); ++i) { | 76 for (size_t i = 0; i < addresses.size(); ++i) { |
77 talk_base::SocketAddress address; | 77 talk_base::SocketAddress address; |
78 PpNetAddressToSocketAddress(addresses[i], &address); | 78 PpNetAddressToSocketAddress(addresses[i], &address); |
79 | |
80 if (address.family() == AF_INET6 && IPIsSiteLocal(address.ipaddr())) { | |
81 // Pepper socket API currently doesn't work with link-local IPv6 | |
Wez
2014/06/17 01:13:26
nit: Suggest "Link-local IPv6 addresses can't be b
Sergey Ulanov
2014/06/17 02:12:02
Done.
| |
82 // addresses. See crbug.com/384854 . Skip them as Bind() will fail | |
83 // anyway. | |
84 continue; | |
85 } | |
86 | |
79 talk_base::Network* network = new talk_base::Network( | 87 talk_base::Network* network = new talk_base::Network( |
80 list.GetName(i), list.GetDisplayName(i), address.ipaddr(), 0); | 88 list.GetName(i), list.GetDisplayName(i), address.ipaddr(), 0); |
81 network->AddIP(address.ipaddr()); | 89 network->AddIP(address.ipaddr()); |
82 networks.push_back(network); | 90 networks.push_back(network); |
83 } | 91 } |
84 } | 92 } |
85 | 93 |
86 bool changed = false; | 94 bool changed = false; |
87 MergeNetworkList(networks, &changed); | 95 MergeNetworkList(networks, &changed); |
88 if (changed) | 96 if (changed) |
89 SignalNetworksChanged(); | 97 SignalNetworksChanged(); |
90 } | 98 } |
91 | 99 |
92 void PepperNetworkManager::SendNetworksChangedSignal() { | 100 void PepperNetworkManager::SendNetworksChangedSignal() { |
93 SignalNetworksChanged(); | 101 SignalNetworksChanged(); |
94 } | 102 } |
95 | 103 |
96 } // namespace remoting | 104 } // namespace remoting |
OLD | NEW |