Skip to content

Commit

Permalink
fix(mdns): mdns interface-state polling
Browse files Browse the repository at this point in the history
  • Loading branch information
stormshield-frb committed Nov 15, 2023
1 parent cddc306 commit 727964a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions protocols/mdns/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

- Ensure `Multiaddr` handled and returned by `Behaviour` are `/p2p` terminated.
See [PR 4596](https://github.com/libp2p/rust-libp2p/pull/4596).
- Fix a bug in the `Behaviour::poll` method causing missed mdns packets.
See [PR 4861](https://github.com/libp2p/rust-libp2p/pull/4861).

## 0.45.0

Expand Down
6 changes: 5 additions & 1 deletion protocols/mdns/src/behaviour/iface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,18 @@ where
}
Poll::Ready(Err(err)) if err.kind() == std::io::ErrorKind::WouldBlock => {
// No more bytes available on the socket to read
continue;
}
Poll::Ready(Err(err)) => {
tracing::error!("failed reading datagram: {}", err);
return Poll::Ready(());
}
Poll::Ready(Ok(Err(err))) => {
tracing::debug!("Parsing mdns packet failed: {:?}", err);
continue;
}
Poll::Ready(Ok(Ok(None))) | Poll::Pending => {}
Poll::Ready(Ok(Ok(None))) => continue,
Poll::Pending => {}
}

return Poll::Pending;
Expand Down

0 comments on commit 727964a

Please sign in to comment.