Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de5df131 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by android-build-merger
Browse files

Merge "Remove framework code that calls SIOCKILLADDR" into nyc-dev am: e6109ddd

am: 7ceb8f53

* commit '7ceb8f53':
  Remove framework code that calls SIOCKILLADDR
parents c2d63160 7ceb8f53
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -39,23 +39,6 @@ public class NetworkUtils {

    private static final String TAG = "NetworkUtils";

    /** Setting bit 0 indicates reseting of IPv4 addresses required */
    public static final int RESET_IPV4_ADDRESSES = 0x01;

    /** Setting bit 1 indicates reseting of IPv4 addresses required */
    public static final int RESET_IPV6_ADDRESSES = 0x02;

    /** Reset all addresses */
    public static final int RESET_ALL_ADDRESSES = RESET_IPV4_ADDRESSES | RESET_IPV6_ADDRESSES;

    /**
     * Reset IPv6 or IPv4 sockets that are connected via the named interface.
     *
     * @param interfaceName is the interface to reset
     * @param mask {@see #RESET_IPV4_ADDRESSES} and {@see #RESET_IPV6_ADDRESSES}
     */
    public native static int resetConnections(String interfaceName, int mask);

    /**
     * Attaches a socket filter that accepts DHCP packets to the given socket.
     */
+0 −17
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@
extern "C" {
int ifc_enable(const char *ifname);
int ifc_disable(const char *ifname);
int ifc_reset_connections(const char *ifname, int reset_mask);
}

#define NETUTILS_PKG_NAME "android/net/NetworkUtils"
@@ -50,21 +49,6 @@ namespace android {

static const uint16_t kDhcpClientPort = 68;

static jint android_net_utils_resetConnections(JNIEnv* env, jobject clazz,
      jstring ifname, jint mask)
{
    int result;

    const char *nameStr = env->GetStringUTFChars(ifname, NULL);

    ALOGD("android_net_utils_resetConnections in env=%p clazz=%p iface=%s mask=0x%x\n",
          env, clazz, nameStr, mask);

    result = ::ifc_reset_connections(nameStr, mask);
    env->ReleaseStringUTFChars(ifname, nameStr);
    return (jint)result;
}

static void android_net_utils_attachDhcpFilter(JNIEnv *env, jobject clazz, jobject javaFd)
{
    uint32_t ip_offset = sizeof(ether_header);
@@ -181,7 +165,6 @@ static jboolean android_net_utils_queryUserAccess(JNIEnv *env, jobject thiz, jin
 */
static const JNINativeMethod gNetworkUtilMethods[] = {
    /* name, signature, funcPtr */
    { "resetConnections", "(Ljava/lang/String;I)I",  (void *)android_net_utils_resetConnections },
    { "bindProcessToNetwork", "(I)Z", (void*) android_net_utils_bindProcessToNetwork },
    { "getBoundNetworkForProcess", "()I", (void*) android_net_utils_getBoundNetworkForProcess },
    { "bindProcessToNetworkForHostResolution", "(I)Z", (void*) android_net_utils_bindProcessToNetworkForHostResolution },