修复虚拟网卡

This commit is contained in:
snltty
2024-09-16 01:39:48 +08:00
parent 7ce0a9d558
commit d6a182688d
21 changed files with 62 additions and 61 deletions

View File

@@ -33,11 +33,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
with:
tag_name: v1.3.6
release_name: v1.3.6.${{ steps.date.outputs.today }}
tag_name: v1.3.7
release_name: v1.3.7.${{ steps.date.outputs.today }}
draft: false
prerelease: false
body: "1. 重构中继\r\n2. 修复断网导致的CPU溢出\r\n3. action用于动态验证当服务端设置action url时在登入中继穿透时将执行post\r\n4. 增加信标服务器密钥,服务端设置密钥时,客户端连接信标服务器需要提供密钥\r\n5. 先更新服务端,先更新服务端,先更新服务端"
body: 1. 修复首次启动客户端时虚拟网卡路由不到目标客户端的BUG
- name: upload-win-x86-oss
id: upload-win-x86-oss
uses: tvrcgo/oss-action@v0.1.1
@@ -47,7 +47,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-win-x86.zip
target-path: /downloads/linker/v1.3.6/linker-win-x86.zip
target-path: /downloads/linker/v1.3.7/linker-win-x86.zip
- name: upload-win-x86
id: upload-win-x86
uses: actions/upload-release-asset@master
@@ -67,7 +67,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-win-x64.zip
target-path: /downloads/linker/v1.3.6/linker-win-x64.zip
target-path: /downloads/linker/v1.3.7/linker-win-x64.zip
- name: upload-win-x64
id: upload-win-x64
uses: actions/upload-release-asset@master
@@ -87,7 +87,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-win-arm64.zip
target-path: /downloads/linker/v1.3.6/linker-win-arm64.zip
target-path: /downloads/linker/v1.3.7/linker-win-arm64.zip
- name: upload-win-arm64
id: upload-win-arm64
uses: actions/upload-release-asset@master
@@ -107,7 +107,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-linux-x64.zip
target-path: /downloads/linker/v1.3.6/linker-linux-x64.zip
target-path: /downloads/linker/v1.3.7/linker-linux-x64.zip
- name: upload-linux-x64
id: upload-linux-x64
uses: actions/upload-release-asset@master
@@ -127,7 +127,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-linux-arm.zip
target-path: /downloads/linker/v1.3.6/linker-linux-arm.zip
target-path: /downloads/linker/v1.3.7/linker-linux-arm.zip
- name: upload-linux-arm
id: upload-linux-arm
uses: actions/upload-release-asset@master
@@ -147,7 +147,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-linux-arm64.zip
target-path: /downloads/linker/v1.3.6/linker-linux-arm64.zip
target-path: /downloads/linker/v1.3.7/linker-linux-arm64.zip
- name: upload-linux-arm64
id: upload-linux-arm64
uses: actions/upload-release-asset@master
@@ -167,7 +167,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-linux-musl-x64.zip
target-path: /downloads/linker/v1.3.6/linker-linux-musl-x64.zip
target-path: /downloads/linker/v1.3.7/linker-linux-musl-x64.zip
- name: upload-linux-musl-x64
id: upload-linux-musl-x64
uses: actions/upload-release-asset@master
@@ -187,7 +187,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-linux-musl-arm.zip
target-path: /downloads/linker/v1.3.6/linker-linux-musl-arm.zip
target-path: /downloads/linker/v1.3.7/linker-linux-musl-arm.zip
- name: upload-linux-musl-arm
id: upload-linux-musl-arm
uses: actions/upload-release-asset@master
@@ -207,7 +207,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-linux-musl-arm64.zip
target-path: /downloads/linker/v1.3.6/linker-linux-musl-arm64.zip
target-path: /downloads/linker/v1.3.7/linker-linux-musl-arm64.zip
- name: upload-linux-musl-arm64
id: upload-linux-musl-arm64
uses: actions/upload-release-asset@master
@@ -227,7 +227,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-osx-x64.zip
target-path: /downloads/linker/v1.3.6/linker-osx-x64.zip
target-path: /downloads/linker/v1.3.7/linker-osx-x64.zip
- name: upload-osx-x64
id: upload-osx-x64
uses: actions/upload-release-asset@master
@@ -247,7 +247,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-osx-arm64.zip
target-path: /downloads/linker/v1.3.6/linker-osx-arm64.zip
target-path: /downloads/linker/v1.3.7/linker-osx-arm64.zip
- name: upload-osx-arm64
id: upload-osx-arm64
uses: actions/upload-release-asset@master
@@ -277,7 +277,7 @@ jobs:
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
bucket: ide-qbcode
asset-path: ./public/publish-zip/linker-windows-route.zip
target-path: /downloads/linker/v1.3.6/linker-windows-route.zip
target-path: /downloads/linker/v1.3.7/linker-windows-route.zip
- name: upload-windows-route
id: upload-windows-route
uses: actions/upload-release-asset@master

