diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index e2fa9afd0583..3ad0d9a23c03 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #endif static const char rcsid[] = - "$Id: syslogd.c,v 1.34 1998/06/24 23:50:20 julian Exp $"; + "$Id: syslogd.c,v 1.35 1998/06/25 19:39:19 guido Exp $"; #endif /* not lint */ /* @@ -796,7 +796,14 @@ fprintlog(f, flags, msg) case F_FORW: dprintf(" %s\n", f->f_un.f_forw.f_hname); - l = snprintf(line, sizeof line - 1, "<%d>%.15s %s", + /* check for local vs remote messages */ + if (strcmp(f->f_prevhost, LocalHostName)) + l = snprintf(line, sizeof line - 1, + "<%d>%.15s Forwarded from %s: %s", + f->f_prevpri, iov[0].iov_base, f->f_prevhost, + iov[4].iov_base); + else + l = snprintf(line, sizeof line - 1, "<%d>%.15s %s", f->f_prevpri, iov[0].iov_base, iov[4].iov_base); if (l > MAXLINE) l = MAXLINE;