summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_TOS.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-01-27 18:14:21 +0100
committerJan Engelhardt <jengelh@medozas.de>2009-01-27 23:14:29 +0100
commite917bca09924435f3fca23c01042543b1826c81e (patch)
tree4af388f40ddf885f17fa3e8fe791b3f9affd2a14 /extensions/libxt_TOS.c
parenta80975497968e69b23f56bf15d346c65bec381f2 (diff)
extensions: use UINT_MAX constants over open-coded numbers (2/2)
Use the handy constants for ranges. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'extensions/libxt_TOS.c')
-rw-r--r--extensions/libxt_TOS.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/extensions/libxt_TOS.c b/extensions/libxt_TOS.c
index c1856817..a04f7414 100644
--- a/extensions/libxt_TOS.c
+++ b/extensions/libxt_TOS.c
@@ -118,7 +118,7 @@ static int tos_tg_parse(int c, char **argv, int invert, unsigned int *flags,
case '&': /* --and-tos */
param_act(P_ONLY_ONCE, "TOS", "--and-tos", *flags & FLAG_TOS);
param_act(P_NO_INVERT, "TOS", "--and-tos", invert);
- if (!strtonum(optarg, NULL, &bits, 0, 0xFF))
+ if (!strtonum(optarg, NULL, &bits, 0, UINT8_MAX))
param_act(P_BAD_VALUE, "TOS", "--and-tos", optarg);
info->tos_value = 0;
info->tos_mask = ~bits;
@@ -127,7 +127,7 @@ static int tos_tg_parse(int c, char **argv, int invert, unsigned int *flags,
case '|': /* --or-tos */
param_act(P_ONLY_ONCE, "TOS", "--or-tos", *flags & FLAG_TOS);
param_act(P_NO_INVERT, "TOS", "--or-tos", invert);
- if (!strtonum(optarg, NULL, &bits, 0, 0xFF))
+ if (!strtonum(optarg, NULL, &bits, 0, UINT8_MAX))
param_act(P_BAD_VALUE, "TOS", "--or-tos", optarg);
info->tos_value = bits;
info->tos_mask = bits;
@@ -136,7 +136,7 @@ static int tos_tg_parse(int c, char **argv, int invert, unsigned int *flags,
case '^': /* --xor-tos */
param_act(P_ONLY_ONCE, "TOS", "--xor-tos", *flags & FLAG_TOS);
param_act(P_NO_INVERT, "TOS", "--xor-tos", invert);
- if (!strtonum(optarg, NULL, &bits, 0, 0xFF))
+ if (!strtonum(optarg, NULL, &bits, 0, UINT8_MAX))
param_act(P_BAD_VALUE, "TOS", "--xor-tos", optarg);
info->tos_value = bits;
info->tos_mask = 0;