Linux Netfilter discussions
 help / color / mirror / Atom feed
* iptables - Couldn't load target error
@ 2007-12-19 11:21 Saravanan Chanemouganandam
  2007-12-19 11:56 ` Alexander Griesser
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Saravanan Chanemouganandam @ 2007-12-19 11:21 UTC (permalink / raw)
  To: netfilter; +Cc: busybox, linux-arm

Hi all,

I have some problem with iptables (v1.3.8) and extension supports libraries 
installed to the buildroot's root filesystem (/lib/iptables) running on 
Xscale pxa270. 

iptables with MASQUERADE support throws Couldn't load target error. The 
following strace shows that it tries to open libraries in the /lib and in 
the /usr/lib instead of /lib/iptables.

Can anybody precise me, why it is not looking into /lib/iptables for the 
dynamic libraries?

#strace iptables -t nat -A POSTROUTING -o br_wan -j MASQUERADE shows 
....

open("/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib/iptables/libipt_MASQUERADE.so",)
open("/lib/libipt_MASQUERADE.so", O_RDONLY) = -1 ENOENT (No such file or 
directory)
open("/lib/libipt_MASQUERADE.so", O_RDONLY) = -1 ENOENT (No such file or 
directory)
open("/usr/lib/libipt_MASQUERADE.so", O_RDONLY) = -1 ENOENT (No such file or 
directory)
munmap(0x40006000, 698)                 = 0
write(2, "iptables", 8iptables)                 = 8
write(2, " v", 2 v)                       = 2
write(2, "1.3.8", 51.3.8)                    = 5
write(2, ": ", 2: )                       = 2
write(2, "Couldn\'t load target `", 22Couldn't load target `) = 22
write(2, "MASQUERADE", 10MASQUERADE)              = 10
write(2, "\':", 2':)                      = 2
write(2, "File not found", 14File not found)          = 14

thanks
Sara

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

* Re: iptables - Couldn't load target error
  2007-12-19 11:21 iptables - Couldn't load target error Saravanan Chanemouganandam
@ 2007-12-19 11:56 ` Alexander Griesser
  2007-12-19 12:48 ` Mike Frysinger
  2007-12-20 10:03 ` Denys Vlasenko
  2 siblings, 0 replies; 6+ messages in thread
From: Alexander Griesser @ 2007-12-19 11:56 UTC (permalink / raw)
  To: Saravanan Chanemouganandam; +Cc: busybox, linux-arm, netfilter

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Saravanan Chanemouganandam wrote:
> iptables with MASQUERADE support throws Couldn't load target error. The 
> following strace shows that it tries to open libraries in the /lib and in 
> the /usr/lib instead of /lib/iptables.

Maybe because your LD_LIBRARY_PATH needs to be adapted accordingly?

man ldconfig

ciao,
- --
Alexander Griesser (Netzwerkadministration)
E-Mail: alexander.griesser@lkh-vil.or.at | Web: http://www.lkh-vil.or.at
KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach
Tel.:   +43 4242 208 3061 | Fax.:   +43 4242 971 3061
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHaQcJ66HVD6KUm1oRAvm8AJ44DrrsphkQ13OGAxB7xKK1Ma8GFQCfatGA
0jeJVKaO0JcQrW5CTlWReaU=
=PlTs
-----END PGP SIGNATURE-----

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

* Re: iptables - Couldn't load target error
  2007-12-19 11:21 iptables - Couldn't load target error Saravanan Chanemouganandam
  2007-12-19 11:56 ` Alexander Griesser
@ 2007-12-19 12:48 ` Mike Frysinger
  2007-12-20 10:03 ` Denys Vlasenko
  2 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2007-12-19 12:48 UTC (permalink / raw)
  To: busybox; +Cc: Saravanan Chanemouganandam, netfilter, linux-arm

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

On Wednesday 19 December 2007, Saravanan Chanemouganandam wrote:
> I have some problem with iptables (v1.3.8) and extension supports libraries
> installed to the buildroot's root filesystem (/lib/iptables) running on
> Xscale pxa270.

this isnt a busybox issue.  please dont mass cc us next time.

> iptables with MASQUERADE support throws Couldn't load target error. The
> following strace shows that it tries to open libraries in the /lib and in
> the /usr/lib instead of /lib/iptables.

your iptables was compiled incorrectly.  the library path is irrelevant as the 
iptables compile should select the runtime path correctly.  complain to 
whoever build your iptables.

you can clearly see it here:
> open("/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib/ipta
>bles/libipt_MASQUERADE.so",)

guess you should complain to the buildroot list
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

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

* Re: iptables - Couldn't load target error
  2007-12-19 11:21 iptables - Couldn't load target error Saravanan Chanemouganandam
  2007-12-19 11:56 ` Alexander Griesser
  2007-12-19 12:48 ` Mike Frysinger
@ 2007-12-20 10:03 ` Denys Vlasenko
  2007-12-20 13:49   ` Saravanan Chanemouganandam
  2 siblings, 1 reply; 6+ messages in thread
From: Denys Vlasenko @ 2007-12-20 10:03 UTC (permalink / raw)
  To: busybox; +Cc: Saravanan Chanemouganandam, netfilter, linux-arm

On Wednesday 19 December 2007 11:21, Saravanan Chanemouganandam wrote:
> Hi all,
>
> I have some problem with iptables (v1.3.8) and extension supports libraries
> installed to the buildroot's root filesystem (/lib/iptables) running on
> Xscale pxa270.
>
> iptables with MASQUERADE support throws Couldn't load target error. The
> following strace shows that it tries to open libraries in the /lib and in
> the /usr/lib instead of /lib/iptables.

Last time I built iptables from source it was iptables-1.3.5.
iptables are not using de-facto standard "configure+make"
install process, they take make variables instead.

Mine was built with:

# Do NOT point it to non-pristine kernel tree!
# (seen horrible miscompilation on 32:64 user:kernel x86_64)
KERNEL_DIR=/usr/src/kernel/delay/linux-2.6.17.11.src

make KERNEL_DIR="$KERNEL_DIR" BINDIR=... LIBDIR=... MANDIR=...

I guess you built your iptables with wrong/unset LIBDIR.

People were right pointing out that this is not busybox related question.
--
vda

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

* Re: iptables - Couldn't load target error
  2007-12-20 10:03 ` Denys Vlasenko
@ 2007-12-20 13:49   ` Saravanan Chanemouganandam
  2007-12-20 17:26     ` Denys Vlasenko
  0 siblings, 1 reply; 6+ messages in thread
From: Saravanan Chanemouganandam @ 2007-12-20 13:49 UTC (permalink / raw)
  To: Denys Vlasenko; +Cc: busybox, netfilter

Hi vda,

I accept your comment and others that it was not a busybox related issue. 

Well, here is my situation.I built a small rootfs for my arm pxa270 target 
board on the host x86 machine using the latest Buildroot. I then downloaded & 
installed iptables(v1.3.8)  using 

make KERNEL_DIR=/home/sara/cm-x270/linux-2.6.16 
CC=/home/sara/BuildRoot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-gcc 
LD=/home/sara/BuildRoot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-ld 
BINDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/sbin
LIBDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib

make BINDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/sbin
LIBDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib 
install

command install all iptables into the rootfs under 
"/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root" with all 
iptables and extension supports are built into linux kernel 
"/home/sara/cm-x270/linux-2.6.16" image. 

I then boot my cm-x270 target board using setboot os "console=ttySA0,38400 
root=/dev/nfs 
nfsroot=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root 
ip=::::cm-x270:eth0".

Now, when I perform MASQUERADE , it couldn't find libipt_MASQUERADE.so but it 
is installed in /lib/iptables.

sara:/$ ldconfig -v show /lib , /usr/lib. 
ldconfig: uClibc version
/lib:
        libc.so.0 => libuClibc-0.9.29.so
        libnsl.so.0 => libnsl-0.9.29.so
        libdl.so.0 => libdl-0.9.29.so
        librt.so.0 => librt-0.9.29.so
        libgcc_s.so.1 => libgcc_s.so.1
        libncurses.so.5 => libncurses.so.5.6
        libutil.so.0 => libutil-0.9.29.so
        libcrypt.so.0 => libcrypt-0.9.29.so
        ld-uClibc.so.0 => ld-uClibc-0.9.29.so
        libpthread.so.0 => libpthread-0.9.29.so
        libresolv.so.0 => libresolv-0.9.29.so
        libm.so.0 => libm-0.9.29.so
/usr/lib:
        libstdc++.so.6 => libstdc++.so.6.0.8
        libz.so.1 => libz.so.1.2.3

/lib/iptables is not visible in the system to load the library. 

thanks
Sara



Le Jeudi 20 Décembre 2007 11:03, Denys Vlasenko a écrit :
> On Wednesday 19 December 2007 11:21, Saravanan Chanemouganandam wrote:
> > Hi all,
> >
> > I have some problem with iptables (v1.3.8) and extension supports
> > libraries installed to the buildroot's root filesystem (/lib/iptables)
> > running on Xscale pxa270.
> >
> > iptables with MASQUERADE support throws Couldn't load target error. The
> > following strace shows that it tries to open libraries in the /lib and in
> > the /usr/lib instead of /lib/iptables.
>
> Last time I built iptables from source it was iptables-1.3.5.
> iptables are not using de-facto standard "configure+make"
> install process, they take make variables instead.
>
> Mine was built with:
>
> # Do NOT point it to non-pristine kernel tree!
> # (seen horrible miscompilation on 32:64 user:kernel x86_64)
> KERNEL_DIR=/usr/src/kernel/delay/linux-2.6.17.11.src
>
> make KERNEL_DIR="$KERNEL_DIR" BINDIR=... LIBDIR=... MANDIR=...
>
> I guess you built your iptables with wrong/unset LIBDIR.
>
> People were right pointing out that this is not busybox related question.
> --
> vda

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

* Re: iptables - Couldn't load target error
  2007-12-20 13:49   ` Saravanan Chanemouganandam
@ 2007-12-20 17:26     ` Denys Vlasenko
  0 siblings, 0 replies; 6+ messages in thread
From: Denys Vlasenko @ 2007-12-20 17:26 UTC (permalink / raw)
  To: Saravanan Chanemouganandam; +Cc: busybox, netfilter

On Thursday 20 December 2007 13:49, Saravanan Chanemouganandam wrote:
> Hi vda,
>
> I accept your comment and others that it was not a busybox related issue.
>
> Well, here is my situation.I built a small rootfs for my arm pxa270 target
> board on the host x86 machine using the latest Buildroot. I then downloaded
> & installed iptables(v1.3.8)  using
>
> make KERNEL_DIR=/home/sara/cm-x270/linux-2.6.16
> CC=/home/sara/BuildRoot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-g
>cc
> LD=/home/sara/BuildRoot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-l
>d BINDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/sbin
> LIBDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib
>
> make
> BINDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/sbin
> LIBDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib
> install
>
> command install all iptables into the rootfs under
> "/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root" with all
> iptables and extension supports are built into linux kernel
> "/home/sara/cm-x270/linux-2.6.16" image.

Yes, but iptable developers meant that option to indicate
_where to find_ modules at runtime!

You need to have different LIBDIR= settings for "make" and "make install".

make LIBDIR=/where/to/look/for/modules/at/runtime
make LIBDIR=/where/to/install/modules              install

If it will not work (say, make install will start rebuilding stuff
due to changed LIBDIR), you will need to do "make install" -
by hand copying stuff. Feel free to curse a lot in the process.

--
vda

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

end of thread, other threads:[~2007-12-20 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-19 11:21 iptables - Couldn't load target error Saravanan Chanemouganandam
2007-12-19 11:56 ` Alexander Griesser
2007-12-19 12:48 ` Mike Frysinger
2007-12-20 10:03 ` Denys Vlasenko
2007-12-20 13:49   ` Saravanan Chanemouganandam
2007-12-20 17:26     ` Denys Vlasenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox