faicker / ipt_xor Goto Github PK
View Code? Open in Web Editor NEWiptables xor module
License: MIT License
iptables xor module
License: MIT License
~/build/ipt_xor/kernel # make
make -C /lib/modules/4.9.0-4-amd64/build M=$PWD;
make[1]: Entering directory '/usr/src/linux-headers-4.9.0-4-amd64'
CC [M] /root/build/ipt_xor/kernel/xt_XOR.o
/root/build/ipt_xor/kernel/xt_XOR.c:41:49: warning: ‘struct xt_target_param’ declared inside parameter list will not be visible outside of this definition or declaration
xt_xor_target(struct sk_buff *skb, const struct xt_target_param *par)
^~~~~~~~~~~~~~~
/root/build/ipt_xor/kernel/xt_XOR.c: In function ‘xt_xor_target’:
/root/build/ipt_xor/kernel/xt_XOR.c:43:41: error: dereferencing pointer to incomplete type ‘const struct xt_target_param’
const struct xt_xor_info *info = par->targinfo;
^~
/root/build/ipt_xor/kernel/xt_XOR.c: At top level:
/root/build/ipt_xor/kernel/xt_XOR.c:108:15: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.target = xt_xor_target,
^~~~~~~~~~~~~
/root/build/ipt_xor/kernel/xt_XOR.c:108:15: note: (near initialization for ‘xt_xor.target’)
/root/build/ipt_xor/kernel/xt_XOR.c:110:19: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.checkentry = xt_xor_checkentry,
^~~~~~~~~~~~~~~~~
/root/build/ipt_xor/kernel/xt_XOR.c:110:19: note: (near initialization for ‘xt_xor.checkentry’)
cc1: some warnings being treated as errors
/usr/src/linux-headers-4.9.0-4-common/scripts/Makefile.build:304: recipe for target '/root/build/ipt_xor/kernel/xt_XOR.o' failed
make[4]: *** [/root/build/ipt_xor/kernel/xt_XOR.o] Error 1
/usr/src/linux-headers-4.9.0-4-common/Makefile:1510: recipe for target '_module_/root/build/ipt_xor/kernel' failed
make[3]: *** [_module_/root/build/ipt_xor/kernel] Error 2
Makefile:150: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-4-amd64'
Makefile:8: recipe for target 'all' failed
make: *** [all] Error 2
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.3 (stretch)
Release: 9.3
Codename: stretch
4.9.0-4-amd64
any clues ?
Hello,
Is there any reason for assigning iph twice (lines 61 and 69)? Thanks
Line 69 in 033bee0
Hello,
It would be great to also have IPv6 support in this module. There is another one with similar concept, WGOBFS which has recently gained IPv6 support:
https://github.com/infinet/xt_wgobfs/blob/4134a20f5d99db3f7f4c3872438b735c537b9517/src/xt_WGOBFS_main.c#L276
https://github.com/infinet/xt_wgobfs/blob/4134a20f5d99db3f7f4c3872438b735c537b9517/src/xt_WGOBFS_main.c#L531
I tried adding it myself consulting the code above, but not succeeding so far, due to not being an expert in C and the Linux kernel code.
I saw the latest change was from 4 years ago, and thought the initial developer is long inactive. But seeing a reply on another bug today from @faicker, this gives another hope, maybe you could find time and interest in adding it? Thanks!
Hey,
I tried your kernel module, however it seems not to work on Debian 12 at all.
It does compile, its slightly smaller, seems to load fine, however iptables is unhappy.
debian 11
rwxr-xr-x 1 root root 16960 Apr 2 15:16 /usr/lib/x86_64-linux-gnu/xtables/libxt_XOR.so
debian 12
rwxr-xr-x 1 root root 14864 Apr 1 16:23 /usr/lib/x86_64-linux-gnu/xtables/libxt_XOR.so
Debian 12 build
gcc -O2 -Wall -I../include -fPIC -c -o libxt_XOR.o libxt_XOR.c
libxt_XOR.c:119:13: warning: ‘_init’ defined but not used [-Wunused-function]
119 | static void _init(void)
| ^~~~~
gcc -shared -o libxt_XOR.so libxt_XOR.o
rm libxt_XOR.o
make -C /lib/modules/6.1.0-18-amd64/build M=$PWD;
make[1]: Entering directory '/usr/src/linux-headers-6.1.0-18-amd64'
CC [M] /tmp/ipt_xor/kernel/xt_XOR.o
MODPOST /tmp/ipt_xor/kernel/Module.symvers
CC [M] /tmp/ipt_xor/kernel/xt_XOR.mod.o
LD [M] /tmp/ipt_xor/kernel/xt_XOR.ko
BTF [M] /tmp/ipt_xor/kernel/xt_XOR.ko
Skipping BTF generation for /tmp/ipt_xor/kernel/xt_XOR.ko due to unavailability of vmlinux
Any ideas?
Mismatched checksum caused some errors while combined with iptables nat, such as TCP connection reset/packet loss.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.