[bug #56280] lwIP DNS need to support CNAME Resource Record

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #56280] lwIP DNS need to support CNAME Resource Record

Ashley Duncan
URL:
  <https://savannah.nongnu.org/bugs/?56280>

                 Summary: lwIP DNS need to support CNAME Resource Record
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: kevingao
            Submitted on: Tue 07 May 2019 07:32:55 AM UTC
                Category: DNS
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

As most of the DNS Standard query response contains CNAME resource record to
declare the alias name of the domain name which need to be resolved, so I
think lwIP need to support CNAME RR, else most of the DNS domain name
resolution would be failed to make the DNS APIs unusable, such as getaddrinfo.




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56280] lwIP DNS need to support CNAME Resource Record

Ashley Duncan
Follow-up Comment #1, bug #56280 (project lwip):

I don't see why. A recursive DNS server should do the recursion and answer all
records up to A/AAAA (or whatever asked) records.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56280] lwIP DNS need to support CNAME Resource Record

Ashley Duncan
Follow-up Comment #2, bug #56280 (project lwip):

Ping?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56280] lwIP DNS need to support CNAME Resource Record

Ashley Duncan
Update of bug #56280 (project lwip):

                  Status:                    None => Fixed                  
             Assigned to:                    None => goldsimon              
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #3:

> Ping?

No answer -> closing as invalid. Just continue to post here if you think
otherwise...

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56280] lwIP DNS need to support CNAME Resource Record

Ashley Duncan
Follow-up Comment #4, bug #56280 (project lwip):

There are situations in which the CNAME is required. I'm currently working on
one such project. Each unit of my product cooks up a hostname using a unique
secret number as part of the name. It then does a DNS lookup to get the CNAME,
which it then stores for future use. That CNAME is periodically refreshed by
another DNS lookup. The CNAME must also be added to our client's whitelist of
allowed external destinations. So the CNAME is certainly need for this case.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56280] lwIP DNS need to support CNAME Resource Record

Ashley Duncan
Additional Item Attachment, bug #56280 (project lwip):

File name: dns.c                          Size:54 KB
    <https://savannah.nongnu.org/file/dns.c?file_id=49374>



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56280] lwIP DNS need to support CNAME Resource Record

Ashley Duncan
Follow-up Comment #5, bug #56280 (project lwip):

