Skip to content

Commit

Permalink
Add the ability to disable Link-Local answer
Browse files Browse the repository at this point in the history
pion/ice doesn't gather Link-Local addresses, these answers break
connectivity
  • Loading branch information
Sean-Der committed Mar 20, 2024
1 parent 28bb42c commit c1bcd1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 4 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,10 @@ func (c *Conn) readLoop(name string, pktConn ipPacketConn, inboundBufferSize int
continue

Check warning on line 877 in conn.go

View check run for this annotation

Codecov / codecov/patch

conn.go#L876-L877

Added lines #L876 - L877 were not covered by tests
}

if config.DisableLinkLocal && ipCopy.IsLinkLocalUnicast() {
continue

Check warning on line 881 in conn.go

View check run for this annotation

Codecov / codecov/patch

conn.go#L881

Added line #L881 was not covered by tests
}

selectedIP = ipCopy
break
}
Expand Down

0 comments on commit c1bcd1e

Please sign in to comment.