Commit 11090635 authored by Haruki NAOI's avatar Haruki NAOI

Fix: Receive multiple sf_indication.

(cherry picked from commit edd9d0e8237dad97901bee1f6bfc6a40af2246d0)
parent 2a9f33e3
...@@ -393,6 +393,10 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){ ...@@ -393,6 +393,10 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
int ret; int ret;
static int sync = 0; static int sync = 0;
uint8_t timeout_flag = 0;
struct timespec time_out;
struct timespec time_now;
sock_1ms = socket(AF_INET,SOCK_DGRAM,0); sock_1ms = socket(AF_INET,SOCK_DGRAM,0);
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_port = htons(50040); addr.sin_port = htons(50040);
...@@ -478,9 +482,20 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){ ...@@ -478,9 +482,20 @@ int nfapi_vnf_p7_time(nfapi_vnf_p7_config_t* config){
break; break;
} }
} }
if(timeout_flag == 1){
clock_gettime( CLOCK_REALTIME, &time_now );
uint32_t time_diff = (time_now.tv_sec - time_out.tv_sec)*1000000 + (time_now.tv_nsec - time_out.tv_nsec)/1000;
if(time_diff < 500){
NFAPI_TRACE(NFAPI_TRACE_ERROR, "after timeout,recv signal : time interval = %d\n", time_diff);
continue;
}
timeout_flag = 0;
}
} }
else { else {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "recv timeout sfnsf = 0x%x\n", curr->sfn_sf); NFAPI_TRACE(NFAPI_TRACE_ERROR, "recv timeout sfnsf = 0x%x\n", curr->sfn_sf);
timeout_flag = 1;
clock_gettime( CLOCK_REALTIME, &time_out );
} }
sync = 1; sync = 1;
......
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