Re: iptables -> can't initialize iptables table `filter': Bad file descriptor

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

 



Jan Engelhardt wrote:
On Dec 4 2007 09:18, Patrick McHardy wrote:
Salatiel Filho wrote:
On Dec 3, 2007 5:07 AM, Patrick McHardy <kaber@xxxxxxxxx> wrote:
Salatiel Filho wrote:
# iptables -L
iptables v1.3.6: can't initialize iptables table `filter': Bad file
descriptor
Perhaps iptables or your kernel needs to be upgraded.

My machine is a ARM machine with debian 4.0.
I also have already tried 1.3.8 and got the same error.
Which kernel version (please also send .config)? Did you compile
iptables yourself or used a version from Debian?


This looks more like an userspace issue. The strace log shows that the
netlink socket was obtained, but calls setsockopt with fd=-1.
Just a guess, though.


Right, I missed that, thanks. Jesper seems to be correct, if autoloading
fails we close the socket and decrement sockfd_use twice, which causes
iptables to not open it again for the second attempt.

Salatiel, does this patch fix the problem?
Index: libiptc/libiptc.c
===================================================================
--- libiptc/libiptc.c	(Revision 7130)
+++ libiptc/libiptc.c	(Arbeitskopie)
@@ -866,10 +866,6 @@
 	CHECK(h);
 	return h;
 error:
-	if (--sockfd_use == 0) {
-		close(sockfd);
-		sockfd = -1;
-	}
 	TC_FREE(&h);
 	return NULL;
 }

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

  Powered by Linux