| // Copyright 2012 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| func ipv4SendSourceAddress(fd int) (bool, error) { |
| v, err := syscall.GetsockoptInt(fd, syscall.IPPROTO_IP, syscall.IP_SENDSRCADDR) |
| return false, os.NewSyscallError("getsockopt", err) |
| func setIPv4SendSourceAddress(fd int, v bool) error { |
| err := syscall.SetsockoptInt(fd, syscall.IPPROTO_IP, syscall.IP_SENDSRCADDR, boolint(v)) |
| return os.NewSyscallError("setsockopt", err) |