IPMARK: omit printing unset mask

This commit is contained in:
Jan Engelhardt
2008-04-09 14:44:24 +02:00
parent 59ef68fecc
commit 4b8ec990b8

View File

@@ -99,11 +99,14 @@ ipmark_tg_print(const void *entry, const struct xt_entry_target *target,
const struct xt_ipmark_tginfo *info = (const void *)target->data; const struct xt_ipmark_tginfo *info = (const void *)target->data;
if (info->selector == XT_IPMARK_SRC) if (info->selector == XT_IPMARK_SRC)
printf("IPMARK src"); printf("IPMARK src ip");
else else
printf("IPMARK dst"); printf("IPMARK dst ip");
printf(" ip and 0x%x or 0x%x",
(unsigned int)info->andmask, (unsigned int)info->ormask); if (info->andmask != ~0U)
printf(" and 0x%x ", (unsigned int)info->andmask);
if (info->ormask != 0)
printf(" or 0x%x ", (unsigned int)info->ormask);
} }
static void static void