From 551a592a7102be8de3a4a3dfc0463e54c0581b8b Mon Sep 17 00:00:00 2001 From: afeiszli Date: Mon, 25 Apr 2022 22:06:33 -0400 Subject: [PATCH] fix iface on update --- netclient/wireguard/common.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/netclient/wireguard/common.go b/netclient/wireguard/common.go index 5b9d8610..26ce7686 100644 --- a/netclient/wireguard/common.go +++ b/netclient/wireguard/common.go @@ -435,12 +435,14 @@ func UpdateWgInterface(file, privateKey, nameserver string, node models.Node) er } wireguard.Section(section_interface).Key("PrivateKey").SetValue(privateKey) wireguard.Section(section_interface).Key("ListenPort").SetValue(strconv.Itoa(int(node.ListenPort))) - if node.Address != "" { - wireguard.Section(section_interface).Key("Address").SetValue(node.Address) - } + addrString := node.Address if node.Address6 != "" { - wireguard.Section(section_interface).Key("Address").SetValue(node.Address6) + if addrString != "" { + addrString += "," + } + addrString += node.Address6 } + wireguard.Section(section_interface).Key("Address").SetValue(addrString) //if node.DNSOn == "yes" { // wireguard.Section(section_interface).Key("DNS").SetValue(nameserver) //}