]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Don't reverse matches on command line (matters for -m limit).
authorRusty Russell <rusty@linuxcare.com.au>
Fri, 7 Jul 2000 02:17:46 +0000 (02:17 +0000)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 7 Jul 2000 02:17:46 +0000 (02:17 +0000)
iptables.c

index 6d62cabc7c62ebdb942394fe42181475866a4728..d4deff8e2d6136fbe589f19324d1e71154dd8380 100644 (file)
@@ -916,6 +916,8 @@ merge_options(struct option *oldopts, struct option *newopts,
 void
 register_match(struct iptables_match *me)
 {
+       struct iptables_match **i;
+
        if (strcmp(me->version, program_version) != 0) {
                fprintf(stderr, "%s: match `%s' v%s (I'm v%s).\n",
                        program_name, me->name, me->version, program_version);
@@ -934,9 +936,11 @@ register_match(struct iptables_match *me)
                exit(1);
        }
 
-       /* Prepend to list. */
-       me->next = iptables_matches;
-       iptables_matches = me;
+       /* Append to list. */
+       for (i = &iptables_matches; *i; i = &(*i)->next);
+       me->next = NULL;
+       *i = me;
+
        me->m = NULL;
        me->mflags = 0;