buglwIP - A Lightweight TCP/IP stack - Bugs: bug #26657, DNS, if host name is...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #26657: DNS, if host name is "localhost", result is error.

Submitted by:  hanhui <hanhui03>
Submitted on:  Sun 24 May 2009 12:14:38 PM UTC  
 
Category: sockets/netconnSeverity: 3 - Normal
Item Group: Change RequestStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.3.0

Sun 23 Aug 2009 01:55:49 PM UTC, comment #3:

Fixed lwip_getaddrinfo() and dns_gethostbyname().

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sun 23 Aug 2009 01:47:57 PM UTC, comment #2:

Seems like hanhui is correct:

Excerpt from gethostbyaddr description of opengroup:
"The addr argument of gethostbyaddr() shall be an in_addr structure when type is AF_INET. It contains a binary format (that is, not null-terminated) address in network byte order. The gethostbyaddr() function is not guaranteed to return addresses of address families other than AF_INET, even when such addresses exist in the database."

And after all, the addresses we return from real lookups are also in network byte order. This also has to be adjusted in dns_gethostbyname().

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 02 Jun 2009 11:04:44 AM UTC, comment #1:

Are you sure? I'd be surprised if we were supposed to return addresses in network byte order.

Kieran Mansley <kieranm>
Project Administrator
Sun 24 May 2009 12:14:38 PM UTC, original submission:

---------------CODE----------------------

#if LWIP_HAVE_LOOPIF
if (strcmp(hostname,"localhost")==0) {
addr->addr = INADDR_LOOPBACK;
return ERR_OK;
}
#endif /* LWIP_HAVE_LOOPIF */

if (nodename != NULL) {
/* service location specified, try to resolve */
err = netconn_gethostbyname(nodename, &addr);
if (err != ERR_OK) {
return EAI_FAIL;
}
} else {
/* service location specified, use loopback address */
addr.addr = INADDR_LOOPBACK;
}
-----------------------------------------

addr->addr = INADDR_LOOPBACK;

should be

addr->addr = htonl(INADDR_LOOPBACK);

hanhui <hanhui03>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by kieranm (Posted a comment)
  • -unavailable- added by hanhui03 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 23 Aug 2009 01:55:49 PM UTCgoldsimonStatusNeed Info=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Thu 25 Jun 2009 10:18:42 AM UTCkieranmStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1