mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
Cloak MAC address from unpaired clients
This commit is contained in:
@@ -660,9 +660,17 @@ namespace nvhttp {
|
||||
tree.put("root.uniqueid", http::unique_id);
|
||||
tree.put("root.HttpsPort", net::map_port(PORT_HTTPS));
|
||||
tree.put("root.ExternalPort", net::map_port(PORT_HTTP));
|
||||
tree.put("root.mac", platf::get_mac_address(net::addr_to_normalized_string(local_endpoint.address())));
|
||||
tree.put("root.MaxLumaPixelsHEVC", video::active_hevc_mode > 1 ? "1869449984" : "0");
|
||||
|
||||
// Only include the MAC address for requests sent from paired clients over HTTPS.
|
||||
// For HTTP requests, use a placeholder MAC address that Moonlight knows to ignore.
|
||||
if constexpr (std::is_same_v<SimpleWeb::HTTPS, T>) {
|
||||
tree.put("root.mac", platf::get_mac_address(net::addr_to_normalized_string(local_endpoint.address())));
|
||||
}
|
||||
else {
|
||||
tree.put("root.mac", "00:00:00:00:00:00");
|
||||
}
|
||||
|
||||
// Moonlight clients track LAN IPv6 addresses separately from LocalIP which is expected to
|
||||
// always be an IPv4 address. If we return that same IPv6 address here, it will clobber the
|
||||
// stored LAN IPv4 address. To avoid this, we need to return an IPv4 address in this field
|
||||
|
||||
Reference in New Issue
Block a user