No more segfaults or compilewarnings.
/* Take a snapshot of the rules. Returns NULL on error. */
ip6tc_handle_t ip6tc_init(const char *tablename);
+/* Cleanup after ip6tc_init(). */
+void ip6tc_free(ip6tc_handle_t *h);
+
/* Iterator functions to run through the chains. Returns NULL at end. */
const char *ip6tc_first_chain(ip6tc_handle_t *handle);
const char *ip6tc_next_chain(ip6tc_handle_t *handle);
const char *modprobe = NULL;
int proto_used = 0;
char icmp6p[] = "icmpv6";
- int no_handle = 0;
memset(&fw, 0, sizeof(fw));
chain, IP6T_FUNCTION_MAXNAMELEN);
/* only allocate handle if we weren't called with a handle */
- if (!*handle) {
+ if (!*handle)
*handle = ip6tc_init(*table);
- no_handle = 1;
- }
if (!*handle) {
/* try to insmod the module if iptc_init failed */
if (verbose > 1)
dump_entries6(*handle);
- if (no_handle)
- ip6tc_free(handle);
-
return ret;
}
char *protocol = NULL;
const char *modprobe = NULL;
int proto_used = 0;
- int no_handle = 0;
memset(&fw, 0, sizeof(fw));
chain, IPT_FUNCTION_MAXNAMELEN);
/* only allocate handle if we weren't called with a handle */
- if (!*handle) {
+ if (!*handle)
*handle = iptc_init(*table);
- no_handle = 1;
- }
if (!*handle) {
/* try to insmod the module if iptc_init failed */
if (verbose > 1)
dump_entries(*handle);
- if (no_handle)
- iptc_free(handle);
-
return ret;
}