wgengine: fix macos staticcheck errors (#557)

Signed-off-by: Wendi <wendi.yu@yahoo.ca>
reviewable/pr560/r1
Wendi Yu 4 years ago committed by GitHub
parent d9ac2ada45
commit c3736250a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,13 +20,6 @@ type message interface {
ignore() bool
}
// unspecifiedMessage is a minimal message implementation that should not
// be ignored. In general, OS-specific implementations should use better
// types and avoid this if they can.
type unspecifiedMessage struct{}
func (unspecifiedMessage) ignore() bool { return false }
// osMon is the interface that each operating system-specific
// implementation of the link monitor must implement.
type osMon interface {

@ -13,6 +13,13 @@ import (
"tailscale.com/types/logger"
)
// unspecifiedMessage is a minimal message implementation that should not
// be ignored. In general, OS-specific implementations should use better
// types and avoid this if they can.
type unspecifiedMessage struct{}
func (unspecifiedMessage) ignore() bool { return false }
// devdConn implements osMon using devd(8).
type devdConn struct {
conn net.Conn

@ -19,6 +19,13 @@ import (
"tailscale.com/types/logger"
)
// unspecifiedMessage is a minimal message implementation that should not
// be ignored. In general, OS-specific implementations should use better
// types and avoid this if they can.
type unspecifiedMessage struct{}
func (unspecifiedMessage) ignore() bool { return false }
// 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

@ -5,8 +5,6 @@
package router
import (
"time"
"inet.af/netaddr"
)
@ -46,13 +44,6 @@ func (lhs DNSConfig) EquivalentTo(rhs DNSConfig) bool {
return true
}
// dnsReconfigTimeout is the timeout for DNS reconfiguration.
//
// This is useful because certain conditions can cause indefinite hangs
// (such as improper dbus auth followed by contextless dbus.Object.Call).
// Such operations should be wrapped in a timeout context.
const dnsReconfigTimeout = time.Second
// dnsMode determines how DNS settings are managed.
type dnsMode uint8

@ -11,6 +11,7 @@ import (
"errors"
"fmt"
"os/exec"
"time"
"github.com/godbus/dbus/v5"
"golang.org/x/sys/unix"
@ -35,6 +36,13 @@ import (
// this address is, in fact, hard-coded into resolved.
var resolvedListenAddr = netaddr.IPv4(127, 0, 0, 53)
// dnsReconfigTimeout is the timeout for DNS reconfiguration.
//
// This is useful because certain conditions can cause indefinite hangs
// (such as improper dbus auth followed by contextless dbus.Object.Call).
// Such operations should be wrapped in a timeout context.
const dnsReconfigTimeout = time.Second
var errNotReady = errors.New("interface not ready")
type resolvedLinkNameserver struct {

Loading…
Cancel
Save