Loading services/jni/com_android_server_connectivity_Vpn.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ static int create_interface(int mtu, char *name, int *index) { int tun = open("/dev/tun", O_RDWR); int inet4 = socket(AF_INET, SOCK_DGRAM, 0); int flags; ifreq ifr4; memset(&ifr4, 0, sizeof(ifr4)); Loading Loading @@ -86,6 +87,13 @@ static int create_interface(int mtu, char *name, int *index) goto error; } // Make it non-blocking. flags = fcntl(tun, F_GETFL, 0); if (flags == -1 || fcntl(tun, F_SETFL, flags | O_NONBLOCK)) { LOGE("Cannot set non-blocking on %s: %s", ifr4.ifr_name, strerror(errno)); goto error; } strcpy(name, ifr4.ifr_name); *index = ifr4.ifr_ifindex; close(inet4); Loading Loading
services/jni/com_android_server_connectivity_Vpn.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ static int create_interface(int mtu, char *name, int *index) { int tun = open("/dev/tun", O_RDWR); int inet4 = socket(AF_INET, SOCK_DGRAM, 0); int flags; ifreq ifr4; memset(&ifr4, 0, sizeof(ifr4)); Loading Loading @@ -86,6 +87,13 @@ static int create_interface(int mtu, char *name, int *index) goto error; } // Make it non-blocking. flags = fcntl(tun, F_GETFL, 0); if (flags == -1 || fcntl(tun, F_SETFL, flags | O_NONBLOCK)) { LOGE("Cannot set non-blocking on %s: %s", ifr4.ifr_name, strerror(errno)); goto error; } strcpy(name, ifr4.ifr_name); *index = ifr4.ifr_ifindex; close(inet4); Loading