Skip to content

Commit 9373a1b

Browse files
nshalmanbradfitz
authored andcommitted
all: illumos/solaris userspace only support
Updates tailscale#14565 Change-Id: I743148144938794db0a224873ce76c10dbe6fa5f Signed-off-by: Nahum Shalman <[email protected]>
1 parent 6ddeae7 commit 9373a1b

File tree

14 files changed

+60
-12
lines changed

14 files changed

+60
-12
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,12 @@ jobs:
313313
# AIX
314314
- goos: aix
315315
goarch: ppc64
316+
# Solaris
317+
- goos: solaris
318+
goarch: amd64
319+
# illumos
320+
- goos: illumos
321+
goarch: amd64
316322

317323
runs-on: ubuntu-22.04
318324
steps:

cmd/tailscaled/tailscaled.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func defaultTunName() string {
8181
// "utun" is recognized by wireguard-go/tun/tun_darwin.go
8282
// as a magic value that uses/creates any free number.
8383
return "utun"
84-
case "plan9", "aix":
84+
case "plan9", "aix", "solaris", "illumos":
8585
return "userspace-networking"
8686
case "linux":
8787
switch distro.Get() {
@@ -665,7 +665,7 @@ func handleSubnetsInNetstack() bool {
665665
return true
666666
}
667667
switch runtime.GOOS {
668-
case "windows", "darwin", "freebsd", "openbsd":
668+
case "windows", "darwin", "freebsd", "openbsd", "solaris", "illumos":
669669
// Enable on Windows and tailscaled-on-macOS (this doesn't
670670
// affect the GUI clients), and on FreeBSD.
671671
return true

ipn/ipnlocal/local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4176,7 +4176,7 @@ func (b *LocalBackend) peerAPIServicesLocked() (ret []tailcfg.Service) {
41764176
})
41774177
}
41784178
switch runtime.GOOS {
4179-
case "linux", "freebsd", "openbsd", "illumos", "darwin", "windows", "android", "ios":
4179+
case "linux", "freebsd", "openbsd", "illumos", "solaris", "darwin", "windows", "android", "ios":
41804180
// These are the platforms currently supported by
41814181
// net/dns/resolver/tsdns.go:Resolver.HandleExitNodeDNSQuery.
41824182
ret = append(ret, tailcfg.Service{

ipn/ipnserver/actor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (a *actor) Username() (string, error) {
9696
}
9797
defer tok.Close()
9898
return tok.Username()
99-
case "darwin", "linux":
99+
case "darwin", "linux", "illumos", "solaris":
100100
uid, ok := a.ci.Creds().UserID()
101101
if !ok {
102102
return "", errors.New("missing user ID")

ipn/ipnstate/ipnstate.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ func osEmoji(os string) string {
650650
return "🐡"
651651
case "illumos":
652652
return "☀️"
653+
case "solaris":
654+
return "🌤️"
653655
}
654656
return "👽"
655657
}

ipn/localapi/localapi.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ func (h *Handler) serveServeConfig(w http.ResponseWriter, r *http.Request) {
10971097

10981098
func authorizeServeConfigForGOOSAndUserContext(goos string, configIn *ipn.ServeConfig, h *Handler) error {
10991099
switch goos {
1100-
case "windows", "linux", "darwin":
1100+
case "windows", "linux", "darwin", "illumos", "solaris":
11011101
default:
11021102
return nil
11031103
}
@@ -1117,7 +1117,7 @@ func authorizeServeConfigForGOOSAndUserContext(goos string, configIn *ipn.ServeC
11171117
switch goos {
11181118
case "windows":
11191119
return errors.New("must be a Windows local admin to serve a path")
1120-
case "linux", "darwin":
1120+
case "linux", "darwin", "illumos", "solaris":
11211121
return errors.New("must be root, or be an operator and able to run 'sudo tailscale' to serve a path")
11221122
default:
11231123
// We filter goos at the start of the func, this default case

ipn/localapi/localapi_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func TestShouldDenyServeConfigForGOOSAndUserContext(t *testing.T) {
237237
}
238238

239239
for _, tt := range tests {
240-
for _, goos := range []string{"linux", "windows", "darwin"} {
240+
for _, goos := range []string{"linux", "windows", "darwin", "illumos", "solaris"} {
241241
t.Run(goos+"-"+tt.name, func(t *testing.T) {
242242
err := authorizeServeConfigForGOOSAndUserContext(goos, tt.configIn, tt.h)
243243
gotErr := err != nil

net/dns/manager_default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Tailscale Inc & AUTHORS
22
// SPDX-License-Identifier: BSD-3-Clause
33

4-
//go:build !linux && !freebsd && !openbsd && !windows && !darwin
4+
//go:build !linux && !freebsd && !openbsd && !windows && !darwin && !illumos && !solaris
55

66
package dns
77

net/dns/manager_solaris.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (c) Tailscale Inc & AUTHORS
2+
// SPDX-License-Identifier: BSD-3-Clause
3+
4+
package dns
5+
6+
import (
7+
"tailscale.com/control/controlknobs"
8+
"tailscale.com/health"
9+
"tailscale.com/types/logger"
10+
)
11+
12+
func NewOSConfigurator(logf logger.Logf, health *health.Tracker, _ *controlknobs.Knobs, iface string) (OSConfigurator, error) {
13+
return newDirectManager(logf, health), nil
14+
}

net/dns/resolver/tsdns.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ func (r *Resolver) HandlePeerDNSQuery(ctx context.Context, q []byte, from netip.
384384
// but for now that's probably good enough. Later we'll
385385
// want to blend in everything from scutil --dns.
386386
fallthrough
387-
case "linux", "freebsd", "openbsd", "illumos", "ios":
387+
case "linux", "freebsd", "openbsd", "illumos", "solaris", "ios":
388388
nameserver, err := stubResolverForOS()
389389
if err != nil {
390390
r.logf("stubResolverForOS: %v", err)

0 commit comments

Comments
 (0)