summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2010-04-02 09:17:30 -0700
committerAustin Foxley <austinf@cetoncorp.com>2010-04-02 09:17:30 -0700
commitaae3eb9256affb18cff589b52ee26e0a4e557bbd (patch)
tree003711a54e7dfbde0b50979e2942fd3e0d3451c8 /libc/inet
parentef18cfe8ebab25f5ef92e81956f50e2dc57df602 (diff)
parent2864786ad884369ab5397be864e9f43d32bc2726 (diff)
Merge commit 'origin/master' into nptl
Conflicts: Makefile.in extra/Configs/Config.in libc/sysdeps/linux/common/bits/kernel-features.h libc/sysdeps/linux/common/poll.c libc/sysdeps/linux/common/sysdep.h libc/sysdeps/linux/sh/sysdep.h Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/inet')
-rw-r--r--libc/inet/Makefile.in4
-rw-r--r--libc/inet/resolv.c20
-rw-r--r--libc/inet/rpc/Makefile.in4
3 files changed, 22 insertions, 6 deletions
diff --git a/libc/inet/Makefile.in b/libc/inet/Makefile.in
index 702642f00..31b270f07 100644
--- a/libc/inet/Makefile.in
+++ b/libc/inet/Makefile.in
@@ -57,7 +57,7 @@ INET_OBJ := $(patsubst %.c,$(INET_OUT)/%.o,$(CSRC-y))
libc-y += $(INET_OBJ)
-objclean-y += inet_clean
+objclean-y += CLEAN_libc/inet
-inet_clean:
+CLEAN_libc/inet:
$(do_rm) $(addprefix $(INET_OUT)/*., o os)
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 0a6fd7aaf..056539f6e 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1348,8 +1348,24 @@ int attribute_hidden __dns_lookup(const char *name,
packet_len = i + j;
/* send packet */
- DPRINTF("On try %d, sending query to port %d\n",
- retries_left, NAMESERVER_PORT);
+#ifdef DEBUG
+ {
+ const socklen_t plen = sa.sa.sa_family == AF_INET ? INET_ADDRSTRLEN : INET6_ADDRSTRLEN;
+ char *pbuf = malloc(plen);
+ if (pbuf == NULL) ;/* nothing */
+#ifdef __UCLIBC_HAS_IPV6__
+ else if (sa.sa.sa_family == AF_INET6)
+ pbuf = (char*)inet_ntop(AF_INET6, &sa.sa6.sin6_addr, pbuf, plen);
+#endif
+#ifdef __UCLIBC_HAS_IPV4__
+ else if (sa.sa.sa_family == AF_INET)
+ pbuf = (char*)inet_ntop(AF_INET, &sa.sa4.sin_addr, pbuf, plen);
+#endif
+ DPRINTF("On try %d, sending query to %s, port %d\n",
+ retries_left, pbuf, NAMESERVER_PORT);
+ free(pbuf);
+ }
+#endif
fd = socket(sa.sa.sa_family, SOCK_DGRAM, IPPROTO_UDP);
if (fd < 0) /* paranoia */
goto try_next_server;
diff --git a/libc/inet/rpc/Makefile.in b/libc/inet/rpc/Makefile.in
index b498f92d7..6ec674d10 100644
--- a/libc/inet/rpc/Makefile.in
+++ b/libc/inet/rpc/Makefile.in
@@ -41,7 +41,7 @@ libc-nomulti-$(UCLIBC_HAS_RPC) += $(INET_RPC_OUT)/rpc_thread.o
libc-$(UCLIBC_HAS_RPC)+=$(INET_RPC_OBJ)
-objclean-y+=inet_rpc_clean
+objclean-y+=CLEAN_libc/inet/rpc
-inet_rpc_clean:
+CLEAN_libc/inet/rpc:
$(do_rm) $(addprefix $(INET_RPC_OUT)/*., o os oS)