Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Store mac in big-endian order in DeviceKey
Browse files Browse the repository at this point in the history
This was a bug. The intention was to store it in big endian, so that the
sort order for devices would be VLANs+Mac.

Fixes #289
  • Loading branch information
pstavirs committed Mar 23, 2020
1 parent 79ac3a2 commit bfc5477
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void Device::setMac(quint64 mac)
int ofs = kMaxVlan * sizeof(quint16);

mac_ = mac & ~(0xffffULL << 48);
memcpy(key_.data() + ofs, (char*)&mac_, sizeof(mac_));
qToBigEndian(mac_, key_.data()+ofs);
}

void Device::setIp4(quint32 address, int prefixLength, quint32 gateway)
Expand Down

0 comments on commit bfc5477

Please sign in to comment.