lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [task #7017] Implement DNS client


From: Frédéric Bernon
Subject: [lwip-devel] [task #7017] Implement DNS client
Date: Fri, 16 Nov 2007 08:27:59 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9

Follow-up Comment #36, task #7017 (project lwip):

>Isn't that MS only? 

No, you got the same in FreeBSD :

http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=gethostbyname

>I made it a define because it will be reused in other functions using hosten
(e.g. gethostbyname_r) 

In all cases, it's not something which have to be see by the users (not in
the task #7410 spirit ?). So, move it in sockets.c allows to reuse it. But I
think it should give the "static/per thread" option more complex.

>Hehe, I really didn't know how that thing is used and was too lazy to look
it up then. Obviously, it would have to be changed. Please change it if you
know how it should be. 

Ok, I will did once you will have check in your patch. hostent provide two
tables, terminated by a NULL pointer. To set it in a struct sockaddr_in, you
should write something like that :

sin.sin_addr.s_addr = (*((u32_t*)(phostent->h_addr_list[0])));

In fact, even if dns client doesn't support it now, you could got several ip
addresses in h_addr_list table. You could do something like :

u8_t idx=0;
while (phostent->h_addr_list[idx]) {
  /* or something else */
  sin.sin_addr.s_addr = (*((u32_t*)(phostent->h_addr_list[idx])));
  idx++;
}


>I don't know either, I only wanted to protect a hostent being mixed between
different calls (e.g. name1, addr2), but that's probably not worth it... 

Same, I think it's something to do in the same time that the "static/per
thread" option.




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?7017>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]