mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-19 05:02:34 +00:00
cmd/tailscaled: use the wf package instead of wireguard-windows/firewall
Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
25df067dd0
commit
234cc87f48
@ -69,6 +69,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
|
|||||||
inet.af/netstack/tcpip/transport/udp from inet.af/netstack/tcpip/adapters/gonet+
|
inet.af/netstack/tcpip/transport/udp from inet.af/netstack/tcpip/adapters/gonet+
|
||||||
inet.af/netstack/waiter from inet.af/netstack/tcpip+
|
inet.af/netstack/waiter from inet.af/netstack/tcpip+
|
||||||
inet.af/peercred from tailscale.com/ipn/ipnserver
|
inet.af/peercred from tailscale.com/ipn/ipnserver
|
||||||
|
W 💣 inet.af/wf from tailscale.com/wf
|
||||||
rsc.io/goversion/version from tailscale.com/version
|
rsc.io/goversion/version from tailscale.com/version
|
||||||
tailscale.com/atomicfile from tailscale.com/ipn+
|
tailscale.com/atomicfile from tailscale.com/ipn+
|
||||||
tailscale.com/client/tailscale/apitype from tailscale.com/ipn/ipnlocal+
|
tailscale.com/client/tailscale/apitype from tailscale.com/ipn/ipnlocal+
|
||||||
@ -115,7 +116,6 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
|
|||||||
tailscale.com/smallzstd from tailscale.com/ipn/ipnserver+
|
tailscale.com/smallzstd from tailscale.com/ipn/ipnserver+
|
||||||
tailscale.com/syncs from tailscale.com/net/interfaces+
|
tailscale.com/syncs from tailscale.com/net/interfaces+
|
||||||
tailscale.com/tailcfg from tailscale.com/control/controlclient+
|
tailscale.com/tailcfg from tailscale.com/control/controlclient+
|
||||||
W 💣 tailscale.com/tempfork/wireguard-windows/firewall from tailscale.com/cmd/tailscaled
|
|
||||||
W tailscale.com/tsconst from tailscale.com/net/interfaces
|
W tailscale.com/tsconst from tailscale.com/net/interfaces
|
||||||
tailscale.com/tstime from tailscale.com/wgengine/magicsock
|
tailscale.com/tstime from tailscale.com/wgengine/magicsock
|
||||||
tailscale.com/types/empty from tailscale.com/control/controlclient+
|
tailscale.com/types/empty from tailscale.com/control/controlclient+
|
||||||
@ -143,6 +143,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
|
|||||||
tailscale.com/util/winutil from tailscale.com/logpolicy+
|
tailscale.com/util/winutil from tailscale.com/logpolicy+
|
||||||
tailscale.com/version from tailscale.com/cmd/tailscaled+
|
tailscale.com/version from tailscale.com/cmd/tailscaled+
|
||||||
tailscale.com/version/distro from tailscale.com/control/controlclient+
|
tailscale.com/version/distro from tailscale.com/control/controlclient+
|
||||||
|
W tailscale.com/wf from tailscale.com/cmd/tailscaled
|
||||||
tailscale.com/wgengine from tailscale.com/cmd/tailscaled+
|
tailscale.com/wgengine from tailscale.com/cmd/tailscaled+
|
||||||
tailscale.com/wgengine/filter from tailscale.com/control/controlclient+
|
tailscale.com/wgengine/filter from tailscale.com/control/controlclient+
|
||||||
tailscale.com/wgengine/magicsock from tailscale.com/wgengine+
|
tailscale.com/wgengine/magicsock from tailscale.com/wgengine+
|
||||||
|
@ -21,7 +21,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -32,9 +31,9 @@ import (
|
|||||||
"tailscale.com/logpolicy"
|
"tailscale.com/logpolicy"
|
||||||
"tailscale.com/net/dns"
|
"tailscale.com/net/dns"
|
||||||
"tailscale.com/net/tstun"
|
"tailscale.com/net/tstun"
|
||||||
"tailscale.com/tempfork/wireguard-windows/firewall"
|
|
||||||
"tailscale.com/types/logger"
|
"tailscale.com/types/logger"
|
||||||
"tailscale.com/version"
|
"tailscale.com/version"
|
||||||
|
"tailscale.com/wf"
|
||||||
"tailscale.com/wgengine"
|
"tailscale.com/wgengine"
|
||||||
"tailscale.com/wgengine/netstack"
|
"tailscale.com/wgengine/netstack"
|
||||||
"tailscale.com/wgengine/router"
|
"tailscale.com/wgengine/router"
|
||||||
@ -144,13 +143,13 @@ func beFirewallKillswitch() bool {
|
|||||||
|
|
||||||
luid, err := winipcfg.LUIDFromGUID(&guid)
|
luid, err := winipcfg.LUIDFromGUID(&guid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("no interface with GUID %q", guid)
|
log.Fatalf("no interface with GUID %q: %v", guid, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
noProtection := false
|
|
||||||
var dnsIPs []net.IP // unused in called code.
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
firewall.EnableFirewall(uint64(luid), noProtection, dnsIPs)
|
if _, err := wf.New(uint64(luid)); err != nil {
|
||||||
|
log.Fatalf("filewall creation failed: %v", err)
|
||||||
|
}
|
||||||
log.Printf("killswitch enabled, took %s", time.Since(start))
|
log.Printf("killswitch enabled, took %s", time.Since(start))
|
||||||
|
|
||||||
// Block until the monitor goroutine shuts us down.
|
// Block until the monitor goroutine shuts us down.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user