Index: ipv4/payload_cmsg.go |
=================================================================== |
copy from ipv4/payload.go |
copy to ipv4/payload_cmsg.go |
--- a/ipv4/payload.go |
+++ b/ipv4/payload_cmsg.go |
@@ -2,6 +2,8 @@ |
// Use of this source code is governed by a BSD-style |
// license that can be found in the LICENSE file. |
+// +build !plan9,!solaris,!windows |
+ |
package ipv4 |
import ( |
@@ -9,14 +11,6 @@ |
"syscall" |
) |
-// A payloadHandler represents the IPv4 datagram payload handler. |
-type payloadHandler struct { |
- net.PacketConn |
- rawOpt |
-} |
- |
-func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil } |
- |
// ReadFrom reads a payload of the received IPv4 datagram, from the |
// endpoint c, copying the payload into b. It returns the number of |
// bytes copied into b, the control message cm and the source address |
@@ -56,8 +50,8 @@ |
// address dst through the endpoint c, copying the payload from b. It |
// returns the number of bytes written. The control message cm allows |
// the datagram path and the outgoing interface to be specified. |
-// Currently only Linux supports this. The cm may be nil if control |
-// of the outgoing datagram is not required. |
+// Currently only Darwin and Darwin support this. The cm may be nil if |
+// control of the outgoing datagram is not required. |
func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { |
if !c.ok() { |
return 0, syscall.EINVAL |