Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "David Wu" <davidwu@arcturusnetworks.com>
To: netfilter@vger.kernel.org
Subject: iptables (1.4.2 release) failed to run on embedded system with "can't initialize iptables table `filter'"
Date: Wed, 19 Nov 2008 16:51:38 -0500	[thread overview]
Message-ID: <op.ukvy0c1eqigx4y@cyprus.local> (raw)

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

                 reply	other threads:[~2008-11-19 21:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.ukvy0c1eqigx4y@cyprus.local \
    --to=davidwu@arcturusnetworks.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox