]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
IPMARK: print missing --shift parameter
authorMarek Michalkiewicz <marekm@amelek.gda.pl>
Wed, 10 Jun 2009 16:09:24 +0000 (18:09 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Fri, 12 Jun 2009 01:33:54 +0000 (03:33 +0200)
doc/changelog.txt
extensions/libxt_IPMARK.c

index c12857c509abcde5d52ce737be2cebf838a7ae5b..d87791e7aa841e956171713c2d43496301e1561d 100644 (file)
@@ -1,5 +1,8 @@
 
 
+- IPMARK: print missing --shift parameter
+
+
 Xtables-addons 1.16 (May 27 2009)
 =================================
 - RAWNAT: make iptable_rawpost compile with 2.6.30-rc5
index 6260f18685ac5f3fdc6f59c47cd513e1df0b7749..e3390e164cba99a18c2b6db2e2bc2efcdba49d68 100644 (file)
@@ -97,6 +97,7 @@ static int ipmark_tg_parse(int c, char **argv, int invert, unsigned int *flags,
                if (!xtables_strtoui(optarg, NULL, &n, 0, 128))
                        xtables_param_act(XTF_BAD_VALUE, "IPMARK", "--shift", optarg);
                info->shift = n;
+               *flags |= FL_SHIFT;
                return true;
        }
 
@@ -117,14 +118,16 @@ ipmark_tg_print(const void *entry, const struct xt_entry_target *target,
        const struct xt_ipmark_tginfo *info = (const void *)target->data;
 
        if (info->selector == XT_IPMARK_SRC)
-               printf("IPMARK src ip");
+               printf("IPMARK src ip ");
        else
-               printf("IPMARK dst ip");
+               printf("IPMARK dst ip ");
 
+       if (info->shift != 0)
+               printf("shift %u ", (unsigned int)info->shift);
        if (info->andmask != ~0U)
-               printf(" and 0x%x ", (unsigned int)info->andmask);
+               printf("and 0x%x ", (unsigned int)info->andmask);
        if (info->ormask != 0)
-               printf(" or 0x%x ", (unsigned int)info->ormask);
+               printf("or 0x%x ", (unsigned int)info->ormask);
 }
 
 static void
@@ -137,6 +140,8 @@ ipmark_tg_save(const void *entry, const struct xt_entry_target *target)
        else
                printf("--addr dst ");
 
+       if (info->shift != 0)
+               printf("--shift %u ", (unsigned int)info->shift);
        if (info->andmask != ~0U)
                printf("--and-mask 0x%x ", (unsigned int)info->andmask);
        if (info->ormask != 0)