Commit Graph

739 Commits

Author SHA1 Message Date
Steven Moreland
cf42d60c53 unregistered null callback will cause a crash later
Bug: N/A
Change-Id: I7acbc084d8a401817879d416f0283ca40e060069
Test: N/A
2023-01-06 02:29:54 +00:00
Hungming Chen
5c985e2cdd BpfCoordinator: publish upstream interface mtu to v4 offload rule
Respect the upstream interface mtu instead of always setting
mtu 1500.

Using upstream interface mtu is probably not the best solution
for tether offload pmtu but it at least respects the upstream
interface mtu which may be less than 1500.

Test: manual test
1. Connect to carrier Taiwan Star.
2. Enable tethering and check the mtu 1434 in dumpsys.
IPv4 Upstream: proto [inDstMac] iif(iface) src -> nat ->
dst [outDstMac] pmtu age
  udp [02:10:45:32:ef:35] 54(54) 192.168.72.125:39034
  -> 15(rmnet1) 100.83.189.11:39034
  -> 142.251.43.14:443 [00:00:00:00:00:00] 1434 69657ms
IPv4 Downstream: proto [inDstMac] iif(iface) src -> nat
  -> dst [outDstMac] pmtu age
  udp [00:00:00:00:00:00] 15(rmnet1) 142.251.43.14:443
  -> 54(54) 100.83.189.11:39034
  -> 192.168.72.125:39034 [9a:8a:4d:ec:a4:7c] 1434 69633ms

Bug: 262860312
Test: atest BpfCoordinatorTest
Change-Id: Ic6dcb95ed76d5306053e4645b6baebc67ff082cf
2023-01-03 23:36:30 +08:00
Hungming Chen
a432d621b0 Tethering: deprecate CONNECTIVITY_ACTION on U+ device
Both CONNECTIVITY_ACTION and UpstreamNetworkMonitor monitor the
upstream connection status. The upstream status should be monitored
in one place and deprecated the duplicate one since U+ device.

Once CONNECTIVITY_ACTION is removed, CMD_UPSTREAM_CHANGED won't be
triggered anymore. For non-dun upstream netowrk , upstream
re-evaluation is triggered by EVENT_DEFAULT_SWITCHED and
EVENT_ON_LOST. For dun upstream re-evaluation, re-evaluation is
triggered by EVENT_ON_LINKPROPERTIES and EVENT_ON_LOST.

Changes:
1. Deprecate the CONNECTIVITY_ACTION broadcast.
2. Re-evaluate possible upstream selection on the event
   UpstreamNetworkMonitor.EVENT_ON_LOST.

Note that EVENT_DEFAULT_SWITCHED and EVENT_ON_LINKPROPERTIES have
already triggered the upstream re-evaluation and keep as it.

Bug: 257408654
Bug: 257941865
Test: atest ConnectivityCoverageTests
Change-Id: I8b75cfb2fec51fb5bc4e2d13ad6b54daf8efc71e
2022-12-28 02:28:16 +00:00
Igor Chernyshev
a4fc702f7e Add Wearable Tethering flag and configuration
This establishes the main Wear connection manager class,
and enforces T+ requirement.

Bug: 245972418

Change-Id: Ia60925ce4dc2a25ac61c4b9bae1d022dc74f5b05
2022-12-19 14:40:15 -08:00
Chiachang Wang
2d7d6e5caf Merge "Replace NetlinkSocket with NetlinkUtils" 2022-12-19 12:40:41 +00:00
chiachangwang
e97aed4847 Replace NetlinkSocket with NetlinkUtils
Those static method and constants are better to fit in
NetlinkUitls. Replace the usage.

Test: m
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I81e27b8264e39764a44a4ba87344e9ac940d920a
2022-12-19 06:39:31 +00:00
Chiachang Wang
393052b61f Merge "Use SocketUtils from shared lib" 2022-12-19 00:54:16 +00:00
Igor Chernyshev
9dac660bf0 Add CDM dependency in Tethering
This change introduces a limited library for dependencies on
framework-connectivity from Tethering,
connectivity-internal-api-util, where all classes are annotated with
@RequiresApi(S) to ensure proper API checks are done before usage.

