mirror of
https://github.com/netchx/netch.git
synced 2026-04-05 19:45:05 +08:00
修复个别路由表添加失败导致过程中断的问题
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user