summaryrefslogtreecommitdiffstats
path: root/libiptc
diff options
context:
space:
mode:
authorMiguel GAIO <miguel.gaio@efixo.com>2012-04-19 00:14:33 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2012-04-19 18:54:20 +0200
commit8db1044ba608a78035bbf89007aab6b6d8ff6f68 (patch)
tree79ba654091dc895e57baf018a21e83fcb8242604 /libiptc
parente8f32983048d6aa4a908b6a92da55fa71c859623 (diff)
libiptc: fix retry path in TC_INIT
There is an issue on TC_INIT retry path: In error case, TC_FREE is called and close sockfd. The retry does not reopen then always fail. The proposing patch reopens sockfd in retry patch. Signed-off-by: Miguel GAIO <miguel.gaio@efixo.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'libiptc')
-rw-r--r--libiptc/libiptc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index 63965e73..f0f78155 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -1307,6 +1307,7 @@ TC_INIT(const char *tablename)
socklen_t s;
int sockfd;
+retry:
iptc_fn = TC_INIT;
if (strlen(tablename) >= TABLE_MAXNAMELEN) {
@@ -1324,7 +1325,6 @@ TC_INIT(const char *tablename)
abort();
}
-retry:
s = sizeof(info);
strcpy(info.name, tablename);