Hi, I attached a file to address CNAME DNS resolution in DNS responses.  Is
this what I was meant to do?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: [bug #56280] lwIP DNS need to support CNAME Resource Record

Thompson, Jeff
Thanks, I'll take a look at it. I added this feature to my code several weeks ago, since no one had responded to my posting. It will be interesting to compare the two implementations. The comment at the top of the file says it was ported to lwIP 13 years ago; I'm curious as to why it isn't in the current distribution?

Jeff Thompson  |  Senior Electrical Engineer-Firmware
+1 704 752 6513 x1394
www.invue.com
-----Original Message-----
From: Chris Nocker <[hidden email]>
Sent: Friday, June 26, 2020 02:05
To: Simon Goldschmidt <[hidden email]>; Gao Qingshui <[hidden email]>; Thompson, Jeff <[hidden email]>; Chris Nocker <[hidden email]>; Sylvain Rochet <[hidden email]>; [hidden email]; [hidden email]
Subject: [bug #56280] lwIP DNS need to support CNAME Resource Record

Follow-up Comment #5, bug #56280 (project lwip):

Hi, I attached a file to address CNAME DNS resolution in DNS responses.  Is this what I was meant to do?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/

_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56280] lwIP DNS need to support CNAME Resource Record

Ashley Duncan
In reply to this post by Ashley Duncan
Additional Item Attachment, bug #56280 (project lwip):

File name: 0001-DNS-Allowed-processing-of-a-DNS-response-that-contai.patch
Size:1 KB
   
<https://savannah.nongnu.org/file/0001-DNS-Allowed-processing-of-a-DNS-response-that-contai.patch?file_id=49395>



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: [bug #56280] lwIP DNS need to support CNAME Resource Record

Thompson, Jeff
Attached is the solution I came up with. All my changes are conditionalized the macro CNAME_HACK. The entry point is the function netconn_gethostCname().

Jeff Thompson  |  Senior Electrical Engineer-Firmware
+1 704 752 6513 x1394
www.invue.com
-----Original Message-----
From: Chris Nocker <[hidden email]>
Sent: Monday, June 29, 2020 23:45
To: Simon Goldschmidt <[hidden email]>; Gao Qingshui <[hidden email]>; Thompson, Jeff <[hidden email]>; Chris Nocker <[hidden email]>; Sylvain Rochet <[hidden email]>; [hidden email]; [hidden email]
Subject: [bug #56280] lwIP DNS need to support CNAME Resource Record

Additional Item Attachment, bug #56280 (project lwip):

File name: 0001-DNS-Allowed-processing-of-a-DNS-response-that-contai.patch
Size:1 KB
   
<https://savannah.nongnu.org/file/0001-DNS-Allowed-processing-of-a-DNS-response-that-contai.patch?file_id=49395>



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel

api_lib.c (63K) Download Attachment
api_msg.c (97K) Download Attachment
dns.c (86K) Download Attachment
api_msg.h (12K) Download Attachment
api.h (24K) Download Attachment
dns.h (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [bug #56280] lwIP DNS need to support CNAME Resource Record

Christopher Nocker
Hi Jeff,
Our implementations are slightly different in what they are trying to achieve.  I was trying to iterate over the response from the DNS server to see if an A record was present (i.e. when the DNS server would have done the recursion and all of the CNAMEs for the query would be in the response).  Your implementation is explicitly looking for the CNAME response to a query.
I have tried your implementation and queried a name which I know has a couple of CNAMEs in the response but my application was never able to resolve it.  Maybe I'm using it wrong?  I'm guessing that it is working for you?
Did you try my implementation?  Does my implementation suit your needs?
Regards,
Chris


On Tue, Jun 30, 2020 at 8:21 PM Thompson, Jeff <[hidden email]> wrote:
Attached is the solution I came up with. All my changes are conditionalized the macro CNAME_HACK. The entry point is the function netconn_gethostCname().

Jeff Thompson  |  Senior Electrical Engineer-Firmware
+1 704 752 6513 x1394
www.invue.com
-----Original Message-----
From: Chris Nocker <[hidden email]>
Sent: Monday, June 29, 2020 23:45
To: Simon Goldschmidt <[hidden email]>; Gao Qingshui <[hidden email]>; Thompson, Jeff <[hidden email]>; Chris Nocker <[hidden email]>; Sylvain Rochet <[hidden email]>; [hidden email]; [hidden email]
Subject: [bug #56280] lwIP DNS need to support CNAME Resource Record

Additional Item Attachment, bug #56280 (project lwip):

File name: 0001-DNS-Allowed-processing-of-a-DNS-response-that-contai.patch
Size:1 KB

<https://savannah.nongnu.org/file/0001-DNS-Allowed-processing-of-a-DNS-response-that-contai.patch?file_id=49395>



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

Re: [bug #56280] lwIP DNS need to support CNAME Resource Record

Thompson, Jeff

Chris,

 

Sorry, but I haven’t tried your solution. I wanted something that would work from the highest level, so I created the function function netconn_gethostCname(). Whereas our solution only changed dns.c., my changes are spread across several files, and are conditionalized with CNAME_HACK. If you call netconn_gethostCname( myHostname, myHostCname), Where myHostName is the URL for which you want the CNAME, and myHostCanem is where you want the result stored, it should work. For example:

 

hostCNameTask Looking up CName for '16662.lb.invue-am.com'

hostCNameTask CName 'dev-ir4-sso.invue-am.com'

 

Jeff Thompson  |  Senior Electrical Engineer-Firmware
+1 704 752 6513 x1394
www.invue.com

 

From: Christopher Nocker <[hidden email]>
Sent: Wednesday, July 15, 2020 09:44
To: Thompson, Jeff <[hidden email]>
Cc: Simon Goldschmidt <[hidden email]>; Gao Qingshui <[hidden email]>; Sylvain Rochet <[hidden email]>; [hidden email]; [hidden email]
Subject: Re: [bug #56280] lwIP DNS need to support CNAME Resource Record

 

Hi Jeff,

Our implementations are slightly different in what they are trying to achieve.  I was trying to iterate over the response from the DNS server to see if an A record was present (i.e. when the DNS server would have done the recursion and all of the CNAMEs for the query would be in the response).  Your implementation is explicitly looking for the CNAME response to a query.

I have tried your implementation and queried a name which I know has a couple of CNAMEs in the response but my application was never able to resolve it.  Maybe I'm using it wrong?  I'm guessing that it is working for you?

Did you try my implementation?  Does my implementation suit your needs?

Regards,

Chris

 

 

On Tue, Jun 30, 2020 at 8:21 PM Thompson, Jeff <[hidden email]> wrote:

Attached is the solution I came up with. All my changes are conditionalized the macro CNAME_HACK. The entry point is the function netconn_gethostCname().

Jeff Thompson  |  Senior Electrical Engineer-Firmware
+1 704 752 6513 x1394
www.invue.com
-----Original Message-----
From: Chris Nocker <[hidden email]>
Sent: Monday, June 29, 2020 23:45
To: Simon Goldschmidt <[hidden email]>; Gao Qingshui <[hidden email]>; Thompson, Jeff <[hidden email]>; Chris Nocker <[hidden email]>; Sylvain Rochet <[hidden email]>; [hidden email]; [hidden email]
Subject: [bug #56280] lwIP DNS need to support CNAME Resource Record

Additional Item Attachment, bug #56280 (project lwip):

File name: 0001-DNS-Allowed-processing-of-a-DNS-response-that-contai.patch
Size:1 KB

<https://savannah.nongnu.org/file/0001-DNS-Allowed-processing-of-a-DNS-response-that-contai.patch?file_id=49395>



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56280>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel