You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/system/address/AddressBookUtils.java
+10-6
Original file line number
Diff line number
Diff line change
@@ -208,9 +208,11 @@ public static Address parseAddressText(@NonNull final String addressText) throws
208
208
} catch (NumberFormatExceptione) {
209
209
thrownewParseException("Cannot parse value of weight from '" + parts[4] + "'", 4);
210
210
}
211
-
finalInetAddressinternalIp;
211
+
// FQDN Support: The original string value is preserved, whether it is an IP Address or a FQDN.
212
+
finalStringinternalHostname = parts[5];
212
213
try {
213
-
internalIp = InetAddress.getByName(parts[5]);
214
+
// validate that an InetAddress can be created from the internal hostname.
215
+
InetAddress.getByName(internalHostname);
214
216
} catch (UnknownHostExceptione) {
215
217
thrownewParseException("Cannot parse ip address from '" + parts[5] + ",", 5);
216
218
}
@@ -220,9 +222,11 @@ public static Address parseAddressText(@NonNull final String addressText) throws
220
222
} catch (NumberFormatExceptione) {
221
223
thrownewParseException("Cannot parse ip port from '" + parts[6] + "'", 6);
222
224
}
223
-
finalInetAddressexternalIp;
225
+
// FQDN Support: The original string value is preserved, whether it is an IP Address or a FQDN.
226
+
finalStringexternalHostname = parts[7];
224
227
try {
225
-
externalIp = InetAddress.getByName(parts[7]);
228
+
// validate that an InetAddress can be created from the external hostname.
229
+
InetAddress.getByName(externalHostname);
226
230
} catch (UnknownHostExceptione) {
227
231
thrownewParseException("Cannot parse ip address from '" + parts[7] + ",", 7);
228
232
}
@@ -239,9 +243,9 @@ public static Address parseAddressText(@NonNull final String addressText) throws
Copy file name to clipboardExpand all lines: platform-sdk/swirlds-platform-core/src/test/java/com/swirlds/platform/system/address/AddressBookTests.java
0 commit comments