From patchwork Thu Feb 1 09:35:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 10195183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 92A3F601A0 for ; Thu, 1 Feb 2018 09:37:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7607A28879 for ; Thu, 1 Feb 2018 09:37:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 678A7288CE; Thu, 1 Feb 2018 09:37:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BA4A028879 for ; Thu, 1 Feb 2018 09:37:18 +0000 (UTC) Received: from localhost ([::1]:45242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehBJ0-0001Lj-3Y for patchwork-qemu-devel@patchwork.kernel.org; Thu, 01 Feb 2018 04:37:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehBIE-0000rA-Hj for qemu-devel@nongnu.org; Thu, 01 Feb 2018 04:36:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehBI4-0002iC-Cu for qemu-devel@nongnu.org; Thu, 01 Feb 2018 04:36:30 -0500 Received: from ozlabs.ru ([107.173.13.209]:48820) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehBI4-0002hM-7a; Thu, 01 Feb 2018 04:36:20 -0500 Received: from vpl1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 6DA8A3A60012; Thu, 1 Feb 2018 04:35:44 -0500 (EST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Thu, 1 Feb 2018 20:35:45 +1100 Message-Id: <20180201093545.33741-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 107.173.13.209 Subject: [Qemu-devel] [PATCH qemu] slirp/debug: Print IP addresses in human readable form X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Alexey Kardashevskiy --- slirp/arp_table.c | 4 ++-- slirp/socket.c | 8 ++++---- slirp/udp.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) 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)); 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 = 0x%x", ip_addr); + DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr)); /* If broadcast address */ if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) { diff --git a/slirp/socket.c b/slirp/socket.c index cb7b5b6..61347d1 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -701,10 +701,10 @@ tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr, memset(&addr, 0, addrlen); DEBUG_CALL("tcp_listen"); - DEBUG_ARG("haddr = %x", haddr); - DEBUG_ARG("hport = %d", hport); - DEBUG_ARG("laddr = %x", laddr); - DEBUG_ARG("lport = %d", lport); + DEBUG_ARG("haddr = %s", inet_ntoa(*(struct in_addr *)&haddr)); + DEBUG_ARG("hport = %d", ntohs(hport)); + DEBUG_ARG("laddr = %s", inet_ntoa(*(struct in_addr *)&laddr)); + DEBUG_ARG("lport = %d", ntohs(lport)); DEBUG_ARG("flags = %x", flags); so = socreate(slirp); diff --git a/slirp/udp.c b/slirp/udp.c index 227d779..e5bf065 100644 --- a/slirp/udp.c +++ b/slirp/udp.c @@ -241,8 +241,8 @@ int udp_output(struct socket *so, struct mbuf *m, DEBUG_CALL("udp_output"); DEBUG_ARG("so = %p", so); DEBUG_ARG("m = %p", m); - DEBUG_ARG("saddr = %lx", (long)saddr->sin_addr.s_addr); - DEBUG_ARG("daddr = %lx", (long)daddr->sin_addr.s_addr); + DEBUG_ARG("saddr = %s", inet_ntoa(saddr->sin_addr)); + DEBUG_ARG("daddr = %s", inet_ntoa(daddr->sin_addr)); /* * Adjust for header