blob: f13a28f82f7908e9d24bf2e3023fed7d453c00a6 [file] [log] [blame]
Mikio Haracdfc4ce2013-06-04 17:42:58 +09001// 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
5package ipv6
6
7import (
8 "os"
Mikio Harab27e68b2013-11-06 21:33:49 +09009 "unsafe"
Mikio Haracdfc4ce2013-06-04 17:42:58 +090010)
11
12func setIPv6Checksum(fd int, on bool, offset int) error {
13 if !on {
14 offset = -1
15 }
Mikio Harab27e68b2013-11-06 21:33:49 +090016 v := int32(offset)
17 return os.NewSyscallError("setsockopt", setsockopt(fd, ianaProtocolReserved, sysSockoptChecksum, uintptr(unsafe.Pointer(&v)), 4))
Mikio Haracdfc4ce2013-06-04 17:42:58 +090018}