Merge pull request #87 from juanfont/fix-route-notify

Send notifications when enabling a route
This commit is contained in:
Juan Font
2021-08-16 09:25:31 +02:00
committed by GitHub

View File

@@ -45,14 +45,12 @@ func (h *Headscale) EnableNodeRoute(namespace string, nodeName string, routeStr
m.EnabledRoutes = datatypes.JSON(routes)
h.db.Save(&m)
// THIS IS COMPLETELY USELESS.
// The peers map is stored in memory in the server process.
// Definitely not accessible from the CLI tool.
// We need RPC to the server - or some kind of 'needsUpdate' field in the DB
h.notifyChangesToPeers(m)
err = h.RequestMapUpdates(m.NamespaceID)
if err != nil {
return nil, err
}
return &rIP, nil
}
}
return nil, errors.New("could not find routable range")
}