From d78705ea746780f67c960eb35e8333344b3a3d23 Mon Sep 17 00:00:00 2001 From: Vadim Vetrov Date: Thu, 25 Jul 2024 09:51:23 +0300 Subject: [PATCH] Fix compilation issues --- Makefile | 13 +++++++++---- README.md | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d84f590..988ffc9 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,11 @@ LD := gcc CFLAGS:=-Wall -Wpedantic -Wno-unused-variable -I$(DEPSDIR)/include -Os LDFLAGS:=-L$(DEPSDIR)/lib -static +LIBNFNETLINK_CFLAGS := -I$(DEPSDIR)/include +LIBNFNETLINK_LIBS := -L$(DEPSDIR)/lib +LIBMNL_CFLAGS := -I$(DEPSDIR)/include +LIBMNL_LIBS := -L$(DEPSDIR)/lib + # PREFIX is environment variable, if not set default to /usr/local ifeq ($(PREFIX),) PREFIX := /usr/local @@ -13,7 +18,7 @@ else PREFIX := $(DESTDIR) endif -export CC LD CFLAGS LDFLAGS +export CC LD CFLAGS LDFLAGS LIBNFNETLINK_CFLAGS LIBNFNETLINK_LIBS LIBMNL_CFLAGS LIBMNL_LIBS APP:=$(BUILD_DIR)/youtubeUnblock @@ -43,17 +48,17 @@ prepare_dirs: mkdir -p $(DEPSDIR) $(LIBNFNETLINK): - cd deps/libnfnetlink && ./autogen.sh && ./configure --prefix=$(DEPSDIR) $(if $(CROSS_COMPILE_PLATFORM),--host=$(CROSS_COMPILE_PLATFORM),) + cd deps/libnfnetlink && ./autogen.sh && ./configure --prefix=$(DEPSDIR) $(if $(CROSS_COMPILE_PLATFORM),--host=$(CROSS_COMPILE_PLATFORM),) --enable-static --disable-shared $(MAKE) -C deps/libnfnetlink $(MAKE) install -C deps/libnfnetlink $(LIBMNL): - cd deps/libmnl && ./autogen.sh && ./configure --prefix=$(DEPSDIR) $(if $(CROSS_COMPILE_PLATFORM),--host=$(CROSS_COMPILE_PLATFORM),) + cd deps/libmnl && ./autogen.sh && ./configure --prefix=$(DEPSDIR) $(if $(CROSS_COMPILE_PLATFORM),--host=$(CROSS_COMPILE_PLATFORM),) --enable-static --disable-shared $(MAKE) -C deps/libmnl $(MAKE) install -C deps/libmnl $(LIBNETFILTER_QUEUE): $(LIBNFNETLINK) $(LIBMNL) - cd deps/libnetfilter_queue && ./autogen.sh && ./configure --prefix=$(DEPSDIR) $(if $(CROSS_COMPILE_PLATFORM),--host=$(CROSS_COMPILE_PLATFORM),) + cd deps/libnetfilter_queue && ./autogen.sh && ./configure --prefix=$(DEPSDIR) $(if $(CROSS_COMPILE_PLATFORM),--host=$(CROSS_COMPILE_PLATFORM),) --enable-static --disable-shared $(MAKE) -C deps/libnetfilter_queue $(MAKE) install -C deps/libnetfilter_queue diff --git a/README.md b/README.md index 8702649..f05fff3 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ You may read further in an [yt-dlp issue page](https://github.com/yt-dlp/yt-dlp/ When the packet is joining the queue, the application checks sni payload to be googlevideo (right how the DPIs do), segmentates/fragmentates (both TCP and IP fragmentation techniques are supported) and posts the packet. Note that it is impossible to post two fragmented packets from one netfilter queue verdict. Instead, the application drops an original packet and makes another linux raw socket to post the packets in the network. To escape infinity loops the socket marks outgoing packets and the application automatically accepts it. ## Usage: +Before compilation make sure `gcc`, `make`, `autoconf`, `automake`, `pkg-config` and `libtool` is installed. For Fedora `glibc-static` should be installed as well. Compile with `make`. Install with `make install`. The package include libnetfilter_queue, libnfnetlink and libmnl as static dependencies. The package requires linux-headers and kernel built with netfilter nfqueue support. You should also configure iptables for this to start working: