netmod-lan panics on incoming announcement/ data frame
Describe the bug
Sometimes (pretty consistently across my two computers, but not 100% deterministically) netmod-lan
will panic when restarting Ratman from a previous session. This seems to happen for an incoming discovery packet from another peer on the network running netmod-lan
.
(edit: actually it's not just after restarts but that's the most consistent way of triggering this behaviour)
Component
netmod-lan
To Reproduce
- Run
cargo run --bin ratmand -- --no-inet -v trace
on two computers on the same network - Run
cargo run --bin ratcat -- --register
on both computers (or any other client that will register an address) - Exit one of the
ratmand
instances - Restart that
ratmand
instance
The error I get is:
thread 'async-std/runtime' panicked at 'called `Option::unwrap()` on a `None` value', netmods/netmod-lan/src/socket.rs:153:70
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Additional context
Recently some refactoring was done on netmod-lan
and the endpoint and address handling code in ratmand
. Both changes are candidates for having broken something. The fact that it's not 100% reproducible (at least from what I can observe) makes this more confusing.