revert some code in pr 962

Signed-off-by: arthur-zhang <zhangya_no1@qq.com>
This commit is contained in:
arthur-zhang 2023-11-14 10:04:18 +08:00
parent 93a1b3d0e7
commit f90ac41ae4

View File

@ -240,7 +240,7 @@ func calcGateways(result *current.Result, n *NetConf) (*gwInfo, *gwInfo, error)
// Add a default route for this family using the current
// gateway address if necessary.
if n.IsDefaultGW {
if n.IsDefaultGW && !gws.defaultRouteFound {
for _, route := range result.Routes {
if route.GW != nil && defaultNet.String() == route.Dst.String() {
gws.defaultRouteFound = true