From cc66eb7c5902f5ce4fb3ed1b3df51fb58e278aaf Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Tue, 3 May 2011 13:44:08 +0200 Subject: [PATCH] [Listener] read_packet(): blank the whole request Blank the whole request with memset() instead of setting to zero each field. --- owlps-listener/owlps-listenerd.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/owlps-listener/owlps-listenerd.c b/owlps-listener/owlps-listenerd.c index 63dc322..dd9f4e4 100644 --- a/owlps-listener/owlps-listenerd.c +++ b/owlps-listener/owlps-listenerd.c @@ -741,7 +741,8 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header, owl_bool uses_autocalibration_request_port = FALSE ; int i ; // Iterator - memset(request.mobile_ip_addr_bytes, 0, 4) ; // Blank the IP + // Blank the request: + memset(&request, 0, sizeof(request)) ; /* Common treatements */ @@ -837,14 +838,6 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header, memcpy(request.ap_mac_addr_bytes, my_mac_bytes, ETHER_ADDR_LEN) ; // Capture time is in the pcap header (net-endian): request.start_time = owl_timeval_to_timestamp(header->ts) ; - // Transmission time on the mobile is unknown (unless the packet is - // an explicit request): - memset(&request.request_time, 0, sizeof(owl_timestamp)) ; - // Blank position data: - request.direction = 0 ; - request.x_position = 0 ; - request.y_position = 0 ; - request.z_position = 0 ; /* Active mode */ if (is_explicit_packet