diff --git a/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c b/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c index 899c572..2bd2633 100644 --- a/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c +++ b/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c @@ -693,6 +693,7 @@ void listen_for_aps(void) struct sockaddr_in client; // UDP client structure socklen_t client_len = sizeof(client) ; // Size of clients autocalibration_hello message ; + char ap_ip_addr[16] ; #ifdef DEBUG fprintf(stderr, "Autocalibration Hello thread launched.\n") ; @@ -720,11 +721,14 @@ void listen_for_aps(void) continue ; } + strncpy(ap_ip_addr, inet_ntoa(client.sin_addr), 16) ; + #ifdef DEBUG - fprintf(stderr, "Got a Hello message.\n") ; + fprintf(stderr, "Got a Hello message from « %s »\n", + ap_ip_addr) ; #endif // DEBUG - update_ap(message.ap_mac_addr_bytes, message.ap_ip_addr) ; + update_ap(message.ap_mac_addr_bytes, ap_ip_addr) ; } (void) close(listen_sockfd) ; diff --git a/infrastructure-centred/owlps-listener/owlps-listenerd.c b/infrastructure-centred/owlps-listener/owlps-listenerd.c index 1e9b432..f462da6 100644 --- a/infrastructure-centred/owlps-listener/owlps-listenerd.c +++ b/infrastructure-centred/owlps-listener/owlps-listenerd.c @@ -925,7 +925,6 @@ void autocalibrate_hello() &serv, NULL) ; memcpy(&message.ap_mac_addr_bytes, my_mac, 6) ; - strncpy(message.ap_ip_addr, my_ip, 16) ; while (run) { diff --git a/libowlps/owlps.h b/libowlps/owlps.h index 421e225..2ab5094 100644 --- a/libowlps/owlps.h +++ b/libowlps/owlps.h @@ -92,7 +92,6 @@ typedef struct _request typedef struct _autocalibration_hello { unsigned char ap_mac_addr_bytes[6]; - char ap_ip_addr[16] ; } autocalibration_hello ; typedef struct _autocalibration_order