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 }