Browse Source

Merge pull request #15 from switch-iot/pr2ntop

Bug fixes for Android support code
pull/23/head
Luca Deri 6 years ago
committed by GitHub
parent
commit
1caa630568
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      android/edge_android.c
  2. 1
      edge_utils.c

3
android/edge_android.c

@ -354,12 +354,13 @@ int stop_edge(void)
peer_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); peer_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
peer_addr.sin_port = htons(N2N_EDGE_MGMT_PORT); peer_addr.sin_port = htons(N2N_EDGE_MGMT_PORT);
sendto(fd, "stop", 4, 0, (struct sockaddr *)&peer_addr, sizeof(struct sockaddr_in)); sendto(fd, "stop", 4, 0, (struct sockaddr *)&peer_addr, sizeof(struct sockaddr_in));
close(fd);
pthread_mutex_lock(&status.mutex); pthread_mutex_lock(&status.mutex);
status.is_running = 0; status.is_running = 0;
pthread_mutex_unlock(&status.mutex); pthread_mutex_unlock(&status.mutex);
report_edge_status(); report_edge_status();
return 0; return 0;
} }
#endif /* #ifdef __ANDROID_NDK__ */ #endif /* #ifdef __ANDROID_NDK__ */

1
edge_utils.c

@ -1521,6 +1521,7 @@ int run_edge_loop(n2n_edge_t * eee, int *keep_running) {
#ifdef __ANDROID_NDK__ #ifdef __ANDROID_NDK__
if ((nowTime - lastArpPeriod) > ARP_PERIOD_INTERVAL) { if ((nowTime - lastArpPeriod) > ARP_PERIOD_INTERVAL) {
uip_arp_timer(); uip_arp_timer();
lastArpPeriod = nowTime;
} }
#endif /* #ifdef __ANDROID_NDK__ */ #endif /* #ifdef __ANDROID_NDK__ */
} /* while */ } /* while */

Loading…
Cancel
Save