[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:
parent
220289e83f
commit
603293c5f9
|
@ -137,11 +137,10 @@ int main(int argc, char *argv[])
|
||||||
get_mac_addr(GET_WIFI_IFACE(), my_mac_bytes) ;
|
get_mac_addr(GET_WIFI_IFACE(), my_mac_bytes) ;
|
||||||
get_ip_addr(GET_WIFI_IFACE(), my_ip) ;
|
get_ip_addr(GET_WIFI_IFACE(), my_ip) ;
|
||||||
if (VERBOSE_INFO)
|
if (VERBOSE_INFO)
|
||||||
{
|
printf("My MAC address is: %s\n"
|
||||||
printf("My MAC address is: %s\n",
|
"My IP address is: %s\n",
|
||||||
owl_mac_bytes_to_string(my_mac_bytes)) ;
|
owl_mac_bytes_to_string(my_mac_bytes),
|
||||||
printf("My IP address is: %s\n", my_ip) ;
|
my_ip) ;
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef USE_PTHREAD
|
#ifdef USE_PTHREAD
|
||||||
/* Set up threads */
|
/* Set up threads */
|
||||||
|
@ -1021,11 +1020,17 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
||||||
{
|
{
|
||||||
char
|
char
|
||||||
request_time_str[OWL_TIMESTAMP_STRLEN],
|
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_timestamp_to_string(request_time_str,
|
||||||
owl_ntoh_timestamp(request.request_time)) ;
|
owl_ntoh_timestamp(request.request_time)) ;
|
||||||
owl_timestamp_to_string(start_time_str,
|
owl_timestamp_to_string(start_time_str,
|
||||||
owl_ntoh_timestamp(request.start_time)) ;
|
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"
|
printf("*** Request to send ***\n"
|
||||||
"\tType: %"PRIu8"\n"
|
"\tType: %"PRIu8"\n"
|
||||||
"\tMAC AP: %s\n"
|
"\tMAC AP: %s\n"
|
||||||
|
@ -1039,8 +1044,8 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
||||||
"\tDirection: %hhd\n"
|
"\tDirection: %hhd\n"
|
||||||
,
|
,
|
||||||
request.type,
|
request.type,
|
||||||
owl_mac_bytes_to_string(request.ap_mac_addr_bytes),
|
ap_mac_addr_str,
|
||||||
owl_mac_bytes_to_string(request.mobile_mac_addr_bytes),
|
mobile_mac_addr_str,
|
||||||
request_time_str,
|
request_time_str,
|
||||||
start_time_str,
|
start_time_str,
|
||||||
rtap_fields[RTAP_ANTENNASIGNALDBM] ?
|
rtap_fields[RTAP_ANTENNASIGNALDBM] ?
|
||||||
|
|
Loading…
Reference in New Issue