(mostly to improve code coverage)
We can always revert if it ever turns out this is useful,
but I'd prefer for cgroup attach to be a once-at-boot
thing and handled either from bpfloader or the netd updatable
which are both directly C++ code.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I79b5ca8a47388cb6b9189234942e74ab6056aab9
* changes:
Add toString for more consistent logging to IaPrefixOption
Create IpPrefix in IaPrefixOption constructor
Add @Computed annotation to Struct
Remove check that preferred lifetime >= t2
Remove IA prefix option option-code from public constructor
The constructor is invoked during Struct#parse() at which point we might
as well try to create the IpPrefix object which will be used later. If
this fails for some reason (UnknownHostException or ClassCastException),
the prefix is bogus and should not be used.
Test: TH
Change-Id: I7e0090735022d017ba11aa85266ba19e65807da7
@Computed will ignore "computed" fields from struct parsing. Fields
cannot both be annotated by @Computed and @Field (though there
currently is no check for this).
Test: builds
Change-Id: I29fe506c5e3be4cc50fdaf3a07fc5e922111165b
For a single address, DHCPv6 won't work well (i.e. potentially lose provisioning) if
the preferred lifetime is lower than t2. However, this might be a valid
scenario in a renumbering event in the presence of multiple prefixes.
Additionally, in DHCPv6 it is up to the server to configure the client
correctly.
Test: TH
Change-Id: I37b2a0b89deda85b3f7be29c8f02f685aa6e65f8
Since it is constant. Struct.parse() still requires a constructor that
includes the code field, so it is marked protected.
Test: TH
Change-Id: Iccb4e3ec4078e0dcc73836f0d1b721146153da50
A helper class to *read* java BpfMaps. This is designed to
provide direct bpf access in the caller process through
ConnectivityManager APIs.
The change also removes any statical link to
net-utils-device-common-struct from service-connectivity.
This is because net-utils-device-common-struct is already
included in framework-connectivity. Including it again in
service-connectivity would create a r8 build fail by circular
dependency.
Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.StructTest
Test: atest FrameworksNetTests:android.net.connectivity.android.net.BpfNetMapsReaderTest
Bug: 297836825
Change-Id: I7a6d2eb816d0dc7343167bddd672806b199f44fe
There are only three calls to this method, and two of them
are with a list of 1 address which means it's simpler inlined.
The last call will be replaced with calls to RouteController
in a followup, meaning we addRoutesToLocalNetwork can be removed.
Test: RouterAdvertisementDaemonTest
NetdUtilsTest
Change-Id: I3b6ee1db40f09954b336321000735a66306bf000
aconfig soong modules should be used to read the trunk stable flag.
However they are not available in the mainline branch.
So this CL adds the method to check if the trunk stable flag is enabled
or not by directly reading from DeviceConfig.
It's expected that this does not work correctly if flag value is not
stored in the DeviceConfig.
But for the time being, this method can be used to keep development.
Once the mainline branch supports the aconfig soong modules, method
added by this CL must be removed and java_aconfig_library should be
used instead.
Test: adb shell device_config put android_core_networking \
Test: com.android.net.flags.test_feature true
Test: Compares the value from java_aconfig_library and DeviceConfigUtils
Change-Id: I8e35b33a3201192e940e88f96aad3b2b6685b046
* changes:
Move the MULTI_SIM_ACTION receiver inline
Inline registerForCarrierChanges
Make mThread a local
Introduce a flag for using the carrier service changed callbacks.
Have DevSdkIgnoreRunner support @Parameterized parameters
sepolicy gates RTM_GETNEIGH{TBL} with a new permission nlmsg_getneigh
and block access from untrusted_apps, but NetworkStackCoverageTests
uses the same UID with NetworkStack module, so it still has the
permission to send RTM_GETNEIGH(context: u:r:network_stack:s0<00>),
which causes the test always fails. Add the same assumeFalse check
for tests with network_stack context.
Bug: 283346574
Test: atest NetworkStackCoverageTests
Change-Id: Iaf652841bb9868783c924aa22fdf0c4f07e1e391