mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-08 07:41:41 +08:00
logic/extpeers: Set IPv6 in CreateExtClient
Signed-off-by: John Sahhar <john@gravitl.com>
This commit is contained in:
parent
644567f48a
commit
d322631ebb
1 changed files with 9 additions and 2 deletions
|
|
@ -133,6 +133,14 @@ func CreateExtClient(extclient *models.ExtClient) error {
|
|||
extclient.Address = newAddress
|
||||
}
|
||||
|
||||
if extclient.Address6 == "" {
|
||||
addr6, err := UniqueAddress6(extclient.Network)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
extclient.Address6 = addr6
|
||||
}
|
||||
|
||||
if extclient.ClientID == "" {
|
||||
extclient.ClientID = models.GenerateNodeName()
|
||||
}
|
||||
|
|
@ -150,8 +158,7 @@ func CreateExtClient(extclient *models.ExtClient) error {
|
|||
if err = database.Insert(key, string(data), database.EXT_CLIENT_TABLE_NAME); err != nil {
|
||||
return err
|
||||
}
|
||||
err = SetNetworkNodesLastModified(extclient.Network)
|
||||
return err
|
||||
return SetNetworkNodesLastModified(extclient.Network)
|
||||
}
|
||||
|
||||
// UpdateExtClient - only supports name changes right now
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue