Skip to content

Commit

Permalink
-Fixed broadcast storm when entire packet is sent and poll_send_to re…
Browse files Browse the repository at this point in the history
…turns Ready
  • Loading branch information
AndrewFrailing committed Sep 1, 2020
1 parent e54cb43 commit e47ab41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libmdns"
version = "0.4.0"
version = "0.4.1"
authors = ["Will Stott <[email protected]>"]

description = "mDNS Responder library for building discoverable LAN services in Rust"
Expand Down
3 changes: 2 additions & 1 deletion src/fsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ impl<AF: Unpin + AddressFamily> Future for FSM<AF> {
trace!("sending packet to {:?}", addr);

match pinned.socket.poll_send_to(cx, response, addr) {
Poll::Ready(Ok(_)) => (),
Poll::Ready(Ok(bytes_sent)) if bytes_sent == response.len() => break,
Poll::Ready(Ok(_)) => warn!("failed to send entire packet"),
Poll::Ready(Err(ref ioerr)) if ioerr.kind() == WouldBlock => break,
Poll::Ready(Err(err)) => warn!("error sending packet {:?}", err),
Poll::Pending => (break),
Expand Down

0 comments on commit e47ab41

Please sign in to comment.