From owner-svn-src-head@freebsd.org Sun Apr 24 09:05:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D93BB12FAA; Sun, 24 Apr 2016 09:05:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50BB71499; Sun, 24 Apr 2016 09:05:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3O95T1Y038698; Sun, 24 Apr 2016 09:05:29 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3O95Txr038697; Sun, 24 Apr 2016 09:05:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201604240905.u3O95Txr038697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 24 Apr 2016 09:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298536 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 09:05:30 -0000 Author: ae Date: Sun Apr 24 09:05:29 2016 New Revision: 298536 URL: https://svnweb.freebsd.org/changeset/base/298536 Log: Use ipsec_address() function to print IP addresses. Modified: head/sys/netipsec/key_debug.c Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Sun Apr 24 09:02:17 2016 (r298535) +++ head/sys/netipsec/key_debug.c Sun Apr 24 09:05:29 2016 (r298536) @@ -506,6 +506,8 @@ kdebug_secpolicy(struct secpolicy *sp) void kdebug_secpolicyindex(struct secpolicyindex *spidx) { + char buf[INET6_ADDRSTRLEN]; + /* sanity check */ if (spidx == NULL) panic("%s: NULL pointer was passed.\n", __func__); @@ -513,19 +515,15 @@ kdebug_secpolicyindex(struct secpolicyin printf("secpolicyindex{ dir=%u prefs=%u prefd=%u ul_proto=%u\n", spidx->dir, spidx->prefs, spidx->prefd, spidx->ul_proto); - ipsec_hexdump((caddr_t)&spidx->src, - ((struct sockaddr *)&spidx->src)->sa_len); - printf("\n"); - ipsec_hexdump((caddr_t)&spidx->dst, - ((struct sockaddr *)&spidx->dst)->sa_len); - printf("}\n"); - - return; + printf("%s -> ", ipsec_address(&spidx->src, buf, sizeof(buf))); + printf("%s }\n", ipsec_address(&spidx->dst, buf, sizeof(buf))); } void kdebug_secasindex(struct secasindex *saidx) { + char buf[INET6_ADDRSTRLEN]; + /* sanity check */ if (saidx == NULL) panic("%s: NULL pointer was passed.\n", __func__); @@ -533,14 +531,8 @@ kdebug_secasindex(struct secasindex *sai printf("secasindex{ mode=%u proto=%u\n", saidx->mode, saidx->proto); - ipsec_hexdump((caddr_t)&saidx->src, - ((struct sockaddr *)&saidx->src)->sa_len); - printf("\n"); - ipsec_hexdump((caddr_t)&saidx->dst, - ((struct sockaddr *)&saidx->dst)->sa_len); - printf("\n"); - - return; + printf("%s -> ", ipsec_address(&saidx->src, buf, sizeof(buf))); + printf("%s }\n", ipsec_address(&saidx->dst, buf, sizeof(buf))); } static void