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 ( import (
"fmt" "fmt"
"os" "os"
"net"
"text/template" "text/template"
"time" "time"
) )
@ -123,6 +124,14 @@ func PrintPeerCfg(peer PeerConfig, conf *DsnetConfig) {
"Keepalive": time.Duration(KEEPALIVE).Seconds(), "Keepalive": time.Duration(KEEPALIVE).Seconds(),
"AllowedIPs": allowedIPs, "AllowedIPs": allowedIPs,
"Cidrmask": cidrmask, "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) check(err)
} }