-
Notifications
You must be signed in to change notification settings - Fork 39
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
Should the daemon send the preset IPs to the browser #46
Comments
I agree. It was a trade-off that we moved to use Also feel free to share your thoughts regarding how we can fix or work around this. |
@fufesou To figure out what we should do for a host that resides in more than one LAN:
also cc @lu-zero @indietyp as I am interested in their thoughts too, and if they have seen related use cases. |
What you suggest is an approximation of knowing the routes available per interface and filter accordingly, either at the source or the destination or both ways. I have no idea if there is a portable abstraction we could rely on. What is the apple impl doing in this regard? |
I haven't yet had a use case where that would be the case, so cannot really comment on it. Sorry. |
@fufesou I've read the RFC 6762 again and here is what I think.
It means in your example, mDNS respond message should not include
this is also related to question 1 we have earlier:
Currently our API of this crate does not support specifying which interface to use for the daemon. If the host is multi homed, the daemon binds to To fix this part, we probably need to know the incoming interface, and track responses using interface and the service instance name. To do that, we might want to move back to use In summary, I think your original problem is the item 1 (response address filter) in this comment, and we can probably implement that as the first step. What do you think?
Did you mean Apple's Bonjour in macOS? (btw I just notice that RFC 6762 was written by Apple engineers). |
I consider their software (dns-ds & friends) a reference implementation because of that :) What is the problem in socket2 0.4 ? |
socket2 0.4 changes its signature of |
@keepsimple1 Sorry for late. I'm not very sure about the item 1(response address filter).
Netmask is provided in
|
yes I also noticed the I think we can :
I will give it a try locally. |
@fufesou based on what we discussed, I've drafted a diff in this gist. It builds OK and seems to be working for the basic local test. Since I don't have a lab setup to test multi-homed mDNS, are you interested in working on an actual PR to fix this issue? My gist is for you only as a reference, feel free to make changes / improvements. (I'm also OK if you would rather let me to do the fix, but then I probably would need your help for testing). |
Hi, my thoughts as following:
for (i, _) in self.respond_sockets.iter() {
// if i.ip == src_ip {
if (u32::from(i.ip) & u32::from(i.netmask))
== (u32::from(src_ip) & u32::from(i.netmask))
{
intf_opt = Some(i);
break;
}
} |
thanks @fufesou for your comment. Yes the ip check was not correct. I refactored the approach and avoid to use |
@keepsimple1 Looks good. But there is still one thing to confirm.
If IPs on one interface is not set to serve the service. And If |
Thanks @fufesou for checking. Indeed I noticed that later. I updated the diff to fix that, and added a new test case. Please take a look & check if works for your use case. You can also comment directly on the PR. |
Suppose we have some lans like the following:
B
send a query. IfA
's response contains172.21.5.234
, it will be confusing.In 'A''s response, the IP may be better set to the binding socket.
And I also think response may be better to send back to the interface, witch received the query. No need to send outging responses to all interfaces.
The text was updated successfully, but these errors were encountered: