]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Retry ruleset dump when kernel returns EAGAIN.
authorPatrick McHardy <kaber@trash.net>
Wed, 2 Apr 2008 12:01:53 +0000 (14:01 +0200)
committerPatrick McHardy <kaber@trash.net>
Wed, 2 Apr 2008 12:01:53 +0000 (14:01 +0200)
Bugzilla #104

libiptc/libiptc.c

index b7bf785c221f6b7f3f714db660c996f2683ba39a..277ca0f209abb9851406b73f56fb83c166e1e9c6 100644 (file)
@@ -1226,7 +1226,7 @@ TC_INIT(const char *tablename)
                        return NULL;
        }
        sockfd_use++;
-
+retry:
        s = sizeof(info);
 
        strcpy(info.name, tablename);
@@ -1279,6 +1279,9 @@ TC_INIT(const char *tablename)
        return h;
 error:
        TC_FREE(&h);
+       /* A different process changed the ruleset size, retry */
+       if (errno == EAGAIN)
+               goto retry;
        return NULL;
 }