Repository navigation
refactoring: define our own interface struct to allow multiple addresses - #380
Merged
Merged
Conversation
Owner
Author
|
@hrzlgnm I would like invite you to take a look at this, and possibly run some quick test with this PR if possible. It's OK to skip if no time. |
Contributor
|
@keepsimple1 Did some quick tests on Linux and Windows. LGTM. |
hrzlgnm
reviewed
Aug 6, 2025
| HostIp::V6(v6) => { | ||
| if v6.scope_id.index != 0 { | ||
| write!(f, "{}%{}", v6.addr, v6.scope_id.index) | ||
| write!(f, "{}%{}", v6.addr, v6.scope_id.name) |
Contributor
There was a problem hiding this comment.
Please keep in mind, that the interface name is not usable on windows like this. As already discussed in:
#362 (comment)
Owner
Author
There was a problem hiding this comment.
I made the change during debugging and found it's helpful (on macOS and Linux), but forgot about it later. Thanks for the reminder. Now I updated it to use index on Windows and name on other platforms. Hope it's a meaningful trade-off?
hrzlgnm
approved these changes
Aug 6, 2025
Owner
Author
|
Thank you @hrzlgnm for reviewing! |
keepsimple1
added a commit
that referenced
this pull request
Nov 21, 2026
…t_bind (#555) _new_socket_bind() has been unused by the daemon since #380 switched to shared IPv4/IPv6 sockets; only test_service_with_temporarily_invalidated_ptr still called it. The test now uses one new_multicast_socket() per IP family, and send_dns_outgoing_impl selects the outgoing interface for each send.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is triggered by #377 as currently we would skip 2nd IP address on an interface due to
join_multicast_grouperror on the same interface. Strictly speaking, this is wrong and it can cause confusion in debugging asaddr 1is inZeroConf.my_intfsbutaddr 2(on the same interface) is not.Also, currently we directly use
Interfacefromif-addrscrate, but it is per address, not truly per interface. I took this opportunity to define a new interface struct for usMyIntfthat represents a network interface that supports multiple addresses.The diff is very extensive but conceptually really just
Interfaceis replaced byMyIntf.