diff --git a/bpf/loader/NetBpfLoad.cpp b/bpf/loader/NetBpfLoad.cpp index d0c5a6a445..ef29cfef1a 100644 --- a/bpf/loader/NetBpfLoad.cpp +++ b/bpf/loader/NetBpfLoad.cpp @@ -941,8 +941,6 @@ static int createMaps(const char* elfPath, ifstream& elfFile, vector& unsigned kvers = kernelVersion(); for (int i = 0; i < (int)mapNames.size(); i++) { - if (md[i].zero != 0) abort(); - if (bpfloader_ver < md[i].bpfloader_min_ver) { ALOGD("skipping map %s which requires bpfloader min ver 0x%05x", mapNames[i].c_str(), md[i].bpfloader_min_ver); diff --git a/bpf/progs/include/bpf_map_def.h b/bpf/progs/include/bpf_map_def.h index 22c79d508e..9fb2917290 100644 --- a/bpf/progs/include/bpf_map_def.h +++ b/bpf/progs/include/bpf_map_def.h @@ -136,7 +136,7 @@ struct bpf_map_def { // unsigned int inner_map_idx; // unsigned int numa_node; - unsigned int zero; // uid_t, for compat with old (buggy) bpfloader must be AID_ROOT == 0 + unsigned int uid; // uid_t unsigned int gid; // gid_t unsigned int mode; // mode_t @@ -158,13 +158,11 @@ struct bpf_map_def { bool shared; // use empty string as 'file' component of pin path - allows cross .o map sharing char pad0[3]; // manually pad up to 4 byte alignment, may be used for extensions in the future - - unsigned int uid; // uid_t }; // This needs to be updated whenever the above structure definition is expanded. // These asserts are here to make sure we have cross-6-arch consistency. -_Static_assert(sizeof(struct bpf_map_def) == 120, "sizeof struct bpf_map_def != 120"); +_Static_assert(sizeof(struct bpf_map_def) == 116, "sizeof struct bpf_map_def != 116"); _Static_assert(__alignof__(struct bpf_map_def) == 4, "__alignof__ struct bpf_map_def != 4"); _Static_assert(_Alignof(struct bpf_map_def) == 4, "_Alignof struct bpf_map_def != 4");