fishfolk / bones

An easy-to-use game engine for making real games.
https://fishfolk.org/development/bones/introduction/
Other
236 stars 20 forks source link

Panic in mdns-sd daemon thread due to lengthy property #485

Closed nelson137 closed 3 weeks ago

nelson137 commented 3 weeks ago

See this jumpy#1030 comment for a more in-depth explanation of the problem.

Bones sends the iroh NodeAddr as a hex-encoded property on the mdns-sd service. The mdns-sd crate has a hard upper-limit of u8::MAX on keyLength + 1 + valueLength. On some machines there may be too many direct addresses of the iroh node causing the encoded value to be too long, resulting in a panic when attempting to start a LAN server.

Limit iroh node direct addresses to only IPv4 in attempt to keep the total property length under 256 bytes.