diff --git a/src/detection/localip/localip_linux.c b/src/detection/localip/localip_linux.c index f1814f77f..f93ee6f9d 100644 --- a/src/detection/localip/localip_linux.c +++ b/src/detection/localip/localip_linux.c @@ -17,10 +17,12 @@ #include #endif -#ifdef __linux__ +#if defined(__linux__) || defined(__ANDROID__) static bool getDefaultRoute(char iface[IF_NAMESIZE + 1]) { FILE* FF_AUTO_CLOSE_FILE netRoute = fopen("/proc/net/route", "r"); + if (!netRoute) return false; + // skip first line flockfile(netRoute); while (getc_unlocked(netRoute) != '\n');