[Listener] read_packet(): blank the whole request

Blank the whole request with memset() instead of setting to zero each
field.
This commit is contained in:
Matteo Cypriani 2011-05-03 13:44:08 +02:00
parent be784c8ec0
commit cc66eb7c59
1 changed files with 2 additions and 9 deletions

View File

@ -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