Removed interface manipulation via os.Exec into

rtnetlink calls
This commit is contained in:
Tim Beatham
2023-11-07 19:48:53 +00:00
parent 4c19ebd81f
commit 1a864b7c80
15 changed files with 618 additions and 99 deletions

View File

@@ -31,7 +31,11 @@ type SyncerImpl struct {
// Sync: Sync random nodes
func (s *SyncerImpl) Sync(meshId string) error {
logging.Log.WriteInfof("UPDATING WG CONF")
s.manager.ApplyConfig()
err := s.manager.ApplyConfig()
if err != nil {
logging.Log.WriteInfof("Failed to update config %w", err)
}
if !s.manager.HasChanges(meshId) && s.infectionCount == 0 {
logging.Log.WriteInfof("No changes for %s", meshId)