Fixed bug in NetUtils.isMulticastMACAddr() caused by sign extension.
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / utils / NetUtils.java
index dc341625af642395872a3e2860a9d0fcc6f1ce3b..6b303f09f11955a053f7bcf740bf9f647b5df2ce 100644 (file)
@@ -355,9 +355,7 @@ public abstract class NetUtils {
      */
     public static boolean isMulticastMACAddr(byte[] MACAddress) {
         if (MACAddress.length == MACAddrLengthInBytes && !isBroadcastMACAddr(MACAddress)) {
-            if (MACAddress[0] % 2 == 1) {
-                return true;
-            }
+            return (MACAddress[0] & 1) != 0;
         }
         return false;
     }