Skip to content

Commit

Permalink
fix the bug of parse empty cidr
Browse files Browse the repository at this point in the history
  • Loading branch information
珩轩 committed Mar 25, 2024
1 parent f202674 commit d46cb47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/networkengine/routedriver/vxlan/vxlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,11 @@ func (vx *vxlan) calIPSetOnNode(network *types.Network) map[string]*netlink.IPSe
continue
}
for _, srcCIDR := range nodeInfo.Subnets {
_, ipNet, _ := net.ParseCIDR(srcCIDR)
_, ipNet, err := net.ParseCIDR(srcCIDR)
if err != nil {
klog.Errorf("parse node subnet %s error %s", srcCIDR, err.Error())
continue
}
ones, _ := ipNet.Mask.Size()
entry := &netlink.IPSetEntry{
IP: ipNet.IP,
Expand Down

0 comments on commit d46cb47

Please sign in to comment.