diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2024-01-30 18:57:27 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2024-01-30 19:02:52 +0100 |
commit | 5156a5f1bdef61d45ca92a0b252947c0218d4028 (patch) | |
tree | 63c5bf91ecef72066d17676efeaa8144e7ee821b | |
parent | e4e6ca00cdfcebc331a96d48c1ca1ebbf6476aa9 (diff) |
poll socket recv before to_send
Fixes reply packets not being read from the socket.
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index e82ac57..3c9e3fa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -188,6 +188,13 @@ async fn main() -> Result<()> { } }, + result = sock.recv_from(&mut buf) => { + let (n, _) = result?; + let buf = &buf[..n]; + + logged_handle(&mut dhcp6, &mut dhcp6c, buf); + } + packet = dhcp6c.to_send() => send_dhcp6(&mut dhcp6, &sock, packet.0, packet.1).await, result = dhcp6c_rx.changed() => { @@ -221,13 +228,6 @@ async fn main() -> Result<()> { println!("[info] <> invalidate"); } } - - result = sock.recv_from(&mut buf) => { - let (n, _) = result?; - let buf = &buf[..n]; - - logged_handle(&mut dhcp6, &mut dhcp6c, buf); - } } } } |