| Index: net/base/net_util_posix.cc
|
| diff --git a/net/base/net_util_posix.cc b/net/base/net_util_posix.cc
|
| index a2fa6cdf2ce7c1c871c4415911fe04c6b2d51602..509586be0ed942762d8e1784ff5b13d682520e23 100644
|
| --- a/net/base/net_util_posix.cc
|
| +++ b/net/base/net_util_posix.cc
|
| @@ -80,7 +80,7 @@ bool IsLoopbackOrUnspecifiedAddress(const sockaddr* addr) {
|
| #if defined(OS_MACOSX)
|
|
|
| struct NetworkInterfaceInfo {
|
| - NetworkInterfaceInfo() : permanent(true) { }
|
| + NetworkInterfaceInfo() : permanent(true) {}
|
|
|
| bool permanent; // IPv6 has notion of temporary address. If the address is
|
| // IPv6 and it's temporary this field will be false.
|
| @@ -108,12 +108,12 @@ void RemovePermanentIPv6AddressesWhereTemporaryExists(
|
| return;
|
|
|
| // Search for permenent addresses belonging to same network interface.
|
| - for (i = infos->begin(); i != infos->end(); ) {
|
| + for (i = infos->begin(); i != infos->end();) {
|
| // If the address is IPv6 and it's permanent and there is temporary
|
| // address for it, then we can remove this address.
|
| if ((i->interface.address.size() == kIPv6AddressSize) && i->permanent &&
|
| (ifaces_with_temp_addrs.find(i->interface.name) !=
|
| - ifaces_with_temp_addrs.end())) {
|
| + ifaces_with_temp_addrs.end())) {
|
| i = infos->erase(i);
|
| } else {
|
| ++i;
|
| @@ -123,7 +123,8 @@ void RemovePermanentIPv6AddressesWhereTemporaryExists(
|
|
|
| #if !defined(OS_IOS)
|
| NetworkChangeNotifier::ConnectionType GetNetworkInterfaceType(
|
| - int addr_family, const std::string& interface_name) {
|
| + int addr_family,
|
| + const std::string& interface_name) {
|
| NetworkChangeNotifier::ConnectionType type =
|
| NetworkChangeNotifier::CONNECTION_UNKNOWN;
|
|
|
| @@ -161,9 +162,9 @@ bool TryConvertNativeToNetIPAttributes(int native_attributes,
|
| // is completed.
|
| if (native_attributes & (
|
| #if !defined(OS_ANDROID)
|
| - IFA_F_OPTIMISTIC | IFA_F_DADFAILED |
|
| + IFA_F_OPTIMISTIC | IFA_F_DADFAILED |
|
| #endif // !OS_ANDROID
|
| - IFA_F_TENTATIVE)) {
|
| + IFA_F_TENTATIVE)) {
|
| return false;
|
| }
|
|
|
| @@ -202,8 +203,7 @@ bool GetNetworkListImpl(
|
|
|
| for (internal::AddressTrackerLinux::AddressMap::const_iterator it =
|
| address_map.begin();
|
| - it != address_map.end();
|
| - ++it) {
|
| + it != address_map.end(); ++it) {
|
| // Ignore addresses whose links are not online.
|
| if (online_links.find(it->second.ifa_index) == online_links.end())
|
| continue;
|
| @@ -253,13 +253,9 @@ bool GetNetworkListImpl(
|
| continue;
|
|
|
| networks->push_back(
|
| - NetworkInterface(ifname,
|
| - ifname,
|
| - it->second.ifa_index,
|
| - NetworkChangeNotifier::CONNECTION_UNKNOWN,
|
| - it->first,
|
| - it->second.ifa_prefixlen,
|
| - ip_attributes));
|
| + NetworkInterface(ifname, ifname, it->second.ifa_index,
|
| + NetworkChangeNotifier::CONNECTION_UNKNOWN, it->first,
|
| + it->second.ifa_prefixlen, ip_attributes));
|
| }
|
|
|
| return true;
|
| @@ -279,11 +275,9 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
|
| internal::AddressTrackerLinux tracker;
|
| tracker.Init();
|
|
|
| - return internal::GetNetworkListImpl(networks,
|
| - policy,
|
| + return internal::GetNetworkListImpl(networks, policy,
|
| tracker.GetOnlineLinks(),
|
| - tracker.GetAddressMap(),
|
| - &if_indextoname);
|
| + tracker.GetAddressMap(), &if_indextoname);
|
|
|
| #else // Only OS_MACOSX and OS_IOS will run the code below
|
|
|
| @@ -308,8 +302,7 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
|
| std::vector<NetworkInterfaceInfo> network_infos;
|
|
|
| // Enumerate the addresses assigned to network interfaces which are up.
|
| - for (ifaddrs *interface = interfaces;
|
| - interface != NULL;
|
| + for (ifaddrs* interface = interfaces; interface != NULL;
|
| interface = interface->ifa_next) {
|
| // Skip loopback interfaces, and ones which are down.
|
| if (!(IFF_UP & interface->ifa_flags))
|
| @@ -373,13 +366,9 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
|
| net_mask = MaskPrefixLength(netmask.address());
|
| }
|
| }
|
| - network_info.interface = NetworkInterface(name,
|
| - name,
|
| - if_nametoindex(name.c_str()),
|
| - connection_type,
|
| - address.address(),
|
| - net_mask,
|
| - IP_ADDRESS_ATTRIBUTE_NONE);
|
| + network_info.interface = NetworkInterface(
|
| + name, name, if_nametoindex(name.c_str()), connection_type,
|
| + address.address(), net_mask, IP_ADDRESS_ATTRIBUTE_NONE);
|
|
|
| network_infos.push_back(NetworkInterfaceInfo(network_info));
|
| }
|
| @@ -410,5 +399,4 @@ scoped_ptr<ScopedWifiOptions> SetWifiOptions(int options) {
|
| return scoped_ptr<ScopedWifiOptions>();
|
| }
|
|
|
| -
|
| } // namespace net
|
|
|