From a038e8690cc9476b8e96e82f39856c311ed73f1a Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 1 Mar 2021 11:19:20 -0800 Subject: [PATCH] wgengine/netstack: fix 32-bit build broken from prior commit Signed-off-by: Brad Fitzpatrick --- Makefile | 5 ++++- wgengine/netstack/netstack_32bit.go | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dee8743ca..944a77aed 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,10 @@ depaware: buildwindows: GOOS=windows GOARCH=amd64 go install tailscale.com/cmd/tailscale tailscale.com/cmd/tailscaled -check: staticcheck vet depaware buildwindows +build386: + GOOS=linux GOARCH=386 go install tailscale.com/cmd/tailscale tailscale.com/cmd/tailscaled + +check: staticcheck vet depaware buildwindows build386 staticcheck: go run honnef.co/go/tools/cmd/staticcheck -- $$(go list ./... | grep -v tempfork) diff --git a/wgengine/netstack/netstack_32bit.go b/wgengine/netstack/netstack_32bit.go index dfb433d3d..7f3343ada 100644 --- a/wgengine/netstack/netstack_32bit.go +++ b/wgengine/netstack/netstack_32bit.go @@ -8,14 +8,30 @@ package netstack import ( + "context" "errors" + "net" + "inet.af/netaddr" "tailscale.com/types/logger" + "tailscale.com/types/netmap" "tailscale.com/wgengine" "tailscale.com/wgengine/magicsock" "tailscale.com/wgengine/tstun" ) -func Create(logf logger.Logf, tundev *tstun.TUN, e wgengine.Engine, mc *magicsock.Conn) (wgengine.FakeImpl, error) { +type Impl struct{} + +func (*Impl) Start() error { panic("noimpl") } + +func (*Impl) DialContextTCP(ctx context.Context, addr string) (net.Conn, error) { panic("noimpl") } + +type DNSMap map[string]netaddr.IP + +func (m DNSMap) Resolve(ctx context.Context, addr string) (netaddr.IPPort, error) { panic("noimpl") } + +func DNSMapFromNetworkMap(nm *netmap.NetworkMap) DNSMap { return nil } + +func Create(logf logger.Logf, tundev *tstun.TUN, e wgengine.Engine, mc *magicsock.Conn) (*Impl, error) { return nil, errors.New("netstack is not supported on 32-bit platforms for now; see https://github.com/google/gvisor/issues/5241") }