This patch adds in IpReachabilityMonitor a timestamp variable set
everytime that probeAll() send NUD probe requests to RTNETLINK.
This allows to distinguish between:
1) NUD_FAILED events resulting from such a forced NUD probe
2) "organic" NUD_FAILED notifications from the kernel
This distinction is added to IpReachabilityEvent as a one-bit flag.
This patch also changes the formatting of ApfProgramEvent flags to use
'|' as a joining character, similarly to other flags formatting.
Bug: 21859053
Change-Id: I24c64a3f17fa283eace5bd0a05c21a90a2305359
This patch adds lifetime durations of DhcpClient states to
DhcpClientEvents.
To record the duration of a state, the event is now recorded when the
DhcpClient state machine exits that state.
In addition this patch removes event logging of StoppedState,
DhcpState and DhcpHaveLeaseState.
Change-Id: Ibd37b5e3070f35113b6b45942b1e1ff19c27a90b
This patch
- adds a Builder class for RaEvent.
- uses this Builder class for correctly recording the minimum
lifetime seen for every ICMP6 options tracked, instead of
recording the last lifetime seen.
- adds unit test coverage for RaEvent logging.
Change-Id: I6443932f5cf7a613a5c695c65a60eab01e60602a
This patch defines a new android.net.metrics.RaEvent class carrying
lifetime values contained in RA packets. RaEvent are recorded when
ApfFilter processes a new RA for which there is no match.
Example:
ConnectivityMetricsEvent(15:39:39.808, 0, 0): RaEvent(lifetimes: router=3600s, prefix_valid=2592000s, prefix_preferred=604800s, route_info=-1s, dnssl=-1s, rdnss=3600s)
Change-Id: Ia28652e03ed442d5f2a686ef5b3fafbcb77c503a
This patch adds a new ApfStats event class that counts RA packet
reception statistics on the RA listener thread of ApfFilter and reports
the maximum program size advertised by hardware.
Statistics are gathered for the lifetime of a network with APF
capabilities and uploaded at network teardown when the listener thread
exits.
Example event:
ConnectivityMetricsEvent(15:44:23.741, 0, 0): ApfStats(284945ms 2048B RA: 2 received, 0 matching, 0 ignored, 0 expired, 0 parse errors, 2 program updates)
Bug: 28204408
Change-Id: Id2eaafdca97f61152a4b66d06061c971bc0aba4c
This patch removes static methods for logging IP connectivity events
defined in android.net.metrics and replaces them with a single log()
instance method defined on IpConnectivityLog. Event constructors are
now public also. Every classes logging such events now create an
instance of IpConnectivityLog for logging event objects directly
instantiated with new.
Removing static dependencies allow straightforward testing of logging.
This patch also removes the base IpConnectivityEvent class which is not
needed any more.
Bug: 29035129
Change-Id: I3de700f93f46deaa48a759f938f7d00e1d8bff98
A malformed RA could cause the Ra constructor in ApfFilter to
enter an infinite loop while holding the class lock. This blocks
IpManager until reboot and drains the battery.
Bug: 29586253
Change-Id: Idaa46b3bc50371db076630881883807c2fa21674
IPv4 broadcast packets can be very common (e.g. every 2s) so they
need to be dropped in the general case. They also may be critical
for certain discovery protocols, so allow them through with APF
when the WiFi multicast lock is held.
Bug: 26238573
Change-Id: I03e09a2b9c779da5da775e78b95e9e0339720eaf
For now this just drops all non-ICMPv6 packets to ff00::/8 when
mMulticastFilter is true. Multicast ICMPv6 is already mostly
dealt with by other filters - the L2 multicast filter, the RA
filter, the multicast NA filter, and ND offload.
Bug: 28393601
Change-Id: Ia7b0d4f00fac6710093befe6a726b46677a5f20b
This used to be done by some WiFi firmwares but should now be done by APF
for consistency across the board.
Bug: 28304368
Change-Id: Ic75f408affc1f56e1ecf4d347d0c287aa72250bf
This ensures that IpManager has a complete copy of DHCP state
before configuring the IPv4 address. That way, when the netlink
notification of the IPv4 address arrives, we are guaranteed to
have all DHCP information (including DNS servers and routes)
available and we will never send the IPv4 address before the DNS
servers.
Bug: 27605330
Change-Id: I732424dfe2408be9e40028563e99d610b541e12d
Now that it's long since been unused also delete the locking that was
introduced to make it possible.
Bug: 17733693
Bug: 24837343
Change-Id: Iee817a7c2e1d1dc9c080d3124d5986232dcda00f
- fold IpReachabilityMonitor* classes into a single IpReachabilityEvent.
- only log an event for NUD_FAILED Netlink answers.
- distinguish between NUD_FAILED with or without lost of provisioning.
- do not record host ip addresses.
- record interface name instead of interface index when losing
provisioning.
- also return an error code when probeNeighbor fails, and log this error
code in IpReachability events.
Bug: 28204408
Change-Id: I5f0def0ab1ace7e467a0c69b3b82d07ef2252307
This patch moves the event logging of DHCP response packet parse errors
to DHCPClient in a single place. It also logs receive IO errors as
DHCPErrors instead of DHCPClientEvents.
BUG=28197345
Change-Id: I7ad666cff4d8b97915880477347fbb3f588fdb2a
APF version 2 and prior versions fail to execute JNEBS with R1 argument.
The APF interpreter tries to use R1's value as the number of bytes to
compare, as well as the offset within the packet to compare at.
This change makes ApfFilter avoid using this and makes the APF generator
throw if this is used. This was limiting the IPv4 filter, causing it to
only drop multicast (when multicast filtering was enabled), rather than
a wider range of broadcast packets.
Bug: 28206777
Change-Id: I8d116e024e8bd641b21053c6b1defc734d744467
This patch adds an event class derived from IpConnectivityEvent that
records parsing errors of DHCP response packets.
Change-Id: I19516cf05e3419c4262e3236899e52987e5f2264
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