修复个别路由表添加失败导致过程中断的问题

This commit is contained in:
ChsBuffer
2020-09-02 14:58:43 +08:00
parent b3866d1d90
commit fd8185b83e

View File

@@ -358,9 +358,19 @@ namespace Netch.Controllers
Delete
}
private static bool RouteAction(Action action, IEnumerable<IPNetwork> ipNetworks, RouteType routeType, int metric = 0)
private static void RouteAction(Action action, IEnumerable<IPNetwork> ipNetworks, RouteType routeType, int metric = 0)
{
return ipNetworks.All(address => RouteAction(action, address, routeType, metric));
foreach (var address in ipNetworks)
{
try
{
RouteAction(action, address, routeType, metric);
}
catch
{
// ignored
}
}
}
private static bool RouteAction(Action action, string address, byte cidr, RouteType routeType, int metric = 0)