summaryrefslogtreecommitdiff
path: root/src/android/net/dhcp/DhcpClient.java
diff options
context:
space:
mode:
authorpaulhu <paulhu@google.com>2019-03-29 17:22:20 +0800
committerpaulhu <paulhu@google.com>2019-04-03 17:49:36 +0800
commite455e2a1982365a52e2c93b37469650c2a2e79be (patch)
tree52c997fd9b106afc329c93e55370c206befe3f07 /src/android/net/dhcp/DhcpClient.java
parent5982efffc8d98fcadbbfa61a3f382526174a2bc6 (diff)
Move attach*Filter() and addArpEntry() methods to NetworkStack
The SocketUtils.attach*Filter and SocketUtils.addArpEntry methods were added there because they could not be added as JNI inside the NetworkStack. This was not possible because on Go devices, the NetworkStack was a jar library. But now, Go also uses an APK. Hence, move these methods to the NetworkStack. Change-Id: I1d88a0f0be23f2b15d5103fa092b9bf982329d7c Fix: 129433183 Test: atest NetworkStackTests FrameworksNetTests
Diffstat (limited to 'src/android/net/dhcp/DhcpClient.java')
-rw-r--r--src/android/net/dhcp/DhcpClient.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/android/net/dhcp/DhcpClient.java b/src/android/net/dhcp/DhcpClient.java
index 79d6a55..64adc0d 100644
--- a/src/android/net/dhcp/DhcpClient.java
+++ b/src/android/net/dhcp/DhcpClient.java
@@ -51,6 +51,7 @@ import android.net.metrics.DhcpClientEvent;
import android.net.metrics.DhcpErrorEvent;
import android.net.metrics.IpConnectivityLog;
import android.net.util.InterfaceParams;
+import android.net.util.NetworkStackUtils;
import android.net.util.SocketUtils;
import android.os.Message;
import android.os.SystemClock;
@@ -319,7 +320,7 @@ public class DhcpClient extends StateMachine {
mPacketSock = Os.socket(AF_PACKET, SOCK_RAW, ETH_P_IP);
SocketAddress addr = makePacketSocketAddress((short) ETH_P_IP, mIface.index);
Os.bind(mPacketSock, addr);
- SocketUtils.attachDhcpFilter(mPacketSock);
+ NetworkStackUtils.attachDhcpFilter(mPacketSock);
} catch(SocketException|ErrnoException e) {
Log.e(TAG, "Error creating packet socket", e);
return false;