summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorHans Schillstrom <hans@schillstrom.com>2012-07-16 13:53:42 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2012-07-16 13:57:05 +0200
commit3ee90dffea02c9be38dca6544ad5f22d4467e334 (patch)
tree42e7bcc9131dbb0a3df34db5cd9c40900a9bb356 /extensions
parentabdef13f36b63758f8775eb86febd96bf062df6f (diff)
libxt_HMARK: fix output of iptables -L
Fix accidental swap of [s|d]port-mask and [s|d]port-port. Use xtables_ipmask_to_cidr instead of xtables_ipmask_to_numeric. Signed-off-by: Hans Schillstrom <hans@schillstrom.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/libxt_HMARK.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/extensions/libxt_HMARK.c b/extensions/libxt_HMARK.c
index 719effe8..736a671a 100644
--- a/extensions/libxt_HMARK.c
+++ b/extensions/libxt_HMARK.c
@@ -282,15 +282,15 @@ static void HMARK_check(struct xt_fcheck_call *cb)
static void HMARK_print(const struct xt_hmark_info *info)
{
- if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPORT))
+ if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPORT_MASK))
printf("sport-mask 0x%x ", htons(info->port_mask.p16.src));
- if (info->flags & XT_HMARK_FLAG(XT_HMARK_DPORT))
+ if (info->flags & XT_HMARK_FLAG(XT_HMARK_DPORT_MASK))
printf("dport-mask 0x%x ", htons(info->port_mask.p16.dst));
if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI))
printf("spi-mask 0x%x ", htonl(info->port_mask.v32));
- if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPORT_MASK))
+ if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPORT))
printf("sport-set 0x%x ", htons(info->port_set.p16.src));
- if (info->flags & XT_HMARK_FLAG(XT_HMARK_DPORT_MASK))
+ if (info->flags & XT_HMARK_FLAG(XT_HMARK_DPORT))
printf("dport-set 0x%x ", htons(info->port_set.p16.dst));
if (info->flags & XT_HMARK_FLAG(XT_HMARK_SPI_MASK))
printf("spi-set 0x%x ", htonl(info->port_set.v32));
@@ -335,11 +335,11 @@ static void HMARK_ip4_print(const void *ip,
if (info->flags & XT_HMARK_FLAG(XT_HMARK_CT))
printf("ct, ");
if (info->flags & XT_HMARK_FLAG(XT_HMARK_SADDR_MASK))
- printf("src-prefix %s ",
- xtables_ipmask_to_numeric(&info->src_mask.in) + 1);
+ printf("src-prefix %u ",
+ xtables_ipmask_to_cidr(&info->src_mask.in));
if (info->flags & XT_HMARK_FLAG(XT_HMARK_DADDR_MASK))
- printf("dst-prefix %s ",
- xtables_ipmask_to_numeric(&info->dst_mask.in) + 1);
+ printf("dst-prefix %u ",
+ xtables_ipmask_to_cidr(&info->dst_mask.in));
HMARK_print(info);
}