Bug: 245972418

Change-Id: I82bafd9063341adc71d07f0858e6d68283d081f0
2022-12-16 17:55:53 +00:00
chiachangwang
18e072c7f5 Use SocketUtils from shared lib
Test: m
Change-Id: Ia86183a7e7844309dcbd21140e2785a71d7febab
2022-12-16 07:34:51 +00:00
Mark Chien
6d8176898e Merge "SyncSM08: statically import tethering error code constant" 2022-12-14 13:35:12 +00:00
Mark
74461fc13d SyncSM08: statically import tethering error code constant
This can make the code using error code not so easy to over 100
words line limit.

Test: m
Change-Id: I952c51f2e3508ed320744985193802454d07ccfe
2022-12-14 09:12:15 +00:00
Maciej Żenczykowski
4e3321ed3b bpf_tethering.h -> offload.h
match header file with bpf program

Locations to change found via:
  https://source.corp.google.com/search?q=p:aosp-master%20(%5E%7C%5B%5E_%5D)bpf_tethering.h

Core reasoning for this will be to match the .h naming
that we'll have for netd.c and clatd.c once we get rid of bpf_shared.h

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4154659c7fb23a37f5316a5c804fb2606d842e9c
2022-12-08 13:04:45 +00:00
KH Shi
cc8db2ac6e Merge "Fix ConntrackSocketTest#testIpv4ConntrackSocket flaky" 2022-12-06 05:46:54 +00:00
KH Shi
09eb7631fa Fix ConntrackSocketTest#testIpv4ConntrackSocket flaky
If we run an iterations test, TCP connections opened by previous tests
won't be closed immediately. They will stay in the TIME_WAIT state for
120 seconds before closed. Netfilter socket listens to both
NF_NETLINK_CONNTRACK_NEW and NF_NETLINK_CONNTRACK_DESTROY groups.

There is a tiny time gap between socket creation and sending dump
request to kernel. If an old TCP connection happened to be closed in
this time gap, listening socket would see a DESTROY message before
seeing the NEW messages triggered by dump request.

The current test only parsing the first contrack message in the read
buffer, so it will only find the DESTROY message and ignore all of the
following NEW messages. It does a netfilter socket dump, but does not
check whether the dump produces reasonable output. Now that we have
the ability to parse conntrack messages, do more in-depth checking.

Bug: 254608655
Test: atest ConntrackSocketTest --iteration 500
Change-Id: Icf95adb9d9390d598e9c6bdb4e245c5fce764e3e
2022-12-05 22:26:52 +08:00
Mark
a542458c16 Wrap some IpServer commands
This is no-op change. Preparing for refactor.

Test: atest TetheringTests
Change-Id: I8fb67cbc95074e990074f08b5fe6afe7dfd28382
2022-12-02 04:48:00 +00:00
Mark Chien
6ed83a43c8 Merge "Remove dead code: updateUpstreamIPv6LinkProperties in InitialState" 2022-11-25 01:07:15 +00:00
Mark
0e38307b4b Remove dead code: updateUpstreamIPv6LinkProperties in InitialState
mRaemon only be created at BaseServingState#enter() and set to null at
BaseServingState#exit(). Thus, updateUpstreamIPv6LinkProperties just be
no-op in InitialState.

Test: atest TetheringTests MtsTetheringTestLatestSdk CtsTetheringTest
Change-Id: I0b8403a2acffb1aa0f40d2ad8721d4eff7c63ff0
2022-11-23 08:22:32 +00:00
Hungming Chen
d15eb88619 TetheringConfiguration: force to select upstream automatically on U+
Simply the upstream selection since U+ device for tethering refactor.

Changes:
1. Support automatic mode only on U+ device.

