Skip to content

Commit

Permalink
[network] Modify iOS port knock to use a valid mDNS packet (openhab#1…
Browse files Browse the repository at this point in the history
…7687)

Signed-off-by: Neil Greatorex <neil@greatorex.me.uk>
  • Loading branch information
ngreatorex authored and KaaNee committed Nov 8, 2024
1 parent aed8022 commit d6d0338
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ public PingResult javaPing(Duration timeout, InetAddress destinationAddress) {
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) {
Expand Down

0 comments on commit d6d0338

Please sign in to comment.