mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-28 05:00:08 +00:00
cmd/tailscaled: start implementing ts_omit_netstack
Baby steps. This permits building without much of gvisor, but not all of it. Updates #17283 Change-Id: I8433146e259918cc901fe86b4ea29be22075b32c Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
b3ae1cb0cc
commit
f715ee2be9
@@ -1,6 +1,8 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build !ts_omit_netstack
|
||||
|
||||
// Package gro implements GRO for the receive (write) path into gVisor.
|
||||
package gro
|
||||
|
||||
|
||||
10
wgengine/netstack/gro/netstack_disabled.go
Normal file
10
wgengine/netstack/gro/netstack_disabled.go
Normal file
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build ts_omit_netstack
|
||||
|
||||
package gro
|
||||
|
||||
func RXChecksumOffload(any) any {
|
||||
panic("unreachable")
|
||||
}
|
||||
@@ -187,7 +187,7 @@ func (l *linkEndpoint) injectInbound(p *packet.Parsed) {
|
||||
l.mu.RLock()
|
||||
d := l.dispatcher
|
||||
l.mu.RUnlock()
|
||||
if d == nil {
|
||||
if d == nil || !buildfeatures.HasNetstack {
|
||||
return
|
||||
}
|
||||
pkt := gro.RXChecksumOffload(p)
|
||||
|
||||
@@ -578,9 +578,16 @@ func (ns *Impl) decrementInFlightTCPForward(tei stack.TransportEndpointID, remot
|
||||
}
|
||||
}
|
||||
|
||||
// LocalBackend is a fake name for *ipnlocal.LocalBackend to avoid an import cycle.
|
||||
type LocalBackend = any
|
||||
|
||||
// Start sets up all the handlers so netstack can start working. Implements
|
||||
// wgengine.FakeImpl.
|
||||
func (ns *Impl) Start(lb *ipnlocal.LocalBackend) error {
|
||||
func (ns *Impl) Start(b LocalBackend) error {
|
||||
if b == nil {
|
||||
panic("nil LocalBackend interface")
|
||||
}
|
||||
lb := b.(*ipnlocal.LocalBackend)
|
||||
if lb == nil {
|
||||
panic("nil LocalBackend")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user