From 90cfe820d2bf5efd40c1c67ddb06ca8a8f442d64 Mon Sep 17 00:00:00 2001 From: Tim Beatham Date: Tue, 2 Jan 2024 00:09:31 +0000 Subject: [PATCH] - Fixing errors with stale paths --- cmd/smegd/main.go | 16 ++++++++-------- pkg/automerge/automerge_test.go | 6 +++--- pkg/crdt/datastore_test.go | 6 +++--- pkg/crdt/g_map_test.go | 2 +- pkg/ip/types.go | 2 +- pkg/ip/ula.go | 4 ++-- pkg/mesh/manager.go | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cmd/smegd/main.go b/cmd/smegd/main.go index 226b2d7..a2cab84 100644 --- a/cmd/smegd/main.go +++ b/cmd/smegd/main.go @@ -6,14 +6,14 @@ import ( "os" "os/signal" - "github.com/tim-beatham/wgmesh/pkg/conf" - ctrlserver "github.com/tim-beatham/wgmesh/pkg/ctrlserver" - "github.com/tim-beatham/wgmesh/pkg/ipc" - logging "github.com/tim-beatham/wgmesh/pkg/log" - "github.com/tim-beatham/wgmesh/pkg/mesh" - "github.com/tim-beatham/wgmesh/pkg/robin" - "github.com/tim-beatham/wgmesh/pkg/sync" - timer "github.com/tim-beatham/wgmesh/pkg/timers" + "github.com/tim-beatham/smegmesh/pkg/conf" + ctrlserver "github.com/tim-beatham/smegmesh/pkg/ctrlserver" + "github.com/tim-beatham/smegmesh/pkg/ipc" + logging "github.com/tim-beatham/smegmesh/pkg/log" + "github.com/tim-beatham/smegmesh/pkg/mesh" + "github.com/tim-beatham/smegmesh/pkg/robin" + "github.com/tim-beatham/smegmesh/pkg/sync" + timer "github.com/tim-beatham/smegmesh/pkg/timers" "golang.zx2c4.com/wireguard/wgctrl" ) diff --git a/pkg/automerge/automerge_test.go b/pkg/automerge/automerge_test.go index 66eb1b4..6d88b3d 100644 --- a/pkg/automerge/automerge_test.go +++ b/pkg/automerge/automerge_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/tim-beatham/wgmesh/pkg/conf" - "github.com/tim-beatham/wgmesh/pkg/lib" - "github.com/tim-beatham/wgmesh/pkg/mesh" + "github.com/tim-beatham/smegmesh/pkg/conf" + "github.com/tim-beatham/smegmesh/pkg/lib" + "github.com/tim-beatham/smegmesh/pkg/mesh" "golang.zx2c4.com/wireguard/wgctrl/wgtypes" ) diff --git a/pkg/crdt/datastore_test.go b/pkg/crdt/datastore_test.go index c86ec81..6d9459b 100644 --- a/pkg/crdt/datastore_test.go +++ b/pkg/crdt/datastore_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/tim-beatham/wgmesh/pkg/conf" - "github.com/tim-beatham/wgmesh/pkg/lib" - "github.com/tim-beatham/wgmesh/pkg/mesh" + "github.com/tim-beatham/smegmesh/pkg/conf" + "github.com/tim-beatham/smegmesh/pkg/lib" + "github.com/tim-beatham/smegmesh/pkg/mesh" "golang.zx2c4.com/wireguard/wgctrl/wgtypes" ) diff --git a/pkg/crdt/g_map_test.go b/pkg/crdt/g_map_test.go index 4cd05aa..e2e1bd2 100644 --- a/pkg/crdt/g_map_test.go +++ b/pkg/crdt/g_map_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/tim-beatham/wgmesh/pkg/lib" + "github.com/tim-beatham/smegmesh/pkg/lib" ) func NewGmap() *GMap[string, bool] { diff --git a/pkg/ip/types.go b/pkg/ip/types.go index de34feb..2e36592 100644 --- a/pkg/ip/types.go +++ b/pkg/ip/types.go @@ -7,5 +7,5 @@ import ( ) type IPAllocator interface { - GetIP(key wgtypes.Key, meshId string, collisionCount int) (net.IP, error) + GetIP(key wgtypes.Key, meshId string, collisionCount uint8) (net.IP, error) } diff --git a/pkg/ip/ula.go b/pkg/ip/ula.go index be05a54..1e6e6be 100644 --- a/pkg/ip/ula.go +++ b/pkg/ip/ula.go @@ -39,10 +39,10 @@ func (u *ULABuilder) GetIPNet(meshId string) (*net.IPNet, error) { return net, nil } -func (u *ULABuilder) GetIP(key wgtypes.Key, meshId string, collisionCount int) (net.IP, error) { +func (u *ULABuilder) GetIP(key wgtypes.Key, meshId string, collisionCount uint8) (net.IP, error) { ulaPrefix := getMeshPrefix(meshId) - c, err := NewCga(key, ulaPrefix) + c, err := NewCga(key, collisionCount, ulaPrefix) if err != nil { return nil, err diff --git a/pkg/mesh/manager.go b/pkg/mesh/manager.go index a8f49c0..73cfbcc 100644 --- a/pkg/mesh/manager.go +++ b/pkg/mesh/manager.go @@ -286,7 +286,7 @@ func (s *MeshManagerImpl) AddSelf(params *AddSelfParams) error { pubKey := s.HostParameters.PrivateKey.PublicKey() - collisionCount := 0 + collisionCount := uint8(0) var nodeIP *net.IPNet