diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dbe4352..93fd2fa4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,7 @@ jobs: - name: Build libbpf if: matrix.http3 == 'http3' && matrix.compiler == 'clang' && runner.os == 'Linux' run: | - git clone -b v0.4.0 https://github.com/libbpf/libbpf + git clone -b v0.6.1 https://github.com/libbpf/libbpf cd libbpf PREFIX=$PWD/build make -C src install diff --git a/README.rst b/README.rst index 92f9de6a..7b4d0e4f 100644 --- a/README.rst +++ b/README.rst @@ -170,7 +170,7 @@ Use ``--with-libbpf`` configure option to build eBPF program. libelf-dev is needed to build libbpf. For Ubuntu 20.04, you can build libbpf from `the source code -`_. nghttpx +`_. nghttpx requires eBPF program for reloading its configuration and hot swapping its executable. @@ -393,7 +393,7 @@ from source: .. code-block:: text - $ git clone --depth 1 -b v0.4.0 https://github.com/libbpf/libbpf + $ git clone --depth 1 -b v0.6.1 https://github.com/libbpf/libbpf $ cd libbpf $ PREFIX=$PWD/build make -C src install $ cd .. diff --git a/docker/Dockerfile b/docker/Dockerfile index 59d5ad6f..8e8a04b8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,7 +36,7 @@ RUN git clone --depth 1 -b v0.1.0 https://github.com/ngtcp2/ngtcp2 && \ cd .. && \ rm -rf ngtcp2 -RUN git clone --depth 1 -b v0.4.0 https://github.com/libbpf/libbpf && \ +RUN git clone --depth 1 -b v0.6.1 https://github.com/libbpf/libbpf && \ cd libbpf && \ PREFIX=/usr/local make -C src install && \ cd .. && \ diff --git a/src/shrpx_connection_handler.cc b/src/shrpx_connection_handler.cc index 4f216a5c..e2600a1f 100644 --- a/src/shrpx_connection_handler.cc +++ b/src/shrpx_connection_handler.cc @@ -1080,8 +1080,6 @@ std::vector &ConnectionHandler::get_quic_bpf_refs() { } void ConnectionHandler::unload_bpf_objects() { - std::array errbuf; - LOG(NOTICE) << "Unloading BPF objects"; for (auto &ref : quic_bpf_refs_) { @@ -1089,11 +1087,7 @@ void ConnectionHandler::unload_bpf_objects() { continue; } - if (bpf_object__unload(ref.obj) != 0) { - LOG(WARN) << "Failed to unload bpf object: " - << xsi_strerror(errno, errbuf.data(), errbuf.size()); - continue; - } + bpf_object__close(ref.obj); ref.obj = nullptr; }