Skip to content

Commit cd099cc

Browse files
authored
[network] Modify iOS port knock to use a valid mDNS packet (openhab#17687)
Signed-off-by: Neil Greatorex <[email protected]>
1 parent 5d20cba commit cd099cc

File tree

1 file changed

+2
-1
lines changed
  • bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils

1 file changed

+2
-1
lines changed

bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/NetworkUtils.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ public PingResult javaPing(Duration timeout, InetAddress destinationAddress) {
446446
public void wakeUpIOS(InetAddress address) throws IOException {
447447
int port = 5353;
448448
try (DatagramSocket s = new DatagramSocket()) {
449-
byte[] buffer = new byte[0];
449+
// Send a valid mDNS packet (12 bytes of zeroes)
450+
byte[] buffer = new byte[12];
450451
s.send(new DatagramPacket(buffer, buffer.length, address, port));
451452
logger.trace("Sent packet to {}:{} to wake up iOS device", address, port);
452453
} catch (PortUnreachableException e) {

0 commit comments

Comments
 (0)