[network] Modify iOS port knock to use a valid mDNS packet #17687
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The network binding has functionality that assumes, by default, that a device is an iOS device, and should be woken up by sending a packet to port 5353 (mDNS). The code sends a packet with an empty UDP payload, which is not a valid mDNS packet.
If the device is not an iOS device, but is instead a Windows device running the Apple Bonjour Service, the Bonjour Service will add an entry to the application event log for each "malformed" packet received. While this feature can now be disabled (since #16259 was merged), I believe it would be a simple (and non-breaking) change to send a 12-byte packet of zeroes instead. This is a valid mDNS packet (representing a query with 0 questions and 0 answers) so doesn't trigger the error logging in Bonjour for Windows.
There is also a possibility that the malformed packets may trip some firewalls, but I do not have any evidence that this is happening.