Mod aaa-12 修改静态路由IPV6获取显示问题

SOL
修改人:tongyebin
检视人:
This commit is contained in:
tongyebin 2019-09-17 17:57:52 +08:00
parent e4ee5296a2
commit bf6d2816db
1 changed files with 12 additions and 4 deletions

View File

@ -1436,9 +1436,17 @@ ret_code all_routing_get_all(uint source,
rpc_log_info("check 5 after sscanf\n");
rpc_log_info("check 6: destip %s gateway %s netmask %d metric %d dev %s\n",destip,gateway,netmask_int,metric,dev);
if(metric > 0)
{
sscanf(gateway,"[%20[^]]",gateway_new);
if(metric > 0)
{
if(strstr(gateway,"[") == NULL)
{
strcpy(gateway_new,gateway);
}
else
{
sscanf(gateway,"[%20[^]]",gateway_new);
}
conf_buff[count].version = 6;
if (strcmp(destip,"[::]") == 0)
{
@ -1466,7 +1474,7 @@ ret_code all_routing_get_all(uint source,
memset(temp_buff,0,sizeof(temp_buff));
}
else
else
{
memset(destip,0,IP_MAX_LENGTH);
memset(netmask,0,IP_MAX_LENGTH);