安卓不设置路由
This commit is contained in:
@@ -267,6 +267,8 @@ impl<Call: VntCallback> ServerPacketHandler<Call> {
|
|||||||
if old.virtual_ip != Ipv4Addr::UNSPECIFIED {
|
if old.virtual_ip != Ipv4Addr::UNSPECIFIED {
|
||||||
log::info!("ip发生变化,old:{:?},response={:?}", old, response);
|
log::info!("ip发生变化,old:{:?},response={:?}", old, response);
|
||||||
}
|
}
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
|
{
|
||||||
if let Err(e) = self.device.set_ip(virtual_ip, virtual_netmask) {
|
if let Err(e) = self.device.set_ip(virtual_ip, virtual_netmask) {
|
||||||
log::error!("LocalIpExists {:?}", e);
|
log::error!("LocalIpExists {:?}", e);
|
||||||
self.callback.error(ErrorInfo::new_msg(
|
self.callback.error(ErrorInfo::new_msg(
|
||||||
@@ -281,7 +283,9 @@ impl<Call: VntCallback> ServerPacketHandler<Call> {
|
|||||||
log::warn!("删除路由失败 ={:?}", e);
|
log::warn!("删除路由失败 ={:?}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Err(e) = self.device.add_route(virtual_network, virtual_netmask, 1) {
|
if let Err(e) =
|
||||||
|
self.device.add_route(virtual_network, virtual_netmask, 1)
|
||||||
|
{
|
||||||
log::warn!("添加默认路由失败 ={:?}", e);
|
log::warn!("添加默认路由失败 ={:?}", e);
|
||||||
} else {
|
} else {
|
||||||
guard.push((virtual_network, virtual_netmask));
|
guard.push((virtual_network, virtual_netmask));
|
||||||
@@ -315,9 +319,12 @@ impl<Call: VntCallback> ServerPacketHandler<Call> {
|
|||||||
guard.push((dest, mask));
|
guard.push((dest, mask));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.callback.success();
|
}
|
||||||
}
|
}
|
||||||
self.set_device_info_list(response.device_info_list, response.epoch as _);
|
self.set_device_info_list(response.device_info_list, response.epoch as _);
|
||||||
|
if old.status.offline() {
|
||||||
|
self.callback.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
service_packet::Protocol::PushDeviceList => {
|
service_packet::Protocol::PushDeviceList => {
|
||||||
|
|||||||
Reference in New Issue
Block a user