Commit graph android_packages_modules_Co.../service/src/com/android/server/BpfNetMaps.java
Message SHA1
remove TrafficController::dump
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I399ac8dfc4992f4c604f1d32c2f1b8ae06710808

Maciej Żenczykowski   commited 2023-09-06 16:50:06 +00:00
d70a33061e
Split BpfNetMaps constants and utilities into standalone classes
This is a no-op refactoring that splits constants and utility
methods into standalone classes which will be shared with
a bpf reader class in subsequent CLs.

NO_IFTTT=No-op refactoring

Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.StructTest

Bug: 297836825
Change-Id: I6d7ea044e43180ae001573009a166be74ebe6a5d

Junyu Lai   commited 2023-08-29 08:20:10 +00:00
29b7b6385a
Use Java code path for bpf map operations in BpfNetMaps
Experiment to verify bpf map operations refactoring showed no
change of map size metrics and no system health regressions.
So this CL update BpfNetMaps to always use new code path with kill
switch.

Test: m
Bug: 217624062
Change-Id: Ic17470ac5c075884871ea2df2c13c054f5ac2929

Motomu Utsumi   commited 2023-08-16 20:08:20 +09:00
7628ea30b0
Revert "KNOWN BAD CHANGE - it should cause lint failures (but doesn't??)."
This reverts commit fc9875f537.

Reason for revert: known to be bad.

