wgengine/monitor: on unsupported platforms, use a polling implementation

Not great, but lets people working on new ports get going more quickly
without having to do everything up front.

As the link monitor is getting used more, I felt bad having a useless
implementation.

Updates #815
Updates #1427

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-03-02 21:45:40 -08:00
parent 8a55d463c8
commit 7461dded88
7 changed files with 86 additions and 20 deletions

View File

@@ -37,7 +37,7 @@ type nlConn struct {
buffered []netlink.Message
}
func newOSMon(logf logger.Logf) (osMon, error) {
func newOSMon(logf logger.Logf, _ *Mon) (osMon, error) {
conn, err := netlink.Dial(unix.NETLINK_ROUTE, &netlink.Config{
// Routes get us most of the events of interest, but we need
// address as well to cover things like DHCP deciding to give