aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 46f063a..1498dc5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -167,7 +167,7 @@ async fn main() -> Result<()> {
}
},
- packet = dhcp6c.to_send() => send_dhcp6(&mut dhcp6, &sock, packet).await?,
+ packet = dhcp6c.to_send() => send_dhcp6(&mut dhcp6, &sock, packet).await,
result = dhcp6c_rx.changed() => {
result?;
@@ -321,7 +321,14 @@ fn handle(dhcp6: &mut Dhcp6, dhcp6c: &mut Dhcp6c, buf: &[u8]) -> Result<()> {
Ok(())
}
-async fn send_dhcp6(dhcp6: &mut Dhcp6, sock: &UdpSocket, packet: Packet) -> Result<()> {
+async fn send_dhcp6(dhcp6: &mut Dhcp6, sock: &UdpSocket, packet: Packet) {
+ match do_send_dhcp6(dhcp6, sock, packet).await {
+ Ok(_) => {}
+ Err(e) => println!("[warn] -> send error: {}", e),
+ }
+}
+
+async fn do_send_dhcp6(dhcp6: &mut Dhcp6, sock: &UdpSocket, packet: Packet) -> Result<()> {
if packet != dhcp6.last_sent {
dhcp6.xid = rand::random();
}