Skip to content

feat: Remove unneeded multicast send tracking - #377

Merged
keepsimple1 merged 1 commit into
keepsimple1:mainfrom
hrzlgnm:feat/remove-send-tracking
Aug 1, 2025
Merged

keepsimple1 merged 1 commit into
keepsimple1:mainfrom
hrzlgnm:feat/remove-send-tracking

Conversation

@hrzlgnm

@hrzlgnm hrzlgnm commented Jul 31, 2025 •

Copy link
Copy Markdown
Contributor

This became obsolete with #373, as we now only use at max one IPv4 and at max one IPv6 address per interface. This pr reverts #239

This became obsolete with keepsimple1#373, as we now only use at max one IPv4 and
at max one IPv6 address per interface.
@hrzlgnm

hrzlgnm commented Jul 31, 2025 •

Copy link
Copy Markdown
Contributor Author

I've played around with an added Counter for skipped multicast, and additional added addresses on the network interface and the counter never actually increased so I guess it is safe to remove that feature.

Comment thread src/service_daemon.rs

let mut outgoing_intfs = Vec::new();

for intf in self.my_intfs.iter() {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Although I would love to see any removal of unneeded code, I don't find the original issue (in #239) was gone.

It's true we no longer have separate sock for each intf, and use the common ipv4_sock and ipv6_sock. But we are still looping through self.my_intfs here, and if an interface has multiple addresses, multiple intf will show up and we will send out packet for each of them.

Maybe I've missed something, please let me know.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As far as I understand the following loop:

for intf in my_ifaddrs {
, we only add one IPv4 and one IPv6 address per interface, as a second bind to the respective address family fails and is skipped. That's what I've observed under Linux, not sure about the behavior of other platforms.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You are correct 👍 . I didn't realize that case, which would render the concerned code unneeded.

@keepsimple1 keepsimple1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM, thanks!

@keepsimple1
keepsimple1 merged commit 1b194de into keepsimple1:main Aug 1, 2025
@hrzlgnm
hrzlgnm deleted the feat/remove-send-tracking branch August 1, 2025 07:06
keepsimple1 added a commit that referenced this pull request Aug 7, 2025
…ses (#380)

This is triggered by #377 as currently we would skip 2nd IP address on an interface due to join_multicast_group error on the same interface. Strictly speaking, this is wrong and it can cause confusion in debugging as addr 1 is in ZeroConf.my_intfs but addr 2 (on the same interface) is not.

Also, currently we directly use Interface from if-addrs crate, but it is per address, not truly per interface. I took this opportunity to define a new interface struct for us MyIntf that represents a network interface that supports multiple addresses.

The diff is very extensive but conceptually really just Interface is replaced by MyIntf.
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