Skip to content

Commit

Permalink
Fix #1191: Ignore yggdrasil IP as public subnets (#1200)
Browse files Browse the repository at this point in the history
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
  • Loading branch information
LeeSmet authored Feb 25, 2021
1 parent 28f74c9 commit 1fe6b18
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/network/networker.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ func (n *networker) GetPublicIPv6Subnet() (net.IPNet, error) {
}

for _, addr := range addrs {
if addr.IP.IsGlobalUnicast() && !isULA(addr.IP) {
if addr.IP.IsGlobalUnicast() && !isULA(addr.IP) && !isYgg(addr.IP) {
return addr, nil
}
}
Expand Down Expand Up @@ -1088,3 +1088,12 @@ var ulaPrefix = net.IPNet{
func isULA(ip net.IP) bool {
return ulaPrefix.Contains(ip)
}

var yggPrefix = net.IPNet{
IP: net.ParseIP("200::"),
Mask: net.CIDRMask(7, 128),
}

func isYgg(ip net.IP) bool {
return yggPrefix.Contains(ip)
}

0 comments on commit 1fe6b18

Please sign in to comment.