mirror of
https://github.com/corda/corda.git
synced 2024-12-22 06:17:55 +00:00
Ignore utunX interfaces when detecting public IP
This commit is contained in:
parent
08e7eb1a57
commit
a01c466beb
@ -7,6 +7,7 @@ object AddressUtils {
|
||||
/** Returns the first public IP address found on any of the network interfaces, or `null` if none found. */
|
||||
fun tryDetectPublicIP(): InetAddress? {
|
||||
for (int in NetworkInterface.getNetworkInterfaces()) {
|
||||
if (int.name.startsWith("utun")) continue
|
||||
for (address in int.inetAddresses) {
|
||||
if (isPublic(address)) return address
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user