[network] Modify iOS port knock to use a valid mDNS packet (#17687)

Signed-off-by: Neil Greatorex <neil@greatorex.me.uk>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
Neil Greatorex 2024-11-04 18:58:08 +00:00 committed by Ciprian Pascu
parent e7dda8ffbd
commit 67c6fe36d7

View File

@ -446,7 +446,8 @@ public class NetworkUtils {
public void wakeUpIOS(InetAddress address) throws IOException {
int port = 5353;
try (DatagramSocket s = new DatagramSocket()) {
byte[] buffer = new byte[0];
// Send a valid mDNS packet (12 bytes of zeroes)
byte[] buffer = new byte[12];
s.send(new DatagramPacket(buffer, buffer.length, address, port));
logger.trace("Sent packet to {}:{} to wake up iOS device", address, port);
} catch (PortUnreachableException e) {