]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
src: reuse the global modprobe_program variable
authorJan Engelhardt <jengelh@medozas.de>
Tue, 18 Nov 2008 11:26:26 +0000 (12:26 +0100)
committerPatrick McHardy <kaber@trash.net>
Tue, 18 Nov 2008 11:26:26 +0000 (12:26 +0100)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
ip6tables-restore.c
iptables-restore.c

index 0daae5f0855c30a59c4c8c916f1c9506e473dba5..01bccf7742922da4906940fae7bc3f9591c701bc 100644 (file)
@@ -56,8 +56,7 @@ static void print_usage(const char *name, const char *version)
        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 @@ static struct ip6tc_handle *create_handle(const char *tablename,
 
        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 main(int argc, char *argv[])
        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 @@ int main(int argc, char *argv[])
                                noflush = 1;
                                break;
                        case 'M':
-                               modprobe = optarg;
+                               modprobe_program = optarg;
                                break;
                }
        }
@@ -225,7 +223,7 @@ int main(int argc, char *argv[])
                        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);
index 12e558d767b99a43391094e4544ad6f1fd61790d..4ea9306b70830d3856eed0a323408c1ceae926aa 100644 (file)
@@ -55,7 +55,7 @@ static void print_usage(const char *name, const char *version)
        exit(1);
 }
 
-static struct iptc_handle *create_handle(const char *tablename, const char *modprobe)
+static struct iptc_handle *create_handle(const char *tablename)
 {
        struct iptc_handle *handle;
 
@@ -63,7 +63,7 @@ static struct iptc_handle *create_handle(const char *tablename, const char *modp
 
        if (!handle) {
                /* try to insmod the module if iptc_init failed */
-               load_xtables_ko(modprobe, 0);
+               load_xtables_ko(modprobe_program, 0);
                handle = iptc_init(tablename);
        }
 
@@ -124,7 +124,6 @@ main(int argc, char *argv[])
        int c;
        char curtable[IPT_TABLE_MAXNAMELEN + 1];
        FILE *in;
-       const char *modprobe = NULL;
        int in_table = 0, testing = 0;
        const char *tablename = NULL;
 
@@ -167,7 +166,7 @@ main(int argc, char *argv[])
                                noflush = 1;
                                break;
                        case 'M':
-                               modprobe = optarg;
+                               modprobe_program = optarg;
                                break;
                        case 'T':
                                tablename = optarg;
@@ -231,7 +230,7 @@ main(int argc, char *argv[])
                        if (handle)
                                iptc_free(handle);
 
-                       handle = create_handle(table, modprobe);
+                       handle = create_handle(table);
                        if (noflush == 0) {
                                DEBUGP("Cleaning all chains of table '%s'\n",
                                        table);