Standardize arguments in tun setup

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet committed 2023-09-22 16:13:58 +02:00
1 parent d98a8b8d5c
commit c96f42f4f6
1 file changed
+2 -2
+2 -2
View File
@@ -37,7 +37,7 @@ pub async fn new(
let tun_index = link_index_by_name(handle.clone(), name.to_string()).await?;
add_address(handle.clone(), node_subnet, tun_index).await?;
add_address(handle.clone(), tun_index, node_subnet).await?;
add_route(handle.clone(), tun_index, route_subnet).await?;
// We are done with our netlink connection, abort the task so we can properly clean up.
@@ -125,8 +125,8 @@ async fn link_index_by_name(
/// The kernel will automatically add a route entry for the subnet assigned to the interface.
async fn add_address(
handle: Handle,
subnet: Subnet,
link_index: u32,
subnet: Subnet,
) -> Result<(), Box<dyn std::error::Error>> {
Ok(handle
.address()