#include <arpa/inet.h>

Also, use real struct in_addr rather than u_long.
This commit is contained in:
Peter Wemm 1998-06-12 13:04:59 +00:00
parent a60c62a3c0
commit 28faa5304b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36914

View File

@ -29,12 +29,14 @@
#ifndef lint
static const char rcsid[] =
"$Id$";
"$Id: ypwhich.c,v 1.9 1997/08/29 11:56:51 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <err.h>
#include <netdb.h>
@ -93,7 +95,7 @@ struct sockaddr_in *sin;
struct timeval tv;
CLIENT *client;
int sock, r;
u_long ss_addr;
struct in_addr ss_addr;
sock = RPC_ANYSOCK;
tv.tv_sec = 15;
@ -122,7 +124,7 @@ struct sockaddr_in *sin;
}
clnt_destroy(client);
ss_addr = *(u_long *)ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr;
ss_addr = *(struct in_addr *)ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr;
/*printf("%08x\n", ss_addr);*/
hent = gethostbyaddr((char *)&ss_addr, sizeof(ss_addr), AF_INET);
if (hent)