getsockopt failed strangely: No such file or directory
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=yCONFIG_NETFILTER=yCONFIG_NETFILTER_NETLINK=yCONFIG_NETFILTER_XTABLES=yCONFIG_NETFILTER_XT_MATCH_PHYSDEV=yCONFIG_NETFILTER_XT_MATCH_PKTTYPE=yCONFIG_IP_NF_CONNTRACK=yCONFIG_IP_NF_CONNTRACK_NETLINK=yCONFIG_IP_NF_IPTABLES=yCONFIG_IP_NF_MATCH_IPRANGE=yCONFIG_IP_NF_MATCH_MULTIPORT=yCONFIG_IP_NF_MATCH_ADDRTYPE=yCONFIG_IP_NF_FILTER=yCONFIG_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 2006-05-13 19:42:16.000000000 +1000 renamed from iptables.c.orig 2006-05-13 19:41:49.000000000 +1000 +1 -1
@@ -1084,7 +1084,8 @@ } else { fprintf(stderr, "getsockopt failed strangely: %s\n", strerror(errno)); - exit(1); + return (0); } } close(sockfd);
regards,
Aras Vaichas