From: Patrick McHardy Date: Wed, 2 Apr 2008 12:01:53 +0000 (+0200) Subject: Retry ruleset dump when kernel returns EAGAIN. X-Git-Tag: v1.4.1-rc1~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f93205b375ee9f5a383f8041749a9b989012dd0;p=thirdparty%2Fiptables.git Retry ruleset dump when kernel returns EAGAIN. Bugzilla #104 --- 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; }