|
@@ -218,7 +218,7 @@ static struct sk_buff *cfg_set_max_publications(void)
|
|
|
return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
|
|
|
|
|
|
value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
|
|
|
- if (value != delimit(value, 1, 65535))
|
|
|
+ if (value < 1 || value > 65535)
|
|
|
return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
|
|
|
" (max publications must be 1-65535)");
|
|
|
tipc_max_publications = value;
|
|
@@ -233,7 +233,7 @@ static struct sk_buff *cfg_set_max_subscriptions(void)
|
|
|
return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
|
|
|
|
|
|
value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
|
|
|
- if (value != delimit(value, 1, 65535))
|
|
|
+ if (value < 1 || value > 65535)
|
|
|
return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
|
|
|
" (max subscriptions must be 1-65535");
|
|
|
tipc_max_subscriptions = value;
|
|
@@ -249,7 +249,7 @@ static struct sk_buff *cfg_set_max_ports(void)
|
|
|
value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
|
|
|
if (value == tipc_max_ports)
|
|
|
return tipc_cfg_reply_none();
|
|
|
- if (value != delimit(value, 127, 65535))
|
|
|
+ if (value < 127 || value > 65535)
|
|
|
return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
|
|
|
" (max ports must be 127-65535)");
|
|
|
if (tipc_mode != TIPC_NOT_RUNNING)
|
|
@@ -268,7 +268,7 @@ static struct sk_buff *cfg_set_netid(void)
|
|
|
value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
|
|
|
if (value == tipc_net_id)
|
|
|
return tipc_cfg_reply_none();
|
|
|
- if (value != delimit(value, 1, 9999))
|
|
|
+ if (value < 1 || value > 9999)
|
|
|
return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
|
|
|
" (network id must be 1-9999)");
|
|
|
if (tipc_mode == TIPC_NET_MODE)
|