mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
make kcp proxy compitible with old version (#585)
* fix kcp not work with smoltcp * check if dst kcp input is enabled
This commit is contained in:
@@ -30,7 +30,7 @@ use crate::{
|
||||
},
|
||||
peers::route_trait::{Route, RouteInterfaceBox},
|
||||
proto::{
|
||||
common::{Ipv4Inet, NatType, StunInfo},
|
||||
common::{Ipv4Inet, NatType, PeerFeatureFlag, StunInfo},
|
||||
peer_rpc::{
|
||||
route_foreign_network_infos, ForeignNetworkRouteInfoEntry, ForeignNetworkRouteInfoKey,
|
||||
OspfRouteRpc, OspfRouteRpcClientFactory, OspfRouteRpcServer, PeerIdVersion,
|
||||
@@ -2042,6 +2042,8 @@ impl Route for PeerRoute {
|
||||
route.cost_latency_first = next_hop_peer_latency_first.map(|x| x.path_latency);
|
||||
route.path_latency_latency_first = next_hop_peer_latency_first.map(|x| x.path_latency);
|
||||
|
||||
route.feature_flag = item.feature_flag.clone();
|
||||
|
||||
routes.push(route);
|
||||
}
|
||||
routes
|
||||
@@ -2101,6 +2103,14 @@ impl Route for PeerRoute {
|
||||
.map(|x| x.clone())
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
async fn get_feature_flag(&self, peer_id: PeerId) -> Option<PeerFeatureFlag> {
|
||||
self.service_impl
|
||||
.route_table
|
||||
.peer_infos
|
||||
.get(&peer_id)
|
||||
.and_then(|x| x.feature_flag.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl PeerPacketFilter for Arc<PeerRoute> {}
|
||||
|
||||
Reference in New Issue
Block a user