[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qemu] slirp/debug: Print IP addresses in human r
From: |
Samuel Thibault |
Subject: |
Re: [Qemu-devel] [PATCH qemu] slirp/debug: Print IP addresses in human readable form |
Date: |
Wed, 7 Mar 2018 23:39:49 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
Hello,
Remember to Cc the maintainer, I just can't read qemu-devel fully to
find slirp mails.
Thomas Huth, on mer. 07 mars 2018 07:24:16 +0100, wrote:
> >> diff --git a/slirp/arp_table.c b/slirp/arp_table.c
> >> index 3547043..bac608f 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 = 0x%x", ip_addr);
> >> + DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr));
I never like casts :)
And it happens that the standard doesn't say that s_addr is necessarily
the first field of struct in_addr, so better really initialize a struct
in_addr variable and use that (ditto for arp_table_search and
tcp_listen).
Samuel