mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-12 05:37:32 +00:00
cmd/tailscaled, net/tstun: add build tags to omit BIRD and TAP
Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I7a39f4eeeb583b73ecffaf4c5f086a38e3a53e2e
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !ts_omit_tap
|
||||
|
||||
package tstun
|
||||
|
||||
import (
|
||||
|
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !linux
|
||||
//go:build !linux || ts_omit_tap
|
||||
|
||||
package tstun
|
||||
|
||||
|
@@ -31,6 +31,9 @@ func New(logf logger.Logf, tunName string) (tun.Device, string, error) {
|
||||
if runtime.GOOS != "linux" {
|
||||
return nil, "", errors.New("tap only works on Linux")
|
||||
}
|
||||
if createTAP == nil { // if the ts_omit_tap tag is used
|
||||
return nil, "", errors.New("tap is not supported in this build")
|
||||
}
|
||||
f := strings.Split(tunName, ":")
|
||||
var tapName, bridgeName string
|
||||
switch len(f) {
|
||||
|
Reference in New Issue
Block a user