[syslog-ng] [patch] Fixes for 2.0.7 on not ipv6 aware systems

Corinna Vinschen vinschen at redhat.com
Tue Jan 8 17:17:02 CET 2008


On Jan  8 16:37, Balazs Scheidler wrote:
> On Tue, 2008-01-08 at 10:33 +0100, Corinna Vinschen wrote:
> > 	* tests/loggen/loggen.c (usage): Clarify -s usage.
> > [...]
> Thanks, I've fixed this together with the getaddrinfo() changes.

Cool, thank you.

> > Given the simplicity
> > of the code, it's probably faster if you just create your own version :)
> 
> I've just did. The results should be available in our git repository or
> in the nightly snapshot.
> 
> Can I ask you to retest whether it compiles fine on cygwin?

Builds and runs fine on Cygwin.  Would the below patch go through as
trivial?  It just adds the missing getservbyname functionality, which is
provided by the getaddrinfo implementation automagically.

	* tests/loggen/loggen.c (main): Allow symbolic service names for
	systems not providing getaddrinfo.

diff --git a/tests/loggen/loggen.c b/tests/loggen/loggen.c
index 608b0ed..f4c6fa4 100644
--- a/tests/loggen/loggen.c
+++ b/tests/loggen/loggen.c
@@ -250,6 +250,7 @@ main(int argc, char *argv[])
           freeaddrinfo(res);
 #else
           struct hostent *he;
+          struct servent *sv;
           struct sockaddr_in s_in;
           
           he = gethostbyname(argv[optind]);
@@ -259,7 +260,10 @@ main(int argc, char *argv[])
               return 2;
             }
           s_in.sin_family = AF_INET;
-          s_in.sin_port = htons(atoi(argv[optind + 1]));
+          if ((sv = getservbyname (argv[optind + 1], sock_type == SOCK_STREAM ? "tcp" : "udp")))
+            s_in.sin_port = sv->s_port;
+          else
+            s_in.sin_port = htons(atoi(argv[optind + 1]));
           s_in.sin_addr = *(struct in_addr *) he->h_addr;
           
           sock = socket(AF_INET, sock_type, 0);

> > However, "loggen" is easily confused with "logger".  Wouldn't something
> > along the lines of "syslog-perf" be a better name for the tool?
> 
> The similarity was intended, I thought it was funny. So if it is not a
> big problem I would leave it as it is.

Sure, no worries.


Thanks again,
Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


More information about the syslog-ng mailing list