patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9654, getaddrinfo failed when addr has a...

 
 

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

patch #9654: getaddrinfo failed when addr has a upper character

Submitter:  armink.ztl <armink>
Submitted:  Sun 10 Jun 2018 06:16:23 AM UTC
   
 
Category:  DNS Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Wed 13 Jun 2018 01:12:21 PM UTC, comment #5: 

The paper introcuding "dns 0x20 bit encoding" says they saw ~0.3% of the tested servers not preserving case. Even if it is a few years old now, I have decided to take your patch for compatibility.

If we want to implement "dns 0x20 bit encoding", we'll have to compare casing externally, I guess.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 13 Jun 2018 10:24:07 AM UTC, comment #4: 


> Many developer not known "dns 0x20 bit encoding". So it will take many time on 202 error code.


No, developers don't need to know about "dns 0x20 bit encoding", this is a dns internal. It is meant to make dns a bit more secure to be able to reject spoofed response packets where the 0x20 bit does not match.

However, we do not use this encoding at all. We just map the first request through to the net. I'm not 100% sure though whether the standard requires preserving the case in a response, that's why I asked which resolver you are using.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 13 Jun 2018 07:52:00 AM UTC, comment #3: 

That works perfectly valid for me. Which DNS server are you using? Could you provide a pcap trace of the requests? It seems your DNS server answers in lower case although that is not allowed (up to my knowledge, casing should be unchanged in an answer).

Simon Goldschmidt <goldsimon>
Group administrator
Wed 13 Jun 2018 03:11:58 AM UTC, comment #2: 

look at this test code


    int result;
    struct addrinfo hint, *res = NULL;

    memset(&hint, 0, sizeof(hint));

    result = lwip_getaddrinfo("www.Google.com", NULL, &hint, &res);
    printf("getaddrinfo(www.Google.com) result is %d\n", result);

    result = lwip_getaddrinfo("www.google.com", NULL, &hint, &res);
    printf("getaddrinfo(www.google.com) result is %d\n", result);


when NOT using my patch, the log is


getaddrinfo(www.Google.com) result is 202
getaddrinfo(www.google.com) result is 0


Many developer not known "dns 0x20 bit encoding". So it will take many time on 202 error code.


armink.ztl <armink>
Tue 12 Jun 2018 07:41:18 AM UTC, comment #1: 

Can you tell us what failed? DNS should preserve case, so this should just work.

Try and google "dns 0x20 bit encoding" to understand why I don't want to change this.

Anyway, is this some sort of duplicate to bug #53940?

Simon Goldschmidt <goldsimon>
Group administrator
Sun 10 Jun 2018 06:16:23 AM UTC, original submission:  

The dns_compare_name function is case sensitivity now. So it will return error when use lwip_getaddrinfo to the upper characters address. Such as www.Google.com .


armink.ztl <armink>

 

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

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by armink (Submitted the item)
  • -email is unavailable- added by armink
  •  

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-06-13 goldsimon StatusWont Do Done
        Open/ClosedOpen Closed
    2018-06-12 goldsimon StatusNone Wont Do
        Assigned toNone goldsimon
    2018-06-10 armink Attached File- Added 0001-fix-DNS-resolution-to-not-case-insensitivity.patch, #44347
    2018-06-10 armink Attached File- Added 0002-fix-DNS-resolution-to-not-case-insensitivity.patch, #44346
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code