NetBpfLoad: rename isAtLeastW to isAtLeast25Q2

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I485e24663b924bbac97faa6f06156587c8968b81
This commit is contained in:
Maciej Żenczykowski 2025-01-14 14:57:24 -08:00
commit 98975122a4
2 changed files with 6 additions and 6 deletions

View file

@ -62,8 +62,8 @@
// Android Mainline BpfLoader when running on Android V (sdk=35)
#define BPFLOADER_MAINLINE_V_VERSION (BPFLOADER_MAINLINE_U_QPR3_VERSION + 1u)
// Android Mainline BpfLoader when running on Android W (sdk=36)
#define BPFLOADER_MAINLINE_W_VERSION (BPFLOADER_MAINLINE_V_VERSION + 1u)
// Android Mainline BpfLoader when running on Android 25Q2 (sdk=36)
#define BPFLOADER_MAINLINE_25Q2_VERSION (BPFLOADER_MAINLINE_V_VERSION + 1u)
/* For mainline module use, you can #define BPFLOADER_{MIN/MAX}_VER
* before #include "bpf_helpers.h" to change which bpfloaders will

View file

@ -1417,7 +1417,7 @@ static int doLoad(char** argv, char * const envp[]) {
const bool isAtLeastT = (effective_api_level >= __ANDROID_API_T__);
const bool isAtLeastU = (effective_api_level >= __ANDROID_API_U__);
const bool isAtLeastV = (effective_api_level >= __ANDROID_API_V__);
const bool isAtLeastW = (effective_api_level > __ANDROID_API_V__); // TODO: switch to W
const bool isAtLeast25Q2 = (effective_api_level > __ANDROID_API_V__); // TODO: fix >
const int first_api_level = GetIntProperty("ro.board.first_api_level", effective_api_level);
@ -1432,7 +1432,7 @@ static int doLoad(char** argv, char * const envp[]) {
if (isAtLeastU) ++bpfloader_ver; // [44] BPFLOADER_MAINLINE_U_VERSION
if (runningAsRoot) ++bpfloader_ver; // [45] BPFLOADER_MAINLINE_U_QPR3_VERSION
if (isAtLeastV) ++bpfloader_ver; // [46] BPFLOADER_MAINLINE_V_VERSION
if (isAtLeastW) ++bpfloader_ver; // [47] BPFLOADER_MAINLINE_W_VERSION
if (isAtLeast25Q2) ++bpfloader_ver; // [47] BPFLOADER_MAINLINE_25Q2_VERSION
ALOGI("NetBpfLoad v0.%u (%s) api:%d/%d kver:%07x (%s) uid:%d rc:%d%d",
bpfloader_ver, argv[0], android_get_device_api_level(), effective_api_level,
@ -1477,8 +1477,8 @@ static int doLoad(char** argv, char * const envp[]) {
// W bumps the kernel requirement up to 5.4
// see also: //system/netd/tests/kernel_test.cpp TestKernel54
if (isAtLeastW && !isAtLeastKernelVersion(5, 4, 0)) {
ALOGE("Android W requires kernel 5.4.");
if (isAtLeast25Q2 && !isAtLeastKernelVersion(5, 4, 0)) {
ALOGE("Android 25Q2 requires kernel 5.4.");
return 1;
}