Re: iptables (1.4.2 release) failed to run on embedded system with "can't initialize iptables table `filter'"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 21 Nov 2008 11:07:41 -0500, Jan Engelhardt <jengelh@xxxxxxxxxx> wrote:

On Friday 2008-11-21 15:51, David Wu wrote:

My question:
  1 why tries to allocate 0 size memory, it is useful?

        array_elems = (h->num_chains / list_length) +
                      (h->num_chains % list_length ? 1 : 0);
        array_mem   = sizeof(h->chain_index) * array_elems;


Logically,
array_mem == 0  =>  (sizeof(h->chain_index) == 0) ^ (array_elems == 0).
And given that sizeof() is unlikely to return 0 here, array_elems must
be 0. And the only way array_elems can be 0 is that h->num_chains <
list_length && h->num_chains == 0.  Buf if you have 0 chains to start
with, it sounds like it really could not get the filter to table to
work. gdb will help.

It seems that I really have a 0 chains to start. Does this include default chains or is it only user defined chains?

I have compiled on x86(openSUSE 11.0 (X86-64)VERSION = 11.0)
(Linux cyprus 2.6.25.11-0.1-default #1 SMP 2008-07-13 20:48:28 +0200 x86_64 x86_64 x86_64 GNU/Linux)
and enable debug() in libiptc/libiptc.c

This is output:
cyprus:/home/wmq/iptables/iptables-1.4.2 # ./iptables -L
Alloc Chain index, elems:0 mem:0 bytes
Building chain index
Number of user defined chains:0 bucket_sz:40 array_sz:0
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination


  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

It needs the same ABI, as was answered before:

http://marc.info/?l=netfilter-devel&m=122309437709848&w=2

I have built it with: (I added --disable-largefile)
$ ../configure --host=m68k-uclinux --with-kernel=/home/wmq/HG-REV/5329/uCmib.devel/kernel --disable-largefile --disable-shared CFLAGS=-DNO_SHARED_LIBS on a machine (uname -a Linux ivymike 2.6.18.2-34-bigsmp #1 SMP Mon Nov 27 11:46:27 UTC 2006 i686 i686 i386 GNU/Linux, openSUSE 10.2 (i586) VERSION = 10.2)
kernel version is 2.6.26-rc7

embedded system is 32bit, building system is also 32 bit.
I don't have a clue where goes wrong. Could you give more info about which ABI involved.(libc ?)


thanks,

--
David Wu
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux