1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-07-01 08:10:22 +08:00

fix allowed ips error

This commit is contained in:
fumiama
2021-12-30 15:36:27 +08:00
parent f91507fe6a
commit 561392dc0d
2 changed files with 5 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ func (m *Me) AddPeer(peerip string, pubicKey *[32]byte, endPoint string, allowed
l.endpoint = e
}
if allowedIPs != nil {
l.allowedips = make([]*net.IPNet, len(allowedIPs))
l.allowedips = make([]*net.IPNet, 0, len(allowedIPs))
for _, ipnet := range allowedIPs {
_, cidr, err := net.ParseCIDR(ipnet)
if err == nil {