]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix "iptables getsockopt failed strangely" when querying revisions for non-existant...
authorPatrick McHardy <kaber@trash.net>
Tue, 26 Jun 2007 15:29:45 +0000 (15:29 +0000)
committerPatrick McHardy <kaber@trash.net>
Tue, 26 Jun 2007 15:29:45 +0000 (15:29 +0000)
Reported by Joseph Jezak <josejx@gentoo.org>.

ip6tables.c
iptables.c

index f316c7a99cfef6232e9009ccd4d26b67e9ebcdbe..6b2766b7de494e30d2a284920ee9bf3db341a9f2 100644 (file)
@@ -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) {
index 893b02db10f8dd9b3d8a24d75c4641c9c85b27a0..83b0c820a4868c67f9331e854900586c4dc49131 100644 (file)
@@ -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) {