Hey Gabriel,

We have seen the same behaviour and will hopefully be testing your patch this 
week. It would be great to have this capability in base as we don't want to 
install extra packages (i.e. rsyslog) and so far base does everything we need.

Regards,

Rob

----- Original Message -----
From: "Gabriel Linder" <lin...@jeuxvideo.com>
To: tech@openbsd.org
Sent: Wednesday, December 26, 2012 9:40:40 AM
Subject: Send hostname to remote host with syslogd

While playing with base syslogd and syslog-ng to have a unique loghost 
on my network, I noticed that OpenBSD syslogd does not send the hostname 
(while other daemons like rsyslog send it), so my loghost log the IP 
instead of the hostname. Is there a reason for this behaviour ?

The diff below fix this, works for me. Diff is also available at 
http://dargor.servebeer.com/~dargor/openbsd/syslogd.diff (thunderbird 
likes to mess with my tabs...)

Index: syslogd.c
===================================================================
RCS file: /cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.104
diff -u -r1.104 syslogd.c
--- syslogd.c    12 Jul 2011 11:28:31 -0000    1.104
+++ syslogd.c    26 Dec 2012 14:20:08 -0000
@@ -888,8 +888,8 @@

      case F_FORW:
          dprintf(" %s\n", f->f_un.f_forw.f_hname);
-        if ((l = snprintf(line, sizeof(line), "<%d>%.15s %s",
-            f->f_prevpri, (char *)iov[0].iov_base,
+        if ((l = snprintf(line, sizeof(line), "<%d>%.15s %s %s",
+            f->f_prevpri, (char *)iov[0].iov_base, LocalHostName,
              (char *)iov[4].iov_base)) >= sizeof(line) || l == -1)
              l = strlen(line);
          if (sendto(pfd[PFD_INET].fd, line, l, 0,

Reply via email to