ipallocated -- also check ipv6

This commit is contained in:
Callan Bryant 2020-10-24 21:08:12 +01:00
parent 6d9c9c1912
commit 330b986aa4
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA

View File

@ -134,12 +134,12 @@ func (conf *DsnetConfig) MustRemovePeer(hostname string) {
}
func (conf DsnetConfig) IPAllocated(IP net.IP) bool {
if IP.Equal(conf.IP) {
if IP.Equal(conf.IP) || IP.Equal(conf.IP6) {
return true
}
for _, peer := range conf.Peers {
if IP.Equal(peer.IP) {
if IP.Equal(peer.IP) || IP.Equal(peer.IP6) {
return true
}