]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
fixed bug in save() function causing it to print '--reject-with reject-with' in all...
authorHarald Welte <laforge@gnumonks.org>
Sat, 12 May 2001 05:22:18 +0000 (05:22 +0000)
committerHarald Welte <laforge@gnumonks.org>
Sat, 12 May 2001 05:22:18 +0000 (05:22 +0000)
extensions/libipt_REJECT.c

index 84b0b9172a619e4f6b1ad41f3cf388ac5a1ae241..1afdfc52fe677e86a022e32e2e9d549f38dc9221 100644 (file)
@@ -146,8 +146,13 @@ static void save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
 {
        const struct ipt_reject_info *reject
                = (const struct ipt_reject_info *)target->data;
+       unsigned int i;
+
+       for (i = 0; i < sizeof(reject_table)/sizeof(struct reject_names); i++)
+               if (reject_table[i].with == reject->with)
+                       break;
 
-       printf("--reject-with %s ", reject_table[reject->with].name);
+       printf("--reject-with %s ", reject_table[i].name);
 }
 
 struct iptables_target reject