2. Add two tethering tests to make sure that the resource config can't
   control automatic mode anymore. Expect that always automatic mode
   on U+ device. Also limit some existing tethering tests for R, S,
   or T.
   Changes of TetheringTest:
   - testAutomaticUpstreamSelectionWithConfigDisabled (U+) [new]
   - testLegacyUpstreamSelection (T-)
   - testChooseDunUpstreamByLegacyMode (T-)
   - testChooseDunUpstreamByAutomaticModeWithConfigDisabled (U+) [new]

3. Add two tethering configuration tests to make sure that automatic
   mode is always enabled no mater what the resource config or flag
   are on U+ device. Also limit some existing tethering tests for R,
   S, or T.
   Changes of TetheringConfiguration:
   - testChooseUpstreamAutomatically (T-)
   - testChooseUpstreamAutomaticallyAfterT (U+) [new]
   - testChooseUpstreamAutomatically_FlagOverride (R)
   - testChooseUpstreamAutomatically_FlagOverrideOnSAndT (S, T)
     (Renamed from testChooseUpstreamAutomatically_FlagOverrideAfterR)
   - testChooseUpstreamAutomatically_FlagOverrideAfterT (U+) [new]

Bug: 257941865
Bug: 257408654
Test: atest TetheringTest
Change-Id: I7ace317a1529177a84557741dc07d732b7f8cf89
2022-11-15 22:14:21 +08:00
Mark Chien
3074dd6cd5 Merge "Remove try/catch of UnsupportedOperationException" 2022-11-15 12:15:31 +00:00
Treehugger Robot
6660d2375f Merge "Add isTetheringFeatureEnabled which use tethering namespace" 2022-11-15 08:58:23 +00:00
Mark
25d3ac54fe Add isTetheringFeatureEnabled which use tethering namespace
This is no-op change. Tethering shouldn't use connectivity namespace
because it already be used for NetworkStack module. The new feature
should check isTetheringFeatureEnabled instead.

Bug: 238274852
Test: atest TetheringTests
Change-Id: I009f654d0bf8df7051b822e666e3206dd70a5523
2022-11-14 15:51:55 +00:00
Michael Groover
a49c13f7e8 Merge "Add not exported flag to receiver in EntitlementManager" 2022-11-11 15:32:07 +00:00
Michael Groover
3d6b8c83ce Add not exported flag to receiver in EntitlementManager
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting a future
platform release and registering a receiver for non-system
broadcasts must specify either the exported or not exported flag
when invoking #registerReceiver; if one of these flags is not
provided, the platform will throw a SecurityException. This commit
adds the RECEIVER_NOT_EXPORTED flag to the receiver in
EntitlementManager since this broadcast is sent as a PendingIntent
alarm.

Bug: 234659204
Test: atest com.android.networkstack.tethering.EntitlementManagerTest
Change-Id: I46c2df038ccf7669636166f50fe0331efcc42e4b
2022-11-10 12:20:35 -06:00
Cole Faust
22f05839f5 Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:

BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower

See https://errorprone.info/bugpatterns for more
information on the checks.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I7625fa386afe93823b97cb2ecb8fd09a5856c05b
2022-11-02 10:13:14 -07:00
Treehugger Robot
319c97705f Merge changes I63467371,Id4405b70
* changes:
  BpfCoordinatorTest: add testDumpDoesNotCrash
  Move error count BPF map initialization into class Dependencies
2022-10-27 07:27:08 +00:00
Hungming Chen
771bc597b6 Move error count BPF map initialization into class Dependencies
The preparation for testing BpfCoordinator#dump().
Used to wrap error count BPF map access to avoid SYS_SECCOMP on some
test device. Ex: cuttlefish.
https://android-build.googleplex.com/builds/tests/view?invocationId=I01200010101524265&testResultId=TR03228338750686157

Bug: 255466740
Test: atest BpfCoordinatorTest

