netoptimizer / IPTV-Analyzer

Fast MPEG2 Transport Stream Analyzer, based on Netfilter kernel module
www.iptv-analyzer.org
GNU General Public License v3.0
98 stars 55 forks source link

Kernel 4.4 compile not working due to extra param ip_route_me_harder() #28

Open rinsekloek opened 7 years ago

rinsekloek commented 7 years ago

After trying to compile the iptables module on my Raspberry PI 3 with kernel 4.4.x. it's stops with the error that it expects a third parameter to the function;

ip_route_me_harder()

../iptv-analyzer-0.9.4/iptables-module/compat_xtables.c:475:28: warning: passing argument 1 of ‘ip_route_me_harder’ from incompatible pointer type return ip_route_me_harder(*pskb, addr_type);

Ik looks like this param is introduced in kernel 4.4+. Can you help me patching the current code to make it compile with the linux 4.4 kernel ?

int xtnu_ip_route_me_harder(struct sk_buff **pskb, unsigned int addr_type) {

if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17)

    /* Actually this one is valid up to 2.6.18.4, but changed in 2.6.18.5 */
    return ip_route_me_harder(pskb);

elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)

    return ip_route_me_harder(pskb, addr_type);

elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)

    // Different callback.

else

    return ip_route_me_harder(*pskb, addr_type);

endif

}

Linux raspberrypi 4.4.21-v7+ #911 SMP Thu Sep 15 14:22:38 BST 2016 armv7l GNU/Linux

yasa1987 commented 7 years ago

Could you manage to solve this issue ? I'm stuck for the same reason... The ip_route_me_harder effectively changed in kernel version 4.4 and there is a net struct needed : http://elixir.free-electrons.com/linux/v4.4/source/net/ipv4/netfilter.c#L20

The net struct is defined in the following file : http://elixir.free-electrons.com/linux/v4.4/source/include/net/net_namespace.h#L47

No idea on what to do with this information. I can only propose following solutions:

rinsekloek commented 6 years ago

I made a fork that has this fix : https://github.com/rinsekloek/IPTV-Analyzer

oijkn commented 5 years ago

@rinsekloek : Hello,

Do you still use this module to capture mpg2ts packets ? If so, does it work on a raspberry pi 4 ? Can you also capture packets via the RTP protocol ?

I'm trying to compile the iptables-module and I'm having trouble compiling it with the new kernel version 4.9 (Raspberry PI 4). Having no notion of C code, I struggle to debug.

Thank you for your feedback and help.

BR