This commit is contained in:
commit
e4eab3c1ff
28
debian/Makefile
vendored
Normal file
28
debian/Makefile
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#
|
||||||
|
# apt update -y
|
||||||
|
# apt upgrade -y
|
||||||
|
# apt install --reinstall linux-headers-$(uname -r) -y
|
||||||
|
# apt install build-essential autoconf autogen libtool pkg-config libgmp3-dev bison flex libreadline-dev git libedit-dev libmnl-dev make dkms -y
|
||||||
|
# apt autoremove -y
|
||||||
|
#
|
||||||
|
|
||||||
|
obj-m += nft_fullcone.o
|
||||||
|
|
||||||
|
nft_fullcone-y := ../src/nft_ext_fullcone.o ../src/nf_nat_fullcone.o
|
||||||
|
|
||||||
|
KVERSION = $(shell uname -r)
|
||||||
|
|
||||||
|
all:
|
||||||
|
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
|
||||||
|
|
||||||
|
install:
|
||||||
|
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules_install
|
||||||
|
depmod -A
|
||||||
|
modprobe nft_fullcone
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rmmod nft_fullcone || echo "Please remove all nft rules with fullcone and run [rmmod nft_fullcone] manually"
|
||||||
|
rm -f /lib/modules/$(KVERSION)/extra/nft_fullcone.ko && depmod -A
|
||||||
|
|
||||||
|
clean:
|
||||||
|
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
|
@ -854,7 +854,11 @@ static uint16_t find_appropriate_port6(struct net *net, const u16 zone,
|
|||||||
/* for now we do the same thing for both --random and --random-fully */
|
/* for now we do the same thing for both --random and --random-fully */
|
||||||
|
|
||||||
/* select a random starting point */
|
/* select a random starting point */
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
||||||
|
start = (uint16_t) (get_random_u32() % (u32) range_size);
|
||||||
|
#else
|
||||||
start = (uint16_t) (prandom_u32() % (u32) range_size);
|
start = (uint16_t) (prandom_u32() % (u32) range_size);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ((original_port >= min && original_port <= min + range_size - 1)
|
if ((original_port >= min && original_port <= min + range_size - 1)
|
||||||
@ -927,7 +931,11 @@ static uint16_t find_appropriate_port(struct net *net, const u16 zone,
|
|||||||
/* for now we do the same thing for both --random and --random-fully */
|
/* for now we do the same thing for both --random and --random-fully */
|
||||||
|
|
||||||
/* select a random starting point */
|
/* select a random starting point */
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
||||||
|
start = (uint16_t) (get_random_u32() % (u32) range_size);
|
||||||
|
#else
|
||||||
start = (uint16_t) (prandom_u32() % (u32) range_size);
|
start = (uint16_t) (prandom_u32() % (u32) range_size);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ((original_port >= min && original_port <= min + range_size - 1)
|
if ((original_port >= min && original_port <= min + range_size - 1)
|
||||||
|
@ -179,7 +179,11 @@ static int nft_fullcone_init(const struct nft_ctx *ctx, const struct nft_expr *e
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
|
||||||
|
static int nft_fullcone_dump(struct sk_buff *skb, const struct nft_expr *expr, bool reset)
|
||||||
|
#else
|
||||||
static int nft_fullcone_dump(struct sk_buff *skb, const struct nft_expr *expr)
|
static int nft_fullcone_dump(struct sk_buff *skb, const struct nft_expr *expr)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
const struct nft_fullcone *priv = nft_expr_priv(expr);
|
const struct nft_fullcone *priv = nft_expr_priv(expr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user