]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix probing for supported revisions (Jones Desougi <jones@ingate.com>)
authorJones Desougi <jones@ingate.com>
Thu, 22 Dec 2005 03:33:50 +0000 (03:33 +0000)
committerPatrick McHardy <kaber@trash.net>
Thu, 22 Dec 2005 03:33:50 +0000 (03:33 +0000)
Bugzilla #413

include/ip6tables.h
include/iptables.h
ip6tables.c
iptables.c

index 81d99d861fb785047640042f3476b0ea86025a0e..549e04157079ba5a1037ae013f58b89edbe4ee04 100644 (file)
@@ -130,6 +130,7 @@ extern struct ip6tables_target *ip6tables_targets;
 
 enum ip6t_tryload {
        DONT_LOAD,
+       DURING_LOAD,
        TRY_LOAD,
        LOAD_MUST_SUCCEED
 };
index fbcf2eb4b26701402afbe952e6248e554bbd503b..bf71e52672c6b766ad2c1c38a44c2b0c26a8a8c4 100644 (file)
@@ -162,6 +162,7 @@ extern struct iptables_target *iptables_targets;
 
 enum ipt_tryload {
        DONT_LOAD,
+       DURING_LOAD,
        TRY_LOAD,
        LOAD_MUST_SUCCEED
 };
index 3b32606cdd14294a905917a1b5cce8ec13f3feef..6afe68fd841c06b5a1bde7473ec359718154228e 100644 (file)
@@ -734,7 +734,7 @@ find_match(const char *name, enum ip6t_tryload tryload, struct ip6tables_rule_ma
        }
 
 #ifndef NO_SHARED_LIBS
-       if (!ptr && tryload != DONT_LOAD) {
+       if (!ptr && tryload != DONT_LOAD && tryload != DURING_LOAD) {
                char path[strlen(lib_dir) + sizeof("/libip6t_.so")
                         + strlen(name)];
                if (!icmphack)
@@ -986,7 +986,7 @@ find_target(const char *name, enum ip6t_tryload tryload)
        }
 
 #ifndef NO_SHARED_LIBS
-       if (!ptr && tryload != DONT_LOAD) {
+       if (!ptr && tryload != DONT_LOAD && tryload != DURING_LOAD) {
                char path[strlen(lib_dir) + sizeof("/libip6t_.so")
                         + strlen(name)];
                sprintf(path, "%s/libip6t_%s.so", lib_dir, name);
@@ -1058,7 +1058,7 @@ register_match6(struct ip6tables_match *me)
                exit(1);
        }
 
-       if (find_match(me->name, DONT_LOAD, NULL)) {
+       if (find_match(me->name, DURING_LOAD, NULL)) {
                fprintf(stderr, "%s: match `%s' already registered.\n",
                        program_name, me->name);
                exit(1);
@@ -1088,7 +1088,7 @@ register_target6(struct ip6tables_target *me)
                exit(1);
        }
 
-       if (find_target(me->name, DONT_LOAD)) {
+       if (find_target(me->name, DURING_LOAD)) {
                fprintf(stderr, "%s: target `%s' already registered.\n",
                        program_name, me->name);
                exit(1);
index 1ea80635fba429256042406148e66f7c5b20727e..e22b9ea1c38fa563722d139a60aec6afe7b9ad3c 100644 (file)
@@ -685,7 +685,7 @@ find_match(const char *name, enum ipt_tryload tryload, struct iptables_rule_matc
        }
 
 #ifndef NO_SHARED_LIBS
-       if (!ptr && tryload != DONT_LOAD) {
+       if (!ptr && tryload != DONT_LOAD && tryload != DURING_LOAD) {
                char path[strlen(lib_dir) + sizeof("/libipt_.so")
                         + strlen(name)];
                sprintf(path, "%s/libipt_%s.so", lib_dir, name);
@@ -994,7 +994,7 @@ find_target(const char *name, enum ipt_tryload tryload)
        }
 
 #ifndef NO_SHARED_LIBS
-       if (!ptr && tryload != DONT_LOAD) {
+       if (!ptr && tryload != DONT_LOAD && tryload != DURING_LOAD) {
                char path[strlen(lib_dir) + sizeof("/libipt_.so")
                         + strlen(name)];
                sprintf(path, "%s/libipt_%s.so", lib_dir, name);
@@ -1119,7 +1119,7 @@ register_match(struct iptables_match *me)
                exit(1);
        }
 
-       old = find_match(me->name, DONT_LOAD, NULL);
+       old = find_match(me->name, DURING_LOAD, NULL);
        if (old) {
                if (old->revision == me->revision) {
                        fprintf(stderr,
@@ -1175,7 +1175,7 @@ register_target(struct iptables_target *me)
                exit(1);
        }
 
-       old = find_target(me->name, DONT_LOAD);
+       old = find_target(me->name, DURING_LOAD);
        if (old) {
                struct iptables_target **i;