Update platform defaults, handling of 'auto' on Linux/Darwin

This commit is contained in:
Neil Alexander 2019-11-22 20:07:08 +00:00
parent 15726fe90d
commit 7d00206f4b
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
6 changed files with 9 additions and 28 deletions

View file

@ -17,6 +17,9 @@ import (
// Configures the "utun" adapter with the correct IPv6 address and MTU.
func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error {
if ifname == "auto" {
ifname = "utun"
}
iface, err := wgtun.CreateTUN(ifname, mtu)
if err != nil {
panic(err)

View file

@ -11,6 +11,9 @@ import (
// Configures the TUN adapter with the correct IPv6 address and MTU.
func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error {
if ifname == "auto" {
ifname = "\000"
}
iface, err := wgtun.CreateTUN(ifname, mtu)
if err != nil {
panic(err)