We are still using `Subnet.Contains` a lot but that does not handle IPv4 mapped to IPv6 addresses at all. It was partially fixed by #12094 in local network checking, but it may not always happen on LAN.
Also make all local network checking to use IsInLocalNetwork method instead of just performing `Subnet.Contains` which is not accurate.
Filter out all link-local addresses for external interface matching.
We cannot simply use the subnet list to check if the IP is in LAN as it does not handle special cases like IPv4MappedToIPv6 and IPv6 loopback addresses.
Added in .NET 5, this attribute allows for the compiler to recognize
that InitializeLan (and by extension, UpdateSettings) will initialize
the specified fields.
* Call GetSmartApiUrl directly in UdpServer.RespondToV2Message
GetSmartApiUrl already returns PublishedServerUrl if set.
* Rewrite auto discovery using UdpClient and BackgroundService
* Respect network address settings in AutoDiscoveryHost
* Always listen on broadcast address in Linux for auto-discovery
* Await udp server tasks in AutoDiscoveryHost
* Only bind to broadcast addresses for IPv4
* Only bind to broadcast if IPv4 is enabled