Have IpManager track L2-L4 signaling traffic required for IP connectivity.
Test: as follows
- built and flashed
- observed logcat
- observed "dumpsys wifi ipmanager"
- runtest BlockingSocketReaderTest passes
- runtest ConnectivityPacketSummaryTest passes
Bug: 21859053
Bug: 26101306
Bug: 31742572
Bug: 31707128
Bug: 33531488
Change-Id: Ibecaf809dcc1813924b25749e8ba8eb2d4bdf114
diff --git a/core/java/android/net/NetworkUtils.java b/core/java/android/net/NetworkUtils.java
index 35e3065..a677d73 100644
--- a/core/java/android/net/NetworkUtils.java
+++ b/core/java/android/net/NetworkUtils.java
@@ -52,6 +52,17 @@
public native static void attachRaFilter(FileDescriptor fd, int packetType) throws SocketException;
/**
+ * Attaches a socket filter that accepts L2-L4 signaling traffic required for IP connectivity.
+ *
+ * This includes: all ARP, ICMPv6 RS/RA/NS/NA messages, and DHCPv4 exchanges.
+ *
+ * @param fd the socket's {@link FileDescriptor}.
+ * @param packetType the hardware address type, one of ARPHRD_*.
+ */
+ public native static void attachControlPacketFilter(FileDescriptor fd, int packetType)
+ throws SocketException;
+
+ /**
* Configures a socket for receiving ICMPv6 router solicitations and sending advertisements.
* @param fd the socket's {@link FileDescriptor}.
* @param ifIndex the interface index.