bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] small syslogd and IPv6 conf issue


From: Palmer, Thomas
Subject: [bug-inetutils] small syslogd and IPv6 conf issue
Date: Fri, 12 Oct 2012 20:22:09 +0000

Inetutils/Syslogd group ~


I’m using inetutils/syslogd 1.9.1 with eglibc 2.15.   It appears that getaddrinfo with IPv6 is sensitive to trailing spaces and comments, where-as IPv4 addresses are not.

 

For example, syslogd/getaddrinfo handles this fine:

local0.*  @1.2.3.4  #COMMENT

 

But it cannot parse this line successfully:

                Local0.* @FE80::215:5DFF:FE73:2F00 #COMMENT

 

The fact that IPv4 works above may be an unintended consequence of getaddrinfo behavior, but I have found that it has been beneficial in my application development.  The patch below will allow IPv6 to behave the same way and should allow any config line to include a comment at the end.

 

Index: inetutils/src/syslogd.c

===================================================================

--- inetutils/src/syslogd.c     (revision 191)

+++ inetutils/src/syslogd.c     (working copy)

@@ -1839,6 +1839,10 @@

 

       strcpy (cline, p);

 

+      /* Remove end of line comments */

+      p = strchr (cline, '#');

+      if (p) *p = 0;

+

       /* Cut the trailing spaces.  */

       for (p = strchr (cline, '\0'); isspace (*--p);)

        ;

 

Thomas


reply via email to

[Prev in Thread] Current Thread [Next in Thread]