From da81360731a0f1d96d945762d37fc81a8ed27d77 Mon Sep 17 00:00:00 2001 From: Robert Quattlebaum Date: Thu, 14 Mar 2013 19:14:32 -0700 Subject: [PATCH] core/net/resolv: Misc. updates and cleanups. --- core/net/resolv.c | 12 +++--------- examples/udp-ipv6/udp-client.c | 2 ++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/core/net/resolv.c b/core/net/resolv.c index 3308fdcb9..2ffbe54f2 100644 --- a/core/net/resolv.c +++ b/core/net/resolv.c @@ -331,11 +331,6 @@ static int mdns_needs_host_announce; PROCESS(mdns_probe_process, "mDNS probe"); #endif /* RESOLV_CONF_SUPPORTS_MDNS */ -#if RESOLV_AUTO_REMOVE_TRAILING_DOTS -/* For removing trailing dots in resolv_query() and resolve_lookup2(). */ -static char dns_name_without_dots[RESOLV_CONF_MAX_DOMAIN_NAME_SIZE + 1]; -#endif /* RESOLV_AUTO_REMOVE_TRAILING_DOTS */ - /*---------------------------------------------------------------------------*/ #if RESOLV_VERIFY_ANSWER_NAMES || VERBOSE_DEBUG /** \internal @@ -806,7 +801,7 @@ newdata(void) queryptr = skip_name(queryptr) + sizeof(struct dns_question), --nquestions ) { - +#if RESOLV_CONF_SUPPORTS_MDNS if(!is_request) { /* If this isn't a request, we don't need to bother * looking at the individual questions. For the most @@ -815,7 +810,6 @@ newdata(void) continue; } -#if RESOLV_CONF_SUPPORTS_MDNS { struct dns_question *question = (struct dns_question *)skip_name(queryptr); @@ -1022,8 +1016,7 @@ newdata(void) #endif */ - DEBUG_PRINTF("resolver: Answer for \"%s\" is usable.\n", - namemapptr->name); + DEBUG_PRINTF("resolver: Answer for \"%s\" is usable.\n", namemapptr->name); namemapptr->state = STATE_DONE; #if RESOLV_SUPPORTS_RECORD_EXPIRATION @@ -1196,6 +1189,7 @@ PROCESS_THREAD(resolv_process, ev, data) #if RESOLV_AUTO_REMOVE_TRAILING_DOTS static const char * remove_trailing_dots(const char *name) { + static char dns_name_without_dots[RESOLV_CONF_MAX_DOMAIN_NAME_SIZE + 1]; size_t len = strlen(name); if(name[len - 1] == '.') { diff --git a/examples/udp-ipv6/udp-client.c b/examples/udp-ipv6/udp-client.c index ce330970d..656929b46 100644 --- a/examples/udp-ipv6/udp-client.c +++ b/examples/udp-ipv6/udp-client.c @@ -131,6 +131,8 @@ set_connection_address(uip_ipaddr_t *ipaddr) status = RESOLV_STATUS_RESOLVING; } else if(status == RESOLV_STATUS_CACHED && resolved_addr != NULL) { PRINTF("Lookup of \"%s\" succeded!\n",QUOTEME(UDP_CONNECTION_ADDR)); + } else if(status == RESOLV_STATUS_RESOLVING) { + PRINTF("Still looking up \"%s\"...\n",QUOTEME(UDP_CONNECTION_ADDR)); } else { PRINTF("Lookup of \"%s\" failed. status = %d\n",QUOTEME(UDP_CONNECTION_ADDR),status); }