View File

@@ -38,6 +38,6 @@ jobs:
- name: Push
run: |
nuget push ./linker.tunnel/bin/release/linker.tunnel.1.3.6.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
nuget push ./linker.libs/bin/release/linker.libs.1.3.6.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
nuget push ./linker.tun/bin/release/linker.tun.1.3.6.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
nuget push ./linker.tunnel/bin/release/linker.tunnel.1.3.7.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
nuget push ./linker.libs/bin/release/linker.libs.1.3.7.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
nuget push ./linker.tun/bin/release/linker.tun.1.3.7.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol

View File

@@ -14,9 +14,9 @@
<Copyright>snltty</Copyright>
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
<Version>1.3.6</Version>
<AssemblyVersion>1.3.6</AssemblyVersion>
<FileVersion>1.3.6</FileVersion>
<Version>1.3.7</Version>
<AssemblyVersion>1.3.7</AssemblyVersion>
<FileVersion>1.3.7</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>

View File

@@ -16,9 +16,9 @@
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
<PackageReleaseNotes>linker tun</PackageReleaseNotes>
<Version>1.3.6</Version>
<AssemblyVersion>1.3.6</AssemblyVersion>
<FileVersion>1.3.6</FileVersion>
<Version>1.3.7</Version>
<AssemblyVersion>1.3.7</AssemblyVersion>
<FileVersion>1.3.7</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -16,9 +16,9 @@
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
<PackageReleaseNotes>linker tunnel</PackageReleaseNotes>
<Version>1.3.6</Version>
<AssemblyVersion>1.3.6</AssemblyVersion>
<FileVersion>1.3.6</FileVersion>
<Version>1.3.7</Version>
<AssemblyVersion>1.3.7</AssemblyVersion>
<FileVersion>1.3.7</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -19,18 +19,14 @@
<Title>linker</Title>
<Authors>snltty</Authors>
<Company>snltty</Company>
<Description>1. 重构中继
2. 修复断网导致的CPU溢出
3. action用于动态验证当服务端设置action url时在登入中继穿透时将执行post
4. 增加信标服务器密钥,服务端设置密钥时,客户端连接信标服务器需要提供密钥
5. 先更新服务端,先更新服务端,先更新服务端</Description>
<Description>1. 修复首次启动客户端时虚拟网卡路由不到目标客户端的BUG</Description>
<Copyright>snltty</Copyright>
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
<PackageReleaseNotes>linker</PackageReleaseNotes>
<Version>1.3.6</Version>
<AssemblyVersion>1.3.6</AssemblyVersion>
<FileVersion>1.3.6</FileVersion>
<Version>1.3.7</Version>
<AssemblyVersion>1.3.7</AssemblyVersion>
<FileVersion>1.3.7</FileVersion>
</PropertyGroup>

View File

@@ -39,6 +39,8 @@ namespace linker.plugins.tuntap
private OperatingManager operatingManager = new OperatingManager();
public TuntapStatus Status => operatingManager.Operating ? TuntapStatus.Operating : (TuntapStatus)(byte)linkerTunDeviceAdapter.Status;
private readonly SemaphoreSlim slim = new SemaphoreSlim(1,1);
public TuntapTransfer(MessengerSender messengerSender, ClientSignInState clientSignInState, LinkerTunDeviceAdapter linkerTunDeviceAdapter, FileConfig config, TuntapProxy tuntapProxy, RunningConfig runningConfig)
{
this.messengerSender = messengerSender;
@@ -233,29 +235,39 @@ namespace linker.plugins.tuntap
{
Task.Run(async () =>
{
for (int i = 0; i < 5; i++)
await slim.WaitAsync();
try
{
List<TuntapInfo> list = await GetRemoteInfo().ConfigureAwait(false);
if (list != null)
for (int i = 0; i < 5; i++)
{
DelRoute();
foreach (var item in list)
List<TuntapInfo> list = await GetRemoteInfo().ConfigureAwait(false);
if (list != null)
{
tuntapInfos.AddOrUpdate(item.MachineId, item, (a, b) => item);
}
var removes = tuntapInfos.Keys.Except(list.Select(c => c.MachineId)).ToList();
foreach (var item in removes)
{
if (tuntapInfos.TryGetValue(item, out TuntapInfo tuntapInfo))
DelRoute();
foreach (var item in list)
{
tuntapInfo.Status = TuntapStatus.Normal;
tuntapInfos.AddOrUpdate(item.MachineId, item, (a, b) => item);
}
var removes = tuntapInfos.Keys.Except(list.Select(c => c.MachineId)).ToList();
foreach (var item in removes)
{
if (tuntapInfos.TryGetValue(item, out TuntapInfo tuntapInfo))
{
tuntapInfo.Status = TuntapStatus.Normal;
}
}
Version.Add();
AddRoute();
break;
}
Version.Add();
break;
await Task.Delay(1000);
}
await Task.Delay(1000);
}
catch (Exception)
{
}
slim.Release();
});
}
/// <summary>

View File

@@ -10,6 +10,7 @@ using linker.plugins.tuntap.config;
using linker.tun;
using System.Buffers.Binary;
using linker.plugins.client;
using System.Net.Sockets;
namespace linker.plugins.tuntap.proxy
{
@@ -77,8 +78,6 @@ namespace linker.plugins.tuntap.proxy
public async Task Callback(LinkerTunDevicPacket packet)
{
//if(LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG) LoggerHelper.Instance.Debug($"got packet to {packet.Dist}");
//IPV4广播组播
if (packet.IPV4Broadcast)
{
@@ -108,7 +107,6 @@ namespace linker.plugins.tuntap.proxy
return;
}
//if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG) LoggerHelper.Instance.Debug($"got packet to {packet.Dist} 1");
_ = ConnectTunnel(ip).ContinueWith((result, state) =>
{
operatingMultipleManager.StopOperation((uint)state);
@@ -119,7 +117,6 @@ namespace linker.plugins.tuntap.proxy
}, ip);
return;
}
//if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG) LoggerHelper.Instance.Debug($"got packet to {packet.Dist} 2")
await connection.SendAsync(packet.Packet);
}

View File

@@ -1,7 +1,3 @@
v1.3.6
2024-09-15 10:11:05
1. 重构中继
2. 修复断网导致的CPU溢出
3. action用于动态验证当服务端设置action url时在登入中继穿透时将执行post
4. 增加信标服务器密钥,服务端设置密钥时,客户端连接信标服务器需要提供密钥
5. 先更新服务端,先更新服务端,先更新服务端
v1.3.7
2024-09-16 01:39:48
1. 修复首次启动客户端时虚拟网卡路由不到目标客户端的BUG