Add OpenBSD tun driver support

This commit is contained in:
Jason A. Donenfeld
2018-05-22 15:17:35 +02:00
parent 794e494802
commit d6b694e161
6 changed files with 411 additions and 36 deletions

View File

@@ -154,7 +154,7 @@ func CreateTUN(name string) (TUNDevice, error) {
tun, err := CreateTUNFromFile(os.NewFile(uintptr(fd), ""))
if err == nil && name == "utun" {
fname := os.Getenv("WG_DARWIN_UTUN_NAME_FILE")
fname := os.Getenv("WG_TUN_NAME_FILE")
if fname != "" {
ioutil.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
}