summaryrefslogtreecommitdiffstats
path: root/iptables.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@linuxcare.com.au>2000-07-07 02:17:46 +0000
committerRusty Russell <rusty@rustcorp.com.au>2000-07-07 02:17:46 +0000
commit9f60bbf47a254a6887982903c40205bc5da63e1e (patch)
tree5260d43bd7f75fb621c30023cdf684d8b0ca91da /iptables.c
parentb306e447105be1e75cd42bdfd51545e8e5000fe4 (diff)
Don't reverse matches on command line (matters for -m limit).
Diffstat (limited to 'iptables.c')
-rw-r--r--iptables.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/iptables.c b/iptables.c
index 6d62cabc..d4deff8e 100644
--- a/iptables.c
+++ b/iptables.c
@@ -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;