Linux Netfilter discussions
 help / color / mirror / Atom feed
* getsockopt failed strangely: No such file or directory
@ 2006-05-13 10:09 Aras Vaichas
  0 siblings, 0 replies; only message in thread
From: Aras Vaichas @ 2006-05-13 10:09 UTC (permalink / raw)
  To: Netfilter Mailing List

Hi,

I'm cross-compiling a static version of iptables-1.3.5 for ARM, Linux 2.6.16.

The only change I made to the distribution was to uncomment the line in Makefile:
NO_SHARED_LIBS = 1

and I export my CC, LD and AR for cross-compiling before I call make.

When I run the binary on my target I get this strange error:

# iptables
getsockopt failed strangely: No such file or directory

I looked in the source code and I'm not sure why this is happening in this part.

I keep suspecting that maybe my kernel isn't configured correctly, but I've 
configured the basics:

CONFIG_PACKET=y
CONFIG_NETFILTER=y
CONFIG_NETFILTER_NETLINK=y
CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
CONFIG_IP_NF_CONNTRACK=y
CONFIG_IP_NF_CONNTRACK_NETLINK=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_IPRANGE=y
CONFIG_IP_NF_MATCH_MULTIPORT=y
CONFIG_IP_NF_MATCH_ADDRTYPE=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_RAW=y

Any ideas?

The funny thing is, initially I didn't set the NO_SHARED_LIBS flag and iptables 
  started up and gave me help, etc. But when I tried to set up a chain, it 
would complain about no static libraries (as I would expect). Strange why it 
doesn't work in NO_SHARED_LIBS mode.

I tried commenting out the exit() call from the offending line in iptables.c 
and iptables seems to work OK. e.g.

--- iptables.c.orig     2006-05-13 19:41:49.000000000 +1000
+++ iptables.c  2006-05-13 19:42:16.000000000 +1000
@@ -1084,7 +1084,8 @@
                 } else {
                         fprintf(stderr, "getsockopt failed strangely: %s\n",
                                 strerror(errno));
-                       exit(1);
+                               return (0);
                 }
         }
         close(sockfd);

regards,

Aras Vaichas


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-13 10:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-13 10:09 getsockopt failed strangely: No such file or directory Aras Vaichas

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