[PATCH 5/7] helper_test: adapt to TUNDevice interface change

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


Broken in 996c7c4 ("Removed IFF_NO_PI from TUN linux", 2017-12-04).

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

diff --git a/src/helper_test.go b/src/helper_test.go
index 46bb782..99eb5d6 100644
--- a/src/helper_test.go
+++ b/src/helper_test.go
@@ -20,14 +20,14 @@ func (tun *DummyTUN) File() *os.File {
 	return nil
 }
 
-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
 }
 
-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
 }
 
-- 
2.15.1



More information about the WireGuard mailing list