On Thu, 30 May 2013 23:37:58 Денис Устименко wrote:
> No. This bug is in module libxt_quota2, that comes in package
> xtables-addons-common.
>
> I have attached a patch that solves the problem.
>
>
> In last version from http://xtables-addons.sourceforge.net/, this bug is NOT
> fixed.
>
> Bug in function quota_mt2_save
> ------------------
> static void
> quota_mt2_save(const void *ip, const struct xt_entry_match *match)
> {
> const struct xt_quota_mtinfo2 *q = (void *)match->data;
>
> if (q->flags & XT_QUOTA_INVERT)
> printf(" !");
> if (q->flags & XT_QUOTA_GROW)
> printf(" --grow ");
> if (q->flags & XT_QUOTA_NO_CHANGE)
> printf(" --no-change ");
> if (q->flags & XT_QUOTA_PACKET)
> printf(" --packets ");
> if (*q->name != '\0')
> printf(" --name %s ", q->name);
> printf(" --quota %llu ", (unsigned long long)q->quota);
> }
> -------------------
>
> If I use XT_QUOTA_INVERT, "!" printed on first place, but it should be only
> before "--quota".
>
> Regards,
> Denis Ustimenko
>
Thank you very much, Denis.
Regards,
Dmitry Smirnov
GPG key : 4096R/53968D1B
diff -crB xtables-addons-1.42/libxt_quota2.c xtables-addons-1.42.patched/libxt_quota2.c
*** xtables-addons-1.42/libxt_quota2.c 2012-05-08 15:59:34.000000000 +0500
--- xtables-addons-1.42.patched/libxt_quota2.c 2013-05-30 16:27:18.318483230 +0500
***************
*** 98,105 ****
{
const struct xt_quota_mtinfo2 *q = (void *)match->data;
- if (q->flags & XT_QUOTA_INVERT)
- printf(" !");
if (q->flags & XT_QUOTA_GROW)
printf(" --grow ");
if (q->flags & XT_QUOTA_NO_CHANGE)
--- 98,103 ----
***************
*** 108,113 ****
--- 106,113 ----
printf(" --packets ");
if (*q->name != '\0')
printf(" --name %s ", q->name);
+ if (q->flags & XT_QUOTA_INVERT)
+ printf(" !");
printf(" --quota %llu ", (unsigned long long)q->quota);
}