From 3413a7555ff8dcc0c07c2eded690b660f1e03345 Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org" Date: Mon, 7 Feb 2005 18:38:49 +0000 Subject: fix parameter handling in libipt_hashlimit with iptables-save (Nikolai Malykh) --- extensions/libipt_hashlimit.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/libipt_hashlimit.c b/extensions/libipt_hashlimit.c index f59b667..3ed8c58 100644 --- a/extensions/libipt_hashlimit.c +++ b/extensions/libipt_hashlimit.c @@ -7,6 +7,8 @@ * Based on ipt_limit.c by * Jérôme de Vivie * Hervé Eychenne + * + * Error corections by nmalykh@bilim.com (22.01.2005) */ #include @@ -294,7 +296,7 @@ static void print_mode(const struct ipt_hashlimit_info *r, char separator) fputs("dstip", stdout); prevmode = 1; } - if (r->cfg.mode & IPT_HASHLIMIT_HASH_SPT) { + if (r->cfg.mode & IPT_HASHLIMIT_HASH_DPT) { if (prevmode) putchar(separator); fputs("dstport", stdout); @@ -334,8 +336,10 @@ static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match) if (r->cfg.burst != IPT_HASHLIMIT_BURST) printf("--hashlimit-burst %u ", r->cfg.burst); - fputs("--mode ", stdout); + fputs("--hashlimit-mode ", stdout); print_mode(r, ','); + + printf("--hashlimit-name %s ", r->name); if (r->cfg.size) printf("--hashlimit-htable-size %u ", r->cfg.size); -- cgit v1.2.3