add CIDR subnet properly

This commit is contained in:
Callan Bryant 2020-10-26 08:08:39 +00:00
parent e7da49c1a8
commit 7bbe28a145
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA

9
add.go
View File

@ -3,6 +3,7 @@ package dsnet
import (
"fmt"
"os"
"net"
"text/template"
"time"
)
@ -123,6 +124,14 @@ func PrintPeerCfg(peer PeerConfig, conf *DsnetConfig) {
"Keepalive": time.Duration(KEEPALIVE).Seconds(),
"AllowedIPs": allowedIPs,
"Cidrmask": cidrmask,
"Address": net.IPNet{
IP: peer.IP,
Mask: conf.Network.IPNet.Mask,
},
"Address6": net.IPNet{
IP: peer.IP6,
Mask: conf.Network6.IPNet.Mask,
},
})
check(err)
}