--- ../patch-o-matic-ng/patchlets/ipp2p/linux-2.6/net/ipv4/netfilter/ipt_ipp2p.c.orig 2007-07-11 23:45:12.000000000 +0200 +++ ../patch-o-matic-ng/patchlets/ipp2p/linux-2.6/net/ipv4/netfilter/ipt_ipp2p.c 2008-03-15 20:34:21.000000000 +0100 @@ -2,7 +2,6 @@ #include #endif #include -#include #include #include #include @@ -724,33 +723,19 @@ }; -static int +static bool match(const struct sk_buff *skb, const struct net_device *in, const struct net_device *out, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) const struct xt_match *match, -#endif const void *matchinfo, int offset, - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) - const void *hdr, - u_int16_t datalen, -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) unsigned int protoff, -#endif - - int *hotdrop) + bool *hotdrop) { const struct ipt_p2p_info *info = matchinfo; unsigned char *haystack; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) struct iphdr *ip = ip_hdr(skb); -#else - struct iphdr *ip = skb->nh.iph; -#endif int p2p_result = 0, i = 0; // int head_len; int hlen = ntohs(ip->tot_len)-(ip->ihl*4); /*hlen = packet-data length*/ @@ -824,20 +809,11 @@ -static int +static bool checkentry(const char *tablename, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) const void *ip, -#else - const struct ipt_ip *ip, -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) const struct xt_match *match, -#endif void *matchinfo, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) - unsigned int matchsize, -#endif unsigned int hook_mask) { /* Must specify -p tcp */ @@ -850,51 +826,25 @@ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) static struct xt_match ipp2p_match = { -#else -static struct ipt_match ipp2p_match = { -#endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) - { NULL, NULL }, - "ipp2p", - &match, - &checkentry, - NULL, - THIS_MODULE -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) .name = "ipp2p", -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) .family = AF_INET, -#endif .match = &match, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) .matchsize = sizeof(struct ipt_p2p_info), -#endif .checkentry = &checkentry, .me = THIS_MODULE, -#endif }; static int __init init(void) { printk(KERN_INFO "IPP2P v%s loading\n", IPP2P_VERSION); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) return xt_register_match(&ipp2p_match); -#else - return ipt_register_match(&ipp2p_match); -#endif } static void __exit fini(void) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) xt_unregister_match(&ipp2p_match); -#else - ipt_unregister_match(&ipp2p_match); -#endif printk(KERN_INFO "IPP2P v%s unloaded\n", IPP2P_VERSION); }