luigirizzo / dummynet

Automatically exported from code.google.com/p/dummynet
147 stars 53 forks source link

Does not build in Linux 4.1.15 #8

Open finger563 opened 8 years ago

finger563 commented 8 years ago

Produces the following error when compiling the module:

In file included from /home/debian/dummynet/kipfw-mod/ipfw2_mod.c:100:0:
include/net/inet_hashtables.h: In function ‘sk_daddr_set’:
include/net/inet_hashtables.h:396:2: error: implicit declaration of function ‘ipv6_addr_set_v4mapped’ [-Werror=implicit-function-declaration]
  ipv6_addr_set_v4mapped(addr, &sk->sk_v6_daddr);
  ^
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c: In function ‘ipfw2_queue_handler’:
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c:559:26: error: ‘struct nf_queue_entry’ has no member named ‘indev’
  m->m_pkthdr.rcvif = info->indev;
                          ^
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c:568:10: error: ‘struct nf_queue_entry’ has no member named ‘hook’
  if (info->hook == IPFW_HOOK_IN) {
          ^
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c:569:39: error: ‘struct nf_queue_entry’ has no member named ‘indev’
   ret = ipfw_check_hook(NULL, &m, info->indev, PFIL_IN, NULL);
                                       ^
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c:571:39: error: ‘struct nf_queue_entry’ has no member named ‘outdev’
   ret = ipfw_check_hook(NULL, &m, info->outdev, PFIL_OUT, NULL);
                                       ^
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c: At top level:
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c:827:17: error: initialization from incompatible pointer type [-Werror]
                 .hook           = call_ipfw,
                 ^
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c:827:17: error: (near initialization for ‘ipfw_ops[0].hook’) [-Werror]
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c:834:17: error: initialization from incompatible pointer type [-Werror]
                 .hook           = call_ipfw,
                 ^
/home/debian/dummynet/kipfw-mod/ipfw2_mod.c:834:17: error: (near initialization for ‘ipfw_ops[1].hook’) [-Werror]
ducalpha commented 8 years ago

See tomerb's fork which adds support for compiling on kernel > 4.1: https://github.com/tomerb/dummynet/tree/master

jurijpar commented 8 years ago

Sorry that does not work for me - wish it did ! - I get the same error after trying to compile the source. Im using ubuntu 4.4.0-34-generic -specifically the error is /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c: In function ‘ipfw2_queue_handler’: /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:559:26: error: ‘struct nf_queue_entry’ has no member named ‘indev’ m->m_pkthdr.rcvif = info->indev; ^ /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:568:10: error: ‘struct nf_queue_entry’ has no member named ‘hook’ if (info->hook == IPFW_HOOK_IN) { ^ /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:569:39: error: ‘struct nf_queue_entry’ has no member named ‘indev’ ret = ipfw_check_hook(NULL, &m, info->indev, PFIL_IN, NULL); ^ /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:571:39: error: ‘struct nf_queue_entry’ has no member named ‘outdev’ ret = ipfw_check_hook(NULL, &m, info->outdev, PFIL_OUT, NULL); ^ /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c: At top level: /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:827:17: error: initialization from incompatible pointer type [-Werror] .hook = call_ipfw, ^ /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:827:17: error: (near initialization for ‘ipfw_ops[0].hook’) [-Werror] /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:831:17: error: unknown field ‘owner’ specified in initializer SET_MOD_OWNER ^ /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:831:17: error: excess elements in struct initializer [-Werror] /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:831:17: error: (near initialization for ‘ipfw_ops[0]’) [-Werror] /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:834:17: error: initialization from incompatible pointer type [-Werror] .hook = call_ipfw, ^ /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:834:17: error: (near initialization for ‘ipfw_ops[1].hook’) [-Werror] /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:838:3: error: unknown field ‘owner’ specified in initializer SET_MOD_OWNER ^ /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:838:3: error: excess elements in struct initializer [-Werror] /tmp/dummynet-master/kipfw-mod/ipfw2_mod.c:838:3: error: (near initialization for ‘ipfw_ops[1]’) [-Werror] cc1: all warnings being treated as errors make[3]: * [/tmp/dummynet-master/kipfw-mod/ipfw2_mod.o] Error 1 make[2]: * [module/tmp/dummynet-master/kipfw-mod] Error 2 make[2]: Leaving directory /usr/src/linux-headers-4.4.0-34-generic' make[1]: *** [kipfw] Error 2 make[1]: Leaving directory/tmp/dummynet-master/kipfw-mod' make: *\ [kipfw] Error 2

Since I am a noob trying to get ipfw to work on Linux - Ubuntu 14.04 to be precise, I would very much appreciate some noob level (lead me by the nose type) help.

jurijpar commented 8 years ago

Bump... does anyone have an idea what the issue is ? A more recent attempt with 4.4.0-36-generic linux headers (Ubuntu 16) yielded these specific errors (and more)..............

In file included from /home/parry/Downloads/dummynet-master/kipfw-mod/ipfw2_mod.c:100:0: include/net/inet_hashtables.h: In function ‘sk_daddr_set’: include/net/inet_hashtables.h:354:2: error: implicit declaration of function ‘ipv6_addr_set_v4mapped’ [-Werror=implicit-function-declaration] ipv6_addr_set_v4mapped(addr, &sk->sk_v6_daddr); ^ /home/parry/Downloads/dummynet-master/kipfw-mod/ipfw2_mod.c: In function ‘ip_output’: /home/parry/Downloads/dummynet-master/kipfw-mod/ipfw2_mod.c:362:15: error: passing argument 1 of ‘dst_output’ from incompatible pointer type [-Werror=incompatible-pointer-types] dst_output(skb); ^ In file included from include/net/sock.h:67:0, from include/linux/tcp.h:22, from include/linux/ipv6.h:72, from include/net/netfilter/nf_queue.h:5, from /home/parry/Downloads/dummynet-master/kipfw-mod/ipfw2_mod.c:71: include/net/dst.h:490:19: note: expected ‘struct net ’ but argument is of type ‘struct sk_buff ’ static inline int dst_output(struct net net, struct sock sk, struct sk_buff *skb)

seshsubb commented 7 years ago

Hi

I m observing a similar issue while trying to build dummynet. Any suggestions will be helpful.

Thanks

jurijpar commented 7 years ago

Perhaps our colleagues at the University of Pisa can help us. I think the problem starts with the version of linux that is supported. Alas ! I have had no problems until the headers exceed 3.x.x.x. Since I am merely a novice (at best) I defer to the genii in this community ;)

jurijpar commented 7 years ago

I was worried it was 3rd declension fortunately it is not http://www.cultus.hk/Latin_vocab/noun1245/genius.html

NeetishPathak commented 7 years ago

I am facing the same issue. Does anyone have a resolution ?

include/net/inet_hashtables.h: In function ‘sk_daddr_set’: include/net/inet_hashtables.h:354:2: error: implicit declaration of function ‘ipv6_addr_set_v4mapped’ [-Werror=implicit-function-declaration] ipv6_addr_set_v4mapped(addr, &sk->sk_v6_daddr); ^ /tmp/dummynet/kipfw-mod/ipfw2_mod.c: In function ‘ip_output’: /tmp/dummynet/kipfw-mod/ipfw2_mod.c:362:15: error: passing argument 1 of ‘dst_output’ from incompatible pointer type [-Werror=incompatible-pointer-types] dst_output(skb); ^ In file included from include/net/sock.h:67:0, from include/linux/tcp.h:22, from includ...