All of lore.kernel.org
 help / color / mirror / Atom feed
* iptables (1.4.2 release) failed to run on embedded system with "can't initialize iptables table `filter'"
@ 2008-11-19 21:51 David Wu
  0 siblings, 0 replies; 11+ messages in thread
From: David Wu @ 2008-11-19 21:51 UTC (permalink / raw)
  To: netfilter

I am trying to run iptables (1.4.2 release)on a MCF53281(m68knommu, 2.6.26
kernel) embedded board.
It failed with "
iptables v1.4.2: can't initialize iptables table `filter': No
chain/target/match by that name
Perhaps iptables or your kernel needs to be upgraded.

I traced the calls and found out that it failed at
iptcc_chain_index_alloc():

           h->chain_index = malloc(array_mem);

in the first call to iptcc_chain_index_alloc() array_mem is 0 which means
malloc(0) is called in the above statement.
depends on the implementation malloc(0) may return NULL which is the case
for m68k-uclinux-gcc(gcc version 4.2.3 and uClibc-0.9.29-20081003)

I have changed the code to:
          if(array_mem == 0)
                  h->chain_index = malloc(1);
          else
          h->chain_index = malloc(array_mem);

and it works(while I have to fix another error -- ip_tables: ERROR target:
invalid size 30 != 32)

My question:
    1 why tries to allocate 0 size memory, it is useful?
    2 is there any problem to the iptables program in my change?
      I may have to rebuild the toolchain so malloc will return a live
pointer for 0 size allocation.
    3 I have got the error
      ip_tables: ERROR target: invalid size 30 != 32
      from 1.3.7 and 1.4.2 (didn't try other versions) and sent to this list
a question before but haven't received any answer
   then I assume I have done something wrong.

If this is not the correct mailing list for these questions then can
someone let me know the right mailing list ?

thanks,


David Wu

^ permalink raw reply	[flat|nested] 11+ messages in thread
* iptables (1.4.2 release) failed to run on embedded system with "can't initialize iptables table `filter'"
@ 2008-11-21 14:51 David Wu
  2008-11-21 16:07 ` Jan Engelhardt
  0 siblings, 1 reply; 11+ messages in thread
From: David Wu @ 2008-11-21 14:51 UTC (permalink / raw)
  To: netfilter-devel

I am trying to run iptables (1.4.2 release)on a MCF53281(m68knommu, 2.6.26
kernel) embedded board.
It failed with "
iptables v1.4.2: can't initialize iptables table `filter': No
chain/target/match by that name
Perhaps iptables or your kernel needs to be upgraded.

I traced the calls and found out that it failed at
iptcc_chain_index_alloc():

            h->chain_index = malloc(array_mem);

in the first call to iptcc_chain_index_alloc() array_mem is 0 which means
malloc(0) is called in the above statement.
depends on the implementation malloc(0) may return NULL which is the case
for m68k-uclinux-gcc(gcc version 4.2.3 and uClibc-0.9.29-20081003)

I have changed the code to:
           if(array_mem == 0)
                   h->chain_index = malloc(1);
           else
           h->chain_index = malloc(array_mem);

and it works(while I have to fix another error -- ip_tables: ERROR target:
invalid size 30 != 32)

My question:
     1 why tries to allocate 0 size memory, it is useful?
     2 is there any problem to the iptables program in my change?
       I may have to rebuild the toolchain so malloc will return a live
pointer for 0 size allocation.
     3 I have got the error
       ip_tables: ERROR target: invalid size 30 != 32
       from 1.3.7 and 1.4.2 (didn't try other versions) and sent to this  
list
a question before but haven't received any answer
    then I assume I have done something wrong.

If this is not the correct mailing list for these questions then can
someone let me know the right mailing list ?

thanks,


David Wu

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-11-26 17:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-19 21:51 iptables (1.4.2 release) failed to run on embedded system with "can't initialize iptables table `filter'" David Wu
  -- strict thread matches above, loose matches on Subject: below --
2008-11-21 14:51 David Wu
2008-11-21 16:07 ` Jan Engelhardt
2008-11-21 18:35   ` David Wu
2008-11-22 11:06     ` Jan Engelhardt
2008-11-25 17:10       ` David Wu
2008-11-25 17:45         ` Jan Engelhardt
2008-11-25 19:07           ` David Wu
2008-11-26 16:15             ` Jan Engelhardt
2008-11-26 16:25               ` Patrick McHardy
2008-11-26 17:14                 ` Jan Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.