From bf6d2816dbbf918ff6b46c70cbe08f2b1487a338 Mon Sep 17 00:00:00 2001 From: tongyebin <tongyebin@cmhi.chinamobile.com> Date: Tue, 17 Sep 2019 17:57:52 +0800 Subject: [PATCH] =?UTF-8?q?Mod=20aaa-12=20=E4=BF=AE=E6=94=B9=E9=9D=99?= =?UTF-8?q?=E6=80=81=E8=B7=AF=E7=94=B1IPV6=E8=8E=B7=E5=8F=96=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20SOL=20=E4=BF=AE=E6=94=B9=E4=BA=BA?= =?UTF-8?q?=EF=BC=9Atongyebin=20=E6=A3=80=E8=A7=86=E4=BA=BA=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static_routing_config.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Platform/user/configm/config-server/static_routing_config/static_routing_config.c b/Platform/user/configm/config-server/static_routing_config/static_routing_config.c index 425616fdc..bcb840d2d 100644 --- a/Platform/user/configm/config-server/static_routing_config/static_routing_config.c +++ b/Platform/user/configm/config-server/static_routing_config/static_routing_config.c @@ -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);