diff --git a/rtc_base/network.cc b/rtc_base/network.cc index 58764c74e1..4906184b5d 100644 --- a/rtc_base/network.cc +++ b/rtc_base/network.cc @@ -11,15 +11,7 @@ #include "rtc_base/network.h" #if defined(WEBRTC_POSIX) -// linux/if.h can't be included at the same time as the posix sys/if.h, and -// it's transitively required by linux/route.h, so include that version on -// linux instead of the standard posix one. -#if defined(WEBRTC_LINUX) -#include -#include -#elif !defined(__native_client__) #include -#endif #endif // WEBRTC_POSIX #if defined(WEBRTC_WIN) @@ -30,8 +22,6 @@ #include "rtc_base/ifaddrs_converter.h" #endif -#include - #include #include "absl/algorithm/container.h" @@ -764,33 +754,6 @@ bool BasicNetworkManager::CreateNetworks(bool include_ignored, } #endif // WEBRTC_WIN -#if defined(WEBRTC_LINUX) -bool IsDefaultRoute(const std::string& network_name) { - FILE* f = fopen("/proc/net/route", "r"); - if (!f) { - RTC_LOG(LS_WARNING) - << "Couldn't read /proc/net/route, skipping default " - "route check (assuming everything is a default route)."; - return true; - } - bool is_default_route = false; - char line[500]; - while (fgets(line, sizeof(line), f)) { - char iface_name[256]; - unsigned int iface_ip, iface_gw, iface_mask, iface_flags; - if (sscanf(line, "%255s %8X %8X %4X %*d %*u %*d %8X", iface_name, &iface_ip, - &iface_gw, &iface_flags, &iface_mask) == 5 && - network_name == iface_name && iface_mask == 0 && - (iface_flags & (RTF_UP | RTF_HOST)) == RTF_UP) { - is_default_route = true; - break; - } - } - fclose(f); - return is_default_route; -} -#endif - bool BasicNetworkManager::IsIgnoredNetwork(const Network& network) const { // Ignore networks on the explicit ignore list. for (const std::string& ignored_name : network_ignore_list_) {