Skip to content

Commit

Permalink
Merge c589f1c into 54631fa
Browse files Browse the repository at this point in the history
  • Loading branch information
azderski committed May 15, 2015
2 parents 54631fa + c589f1c commit e287167
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -92,8 +92,15 @@ public static byte[] realMacAddress() {
* Optionally setting the system property OVERRIDE_MAC_PROP to a valid MAC
* address will result in it being returned instead.
*/
public static byte[] macAddress() {
public static byte[] macAddress() {
byte[] override = getOverride();
return override != null ? override : realMacAddress();

if (override == null)
override = realMacAddress();

// lop off unicast/multicast lower bit to preserve top vendor bit & resolution. This
override[0] = (byte)((short)(override[0] & 0xff) >> 1);

return override;
}
}

0 comments on commit e287167

Please sign in to comment.