Change-Id: Id4405b70bc6d500b35943b4f81b88e7515fff3b0
2022-10-26 13:47:19 +08:00
Mark Chien
381e339647 Merge "Remove unused TetheringConfigurationParcel fileds" 2022-10-21 07:50:23 +00:00
Nucca Chen
df46aeb098 Merge "Add toString() to Ipv6ForwardingRule" 2022-10-14 07:27:03 +00:00
Mark
0fd561386a Remove try/catch of UnsupportedOperationException
registerLocalOnlyHotspotSoftApCallback implementation is availble in
AOSP, remove unnecessary UnsupportedOperationException catch.

Bug: 240113156
Test: device can boot sucessfully
Change-Id: If010879ddc58285cf01cc8794b4c3ded7d0b0316
2022-10-13 07:43:05 +00:00
Wayne Ma
fe6ecc6333 Add new fields - |upstream_events| and |duration_millis| in stats.proto
Revise annotations in previous fields and deprecate |upstream_type|.

Ignore-AOSP-First: Merge conflict if submits in AOSP first.
Bug: 153942334
Test: statsd_testdrive 303
Change-Id: Id4d594f9238e18266dce5bf2ba238c1f86f655db
(cherry picked from commit 71c8495cea)
Merged-In: Id4d594f9238e18266dce5bf2ba238c1f86f655db
2022-10-12 05:32:12 +00:00
Hungming Chen
de5fb7370b Add toString() to Ipv6ForwardingRule
Needed because default Ipv6ForwardingRule#toString doesn't dump
actual data. It is hard to know why two rule comparison failed
in the test failure.

Bug: 250552545
Test: atest BpfCoordinatorTest
Change-Id: Iaf29c888238573c7c9a0a4e0bd65fbe468084e51
2022-10-04 23:14:55 +08:00
Hungming Chen
09d163dfa8 BpfCoordinator: ignore stopping event monitoring if never started
Ignore stopping monitoring if the monitor has never started
for a given IpServer.

Also fix the related bug in
BpfCoordinator#testStartStopConntrackMonitoring.

Bug: 250552545
Test: atest BpfCoordinatorTest
Change-Id: I7ac71f0ed52bf52244aadaa3c90ca8df239873e4
2022-10-03 11:56:38 +00:00
Maciej Żenczykowski
49e9660e0e handle "TODO: remove equals/hashCode/toString once aosp/1536721 merged"
aosp/1536721 is merged, so this code duplication should not be needed any more.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic05adfc46495086d7f681322aac7acddc30a2260
2022-09-16 06:35:32 +00:00
Treehugger Robot
1949d98e81 Merge "Revert "UpstreamNetworkMonitor: add NOTIFY_TEST_NETWORK_AVAILABLE"" 2022-09-14 14:25:13 +00:00
Nucca Chen
6cafe04787 Revert "UpstreamNetworkMonitor: add NOTIFY_TEST_NETWORK_AVAILABLE"
This reverts commit 82e7733909.

Reason for revert: don't modify production code for testing only

Change-Id: I19826c3308774ce6f62a2748b4e038500aec33e2
2022-09-05 03:25:33 +00:00
Motomu Utsumi
73599a5f5d 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
2022-08-24 23:31:19 +09:00
Mark Chien
0d3c8b692d Merge "updateSupportedDownstreams when tethering allowed is changed" 2022-08-22 15:15:11 +00:00
Mark
c2cc1b42b8 updateSupportedDownstreams when tethering allowed is changed
There are three configuration could affect tethering allowed:
1. user restriction
2. tether_supported settings
3. ro.tether.denied system properties

When user restricted or tether supported setting change, updating
supported downstreams.
ro.tether.denied is read only properties, so it won't be changed runtime.

Also correct the unit test that there is no TetheringConfiguration change when settings or user restriction change.

Bug: 184996041
Bug: 239500515
Test: atest TetheringTests

