5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-26 10:41:40 +00:00

Revert "TUN_OFFSET_BYTES per platform"

This reverts commit 85c5bc61ac.
This commit is contained in:
Neil Alexander 2019-11-24 21:09:29 +00:00
parent 85c5bc61ac
commit 8f323b740d
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944
6 changed files with 3 additions and 11 deletions

View File

@ -9,6 +9,8 @@ import (
"github.com/Arceliar/phony" "github.com/Arceliar/phony"
) )
const TUN_OFFSET_BYTES = 4
type tunWriter struct { type tunWriter struct {
phony.Inbox phony.Inbox
tun *TunAdapter tun *TunAdapter

View File

@ -15,8 +15,6 @@ import (
wgtun "golang.zx2c4.com/wireguard/tun" wgtun "golang.zx2c4.com/wireguard/tun"
) )
const TUN_OFFSET_BYTES = 0
const SIOCSIFADDR_IN6 = (0x80000000) | ((288 & 0x1fff) << 16) | uint32(byte('i'))<<8 | 12 const SIOCSIFADDR_IN6 = (0x80000000) | ((288 & 0x1fff) << 16) | uint32(byte('i'))<<8 | 12
type in6_addrlifetime struct { type in6_addrlifetime struct {

View File

@ -15,8 +15,6 @@ import (
wgtun "golang.zx2c4.com/wireguard/tun" wgtun "golang.zx2c4.com/wireguard/tun"
) )
const TUN_OFFSET_BYTES = 0
// Configures the "utun" adapter with the correct IPv6 address and MTU. // Configures the "utun" adapter with the correct IPv6 address and MTU.
func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error { func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error {
if ifname == "auto" { if ifname == "auto" {

View File

@ -9,8 +9,6 @@ import (
wgtun "golang.zx2c4.com/wireguard/tun" wgtun "golang.zx2c4.com/wireguard/tun"
) )
const TUN_OFFSET_BYTES = 0
// Configures the TUN adapter with the correct IPv6 address and MTU. // Configures the TUN adapter with the correct IPv6 address and MTU.
func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error { func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error {
if ifname == "auto" { if ifname == "auto" {

View File

@ -9,8 +9,6 @@ import (
wgtun "golang.zx2c4.com/wireguard/tun" wgtun "golang.zx2c4.com/wireguard/tun"
) )
const TUN_OFFSET_BYTES = 0
// Configures the TUN adapter with the correct IPv6 address and MTU. // Configures the TUN adapter with the correct IPv6 address and MTU.
func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error { func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error {
iface, err := wgtun.CreateTUN(ifname, mtu) iface, err := wgtun.CreateTUN(ifname, mtu)

View File

@ -2,8 +2,6 @@
package tuntap package tuntap
// This is to catch Windows platforms
import ( import (
"bytes" "bytes"
"errors" "errors"
@ -18,7 +16,7 @@ import (
"golang.zx2c4.com/wireguard/windows/tunnel/winipcfg" "golang.zx2c4.com/wireguard/windows/tunnel/winipcfg"
) )
const TUN_OFFSET_BYTES = 4 // This is to catch Windows platforms
// Configures the TUN adapter with the correct IPv6 address and MTU. // Configures the TUN adapter with the correct IPv6 address and MTU.
func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error { func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error {