remove redundant allowed IP enumeration

This commit is contained in:
Callan Bryant 2020-10-27 22:00:21 +00:00
parent 0481996116
commit 112379c70a
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA

12
add.go
View File

@ -125,18 +125,6 @@ func Add() {
}
func PrintPeerCfg(peer PeerConfig, conf *DsnetConfig) {
allowedIPs := make([]JSONIPNet, 0, len(conf.Networks)+2)
if len(conf.Network.IPNet.Mask) > 0 {
allowedIPs = append(allowedIPs, conf.Network)
}
if len(conf.Network6.IPNet.Mask) > 0 {
allowedIPs = append(allowedIPs, conf.Network6)
}
allowedIPs = append(allowedIPs, conf.Networks...)
var peerConf string
switch os.Getenv("DSNET_OUTPUT") {