faicker / ipt_httpredirect Goto Github PK
View Code? Open in Web Editor NEWhttp 302 redirect iptables module
License: MIT License
http 302 redirect iptables module
License: MIT License
Issue when compiling the kernel module:
CC [M] /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.o
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c: In function ‘send_rst’:
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:55:28: error: passing argument 1 of ‘ip_route_me_harder’ from incompatible pointer type [-Werror=incompatible-pointer-types]
if (ip_route_me_harder(nskb, RTN_UNSPEC)) {
^~~~
In file included from /usr/src/linux-headers-4.19.0-6-common/include/linux/netfilter/x_tables.h:245,
from /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:12:
/usr/src/linux-headers-4.19.0-6-common/include/linux/netfilter_ipv4.h:19:36: note: expected ‘struct net *’ but argument is of type ‘struct sk_buff *’
int ip_route_me_harder(struct net *net, struct sk_buff *skb, unsigned addr_type);
~~~~~~~~~~~~^~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:55:9: error: too few arguments to function ‘ip_route_me_harder’
if (ip_route_me_harder(nskb, RTN_UNSPEC)) {
^~~~~~~~~~~~~~~~~~
In file included from /usr/src/linux-headers-4.19.0-6-common/include/linux/netfilter/x_tables.h:245,
from /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:12:
/usr/src/linux-headers-4.19.0-6-common/include/linux/netfilter_ipv4.h:19:5: note: declared here
int ip_route_me_harder(struct net *net, struct sk_buff *skb, unsigned addr_type);
^~~~~~~~~~~~~~~~~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:66:9: error: ‘struct sk_buff’ has no member named ‘nfctinfo’
nskb->nfctinfo = ctinfo;
^~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:68:18: error: passing argument 1 of ‘ip_local_out’ from incompatible pointer type [-Werror=incompatible-pointer-types]
ip_local_out(nskb);
^~~~
In file included from /usr/src/linux-headers-4.19.0-6-common/include/net/icmp.h:25,
from /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:7:
/usr/src/linux-headers-4.19.0-6-common/include/net/ip.h:165:30: note: expected ‘struct net *’ but argument is of type ‘struct sk_buff *’
int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
~~~~~~~~~~~~^~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:68:5: error: too few arguments to function ‘ip_local_out’
ip_local_out(nskb);
^~~~~~~~~~~~
In file included from /usr/src/linux-headers-4.19.0-6-common/include/net/icmp.h:25,
from /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:7:
/usr/src/linux-headers-4.19.0-6-common/include/net/ip.h:165:5: note: declared here
int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
^~~~~~~~~~~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c: In function ‘send_redirect_to_client’:
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:130:28: error: passing argument 1 of ‘ip_route_me_harder’ from incompatible pointer type [-Werror=incompatible-pointer-types]
if (ip_route_me_harder(nskb, RTN_UNSPEC))
^~~~
In file included from /usr/src/linux-headers-4.19.0-6-common/include/linux/netfilter/x_tables.h:245,
from /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:12:
/usr/src/linux-headers-4.19.0-6-common/include/linux/netfilter_ipv4.h:19:36: note: expected ‘struct net *’ but argument is of type ‘struct sk_buff *’
int ip_route_me_harder(struct net *net, struct sk_buff *skb, unsigned addr_type);
~~~~~~~~~~~~^~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:130:9: error: too few arguments to function ‘ip_route_me_harder’
if (ip_route_me_harder(nskb, RTN_UNSPEC))
^~~~~~~~~~~~~~~~~~
In file included from /usr/src/linux-headers-4.19.0-6-common/include/linux/netfilter/x_tables.h:245,
from /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:12:
/usr/src/linux-headers-4.19.0-6-common/include/linux/netfilter_ipv4.h:19:5: note: declared here
int ip_route_me_harder(struct net *net, struct sk_buff *skb, unsigned addr_type);
^~~~~~~~~~~~~~~~~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:143:9: error: ‘struct sk_buff’ has no member named ‘nfctinfo’
nskb->nfctinfo = ctinfo;
^~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:145:18: error: passing argument 1 of ‘ip_local_out’ from incompatible pointer type [-Werror=incompatible-pointer-types]
ip_local_out(nskb);
^~~~
In file included from /usr/src/linux-headers-4.19.0-6-common/include/net/icmp.h:25,
from /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:7:
/usr/src/linux-headers-4.19.0-6-common/include/net/ip.h:165:30: note: expected ‘struct net *’ but argument is of type ‘struct sk_buff *’
int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
~~~~~~~~~~~~^~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:145:5: error: too few arguments to function ‘ip_local_out’
ip_local_out(nskb);
^~~~~~~~~~~~
In file included from /usr/src/linux-headers-4.19.0-6-common/include/net/icmp.h:25,
from /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:7:
/usr/src/linux-headers-4.19.0-6-common/include/net/ip.h:165:5: note: declared here
int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
^~~~~~~~~~~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:82:21: warning: unused variable ‘rst_skb’ [-Wunused-variable]
struct sk_buff *rst_skb;
^~~~~~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c: At top level:
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:188:51: warning: ‘struct xt_target_param’ declared inside parameter list will not be visible outside of this definition or declaration
httpredirect_tg(struct sk_buff *skb, const struct xt_target_param *par)
^~~~~~~~~~~~~~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c: In function ‘httpredirect_tg’:
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:190:58: error: dereferencing pointer to incomplete type ‘const struct xt_target_param’
const struct xt_httpredirect_info *httpredirect = par->targinfo;
^~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c: At top level:
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:211:22: error: initialization of ‘unsigned int (*)(struct sk_buff *, const struct xt_action_param *)’ from incompatible pointer type ‘unsigned int (*)(struct sk_buff *, const struct xt_target_param *)’ [-Werror=incompatible-pointer-types]
.target = httpredirect_tg,
^~~~~~~~~~~~~~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:211:22: note: (near initialization for ‘httpredirect_tg_reg.target’)
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:215:22: error: initialization of ‘int (*)(const struct xt_tgchk_param *)’ from incompatible pointer type ‘bool (*)(const struct xt_tgchk_param *)’ {aka ‘_Bool (*)(const struct xt_tgchk_param *)’} [-Werror=incompatible-pointer-types]
.checkentry = httpredirect_tg_check,
^~~~~~~~~~~~~~~~~~~~~
/root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.c:215:22: note: (near initialization for ‘httpredirect_tg_reg.checkentry’)
cc1: some warnings being treated as errors
make[4]: *** [/usr/src/linux-headers-4.19.0-6-common/scripts/Makefile.build:315: /root/ipt_httpredirect/kernel/xt_HTTPREDIRECT.o] Error 1
make[3]: *** [/usr/src/linux-headers-4.19.0-6-common/Makefile:1534: _module_/root/ipt_httpredirect/kernel] Error 2
make[2]: *** [Makefile:146: sub-make] Error 2
make[1]: *** [Makefile:8: all] Error 2
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.