bpfloader - minor fixups asked for by reviewer am: a21256dcf1
Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1754722
Change-Id: I5c64e62cea1d38274c5f2ca9cafe1dffbf712011
diff --git a/libbpf_android/Loader.cpp b/libbpf_android/Loader.cpp
index c10988d..b1af34f 100644
--- a/libbpf_android/Loader.cpp
+++ b/libbpf_android/Loader.cpp
@@ -514,14 +514,14 @@
if (BPFLOADER_VERSION < md[i].bpfloader_min_ver) {
ALOGI("skipping map %s which requires bpfloader min ver 0x%05x\n", mapNames[i].c_str(),
md[i].bpfloader_min_ver);
- mapFds.push_back(std::move(fd)); // -1
+ mapFds.push_back(unique_fd());
continue;
}
if (BPFLOADER_VERSION >= md[i].bpfloader_max_ver) {
ALOGI("skipping map %s which requires bpfloader max ver 0x%05x\n", mapNames[i].c_str(),
md[i].bpfloader_max_ver);
- mapFds.push_back(std::move(fd)); // -1
+ mapFds.push_back(unique_fd());
continue;
}
diff --git a/progs/include/bpf_map_def.h b/progs/include/bpf_map_def.h
index d80bfe7..b4fdd54 100644
--- a/progs/include/bpf_map_def.h
+++ b/progs/include/bpf_map_def.h
@@ -48,8 +48,8 @@
#endif
// These are the values used if these fields are missing
-#define DEFAULT_BPFLOADER_MIN_VER 0u // v0.0
-#define DEFAULT_BPFLOADER_MAX_VER 0x10000u // v1.0
+#define DEFAULT_BPFLOADER_MIN_VER 0u // v0.0 (this is inclusive ie. >= v0.0)
+#define DEFAULT_BPFLOADER_MAX_VER 0x10000u // v1.0 (this is exclusive ie. < v1.0)
#define DEFAULT_SIZEOF_BPF_MAP_DEF 32 // v0.0 struct: enum + alignment padding + 7 uint
#define DEFAULT_SIZEOF_BPF_PROG_DEF 20 // v0.0 struct: 4 uint + bool + alignment padding