bmahler commented on code in PR #512:
URL: https://github.com/apache/mesos/pull/512#discussion_r1520498604
##########
src/linux/ebpf.cpp:
##########
@@ -152,6 +159,24 @@ Try<Nothing> attach(int fd, const string& cgroup)
}
+Try<Nothing> attach(const string& cgroup, const Program& program)
+{
+ Try<int> program_fd = ebpf::load(program);
+ if (program_fd.isError()) {
+ return Error("Failed to load eBPF program: " + program_fd.error());
+ }
+
+ Try<Nothing> _attach = attach(cgroup, *program_fd);
+ if (_attach.isError()) {
+ return Error("Failed to attach eBPF program: " + _attach.error());
Review Comment:
we're leaking the program fd in this branch
##########
src/linux/ebpf.cpp:
##########
@@ -65,6 +65,8 @@ void Program::append(vector<bpf_insn>&& instructions)
}
+// Load an eBPF program into the kernel and return the file
+// descriptor of the loaded program.
Review Comment:
This is still left in the header?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]