Rather than bundling a copy of the framework annotations, reference them
via framework-annotations-lib as a libs reference. This ensures the
target inherits any necessary keep rule configurations, and is the same
pattern used by other mainline modules.
Bug: 275175207
Test: m
Flag: EXEMPT refactor
Change-Id: I014aa79f4fec69aef062a2fb855a50f658380ac5
Watches do not have a VpnManager instance anymore, so the tests crashes
at the teardown step when trying to interact with a null VpnManager.
Bug: 368624224
Bug: 340928692
Test: Ikev2VpnTest
Change-Id: Iedf784625933e73bcb5fed9bfa36fbae1e11d398
The mapping from network to interface name is passed from
ThreadNetworkControllerService to NsdPublisher, so that NsdPublisher can
send interface index to mdns subscribers when a service is resolved.
Bug: 321883491
Test: presubmit
Change-Id: I401c38ba3fbc7b2a2de5cbc9ab1132c657518f32
This CL mainly adds the createSetLinkNameMessage() method at the
RtNetlinkLinkMessage class, that creates a link message to rename the
network interface. The functionality is the same as
"ip link set $interface name NEW_NAME".
Bug: 364501824
Test: atest NetworkStaticLibTests
Change-Id: I6323bce1ece10f4437483214860d50cb7d29df8d
This CL mainly adds the createSetLinkStateMessage() method at the
RtNetlinkLinkMessage class, that creates a link message to set the
interface up or down. The functionality is the same as
"ip link set $interface up" or "ip link set $interface down".
Bug: 364501824
Test: atest NetworkStaticLibTests
Change-Id: Id9232851f6d9a7f99f857fd5b8d4eae506de2c7c
Take the functionality from the (better) FakeDns in NetworkStack,
move it to the FakeDns in staticlibs, and port it to kotlin.
Test: test-only change
Change-Id: I6d0b4a348ca86ab69785cdf722c259ef6a92ce4b
Lorenzo Colitticommited 2024-09-19 12:51:28 +09:00
Since this is just a special case of a bpf cgroup hook,
it really should be in netd.o with all other such hooks.
Besides moving/renaming the map & programs this should be a no-op.
Test: TreeHugger, atest bpf_existence_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4a2aedaf77f89a9c0a96fa1c369d80659535eabe
Maciej Żenczykowskicommited 2024-09-19 00:40:53 +00:00
All 6 .c files under bpf/progs are flagged CRITICAL(),
and as such we can simplify this logic.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I884705e1f0fdb20c992499aa2c83d5953a24fd9e
Maciej Żenczykowskicommited 2024-09-18 23:46:16 +00:00
Fixes the deadlock described by the below two thread states:
Thread 1:
- ConsumeAll() (takes mBufferMutex)
- perfetto::DataSource::Trace() (takes Perfetto mutex)
Thread 2:
- StartDataSourceImpl() (takes Perfetto mutex)
- NetworkTracePoller::Start() (takes mBufferMutex)
Locks should always be taken in the same order. To achieve this,
ConsumeAll only locks mBufferMutex while accessing the buffer, and
releases it before calling the callback (which under typical use calls
DataSource::Trace() as in "Thread 1").
As a fun side note, Start() always calls ConsumeAll(), so there exists a
lock sequence of perfetto mutex -> mBufferMutex -> perfetto mutex, thus
this order was always "exercised". However, Perfetto uses a recursive
mutex, so the second lock was a no-op, making this hard to catch.
Bug: 320700806
Test: atest libnetworkstats_test
Change-Id: If8c5e0e218666ec53a287ec56333a6d3b8cfe08f
There no longer needs to be separate locked and unlocked methods now
that the buffer has its own mutex.
The most notable change is that within PollAndSchedule, we go from using
try_lock to using the scoped_lock in ConsumeAll. The try_lock was meant
to prevent the following deadlock:
- Stop() takes mMutex and calls mTaskRunner.reset()
- mTaskRunner awaits completion of final closure (PollAndSchedule)
- PollAndSchedule is blocked trying to acquire mMutex
Now that ConsumeAll depends only on mBufferMutex, a more elegant
solution is to just ensure that Stop() isn't holding mBufferMutex while
calling mTaskRunner.reset().
Bug: 320700806
Test: atest libnetworkstats_test
Change-Id: Id5df18bc5809ba193bbe1aa0b97121bd5a8afdcd
This covers the ring buffer and ConsumeAll methods. This change also
removes unnecessary GUARDED_BY for TraceIfaces (making it static) and
mCallback (making it const).
This should be close to a no-op. The new lock is taken in addition to,
or instead of in the few places it's needed.
Bug: 320700806
Test: atest libnetworkstats_test
Change-Id: I45d36eba033afae1c03eac2f8d5b2ac4c9e78716
Ryan Zuklieauthored and Maciej Żenczykowskicommited 2024-09-18 18:34:17 +00:00
INGRESS_TO_VPN_ADDRESS_FILTERING is disabled due to b/352424251 and
testDropPacketToVpnAddress fails if the feature is disabled.
So skip testDropPacketToVpnAddress if the feature is disabled.
Bug: 362434644
Test: adb shell device_config put tethering
ingress_to_vpn_address_filtering -1
Test: atest CtsHostsideNetworkTests
(cherry picked from https://android-review.googlesource.com/q/commit:9d5d7d07793549a9c8a19d6277c498683cb7da3f)
Merged-In: Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d
Change-Id: Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d
Motomu Utsumiauthored and Android Build Cherrypicker Workercommited 2024-09-18 11:12:45 +00:00
This CL marks all the fields of RtNetlinkLinkMessage class final. That
means once the instance is created, the instance is immutable.
Also, the CL adds a static create method that verifies the arguments,
and updates the nlmsg_len field of the header before creation.
Bug: 364501824
Test: atest NetworkStaticLibTests
Change-Id: I08af4a6e68df9aee8ae76d953fac5d81f0b02c84
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on
devices that have config_multiuserVisibleBackgroundUsers enabled. The
main use case is Automotive's multi-display Whole Cabin experience where
passengers (modeled as visible background users) can interact with the
display in front of them concurrently with the driver (modeled as the
current user) interacting with driver's display.
Bug: 364635030
Test: atest CtsNetApi23TestCases
Test: atest --user-type secondary_user_on_secondary_display \
CtsNetApi23TestCases
(cherry picked from https://android-review.googlesource.com/q/commit:7969d8baff85ae6c2165e7ac525c913546f070f0)
Merged-In: I9315eff338e5ba232c26e27d2885ab922abddabd
Change-Id: I9315eff338e5ba232c26e27d2885ab922abddabd
bkchoiauthored and BK Choicommited 2024-09-17 15:27:28 +00:00
Instead of the current "tehtering" namespace.
Also, flags pushed via DeviceConfig come with a
"CertificateTransparencyLogList" feature prefix.
Flag: com.android.net.ct.flags.certificate_transparency_service
Bug: 319829948
Test: atest NetworkSecurityUnitTests
Change-Id: I565f888409f21e78cc28684cbf7daaae44b95d57
With the addition of defaults to the bpf soong module (see aosp/3249485
), the name `bpf_defaults` will be used to define defaults for bpf
program compilation. While there are separate soong namespaces for
module types and module names, rename the existing bpf_defaults
cc_defaults to bpf_cc_defaults for clarity.
While we're at it, add -Wextra, and cleanup unnecessary cflags in
clauses which use bpf_cc_defaults. Add -Wno-sign-compare to resolve
build issues in external test code.
Test: TH
Change-Id: Id0407f86ad50033a77a8679d465dc9412991d764
Signed-off-by: Neill Kapron <nkapron@google.com>
The services in the cache are no longer useful after the network
is disconnected. Because either the Network object or the
interface index will change after the network is reconnected,
these cached services won't be used for any discovery/resolution/
service info callback requests. Therefore, these cached services
should be removed after the network is disconnected. Otherwise,
these useless cached services will occupy memory until the device
is rebooted.
In addition, the cached service may not be reliable after the
last listener is unregistered. Because the socket is
disconnected, the service type client won't receive any updates
for the services. Therefore, remove these cached services after
exceeding the keeping time.
Bug: 355421878
Test: atest FrameworksNetTests NsdManagerTest
Change-Id: I06ff320fec84f71dc2ed742c50fa46f25c284170
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on devices that have config_multiuserVisibleBackgroundUsers enabled. The main use case is Automotive's multi-display Whole Cabin experience where
passengers (modeled as visible background users) can interact with the display in front of them concurrently with the driver (modeled as the the current user) interacting with driver's display.
Tested on gcar_md emu
Flag: TEST_ONLY
Bug: 356700021
Bug: 354233217
Bug: 358707308
Test: atest --user-type secondary_user_on_secondary_display CtsThreadNetworkTestCases
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b642178a9426f854f4496c07c8440d5ed417167c)
Merged-In: Iad7deb2c2715f6ef684ecc16b95a2fbbc7bb5260
Change-Id: Iad7deb2c2715f6ef684ecc16b95a2fbbc7bb5260
(cherry picked from commit 47b87650d1)