Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(800)

Unified Diff: ipv4/payload_cmsg.go

Issue 97800043: code review 97800043: go.net/ipv4: add support for dragonfly (Closed)
Patch Set: diff -r 9c33002573cb https://code.google.com/p/go.net Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipv4/payload.go ('k') | ipv4/payload_noncmsg.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ipv4/payload.go ('k') | ipv4/payload_noncmsg.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b