[ https://issues.apache.org/jira/browse/MNG-7132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17310570#comment-17310570 ]
Michael Osipov commented on MNG-7132: ------------------------------------- I am aware of this for a long time, but did not start to work on. Fully agree on 1 and 2, though 2 is just {{::1}}. IPv6 does not have any local ranges anymore. There is also link-local which I need to check. As for 3: I would only use {{localhost}} everything else is a user problem or try to rely on {{InetAdress}} if it is suitable. > org.eclipse.aether.util.repository.DefaultMirrorSelector#isLocal does not > handle local host/ip > ---------------------------------------------------------------------------------------------- > > Key: MNG-7132 > URL: https://issues.apache.org/jira/browse/MNG-7132 > Project: Maven > Issue Type: Bug > Reporter: Romain Manni-Bucau > Priority: Minor > > DefaultMirrorSelector used in > org.apache.maven.internal.aether.DefaultRepositorySystemSessionFactory#newRepositorySession > does not implement isLocal properly - more exactly it only handles 2 > particular cases whereas local can be way more numerous: > # ipv4 case: 127.x.y.z (test can be has 4 segments separated by a dot and > starts with 127.) > # ipv6 case: starts with 1 and ends with 0 (see > java.net.Inet6Address.Inet6AddressHolder#isLoopbackAddress) > # host case: not sure we want to handle it but except localhost hardcoded > string we could parse /etc/hosts (or windows specific location) too to > resolve the ip without going through InetAddress - see next point) and use > the ip with 1+2 rules. > this can be implemented as string parsing (faster) or reusing > [java.net|http://java.net/].InetAddress#isLoopbackAddress (which can fallback > in some resolution which can be slow at startup but works better overall and > is easier). > -- This message was sent by Atlassian Jira (v8.3.4#803005)