From 2982b53555c54eb1952a52ad3788f9375ad9fe52 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sun, 24 Nov 2019 15:09:28 -0600 Subject: [PATCH] make offset generic over TUN_OFFSET_BYTES so we can make this platform dependent --- src/tuntap/iface.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tuntap/iface.go b/src/tuntap/iface.go index f1ca0ad..5eca3ae 100644 --- a/src/tuntap/iface.go +++ b/src/tuntap/iface.go @@ -31,7 +31,7 @@ func (w *tunWriter) _write(b []byte) { if n == 0 { return } - written, err = w.tun.iface.Write(append([]byte{0, 0, 0, 0}, b[:n]...), TUN_OFFSET_BYTES) + written, err = w.tun.iface.Write(append(make([]byte, TUN_OFFSET_BYTES), b[:n]...), TUN_OFFSET_BYTES) util.PutBytes(b) if err != nil { w.tun.Act(w, func() {