From a376b697c0804c9901b7c42d4574bc128a0090db Mon Sep 17 00:00:00 2001 From: Juan Font Date: Mon, 16 Aug 2021 00:17:26 +0200 Subject: [PATCH] Send notifications when enabling a route --- routes.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/routes.go b/routes.go index 7c83436e..202754b1 100644 --- a/routes.go +++ b/routes.go @@ -45,19 +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 - peers, _ := h.getPeers(*m) - for _, p := range *peers { - if pUp, ok := h.clientsPolling.Load(uint64(p.ID)); ok { - pUp.(chan []byte) <- []byte{} - } + err = h.RequestMapUpdates(m.NamespaceID) + if err != nil { + return nil, err } return &rIP, nil } } - return nil, errors.New("could not find routable range") }