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

Submitted by:  Cui hengbin <phant>
Submitted on:  Fri 25 Jan 2008 03:26:28 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Change RequestStatus: Fixed
Privacy: PublicAssigned to: Frédéric Bernon <fbernon>
Open/Closed: ClosedPlanned Release: None
lwIP version: None

(Jump to the original submission Jump to the original submission)

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

Check in.

Frédéric Bernon <fbernon>
Project MemberIn charge of this item.
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>
Project Administrator
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>

 

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
  • -unavailable- added by kieranm (Posted a comment)
  • -unavailable- added by fbernon (Posted a comment)
  • -unavailable- added by phant (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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 25 Jan 2008 01:12:41 PM UTCfbernonStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Fri 25 Jan 2008 11:39:09 AM UTCkieranmPlanned Release=>1.3.0
    Fri 25 Jan 2008 08:45:43 AM UTCfbernonAttached File-=>Added dns.patch, #14867
    Fri 25 Jan 2008 08:23:48 AM UTCfbernonAttached File-=>Added dns.patch, #14866
      StatusConfirmed=>In Progress
      Assigned toNone=>fbernon
    Fri 25 Jan 2008 07:48:29 AM UTCfbernonStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1