From: Harald Welte Date: Sat, 12 May 2001 05:22:18 +0000 (+0000) Subject: fixed bug in save() function causing it to print '--reject-with reject-with' in all... X-Git-Tag: v1.2.3~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97b3fdef41a009e54a0595b78c57f93b63f92469;p=thirdparty%2Fiptables.git fixed bug in save() function causing it to print '--reject-with reject-with' in all cases --- diff --git a/extensions/libipt_REJECT.c b/extensions/libipt_REJECT.c index 84b0b917..1afdfc52 100644 --- a/extensions/libipt_REJECT.c +++ b/extensions/libipt_REJECT.c @@ -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