File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed
Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
99## [ Unreleased]
1010
11+ ## [ v2.3.1] - 2025-07-01
12+ [ v2.3.1] ( https://github.com/TensionDev/UUIDUtil/releases/tag/v2.3.1 )
13+
14+ ### Fixed
15+ - Fixed Node ID for generated UUID v1 to check for valid MAC address.
16+
17+
1118## [ v2.3.0] - 2025-03-30
1219[ v2.3.0] ( https://github.com/TensionDev/UUIDUtil/releases/tag/v2.3.0 )
1320
Original file line number Diff line number Diff line change 1010 <GeneratePackageOnBuild >true</GeneratePackageOnBuild >
1111 <PackageRequireLicenseAcceptance >true</PackageRequireLicenseAcceptance >
1212 <PackageId >TensionDev.UUID</PackageId >
13- <Version >2.3.0 </Version >
13+ <Version >2.3.1 </Version >
1414 <Authors >TensionDev amsga</Authors >
1515 <Company >TensionDev</Company >
1616 <Product >TensionDev.UUID</Product >
Original file line number Diff line number Diff line change 1515// limitations under the License.
1616
1717using System ;
18+ using System . Linq ;
1819
1920namespace TensionDev . UUID
2021{
@@ -127,14 +128,20 @@ public static Byte[] GetNodeID()
127128 {
128129 if ( System . Net . NetworkInformation . PhysicalAddress . None . Equals ( s_physicalAddress ) )
129130 {
130- System . Net . NetworkInformation . NetworkInterface [ ] networkInterfaces = System . Net . NetworkInformation . NetworkInterface . GetAllNetworkInterfaces ( ) ;
131- if ( networkInterfaces . Length > 0 )
131+ var networkInterfaces = System . Net . NetworkInformation . NetworkInterface . GetAllNetworkInterfaces ( ) ;
132+ foreach ( var networkInterface in networkInterfaces )
132133 {
133- s_physicalAddress = networkInterfaces [ 0 ] . GetPhysicalAddress ( ) ;
134+ var address = networkInterface . GetPhysicalAddress ( ) ;
135+ if ( ! address . Equals ( System . Net . NetworkInformation . PhysicalAddress . None ) )
136+ {
137+ s_physicalAddress = address ;
138+ break ;
139+ }
134140 }
135- else
141+ if ( s_physicalAddress . Equals ( System . Net . NetworkInformation . PhysicalAddress . None ) )
136142 {
137- using ( System . Security . Cryptography . RNGCryptoServiceProvider cryptoServiceProvider = new System . Security . Cryptography . RNGCryptoServiceProvider ( ) )
143+ // Fallback to random
144+ using ( var cryptoServiceProvider = new System . Security . Cryptography . RNGCryptoServiceProvider ( ) )
138145 {
139146 Byte [ ] fakeNode = new Byte [ 6 ] ;
140147 cryptoServiceProvider . GetBytes ( fakeNode ) ;
You can’t perform that action at this time.
0 commit comments