.then(path_b.med.cmp(&path_a.med))
});
// TODO: Find last common ASN among all paths
- *path_vecs[0].path.last().unwrap_or(&0)
+ *path_vecs.first().map(|route| route.path.last().unwrap_or(&0)).unwrap_or(&0)
}
pub fn disconnect(&self) {
}
match bgp_msg {
Message::Open(_) => {
- printer.add_line("Connected to BGP route provider".to_string(), true);
+ client.routes.lock().unwrap().v4_table.clear();
+ client.routes.lock().unwrap().v6_table.clear();
+ printer.add_line("Connected to BGP route provider".to_string(), false);
},
Message::KeepAlive => {
let _ = sender.try_send(Message::KeepAlive);