From 658415e6bb2194892ffb823c4356ce2a7a848b1d Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org" Date: Fri, 1 Apr 2005 06:58:38 +0000 Subject: re-sync ip6tables with iptables (check for init functions) (Jonas Berlin) --- ip6tables.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'ip6tables.c') diff --git a/ip6tables.c b/ip6tables.c index 3e66f4b..cea7229 100644 --- a/ip6tables.c +++ b/ip6tables.c @@ -1,4 +1,4 @@ -/* Code to take an iptables-style command line and do it. */ +/* Code to take an ip6tables-style command line and do it. */ /* * Author: Paul.Russell@rustcorp.com.au and mneuling@radlogic.com.au @@ -266,7 +266,7 @@ exit_error(enum exittype status, char *msg, ...) exit_tryhelp(status); if (status == VERSION_PROBLEM) fprintf(stderr, - "Perhaps iptables or your kernel needs to be upgraded.\n"); + "Perhaps ip6tables or your kernel needs to be upgraded.\n"); exit(status); } @@ -1859,7 +1859,7 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle) if (!optarg) optarg = argv[optind]; - /* iptables -p icmp -h */ + /* ip6tables -p icmp -h */ if (!matches && protocol) find_match(protocol, TRY_LOAD, &matches); @@ -1919,7 +1919,8 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle) target->t = fw_calloc(1, size); target->t->u.target_size = size; strcpy(target->t->u.user.name, jumpto); - target->init(target->t, &fw.nfcache); + if (target->init != NULL) + target->init(target->t, &fw.nfcache); opts = merge_options(opts, target->extra_opts, &target->option_offset); } break; @@ -1963,7 +1964,8 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle) m->m = fw_calloc(1, size); m->m->u.match_size = size; strcpy(m->m->u.user.name, m->name); - m->init(m->m, &fw.nfcache); + if (m->init != NULL) + m->init(m->m, &fw.nfcache); opts = merge_options(opts, m->extra_opts, &m->option_offset); } break; @@ -2079,7 +2081,7 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle) * - a protocol has been specified * - the protocol extension has not been * loaded yet, or is loaded and unused - * [think of iptables-restore!] + * [think of ip6tables-restore!] * - the protocol extension can be successively * loaded */ @@ -2104,7 +2106,8 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle) m->m = fw_calloc(1, size); m->m->u.match_size = size; strcpy(m->m->u.user.name, m->name); - m->init(m->m, &fw.nfcache); + if (m->init != NULL) + m->init(m->m, &fw.nfcache); opts = merge_options(opts, m->extra_opts, &m->option_offset); @@ -2232,7 +2235,8 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle) target->t = fw_calloc(1, size); target->t->u.target_size = size; strcpy(target->t->u.user.name, jumpto); - target->init(target->t, &fw.nfcache); + if (target->init != NULL) + target->init(target->t, &fw.nfcache); } if (!target) { -- cgit v1.2.3