forked from extern/smegmesh
Merge pull request #71 from tim-beatham/66-ipv6-address-not-conforming-to-spec
66 ipv6 address not conforming to spec
This commit is contained in:
commit
c29eb197f3
@ -34,7 +34,7 @@ func NewCtrlServer(params *NewCtrlServerParams) (*MeshCtrlServer, error) {
|
||||
nodeFactory := &crdt.MeshNodeFactory{
|
||||
Config: *params.Conf,
|
||||
}
|
||||
idGenerator := &lib.IDNameGenerator{}
|
||||
idGenerator := &lib.ShortIDGenerator{}
|
||||
ipAllocator := &ip.ULABuilder{}
|
||||
interfaceManipulator := wg.NewWgInterfaceManipulator(params.Client)
|
||||
|
||||
@ -89,7 +89,6 @@ func NewCtrlServer(params *NewCtrlServerParams) (*MeshCtrlServer, error) {
|
||||
return ctrlServer, nil
|
||||
}
|
||||
|
||||
|
||||
func (s *MeshCtrlServer) GetConfiguration() *conf.DaemonConfiguration {
|
||||
return s.Conf
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package lib
|
||||
import (
|
||||
"github.com/anandvarma/namegen"
|
||||
"github.com/google/uuid"
|
||||
"github.com/lithammer/shortuuid"
|
||||
)
|
||||
|
||||
// IdGenerator generates unique ids
|
||||
@ -19,6 +20,14 @@ func (g *UUIDGenerator) GetId() (string, error) {
|
||||
return id.String(), nil
|
||||
}
|
||||
|
||||
type ShortIDGenerator struct {
|
||||
}
|
||||
|
||||
func (g *ShortIDGenerator) GetId() (string, error) {
|
||||
id := shortuuid.New()
|
||||
return id, nil
|
||||
}
|
||||
|
||||
type IDNameGenerator struct {
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"math/rand"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/tim-beatham/wgmesh/pkg/conf"
|
||||
@ -169,12 +170,22 @@ func (s *SyncerImpl) Pull(self mesh.MeshNode, mesh mesh.MeshProvider) error {
|
||||
|
||||
// SyncMeshes: Sync all meshes
|
||||
func (s *SyncerImpl) SyncMeshes() error {
|
||||
for _, mesh := range s.manager.GetMeshes() {
|
||||
err := s.Sync(mesh)
|
||||
var wg sync.WaitGroup
|
||||
|
||||
if err != nil {
|
||||
logging.Log.WriteErrorf(err.Error())
|
||||
for _, mesh := range s.manager.GetMeshes() {
|
||||
wg.Add(1)
|
||||
|
||||
sync := func() {
|
||||
defer wg.Done()
|
||||
|
||||
err := s.Sync(mesh)
|
||||
|
||||
if err != nil {
|
||||
logging.Log.WriteErrorf(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
go sync()
|
||||
}
|
||||
|
||||
logging.Log.WriteInfof("updating the WireGuard configuration")
|
||||
|
Loading…
Reference in New Issue
Block a user