Change-Id: I8dfcc42de9787a5e9ba19b69db9444c14ace56f0
2022-08-18 05:42:05 +00:00
Maciej Żenczykowski
9ab28d0832 use getIfName in more spots to improve logging
Also just use 'int' for ifindex.  The kernel allocates these in order,
if we ever exceed 2 billion, we'll have other problems to worry about.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I33eb46185fde90cd4d158bb74f8f9c17b41434fb
2022-08-18 01:07:20 +00:00
Maciej Żenczykowski
09813ced3e 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: Ifbb7139e9118dd2d0c52e83c5874132e03760b30
2022-08-18 01:07:11 +00:00
Maciej Żenczykowski
370f10d117 Merge changes I95352711,I27bdb5d8,I7e1acc65,I7c95ff19
* changes:
  BpfCoordinator: dump IPv6 BPF downstream rules
  BpfCoordinator: change function name and format for dumping IPv6 rules
  add header on ipv6 forwarding rulesdump
  add header on ipv6 upstream bpf map dump
2022-08-18 00:49:54 +00:00
Hungming Chen
e5cd2d4294 BpfCoordinator: dump IPv6 BPF downstream rules
Test: adb shell dumpsys tethering
Forwarding rules:
  IPv6 Upstream: iif(iface) [inDstMac] -> oif(iface) etherType [outSrcMac] [outDstMac]
    54(54) [7a:2e:e8:f1:e3:54] -> 15(rmnet1) 86dd [00:00:00:00:00:00] [00:00:00:00:00:00]
  IPv6 Downstream: iif(iface) [inDstMac] neigh6 -> oif(iface) etherType [outSrcMac] [outDstMac]
    15(rmnet1) [00:00:00:00:00:00] 2401:e180:88e1:7aef:55fb:14d3:7ded:71cd -> 54(54) 86dd [7a:2e:e8:f1:e3:54] [52:5c:cf:fc:c6:ff]

Change-Id: I95352711fad48e5e7779e8bc2c27aa415d98758f
2022-08-17 05:09:12 +00:00
Hungming Chen
f88f7f5c23 BpfCoordinator: change function name and format for dumping IPv6 rules
Current function naming is confusing.
dumpIpv6ForwardingRules dumps Java map.
dumpIpv4ForwardingRules dumps BPF map.

Change related function name and minor output string format.

Test: adb shell dumpsys tethering
Forwarding rules:
  IPv6 Forwarding rules by downstream interface:
    [ap_br_wlan2]: iif(iface) oif(iface) v6addr [srcmac] [dstmac]
      15(rmnet1) 54(ap_br_wlan2) 2401:e180:8d60:9943:a550:fafd:1644:14b6 [d6:bb:b4:95:3c:58] [52:5c:cf:fc:c6:ff]
  IPv6 Upstream: iif(iface) [inDstMac] -> oif(iface) etherType [outSrcMac] [outDstMac]
    54(54) [d6:bb:b4:95:3c:58] -> 15(rmnet1) 86dd [00:00:00:00:00:00] [00:00:00:00:00:00]

Change-Id: I27bdb5d8f3773789f8dcce63e9a33c4316d8048b
2022-08-17 05:09:06 +00:00
Maciej Żenczykowski
93c2b64448 add header on ipv6 forwarding rulesdump
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e1acc6565ebafcf3c27fd56e0a5602f1a760e31
2022-08-17 05:08:57 +00:00
Maciej Żenczykowski
5d2dc65063 add header on ipv6 upstream bpf map dump
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7c95ff19fe665e9b502e439cb59498cac3622eab
2022-08-17 05:08:40 +00:00
Mark Chien
40caeb78f3 Remove unused TetheringConfigurationParcel fileds
Bug: 237338640
Test: atest TetheringTests

Change-Id: Ic851e2e9ed16b5be6f5b1380f6b905fcc1e131cf
2022-08-16 15:58:44 +00:00
Hungming Chen
82e7733909 UpstreamNetworkMonitor: add NOTIFY_TEST_NETWORK_AVAILABLE
Used for test interface upstream can replace existing non-test
upstream interface, like ethernet on cuttlefish.

This helps to fix the flaky test when we are using test interface on
cuttlefish. Because the ethernet and test interface upstream update
event order can't be guaranteed.

