mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 05:07:33 +00:00
wgengine/monitor: use RTMGRP_* consts from x/sys/unix
Bump golang.org/x/sys/unix to get the RTMGRP_* consts and use them. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This commit is contained in:

committed by
Dave Anderson

parent
769e25e37b
commit
4d09316f9a
@@ -12,11 +12,6 @@ import (
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const (
|
||||
_RTMGRP_IPV4_IFADDR = 0x10
|
||||
_RTMGRP_IPV4_ROUTE = 0x40
|
||||
)
|
||||
|
||||
// nlConn wraps a *netlink.Conn and returns a monitor.Message
|
||||
// instead of a netlink.Message. Currently, messages are discarded,
|
||||
// but down the line, when messages trigger different logic depending
|
||||
@@ -33,11 +28,7 @@ func newOSMon() (osMon, error) {
|
||||
// things like DHCP deciding to give us a new address upon
|
||||
// renewal - routing wouldn't change, but all reachability
|
||||
// would.
|
||||
//
|
||||
// Why magic numbers? These aren't exposed in x/sys/unix
|
||||
// yet. The values come from rtnetlink.h, RTMGRP_IPV4_IFADDR
|
||||
// and RTMGRP_IPV4_ROUTE.
|
||||
Groups: _RTMGRP_IPV4_IFADDR | _RTMGRP_IPV4_ROUTE,
|
||||
Groups: unix.RTMGRP_IPV4_IFADDR | unix.RTMGRP_IPV4_ROUTE,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("dialing netlink socket: %v", err)
|
||||
|
Reference in New Issue
Block a user