From 5ec1988029f6129fbc9527008410c6e903c305ec Mon Sep 17 00:00:00 2001 From: Gregory Kurtzer Date: Sat, 19 Dec 2020 21:03:44 -0800 Subject: [PATCH] Use the new network instead of doing this logic in the CLI --- internal/app/wwctl/configure/dhcp/main.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/internal/app/wwctl/configure/dhcp/main.go b/internal/app/wwctl/configure/dhcp/main.go index 456b9388..61829c3f 100644 --- a/internal/app/wwctl/configure/dhcp/main.go +++ b/internal/app/wwctl/configure/dhcp/main.go @@ -2,13 +2,11 @@ package dhcp import ( "fmt" - "github.com/brotherpowers/ipsubnet" "github.com/hpcng/warewulf/internal/pkg/node" "github.com/hpcng/warewulf/internal/pkg/util" "github.com/hpcng/warewulf/internal/pkg/warewulfconf" "github.com/hpcng/warewulf/internal/pkg/wwlog" "github.com/spf13/cobra" - "net" "os" "path" "strings" @@ -99,14 +97,9 @@ func Configure(show bool) error { os.Exit(1) } - mask := net.IPMask(net.ParseIP(controller.Netmask).To4()) - size, _ := mask.Size() - - sub := ipsubnet.SubnetCalculator(controller.Ipaddr, size) - d.Ipaddr = controller.Ipaddr - d.Network = sub.GetNetworkPortion() - d.Netmask = sub.GetSubnetMask() + d.Network = controller.Network + d.Netmask = controller.Netmask d.RangeStart = controller.Dhcp.RangeStart d.RangeEnd = controller.Dhcp.RangeEnd