All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Salatiel Filho <salatiel.filho@gmail.com>,
	netfilter-devel@vger.kernel.org,
	Jesper Dangaard Brouer <hawk@diku.dk>
Subject: Re: iptables -> can't initialize iptables table `filter': Bad file descriptor
Date: Tue, 04 Dec 2007 10:14:43 +0100	[thread overview]
Message-ID: <47551A83.80009@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0712040950390.11746@fbirervta.pbzchgretzou.qr>

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

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@trash.net> 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?

[-- Attachment #2: x --]
[-- Type: text/plain, Size: 319 bytes --]

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;
 }

  parent reply	other threads:[~2007-12-04  9:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-02 19:22 iptables -> can't initialize iptables table `filter': Bad file descriptor Salatiel Filho
2007-12-03  8:07 ` Patrick McHardy
2007-12-03 12:35   ` Salatiel Filho
2007-12-04  8:18     ` Patrick McHardy
2007-12-04  8:51       ` Jan Engelhardt
2007-12-04  8:58         ` Jesper Dangaard Brouer
2007-12-04  9:14         ` Patrick McHardy [this message]
2007-12-04 14:16           ` Salatiel Filho
2007-12-04 14:18             ` Patrick McHardy
     [not found]               ` <beb91d720712040645w76be238bmdd9dc362bf601755@mail.gmail.com>
2007-12-04 15:07                 ` Patrick McHardy
2007-12-04 15:40                   ` Salatiel Filho
2007-12-04 15:57                     ` Patrick McHardy
2007-12-04 16:05                       ` Salatiel Filho
2007-12-04 16:15                         ` Patrick McHardy
2007-12-04 16:32                           ` Salatiel Filho
2007-12-05  8:05                             ` Patrick McHardy
2007-12-05 11:39                               ` Salatiel Filho
2007-12-06  9:51                                 ` Patrick McHardy
2007-12-06 11:25                                   ` Salatiel Filho
2007-12-09 13:34                                     ` Salatiel Filho
2007-12-09 14:11                                       ` Salatiel Filho
2007-12-11 10:29                                         ` Patrick McHardy
2007-12-13 21:41                                           ` Laurence J. Lane
2007-12-13 22:14                                             ` Salatiel Filho
2007-12-14  9:22                                               ` Patrick McHardy
2007-12-14 12:39                                                 ` Salatiel Filho

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=47551A83.80009@trash.net \
    --to=kaber@trash.net \
    --cc=hawk@diku.dk \
    --cc=jengelh@computergmbh.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=salatiel.filho@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.