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
This commit is contained in:
Chenbo Feng 2018-10-16 20:31:52 -07:00
commit 4c9e9ecc57

View file

@ -47,7 +47,7 @@ template <class Key, class Value>
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 @@ class BpfMap {
}
}
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,