History log of /frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7d21eaedade0e01bed665dd2e4ba15e0c217237c 02-Sep-2016 Hugo Benichi <hugobenichi@google.com> ApfFilter: take into account IPv4 subnet prefix

When IPv4 is provisioned on an interface with Apf capabilities,
ApfFilter will only keep track of the raw ipv4 address, with no
information about the subnet or prefix length.

This patch adds the missing prefix length information to ApfFilter. This
allows to calculate the subnet broadcast ipv4 address for more
precise ipv4 broadcast filtering when the multicast lock is not held.

Bug: 30231088

Change-Id: Iebaec040703647c4ced30bb585be173e97a1fae5
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
0dc1d314709d579ccdc3fc59a5f66557f6cd319d 01-Sep-2016 Hugo Benichi <hugobenichi@google.com> ApfFilter: more precise IPv4 broadcast filter

This patch refines the Apf IPv4 filter for interfaces with Apf
capabilities to drop packets when:
- the multicast lock is not held
- the packet is an IPv4 packet
- the packet is not a DHCP packet addressed to us
- the packet is L2 broadcast, or IPv4 multicast, or IPv4 broadcast
- caveat: subnet broadcast address is not checked.

This allows to drop IPv4 broadcast packets whose MAC destination
address is not the L2 broadcast address but the current address of the
interface. Such packets can be received on network that rewrite L2
addresses and can put significant pressure on battery by waking up the
phone unnecessarily.

Bug: 30231088

Change-Id: I8b1785fc5ceadaa1f2881765983e502135dcbc46
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
961ca49fd67b39d8076ea49d12d2fda73f581399 02-Sep-2016 Hugo Benichi <hugobenichi@google.com> Better IPv4 multicast coverage in ApfTest

This patch improves the test coverage of ApfFilter for IPv4 broadcast and
multicast traffic.

Bug: 30231088
Change-Id: I2e1d5d5a7cbae17f3d5978a4cf5f10666b5c6104
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
38db976514ff2ad12d207a927219762eab179882 12-Jul-2016 Hugo Benichi <hugobenichi@google.com> APF: filter unwanted ARP replies

This patch adds APF filtering of ARP replies for interfaces with APF.

- when the interface has no IPv4 address, broadcast ARP replies with a
0.0.0.0 target ip are dropped (GARP), ARP requests with a 0.0.0.0
target ip are dropped.

- when the interface has an IPv4 address, broadcast ARP replies to a
different ip are dropped (including GARPs to 0.0.0.0), ARP requests to
a different ip are dropped.

Bug: 29404209
Bug: 30080487
Change-Id: I82613eb865c7f38b6260997fe2caf2aff382ad78
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
6ccd51a338fed39217cb3a5c0f229ed547918634 04-Jul-2016 Hugo Benichi <hugobenichi@google.com> IpConn metrics: correctly read RA lifetimes

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
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
4fc3ee5be223122792ebc0ee8a05c93d93e26a52 02-Jun-2016 Hugo Benichi <hugobenichi@google.com> Log events at APF program generation

Example:
ConnectivityMetricsEvent(15:24:52.018, 0, 0): ApfProgramEvent(0/0 RAs 121B forever FLAG_MULTICAST_FILTER_ON)
ConnectivityMetricsEvent(15:24:53.036, 0, 0): ApfProgramEvent(1/1 RAs 334B 600s)
ConnectivityMetricsEvent(15:24:53.590, 0, 0): ApfProgramEvent(1/1 RAs 360B 600s FLAG_MULTICAST_FILTER_ON, FLAG_HAS_IPV4_ADDRESS)
ConnectivityMetricsEvent(15:24:58.157, 0, 0): ApfProgramEvent(1/1 RAs 294B 599s FLAG_HAS_IPV4_ADDRESS)

Bug: 28204408
Change-Id: I9c4c82861cf42eb2c7e7bf5471f05e8ff2fc560c
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
8995d85b9432387520c9f04a69251536754b996b 23-Jun-2016 Lorenzo Colitti <lorenzo@google.com> Don't loop forever on 0-length options.

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
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
f8a01e84317fcb9d27a294e95603b846143c7fcb 26-May-2016 Paul Jensen <pauljensen@google.com> Don't drop IPv4 broadcast packets when WiFi multicast lock is held

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
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
11e13e2175674389ed18c2b1e1af69c5ad931e8f 19-May-2016 Lorenzo Colitti <lorenzo@google.com> Support IPv6 multicast filtering in APF.

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
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java
9132f34976f16a626c2ec1d3d90624d71e054346 13-Apr-2016 Paul Jensen <pauljensen@google.com> ApfFilter unit test

Bug: 26238573

Change-Id: I5171038228782bd54e91f5bcc663cc529d2c1150
/frameworks/base/services/tests/servicestests/src/android/net/apf/ApfTest.java