1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-27 14:20:27 +08:00

完善路由表

This commit is contained in:
fumiama
2021-12-28 15:47:21 +08:00
parent a9abad93d3
commit c707e4d90a
7 changed files with 71 additions and 14 deletions

View File

@@ -46,7 +46,7 @@ func (m *Me) AddPeer(peerip string, pubicKey *[32]byte, endPoint string, allowed
_, cidr, err := net.ParseCIDR(ipnet)
if err == nil {
l.allowedips = append(l.allowedips, cidr)
l.me.router.routetable[cidr.String()] = append(l.me.router.routetable[cidr.String()], l)
l.me.router.SetItem(cidr, l)
}
}
}