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 26, 2024
1 parent 12c4711 commit fa158b9
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 @@ -454,7 +454,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

Check warning on line 460 in pkg/networkengine/routedriver/vxlan/vxlan.go

View check run for this annotation

Codecov / codecov/patch

pkg/networkengine/routedriver/vxlan/vxlan.go#L459-L460

Added lines #L459 - L460 were not covered by tests
}
ones, _ := ipNet.Mask.Size()
entry := &netlink.IPSetEntry{
IP: ipNet.IP,
Expand Down

0 comments on commit fa158b9

Please sign in to comment.