Skip to content

Instantly share code, notes, and snippets.

@cure
Last active October 20, 2020 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cure/a74de9ae15327bb565eff1e9f11ae085 to your computer and use it in GitHub Desktop.
Save cure/a74de9ae15327bb565eff1e9f11ae085 to your computer and use it in GitHub Desktop.
You'll need to tell your Yggdrasil-go to use your local checkout of the wireguard code, e.g. by updating your go.mod with a 'replace' line like this:
replace golang.zx2c4.com/wireguard => /path/to/your/wireguard-go
Then, patch your wireguard-go source tree like this:
wireguard-go$ git diff
diff --git a/tun/tun_linux.go b/tun/tun_linux.go
index 791e0be..511e17f 100644
--- a/tun/tun_linux.go
+++ b/tun/tun_linux.go
@@ -399,13 +399,13 @@ func CreateTUN(name string, mtu int) (Device, error) {
}
var ifr [ifReqSize]byte
- var flags uint16 = unix.IFF_TUN // | unix.IFF_NO_PI (disabled for TUN status hack)
+ var flags uint32 = unix.IFF_TUN | 0x0100000 // | unix.IFF_NO_PI (disabled for TUN status hack)
nameBytes := []byte(name)
if len(nameBytes) >= unix.IFNAMSIZ {
return nil, errors.New("interface name too long")
}
copy(ifr[:], nameBytes)
- *(*uint16)(unsafe.Pointer(&ifr[unix.IFNAMSIZ])) = flags
+ *(*uint32)(unsafe.Pointer(&ifr[unix.IFNAMSIZ])) = flags
_, _, errno := unix.Syscall(
unix.SYS_IOCTL,
And then go back to your yggdrasil source and use the `build` script to build yggdrasil.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment