Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: avoid logging netcheck send errors if STUN is disabled #40

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

deansheather
Copy link
Member

This is a confusing log line to customers and happens when STUN is disabled. Also avoids the constant rebinding every 20 seconds which is pointless since we're not using the UDP socket at all in these situations.

func (m *DERPMap) HasSTUN() bool {
for _, r := range m.Regions {
for _, n := range r.Nodes {
if n.STUNPort > 0 && !n.STUNOnly {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we had this bug before, STUNPort: 0 just means the defaullt port. I'm confused on the !n.STUNOnly too, why would you want to exclude STUN only nodes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to if n.StunPort >= 0

@deansheather deansheather merged commit c821c9c into main Sep 21, 2023
@deansheather deansheather deleted the dean/avoid-netcheck-send-error-log branch September 21, 2023 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants