Skip to content

Conversation

Hugal31
Copy link
Contributor

@Hugal31 Hugal31 commented Jun 11, 2025

This PR does two things:

When listening on an unspecified IP address (i.e. 0.0.0.0 and [::]):

  1. If a binding interface is specified, do not filter out localhost addresses. Rational: we'll only get localhost addresses if the bound interface is the loopback interface (at least on Unix systems, someone correct me on Windows?)
  2. If the list of IP locator is empty and we didn't specify any interface, manually add a localhost locator.

Note that is has the side effect of adding the localhost locator to the list even if there is already another non-ip locator (e.g. Unix socket, ...). I think that's all-right.

Closes #1989

Copy link

PR missing one of the required labels: {'new feature', 'dependencies', 'enhancement', 'breaking-change', 'bug', 'documentation', 'internal'}

Copy link

codecov bot commented Jun 11, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.85%. Comparing base (392ea49) to head (7f08327).
⚠️ Report is 51 commits behind head on main.

Files with missing lines Patch % Lines
commons/zenoh-util/src/net/mod.rs 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1990      +/-   ##
==========================================
- Coverage   71.02%   70.85%   -0.18%     
==========================================
  Files         365      365              
  Lines       61617    61630      +13     
==========================================
- Hits        43766    43668      -98     
- Misses      17851    17962     +111     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Hugal31 Hugal31 changed the title Publish locator if no other locators are avalable or when binding to the localhost interface. Publish localhost locator if no other locators are avalable or when binding to the localhost interface. Jun 25, 2025
@milyin milyin added the bug Something isn't working label Aug 4, 2025
@milyin milyin requested a review from OlivierHecart August 4, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zenoh never advertise localhost locator even if it's the only one available
2 participants