Change-Id: I9b8db53c054119f454e50007f56232312a0ba595

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-07-18 20:14:38 +00:00
70fbfa43ed
KNOWN BAD CHANGE - it should cause lint failures (but doesn't??).
Build/TestCop - revert this if you see failures (just document where).
It erroneously(?) doesn't appear to cause any failures in TH
on aosp/master.

Bug: 291519274
Change-Id: I78b049302ae9bd2a8db8c03e79388dc4e51e110f

Maciej Żenczykowski   commited 2023-07-18 20:09:20 +00:00
fc9875f537
BpfNetMaps.java - add @Requires(T) to all native_ methods
Bug: 291519274
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0d6c68e639a975cf35ec6cc948be5744b104c98d

Maciej Żenczykowski   commited 2023-07-18 14:19:44 +00:00
e7da6fdff1
Close sockets from ConnectivityService#setFirewallChainEnabled
And replace netd.socketDestroy by Java implementation

Bug: 270298713
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I0e200247ca010f9649254eeaac02740bd2bfdb21

Motomu Utsumi   commited 2023-05-11 12:22:09 +09:00
d44a33adb9
Fix isFeatureEnabled namespace and overload usage
From service-connectivity, NAMESPACE_TETHERING must be used, as
NAMESPACE_CONNECTIVITY is used for the NetworkStack module. Also the
isFeatureEnabled with module name must be used, otherwise the "android"
package version is queried instead of the tethering module version.

BpfNetMaps is using flag value 1 to workaround this issue.
flags in NsdService, AutomaticOnOffKeepaliveTracker, and ConnectivityFlags
were not pushed currently.
So, this change has no effect to devices.

Bug: 279108992
Test: TH
Change-Id: I2b4b6a13c048c20beef52b1f43b9e21aca0c637a

Motomu Utsumi   commited 2023-04-28 19:18:43 +09:00
278db58bf5
Add getUidRule method to BpfNetMaps
Upcoming CLs use this method to add chain status to failure log of
ConnectivityManagerTest#testFirewallBlocking which is a flaky test

Test: atest BpfNetMapsTest
Bug: 262141231
Change-Id: Ib130a28c708f675c79b889bf293dfe6b0f8d7f60

Motomu Utsumi   commited 2023-02-01 17:05:36 +09:00
56c412a9c8
check for U+ before checking device feature flags
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I12e147e61febd96324cdbb6642e0894e5c399526

Maciej Żenczykowski   commited 2022-12-27 10:57:59 +00:00
e7ebb15424
rename bpf_shared.h to netd.h
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2e1569c8d70e98f9a3fdbab41fd2ba7f7b84dd37

Maciej Żenczykowski   commited 2022-12-18 20:02:52 +00:00
513474c1a7
Enable java bpf map always in U devices
Having SdkLevel.isAtLeastU() as a default value of
DeviceConfigUtils.isFeatureEnabled could result confusing behavior.
For example, when flag value is pushed to only the T device and the T
device with the flag is ugraded to U, this device could disable java bpf
map while the device keeps the flag value.
This CL prevents above confusing behavior.

Bug: 246218229
Test: atest BpfNetMaps
Change-Id: I615603c337bb94101dccac77ea0e6fa857041259

Motomu Utsumi   commited 2022-12-06 15:03:20 +09:00
0e9c379c3e
Add sEnableJavaBpfMap value to the dump
Bug: 217624062
Test: dumpsys connectivity trafficcontroller
Change-Id: Icf3df3aac827e65415a8304df87a685272f38f9e

Motomu Utsumi   commited 2022-10-05 18:28:16 +09:00
316d057ded
Move CookieTag map dump to BpfNetMaps
Also removes dump tests in TrafficController

Bug: 217624062
Test: atest BpfNetMaps TagSocketTest
Change-Id: I92adad60c55443435d7c7a0bfc84b38162fd51b0

Motomu Utsumi   commited 2022-10-05 18:28:13 +09:00
ef546a9bd5
Move ownerMatch config dump to BpfNetMaps
Information in the dump does not change
....
current ownerMatch configuration: 516 DOZABLE_MATCH OEM_DENY_1_MATCH
....

Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I5f7b56e4ba03256414f49d0e82d65477fb97f05a

Motomu Utsumi   commited 2022-10-04 15:02:43 +09:00
372c9b45ee
Move current StatsMap dump to BpfNetMaps
Information in the dump does not change
....
current statsMap configuration: 0 SELECT_MAP_A
....

Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I42a844227f258b91ba5b368d8e8abf82a773a801

Motomu Utsumi   commited 2022-10-04 15:02:43 +09:00
c675d6fc01
Move uidOwnerMap dump to BpfNetMaps
Before this CL
....
mUidOwnerMap:
10050  IIF_MATCH LOCKDOWN_VPN_MATCH 0
10061  HAPPY_BOX_MATCH
10091  HAPPY_BOX_MATCH IIF_MATCH LOCKDOWN_VPN_MATCH 0
....

After this CL
....
sUidOwnerMap:
  10050 IIF_MATCH LOCKDOWN_VPN_MATCH 0
  10061 HAPPY_BOX_MATCH
  10091 HAPPY_BOX_MATCH IIF_MATCH LOCKDOWN_VPN_MATCH 0
....

Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I0e2358e462824273a89fcba6e19e75a233f9fe18

Motomu Utsumi   commited 2022-10-04 15:02:41 +09:00
956d86ccdf
Move uidPermissionMap dump to BpfNetMaps
Also remove the dump of mPrivilegedUser because this is not used now and
the information is duplicated with uidPermissionMap dump.

Before this CL
....
mUidPermissionMap:
10049 PERMISSION_NONE
10027  BPF_PERMISSION_INTERNET BPF_PERMISSION_UPDATE_DEVICE_STATS
1041  BPF_PERMISSION_UPDATE_DEVICE_STATS
....

After this CL
....
sUidPermissionMap:
  10049 PERMISSION_NONE
  10027 PERMISSION_INTERNET PERMISSION_UPDATE_DEVICE_STATS
  1041 PERMISSION_UPDATE_DEVICE_STATS
....

Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I416501d5a28a5443f954f9c8c58ea255e5cdc897

Motomu Utsumi   commited 2022-10-04 15:00:34 +09:00
310850f210
BpfNetMaps.java - array index U32 -> S32
This converts the key, which is an index in an array, of sConfigurationMap from U32 to S32.

Since the array has exactly 2 elements, there's no real difference.
In addition while the kernel does indeed index arrays with U32s,
it doesn't matter, because you'd need to have over 2 billion
elements in the bpf map (at which point you'd need GBs of ram for
the bpf map itself)...

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If17efc25d910af642e519f9ecb6d0e8695c38d42

Maciej Żenczykowski   commited 2022-09-17 06:16:34 +00:00
dc88622eb8
BpfNetMaps.java - uid U32 -> S32
This converts the key, which is a uid, of sUidOwnerMap & sUidPermissionMap from U32 to S32.

The kernel is actually not consistent in whether uids & gids
are signed or unsigned, and neither is our Java code, which
also commonly uses just 'int' for uid.  In practice values
greater or equal to 2**31 often don't quite work right.
For example icmp sockets are enabled via a sysctl that
takes a minimum and maximum gid - and these are signed int32s.

It's worth pointing out that these functions already accept int's
as arguments, so when converting them to U32 (and thus long) they
technically previously did the wrong thing (though it's unlikely
it ever mattered).

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7b389a1cf822c56134b20df5ded269963f5bf69f

Maciej Żenczykowski   commited 2022-09-17 06:06:23 +00:00
785793fe19
UidOwnerValue.java - replace U32 ifindex with S32
These are allocated in order by the kernel, if we go
over 2 billion, we've got other problems... besides
U32 to S32 conversion will work just fine anyway.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6e1da81c03bd36d8c6e7bd2b33f535d1fabfad0a

Maciej Żenczykowski   commited 2022-09-16 18:34:39 +00:00
6c1c6bb582
Add native_dump to the Dependencies
This is a preparation for the upcoming CL that will add the test for
BpfNetMaps#dump.

Bug: 217624062
Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest
Change-Id: I79aa6f6153dc94f806411c642d72f4801915a588

Motomu Utsumi   commited 2022-09-14 11:49:16 +09:00
df8d299ecc
Merge changes from topic "idiag_sock_id"
* changes:
  Switch SkDestroyListener based on the flag.
  Add startSkDestroyListener flag to native_init
  Add SkDestroyListenerTest

Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-09-10 02:02:11 +00:00
08ccd0d2e1
register callback to pull NetworkBpfMapInfo atom
Test: statsd_testdrive 10161, atest BpfNetMaps
Bug: 217624062
Bug: 245228691

Change-Id: I630a86cb5a34aaa1810eb75b374588dba570f0ff

Motomu Utsumi   commited 2022-09-09 11:23:10 +09:00
166f966209
Open CookieTagMap in BpfNetMaps
Upcoming CL will update BpfNetMaps to pull NetworkBpfMapInfo atom that
contains the cookieTagMap size field.

Test: m, atest BpfNetMaps
Bug: 217624062
Change-Id: I84bb0aa56e3916fc6fc0ca31ba5962f3b9be4b6f

Motomu Utsumi   commited 2022-09-06 22:33:44 +09:00
b9548860a9
Switch SkDestroyListener based on the flag.
Switch existing C SkDestroyListener and new Java SkDestroyListener based
on the experiment flag.

Bug: 217624062
Test: atest SkDestroyListenerTest
Change-Id: I7031ba7c155edb43e0e7b77449587058d6ba38fb

Motomu Utsumi   commited 2022-09-06 11:23:13 +09:00
d95a0dafa8
Add startSkDestroyListener flag to native_init
This CL prepares for upcoming CL.
Upcoming CL will add SkDestroyListener with Java BpfMap and switch
current C SkDestroyListener and new Java SkDestroyListener based on the
experiment flag.

Bug: 217624062
Test: atest SkDestroyListenerTest
Change-Id: I5ebb319d1b2262199d4ef6a3549894fee24c4ccf

Motomu Utsumi   commited 2022-09-06 11:23:13 +09:00
3af8f0e8d6
Merge "Use IBpfMap type instead of BpfMap type"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-08-31 03:54:28 +00:00
171c817072
Merge "Add wtf log for the case that should not happen"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-08-26 01:33:01 +00:00
9785a681d7
Merge "Convert int array to Integer Set without stream"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-08-26 01:32:17 +00:00
7631d15ff8
Use IBpfMap type instead of BpfMap type
Currently, production code uses BpfMap type and TestBpfMap extends
BpfMap but this makes it diffcult to test because TestBpfMap loads the
JNI.

This CL updates to use IBpfMap type in the production code.
Upcoming CL updates TestBpfMap to implement IBpfMap instead of extending
BpfMap so that test can still use TestBpfMap but tests do not need to
load JNI.

Bug: 217624062
Test: atest BpfCoordinatorTest BpfNetMapsTest
Change-Id: Ie67e14bf5519fb4427474ecc0fda441877a9555f

Motomu Utsumi   commited 2022-08-24 23:31:19 +09:00
73599a5f5d
Add wtf log for the case that should not happen
Bug: 243314552
Test: atest BpfNetMapsTest
Change-Id: I8e97c8150d0f427b7b0ac26374322e36b013320a

Motomu Utsumi   commited 2022-08-24 18:51:04 +09:00
8e420ead05
Convert int array to Integer Set without stream
Address a review comment on aosp/2145584

Bug: 243314552
Test: atest BpfNetMapsTest
Change-Id: Id4cb96b59c88221ad5de32ce3b170ca82c48e6f2

Motomu Utsumi   commited 2022-08-24 17:50:37 +09:00
1a477b0b33
Support java BpfMap in BpfNetMaps#swapActiveStatsMap
Bug: 217624062
Test: atest BpfNetMapsTest
android.net.cts.NetworkStatsManagerTest
android.net.cts.TrafficStatsTest

Change-Id: I9cb673673d2ed1dda8fa14c0877e2fc683267791

Motomu Utsumi   commited 2022-08-17 14:40:53 +00:00
7abeaa499c
Support java BpfMap in BpfNetMaps#setNetPermForUids
Bug: 217624062
Test: atest BpfNetMapsTest
Change-Id: Ia32a73a49ee6a0b05e1abd0c09766e7769e7e760

Motomu Utsumi   commited 2022-08-17 14:20:13 +00:00
65271207f6
Merge changes from topic "switch_uid_owner_map_api"
* changes:
  Switch previous and new code path in replaceUidChain
  Switch previous and new code path in setUidRule
  Switch previous and new code path in removeUidInterfaceRules
  Switch previous and new code path in addUidInterfaceRules
  Switch previous and new code path in updateUidLockdownRule
  Switch previous and new code path in addNiceApp
  Switch previous and new code path in removeNiceApp
  Switch previous and new code path in addNaughtyApp
  Switch previous and new code path in removeNaughtyApp

Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-08-09 09:33:36 +00:00
eec62aafe4
Merge "Switch previous and new code path in setChildChain"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-08-09 04:07:41 +00:00
02c02a3e83
Switch previous and new code path in replaceUidChain
replaceUidChain was updated to use Java BpfMap class instead of native JNI
functions in aosp/2145584.
But it is better to verify this refactoring by the experiment.
So this commit update replaceUidChain to switch previous code path(JNI)
and new code path(Java) based on the flag.

Also this commit removes @GuardedBy("sUidOwnerMap") from
native_replaceUidChain.
This was needed to avoid JNI and Java code modify the UidOwnerMap
concurrently when some API uses previous code path (JNI) and other APIs
use new code path (Java BpfMap class).
But, after this topic, it will not be needed because all the APIs will use JNI
"or" all the APIs will use Java BpfMap class to update UidOwnerMap.

Bug: 217624062
Test: atest BpfNetMapsTest
Change-Id: Icc264e0665b610adae5706f57fe29a296e6e6d6e

Motomu Utsumi   commited 2022-08-09 04:02:46 +00:00
c7c16853e0
Switch previous and new code path in setUidRule
setUidRule was updated to use Java BpfMap class instead of native JNI
functions in aosp/2145583.
But it is better to verify this refactoring by the experiment.
So this commit update setUidRule to switch previous code path(JNI)
and new code path(Java) based on the flag.

Also this commit removes @GuardedBy("sUidOwnerMap") from
native_setUidRule.
This was needed to avoid JNI and Java code modify the UidOwnerMap
concurrently when some API uses previous code path (JNI) and other APIs
use new code path (Java BpfMap class).
But, after this topic, it will not be needed because all the APIs will use JNI
"or" all the APIs will use Java BpfMap class to update UidOwnerMap.

Bug: 217624062
Test: atest BpfNetMapsTest
android.net.cts.ConnectivityManagerTest#testFirewallBlocking

Change-Id: I0d293c3eb89649c969f09578639dc4cb0233501b

Motomu Utsumi   commited 2022-08-09 04:01:47 +00:00
381ad9e54f
Switch previous and new code path in removeUidInterfaceRules
removeUidInterfaceRules was updated to use Java BpfMap class instead of
native JNI functions in aosp/2141539.
But it is better to verify this refactoring by the experiment.
So this commit update removeUidInterfaceRules to switch previous code
path(JNI) and new code path(Java) based on the flag.

Also this commit removes @GuardedBy("sUidOwnerMap") from
native_removeUidInterfaceRules.
This was needed to avoid JNI and Java code modify the UidOwnerMap
concurrently when some API uses previous code path (JNI) and other APIs
use new code path (Java BpfMap class).
But, after this topic, it will not be needed because all the APIs will use JNI
"or" all the APIs will use Java BpfMap class to update UidOwnerMap.

Bug: 217624062
Test: atest BpfNetMapsTest HostsideVpnTests#testBlockIncomingPacket
Change-Id: I1fb103fb3637ef324f92bbc945568ba316b164b8

Motomu Utsumi   commited 2022-08-09 04:00:48 +00:00
7dc657d4aa
Switch previous and new code path in addUidInterfaceRules
addUidInterfaceRules was updated to use Java BpfMap class instead of native JNI
functions in aosp/2141538.
But it is better to verify this refactoring by the experiment.
So this commit update addUidInterfaceRules to switch previous code path(JNI)
and new code path(Java) based on the flag.

Also this commit removes @GuardedBy("sUidOwnerMap") from
native_addUidInterfaceRules.
This was needed to avoid JNI and Java code modify the UidOwnerMap
concurrently when some API uses previous code path (JNI) and other APIs
use new code path (Java BpfMap class).
But, after this topic, it will not be needed because all the APIs will use JNI
"or" all the APIs will use Java BpfMap class to update UidOwnerMap.

Bug: 217624062
Test: atest BpfNetMapsTest HostsideVpnTests#testBlockIncomingPacket
Change-Id: Idb6400ed5808f8c5f4b0a962a356ac3850fbcff3

Motomu Utsumi   commited 2022-08-09 04:00:02 +00:00
f794e7d4f9
Switch previous and new code path in updateUidLockdownRule
updateUidLockdownRule was updated to use Java BpfMap class instead
of native JNI functions in aosp/2141537.
But it is better to verify this refactoring by the experiment.
So this commit update updateUidLockdownRule to switch previous code
path(JNI) and new code path(Java) based on the flag.

Also this commit removes @GuardedBy("sUidOwnerMap") from
native_updateUidLockdownRule.
This was needed to avoid JNI and Java code modify the UidOwnerMap
concurrently when some API uses previous code path (JNI) and other APIs
use new code path (Java BpfMap class).
But, after this topic, it will not be needed because all the APIs will use JNI
"or" all the APIs will use Java BpfMap class to update UidOwnerMap.

Bug: 217624062
Test: atest BpfNetMapsTest HostsideVpnTests#testBlockIncomingPacket
Change-Id: Ifd17d8a5c3a10a92c63010e5d329f9f541b3bfbf

Motomu Utsumi   commited 2022-08-09 03:59:06 +00:00
b2d32b7471
Switch previous and new code path in addNiceApp
addNiceApp was updated to use Java BpfMap class instead of native JNI
functions in aosp/2139316.
But it is better to verify this refactoring by the experiment.
So this commit update addNiceApp to switch previous code path(JNI)
and new code path(Java) based on the flag.

Also this commit removes @GuardedBy("sUidOwnerMap") from
native_addNiceApp.
This was needed to avoid JNI and Java code modify the UidOwnerMap
concurrently when some API uses previous code path (JNI) and other APIs
use new code path (Java BpfMap class).
But, after this topic, it will not be needed because all the APIs will use JNI
"or" all the APIs will use Java BpfMap class to update UidOwnerMap.

Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
Change-Id: I27b4dccdbfee86e772049caa702853bcab8980ca

Motomu Utsumi   commited 2022-08-09 03:58:24 +00:00
7f19df92e6
Switch previous and new code path in removeNiceApp
removeNiceApp was updated to use Java BpfMap class instead of native JNI
functions in aosp/2139315.
But it is better to verify this refactoring by the experiment.
So this commit update removeNiceApp to switch previous code path(JNI)
and new code path(Java) based on the flag.

Also this commit removes @GuardedBy("sUidOwnerMap") from
native_removeNiceApp.
This was needed to avoid JNI and Java code modify the UidOwnerMap
concurrently when some API uses previous code path (JNI) and other APIs
use new code path (Java BpfMap class).
But, after this topic, it will not be needed because all the APIs will use JNI
"or" all the APIs will use Java BpfMap class to update UidOwnerMap.

Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
Change-Id: I4bbd4480fa66ea43b9244047ae34ce4b3b764e22

Motomu Utsumi   commited 2022-08-09 03:57:17 +00:00
5f15f7514c
Switch previous and new code path in addNaughtyApp
addNaughtyApp was updated to use Java BpfMap class instead of native JNI
functions in aosp/2138295.
But it is better to verify this refactoring by the experiment.
So this commit update addNaughtyApp to switch previous code path(JNI)
and new code path(Java) based on the flag.

Also this commit removes @GuardedBy("sUidOwnerMap") from
native_addNaughtyApp.
This was needed to avoid JNI and Java code modify the UidOwnerMap
concurrently when some API uses previous code path (JNI) and other APIs
use new code path (Java BpfMap class).
But, after this topic, it will not be needed because all the APIs will use JNI
"or" all the APIs will use Java BpfMap class to update UidOwnerMap.

Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
Change-Id: If18c26b805081182153d1dc67bb08f1966fa4990

Motomu Utsumi   commited 2022-08-09 03:56:31 +00:00
55c282e8ca
Switch previous and new code path in removeNaughtyApp
removeNaughtyApp was updated to use Java BpfMap class instead of native JNI
functions in aosp/2135056.
But it is better to verify this refactoring by the experiment.
So this commit update removeNaughtyApp to switch previous code path(JNI)
and new code path(Java) based on the flag.

Also this commit removes @GuardedBy("sUidOwnerMap") from
native_removeNaughtyApp.
This was needed to avoid JNI and Java code modify the UidOwnerMap
concurrently when some API uses previous code path (JNI) and other APIs
use new code path (Java BpfMap class).
But, after this topic, it will not be needed because all the APIs will use JNI
"or" all the APIs will use Java BpfMap class to update UidOwnerMap.

Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
Change-Id: I4df6185e85f6c5512797c1b62e14aa590f4903ee

Motomu Utsumi   commited 2022-08-09 03:54:27 +00:00
878ce0d1a7
Merge "Set default value to bpf maps with Java Bpf Map"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-08-03 07:41:52 +00:00
db323cb73b
Switch previous and new code path in setChildChain
setChildChain was updated to use Java BpfMap class instead of native JNI
functions in aosp/2131752.
But it is better to verify this refactoring by the experiment.
So this commit update setChildChain to switch previous code path(JNI)
and new code path(Java) based on the flag.

Bug: 217624062
Test: atest BpfNetMapsTest android.net.cts.ConnectivityManagerTest#testFirewallBlocking
Change-Id: I47a5e7f631bb6806716f464df26ec2eca46503b3

Motomu Utsumi   commited 2022-08-03 04:23:53 +00:00
e057dd456f
Revert "Remove unused codes that was used in setChildChain"
This reverts commit b1144d7671.

Reason for revert: We decided to have experiment and switch old code path and new code path based on a flag. So the codes removed by this CL is needed.

Bug: 217624062
Test: m

Change-Id: Icb8a353a74935ed97f8e102ba54020825676b817

Motomu Utsumi   commited 2022-08-01 08:42:39 +00:00
114cd9cf73
Set default value to bpf maps with Java Bpf Map
Bug: 217624062
Test: m, flash, boot
Change-Id: Ib6c435cc6a35dec3fe86c7ddde8671eb7de631c1

Motomu Utsumi   commited 2022-08-01 08:41:37 +00:00
ba2fa15641