add CIDR subnet properly
This commit is contained in:
parent
e7da49c1a8
commit
7bbe28a145
9
add.go
9
add.go
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user