Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 72d3dd8

Browse files
author
Jay Logue
authored
Merge pull request #495 from openweave/bug/emargolis/fix-generate-weave-node-id-func
Fixed GenerateWeaveNodeId Function Implementation.
2 parents 3039ec3 + f427405 commit 72d3dd8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/core/WeaveMessageLayer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2019 Google LLC.
3+
* Copyright (c) 2019-2020 Google LLC.
44
* Copyright (c) 2013-2017 Nest Labs, Inc.
55
* All rights reserved.
66
*
@@ -2610,6 +2610,8 @@ NL_DLL_EXPORT WEAVE_ERROR GenerateWeaveNodeId(uint64_t & nodeId)
26102610
{
26112611
err = nl::Weave::Platform::Security::GetSecureRandomData(reinterpret_cast<uint8_t*>(&id), sizeof(id));
26122612
SuccessOrExit(err);
2613+
2614+
id &= ~kEUI64_UL_Local;
26132615
}
26142616

26152617
nodeId = id | kEUI64_UL_Local;

0 commit comments

Comments
 (0)