DHCP receive thread was spinning on a boolean variable to know when to
stop. That variable had no volatile qualifier, potentially preventing
the thread from stopping at all. Without a volatile qualifier, the reads
and writes in halt() could be reordered in such a way that the running
thread is interrupted before mStopped is set t true. Also, the optimizer
could decide to hoist mStopped in a register inside the running thread,
preventing the loop from exiting.
Change-Id: I5b30c1247808114f0e5b46e230978ee7ea18ab8e
1. Decode RDNSS options.
2. Keep track of how many times the program was updated.
3. Remove the leading / from the IPv4 address.
Change-Id: Ida0518a94ea7d952c82c8181b09044eff907b714
When an interface is removed, all netlink events for that
interface are lost, because netd will no longer be able to
resolve the ifindex in the netlink event to an interface name,
and it only communicates to the framework events that include an
interface name.
This can cause us to end up with stale IP addresses if, for
example, wlan0 is removed because we switch wifi back from AP
mode to STA mode when exiting tethering. The presence of stale
IPv4 addresses can in turn lead us to miss a provisioning
notification because we already think we have an IPv4 address.
Change-Id: Ib64559a5a4fa261f483760b69fa7996314e7cc17
The WiFi chipset's ARP offload may handle this when the
AP is asleep, but when the AP is awake and the chipset is in
wake-on-wifi mode use APF to filter these packets.
Bug: 27477163
Change-Id: I180c08bd7301a1af9c3f728ff3cba06ca4e1022d
Use APF to implement WifiManager.MulticastLock, if APF isn't available
fallback to the present behavior of using DRIVER RXFILTER. Since we
don't know whether APF is supported until we're connected, postpone
enabling/disabling the multicast filter until then; this should be
fine as there isn't much need to filter packets if there aren't any
packets going by since we're not connected.
Bug: 26238573
Change-Id: I862c053f1c8c3a41de50c2951cf14b3ca6923a2a
Avoid adjusting ApfFilter.Ra.mPacket's postion() and limit()
in matches(). This avoids potential bugs in other parts of
the code that previously relied on limit() being reset.
Also for good measure change some limit() calls to capacity()
as it's more final.
Change-Id: I466e87ce6838f68654b24f2c9543a6cd547d3f87
There's a few advantages to having ApfFilter in IpManager:
1. If things go wrong, crashing a particular transport is less bad then
crashing ConnectivityService. We also don't want to use
ConnectivityService as a dumping ground for transport-specific logic.
2. This makes implementing WifiManager.MulticastLock a lot simpler and
safer because enabling/disabling it doesn't have to go through the
NetworkAgent, which could risk various races (e.g. installing a filter
into the wrong WiFi network).
3. IpManager is the ultimate source for LinkProperties for a particular
transport and since ApfFilter uses the LinkProperties it's better to
have it closely paired with the IpManager. Likewise, ApfFilter needs
to know the APF capabilities of the transport, so having it in
the transport avoids having to parcel this information through the
NetworkAgent.
Bug: 26238573
Change-Id: I99b85f2b64972f0e7572170ec5d1926081aa3429
Adds initial support for IP connectivity metrics collection (DHCP
client, IP reachability monitor, network monitor, connectivity
service).
Change-Id: If9a0455f2a34aa9abea90f9c1b38e4d895dc1a72
This should only happen if we get a packet in the small time
window between binding the packet socket and programming the
BPF filter on it.
Bug: 26696823
Change-Id: I481f1bc74bbaeb9646d96e1841d2a69acdb47d62
This centralizes code that is shared by both bluetooth and ethernet
transport layers.
Bug: 26991160
Change-Id: I8e2dd8580c29c86394119768e3a5529850b4b859
This class uses reflection to find accessible static integer
members in a specified list of classes and returns a SparseArray
mapping the integers to their names. This will allow us to
replace various 400-line switch statements with a simple
array access.
Change-Id: I3607e6389a423cde0bd83270c00b3c863ae1bb29
Additionally, remove IpManager.Callback#usingIpReachabilityMonitor()
now that this is now longer used.
Bug: 26991160
Change-Id: I9a17497c82238a9fb37a20d01aeca7bc4913ae2c
This class captures provisioning request parameters to be passed to
IpManager#startProvisioning().
Bug: 26991160
Change-Id: I56652bbc4b9ae6cfca3f225a8d99cdfc01bb54d9