| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Try SIGTERM with timeout first. If failure, use SIGKILL
Use the stoping process API for clatd, dnsmasq, iptables-restore
Change-Id: I299c2023d2661ffc6c9d7eacf1650cb233ed22e3
|
| |
|
|
|
|
|
|
|
|
| |
!str[0] is technically speaking reaching past the end of the 0-byte empty string,
though there should normally be an extra 0 byte added to facilitate .c_str()
Bug: 206703697
Test: TreeHugger, atest netd_unit_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I88ddae1b00ff020bd833d057468f729fb530216d
|
| |
|
|
|
| |
Test: m
Change-Id: I40082f7d56f4d3ba088ebcab9417b4d2da0d6ba2
|
| |
|
|
|
|
|
|
|
|
| |
Somehow netd may stuck during initialization. We don't have enough
information to know which step it is stuck. Add traces to narrow down
scope.
Test: adb logcat | grep netd
Bug: 183677095
Change-Id: Ib7bba4301e238c8cc3f6e8ea11bdcbe86f68f4e4
|
| |
|
|
|
|
|
|
|
| |
Finally remove the actual map variables themselves,
since they are no longer used.
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8063af311d3acd33a754f2f388f35830f77b4a2c
|
| |
|
|
|
|
|
|
|
| |
This function is unused.
True implementation is in the Tethering mainline module.
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I53a4ba79890ce4cf3a4be6eb63ef844263bc96b1
|
| |
|
|
|
|
| |
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3374bfad70d2c492c05da6660a4aafdf05776362
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is now dead code - it is reimplemented in Java in the tethering mainline module.
Test:
git grep 'getTetherOffloadStats|getAndClearTetherOffloadStats|setTetherOffloadInterfaceQuota|addOffloadRule|removeOffloadRule|validateOffloadRule'
finds nothing
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic874726f8a99dd686f81bf7b536cd4840e7f7665
|
| |
|
|
|
|
|
|
|
| |
There's bpf map dumping code in the Tethering mainline module.
Additionally we don't want netd to have access to the tethering maps.
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia6abe3cadcbb32a1a94cbeef26ed8957e09e60ab
|
| |
|
|
|
|
|
|
|
| |
This action was recently moved into the Tethering mainline module.
As such doing it again here is spurious.
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I09c3206c06d49a91775a1b5deb72240046f21ee2
|
| |
|
|
|
|
|
|
|
| |
We don't yet have any users of this (even the bpf programs don't yet use it).
Either way it should be handled by the tethering mainline module.
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Icef831e18acdf024251d992037b0d33b20c5c8ab
|
| |
|
|
|
|
|
|
| |
The BPF program attaching and detaching have moved to tethering
module. Remove the stubs in netd.
Test: atest netd_integration_test
Change-Id: Iec05d41c8932c639eb2c694532b5a6a19d44cf76
|
| |
|
|
|
|
| |
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id7738586b6c57f2d14ec94d2eb03e1ac82a41338
|
| |
|
|
|
|
|
|
|
|
| |
This code is moving to BpfCoordinator in this topic.
This reverts commit 419b1d4ad74d100416163bdb4a3e37af89f3eb56.
Test: manual testing of IPv6 upstream tethering
Test: dumpsys tethercontroller shows upstream map non-empty
Change-Id: Ia78bc4df11080df0605484dd7472f2c69a3a12d4
|
| |
|
|
|
|
| |
Test: atest, TreeHugger, installed on bonito with v6 only wifi
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If6602995371a1ca4c509d1ec44bc6450451f0c42
|
| |
|
|
|
|
| |
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I69c4d20952927ddae4131faadf3e2fb8410c0a21
|
| |
|
|
|
|
| |
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e174e62356d61cc2a4c77cdbbb906a5bd6f3628
|
| |
|
|
|
|
| |
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6161efa2a59fd27ddb84483482f21acf7fdd7f59
|
| |
|
|
|
|
| |
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If3eb91ca9c241dbc43dcb4e1741fd2a55b4d3016
|
| |
|
|
|
|
| |
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0098dbb9e6cbe919d0e117155a175b5b2e506aff
|
| |
|
|
|
|
| |
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0e77dbe8e8d195bb61de2500b51aeb7f1826067c
|
| |
|
|
|
|
| |
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4f4be18f4ac8cc73a4689d1fa4f60a7b7e78dfaf
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Generated via:
#!/bin/bash
do_replace() {
pushd "$1" >/dev/null
shift
git grep "$1" | cut -d: -f1 | sort -u | while read f; do
sed -i -r "s@$1@$2@g" "${f}"
git add "${f}"
done
popd >/dev/null
}
replace() {
do_replace packages/modules/Connectivity/Tethering "$@"
do_replace system/netd "$@"
}
do_reset() {
pushd "$1" >/dev/null
git rhh
popd >/dev/null
}
main() {
do_reset packages/modules/Connectivity/Tethering
do_reset system/netd
replace TetherIngressKey TetherDownstream6Key
replace TetherIngressValue TetherDownstream6Value
pushd packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering >/dev/null
git mv TetherIngressKey.java TetherDownstream6Key.java
git mv TetherIngressValue.java TetherDownstream6Value.java
popd >/dev/null
replace TETHER_INGRESS_PROG TETHER_DOWNSTREAM6_TC_PROG
replace ingress_tether tether_downstream6
replace ingress/tether_ tether_downstream6_
replace TETHER_INGRESS_MAP TETHER_DOWNSTREAM6_MAP
replace tether_ingress_map tether_downstream6_map
replace getTetherIngressMapFd getTetherDownstream6MapFd
replace getTetherIngressProgFd getTetherDownstream6TcProgFd
replace mBpfIngressMap mBpfDownstream6Map
replace bpfIngressMap bpfDownstream6Map
replace printIngressMap printDownstream6Map
replace 'BPF ingress map' 'BPF downstream ipv6 map'
}
main "$@"; exit
Followed by:
cd system/netd
# change regexp in tests/binder_test.cpp:3374
git add tests/binder_test.cpp
and undoing incorrect text string change in server/ClatdController.cpp
(and using the automatic linter to fix whitespace issues)
Afterwards we have:
$ adbz shell ls /sys/fs/bpf/tethering
map_offload_tether_downstream6_map
map_offload_tether_limit_map
map_offload_tether_stats_map
map_test_tether_downstream6_map
prog_offload_schedcls_tether_downstream6_ether
prog_offload_schedcls_tether_downstream6_rawip
prog_test_xdp_drop_ipv4_udp_ether
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6bcf5a7ba8703e49590f86e5326f63ee7e63bdc0
|
| |
|
|
|
|
|
| |
Test: builds, atest, TreeHugger
Bug: 167500195
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia1a45de523bb20d451df2041a9cc3fe9930f6686
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Test:
adb shell dumpsys netd --short | sed -rn '/^ TetherController$/,/^ *Log:$/p'
TetherController
Forwarding requests: Tethering
DNS: netId 100 servers [198.224.173.135, 198.224.174.135, 2001:4888:68:ff00:608:d::, 2001:4888:61:ff00:604:d::]
dnsmasq PID: 4395
Interface pairs:
rmnet_data2 -> rndis0 ACTIVE
BPF ingress map: iif(iface) v6addr -> oif(iface) srcmac dstmac ethertype [pmtu]
12(rmnet_data2) 2600:1010:b009:76c8:b0fc:57ff:fe6e:8cc4 -> 33(rndis0) be:b2:04:f9:1a:98 b2:fc:57:6e:8c:c4 86dd [1500]
BPF stats (downlink): iif(iface) -> packets bytes errors
12(rmnet_data2) -> 1 104 0
BPF limit: iif(iface) -> bytes
12(rmnet_data2) -> 9223372036854775807
Bug: 150736748
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I19148e4b079ac1fd2e8a5bf983bd9d8aa1dc4305
|
| |/
|
|
|
|
|
|
|
|
| |
Don't need anymore because the tethering control plane is moved to
the tethering service and the data limit is applied since the first
rule is added. The tethering service has the responsibility to set
the rule and the data limit now.
Test: manual, atest netd_integration_test:NetdBinderTest#TetherOffloadForwarding
Change-Id: Ie2b8d57680025be903ebfb3d33e8ef1e2e819ddd
|
| |
|
|
|
|
|
|
|
| |
Provide binder calls for getting tethering statistics and clear the
stats for the given upstream.
Bug: 150736748
Test: None
Change-Id: I7bb635ee39d658961cd9515cc37e23bc3f0cd38f
|
| |
|
|
|
|
|
|
|
| |
Provide binder calls for setting the limit for the given upstream
interface.
Bug: 150736748
Test: atest
Change-Id: I5def133022ee0ae232972c9ccffccd041b4b47a6
|
| |\
| |
| |
| |
| |
| | |
* changes:
Add com.android.tethering to be netd_aidl_interface's apex user
Add binder call tetherOffloadGetStats
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This binder call is separated from the existing call tetherGetStats
and used for for BPF tether stats.
Note that the default value of ifIndex of TetherStatsParcel.aidl is
applied for backward compatibility because it is added from this
commit.
Make netd modules to use netd_aidl_interface-unstable-cpp.
Both netd and libnetd_server use unstable aidl for new api
tetherOffload* and modified parcel TetherStatsParcel.
Generated with:
m netd_aidl_interface-update-api
Bug: 150736748
Test: atest
Change-Id: Ie03834bc40992a4abdc8ef70150569982092b386
|
| |/
|
|
|
|
|
| |
Tested: atest
Bug: 149816401
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id8a91ed5c0176b41c079ede5533af90b8756de6b
|
| |
|
|
|
|
|
|
|
| |
This doesn't actually change anything, since we initialize it with
1500 default just like we blindly assume it always is today.
Tested: builds
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie448a988c3a769be07f895621711fe4e59d4535c
|
| |
|
|
|
|
|
|
|
|
|
| |
This actually starts enforcing the limit.
Note: this requires netd to populate both stats & limit maps
for offload to work.
Bug: 150736748
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I13c21f455155480712fba9b1464b4392d5169a52
|
| |
|
|
|
|
|
|
|
| |
This is higher level glue code, including dump support.
Tested: builds
Bug: 150736748
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9777d38d319a0b9db265aa339b7e903c49b8a4df
|
| |
|
|
|
|
|
|
|
| |
(not sure why this is not triggering a compiler warning of some kind)
Tested: builds
Bug: 150736748
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Icd20698fbc98dd8537921fe18d1a68f554095d9c
|
| |
|
|
|
|
| |
Bug: 153437886
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If8588c0ebc2893ccea89db3c68e9a08fbdec06fc
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Defining stable AIDL IPCs with primitive args is not future-proof
because AIDL does not support method overloading, so any time a
parameter is added a new method needs to be created.
It's better to use parcelables for parameters instead, because
parcelables can be extended in subsequent version.
Define a TetherOffloadRuleParcel data structure to represent
tethering offload rules, and switch the tethering offload IPCs to
it before we freeze the INetd AIDL.
Bug: 140541991
Test: atest netd_integration_test
Change-Id: I6e84b14872d38a897eb6a10fd37d816ec7e6da64
|
| |\ |
|
| | |
| |
| |
| |
| | |
Test: build, atest
Change-Id: I2e72ae3e0c0d9e5fc8b52dc0d2f0c8f01e886789
|
| |/
|
|
|
|
|
|
|
|
| |
This clears out any stale state from a potential previous run.
(also fix a bug... get...MapFd() return -errno on error)
Test: build, atest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4a452280a3754ef05964630809efb8cca2bbb833
|
| |
|
|
|
|
|
|
| |
Test: Manual test
1. Add two interface tether stats manually
2. Call getTetherStats() and check the content
Change-Id: I5bf7e57e67cf61829ef71fd7caccdb60d4c35213
|
| |
|
|
|
|
| |
Test: build, atest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0b0bfeadb4a8596ea575c103937af83d5ff26027
|
| |
|
|
|
| |
Test: None
Change-Id: Idcb6b9c80de499fafb29e4e8b9202d7b7386340c
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test: build, atest
Manual test steps:
1. Connect to FarEastone mobile
2. Enable WiFi hotspot
3. Get the upstream interface via logcat
I netd : ipfwdAddInterfaceForward("wlan1", "rmnet_data1")
4. Check the tether BPF program attaching on upstream interface
$ adb shell tc filter show dev rmnet_data1 ingress
filter protocol ipv6 pref 1 bpf
filter protocol ipv6 pref 1 bpf handle 0x1
prog_offload_schedcls_ingress_tether_rawip:[*fsobj] direct-action
5. Disable WiFi hotspot
6. Check the tether BPF program detaching on upstream interface by
logcat
Change-Id: I2acca0220a660fbaa235f8863237d526828c2af8
|
| |
|
|
|
| |
Test: manual
Change-Id: I56834d4dd8afa49460e4e02e084b4f268a51d3fe
|
| |
|
|
|
|
|
|
| |
Bugs: 128782815
Test: built, flashed, booted
cd systen/netd && atest
Change-Id: Id72341885d828e30296f20590c64ff614df63cee
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a couple cases were errors can result in a missing calls to:
posix_spawnattr_destroy(&attr);
posix_spawn_file_actions_destroy(&fa);
which potentially results in a memory leak.
It's hard to accomplish this with helper functions, because if init fails,
you shouldn't call destroy, but if adddup2/setflags fails you need to...
Test: atest clatd_test libbpf_android_test libnetdbpf_test netd_integration_test netd_unit_test netdutils_test resolv_integration_test resolv_unit_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If6e5d778e16e2ab69cd5f7d75824f320e1b0888c
|
| |
|
|
|
|
|
|
|
|
|
| |
ResponseCode is necessary for libnetd_resolv, move it to libnetdutils
to ease the cleanup of the include path system/netd/server for
libnetd_resolv.
Bug: 128662167
Test: system/netd/tests/runtests.sh passed
Change-Id: Iae22cc6b4c642a190294fa4ce0ae406434e7ac3d
|
| |
|
|
|
|
|
|
|
|
|
| |
inet_pton could not parse link local address with zone id.
Additionally, setDnsForwarders has already used getaddrinfo for address parsing.
Bug: 129474773
Test: built, flashed, booted
system/netd/tests/runtests.sh passes
Change-Id: Iea8ccd234e81ff6ddd863d920033559d436bf0d0
|