From: Patrick McHardy Date: Tue, 26 Jun 2007 15:29:45 +0000 (+0000) Subject: Fix "iptables getsockopt failed strangely" when querying revisions for non-existant... X-Git-Tag: v1.4.0-rc1~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76258727e101a0960cc8fcf84d9a451e4b5fd9b5;p=thirdparty%2Fiptables.git Fix "iptables getsockopt failed strangely" when querying revisions for non-existant matches and targets Reported by Joseph Jezak . --- diff --git a/ip6tables.c b/ip6tables.c index f316c7a9..6b2766b7 100644 --- a/ip6tables.c +++ b/ip6tables.c @@ -1130,7 +1130,7 @@ static int compatible_revision(const char *name, u_int8_t revision, int opt) max_rev = getsockopt(sockfd, IPPROTO_IPV6, opt, &rev, &s); if (max_rev < 0) { /* Definitely don't support this? */ - if (errno == EPROTONOSUPPORT) { + if (errno == ENOENT || errno == EPROTONOSUPPORT) { close(sockfd); return 0; } else if (errno == ENOPROTOOPT) { diff --git a/iptables.c b/iptables.c index 893b02db..83b0c820 100644 --- a/iptables.c +++ b/iptables.c @@ -1158,7 +1158,7 @@ static int compatible_revision(const char *name, u_int8_t revision, int opt) max_rev = getsockopt(sockfd, IPPROTO_IP, opt, &rev, &s); if (max_rev < 0) { /* Definitely don't support this? */ - if (errno == EPROTONOSUPPORT) { + if (errno == ENOENT || errno == EPROTONOSUPPORT) { close(sockfd); return 0; } else if (errno == ENOPROTOOPT) {