]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
extensions: libxt_rateest: fix bps options for iptables-save
authorLuciano Coelho <luciano.coelho@nokia.com>
Thu, 15 Jul 2010 16:09:54 +0000 (18:09 +0200)
committerPatrick McHardy <kaber@trash.net>
Thu, 15 Jul 2010 16:09:54 +0000 (18:09 +0200)
The output generated by the libxt_rateest extension for bps matches
was wrong and could not be restored properly.  This patch fixes this
problem by using the correct options in the right order when saving
the table.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
extensions/libxt_rateest.c

index 62100f4bf1d6669d5f7d2df026d17c1bcb9f389e..ad0884e788aee683cbb071f0879cf17e85ffe2e4 100644 (file)
@@ -419,9 +419,11 @@ rateest_save(const void *ip, const struct xt_entry_match *match)
        } else {
                printf("--rateest %s ", info->name1);
                if (info->flags & XT_RATEEST_MATCH_BPS) {
-                       printf("--rateest-bps ");
-                       rateest_print_mode(info, "--rateest-");
+                       printf("--rateest-bps1 ");
+                       rateest_print_rate(info->bps1, 0);
+                       printf("--rateest-bps2 ");
                        rateest_print_rate(info->bps2, 0);
+                       rateest_print_mode(info, "--rateest-");
                }
                if (info->flags & XT_RATEEST_MATCH_PPS) {
                        printf("--rateest-pps ");