parent
8e6ce1e4d3
commit
0933c0a574
|
@ -202,10 +202,6 @@ ret_code routing_json_parse(pointer input, uint *conf_type, routing_t *conf_buff
|
||||||
if(!metric)
|
if(!metric)
|
||||||
{
|
{
|
||||||
return RET_INPUTERR;
|
return RET_INPUTERR;
|
||||||
}
|
|
||||||
if((metric->valueint) < 1)
|
|
||||||
{
|
|
||||||
return RET_INPUTERR;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -626,6 +622,10 @@ ret_code routing_add(routing_t *conf_buff)
|
||||||
|
|
||||||
if(version_t == IPV4_VERSION)
|
if(version_t == IPV4_VERSION)
|
||||||
{
|
{
|
||||||
|
if((metric_t < 0)
|
||||||
|
{
|
||||||
|
return RET_INPUTERR;
|
||||||
|
}
|
||||||
if (netmask_t > 0 && netmask_t < 32)
|
if (netmask_t > 0 && netmask_t < 32)
|
||||||
{
|
{
|
||||||
strcpy(route_type,"-net");
|
strcpy(route_type,"-net");
|
||||||
|
@ -659,6 +659,10 @@ ret_code routing_add(routing_t *conf_buff)
|
||||||
|
|
||||||
else if (version_t == IPV6_VERSION)
|
else if (version_t == IPV6_VERSION)
|
||||||
{
|
{
|
||||||
|
if (metric_t < 1)
|
||||||
|
{
|
||||||
|
return RET_INPUTERR;
|
||||||
|
}
|
||||||
if(netmask_t < 0 || netmask_t >128)
|
if(netmask_t < 0 || netmask_t >128)
|
||||||
{
|
{
|
||||||
return RET_INPUTERR;
|
return RET_INPUTERR;
|
||||||
|
|
Loading…
Reference in New Issue