buglwIP - A Lightweight TCP/IP stack - Bugs: bug #22108, DNS problem

 
 

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

bug #22108: DNS problem

Submitter:  Cui hengbin <phant>
Submitted:  Fri 25 Jan 2008 03:26:28 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Change Request Status:  Fixed
Privacy:  Public Assigned to:  fbernon
Open/Closed:  Closed Planned Release:  None
lwIP version:  None

Jump to the original submission

Fri 25 Jan 2008 01:12:41 PM UTC, comment #9: 

Check in.

Frédéric Bernon <fbernon>
Group Member
Fri 25 Jan 2008 11:39:09 AM UTC, comment #8: 

This should go in 1.3.0 - it's a bug fix.  Thanks for sorting it out Frédéric and Cui

Kieran Mansley <kieranm>
Group Member
Fri 25 Jan 2008 11:10:26 AM UTC, comment #7: 

Any objections to integrate that in 1.3.0 ?

Frédéric Bernon <fbernon>
Group Member
Fri 25 Jan 2008 09:02:00 AM UTC, comment #6: 

OK.

Cui hengbin <phant>
Fri 25 Jan 2008 08:48:28 AM UTC, comment #5: 

Stupid remark I did (pHostName is after the hostname). But the last patch file is valid.

Frédéric Bernon <fbernon>
Group Member
Fri 25 Jan 2008 08:45:43 AM UTC, comment #4: 

Done (not exactly what you propose, I think it's better that pHostname continue to reference the hostname)

(file #14867)

Frédéric Bernon <fbernon>
Group Member
Fri 25 Jan 2008 08:35:20 AM UTC, comment #3: 

Sorry,I don't have tool to create patch;

-            pEntry->ipaddr =  (((struct ip_addr)(ans+1)));
+            pEntry->ipaddr =  (((struct ip_addr)((pHostname)+sizeof(struct dns_answer))));

should be as followed:

pHostname = pHostname + sizeof(struct dns_answer);
memcpy(&pEntry->ipaddr,pHostname,sizeof(struct ip_addr));

I forget it.

FYI.

Cui hengbin <phant>
Fri 25 Jan 2008 08:23:48 AM UTC, comment #2: 

Patch attached.


(file #14866)

Frédéric Bernon <fbernon>
Group Member
Fri 25 Jan 2008 07:48:29 AM UTC, comment #1: 

Seems a real problem. Do you have produce a clean patch ?

Frédéric Bernon <fbernon>
Group Member
Fri 25 Jan 2008 03:26:28 AM UTC, original submission:  

Hi All:
   When I used 1.30. find the DNS type and class are unkown when attched "www.baidu.com".
  these problem would be the dns_query's struct address alignment  in my target.I think these should produce when query last address isn't aligned with some host name.
  so I change the code as follow:
  In func dns_send:
  struct dns_query *qry; ====>struct dns_query;
  ...
  /* fill dns query */
    qry = (struct dns_query *)query;   ====>
    qry->type  = htons(DNS_RRTYPE_A);  ====>qry.type  = htons(DNS_RRTYPE_A);
    qry->class = htons(DNS_RRCLASS_IN); ====>qry.class = htons(DNS_RRCLASS_IN);
  ====> memcpy(query,&qry,sizeof(struct dns_query));
...

In func dns_recv:
...
struct dns_answer *ans; ====> struct dns_answer ans;
....
ans = (struct dns_answer *)pHostname; ===> memcpy(&sns,pHostname,sizeof(struct dns_answer));
...

and change all "ans->" to "ans." in dns_recv function;


FYI




Cui hengbin <phant>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #14867:  dns.patch added by fbernon (3KiB - text/x-patch)
file #14866:  dns.patch added by fbernon (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by fbernon (Posted a comment)
  • -email is unavailable- added by phant (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-01-25 fbernon StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2008-01-25 kieranm Planned Release 1.3.0
    2008-01-25 fbernon Attached File- Added dns.patch, #14867
    2008-01-25 fbernon Attached File- Added dns.patch, #14866
        StatusConfirmed In Progress
        Assigned toNone fbernon
    2008-01-25 fbernon StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code