blob: 27d55f95841d385655547dc223c58bf1db58768e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
From 541f9e712491a358511f8c5efdff039429f78222 Mon Sep 17 00:00:00 2001
From: yuuko <yuuko@partyvan.io>
Date: Sun, 24 Nov 2024 01:21:48 -0800
Subject: [PATCH] NO, NO, AND NO.
---
SteamKit2/SteamKit2/Util/HardwareUtils.cs | 36 +----------------------
1 file changed, 1 insertion(+), 35 deletions(-)
diff --git a/SteamKit2/SteamKit2/Util/HardwareUtils.cs b/SteamKit2/SteamKit2/Util/HardwareUtils.cs
index 78f36466..7c7b942b 100644
--- a/SteamKit2/SteamKit2/Util/HardwareUtils.cs
+++ b/SteamKit2/SteamKit2/Util/HardwareUtils.cs
@@ -276,41 +276,7 @@ namespace SteamKit2
static List<byte[]> GetMacAddresses( bool checkForPhysicalDevice = true )
{
- var netDirectories = Directory.GetDirectories( "/sys/class/net" );
- var macs = new List<byte[]>();
-
- // if /sys/class/net can't be open or is empty, "/proc/net/dev" could be read here
-
- foreach ( var directory in netDirectories )
- {
- var iface = Path.GetFileName( directory );
-
- if ( checkForPhysicalDevice && !Directory.Exists( $"/sys/class/net/{iface}/device" ) )
- {
- continue;
- }
-
- try
- {
- // ioctl could be attempted to read the mac address here
- // Loopback mac address will be decoded to zero here
- var addressText = File.ReadAllText( $"/sys/class/net/{iface}/address" );
- var macAddress = Convert.FromHexString( addressText.Replace( ":", "" ).AsSpan().Trim() );
-
- macs.Add( macAddress );
- }
- catch
- {
- // if we can't read a file, continue to the next
- }
- }
-
- if ( checkForPhysicalDevice && macs.Count == 0 )
- {
- return GetMacAddresses( checkForPhysicalDevice: false );
- }
-
- return macs;
+ return new List<byte[]>();
}
}
--
2.47.0
|