mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-19 23:53:20 +03:00
no mask check for wol to avoid unexpected bug
This commit is contained in:
21
src/lan.rs
21
src/lan.rs
@@ -73,21 +73,14 @@ pub fn send_wol(id: String) {
|
||||
let interfaces = default_net::get_interfaces();
|
||||
for peer in &config::LanPeers::load().peers {
|
||||
if peer.id == id {
|
||||
for (ip, mac) in peer.ip_mac.iter() {
|
||||
for (_, mac) in peer.ip_mac.iter() {
|
||||
if let Ok(mac_addr) = mac.parse() {
|
||||
if let Ok(IpAddr::V4(ip)) = ip.parse() {
|
||||
for interface in &interfaces {
|
||||
for ipv4 in &interface.ipv4 {
|
||||
if (u32::from(ipv4.addr) & u32::from(ipv4.netmask))
|
||||
== (u32::from(ip) & u32::from(ipv4.netmask))
|
||||
{
|
||||
allow_err!(wol::send_wol(
|
||||
mac_addr,
|
||||
None,
|
||||
Some(IpAddr::V4(ipv4.addr))
|
||||
));
|
||||
}
|
||||
}
|
||||
for interface in &interfaces {
|
||||
for ipv4 in &interface.ipv4 {
|
||||
// remove below mask check to avoid unexpected bug
|
||||
// if (u32::from(ipv4.addr) & u32::from(ipv4.netmask)) == (u32::from(peer_ip) & u32::from(ipv4.netmask))
|
||||
log::info!("Send wol to {mac_addr} of {}", ipv4.addr);
|
||||
allow_err!(wol::send_wol(mac_addr, None, Some(IpAddr::V4(ipv4.addr))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user