From 9fb2ffe1d36b981c6fa867f37e3a8120eaead021 Mon Sep 17 00:00:00 2001 From: Marek Michalkiewicz Date: Wed, 10 Jun 2009 18:09:24 +0200 Subject: [PATCH] IPMARK: print missing --shift parameter --- doc/changelog.txt | 3 +++ extensions/libxt_IPMARK.c | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index c12857c..d87791e 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -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 diff --git a/extensions/libxt_IPMARK.c b/extensions/libxt_IPMARK.c index 6260f18..e3390e1 100644 --- a/extensions/libxt_IPMARK.c +++ b/extensions/libxt_IPMARK.c @@ -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)