ipn/ipnlocal,wgengine/netstack: unify TCP forwarders

This also has the side effect of registering the local ports with the
port mapper so that subsequent calls to WhoIs return the correct information
(resolves a TODO in code).

Updates #13513
This commit is contained in:
Maisem Ali
2024-09-18 17:53:03 -07:00
parent 5f89c93274
commit f51c968b2a
3 changed files with 92 additions and 77 deletions

View File

@@ -18,7 +18,9 @@
package tsd
import (
"context"
"fmt"
"net"
"reflect"
"tailscale.com/control/controlknobs"
@@ -73,6 +75,7 @@ type System struct {
// references LocalBackend, and LocalBackend has a tsd.System.
type NetstackImpl interface {
UpdateNetstackIPs(*netmap.NetworkMap)
ForwardTCPHandler(dialCtx context.Context, dialAddr string) (func(net.Conn) error, error)
}
// Set is a convenience method to set a subsystem value.