Bugs: Eggdrop 1.6.15 on SunOS 5.9 - net.c patch

Michel michel at endoria.net
Thu Oct 2 18:18:25 CST 2003


Dear Eggheads,


When compiling Eggdrop 1.6.15 with IPv6 enabled on SunOS 5.9 I
discovered a small error in the source code. While

#define HAVE_GETIPNODEBYNAME 1

and

/* #undef HAVE_GETHOSTBYNAME2 */

gethostbyname2() is still used in net.c resulting in a linking error.


I've managed to fix this by using the patch below. Don't know for sure
if this 'ok', but it shows the inconsistency of the gethostbyname2() vs.
getipnodebyname() check.



*** eggdrop1.6.15/src/net.c     Fri Oct  3 02:14:05 2003
--- eggdrop1.6.15.orig/src/net.c        Mon May  5 00:05:33 2003
***************
*** 159,177 ****
      if (myipv6he == NULL)
        fatal("Hostname IPV6 self-lookup failed.", 0);
    }
- 
    if (hostname6[0]) {
- #  ifdef HAVE_GETHOSTBYNAME2    
      myipv6he = gethostbyname2(hostname6, AF_INET6);
! #  else
!     myipv6he = getipnodebyname(hostname6, AF_INET6, AI_DEFAULT,&error_num);
! #  endif /* !HAVE_GETHOSTBYNAME2 */
!    if (myipv6he == NULL)
        fatal("Hostname IPV6 self-lookup failed.", 0);
    }
    if (myipv6he != NULL)
      egg_inet_ntop(AF_INET6, &myipv6he, myipv6host, 119);
- 
  #endif /* USE_IPV6 */
    if (myip[0]) {
      if ((myip[strlen(myip) - 1] >= '0') && (myip[strlen(myip) - 1] <= '9'))
--- 159,171 ----
      if (myipv6he == NULL)
        fatal("Hostname IPV6 self-lookup failed.", 0);
    }
    if (hostname6[0]) {
      myipv6he = gethostbyname2(hostname6, AF_INET6);
!     if (myipv6he == NULL)
        fatal("Hostname IPV6 self-lookup failed.", 0);
    }
    if (myipv6he != NULL)
      egg_inet_ntop(AF_INET6, &myipv6he, myipv6host, 119);
  #endif /* USE_IPV6 */
    if (myip[0]) {
      if ((myip[strlen(myip) - 1] >= '0') && (myip[strlen(myip) - 1] <= '9'))



-- 
Michel Honig
Endoria Networks



More information about the Bugs mailing list