sockopt_rfc3493_linux.go 409 B

1234567891011121314151617
  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. package ipv6
  5. import (
  6. "os"
  7. "syscall"
  8. )
  9. func setIPv6Checksum(fd int, on bool, offset int) error {
  10. if !on {
  11. offset = -1
  12. }
  13. return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolReserved, sysSockoptChecksum, offset))
  14. }