From 369083db0044821f37bce51e1a90e9f7d653a123 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 18 Jan 2000 05:37:19 +0000 Subject: [PATCH] Link get*.c into build INADDR_LOOPBACK is not defined for all OSs --- lib/lwres/Makefile.in | 10 ++++++---- lib/lwres/context.c | 4 ++++ lib/lwres/getaddrinfo.c | 8 +++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/lwres/Makefile.in b/lib/lwres/Makefile.in index 7a3ef9c870..cfb79859b7 100644 --- a/lib/lwres/Makefile.in +++ b/lib/lwres/Makefile.in @@ -26,12 +26,14 @@ CDEFINES = CWARNINGS = # Alphabetically -OBJS = context.@O@ lwbuffer.@O@ lwpacket.@O@ lwresutil.@O@ \ - lwres_gabn.@O@ lwres_gnba.@O@ lwres_noop.@O@ +OBJS = context.@O@ getaddrinfo.@O@ gethost.@O@ getipnode.@O@ \ + getnameinfo.@O@ getnet.@O@ lwbuffer.@O@ lwpacket.@O@ \ + lwresutil.@O@ lwres_gabn.@O@ lwres_gnba.@O@ lwres_noop.@O@ # Alphabetically -SRCS = context.c lwbuffer.c lwpacket.c lwres.c \ - lwres_gabn.c lwres_gnba.c lwres_noop.c +SRCS = context.c getaddrinfo.c gethost.c getipnode.c \ + getnameinfo.c getnet.c lwbuffer.c lwpacket.c \ + lwres.c lwres_gabn.c lwres_gnba.c lwres_noop.c LIBS = @LIBS@ diff --git a/lib/lwres/context.c b/lib/lwres/context.c index 65ecbaebf8..6550dba759 100644 --- a/lib/lwres/context.c +++ b/lib/lwres/context.c @@ -39,6 +39,10 @@ static void *lwres_malloc(void *, size_t); static void lwres_free(void *, void *, size_t); static int context_connect(lwres_context_t *); +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK 0x7f000001UL +#endif + int lwres_context_create(lwres_context_t **contextp, void *arg, lwres_malloc_t malloc_function, diff --git a/lib/lwres/getaddrinfo.c b/lib/lwres/getaddrinfo.c index daaf800d92..bfb24f184b 100644 --- a/lib/lwres/getaddrinfo.c +++ b/lib/lwres/getaddrinfo.c @@ -3,7 +3,7 @@ * The Berkeley Software Design Inc. software License Agreement specifies * the terms and conditions for redistribution. * - * BSDI $Id: getaddrinfo.c,v 1.3 2000/01/17 03:16:24 marka Exp $ + * BSDI $Id: getaddrinfo.c,v 1.4 2000/01/18 05:37:19 marka Exp $ */ @@ -346,7 +346,8 @@ add_ipv4(const char *hostname, int flags, struct addrinfo **aip, *aip = ai; ai->ai_socktype = socktype; SIN(ai->ai_addr)->sin_port = port; - memcpy(&SIN(ai->ai_addr)->sin_addr, by->addrs[i], 4); + memcpy(&SIN(ai->ai_addr)->sin_addr, + by->addrs[i].address, 4); if (flags & AI_CANONNAME) ai->ai_canonname = strdup(by->real_name); } @@ -394,7 +395,8 @@ add_ipv6(const char *hostname, int flags, struct addrinfo **aip, *aip = ai; ai->ai_socktype = socktype; SIN6(ai->ai_addr)->sin6_port = port; - memcpy(&SIN6(ai->ai_addr)->sin6_addr, by->addrs[i], 16); + memcpy(&SIN6(ai->ai_addr)->sin6_addr, + by->addrs[i].address, 16); if (flags & AI_CANONNAME) ai->ai_canonname = strdup(by->real_name); }