NICMx / Jool

SIIT and NAT64 for Linux
GNU General Public License v2.0
320 stars 66 forks source link

Kernel module not compiling in 4.4.1 (ArchLinux) #209

Closed evelineraine closed 8 years ago

evelineraine commented 8 years ago

In kernel 4.4.1-2-ARCH ip6_local_out requires 3 arguments instead of 1, causing compilation to fail.

table.c:
static void send_probe_packet(struct session_entry *session) {
    struct sk_buff *skb;
    ...
    error = ip6_local_out(skb);
}
include/net/ipv6.h:
int ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
make.log:
DKMS make.log for jool-3.4.2 for kernel 4.4.1-2-ARCH (x86_64)
Wed Mar  2 15:59:16 EET 2016
make: Entering directory '/usr/lib/modules/4.4.1-2-ARCH/build'
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/pool4/entry.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/pool4/table.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/pool4/empty.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/pool4/db.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/bib/port_allocator.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/bib/entry.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/bib/table.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/bib/db.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/bib/static_routes.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/session/entry.o
  CC [M]  /var/lib/dkms/jool/3.4.2/build/mod/stateful/session/table.o
/var/lib/dkms/jool/3.4.2/build/mod/stateful/session/table.c: In function ‘send_probe_packet’:
/var/lib/dkms/jool/3.4.2/build/mod/stateful/session/table.c:205:24: warning: passing argument 1 of ‘ip6_local_out’ from incompatible pointer type [-Wincompatible-pointer-types]
  error = ip6_local_out(skb); /* Implicit kfree_skb(skb) goes here. */
                        ^
In file included from include/net/inetpeer.h:15:0,
                 from include/net/route.h:28,
                 from include/net/ip.h:31,
                 from /var/lib/dkms/jool/3.4.2/build/mod/stateful/../../include/nat64/mod/common/packet.h:12,
                 from /var/lib/dkms/jool/3.4.2/build/mod/stateful/../../include/nat64/mod/stateful/session/table.h:5,
                 from /var/lib/dkms/jool/3.4.2/build/mod/stateful/session/table.c:1:
include/net/ipv6.h:889:5: note: expected ‘struct net *’ but argument is of type ‘struct sk_buff *’
 int ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
     ^
/var/lib/dkms/jool/3.4.2/build/mod/stateful/session/table.c:205:10: error: too few arguments to function ‘ip6_local_out’
  error = ip6_local_out(skb); /* Implicit kfree_skb(skb) goes here. */
          ^
In file included from include/net/inetpeer.h:15:0,
                 from include/net/route.h:28,
                 from include/net/ip.h:31,
                 from /var/lib/dkms/jool/3.4.2/build/mod/stateful/../../include/nat64/mod/common/packet.h:12,
                 from /var/lib/dkms/jool/3.4.2/build/mod/stateful/../../include/nat64/mod/stateful/session/table.h:5,
                 from /var/lib/dkms/jool/3.4.2/build/mod/stateful/session/table.c:1:
include/net/ipv6.h:889:5: note: declared here
 int ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb);
     ^
scripts/Makefile.build:258: recipe for target '/var/lib/dkms/jool/3.4.2/build/mod/stateful/session/table.o' failed
make[1]: *** [/var/lib/dkms/jool/3.4.2/build/mod/stateful/session/table.o] Error 1
Makefile:1384: recipe for target '_module_/var/lib/dkms/jool/3.4.2/build/mod/stateful' failed
make: *** [_module_/var/lib/dkms/jool/3.4.2/build/mod/stateful] Error 2
make: Leaving directory '/usr/lib/modules/4.4.1-2-ARCH/build'
ydahhrk commented 8 years ago

Can you please try this code? https://github.com/NICMx/Jool/compare/issue198

evelineraine commented 8 years ago

Compiles and runs great! In stateful mode nat's synthetic 100Mb/s using around 2% of cpu. I will put it to further testing with my real traffic soon. Huge thanks to you!

ydahhrk commented 8 years ago

Thank you! That really helps :)