holdenk commented on code in PR #39728:
URL: https://github.com/apache/spark/pull/39728#discussion_r1087233459


##########
core/src/main/scala/org/apache/spark/util/Utils.scala:
##########
@@ -1109,6 +1109,24 @@ private[spark] object Utils extends Logging {
     }
   }
 
+  /**
+   * Normalize IPv6 IPs and no-op on all other hosts.
+   */
+  private[spark] def normalizeIpIfNeeded(host: String): String = {
+    // Is this a v6 address. We ask users to add [] around v6 addresses as 
strs but
+    // there not always there. If it's just 0-9 and : and [] we treat it as a 
v6 address.
+    // This means some invalid addresses are treated as v6 addresses, but 
since they are
+    // not valid hostnames it doesn't matter.
+    // See https://www.rfc-editor.org/rfc/rfc1123#page-13 for context around 
valid hostnames.
+    val addressRe = """^\[{0,1}([0-9:]+?:[0-9]+)\]{0,1}$""".r

Review Comment:
   Ah good point, I'm used to v4 addresses where that would be a reserved 
broadcast address but yeah.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to