Fix the build problem with bpf project
Add the necessary Android.bp file and fix the compile error for the new
bpf project.
Fix the run time restart false alarm in bpf loader.
Bug: 112334572
Test: device boot and dumpsys netd show eBPF object okay, runtime
restart netd and no bpfloader error showed in logcat.
Change-Id: Iae193bda45e50b7d22479086d6403e3c4fb185c4
diff --git a/libbpf/include/bpf/BpfMap.h b/libbpf/include/bpf/BpfMap.h
index 20db43e..deeed14 100644
--- a/libbpf/include/bpf/BpfMap.h
+++ b/libbpf/include/bpf/BpfMap.h
@@ -47,7 +47,7 @@
class BpfMap {
public:
BpfMap<Key, Value>() : mMapFd(-1){};
- BpfMap<Key, Value>(int fd) : mMapFd(fd){};
+ explicit BpfMap<Key, Value>(int fd) : mMapFd(fd){};
BpfMap<Key, Value>(bpf_map_type map_type, uint32_t max_entries, uint32_t map_flags) {
int map_fd = createMap(map_type, sizeof(Key), sizeof(Value), max_entries, map_flags);
if (map_fd < 0) {
@@ -57,7 +57,7 @@
}
}
- netdutils::Status pinToPath(const std::string path) {
+ netdutils::Status pinToPath(const std::string& path) {
int ret = bpfFdPin(mMapFd, path.c_str());
if (ret) {
return netdutils::statusFromErrno(errno,