[syslog-ng] incorrect port number in stats

Balazs Scheidler bazsi at balabit.hu
Thu Sep 4 09:12:32 CEST 2008


On Wed, 2008-09-03 at 15:41 -0400, Joe Shaw wrote:
> Hi,
> 
> Another minor thing I've noticed in 2.1.1... the port number in the
> log statistics for a remote destination is wrong:
> 
>     dropped='tcp(dest-host:514)=0 [...]
> 
> The syslog-ng daemon is running on port 2000, and the data is
> correctly being sent there.  In 2.0.9, it said instead:
> 
>     dropped='tcp(AF_INET(10.1.73.18:2000))=0'
> 

Wow, thanks for noticing this.

This patch fixes it:

diff --git a/src/afinet.c b/src/afinet.c
index 1f33dda..ec19892 100644
--- a/src/afinet.c
+++ b/src/afinet.c
@@ -292,6 +292,9 @@ afinet_dd_set_destport(LogDriver *s, gchar *service, gchar *proto)
   AFInetDestDriver *self = (AFInetDestDriver *) s;
   
   afinet_set_port(self->super.dest_addr, service, proto);
+  
+  g_free(self->super.dest_name);
+  self->super.dest_name = g_strdup_printf("%s:%d", self->host, g_sockaddr_inet_get_port(self->super.dest_addr));
 }
 
 void 

I'm committing this right now, so the next daily snapshot should have
this integrated.

-- 
Bazsi



More information about the syslog-ng mailing list