cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1883: CLOUDSTACK-9723: Enable unique mac address ac...
Date Fri, 06 Jan 2017 22:57:27 GMT
Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1883#discussion_r95034912
  
    --- Diff: engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java ---
    @@ -377,11 +377,16 @@ protected void addAccountToNetwork(final long networkId, final long
accountId, f
         }
     
         @Override
    -    public String getNextAvailableMacAddress(final long networkConfigId) {
    +    public String getNextAvailableMacAddress(final long networkConfigId, Integer zoneMacIdentifier)
{
             final SequenceFetcher fetch = SequenceFetcher.getInstance();
    -
             long seq = fetch.getNextSequence(Long.class, _tgMacAddress, networkConfigId);
    -        seq = seq | _prefix << 40 | _rand.nextInt(Short.MAX_VALUE) << 16
& 0x00000000ffff0000l;
    +        if(zoneMacIdentifier!=0){
    +            seq = seq | _prefix << 40 | (long)zoneMacIdentifier << 32 | networkConfigId
<< 16 & 0x00000000ffff0000l;
    +        }
    +        else {
    +            seq = seq | _prefix << 40 | _rand.nextInt(Short.MAX_VALUE) <<
16 & 0x00000000ffff0000l;
    +
    +        }
    --- End diff --
    
    Please format per coding standards.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message