[ 
https://issues.apache.org/jira/browse/HIVE-28785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitriy Fingerman updated HIVE-28785:
-------------------------------------
    Description: 
Hive has code occurences as following:
{code:java}
InetAddress.getByName(String){code}
 * Only returns {*}one IP address{*}, even if multiple (IPv4 and IPv6) exist.
 * May return an IPv4 address even when an IPv6 address is preferred.

Safer Alternative:
Use InetAddress.getAllByName(hostname) to get all possible addresses and 
explicitly choose an IPv6 one if needed.

  was:
Hive has code occurences as following:
{code:java}
InetAddress.getByName(String){code}
 

Issue: This method may return only an IPv4 address if the system is not 
properly configured.
Fix: Use InetAddress.getAllByName(String) to support both IPv4 and IPv6.

 

// Bad - may return only IPv4 address
{code:java}
InetAddress address = InetAddress.getByName("example.com");{code}
// Good
{code:java}
InetAddress[] addresses = InetAddress.getAllByName("example.com");
for (InetAddress addr : addresses) {
    System.out.println(addr.getHostAddress());
}{code}


> Fix InetAddress.getByName is not safe with IPv6 stack
> -----------------------------------------------------
>
>                 Key: HIVE-28785
>                 URL: https://issues.apache.org/jira/browse/HIVE-28785
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Dmitriy Fingerman
>            Priority: Major
>
> Hive has code occurences as following:
> {code:java}
> InetAddress.getByName(String){code}
>  * Only returns {*}one IP address{*}, even if multiple (IPv4 and IPv6) exist.
>  * May return an IPv4 address even when an IPv6 address is preferred.
> Safer Alternative:
> Use InetAddress.getAllByName(hostname) to get all possible addresses and 
> explicitly choose an IPv6 one if needed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to