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

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>
(cherry picked from commit 9a3f45e9bf299914462aacb49abc88682f168030)
---
 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