Commit a6d4588e authored by Wensong Zhang's avatar Wensong Zhang Committed by Stephen Hemminger

[IPV4] IPVS: sanity check of threshold setting and code tidy up

parent 97962c24
......@@ -11,7 +11,7 @@ config IP_VS
IP Virtual Server support will let you build a high-performance
virtual server based on cluster of two or more real servers. This
option must be enabled for at least one of the clustered computers
that will take care of intercepting incomming connections to a
that will take care of intercepting incoming connections to a
single IP address and scheduling them to real servers.
Three request dispatching techniques are implemented, they are
......
......@@ -790,6 +790,12 @@ ip_vs_add_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest)
return -ERANGE;
}
if (udest->l_threshold > udest->u_threshold) {
IP_VS_ERR("ip_vs_add_dest(): lower threshold is higher than "
"upper threshold\n");
return -ERANGE;
}
/*
* Check if the dest already exists in the list
*/
......@@ -885,7 +891,13 @@ ip_vs_edit_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest)
EnterFunction(2);
if (udest->weight < 0) {
IP_VS_ERR("ip_vs_add_dest(): server weight less than zero\n");
IP_VS_ERR("ip_vs_edit_dest(): server weight less than zero\n");
return -ERANGE;
}
if (udest->l_threshold > udest->u_threshold) {
IP_VS_ERR("ip_vs_edit_dest(): lower threshold is higher than "
"upper threshold\n");
return -ERANGE;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment