mirror of https://github.com/tailscale/tailscale/
util/linuxfw, feature/buildfeatures: add ts_omit_iptables to make IPTables optional
Updates #12614 Change-Id: Ic0eba982aa8468a55c63e1b763345f032a55b4e2 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>pull/17314/head
parent
7df7e01d0f
commit
dd615c8fdd
@ -0,0 +1,13 @@
|
|||||||
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
// Code generated by gen.go; DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:build ts_omit_iptables
|
||||||
|
|
||||||
|
package buildfeatures
|
||||||
|
|
||||||
|
// HasIPTables is whether the binary was built with support for modular feature "Linux iptables support".
|
||||||
|
// Specifically, it's whether the binary was NOT built with the "ts_omit_iptables" build tag.
|
||||||
|
// It's a const so it can be used for dead code elimination.
|
||||||
|
const HasIPTables = false
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
// Code generated by gen.go; DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:build !ts_omit_iptables
|
||||||
|
|
||||||
|
package buildfeatures
|
||||||
|
|
||||||
|
// HasIPTables is whether the binary was built with support for modular feature "Linux iptables support".
|
||||||
|
// Specifically, it's whether the binary was NOT built with the "ts_omit_iptables" build tag.
|
||||||
|
// It's a const so it can be used for dead code elimination.
|
||||||
|
const HasIPTables = true
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
//go:build (linux && !(arm64 || amd64)) || ts_omit_iptables
|
||||||
|
|
||||||
|
package linuxfw
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"tailscale.com/types/logger"
|
||||||
|
)
|
||||||
|
|
||||||
|
func detectIptables() (int, error) {
|
||||||
|
return 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func newIPTablesRunner(logf logger.Logf) (*iptablesRunner, error) {
|
||||||
|
return nil, errors.New("iptables disabled in build")
|
||||||
|
}
|
||||||
@ -1,40 +0,0 @@
|
|||||||
// Copyright (c) Tailscale Inc & AUTHORS
|
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
|
|
||||||
// NOTE: linux_{arm64, amd64} are the only two currently supported archs due to missing
|
|
||||||
// support in upstream dependencies.
|
|
||||||
|
|
||||||
// TODO(#8502): add support for more architectures
|
|
||||||
//go:build linux && !(arm64 || amd64)
|
|
||||||
|
|
||||||
package linuxfw
|
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
|
|
||||||
"tailscale.com/types/logger"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ErrUnsupported is the error returned from all functions on non-Linux
|
|
||||||
// platforms.
|
|
||||||
var ErrUnsupported = errors.New("linuxfw:unsupported")
|
|
||||||
|
|
||||||
// DebugNetfilter is not supported on non-Linux platforms.
|
|
||||||
func DebugNetfilter(logf logger.Logf) error {
|
|
||||||
return ErrUnsupported
|
|
||||||
}
|
|
||||||
|
|
||||||
// DetectNetfilter is not supported on non-Linux platforms.
|
|
||||||
func detectNetfilter() (int, error) {
|
|
||||||
return 0, ErrUnsupported
|
|
||||||
}
|
|
||||||
|
|
||||||
// DebugIptables is not supported on non-Linux platforms.
|
|
||||||
func debugIptables(logf logger.Logf) error {
|
|
||||||
return ErrUnsupported
|
|
||||||
}
|
|
||||||
|
|
||||||
// DetectIptables is not supported on non-Linux platforms.
|
|
||||||
func detectIptables() (int, error) {
|
|
||||||
return 0, ErrUnsupported
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue