From 2f93205b375ee9f5a383f8041749a9b989012dd0 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Wed, 2 Apr 2008 14:01:53 +0200 Subject: Retry ruleset dump when kernel returns EAGAIN. Bugzilla #104 --- libiptc/libiptc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libiptc/libiptc.c') 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; } -- cgit v1.2.3