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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/extensions/libxt_length.c b/extensions/libxt_length.c
index 4f3a3318..6ea76465 100644
--- a/extensions/libxt_length.c
+++ b/extensions/libxt_length.c
@@ -26,7 +26,9 @@ static void length_parse(struct xt_option_call *cb)
xtables_option_parse(cb);
info->min = cb->val.u16_range[0];
- info->max = (cb->nvals == 2) ? cb->val.u16_range[1] : UINT16_MAX;
+ info->max = cb->val.u16_range[0];
+ if (cb->nvals >= 2)
+ info->max = cb->val.u16_range[1];
if (cb->invert)
info->invert = 1;
}