[Listener] Fix request display

Use owl_mac_bytes_to_string_r() instead of owl_mac_bytes_to_string()
when there are more than one address to display in a single printf().
This commit is contained in:
Matteo Cypriani 2011-10-13 15:40:05 +02:00
parent 220289e83f
commit 603293c5f9
1 changed files with 13 additions and 8 deletions

View File

@ -137,11 +137,10 @@ int main(int argc, char *argv[])
get_mac_addr(GET_WIFI_IFACE(), my_mac_bytes) ;
get_ip_addr(GET_WIFI_IFACE(), my_ip) ;
if (VERBOSE_INFO)
{
printf("My MAC address is: %s\n",
owl_mac_bytes_to_string(my_mac_bytes)) ;
printf("My IP address is: %s\n", my_ip) ;
}
printf("My MAC address is: %s\n"
"My IP address is: %s\n",
owl_mac_bytes_to_string(my_mac_bytes),
my_ip) ;
#ifdef USE_PTHREAD
/* Set up threads */
@ -1021,11 +1020,17 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
{
char
request_time_str[OWL_TIMESTAMP_STRLEN],
start_time_str[OWL_TIMESTAMP_STRLEN] ;
start_time_str[OWL_TIMESTAMP_STRLEN],
ap_mac_addr_str[OWL_ETHER_ADDR_STRLEN],
mobile_mac_addr_str[OWL_ETHER_ADDR_STRLEN] ;
owl_timestamp_to_string(request_time_str,
owl_ntoh_timestamp(request.request_time)) ;
owl_timestamp_to_string(start_time_str,
owl_ntoh_timestamp(request.start_time)) ;
owl_mac_bytes_to_string_r(request.ap_mac_addr_bytes,
ap_mac_addr_str) ;
owl_mac_bytes_to_string_r(request.mobile_mac_addr_bytes,
mobile_mac_addr_str) ;
printf("*** Request to send ***\n"
"\tType: %"PRIu8"\n"
"\tMAC AP: %s\n"
@ -1039,8 +1044,8 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
"\tDirection: %hhd\n"
,
request.type,
owl_mac_bytes_to_string(request.ap_mac_addr_bytes),
owl_mac_bytes_to_string(request.mobile_mac_addr_bytes),
ap_mac_addr_str,
mobile_mac_addr_str,
request_time_str,
start_time_str,
rtap_fields[RTAP_ANTENNASIGNALDBM] ?