Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS(LabelIsNotAscii) #13

Open
jedahan opened this issue Mar 13, 2019 · 6 comments
Open

DNS(LabelIsNotAscii) #13

jedahan opened this issue Mar 13, 2019 · 6 comments

Comments

@jedahan
Copy link

jedahan commented Mar 13, 2019

using the chromecast example but switching to compantion-link._tcp.local, some names panic. Not sure what the best course of action is, to support UTF-8 maybe?

@dylanmckay
Copy link
Owner

What error message/source location do you get from the panic?

I am surprised that UTF-8 has issues.

@LinusU
Copy link

LinusU commented Jun 19, 2019

I'm also running into this, but it's only panicing since I have an unwrap in my code though (as in the example)

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Dns(LabelIsNotAscii)

@dylanmckay
Copy link
Owner

dylanmckay commented Jul 4, 2019

I suspect this will have to be fixed in the upstream dns-parser repository here.

Either:

  • The mDNS servers you are connecting to are using non-ascii data for names
    • The DNS standard explicitly allows this
    • Although the Domain Name System supports non-ASCII characters, applications such as e-mail and web browsers restrict the characters which can be used as domain names for purposes such as a hostname

  • The dns-parser is incorrectly parsing the name, reading out of bounds where adjacent binary data is located

I suspect the first one is more likely.

As far as I can see in dns-parser/src/name.rs, it will always reject non-ASCII names, so perhaps the parser needs to be extended to support UTF-8 values.

@wez
Copy link

wez commented Jan 8, 2021

Sort of related to this, but on the other end of the spectrum; while probing for elgato lights (_elg._tcp.local), I get lots of this eprintln output happening, which is pretty undesirable:

https://github.com/dylanmckay/mdns/blob/master/src/mdns.rs#L101

LabelIsNotAscii, [<hundreds of bytes in decimal here>]

I appreciate that discovery doesn't completely give up for these because I do occasionally get proper responses from this, but I wonder if we can do something to control this unconditional output?

Two ideas come to mind:

  • Adopt the log crate and log::debug these messages
  • Make that stream return an enum with either a valid response or the dns_parser error

what do you think?

wez added a commit to wez/dns-parser that referenced this issue Jan 8, 2021
Make the data integrity check how the data is interpreted;
the check is for ascii only, but we can deal with UTF8,
so relax a little and allow that.

refs: dylanmckay/mdns#13
@wez
Copy link

wez commented Jan 8, 2021

I forked dns-parser to make it handle utf8 in labels and that cured my immediate problem; the commits are referenced above

@dylanmckay
Copy link
Owner

Adopt the log crate and log::debug these messages

Your wish is my command: 2.0.0...2.0.2

If you have any patches to send my way related to the other things, they are welcome :)

saidsay-so pushed a commit to saidsay-so/dns-parser that referenced this issue Oct 11, 2021
Make the data integrity check how the data is interpreted;
the check is for ascii only, but we can deal with UTF8,
so relax a little and allow that.

refs: dylanmckay/mdns#13
saidsay-so pushed a commit to saidsay-so/dns-parser that referenced this issue Oct 11, 2021
Make the data integrity check how the data is interpreted;
the check is for ascii only, but we can deal with UTF8,
so relax a little and allow that.

refs: dylanmckay/mdns#13
saidsay-so pushed a commit to saidsay-so/dns-parser that referenced this issue Oct 11, 2021
Make the data integrity check how the data is interpreted;
the check is for ascii only, but we can deal with UTF8,
so relax a little and allow that.

refs: dylanmckay/mdns#13
jxs pushed a commit to jxs/dns-parser that referenced this issue Nov 9, 2022
Make the data integrity check how the data is interpreted;
the check is for ascii only, but we can deal with UTF8,
so relax a little and allow that.

refs: dylanmckay/mdns#13
jxs pushed a commit to jxs/dns-parser that referenced this issue Nov 9, 2022
Make the data integrity check how the data is interpreted;
the check is for ascii only, but we can deal with UTF8,
so relax a little and allow that.

refs: dylanmckay/mdns#13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants