Repository navigation
Wake-on-LAN: send through the TV's network so a VPN can't swallow it - #18
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What and why
Wake-on-LAN sent magic packets to
255.255.255.255from an unbound socket, which lets Windows pick the adapter. With a full-tunnel VPN that uses a TAP-style adapter (OpenVPN TAP, Hamachi, Radmin VPN, ZeroTier), Windows sends the broadcast into the VPN and the TV never wakes.GetAdaptersAddresses) and sends from each one whose subnet holds the TV's IP address. Each one sends to255.255.255.255, to that subnet's broadcast address and straight to the TV. Picking by subnet, not by route, also covers VPNs that claim the TV's subnet; a tunnel is used only when no real adapter is on that subnet.connect, which sends nothing).For reviewers:
windowsfeatures:Win32_NetworkManagement_IpHelper,Win32_NetworkManagement_NdisandWin32_Networking_WinSock. There's no new crate andCargo.lockis unchanged.src/tv/windows_adapters.rs.tv_network::wakenow takes the TV's address.tvs.jsonis unchanged and a downgrade stays safe. A per-TV adapter choice was left out for that reason.Checks
cargo fmt --all -- --checkcargo clippy --locked --all-targets -- -D warningscargo test --locked -- --test-threads=1(170 lib + 22 app passed, on a Windows 11 VM)THIRD_PARTY_LICENSES.mdregenerated if dependencies changed (no dependency changes)Tested by hand
On a Windows 11 VM, using
pktmonto see which adapter each packet leaves from, with a second VM on the same subnet as the "TV":0/1+128/1routes), the unbound broadcast left through the TAP adapter.director tv wakesent the broadcast, the subnet broadcast and unicast to the TV from Ethernet. The unbound extra still went to the TAP adapter.Not yet tested against a real TV.