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: Sat, 14 Jul 2007 08:17:24 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

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

(Winformatik Info wrote)

Hi Jim,

I have tested the resolver code from you. It is working great... after a 
little debugging. I always had the problem if the domain name to resolve 
had an odd number of bytes. If this was the case, the resolver did not 
work (I use a 16-bit CPU with an alignment of 2).
To solve the problem I think we should surround the struct 
"s_dns_answer" by the two macros PACK_STRUCT_BEGIN and PACK_STRUCT_END 
(please see below). This handles a mapping of the struct "s_dns_answer" 
starting on an odd address the right way.

/* The DNS answer message structure */
PACK_STRUCT_BEGIN
typedef struct s_dns_answer {
  /* DNS answer record starts with either a domain name or a pointer
  to a name already present somewhere in the packet. */
  u16_t type;
  u16_t class;
  u16_t ttl[2];
  u16_t len;
  struct ip_addr ipaddr;
} DNS_ANSWER;
PACK_STRUCT_END

Hope this also helps others...

Roland

    _______________________________________________________

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]