Discussion:
"isIPv6Address" api in InetAddressUtils.java (httpcomponets-core)
Jaikit Savla
2017-07-01 18:56:45 UTC
Permalink
Hello Everyone,

As per RFC 4291 (https://tools.ietf.org/html/rfc4291#section-2.2) , IPV6 address can be represented in 3 ways:a. 2001:DB8:0:0:8:800:200C:417Ab. ::1 c. ::13.1.68.3  
"isIPv6Address" within InetAddressUtils checks only for a, b (above) and does not consider IPv4MappedIPv64Address (case c) as valid.  
Based on the RFC, option c above is considered valid. Does anyone know why it is not considered as part of api "isIPv6Address" api above ? and alternatively should it be considered as valid ?
reference: https://github.com/apache/httpcomponents-core/blob/master/httpcore5/src/main/java/org/apache/hc/core5/net/InetAddressUtils.javahttps://tools.ietf.org/html/rfc5156#section-2.2   --  ::FFFF:0:0/96 are the IPv4-mapped addresses [RFC4291]. Addresses
within this block should not appear on the public Internet.
commit where isIPv4MappedIPv64Address was added but does not look like it is being used.  Does anyone know any particular usage of IPv4MappedIPv6 ?https://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/net/InetAddressUtils.java?r1=1406216&r2=1444926&pathrev=1767956&diff_format=h 

Thanks,Jaikit
Oleg Kalnichevski
2017-07-01 20:20:52 UTC
Permalink
Post by Jaikit Savla
Hello Everyone,
As per RFC 4291 (https://tools.ietf.org/html/rfc4291#section-2.2) ,
IPV6 address can be represented in 3 ways:a.
2001:DB8:0:0:8:800:200C:417Ab. ::1 c. ::13.1.68.3  
"isIPv6Address" within InetAddressUtils checks only for a, b (above)
and does not consider IPv4MappedIPv64Address (case c) as valid.  
Based on the RFC, option c above is considered valid. Does anyone
know why it is not considered as part of api "isIPv6Address" api
above ? and alternatively should it be considered as valid ?
reference: https://github.com/apache/httpcomponents-core/blob/master/
httpcore5/src/main/java/org/apache/hc/core5/net/InetAddressUtils.java
https://tools.ietf.org/html/rfc5156#section-2.2   --  ::FFFF:0:0/96
are the IPv4-mapped addresses [RFC4291]. Addresses
   within this block should not appear on the public Internet. 
commit where isIPv4MappedIPv64Address was added but does not look
like it is being used.  Does anyone know any particular usage of
IPv4MappedIPv6 ?https://svn.apache.org/viewvc/httpcomponents/httpcore
/trunk/httpcore5/src/main/java/org/apache/hc/core5/net/InetAddressUti
ls.java?r1=1406216&r2=1444926&pathrev=1767956&diff_format=h 
Thanks,Jaikit
Jaikit


Feel free to raise PR at Github with changes that you think should be
applied.

I believe the code you are referring to was added by Sebastian. He
might be able to answer your question.

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-***@hc.apache.org
For additional commands, e-mail: httpclient-users-***@hc.apache.org
Jaikit Savla
2017-07-02 04:33:07 UTC
Permalink
Thanks Oleg for quick response. Will send the PR. 
Post by Jaikit Savla
Hello Everyone,
As per RFC 4291 (https://tools.ietf.org/html/rfc4291#section-2.2) ,
IPV6 address can be represented in 3 ways:a.
2001:DB8:0:0:8:800:200C:417Ab. ::1 c. ::13.1.68.3  
"isIPv6Address" within InetAddressUtils checks only for a, b (above)
and does not consider IPv4MappedIPv64Address (case c) as valid.  
Based on the RFC, option c above is considered valid. Does anyone
know why it is not considered as part of api "isIPv6Address" api
above ? and alternatively should it be considered as valid ?
reference: https://github.com/apache/httpcomponents-core/blob/master/
httpcore5/src/main/java/org/apache/hc/core5/net/InetAddressUtils.java
https://tools.ietf.org/html/rfc5156#section-2.2   --  ::FFFF:0:0/96
are the IPv4-mapped addresses [RFC4291]. Addresses
   within this block should not appear on the public Internet. 
commit where isIPv4MappedIPv64Address was added but does not look
like it is being used.  Does anyone know any particular usage of
IPv4MappedIPv6 ?https://svn.apache.org/viewvc/httpcomponents/httpcore
/trunk/httpcore5/src/main/java/org/apache/hc/core5/net/InetAddressUti
ls.java?r1=1406216&r2=1444926&pathrev=1767956&diff_format=h 
Thanks,Jaikit
Jaikit


Feel free to raise PR at Github with changes that you think should be
applied.

I believe the code you are referring to was added by Sebastian. He
might be able to answer your question.

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-***@hc.apache.org
For additional commands, e-mail: httpclient-users-***@hc.apache.org
Loading...