summaryrefslogtreecommitdiffstats
path: root/libiptc/libiptc.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-04-02 14:01:53 +0200
committerPatrick McHardy <kaber@trash.net>2008-04-02 14:01:53 +0200
commit2f93205b375ee9f5a383f8041749a9b989012dd0 (patch)
tree8e11798d6ce952eb81e3b7e58def210d6fffff48 /libiptc/libiptc.c
parentdbe6c3b74ee847707181f1fe28b2975b4a8ab425 (diff)
Retry ruleset dump when kernel returns EAGAIN.
Bugzilla #104
Diffstat (limited to 'libiptc/libiptc.c')
-rw-r--r--libiptc/libiptc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index b7bf785c..277ca0f2 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -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;
}