rafaelweingartner commented on a change in pull request #3136: ipv6: Do not 
allow Secondary IPv6 addresses to be EUI-64
URL: https://github.com/apache/cloudstack/pull/3136#discussion_r249408821
 
 

 ##########
 File path: utils/src/main/java/com/cloud/utils/net/NetUtils.java
 ##########
 @@ -1582,6 +1586,29 @@ public static IPv6Address ipv6LinkLocal(final String 
macAddress) {
         return EUI64Address(IPv6Network.LINK_LOCAL_NETWORK, macAddress);
     }
 
+    /**
+     * When using StateLess Address AutoConfiguration (SLAAC) for IPv6 the 
addresses
+     * choosen by hosts in a network are based on the 48-bit MAC address and 
this is expanded to 64-bits
+     * with EUI-64
+     * FFFE is inserted into the address and these can be identified
+     *
+     * By converting the IPv6 Address to a byte array we can check the 11th 
and 12th byte to see if the
+     * address is EUI064.
+     *
+     * See RFC4291 for more information
+     *
+     * @param address IPv6Address to be checked
+     * @return True if Address is EUI-64 IPv6
+     */
+    public static boolean isIPv6EUI64(final IPv6Address address) {
 
 Review comment:
   Awesome!!!
   :+1: 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to