From beb50b3d7cf71b511636ce5429b7da0a9ab7896e Mon Sep 17 00:00:00 2001
From: "Mohamed S. Mahmoud" <mmahmoud@redhat.com>
Date: Tue, 11 Apr 2023 14:18:26 -0400
Subject: [PATCH] NETOBSERV-977: some interfaces could have both ipv4 and ipv6
 linklocal (#108)

We need to filter out those interfaces when we decide which
socket type to use to connect to google dns server

Signed-off-by: msherif1234 <mmahmoud@redhat.com>
---
 pkg/agent/ip.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/agent/ip.go b/pkg/agent/ip.go
index fccb23ad..ef52d01d 100644
--- a/pkg/agent/ip.go
+++ b/pkg/agent/ip.go
@@ -113,7 +113,7 @@ func findAddress(addrs []net.Addr, ipType string) (net.IP, bool) {
 }
 
 func getIP(pip net.IP, ipType string) (net.IP, bool) {
-	if pip == nil || pip.IsLoopback() {
+	if pip == nil || pip.IsLoopback() || pip.IsLinkLocalUnicast() {
 		return nil, false
 	}
 	switch ipType {
-- 
GitLab