NetBpfLoad: use macro for mainline beta flag
Flag: com.android.tethering.readonly.flags.use_libbpf Bug: 428792764 Test: Enable/Disable flag, boot, adb shell logcat Change-Id: I40e6124f6c96cf09ce50f38d786f15847ec6f69d
This commit is contained in:
parent
a759f8b01c
commit
aa8717db44
1 changed files with 6 additions and 2 deletions
|
|
@ -81,7 +81,6 @@ using android::base::Split;
|
|||
using android::base::StartsWith;
|
||||
using android::base::Tokenize;
|
||||
using android::base::unique_fd;
|
||||
using com::android::tethering::readonly::flags::use_libbpf;
|
||||
using std::ifstream;
|
||||
using std::ios;
|
||||
using std::optional;
|
||||
|
|
@ -1393,11 +1392,16 @@ static bool loadObject(const unsigned int bpfloader_ver,
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifndef COM_ANDROID_TETHERING_READONLY_FLAGS_USE_LIBBPF
|
||||
#error "COM_ANDROID_TETHERING_READONLY_FLAGS_USE_LIBBPF must be defined"
|
||||
#endif
|
||||
#define USE_LIBBPF COM_ANDROID_TETHERING_READONLY_FLAGS_USE_LIBBPF
|
||||
|
||||
#define APEXROOT "/apex/com.android.tethering"
|
||||
#define BPFROOT APEXROOT "/etc/bpf/mainline/"
|
||||
|
||||
static bool loadAllObjects(const unsigned int bpfloader_ver) {
|
||||
bool libbpf = !bpfCmdFixupIsNeeded && (isAtLeast25Q3 || use_libbpf());
|
||||
bool libbpf = !bpfCmdFixupIsNeeded && (isAtLeast25Q3 || USE_LIBBPF);
|
||||
if (!loadObject(bpfloader_ver, BPFROOT "offload.o")) return false;
|
||||
if (!loadObject(bpfloader_ver, BPFROOT "test.o", libbpf)) return false;
|
||||
if (isAtLeastT) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue