mirror of
https://github.com/snltty/linker.git
synced 2025-12-19 09:56:46 +08:00
优化系统重启自动启动网卡
This commit is contained in:
33
.github/workflows/dotnet.yml
vendored
33
.github/workflows/dotnet.yml
vendored
@@ -48,16 +48,13 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: '${{ secrets.ACTIONS_TOKEN }}'
|
||||
with:
|
||||
tag_name: v1.2.0.6
|
||||
release_name: v1.2.0.6.${{ steps.date.outputs.today }}
|
||||
tag_name: v1.2.0.7
|
||||
release_name: v1.2.0.7.${{ steps.date.outputs.today }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
body: |
|
||||
1. 显示虚拟网卡ping值
|
||||
2. 修复UDP打洞,UDP端口映射,UDP打洞加密
|
||||
3. 更改虚拟网卡打洞逻辑
|
||||
4. 先更新客户端,再更新服务端
|
||||
5. 更新服务端,更新服务端,更新服务端
|
||||
1. 优化重启系统后网卡自动启动逻辑
|
||||
2. Web UI 优化
|
||||
|
||||
- name: upload win x86 oss
|
||||
id: upload-win-x86-oss
|
||||
@@ -68,7 +65,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.2.0.6/linker-win-x86.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-win-x86.zip
|
||||
|
||||
- name: upload win x86
|
||||
id: upload-win-x86
|
||||
@@ -90,7 +87,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.2.0.6/linker-win-x64.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-win-x64.zip
|
||||
|
||||
- name: upload win x64
|
||||
id: upload-win-x64
|
||||
@@ -112,7 +109,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.2.0.6/linker-win-arm64.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-win-arm64.zip
|
||||
|
||||
- name: upload win arm64
|
||||
id: upload-win-arm64
|
||||
@@ -134,7 +131,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.2.0.6/linker-linux-x64.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-linux-x64.zip
|
||||
|
||||
- name: upload linux x64
|
||||
id: upload-linux-x64
|
||||
@@ -156,7 +153,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.2.0.6/linker-linux-arm.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-linux-arm.zip
|
||||
|
||||
- name: upload linux arm
|
||||
id: upload-linux-arm
|
||||
@@ -178,7 +175,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.2.0.6/linker-linux-arm64.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-linux-arm64.zip
|
||||
|
||||
- name: upload linux arm64
|
||||
id: upload-linux-arm64
|
||||
@@ -200,7 +197,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.2.0.6/linker-linux-musl-x64.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-linux-musl-x64.zip
|
||||
|
||||
- name: upload linux musl x64
|
||||
id: upload-linux-musl-x64
|
||||
@@ -222,7 +219,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.2.0.6/linker-linux-musl-arm.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-linux-musl-arm.zip
|
||||
|
||||
- name: upload linux musl arm
|
||||
id: upload-linux-musl-arm
|
||||
@@ -244,7 +241,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.2.0.6/linker-linux-musl-arm64.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-linux-musl-arm64.zip
|
||||
|
||||
- name: upload linux musl arm64
|
||||
id: upload-linux-musl-arm64
|
||||
@@ -266,7 +263,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.2.0.6/linker-osx-x64.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-osx-x64.zip
|
||||
|
||||
- name: upload osx x64
|
||||
id: upload-osx-x64
|
||||
@@ -288,7 +285,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.2.0.6/linker-osx-arm64.zip
|
||||
target-path: /downloads/linker/v1.2.0.7/linker-osx-arm64.zip
|
||||
|
||||
- name: upload osx arm64
|
||||
id: upload-osx-arm64
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
<Version>1.2.0</Version>
|
||||
<AssemblyVersion>1.2.0.6</AssemblyVersion>
|
||||
<FileVersion>1.2.0.6</FileVersion>
|
||||
<AssemblyVersion>1.2.0.7</AssemblyVersion>
|
||||
<FileVersion>1.2.0.7</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>full</DebugType>
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
<PackageReleaseNotes>linker tun</PackageReleaseNotes>
|
||||
<AssemblyVersion>1.2.0.6</AssemblyVersion>
|
||||
<FileVersion>1.2.0.6</FileVersion>
|
||||
<AssemblyVersion>1.2.0.7</AssemblyVersion>
|
||||
<FileVersion>1.2.0.7</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Collections.Concurrent;
|
||||
using System.Net.Sockets;
|
||||
using System.Net;
|
||||
using linker.tunnel.wanport;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace linker.tunnel
|
||||
{
|
||||
@@ -43,21 +44,32 @@ namespace linker.tunnel
|
||||
}
|
||||
|
||||
var transportItems = tunnelAdapter.GetTunnelTransports();
|
||||
var names = transportItems.Select(c => c.Name);
|
||||
transportItems = transportItems.Concat(transports.Select(c => new TunnelTransportItemInfo
|
||||
//有新的协议
|
||||
var newTransportNames = transports.Select(c => c.Name).Except(transportItems.Select(c => c.Name));
|
||||
if (newTransportNames.Any())
|
||||
{
|
||||
Label = c.Label,
|
||||
Name = c.Name,
|
||||
ProtocolType = c.ProtocolType.ToString(),
|
||||
Reverse = c.Reverse,
|
||||
DisableReverse = c.DisableReverse,
|
||||
SSL = c.SSL,
|
||||
DisableSSL = c.DisableSSL
|
||||
}))
|
||||
.Distinct(new TunnelTransportItemInfoEqualityComparer())
|
||||
.Where(c => transports.Select(c => c.Name).Contains(c.Name))
|
||||
.ToList();
|
||||
|
||||
transportItems.AddRange(transports.Where(c => newTransportNames.Contains(c.Name)).Select(c => new TunnelTransportItemInfo
|
||||
{
|
||||
Label = c.Label,
|
||||
Name = c.Name,
|
||||
ProtocolType = c.ProtocolType.ToString(),
|
||||
Reverse = c.Reverse,
|
||||
DisableReverse = c.DisableReverse,
|
||||
SSL = c.SSL,
|
||||
DisableSSL = c.DisableSSL,
|
||||
Order = c.Order
|
||||
}));
|
||||
}
|
||||
//有已移除的协议
|
||||
var oldTransportNames = transportItems.Select(c => c.Name).Except(transports.Select(c => c.Name));
|
||||
if (oldTransportNames.Any())
|
||||
{
|
||||
foreach (var item in transportItems.Where(c => oldTransportNames.Contains(c.Name)))
|
||||
{
|
||||
transportItems.Remove(item);
|
||||
}
|
||||
}
|
||||
//强制更新一些信息
|
||||
foreach (var item in transportItems)
|
||||
{
|
||||
var transport = transports.FirstOrDefault(c => c.Name == item.Name);
|
||||
@@ -82,10 +94,8 @@ namespace linker.tunnel
|
||||
}
|
||||
}
|
||||
|
||||
tunnelAdapter.SetTunnelTransports(transportItems, names.SequenceEqual(transportItems.Select(c => c.Name)) == false);
|
||||
|
||||
tunnelAdapter.SetTunnelTransports(transportItems, true);
|
||||
LoggerHelper.Instance.Warning($"load tunnel transport:{string.Join(",", transports.Select(c => c.Name))}");
|
||||
LoggerHelper.Instance.Warning($"used tunnel transport:{string.Join(",", transportItems.Where(c => c.Disabled == false).Select(c => c.Name))}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
<PackageReleaseNotes>linker tunnel</PackageReleaseNotes>
|
||||
<AssemblyVersion>1.2.0.6</AssemblyVersion>
|
||||
<FileVersion>1.2.0.6</FileVersion>
|
||||
<AssemblyVersion>1.2.0.7</AssemblyVersion>
|
||||
<FileVersion>1.2.0.7</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="status-api-wrap" :class="{connected:connected}">
|
||||
<el-popconfirm confirm-button-text="清除" cancel-button-text="更改" title="确定你的操作?" @cancel="handleShow" @confirm="handleResetConnect" >
|
||||
<template #reference>
|
||||
<a href="javascript:;" >
|
||||
<a href="javascript:;" title="此设备的管理接口">
|
||||
<el-icon size="16"><Tools /></el-icon>
|
||||
管理接口
|
||||
</a>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="status-server-wrap" :class="{ connected: state.connected }">
|
||||
<a href="javascript:;" @click="handleConfig"> <el-icon size="16"><Promotion /></el-icon> 信标服务器</a>
|
||||
<a href="javascript:;" @click="handleUpdate" class="download" :title="updateText()" :class="updateColor()">
|
||||
<a href="javascript:;" title="更改你的连接设置" @click="handleConfig"> <el-icon size="16"><Promotion /></el-icon> 信标服务器</a>
|
||||
<a href="javascript:;" title="服务端的程序版本" @click="handleUpdate" class="download" :title="updateText()" :class="updateColor()">
|
||||
<span>{{state.version}}</span>
|
||||
<template v-if="updaterCurrent.Version">
|
||||
<template v-if="updaterCurrent.Status == 1">
|
||||
|
||||
@@ -19,15 +19,15 @@
|
||||
<img v-if="tuntap.list[scope.row.MachineId].systemDocker" class="system" src="/docker.svg" />
|
||||
</span>
|
||||
</template>
|
||||
<a href="javascript:;" @click="handleEdit(scope.row)" :class="{green:scope.row.Connected}">{{scope.row.MachineName }}</a>
|
||||
<a href="javascript:;" title="此客户端的设备名" @click="handleEdit(scope.row)" :class="{green:scope.row.Connected}">{{scope.row.MachineName }}</a>
|
||||
<strong v-if="scope.row.isSelf"> - (<el-icon><StarFilled /></el-icon> 本机) </strong>
|
||||
</p>
|
||||
<p class="flex">
|
||||
<template v-if="scope.row.showip">
|
||||
<span class="ipaddress"><span>{{ scope.row.IP }}</span> <el-icon @click="scope.row.showip=flase"><View /></el-icon></span>
|
||||
<span title="此设备的外网IP端口" class="ipaddress"><span>{{ scope.row.IP }}</span> <el-icon @click="scope.row.showip=flase"><View /></el-icon></span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="ipaddress"><span>{{ scope.row.IP.replace(/(\d+\.\d+\.\d+\.\d+)/,'***.***.***.***') }}</span> <el-icon @click="scope.row.showip=true"><Hide /></el-icon></span>
|
||||
<span title="此设备的外网IP端口" class="ipaddress"><span>{{ scope.row.IP.replace(/(\d+\.\d+\.\d+\.\d+)/,'***.***.***.***') }}</span> <el-icon @click="scope.row.showip=true"><Hide /></el-icon></span>
|
||||
</template>
|
||||
<span class="flex-1"></span>
|
||||
<a href="javascript:;" class="download" @click="handleUpdate(scope.row)" :title="updateText(scope.row)" :class="updateColor(scope.row)">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li><a href="javascript:;" @click="handleEdit(scope.row.MachineId)">暂无配置</a></li>
|
||||
<li><a href="javascript:;" title="管理你的端口转发" @click="handleEdit(scope.row.MachineId)">暂无配置</a></li>
|
||||
</template>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -43,7 +43,7 @@
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li><a href="javascript:;" @click="handleSEdit()">暂无配置</a></li>
|
||||
<li><a href="javascript:;" title="管理你的服务器穿透" @click="handleSEdit()">暂无配置</a></li>
|
||||
</template>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<div v-if="tunnel.list[scope.row.MachineId]">
|
||||
<a href="javascript:;" class="a-line"
|
||||
:class="{yellow:tunnel.list[scope.row.MachineId].NeedReboot}"
|
||||
:title="tunnel.list[scope.row.MachineId].NeedReboot?'需要重启':''"
|
||||
:title="tunnel.list[scope.row.MachineId].NeedReboot?'需要重启':'调整网关层级有助于打洞成功'"
|
||||
@click="handleTunnel(tunnel.list[scope.row.MachineId])">
|
||||
<span>网关 : {{tunnel.list[scope.row.MachineId].RouteLevel}} + {{tunnel.list[scope.row.MachineId].RouteLevelPlus}}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="javascript:;" class="a-line" :class="{green:connectionCount(scope.row.MachineId)>0}" @click="handleConnections(scope.row.MachineId)">
|
||||
<a href="javascript:;" title="与此设备的隧道连接" class="a-line" :class="{green:connectionCount(scope.row.MachineId)>0}" @click="handleConnections(scope.row.MachineId)">
|
||||
连接数 : <span>{{connectionCount(scope.row.MachineId)}}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div v-if="tuntap.list[scope.row.MachineId]">
|
||||
<div class="flex">
|
||||
<div class="flex-1">
|
||||
<a href="javascript:;" class="a-line" @click="handleTuntapIP(tuntap.list[scope.row.MachineId])" :title="tuntap.list[scope.row.MachineId].Gateway?'我在路由器上,所以略有不同':''">
|
||||
<a href="javascript:;" class="a-line" @click="handleTuntapIP(tuntap.list[scope.row.MachineId])" :title="tuntap.list[scope.row.MachineId].Gateway?'我在路由器上,所以略有不同':'此设备的虚拟网卡IP'">
|
||||
<template v-if="tuntap.list[scope.row.MachineId].Error">
|
||||
<el-popover placement="top" title="msg" width="20rem" trigger="hover" :content="tuntap.list[scope.row.MachineId].Error">
|
||||
<template #reference>
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
<PackageReleaseNotes>linker</PackageReleaseNotes>
|
||||
<AssemblyVersion>1.2.0.6</AssemblyVersion>
|
||||
<FileVersion>1.2.0.6</FileVersion>
|
||||
<AssemblyVersion>1.2.0.7</AssemblyVersion>
|
||||
<FileVersion>1.2.0.7</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using linker.plugins.messenger;
|
||||
using linker.tun;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace linker.plugins.client
|
||||
@@ -8,6 +9,13 @@ namespace linker.plugins.client
|
||||
/// </summary>
|
||||
public sealed class ClientSignInState
|
||||
{
|
||||
|
||||
public ClientSignInState()
|
||||
{
|
||||
AppDomain.CurrentDomain.ProcessExit += (s, e) => Disponse();
|
||||
Console.CancelKeyPress += (s, e) => Disponse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 登入服务器的连接对象
|
||||
/// </summary>
|
||||
@@ -44,5 +52,10 @@ namespace linker.plugins.client
|
||||
NetworkEnabledHandle?.Invoke(networdkEnabledTimes);
|
||||
networdkEnabledTimes++;
|
||||
}
|
||||
|
||||
public void Disponse()
|
||||
{
|
||||
Connection?.Disponse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,9 +44,8 @@ namespace linker.plugins.tuntap
|
||||
this.config = config;
|
||||
this.tuntapProxy = tuntapProxy;
|
||||
this.runningConfig = runningConfig;
|
||||
|
||||
linkerTunDeviceAdapter.Initialize(deviceName, tuntapProxy);
|
||||
linkerTunDeviceAdapter.Shutdown();
|
||||
linkerTunDeviceAdapter.Clear();
|
||||
AppDomain.CurrentDomain.ProcessExit += (s, e) => linkerTunDeviceAdapter.Shutdown();
|
||||
Console.CancelKeyPress += (s, e) => linkerTunDeviceAdapter.Shutdown();
|
||||
clientSignInState.NetworkFirstEnabledHandle += Initialize;
|
||||
@@ -56,12 +55,16 @@ namespace linker.plugins.tuntap
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
LoggerHelper.Instance.Debug($"tuntap initialize");
|
||||
linkerTunDeviceAdapter.Shutdown();
|
||||
linkerTunDeviceAdapter.Clear();
|
||||
NetworkHelper.GetRouteLevel(config.Data.Client.Server, out routeIps);
|
||||
NotifyConfig();
|
||||
CheckTuntapStatusTask();
|
||||
PingTask();
|
||||
if (runningConfig.Data.Tuntap.Running)
|
||||
{
|
||||
LoggerHelper.Instance.Debug($"tuntap should be run");
|
||||
Setup();
|
||||
}
|
||||
});
|
||||
@@ -105,7 +108,6 @@ namespace linker.plugins.tuntap
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void SetupBefore()
|
||||
{
|
||||
NotifyConfig();
|
||||
@@ -302,14 +304,18 @@ namespace linker.plugins.tuntap
|
||||
/// </summary>
|
||||
private void AddForward()
|
||||
{
|
||||
linkerTunDeviceAdapter.AddForward(runningConfig.Data.Tuntap.Forwards.Select(c => new LinkerTunDeviceForwardItem { ListenAddr = c.ListenAddr, ListenPort = c.ListenPort, ConnectAddr = c.ConnectAddr, ConnectPort = c.ConnectPort }).ToList());
|
||||
linkerTunDeviceAdapter.AddForward(ParseForwardItems());
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除端口转发
|
||||
/// </summary>
|
||||
private void DeleteForward()
|
||||
{
|
||||
linkerTunDeviceAdapter.RemoveForward(runningConfig.Data.Tuntap.Forwards.Select(c => new LinkerTunDeviceForwardItem { ListenAddr = c.ListenAddr, ListenPort = c.ListenPort, ConnectAddr = c.ConnectAddr, ConnectPort = c.ConnectPort }).ToList());
|
||||
linkerTunDeviceAdapter.RemoveForward(ParseForwardItems());
|
||||
}
|
||||
private List<LinkerTunDeviceForwardItem> ParseForwardItems()
|
||||
{
|
||||
return runningConfig.Data.Tuntap.Forwards.Select(c => new LinkerTunDeviceForwardItem { ListenAddr = c.ListenAddr, ListenPort = c.ListenPort, ConnectAddr = c.ConnectAddr, ConnectPort = c.ConnectPort }).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -322,6 +328,7 @@ namespace linker.plugins.tuntap
|
||||
List<TuntapVeaLanIPAddressList> ipsList = ParseIPs(tuntapInfos.Values.ToList());
|
||||
TuntapVeaLanIPAddress[] ips = ipsList.SelectMany(c => c.IPS).ToArray();
|
||||
var items = ipsList.SelectMany(c => c.IPS).Select(c => new LinkerTunDeviceRouteItem { Address = c.OriginIPAddress, PrefixLength = c.MaskLength }).ToArray();
|
||||
|
||||
linkerTunDeviceAdapter.DelRoute(items, (runningConfig.Data.Tuntap.Switch & TuntapSwitch.Gateway) == TuntapSwitch.Gateway);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -336,8 +343,8 @@ namespace linker.plugins.tuntap
|
||||
{
|
||||
List<TuntapVeaLanIPAddressList> ipsList = ParseIPs(tuntapInfos.Values.ToList());
|
||||
TuntapVeaLanIPAddress[] ips = ipsList.SelectMany(c => c.IPS).ToArray();
|
||||
|
||||
var items = ipsList.SelectMany(c => c.IPS).Select(c => new LinkerTunDeviceRouteItem { Address = c.OriginIPAddress, PrefixLength = c.MaskLength }).ToArray();
|
||||
|
||||
linkerTunDeviceAdapter.AddRoute(items, runningConfig.Data.Tuntap.IP, (runningConfig.Data.Tuntap.Switch & TuntapSwitch.Gateway) == TuntapSwitch.Gateway);
|
||||
|
||||
tuntapProxy.SetIPs(ipsList);
|
||||
@@ -420,7 +427,7 @@ namespace linker.plugins.tuntap
|
||||
if (await InterfaceAvailable() == false && operatingManager.Operating == false)
|
||||
{
|
||||
LoggerHelper.Instance.Error($"tuntap inerface {deviceName} is down, restarting");
|
||||
Shutdown();
|
||||
linkerTunDeviceAdapter.Shutdown();
|
||||
await Task.Delay(5000).ConfigureAwait(false);
|
||||
if (await InterfaceAvailable() == false && operatingManager.Operating == false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user