mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-08-29 07:08:42 +00:00
Add error log if set route or addr on TUN fails
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
+8
-2
@@ -37,8 +37,14 @@ pub async fn new(
|
||||
|
||||
let tun_index = link_index_by_name(handle.clone(), name.to_string()).await?;
|
||||
|
||||
add_address(handle.clone(), tun_index, node_subnet).await?;
|
||||
add_route(handle.clone(), tun_index, route_subnet).await?;
|
||||
if let Err(e) = add_address(handle.clone(), tun_index, node_subnet).await {
|
||||
error!("Failed to add address {node_subnet} to TUN interface: {e}");
|
||||
return Err(e);
|
||||
}
|
||||
if let Err(e) = add_route(handle.clone(), tun_index, route_subnet).await {
|
||||
error!("Failed to add route for {route_subnet} to TUN interface: {e}");
|
||||
return Err(e);
|
||||
}
|
||||
|
||||
// We are done with our netlink connection, abort the task so we can properly clean up.
|
||||
netlink_task_handle.abort();
|
||||
|
||||
Reference in New Issue
Block a user