aboutsummaryrefslogtreecommitdiffstats
path: root/src/helper_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper_test.go')
-rw-r--r--src/helper_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/helper_test.go b/src/helper_test.go
index 8548121..41e6b72 100644
--- a/src/helper_test.go
+++ b/src/helper_test.go
@@ -28,8 +28,8 @@ func (tun *DummyTUN) MTU() (int, error) {
return tun.mtu, nil
}
-func (tun *DummyTUN) Write(d []byte) (int, error) {
- tun.packets <- d
+func (tun *DummyTUN) Write(d []byte, offset int) (int, error) {
+ tun.packets <- d[offset:]
return len(d), nil
}
@@ -41,9 +41,9 @@ func (tun *DummyTUN) Events() chan TUNEvent {
return tun.events
}
-func (tun *DummyTUN) Read(d []byte) (int, error) {
+func (tun *DummyTUN) Read(d []byte, offset int) (int, error) {
t := <-tun.packets
- copy(d, t)
+ copy(d[offset:], t)
return len(t), nil
}