Skip to content

Commit

Permalink
Send notifications when enabling a route
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfont committed Aug 15, 2021
1 parent 9c2a630 commit a376b69
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit a376b69

Please sign in to comment.