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

Commit dde033d

Browse files
committed
Fix calculating machine fingerprint.
Start from the fastest NIC (`OrderByDescending` instead of `OrderBy`) and check for length of `>= 12` instead of `> 12`. This results in a better machine identifier on my machine at least.
1 parent 8a9c8aa commit dde033d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GitHub.Api/ApiClientConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ static string GetMachineIdentifier()
6161
{
6262
// adapted from http://stackoverflow.com/a/1561067
6363
var fastedValidNetworkInterface = NetworkInterface.GetAllNetworkInterfaces()
64-
.OrderBy(nic => nic.Speed)
64+
.OrderByDescending(nic => nic.Speed)
6565
.Where(nic => nic.OperationalStatus == OperationalStatus.Up)
6666
.Select(nic => nic.GetPhysicalAddress().ToString())
67-
.FirstOrDefault(address => address.Length > 12);
67+
.FirstOrDefault(address => address.Length >= 12);
6868

6969
return fastedValidNetworkInterface ?? GetMachineNameSafe();
7070
}

0 commit comments

Comments
 (0)