set not ipv6 if no ipv4 present

This commit is contained in:
Christian Goll
2022-03-31 13:56:58 +02:00
committed by Christian Goll
parent 29fa839175
commit 16fa2518fa

View File

@@ -117,7 +117,7 @@ func (config *nodeYaml) FindAllNodes() ([]NodeInfo, error) {
n.NetDevs[devname].Ipaddr6.Set(netdev.Ipaddr6)
// Derive value of ipv6 address from ipv4 if not explicitly set
if wwconfig.Ipaddr6 != "" {
if wwconfig.Ipaddr6 != "" && netdev.Ipaddr != "" {
ipv4Arr := strings.Split(netdev.Ipaddr, ".")
// error can be ignored as check was done at init
_, ipv6Net, _ := net.ParseCIDR(wwconfig.Ipaddr6)