From deed6435671a79474d802ab603daaca5d375c802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Mon, 28 Jul 2025 13:36:04 -0700 Subject: [PATCH] bpf: test.c - use pindir instead of prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We continue to have: $ adbz shell ls -lZ /sys/fs/bpf/tethering/map_test_* -rw-rw---- 1 root network_stack u:object_r:fs_bpf_tethering:s0 0 2025-07-28 13:46 /sys/fs/bpf/tethering/map_test_bitmap -rw-rw---- 1 root network_stack u:object_r:fs_bpf_tethering:s0 0 2025-07-28 13:46 /sys/fs/bpf/tethering/map_test_tether2_downstream6_map -rw-rw---- 1 root network_stack u:object_r:fs_bpf_tethering:s0 0 2025-07-28 13:46 /sys/fs/bpf/tethering/map_test_tether3_downstream6_map -rw-rw---- 1 root network_stack u:object_r:fs_bpf_tethering:s0 0 2025-07-28 13:46 /sys/fs/bpf/tethering/map_test_tether_downstream6_map Long term goal here is to eliminate 'prefix' entirely. This will also allow merging all the bpf .o's into 1. Test: TreeHugger Flag: EXEMPT mainline/noop Signed-off-by: Maciej Żenczykowski Change-Id: Ifdbc47243363e73ef46a9a9c71136f342fd381a7 --- bpf/loader/NetBpfLoad.cpp | 2 +- bpf/progs/test.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bpf/loader/NetBpfLoad.cpp b/bpf/loader/NetBpfLoad.cpp index c8162bc847..0dfc0dda25 100644 --- a/bpf/loader/NetBpfLoad.cpp +++ b/bpf/loader/NetBpfLoad.cpp @@ -1668,7 +1668,7 @@ static int loadAllObjects(const unsigned int bpfloader_ver) { // S+ Tethering mainline module (network_stack): tether offload // loads under /sys/fs/bpf/tethering: if (loadObject(bpfloader_ver, "tethering/", "offload.o")) return 1; - if (loadObject(bpfloader_ver, "tethering/", "test.o")) return 1; + if (loadObject(bpfloader_ver, "", "test.o")) return 1; if (isAtLeastT) { // T+ Tethering mainline module loads under: // /sys/fs/bpf/net_shared: shared with netd & system server diff --git a/bpf/progs/test.c b/bpf/progs/test.c index 64dc0c8434..3f3178bd26 100644 --- a/bpf/progs/test.c +++ b/bpf/progs/test.c @@ -16,6 +16,7 @@ // The resulting .o needs to load on Android S+ #define BPFLOADER_MIN_VER BPFLOADER_MAINLINE_S_VERSION +#define DEFAULT_BPF_PIN_SUBDIR "tethering/" // This is non production code, only used for testing // Needed because the bitmap array definition is non-kosher for pre-T OS devices.