diff --git a/moonlight-common/src/main/java/com/limelight/nvstream/wol/WakeOnLanSender.java b/moonlight-common/src/main/java/com/limelight/nvstream/wol/WakeOnLanSender.java index 2bce21d1..8940e7fa 100644 --- a/moonlight-common/src/main/java/com/limelight/nvstream/wol/WakeOnLanSender.java +++ b/moonlight-common/src/main/java/com/limelight/nvstream/wol/WakeOnLanSender.java @@ -22,8 +22,12 @@ public class WakeOnLanSender { boolean sentWolPacket = false; try { - // Try all resolved remote and local addresses - for (String unresolvedAddress : new String[] {computer.localAddress, computer.remoteAddress}) { + // Try all resolved remote and local addresses and IPv4 broadcast address. + // The broadcast address is required to avoid stale ARP cache entries + // making the sleeping machine unreachable. + for (String unresolvedAddress : new String[] { + computer.localAddress, computer.remoteAddress, "255.255.255.255" + }) { try { for (InetAddress resolvedAddress : InetAddress.getAllByName(unresolvedAddress)) { // Try all the ports for each resolved address