assert for kmod

This commit is contained in:
Vadim Vetrov
2026-01-31 20:42:29 +03:00
parent 4afd4eae5a
commit 27adf8a308
4 changed files with 10 additions and 6 deletions

2
Kbuild
View File

@@ -1,3 +1,3 @@
obj-m := kyoutubeUnblock.o
kyoutubeUnblock-objs := src/kytunblock.o src/dpi.c src/mangle.o src/quic.o src/quic_crypto.o src/utils.o src/tls.o src/getopt.o src/inet_ntop.o src/args.o src/trie.o deps/cyclone/aes.o deps/cyclone/cpu_endian.o deps/cyclone/ecb.o deps/cyclone/gcm.o deps/cyclone/hkdf.o deps/cyclone/hmac.o deps/cyclone/sha256.o
kyoutubeUnblock-objs := src/kytunblock.o src/dpi.o src/mangle.o src/quic.o src/quic_crypto.o src/utils.o src/tls.o src/getopt.o src/inet_ntop.o src/args.o src/trie.o deps/cyclone/aes.o deps/cyclone/cpu_endian.o deps/cyclone/ecb.o deps/cyclone/gcm.o deps/cyclone/hkdf.o deps/cyclone/hmac.o deps/cyclone/sha256.o
ccflags-y := -std=gnu99 -DKERNEL_SPACE -Wno-error -Wno-declaration-after-statement -I$(src)/src -I$(src)/deps/cyclone/include

View File

@@ -226,7 +226,7 @@ static int parse_dport_range(char *str, struct dport_range **udpr, int *udpr_len
#ifdef KERNEL_SPACE
struct dport_range *dport_ranges = kmalloc(
seclen * sizeof(struct port_range), GFP_KERNEL);
seclen * sizeof(struct dport_range), GFP_KERNEL);
#else
struct dport_range *dport_ranges = malloc(

View File

@@ -39,7 +39,7 @@
#include "mangle.h"
int log_packet(const struct parsed_packet *pkt);
void log_packet(const struct parsed_packet *pkt);
#define MAX_FRAGMENTATION_PTS 16
@@ -224,8 +224,8 @@ int process_tcp_packet(const struct section_config_t *section, const struct pars
if (!is_matched && section->tcp_match_connpkts && pkt->yct.orig_packets) {
if (pkt->yct.orig_packets <= section->tcp_match_connpkts) {
lgtrace_addp("connpackets match: %lu <= %d",
pkt->yct.orig_packets, section->tcp_match_connpkts);
lgtrace_addp("connpackets match: %u <= %d",
(uint32_t) pkt->yct.orig_packets, section->tcp_match_connpkts);
is_matched = 1;
frag_pts.used_points = 0;
@@ -453,7 +453,7 @@ drop:
return PKT_DROP;
}
int log_packet(const struct parsed_packet *pkt) {
void log_packet(const struct parsed_packet *pkt) {
int ret = 0;
const char *bpt = inet_ntop(

View File

@@ -22,7 +22,11 @@
#define TYPES_H
#include <asm/byteorder.h>
#ifndef KERNEL_SPACE
#include <assert.h>
#else
#define assert(...) ;
#endif
#ifdef KERNEL_SPACE
#include <linux/errno.h> // IWYU pragma: export