BpfLoader: exec mainline netbpfload for finalization am: 95c6fff6a2

Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/3067735

Change-Id: I6ae9b1697f9f67d9bfa4c6f155a4a61fe6a48c72
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Maciej Żenczykowski 2024-05-01 12:29:32 +00:00 committed by Automerger Merge Worker
commit 91d60440f5
2 changed files with 6 additions and 11 deletions

View file

@ -40,7 +40,6 @@
#include <android-base/logging.h>
#include <android-base/macros.h>
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <android-base/unique_fd.h>
@ -147,8 +146,7 @@ int createSysFsBpfSubDir(const char* const prefix) {
return 0;
}
int main(int argc, char** argv) {
(void)argc;
int main(int __unused argc, char** argv, char * const envp[]) {
android::base::InitLogging(argv, &android::base::KernelLogger);
// Load all ELF objects, create programs and maps, and pin them
@ -160,14 +158,12 @@ int main(int argc, char** argv) {
"problems or startup script race.");
ALOGE("--- DO NOT EXPECT SYSTEM TO BOOT SUCCESSFULLY ---");
sleep(20);
return 2;
return 120;
}
}
if (!android::base::SetProperty("bpf.progs_loaded", "1")) {
ALOGE("Failed to set bpf.progs_loaded property");
return 1;
}
return 0;
const char * args[] = { "/apex/com.android.tethering/bin/netbpfload", "done", NULL, };
execve(args[0], (char**)args, envp);
ALOGE("FATAL: execve(): %d[%s]", errno, strerror(errno));
return 121;
}

View file

@ -46,7 +46,6 @@
#include <android-base/cmsg.h>
#include <android-base/file.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <android-base/unique_fd.h>