|
|
|
@ -11,6 +11,7 @@ import (
|
|
|
|
"errors"
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"os/exec"
|
|
|
|
"os/exec"
|
|
|
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/godbus/dbus/v5"
|
|
|
|
"github.com/godbus/dbus/v5"
|
|
|
|
"golang.org/x/sys/unix"
|
|
|
|
"golang.org/x/sys/unix"
|
|
|
|
@ -35,6 +36,13 @@ import (
|
|
|
|
// this address is, in fact, hard-coded into resolved.
|
|
|
|
// this address is, in fact, hard-coded into resolved.
|
|
|
|
var resolvedListenAddr = netaddr.IPv4(127, 0, 0, 53)
|
|
|
|
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")
|
|
|
|
var errNotReady = errors.New("interface not ready")
|
|
|
|
|
|
|
|
|
|
|
|
type resolvedLinkNameserver struct {
|
|
|
|
type resolvedLinkNameserver struct {
|
|
|
|
|