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

Signed-off-by: Neil Greatorex <neil@greatorex.me.uk>
This commit is contained in:
Neil Greatorex 2024-11-04 18:58:08 +00:00 committed by GitHub
parent 5d20cba182
commit cd099cceef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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) {