Skip to content

Commit b0b6f44

Browse files
committed
fix
Signed-off-by: clyi <clyi@alauda.io>
1 parent 374bcb2 commit b0b6f44

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

pkg/daemon/controller_linux.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,9 @@ func routeDiff(nodeNicRoutes, allRoutes []netlink.Route, cidrs, joinCIDR []strin
401401
}
402402

403403
found := false
404-
_, cidrNet, _ := net.ParseCIDR(c)
405404
for _, ar := range allRoutes {
406-
if ar.Dst != nil && ar.Dst.String() == cidrNet.String() {
407-
if slices.Contains(joinCIDR, cidrNet.String()) {
405+
if ar.Dst != nil && ar.Dst.String() == c {
406+
if slices.Contains(joinCIDR, c) {
408407
// Only compare Dst for join subnets
409408
found = true
410409
klog.V(3).Infof("[routeDiff] joinCIDR route already exists in allRoutes: %v", ar)
@@ -421,7 +420,7 @@ func routeDiff(nodeNicRoutes, allRoutes []netlink.Route, cidrs, joinCIDR []strin
421420
continue
422421
}
423422
for _, r := range nodeNicRoutes {
424-
if r.Dst == nil || r.Dst.String() != cidrNet.String() {
423+
if r.Dst == nil || r.Dst.String() != c {
425424
continue
426425
}
427426
if (src == nil && r.Src == nil) || (src != nil && r.Src != nil && src.Equal(r.Src)) {

0 commit comments

Comments
 (0)