summaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2022-07-04 14:51:50 +0200
committerMartin Polden <mpolden@mpolden.no>2022-07-04 14:51:50 +0200
commit84ae4d047dfa1d98faf6453f6a839fffb2bce8ca (patch)
tree5e9c02f47b28e47b94e7b5baa10856ae83ce13a2 /node-admin
parentef5c5ca45cf9c39a4f9e751e0d64aa9ac4fd1c05 (diff)
Add fix-ipv6-gateway flag
Diffstat (limited to 'node-admin')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/network/IPAddresses.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/network/IPAddresses.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/network/IPAddresses.java
index fc181eb3107..07e172c5117 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/network/IPAddresses.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/network/IPAddresses.java
@@ -73,6 +73,15 @@ public interface IPAddresses {
addresses));
}
+ /** Returns the hostname of given inetAddress */
+ default String getHostname(InetAddress inetAddress) {
+ String hostname = inetAddress.getHostName();
+ if (hostname.equals(inetAddress.getHostAddress())) {
+ throw new IllegalArgumentException("Could not find hostname for address " + inetAddress.getHostAddress());
+ }
+ return hostname;
+ }
+
/**
* Get the IPv4 address for the host if any.
*