5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 22:20:27 +00:00

make offset generic over TUN_OFFSET_BYTES so we can make this platform dependent

This commit is contained in:
Arceliar 2019-11-24 15:09:28 -06:00
parent f6f9b3ef76
commit 2982b53555

View File

@ -31,7 +31,7 @@ func (w *tunWriter) _write(b []byte) {
if n == 0 { if n == 0 {
return 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) util.PutBytes(b)
if err != nil { if err != nil {
w.tun.Act(w, func() { w.tun.Act(w, func() {