Josue Abarca <jmasli...@debian.org.gt> writes:

>
> Hello Michael,
>
> thanks for reporting the problem, please, if possible, let me now if
> you get an answer from upstream (He is usually very responsive).

I got an answer indeed, and sent him the attached patch.  I can't find a
public bug tracker or version control so I'll let you know what he
thinks of it.

> I have tried to reproduce the bug, but it seems that in Debian Sid
> (using Amd64 architecture) cli.sin_addr is getting the right value.

Ah yes: for whatever reason I only see the bug when pointing siege at a
name from /etc/hosts or an IP address.  When the resolution happens via
actual DNS, it works fine.  Maybe that's what you're seeing, or maybe
the bug just doesn't happen on sid...

Cheers,
mwh

diff -ur siege-3.0.0-orig/src/sock.c siege-3.0.0/src/sock.c
--- siege-3.0.0-orig/src/sock.c	2013-03-26 03:12:18.000000000 +1300
+++ siege-3.0.0/src/sock.c	2013-05-06 09:01:08.656569799 +1200
@@ -82,10 +82,18 @@
   struct hostent     *hp;
   char   hn[512];
   int    port;
-#if defined(_AIX)
+#if defined(__GLIBC__)
+  struct hostent hent;
+  char hbf[8192];
+#elif defined(sun)
+# ifndef HAVE_GETIPNODEBYNAME
+  struct hostent hent;
+  char hbf[8192];
+# endif/*HAVE_GETIPNODEBYNAME*/
+#elif defined(_AIX)
   char *aixbuf;
   int  rc;
-#endif/*_AIX*/ 
+#endif/*_AIX*/
 
   C->encrypt  = (C->scheme == HTTPS) ? TRUE: FALSE;
   C->state    = UNDEF;
@@ -121,8 +129,6 @@
 
 #if defined(__GLIBC__)
   {
-    struct hostent hent;
-    char hbf[8192]; 
     memset(hbf, '\0', sizeof hbf);
     /* for systems using GNU libc */
     if((gethostbyname_r(hostparam, &hent, hbf, sizeof(hbf), &hp, &herrno) < 0)){
@@ -134,8 +140,6 @@
   hp = getipnodebyname(hn, AF_INET, 0, &herrno);
 # else /* default use gethostbyname_r*/
   {
-    struct hostent hent;
-    char hbf[8192]; 
     memset(hbf, '\0', sizeof hbf);
     hp = gethostbyname_r(hn, &hent, hbf, sizeof(hbf), &herrno); 
   }

Reply via email to