snmp_api.c - remove "BY" from HAVE_GETHOSTBYNAME (Solaris 2.5.1 wrong!)


git-svn-id: file:///home/hardaker/lib/sf-bkups/net-snmp-convert-svnrepo/trunk@2950 06827809-a52a-0410-b366-d66718629ded
diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c
index e6ca8bd..6e8e667 100644
--- a/snmplib/snmp_api.c
+++ b/snmplib/snmp_api.c
@@ -842,7 +842,7 @@
     int sd;
     in_addr_t addr;
     struct sockaddr_in *isp_addr, *meIp;
-#ifdef HAVE_GETHOSTBYNAME
+#ifdef HAVE_GETHOSTNAME
     struct hostent *hp;
 #endif
     struct snmp_pdu *pdu, *response;
@@ -881,7 +881,7 @@
                 if ((int)(addr = inet_addr(session->peername)) != -1){
                     memmove(&isp_addr->sin_addr, &addr, sizeof(isp_addr->sin_addr));
                 } else {
-#ifdef HAVE_GETHOSTBYNAME
+#ifdef HAVE_GETHOSTNAME
                     hp = gethostbyname(session->peername);
                     if (hp == NULL){
                         in_session->s_snmp_errno = SNMPERR_BAD_ADDRESS;
@@ -893,12 +893,12 @@
                         memmove(&isp_addr->sin_addr, hp->h_addr, hp->h_length);
                     }
 
-#else /* HAVE_GETHOSTBYNAME */
+#else /* HAVE_GETHOSTNAME */
                     fprintf(stderr,"%s:%d: _sess_open do not have get host by name - cannot resolve %s \n",
                             __FILE__,__LINE__,
                             session->peername);
                     return(0);
-#endif /* HAVE_GETHOSTBYNAME */
+#endif /* HAVE_GETHOSTNAME */
 
                 }
                 if (session->remote_port == SNMP_DEFAULT_REMPORT){