This change modifies the RA filter generation code to ignore bytes 1-3
of the IPv6 header. It also updates testApfFilterRa such that it fails
without the updates to ApfFilter.
Test: as follows
- built
- flashed
- booted
- sent RAs from OS X with differing flow labels and observed
that they were filtered
- ApfTest passes
Bug: 31166495
(cherry picked from commit 7006bd4fe5eba4b6fad43dd28d9cad2d26ce140a)
Change-Id: I32153238193ac13a0e59be1875d983a0567c41c7
Introduce a SharedLog that can be shared among all Tethering
components. All log entries go to the same log, and each includes
its subsystem name. Additionally, all entries emitted to the
system log shared the same tag, so can easily be watched.
More subsystems can inherit a SharedLog, but to minimize cherry-pick
conflicts we limit ourselves to these changes only.
Test: as follows
- built
- flashed
- booted
- log output observed via dumpsys
- runtest frameworks-net passes
Bug: 32163131
Bug: 36988090
Bug: 38218697
Change-Id: I1229d4c55987402d84b0d4a2c8a595e0c829aa3e
This patch extracts into BitUtils byte manipulation helper methods
and unsigned type manipulation helper methods from ApfFilter into
an independent and reusable structure.
Test: $ runtest frameworks-net
Change-Id: I0f33af10457a63dbde5983f14353a79b8cd877d9
This allows an application that knows how to provide seamless
network connectivity (e.g., using QUIC multipath) to find out if
doing so is desired.
(cherry picked from commit 2de4925f5cc64aeb92e02a8f740d3ff20f36dddd)
Test: builds, boots, runtest frameworks-net passes.
Bug: 34630278
Change-Id: Ic7fd0b9e1cd879fdfaf84009d7125391895e9087
Direct access to Netd from the bluetooth process is disallowed by
SELinux policy. This change reverts to the old behavior where IpManager
interacts with NetdService indirectly via NetworkManagementService.
Bug: 36492299
This partially reverts commit af39244a34f4449c12a5f925222c9bc8d8049320.
Change-Id: Icf20b1e24abf7dd3123760f8637928bde7afe06b
On second thought, let's set accept_ra_rt_info_m**_plen in
Netd (InterfaceController::initializeAll())
This reverts commit 25870a2c9effd7a7d31c0678c34a6e952b2d56a1.
Change-Id: I22b000623bb852e375385d4aae789d007e84ba3d
This patch deprecates the ifname field for specific metrics events of
types DhcpClientEvent, DhcpErrorEvent, IpReachabilityEvent and
IpManagerEvent.
Instead ifnames are logged in ConnectivityMetricsEvent, allowing for
link layer inference.
Test: updated unit tests, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I8bfabcb115bbd5289471d653c153a40bb48f28cd
This patch tries to change accept_ra_rt_info_max_plen to 64 from its
default value of 0 on kernels that support router advertisements with
route information options. The code fails silently on older unsupported
platforms.
Also factor existing startIPv6() code into a self documenting function
enableInterfaceIpv6PrivacyExtensions()
Bug: 33333670
Test: as follows
- build sailfish
- flashed
- booted
- runtest frameworks-net passes
- runtest frameworks-wifi passes
Change-Id: I10ec83b9e04836089477d74417b7222499820066
This patch adds a few missing counters to APF events:
- an actual lifetime duration to ApfProgramEvent.
- counters for total number of updates to ApfStatistics.
ApfProgramEvents are now recorded at program removal in order to
populate the actual lifetime of the program. ApfProgramEvents whose
actual lifetime was less than 1 second are filtered out.
Finally, instance fields of ApfProgramEvent and ApfStats classes are
made mutable to allow for simple record-like creation. This was not
possible when these classes were tagged @SystemApi.
Test: - manually verified output of $ dumpsys connmetrics list
- unit tests updated.
Bug: 34901696
Change-Id: I02694ebb9421ce1c2aa757fa6aa209d19a654dcd
This allows an application that knows how to provide seamless
network connectivity (e.g., using QUIC multipath) to find out if
doing so is desired.
Test: builds, boots, runtest frameworks-net passes.
Bug: 34630278
Change-Id: Ic7fd0b9e1cd879fdfaf84009d7125391895e9087
Rename the class and ensure that all code related to bad wifi
avoidance has names that reflect its purpose. This will allow us
to reuse most of the the code for other purposes in future CLs.
Test: runtest frameworks-net passes
Bug: 34630278
Change-Id: Ida190e5a79e7a12f4eec07e1a3e4d9d138e83bcd
testApfFilterRa is failing with probabiliy 1/10 ~ 1/15 on the following
assert: assertDrop(program, packet, lifetime/6), for lifetime values
that are multiple of 6, where 6 is the hardcoded fraction of RA lifetime
to filter in ApfFilter.java.
When the lifetime is not a multiple of 6, the remainder of 1 to 5
seconds gives enough margin so that when the APF program is simulated
the faked lifetime of the program is less than lifetime/6 away and the
packet is dropped.
However for lifetimes which are exact multiples of 6, this margin is
always 0s and that result in nondeterminism in the result. This is
consistent with the obervation that the only failed assert was for a
lifetime of 300s, the only multiple of 6.
This can be observed by detecting the age limit at which the filter
stops dropping packet oscillating between lifetime/6 and lifetime/6 + 1
for lifetimes which are multiple of 6.
This patch fixes the flakyness by freezing the flow of time in tests so
that the expected filter age threshold is consistent and stable.
Test: no failure observed in 1000 runs.
Bug: 32561414
Change-Id: I5251d047039f34b82ce8a5d20ae46563e1e0cce8