netstack_linux.go 403 B

1234567891011121314151617181920
  1. // Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package netstack
  5. import (
  6. "os/exec"
  7. "syscall"
  8. "golang.org/x/sys/unix"
  9. )
  10. func init() {
  11. setAmbientCapsRaw = func(cmd *exec.Cmd) {
  12. cmd.SysProcAttr = &syscall.SysProcAttr{
  13. AmbientCaps: []uintptr{unix.CAP_NET_RAW},
  14. }
  15. }
  16. }