[PATCH 1/7] tun: TUNDevice: document behavior of offset parameter

Simon Ruderich simon at ruderich.org
Sun Dec 31 17:16:48 CET 2017


---
 src/tun.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tun.go b/src/tun.go
index 024f0f0..cb50cd0 100644
--- a/src/tun.go
+++ b/src/tun.go
@@ -17,8 +17,8 @@ const (
 
 type TUNDevice interface {
 	File() *os.File                 // returns the file descriptor of the device
-	Read([]byte, int) (int, error)  // read a packet from the device (without any additional headers)
-	Write([]byte, int) (int, error) // writes a packet to the device (without any additional headers)
+	Read([]byte, int) (int, error)  // read a packet from the device (without any additional headers); packet starts at the given offset (however data preceding offset may be overwritten!)
+	Write([]byte, int) (int, error) // writes a packet to the device (without any additional headers); packet starts at the given offset (however data preceding offset may be overwritten!)
 	MTU() (int, error)              // returns the MTU of the device
 	Name() string                   // returns the current name
 	Events() chan TUNEvent          // returns a constant channel of events related to the device
-- 
2.15.1



More information about the WireGuard mailing list