src: reuse the global modprobe_program variable
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index 0daae5f..01bccf7 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -56,8 +56,7 @@
exit(1);
}
-static struct ip6tc_handle *create_handle(const char *tablename,
- const char *modprobe)
+static struct ip6tc_handle *create_handle(const char *tablename)
{
struct ip6tc_handle *handle;
@@ -65,7 +64,7 @@
if (!handle) {
/* try to insmod the module if iptc_init failed */
- load_xtables_ko(modprobe, 0);
+ load_xtables_ko(modprobe_program, 0);
handle = ip6tc_init(tablename);
}
@@ -124,7 +123,6 @@
int c;
char curtable[IP6T_TABLE_MAXNAMELEN + 1];
FILE *in;
- const char *modprobe = NULL;
int in_table = 0, testing = 0;
program_name = "ip6tables-restore";
@@ -166,7 +164,7 @@
noflush = 1;
break;
case 'M':
- modprobe = optarg;
+ modprobe_program = optarg;
break;
}
}
@@ -225,7 +223,7 @@
if (handle)
ip6tc_free(handle);
- handle = create_handle(table, modprobe);
+ handle = create_handle(table);
if (noflush == 0) {
DEBUGP("Cleaning all chains of table '%s'\n",
table);