hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Isaacson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-8568) DNS#reverseDns fails on IPv6 addresses
Date Mon, 01 Oct 2012 18:17:09 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-8568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13467037#comment-13467037
] 

Andy Isaacson commented on HADOOP-8568:
---------------------------------------

Tony,

no need to delete old patches when uploading a new one, it can be useful to reviewers to have
old patches available to use {{interdiff}} or similar tools or simply to review advancement
of a change.  I tend to use a new name (hdfs-123.patch, hdfs-123-1.patch, etc) for each upload,
but that's just for my convenience since Jira keeps track of different uploads with the same
name just fine.

{code}
+      byte rawaddr[] = hostIp.getAddress();
...
+      String[] parts = hostaddr.split("\\.");
+      reverseIP = parts[3] + "." + parts[2] + "." + parts[1] + "."
+        + parts[0] + ".in-addr.arpa";
{code}
I think the {{byte[]}} version of this code, used for IPv6, is significantly superior to the
regex based string version used for IPv4.  Could you rewrite the IPv4 section of the code
using {{getAddress()}}?  This may also result in greater code sharing between the two branches.

                
> DNS#reverseDns fails on IPv6 addresses
> --------------------------------------
>
>                 Key: HADOOP-8568
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8568
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.0.0-alpha
>            Reporter: Eli Collins
>            Assignee: Tony Kew
>              Labels: newbie
>         Attachments: HADOOP-8568.patch
>
>
> DNS#reverseDns assumes hostIp is a v4 address (4 parts separated by dots), blows up if
given a v6 address:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
>         at org.apache.hadoop.net.DNS.reverseDns(DNS.java:79)
>         at org.apache.hadoop.net.DNS.getHosts(DNS.java:237)
>         at org.apache.hadoop.net.DNS.getDefaultHost(DNS.java:340)
>         at org.apache.hadoop.net.DNS.getDefaultHost(DNS.java:358)
>         at org.apache.hadoop.net.DNS.getDefaultHost(DNS.java:337)
>         at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:235)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1649)
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message