Browse Source

Fixed bug #31701: Error return value from dns_gethostbyname() does not match documentation: return ERR_ARG instead of ERR_VAL if not initialized or wrong argument.

STABLE-2_1_x
goldsimon 16 years ago
parent
commit
fa092c47c8
  1. 5
      CHANGELOG
  2. 3
      src/core/dns.c

5
CHANGELOG

@ -229,6 +229,11 @@ HISTORY
++ Bugfixes:
2010-11-20: Simon Goldschmidt
* dns.c: Fixed bug #31701: Error return value from dns_gethostbyname() does
not match documentation: return ERR_ARG instead of ERR_VAL if not
initialized or wrong argument.
2010-10-20: Simon Goldschmidt
* sockets.h: Fixed bug #31385: sizeof(struct sockaddr) is 30 but should be 16

3
src/core/dns.c

@ -922,6 +922,7 @@ dns_enqueue(const char *name, dns_found_callback found, void *callback_arg)
* name is already in the local names table.
* - ERR_INPROGRESS enqueue a request to be sent to the DNS server
* for resolution if no errors are present.
* - ERR_ARG: dns client not initialized or invalid hostname
*
* @param hostname the hostname that is to be queried
* @param addr pointer to a ip_addr_t where to store the address if it is already
@ -941,7 +942,7 @@ dns_gethostbyname(const char *hostname, ip_addr_t *addr, dns_found_callback foun
if ((dns_pcb == NULL) || (addr == NULL) ||
(!hostname) || (!hostname[0]) ||
(strlen(hostname) >= DNS_MAX_NAME_LENGTH)) {
return ERR_VAL;
return ERR_ARG;
}
#if LWIP_HAVE_LOOPIF

Loading…
Cancel
Save