]> git.bitcoin.ninja Git - dnsseed-rust/commitdiff
Reset routing tables on reconnect
authorMatt Corallo <git@bluematt.me>
Fri, 23 Aug 2019 03:39:20 +0000 (23:39 -0400)
committerMatt Corallo <git@bluematt.me>
Fri, 23 Aug 2019 03:42:07 +0000 (23:42 -0400)
src/bgp_client.rs

index a890dad9cd72b227c5948461eefab5d2979899c8..a96de047731edc1bf0e958e61394e66d248f4a6a 100644 (file)
@@ -257,7 +257,9 @@ impl BGPClient {
                                        }
                                        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);