From 8a66bdb41446e5e007d486a6f8749f06ab30ee51 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Mon, 2 Jul 2018 10:57:22 +0000 Subject: [PATCH] Restore the order in which RFC 3164 messages with fac/pri are formatted. The refactoring of the syslogd code to format messages using iovecs slightly altered the output of syslogd by placing the facility/priority after the hostname, as opposed to printing it right before. This change reverts the behaviour to be consistent with how it was before. PR: 229457 Reported by: Andre Albsmeier MFC after: 1 week --- usr.sbin/syslogd/syslogd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index c61abde9dfb0..0bc25109db42 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1873,8 +1873,6 @@ fprintlog_rfc3164(struct filed *f, const char *hostname, const char *app_name, /* Message written to files. */ iovlist_append(&il, timebuf); iovlist_append(&il, " "); - iovlist_append(&il, hostname); - iovlist_append(&il, " "); if (LogFacPri) { iovlist_append(&il, "<"); @@ -1918,6 +1916,9 @@ fprintlog_rfc3164(struct filed *f, const char *hostname, const char *app_name, iovlist_append(&il, "> "); } + + iovlist_append(&il, hostname); + iovlist_append(&il, " "); break; }