From 330b986aa40a8d9ce0c751fc7fe357ec2777aa88 Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Sat, 24 Oct 2020 21:08:12 +0100 Subject: [PATCH] ipallocated -- also check ipv6 --- configtypes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configtypes.go b/configtypes.go index 7080864..449c264 100644 --- a/configtypes.go +++ b/configtypes.go @@ -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 }