Skip to content

Commit

Permalink
fix no interface report to multus cni, missing in k8s.v1.cni.cncf.io/…
Browse files Browse the repository at this point in the history
…network[s]-status (#1636)

(cherry picked from commit 3d82780)
  • Loading branch information
halfcrazy authored and oilbeater committed Jun 25, 2022
1 parent fe5e020 commit 73a53ba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/cni/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ func parseValueFromArgs(key, argString string) (string, error) {

func assignV4Address(ipAddress, gateway string, mask *net.IPNet) (*current.IPConfig, *types.Route) {
ip := &current.IPConfig{
Address: net.IPNet{IP: net.ParseIP(ipAddress).To4(), Mask: mask.Mask},
Gateway: net.ParseIP(gateway).To4(),
Address: net.IPNet{IP: net.ParseIP(ipAddress).To4(), Mask: mask.Mask},
Gateway: net.ParseIP(gateway).To4(),
Interface: current.Int(0),
}

var route *types.Route
Expand All @@ -218,8 +219,9 @@ func assignV4Address(ipAddress, gateway string, mask *net.IPNet) (*current.IPCon

func assignV6Address(ipAddress, gateway string, mask *net.IPNet) (*current.IPConfig, *types.Route) {
ip := &current.IPConfig{
Address: net.IPNet{IP: net.ParseIP(ipAddress).To16(), Mask: mask.Mask},
Gateway: net.ParseIP(gateway).To16(),
Address: net.IPNet{IP: net.ParseIP(ipAddress).To16(), Mask: mask.Mask},
Gateway: net.ParseIP(gateway).To16(),
Interface: current.Int(0),
}

var route *types.Route
Expand Down

0 comments on commit 73a53ba

Please sign in to comment.