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_r248483838
 
 

 ##########
 File path: utils/src/main/java/com/cloud/utils/net/NetUtils.java
 ##########
 @@ -1582,6 +1582,15 @@ public static IPv6Address ipv6LinkLocal(final String 
macAddress) {
         return EUI64Address(IPv6Network.LINK_LOCAL_NETWORK, macAddress);
     }
 
+    public static boolean isIPv6EUI64(final IPv6Address address) {
+        byte[] bytes = address.toByteArray();
+        return (bytes[11] == -1 && bytes[12] == -2);
 
 Review comment:
   Would you mind extracting these `-1` and `-2` to constants, and also 
documenting what they mean. One is `F` and the other one `E`, right?
   
   Also, would you mind documenting the method `isIPv6EUI64` with something 
similar to what you posted in the PR description. At least for me, that 
explanation was very useful.

----------------------------------------------------------------
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