diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2018-03-13 15:49:44 +1100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-05-31 21:19:24 +0200 |
commit | 8ee2022b44e5bbc5360513957790c656824eec55 (patch) | |
tree | 5c0e20787d103143edb4cbb1db2b12ab6d325591 /slirp/arp_table.c | |
parent | 05658ecb5582d7dab9e275a33db698e44413d4a7 (diff) |
slirp/debug: Print IP addresses in human readable form
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/arp_table.c')
-rw-r--r-- | slirp/arp_table.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/slirp/arp_table.c b/slirp/arp_table.c index bac608f97f..f81963bb88 100644 --- a/slirp/arp_table.c +++ b/slirp/arp_table.c @@ -33,7 +33,7 @@ void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN]) int i; DEBUG_CALL("arp_table_add"); - DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr)); + DEBUG_ARG("ip = %s", inet_ntoa((struct in_addr){.s_addr = ip_addr})); DEBUG_ARGS((dfd, " hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n", ethaddr[0], ethaddr[1], ethaddr[2], ethaddr[3], ethaddr[4], ethaddr[5])); @@ -67,7 +67,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, int i; DEBUG_CALL("arp_table_search"); - DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr)); + DEBUG_ARG("ip = %s", inet_ntoa((struct in_addr){.s_addr = ip_addr})); /* If broadcast address */ if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) { |