Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5424#discussion_r28058083
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -806,15 +808,20 @@ private[spark] object Utils extends Logging {
             // It's more proper to pick ip address following system output 
order.
             val activeNetworkIFs = NetworkInterface.getNetworkInterfaces.toList
             val reOrderedNetworkIFs = if (isWindows) activeNetworkIFs else 
activeNetworkIFs.reverse
    +
             for (ni <- reOrderedNetworkIFs) {
    -          for (addr <- ni.getInetAddresses if !addr.isLinkLocalAddress &&
    -               !addr.isLoopbackAddress && addr.isInstanceOf[Inet4Address]) 
{
    +          val addresses = ni.getInetAddresses.toList
    +            .filter { addr => !addr.isLinkLocalAddress && 
!addr.isLoopbackAddress }
    +          if ( !addresses.isEmpty ) {
    +            val addr = addresses.find( _.isInstanceOf[Inet4Address] 
).getOrElse(addresses.head)
    +            // because of Inet6Address.toHostName may add interface at the 
end if it knows about it
    +            val strippedAddress = InetAddress.getByAddress(addr.getAddress)
    --- End diff --
    
    Just push more commits to this branch


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to