From owner-svn-src-all@freebsd.org Thu Dec 22 05:28:31 2016 Return-Path: Delivered-To: svn-src-all@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 EE611C8C283; Thu, 22 Dec 2016 05:28:31 +0000 (UTC) (envelope-from hrs@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 BDCBAFD; Thu, 22 Dec 2016 05:28:31 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBM5SUOr059017; Thu, 22 Dec 2016 05:28:30 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBM5SUr1059016; Thu, 22 Dec 2016 05:28:30 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201612220528.uBM5SUr1059016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 22 Dec 2016 05:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310384 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2016 05:28:32 -0000 Author: hrs Date: Thu Dec 22 05:28:30 2016 New Revision: 310384 URL: https://svnweb.freebsd.org/changeset/base/310384 Log: Fix debug log in the case of AF_INET6. Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Thu Dec 22 05:23:38 2016 (r310383) +++ head/usr.sbin/syslogd/syslogd.c Thu Dec 22 05:28:30 2016 (r310384) @@ -1262,17 +1262,23 @@ fprintlog(struct filed *f, int flags, co f->f_time = now; switch (f->f_type) { - int port; case F_UNUSED: dprintf("\n"); break; case F_FORW: - port = ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port); - if (port != 514) { - dprintf(" %s:%d\n", f->fu_forw_hname, port); - } else { - dprintf(" %s\n", f->fu_forw_hname); + dprintf(" %s", f->fu_forw_hname); + switch (f->fu_forw_addr->ai_addr->sa_family) { + case AF_INET: + dprintf(":%d\n", + ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port)); + break; +#ifdef INET6 + case AF_INET6: + dprintf(":%d\n", + ntohs(satosin6(f->fu_forw_addr->ai_addr)->sin6_port)); + break; +#endif } /* check for local vs remote messages */ if (strcasecmp(f->f_prevhost, LocalHostName))