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

Panic when solving URI with mDNS #941

Closed
ODCA117 opened this issue Jun 19, 2024 · 3 comments · Fixed by #987
Closed

Panic when solving URI with mDNS #941

ODCA117 opened this issue Jun 19, 2024 · 3 comments · Fixed by #987

Comments

@ODCA117
Copy link

ODCA117 commented Jun 19, 2024

I tried to enable the following feature in embassy-net #[cfg(feature = "socket-mdns")] to be able to resolve this URI homeassistant.local in rp pico. I was able to enable mdns feature but when trying to resolve the URI smoltcp panics with

smoltcp-0.11.0/src/iface/interface/mod.rs:882:14:
called `Option::unwrap()` on a `None` value
@Dirbaio
Copy link
Member

Dirbaio commented Jun 19, 2024

panic is here https://github.com/smoltcp-rs/smoltcp/blob/v0.11.0/src/iface/interface/mod.rs#L882

it happens because you haven't configured any ipv6 address in the interface. Are you actually intending to use IPv6? if no, disable it. if yes, configure an address.

(we should probably look into preventing mDNS from trying to use ipv6 if you have no ipv6 addr, or at least not panic...)

@aurelj
Copy link

aurelj commented Jun 28, 2024

Note that the panic seems to already be fixed in the current git tree.

You can try the git version adding this in your Cargo.toml:

[patch.crates-io]
smoltcp = { git = "https://github.com/smoltcp-rs/smoltcp.git" }

@thvdveld
Copy link
Contributor

The panic is still there, but in a different place:

let src_addr = cx.get_source_address(&dst_addr).unwrap(); // TODO remove unwrap

There is a panic when there is no IPv4 or IPv6 address configured when sending to an IPv4 or IPv6 address respectively. We should handle this case differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants