sockopt_rfc3493_bsd.go 456 B

12345678910111213141516171819
  1. // Copyright 2013 The Go 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. // +build darwin dragonfly freebsd netbsd openbsd
  5. package ipv6
  6. import (
  7. "os"
  8. "syscall"
  9. )
  10. func setIPv6Checksum(fd int, on bool, offset int) error {
  11. if !on {
  12. offset = -1
  13. }
  14. return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptChecksum, offset))
  15. }