summaryrefslogtreecommitdiffhomepage
path: root/wgengine/monitor/monitor_linux.go
AgeCommit message (Collapse)AuthorFilesLines
2021-05-16all: adapt to opaque netaddr typesJosh Bleecher Snyder1-3/+3
This commit is a mishmash of automated edits using gofmt: gofmt -r 'netaddr.IPPort{IP: a, Port: b} -> netaddr.IPPortFrom(a, b)' -w . gofmt -r 'netaddr.IPPrefix{IP: a, Port: b} -> netaddr.IPPrefixFrom(a, b)' -w . gofmt -r 'a.IP.Is4 -> a.IP().Is4' -w . gofmt -r 'a.IP.As16 -> a.IP().As16' -w . gofmt -r 'a.IP.Is6 -> a.IP().Is6' -w . gofmt -r 'a.IP.As4 -> a.IP().As4' -w . gofmt -r 'a.IP.String -> a.IP().String' -w . And regexps: \w*(.*)\.Port = (.*) -> $1 = $1.WithPort($2) \w*(.*)\.IP = (.*) -> $1 = $1.WithIP($2) And lots of manual fixups. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-04-12wgengine/monitor: reduce Linux log spam on downBrad Fitzpatrick1-1/+1
Fixes #1689 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-04-01wgengine/monitor: Linux fall back to pollingDenton Gentry1-3/+4
Google Cloud Run does not implement NETLINK_ROUTE RTMGRP. If initialization of the netlink socket or group membership fails, fall back to a polling implementation. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-03-02wgengine/monitor: on unsupported platforms, use a polling implementationBrad Fitzpatrick1-1/+1
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>
2021-02-22wgengine/monitor: don't log any single-IP routes added to the tailscale table.David Anderson1-1/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-22wgengine/monitor: on linux, also monitor for IPv6 changes.David Anderson1-6/+5
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-12-23go.mod: bump github.com/mdlayher/netlink to v1.2.0Matt Layher1-4/+1
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2020-08-12wgengine/monitor: add, clean up netlink logging on route changesBrad Fitzpatrick1-18/+51
Updates #643
2020-08-05wgengine/monitor: log RTM_DELROUTE details, fix format stringsBrad Fitzpatrick1-2/+12
Updates #643
2020-07-14wgengine: fix macos staticcheck errors (#557)Wendi Yu1-0/+7
Signed-off-by: Wendi <wendi.yu@yahoo.ca>
2020-07-07wgengine/monitor: fix other potential crashes on LinuxBrad Fitzpatrick1-11/+16
Never return "nil, nil" anymore. The caller expected a usable interface now. I missed some of these earlier. Also, handle address deletion now. Updates #532
2020-07-07wgengine/monitor: fix crash on Linux on type 21 messagesBrad Fitzpatrick1-1/+2
Fixes #532
2020-07-06wgengine/monitor: parse Linux netlink messages, ignore our own eventsBrad Fitzpatrick1-10/+78
Fixes tailscale/corp#412 ("flood of link change events at start-up") Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-04-24wgengine/monitor: disable monitor on AndroidElias Naur1-0/+2
Netlink is not supported on Android. Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-02-17wgengine/monitor: use RTMGRP_* consts from x/sys/unixTobias Klauser1-10/+1
Bump golang.org/x/sys/unix to get the RTMGRP_* consts and use them. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-02-17wgengine/monitor: make Close not block forever on LinuxBrad Fitzpatrick1-0/+2
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-17wgengine: move link monitor to be owned by the engine, not the routerBrad Fitzpatrick1-5/+5
And make the monitor package portable with no-op implementations on unsupported operating systems. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-13monitor: refactor for architecture-specific connection implementationswardn1-0/+60
Signed-off-by: wardn <wardn@users.noreply.github.com>