mirror of
https://github.com/corda/corda.git
synced 2025-01-03 03:36:48 +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. */
|
/** Returns the first public IP address found on any of the network interfaces, or `null` if none found. */
|
||||||
fun tryDetectPublicIP(): InetAddress? {
|
fun tryDetectPublicIP(): InetAddress? {
|
||||||
for (int in NetworkInterface.getNetworkInterfaces()) {
|
for (int in NetworkInterface.getNetworkInterfaces()) {
|
||||||
|
if (int.name.startsWith("utun")) continue
|
||||||
for (address in int.inetAddresses) {
|
for (address in int.inetAddresses) {
|
||||||
if (isPublic(address)) return address
|
if (isPublic(address)) return address
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user