NetBpfLoad: prog names are only valid on 4.15+

The following commit is only in 4.15:

  commit cb4d2b3f03d8eed90be3a194e5b54b734ec4bbe9
  Author: Martin KaFai Lau <kafai@fb.com>
  Date:   Wed Sep 27 14:37:52 2017 -0700

    bpf: Add name, load_time, uid and map_ids to bpf_prog_info

  $ git describe cb4d2b3f03d8eed90be3a194e5b54b734ec4bbe9
  v4.14-rc1-661-gcb4d2b3f03d8

Bug: 335390828
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I246a7a8640bea1e939f12f3ffd3fedc25a0a6422
This commit is contained in:
Maciej Żenczykowski 2024-04-23 03:14:00 +00:00
commit 89efcc36e7

View file

@ -1012,7 +1012,7 @@ static int loadCodeSections(const char* elfPath, vector<codeSection>& cs, const
.log_size = static_cast<__u32>(log_buf.size()),
.expected_attach_type = cs[i].expected_attach_type,
};
if (isAtLeastKernelVersion(4, 14, 0))
if (isAtLeastKernelVersion(4, 15, 0))
strlcpy(req.prog_name, cs[i].name.c_str(), sizeof(req.prog_name));
fd.reset(bpf(BPF_PROG_LOAD, req));