summaryrefslogtreecommitdiffstats
path: root/libiptc/libiptc.c
diff options
context:
space:
mode:
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 73cb217..3574ac8 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -1,4 +1,4 @@
-/* Library which manipulates firewall rules. Version $Revision: 1.31 $ */
+/* Library which manipulates firewall rules. Version $Revision: 1.32 $ */
/* Architecture of firewall rules is as follows:
*
@@ -234,6 +234,9 @@ TC_INIT(const char *tablename)
iptc_fn = TC_INIT;
+ if (sockfd != -1)
+ close(sockfd);
+
sockfd = socket(TC_AF, SOCK_RAW, IPPROTO_RAW);
if (sockfd < 0)
return NULL;