Fix compilationg errors for some kernels

This commit is contained in:
Vadim Vetrov 2024-09-02 13:41:25 +03:00
parent c0dc5d2652
commit 1e6a9496f6
No known key found for this signature in database
GPG Key ID: E8A308689D7A73A5
4 changed files with 9 additions and 2 deletions

2
Kbuild
View File

@ -1,3 +1,3 @@
obj-m := kyoutubeUnblock.o
kyoutubeUnblock-objs := kytunblock.o mangle.o quic.o utils.o kmod_utils.o
ccflags-y := -std=gnu11 -DKERNEL_SPACE -Wno-error
ccflags-y := -std=gnu11 -DKERNEL_SPACE -Wno-error -Wno-declaration-after-statement

View File

@ -9,7 +9,6 @@
#include <linux/mutex.h>
#include <linux/socket.h>
#include <linux/net.h>
#include <linux/version.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>

View File

@ -32,6 +32,7 @@ typedef __u64 uint64_t;
#include <linux/ip.h> // IWYU pragma: export
#include <linux/ipv6.h> // IWYU pragma: export
#include <linux/tcp.h> // IWYU pragma: export
#include <linux/version.h>
#define ip6_hdr ipv6hdr

View File

@ -7,6 +7,13 @@
#include <libnetfilter_queue/libnetfilter_queue_ipv4.h>
#include <libnetfilter_queue/libnetfilter_queue_ipv6.h>
#include <libnetfilter_queue/libnetfilter_queue_tcp.h>
#else
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
#include <net/ip6_checksum.h>
#include <net/checksum.h>
#else
#include <net/checksum.h>
#endif
#endif