File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 4
4
using System . Net ;
5
5
using Microsoft . Extensions . Logging ;
6
6
using System . Diagnostics ;
7
+ using System . Text . Json ;
8
+ using System . Runtime . InteropServices ;
7
9
8
10
namespace SangServerTool
9
11
{
@@ -51,7 +53,16 @@ public static bool isCerWillExp(string certFilePath)
51
53
/// <returns>不用则返回true</returns>
52
54
private static bool IsNotGoodIPv6 ( UnicastIPAddressInformation unicastAddress )
53
55
{
54
- return unicastAddress . Address . IsIPv6LinkLocal || unicastAddress . PrefixOrigin == PrefixOrigin . Dhcp || unicastAddress . SuffixOrigin == SuffixOrigin . Random ;
56
+ // 判断平台
57
+ if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
58
+ {
59
+ return unicastAddress . Address . IsIPv6LinkLocal || unicastAddress . PrefixOrigin == PrefixOrigin . Dhcp || unicastAddress . SuffixOrigin == SuffixOrigin . Random ;
60
+ }
61
+ else
62
+ {
63
+ // 其他暂时这样处理
64
+ return unicastAddress . Address . IsIPv6LinkLocal || unicastAddress . Address . ToString ( ) . Length < 35 ;
65
+ }
55
66
}
56
67
57
68
/// <summary>
You can’t perform that action at this time.
0 commit comments