mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-30 07:57:59 +08:00
fix panic joining non-dual stack network
This commit is contained in:
parent
770a293049
commit
0272e88c0f
1 changed files with 8 additions and 4 deletions
|
|
@ -629,10 +629,14 @@ func (n *Node) Legacy(h *Host, s *ServerConfig, net *Network) *LegacyNode {
|
|||
|
||||
// Node.NetworkSettings updates a node with network settings
|
||||
func (node *Node) NetworkSettings(n Network) {
|
||||
_, cidr, _ := net.ParseCIDR(n.AddressRange)
|
||||
node.NetworkRange = *cidr
|
||||
_, cidr, _ = net.ParseCIDR(n.AddressRange6)
|
||||
node.NetworkRange6 = *cidr
|
||||
_, cidr, err := net.ParseCIDR(n.AddressRange)
|
||||
if err == nil {
|
||||
node.NetworkRange = *cidr
|
||||
}
|
||||
_, cidr, err = net.ParseCIDR(n.AddressRange6)
|
||||
if err == nil {
|
||||
node.NetworkRange6 = *cidr
|
||||
}
|
||||
}
|
||||
|
||||
func parseBool(s string) bool {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue