+ Responder ao Tópico



  1. #1

    Padrão Como resolver este erro no ipp2p?

    ipp2p-0.8.2# make
    make -C /lib/modules/2.6.21.5-smp/build SUBDIRS=/usr/src/ipp2p-0.8.2 modules
    make[1]: Entering directory `/usr/src/linux-2.6.21.5'
    CC [M] /usr/src/ipp2p-0.8.2/ipt_ipp2p.o
    /usr/src/ipp2p-0.8.2/ipt_ipp2p.c:874: warning: initialization from incompatible pointer type
    Building modules, stage 2.
    MODPOST 1 modules
    CC /usr/src/ipp2p-0.8.2/ipt_ipp2p.mod.o
    LD [M] /usr/src/ipp2p-0.8.2/ipt_ipp2p.ko
    make[1]: Leaving directory `/usr/src/linux-2.6.21.5'
    gcc -O3 -Wall -DIPTABLES_VERSION=\"1.3.8\" -I/usr/src/iptables/include -fPIC -c libipt_ipp2p.c
    ld -shared -o libipt_ipp2p.so libipt_ipp2p.o

  2. #2

    Padrão

    tenta aplicar este patch que criei aqui.. tive o mesmo problema.. resolveu pra mim aqui.. meu kernel eh o 2.6.22.1

    Código :
    diff -Nru ipp2p-0.8.2.orig/ipt_ipp2p.c ipp2p-0.8.2/ipt_ipp2p.c
    --- ipp2p-0.8.2.orig/ipt_ipp2p.c        2006-09-27 12:52:00.000000000 +0300
    +++ ipp2p-0.8.2/ipt_ipp2p.c     2007-07-11 08:00:26.000000000 +0300
    @@ -2,9 +2,18 @@
     #include <linux/modversions.h>
     #endif
     #include <linux/module.h>
    -#include <linux/netfilter_ipv4/ip_tables.h>
     #include <linux/version.h>
    +
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
    +#      include <linux/netfilter/x_tables.h>
    +#      define ipt_register_match xt_register_match
    +#      define ipt_unregister_match xt_unregister_match
    +#      define ipt_match xt_match
    +#else
    +#      include <linux/netfilter_ipv4/ip_tables.h>
     //#include <linux/netfilter_ipv4/ipt_ipp2p.h>
    +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) */
    +
     #include "ipt_ipp2p.h"
     #include <net/tcp.h>
     #include <net/udp.h>
    @@ -748,7 +757,11 @@
     {
         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*/
    @@ -831,7 +844,9 @@
                const struct ipt_ip *ip,
     #endif
               void *matchinfo,
    +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
               unsigned int matchsize,
    +#endif
               unsigned int hook_mask)
     {
             /* Must specify -p tcp */
    @@ -843,15 +858,6 @@
     }
     
     
    -// TODO: find out what this structure is for (scheme taken
    -// from kernel sources)
    -// content seems to have a length of 8 bytes
    -// (at least on my x86 machine)
    -struct ipp2p_match_info {
    -       long int dunno_what_this_is_for;
    -       long int i_also_dunno_what_this_is_for;
    -};
    -
     static struct ipt_match ipp2p_match = {
     #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
            { NULL, NULL },
    @@ -860,17 +866,16 @@
            &checkentry,
            NULL,
            THIS_MODULE
    -#endif
    -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17))
    +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
            .name           = "ipp2p",
            .match          = &match,
            .checkentry     = &checkentry,
            .me             = THIS_MODULE,
    -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
    +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) */
            .name           = "ipp2p",
            .match          = &match,
            .family         = AF_INET,
    -       .matchsize      = sizeof(struct ipp2p_match_info),
    +       .matchsize      = XT_ALIGN(sizeof(struct ipt_p2p_info)),
            .checkentry     = &checkentry,
            .me             = THIS_MODULE,
     #endif

    basta gravar em um arquivo.. e fazer

    patch -p1 < arquivo.patch

  3. #3

    Padrão

    Citação Postado originalmente por alexandrecorrea Ver Post
    tenta aplicar este patch que criei aqui.. tive o mesmo problema.. resolveu pra mim aqui.. meu kernel eh o 2.6.22.1

    Código :
    diff -Nru ipp2p-0.8.2.orig/ipt_ipp2p.c ipp2p-0.8.2/ipt_ipp2p.c
    --- ipp2p-0.8.2.orig/ipt_ipp2p.c        2006-09-27 12:52:00.000000000 +0300
    +++ ipp2p-0.8.2/ipt_ipp2p.c     2007-07-11 08:00:26.000000000 +0300
    @@ -2,9 +2,18 @@
     #include <linux/modversions.h>
     #endif
     #include <linux/module.h>
    -#include <linux/netfilter_ipv4/ip_tables.h>
     #include <linux/version.h>
    +
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
    +#      include <linux/netfilter/x_tables.h>
    +#      define ipt_register_match xt_register_match
    +#      define ipt_unregister_match xt_unregister_match
    +#      define ipt_match xt_match
    +#else
    +#      include <linux/netfilter_ipv4/ip_tables.h>
     //#include <linux/netfilter_ipv4/ipt_ipp2p.h>
    +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) */
    +
     #include "ipt_ipp2p.h"
     #include <net/tcp.h>
     #include <net/udp.h>
    @@ -748,7 +757,11 @@
     {
         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*/
    @@ -831,7 +844,9 @@
                const struct ipt_ip *ip,
     #endif
               void *matchinfo,
    +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
               unsigned int matchsize,
    +#endif
               unsigned int hook_mask)
     {
             /* Must specify -p tcp */
    @@ -843,15 +858,6 @@
     }
     
     
    -// TODO: find out what this structure is for (scheme taken
    -// from kernel sources)
    -// content seems to have a length of 8 bytes
    -// (at least on my x86 machine)
    -struct ipp2p_match_info {
    -       long int dunno_what_this_is_for;
    -       long int i_also_dunno_what_this_is_for;
    -};
    -
     static struct ipt_match ipp2p_match = {
     #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
            { NULL, NULL },
    @@ -860,17 +866,16 @@
            &checkentry,
            NULL,
            THIS_MODULE
    -#endif
    -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17))
    +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
            .name           = "ipp2p",
            .match          = &match,
            .checkentry     = &checkentry,
            .me             = THIS_MODULE,
    -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
    +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) */
            .name           = "ipp2p",
            .match          = &match,
            .family         = AF_INET,
    -       .matchsize      = sizeof(struct ipp2p_match_info),
    +       .matchsize      = XT_ALIGN(sizeof(struct ipt_p2p_info)),
            .checkentry     = &checkentry,
            .me             = THIS_MODULE,
     #endif

    basta gravar em um arquivo.. e fazer

    patch -p1 < arquivo.patch

    Dentro da pasta do ipp2p, existe tais arquivos:
    #ls ipp2p-0.8.2
    COPYING Makefile Makefile_old Module.symvers README ipt_ipp2p.c ipt_ipp2p.h libipt_ipp2p.c

    Qual desses arquivos eu aplico sua patch??

    Ex: patch -p1 < ipt_ipp2p.c ??

    Depois de aplicar devo recompilar o kernel e depois compilar o ipp2p???

  4. #4

    Padrão

    nao.. o ipp2p roda sem necessidade de recompilar kernel.. eh um modulo apenas !!

  5. #5

    Padrão

    Citação Postado originalmente por alexandrecorrea Ver Post
    nao.. o ipp2p roda sem necessidade de recompilar kernel.. eh um modulo apenas !!
    O comando para aplicar sua patch é este:


    Ex: patch -p1 < ipt_ipp2p.c (o arquivo é este ?)


    #ls ipp2p-0.8.2
    COPYING Makefile Makefile_old Module.symvers README ipt_ipp2p.c ipt_ipp2p.h libipt_ipp2p.c

  6. #6

    Padrão

    cara pra aplicar patch eh

    patch -p1 < arquivo.do.patch

    faz dentro da pasta do ipp2p ...

  7. #7

    Padrão Não deu certo!!

    Citação Postado originalmente por alexandrecorrea Ver Post
    tenta aplicar este patch que criei aqui.. tive o mesmo problema.. resolveu pra mim aqui.. meu kernel eh o 2.6.22.1

    Código :
    diff -Nru ipp2p-0.8.2.orig/ipt_ipp2p.c ipp2p-0.8.2/ipt_ipp2p.c
    --- ipp2p-0.8.2.orig/ipt_ipp2p.c        2006-09-27 12:52:00.000000000 +0300
    +++ ipp2p-0.8.2/ipt_ipp2p.c     2007-07-11 08:00:26.000000000 +0300
    @@ -2,9 +2,18 @@
     #include <linux/modversions.h>
     #endif
     #include <linux/module.h>
    -#include <linux/netfilter_ipv4/ip_tables.h>
     #include <linux/version.h>
    +
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
    +#      include <linux/netfilter/x_tables.h>
    +#      define ipt_register_match xt_register_match
    +#      define ipt_unregister_match xt_unregister_match
    +#      define ipt_match xt_match
    +#else
    +#      include <linux/netfilter_ipv4/ip_tables.h>
     //#include <linux/netfilter_ipv4/ipt_ipp2p.h>
    +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) */
    +
     #include "ipt_ipp2p.h"
     #include <net/tcp.h>
     #include <net/udp.h>
    @@ -748,7 +757,11 @@
     {
         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*/
    @@ -831,7 +844,9 @@
                const struct ipt_ip *ip,
     #endif
               void *matchinfo,
    +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
               unsigned int matchsize,
    +#endif
               unsigned int hook_mask)
     {
             /* Must specify -p tcp */
    @@ -843,15 +858,6 @@
     }
     
     
    -// TODO: find out what this structure is for (scheme taken
    -// from kernel sources)
    -// content seems to have a length of 8 bytes
    -// (at least on my x86 machine)
    -struct ipp2p_match_info {
    -       long int dunno_what_this_is_for;
    -       long int i_also_dunno_what_this_is_for;
    -};
    -
     static struct ipt_match ipp2p_match = {
     #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
            { NULL, NULL },
    @@ -860,17 +866,16 @@
            &checkentry,
            NULL,
            THIS_MODULE
    -#endif
    -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17))
    +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
            .name           = "ipp2p",
            .match          = &match,
            .checkentry     = &checkentry,
            .me             = THIS_MODULE,
    -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
    +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) */
            .name           = "ipp2p",
            .match          = &match,
            .family         = AF_INET,
    -       .matchsize      = sizeof(struct ipp2p_match_info),
    +       .matchsize      = XT_ALIGN(sizeof(struct ipt_p2p_info)),
            .checkentry     = &checkentry,
            .me             = THIS_MODULE,
     #endif

    basta gravar em um arquivo.. e fazer

    patch -p1 < arquivo.patch


    Olá Alexandre,

    fiz o seguinte:

    1 - apliquei sua patch

    ipp2p-0.8.2# patch -p1 < p2p.patch
    patching file ipt_ipp2p.c
    Hunk #2 succeeded at 757 with fuzz 1.
    Hunk #3 FAILED at 844.
    Hunk #4 FAILED at 858.
    Hunk #5 FAILED at 866.
    3 out of 5 hunks FAILED -- saving rejects to file ipt_ipp2p.c.rej

    _____________

    2 - rodei o make

    make
    make -C /lib/modules/2.6.21.5-smp/build SUBDIRS=/usr/src/ipp2p-0.8.2 modules
    make[1]: Entering directory `/usr/src/linux-2.6.21.5'
    CC [M] /usr/src/ipp2p-0.8.2/ipt_ipp2p.o
    /usr/src/ipp2p-0.8.2/ipt_ipp2p.c:887: warning: initialization from incompatible pointer type
    Building modules, stage 2.
    MODPOST 1 modules
    CC /usr/src/ipp2p-0.8.2/ipt_ipp2p.mod.o
    LD [M] /usr/src/ipp2p-0.8.2/ipt_ipp2p.ko
    make[1]: Leaving directory `/usr/src/linux-2.6.21.5'
    gcc -O3 -Wall -DIPTABLES_VERSION=\"1.3.8\" -I/usr/src/iptables/include -fPIC -c libipt_ipp2p.c
    ld -shared -o libipt_ipp2p.so libipt_ipp2p.o


    Ocorreu a mesma mensagem de erro!


    - - - - - - - - - - - - -
    -Kernel 2.6.21.5-smp
    -Slack 12

  8. #8

    Padrão

    seguinte...

    pega o arquivo de patch.. as linhas que tem - sao substituidas pelas que tem +

    ai vc edita o arquivo ipt_ipp2p.c e faz as alteracoes MANUALMENTE !!

  9. #9

    Padrão

    Veja bem...

    Reinstalei o slack 12 e compilei o ipp2p, para minha surpresa ocorreu tudo bem. Porém, depois que compilei o kernel o módulo do ipp2p não carrega.

    Veja a mensagem:

    #modprobe ipt_ipp2p
    FATAL: Error inserting ipt_ipp2p (/lib/modules/2.6.21.5-smp/kernel/net/ipv4/netfilter/ipt_ipp2p.ko): Invalid module format

    #dmesg
    ipt_ipp2p: version magic '2.6.21.5-smp SMP mod_unload 686 ' should be '2.6.21.5-smp SMP mod_unload PENTIUMIII '


    Informações

    Slack 12 com smp
    Processador: Xeon(opção marcada no kernel=Xeon/PentiumIII)

    Antes de compilar o kernel, o ipp2p funcionou perfeito, mas após a compilação o módulo não carrega mais..

    O que pode ser???
    Última edição por silvasp; 17-01-2008 às 15:23.

  10. #10

    Smile Conseguir Resolver!! Eba!!!

    Olá pessoal...

    Finalmente conseguir resolver o poblema do ipp2p no slack 12.

    Obrigado a todos que tentaram me ajudar!!!