diff --git a/CMakeLists.txt b/CMakeLists.txt index 23fcd68..65d634c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ set(VECTORSZ 4000 CACHE STRING "Memory allocation for spin state vector") include("CheckTypeSize") check_type_size("void *" SIZEOF_VOID_P) check_type_size("int" SIZEOF_INT) -add_compile_options(-Wall -Wextra -Werror) +add_compile_options(-Wall -Wextra -Werror -O2) # # release/debug compile flags diff --git a/src/dockerapi.cpp b/src/dockerapi.cpp index 85f0c86..ee5fc88 100644 --- a/src/dockerapi.cpp +++ b/src/dockerapi.cpp @@ -271,7 +271,7 @@ Document DockerAPI::inspect_img(const string &img_name) { } Document DockerAPI::rm_img(const string &img_name) { - string path = "/images/" + img_name; + string path = "/images/" + img_name + "?force=true"; return this->send_curl_request(method::DELETE, path); } diff --git a/src/droptrace.bpf.c b/src/droptrace.bpf.c index 4230103..2fea250 100644 --- a/src/droptrace.bpf.c +++ b/src/droptrace.bpf.c @@ -1,7 +1,5 @@ #include "../build/vmlinux.h" -#include - #include #include diff --git a/src/droptrace.cpp b/src/droptrace.cpp index 85e4df0..b2f2257 100644 --- a/src/droptrace.cpp +++ b/src/droptrace.cpp @@ -105,9 +105,7 @@ void DropTrace::start() { logger.error("Another BPF progam is already loaded"); } - _bpf = droptrace_bpf__open(); - - if (!_bpf) { + if (!(_bpf = droptrace_bpf__open())) { logger.error("Failed to open BPF program", errno); } @@ -163,7 +161,6 @@ void DropTrace::start_listening_for(const Packet &pkt, Driver *driver) { _ringbuf = ring_buffer__new(bpf_map__fd(_bpf->maps.events), DropTrace::ringbuf_handler, this, nullptr); - if (!_ringbuf) { logger.error("Failed to create ring buffer", errno); } diff --git a/src/packet.cpp b/src/packet.cpp index 482f59b..6b06356 100644 --- a/src/packet.cpp +++ b/src/packet.cpp @@ -8,12 +8,11 @@ #include "driver/docker.hpp" #include "driver/driver.hpp" -#include "eqclassmgr.hpp" +#include "eqclass.hpp" #include "interface.hpp" #include "lib/hash.hpp" #include "model-access.hpp" #include "payload.hpp" -#include "process/process.hpp" #include "protocols.hpp" Packet::Packet() : diff --git a/third_party/bpftool/CMakeLists.txt b/third_party/bpftool/CMakeLists.txt index d78dbaf..efe8852 100644 --- a/third_party/bpftool/CMakeLists.txt +++ b/third_party/bpftool/CMakeLists.txt @@ -8,5 +8,5 @@ ExternalProject_Add(bpftool STEP_TARGETS build ) -set(bpftool_VERSION "7.2.0" PARENT_SCOPE) +set(bpftool_VERSION "7.4.0" PARENT_SCOPE) set(bpftool_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/bpftool PARENT_SCOPE) diff --git a/third_party/libbpf/CMakeLists.txt b/third_party/libbpf/CMakeLists.txt index 5063989..0d7c316 100644 --- a/third_party/libbpf/CMakeLists.txt +++ b/third_party/libbpf/CMakeLists.txt @@ -16,6 +16,6 @@ ExternalProject_Add(libbpf STEP_TARGETS build ) -set(libbpf_VERSION "1.2.2" PARENT_SCOPE) +set(libbpf_VERSION "1.4.0" PARENT_SCOPE) set(libbpf_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/install PARENT_SCOPE) set(libbpf_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/install/libbpf.a PARENT_SCOPE) diff --git a/third_party/libbpf/libbpf b/third_party/libbpf/libbpf index a508615..20ea95b 160000 --- a/third_party/libbpf/libbpf +++ b/third_party/libbpf/libbpf @@ -1 +1 @@ -Subproject commit a5086158dc90593b4e4b3ddbafab9bdaf9ec97ef +Subproject commit 20ea95b4505c477af3b6ff6ce9d19cee868ddc5d