From c1bcd1edf710b4050a87904d0a471285b8547cba Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Tue, 19 Mar 2024 22:50:31 -0400 Subject: [PATCH] Add the ability to disable Link-Local answer pion/ice doesn't gather Link-Local addresses, these answers break connectivity --- config.go | 3 +++ conn.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/config.go b/config.go index 50a7a57..3e211db 100644 --- a/config.go +++ b/config.go @@ -41,6 +41,9 @@ type Config struct { // IncludeLoopback will include loopback interfaces to be eligble for queries and answers. IncludeLoopback bool + // DisableLinkLocal disables answering with the Link-Local Address + DisableLinkLocal bool + // Interfaces will override the interfaces used for queries and answers. Interfaces []net.Interface } diff --git a/conn.go b/conn.go index e8aa392..f73fb27 100644 --- a/conn.go +++ b/conn.go @@ -877,6 +877,10 @@ func (c *Conn) readLoop(name string, pktConn ipPacketConn, inboundBufferSize int continue } + if config.DisableLinkLocal && ipCopy.IsLinkLocalUnicast() { + continue + } + selectedIP = ipCopy break }