Giter Club home page Giter Club logo

Comments (6)

dylanmckay avatar dylanmckay commented on September 25, 2024 2

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.

from mdns.

dylanmckay avatar dylanmckay commented on September 25, 2024

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

I am surprised that UTF-8 has issues.

from mdns.

LinusU avatar LinusU commented on September 25, 2024

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)

from mdns.

wez avatar wez commented on September 25, 2024

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?

from mdns.

wez avatar wez commented on September 25, 2024

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

from mdns.

dylanmckay avatar dylanmckay commented on September 25, 2024

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 :)

from mdns.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.