| Index: net/base/net_util_posix.cc
|
| diff --git a/net/base/net_util_posix.cc b/net/base/net_util_posix.cc
|
| index 73704cde69de5b5697acf1a5d621a5d880d5c1da..1a4a8ed439ab06ce59482d8157c3279861618923 100644
|
| --- a/net/base/net_util_posix.cc
|
| +++ b/net/base/net_util_posix.cc
|
| @@ -42,7 +42,7 @@ namespace {
|
| #if !defined(OS_ANDROID)
|
|
|
| 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.
|
| @@ -70,12 +70,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;
|
| @@ -88,7 +88,8 @@ void RemovePermanentIPv6AddressesWhereTemporaryExists(
|
| #if defined(OS_MACOSX) && !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;
|
|
|
| @@ -132,9 +133,7 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
|
| std::string interface_address = network_tokenizer.token();
|
| IPAddressNumber address;
|
| size_t network_prefix = 0;
|
| - CHECK(ParseCIDRBlock(network_tokenizer.token(),
|
| - &address,
|
| - &network_prefix));
|
| + CHECK(ParseCIDRBlock(network_tokenizer.token(), &address, &network_prefix));
|
|
|
| CHECK(network_tokenizer.GetNext());
|
| uint32 index = 0;
|
| @@ -163,7 +162,7 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
|
| }
|
| #endif
|
|
|
| - ifaddrs *interfaces;
|
| + ifaddrs* interfaces;
|
| if (getifaddrs(&interfaces) < 0) {
|
| PLOG(ERROR) << "getifaddrs";
|
| return false;
|
| @@ -172,8 +171,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))
|
| @@ -198,8 +196,7 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
|
| continue;
|
| }
|
| } else if (addr->sa_family == AF_INET) {
|
| - struct sockaddr_in* addr_in =
|
| - reinterpret_cast<struct sockaddr_in*>(addr);
|
| + struct sockaddr_in* addr_in = reinterpret_cast<struct sockaddr_in*>(addr);
|
| addr_size = sizeof(*addr_in);
|
| if (addr_in->sin_addr.s_addr == INADDR_LOOPBACK ||
|
| addr_in->sin_addr.s_addr == 0) {
|
| @@ -228,7 +225,8 @@ bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
|
| ioctl_socket >= 0 && addr->sa_family == AF_INET6) {
|
| struct in6_ifreq ifr = {};
|
| strncpy(ifr.ifr_name, interface->ifa_name, sizeof(ifr.ifr_name) - 1);
|
| - memcpy(&ifr.ifr_ifru.ifru_addr, interface->ifa_addr,
|
| + memcpy(&ifr.ifr_ifru.ifru_addr,
|
| + interface->ifa_addr,
|
| interface->ifa_addr->sa_len);
|
| int rv = ioctl(ioctl_socket, SIOCGIFAFLAG_IN6, &ifr);
|
| if (rv >= 0) {
|
| @@ -289,5 +287,4 @@ scoped_ptr<ScopedWifiOptions> SetWifiOptions(int options) {
|
| return scoped_ptr<ScopedWifiOptions>();
|
| }
|
|
|
| -
|
| } // namespace net
|
|
|