runtime-rs: update route destination with prefix

Update route destination with prefix.

Fixes: #4726
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
This commit is contained in:
Quanwei Zhou 2022-07-23 15:18:00 +08:00 committed by quanwei.zqw
parent 534a4920b1
commit e0194dcb5e

View File

@ -163,7 +163,7 @@ fn generate_route(name: &str, route: &RouteMessage) -> Result<Option<Route>> {
Ok(Some(Route {
dest: route
.destination_prefix()
.map(|(addr, _)| addr.to_string())
.map(|(addr, prefix)| format!("{}/{}", addr, prefix))
.unwrap_or_default(),
gateway: route.gateway().map(|v| v.to_string()).unwrap_or_default(),
device: name.to_string(),