summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_length.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libxt_length.c')
-rw-r--r--extensions/libxt_length.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/extensions/libxt_length.c b/extensions/libxt_length.c
index c5c411e1..98e81673 100644
--- a/extensions/libxt_length.c
+++ b/extensions/libxt_length.c
@@ -91,28 +91,26 @@ static void length_check(unsigned int flags)
}
static void
-print_length(struct xt_length_info *info)
+length_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
- if (info->invert)
- printf("! ");
-
- if (info->max == info->min)
+ const struct xt_length_info *info = (void *)match->data;
+
+ printf("length %s", info->invert ? "!" : "");
+ if (info->min == info->max)
printf("%u ", info->min);
else
printf("%u:%u ", info->min, info->max);
}
-static void
-length_print(const void *ip, const struct xt_entry_match *match, int numeric)
-{
- printf("length ");
- print_length((struct xt_length_info *)match->data);
-}
-
static void length_save(const void *ip, const struct xt_entry_match *match)
{
- printf("--length ");
- print_length((struct xt_length_info *)match->data);
+ const struct xt_length_info *info = (void *)match->data;
+
+ printf("%s--length ", info->invert ? "! " : "");
+ if (info->min == info->max)
+ printf("%u ", info->min);
+ else
+ printf("%u:%u ", info->min, info->max);
}
static struct xtables_match length_match = {