Bug: 237369591
Bug: 242067530

Test: atest ConnectivityCoverageTests
Change-Id: I9da71ee116bf1ebc9831f61f25acf42e328a8370
2022-08-15 17:38:06 +08:00
Hungming Chen
1668b2da03 BpfCoordinator: avoid attach/deatach ipv6 program on 464xlat interface
464xlat interface v4-* doesn't have IPv6 address. IPv6 program should
not be attached/deatached on v4-* interface.

Bug: 241106456
Test: atest BpfCoordinatorTest
Test: manual test

Use IPv6-only wifi to test because there is no IPv6-only live
cellular environment here.

1. Patch TetheringInterfaceUtils.allowIpv6Tethering to allow WIFI.
2. Connect to IPv6-only wifi Google-Guest.
3. Enable USB tethering.
4. Check that v4-wlan0 doesn't have IPv6 program.

$ adb shell tc filter show dev wlan0 ingress;
filter protocol ipv6 pref 2 bpf chain 0
filter protocol ipv6 pref 2 bpf chain 0 handle 0x1 prog_offload_schedcls_tether_downstream6_ether:[*fsobj] direct-action not_in_hw id 2 tag 7d9be9d02d02e8d8
filter protocol ip pref 3 bpf chain 0
filter protocol ip pref 3 bpf chain 0 handle 0x1 prog_offload_schedcls_tether_downstream4_ether:[*fsobj] direct-action not_in_hw id 8 tag 434b3ecac7968bb3
filter protocol ipv6 pref 4 bpf chain 0
filter protocol ipv6 pref 4 bpf chain 0 handle 0x1 prog_clatd_schedcls_ingress6_clat_ether:[*fsobj] direct-action not_in_hw id 24 tag 06763574e0e1f984

$ adb shell tc filter show dev v4-wlan0 ingress;
filter protocol ip pref 3 bpf chain 0
filter protocol ip pref 3 bpf chain 0 handle 0x1 prog_offload_schedcls_tether_downstream4_rawip:[*fsobj] direct-action not_in_hw id 6 tag 9e6e587e0c6cf0bc

$ adb shell tc filter show dev v4-wlan0 egress;
filter protocol ip pref 4 bpf chain 0
filter protocol ip pref 4 bpf chain 0 handle 0x1 prog_clatd_schedcls_egress4_clat_rawip:[*fsobj] direct-action not_in_hw id 27 tag 9158397a2869247e

$ adb shell tc filter show dev ncm0 ingress;
filter protocol ipv6 pref 2 bpf chain 0
filter protocol ipv6 pref 2 bpf chain 0 handle 0x1 prog_offload_schedcls_tether_upstream6_ether:[*fsobj] direct-action not_in_hw id 3 tag 5f70a4f42dffe899
filter protocol ip pref 3 bpf chain 0
filter protocol ip pref 3 bpf chain 0 handle 0x1 prog_offload_schedcls_tether_upstream4_ether:[*fsobj] direct-action not_in_hw id 9 tag 26f324113d54c30a

Change-Id: Ic1c1cfc7646b4d4004856850b66428e4651d42ab
2022-08-08 20:56:50 +08:00
Hungming Chen
6f54391340 BpfCoordinator: avoid attach/deatach duplicate downstream program
The forwarding pairs may use the same downstream. Ex: 464xlat
tethering has rmnet0:ncm0, v4-rmnet0:ncm0 forwarding pairs.
Need to avoid duplicate downstream program.

Bug: 241106456
Test: atest BpfCoordinatorTest
Change-Id: Ic41b3ad856e4876808f8497a760081afcfd04988
2022-08-05 20:56:04 +08:00
Maciej Żenczykowski
63a2f68bd2 clarify 'which is not tetherable' log line
Test: TreeHugger
Bug: 241104956
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I01418e026b2084cbcf013b7e633d82148f2c874c
2022-08-04 11:08:21 +00:00