Commit Graph

3 Commits

Author SHA1 Message Date
Ken Chen
d6ea75ac97 Return error Status from BpfHandler::initPrograms()
Instead of logging and aborting from the BpfHandler::initPrograms(),
return a Status object with an error message. The caller
NetdUpdatable::libnetd_updatable_init() will log the message. Netd
main() will exit and restart.

Bug: 312094533
Test: m
Change-Id: I6717da871a9a53357ac895709ea0094c089e7bbd
2023-12-03 23:45:47 +08:00
Maciej Żenczykowski
4938d40501 simplify netd updatable
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8987f33b3f3427683e5ae9b2931528f91d6f0aeb
2022-08-15 17:40:31 +00:00
Ken Chen
1647f60d66 [NETD-BPF#19] Mainline part of bpf code from netd
1. Add libnetd_updatable.so in com.android.tethering. The library is
loaded by netd. Currently, it mainly targets on a few functions which
access BPF maps. The functionality may extend in the future.

2. Attach gcroup progs from libnetd_updatable.so.

3. Move (privileged)TagSocket and untagSocket implementation to mainline
module. Combine privilegedTagSocket and untagSocket into a single
function.

4. Split related unit tests from netd_unit_test to
libnetd_updatable_unit_test as well.

Bug: 202086915
Test: cd system/netd; atest
Test: atest TrafficStatsTest NetworkUsageStatsTest

Change-Id: Ib556458103a4cbb643c1342d9b689ac692160de0
2022-01-30 09:51:25 +08:00