summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-11-21 07:03:25 +0000
committerEric Andersen <andersen@codepoet.org>2002-11-21 07:03:25 +0000
commitac47326a5c217c337ad200c9af83578a02d8ad93 (patch)
treef9771f439eb1cfaa14bec95007eb2303a4c64fbc /libc
parentde2abcca5af59ebc11f66fb6fb491e16f50c8166 (diff)
Cleanup use of in6addr_loopback and in6addr_any
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/Makefile3
-rw-r--r--libc/inet/getaddrinfo.c2
-rw-r--r--libc/inet/in6_addr.c33
-rw-r--r--libc/inet/resolv.c18
4 files changed, 36 insertions, 20 deletions
diff --git a/libc/inet/Makefile b/libc/inet/Makefile
index efc8cb621..80848517d 100644
--- a/libc/inet/Makefile
+++ b/libc/inet/Makefile
@@ -50,7 +50,8 @@ MOBJ3= accept.o bind.o connect.o getpeername.o getsockname.o getsockopt.o \
setsockopt.o shutdown.o socket.o socketpair.o
CSRC =getservice.c getproto.c hostid.c getnetent.c getnetbynm.c getnetbyad.c \
- inet_net.c ntop.c herror.c if_nametoindex.c gai_strerror.c getaddrinfo.c
+ inet_net.c ntop.c herror.c if_nametoindex.c gai_strerror.c getaddrinfo.c \
+ in6_addr.c
COBJS=$(patsubst %.c,%.o, $(CSRC))
diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c
index 70bdfbbd1..a2f595a6e 100644
--- a/libc/inet/getaddrinfo.c
+++ b/libc/inet/getaddrinfo.c
@@ -585,7 +585,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
{
at->family = AF_INET6;
if ((req->ai_flags & AI_PASSIVE) == 0)
- memcpy (at->addr, &in6addr_loopback, sizeof (struct in6_addr));
+ memcpy (at->addr, &__in6addr_loopback, sizeof (struct in6_addr));
atr = at->next;
}
#endif
diff --git a/libc/inet/in6_addr.c b/libc/inet/in6_addr.c
new file mode 100644
index 000000000..de90555c9
--- /dev/null
+++ b/libc/inet/in6_addr.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define __FORCE_GLIBC
+#include <features.h>
+#include <netinet/in.h>
+
+#ifdef __UCLIBC_HAS_IPV6__
+const struct in6_addr __in6addr_any =
+{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
+weak_alias (__in6addr_any, in6addr_any)
+const struct in6_addr __in6addr_loopback =
+{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
+weak_alias(__in6addr_loopback, in6addr_loopback);
+#endif /* __UCLIBC_HAS_IPV6__ */
+
+
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index e6ac9d9ce..0cc344399 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -933,14 +933,6 @@ struct hostent *gethostbyname(const char *name)
#ifdef L_gethostbyname2
-#ifdef __UCLIBC_HAS_IPV6__
-/* TBD: Not the right place for defining these, I guess */
-const struct in6_addr in6addr_any =
- { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
-const struct in6_addr in6addr_loopback =
- { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
-#endif /* __UCLIBC_HAS_IPV6__ */
-
struct hostent *gethostbyname2(const char *name, int family)
{
#ifndef __UCLIBC_HAS_IPV6__
@@ -1686,16 +1678,6 @@ int gethostbyname_r(const char * name,
#ifdef L_gethostbyname2_r
-#ifdef __UCLIBC_HAS_IPV6__
-/* TBD: Not the right place for defining these, I guess */
-/*
-const struct in6_addr in6addr_any =
- { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
-const struct in6_addr in6addr_loopback =
- { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
-*/
-#endif /* __UCLIBC_HAS_IPV6__ */
-
int gethostbyname2_r(const char *name, int family,
struct hostent * result_buf,
char * buf, size_t buflen,