connlib: dont fail on ipv6 add route failure (#2962)

Fixes a bug where gateway failed to start if we couldn't add ipv6
routes.
This commit is contained in:
Gabi
2023-12-19 21:49:32 -03:00
committed by GitHub
parent 9b51094f73
commit 92c5e5f1de

View File

@@ -143,7 +143,12 @@ impl Tun {
match res {
Ok(_) => Ok(()),
Err(NetlinkError(err)) if err.raw_code() == FILE_ALREADY_EXISTS => Ok(()),
Err(err) => Err(err.into()),
// TODO: we should be able to surface this error and handle it depending on
// if any of the added routes succeeded.
Err(err) => {
tracing::error!(%route, "failed to add route: {err:#?}");
Ok(())
}
}
};
@@ -208,7 +213,8 @@ async fn set_iface_config(config: InterfaceConfig, handle: Handle) -> Result<()>
handle.link().set(index).up().execute().await?;
Ok(res_v4.or(res_v6)?)
res_v4.or(res_v6)?;
Ok(())
}
fn get_last_error() -> Error {