Loading include/netutils/ifc.h +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ extern int ifc_down(const char *name); extern int ifc_enable(const char *ifname); extern int ifc_disable(const char *ifname); extern int ifc_reset_connections(const char *ifname); extern int ifc_reset_connections(const char *ifname, const int reset_mask); extern int ifc_get_addr(const char *name, in_addr_t *addr); extern int ifc_set_addr(const char *name, in_addr_t addr); Loading libnetutils/ifc_utils.c +32 −22 Original line number Diff line number Diff line Loading @@ -353,7 +353,11 @@ int ifc_disable(const char *ifname) return result; } int ifc_reset_connections(const char *ifname) #define RESET_IPV4_ADDRESSES 0x01 #define RESET_IPV6_ADDRESSES 0x02 #define RESET_ALL_ADDRESSES (RESET_IPV4_ADDRESSES | RESET_IPV6_ADDRESSES) int ifc_reset_connections(const char *ifname, const int reset_mask) { #ifdef HAVE_ANDROID_OS int result, success; Loading @@ -361,6 +365,7 @@ int ifc_reset_connections(const char *ifname) struct ifreq ifr; struct in6_ifreq ifr6; if (reset_mask & RESET_IPV4_ADDRESSES) { /* IPv4. Clear connections on the IP address. */ ifc_init(); ifc_get_info(ifname, &myaddr, NULL, NULL); Loading @@ -368,7 +373,11 @@ int ifc_reset_connections(const char *ifname) init_sockaddr_in(&ifr.ifr_addr, myaddr); result = ioctl(ifc_ctl_sock, SIOCKILLADDR, &ifr); ifc_close(); } else { result = 0; } if (reset_mask & RESET_IPV6_ADDRESSES) { /* * IPv6. On Linux, when an interface goes down it loses all its IPv6 * addresses, so we don't know which connections belonged to that interface Loading @@ -383,6 +392,7 @@ int ifc_reset_connections(const char *ifname) result = success; } ifc_close6(); } return result; #else Loading Loading
include/netutils/ifc.h +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ extern int ifc_down(const char *name); extern int ifc_enable(const char *ifname); extern int ifc_disable(const char *ifname); extern int ifc_reset_connections(const char *ifname); extern int ifc_reset_connections(const char *ifname, const int reset_mask); extern int ifc_get_addr(const char *name, in_addr_t *addr); extern int ifc_set_addr(const char *name, in_addr_t addr); Loading
libnetutils/ifc_utils.c +32 −22 Original line number Diff line number Diff line Loading @@ -353,7 +353,11 @@ int ifc_disable(const char *ifname) return result; } int ifc_reset_connections(const char *ifname) #define RESET_IPV4_ADDRESSES 0x01 #define RESET_IPV6_ADDRESSES 0x02 #define RESET_ALL_ADDRESSES (RESET_IPV4_ADDRESSES | RESET_IPV6_ADDRESSES) int ifc_reset_connections(const char *ifname, const int reset_mask) { #ifdef HAVE_ANDROID_OS int result, success; Loading @@ -361,6 +365,7 @@ int ifc_reset_connections(const char *ifname) struct ifreq ifr; struct in6_ifreq ifr6; if (reset_mask & RESET_IPV4_ADDRESSES) { /* IPv4. Clear connections on the IP address. */ ifc_init(); ifc_get_info(ifname, &myaddr, NULL, NULL); Loading @@ -368,7 +373,11 @@ int ifc_reset_connections(const char *ifname) init_sockaddr_in(&ifr.ifr_addr, myaddr); result = ioctl(ifc_ctl_sock, SIOCKILLADDR, &ifr); ifc_close(); } else { result = 0; } if (reset_mask & RESET_IPV6_ADDRESSES) { /* * IPv6. On Linux, when an interface goes down it loses all its IPv6 * addresses, so we don't know which connections belonged to that interface Loading @@ -383,6 +392,7 @@ int ifc_reset_connections(const char *ifname) result = success; } ifc_close6(); } return result; #else Loading