mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-21 18:42:36 +00:00
wgengine: move link monitor to be owned by the engine, not the router
And make the monitor package portable with no-op implementations on unsupported operating systems. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
09fbae01a9
commit
7f5e3febe5
@@ -11,11 +11,12 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// devdConn implements osMon using devd(8).
|
||||
type devdConn struct {
|
||||
conn net.Conn
|
||||
}
|
||||
|
||||
func NewConn() (Conn, error) {
|
||||
func newOSMon() (osMon, error) {
|
||||
conn, err := net.Dial("unixpacket", "/var/run/devd.seqpacket.pipe")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("devd dial error: %v", err)
|
||||
@@ -30,7 +31,7 @@ func (c *devdConn) Close() error {
|
||||
return c.conn.Close()
|
||||
}
|
||||
|
||||
func (c *devdConn) Receive() (Message, error) {
|
||||
func (c *devdConn) Receive() (message, error) {
|
||||
for {
|
||||
msg, err := bufio.NewReader(c.conn).ReadString('\n')
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user