-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Abort murmur if no ipv6 and no ipv4 are found. #1958
Conversation
It seems wrong to rely on the qFatal branch to be executed, and the daemon to be restarted. Is it not better to just use |
systemd docs recommend against it though: |
after=network-online.target is not reliable in my experience. Any daemon I have ever worked with has to solve this in one of two ways. Either exit if network is not up, or enter a loop and try until network is up. I prefer the first way as it lets the sysadmin have more control. I think that qFatal needs to be added somewhere regardless though. Murmur shouldn't continue if it has nothing to bind to. |
I think we need to rework the logic. Here: https://github.com/mumble-voip/mumble/blob/master/src/murmur/Meta.cpp#L225-L281 According to murmur.ini
If that's the case, we should check the system for ipv6/dual stack support and bind to :: , if ipv4 only bind to 0.0.0.0 The way the logic currently detects network support is a little bit silly and causing the root of our issues. I'll give it a shot and make a new PR. |
I think it is a bit tricky to get right. Mainly because we have to support Qt 4 and 5, as well as Windows, Linux and OS X. Officially, we're allowing Qt 4 for 1.3.0, but technically, it's only Linux and the other FOSS OSes. So in that regard, testing should be easier. [Now, the above was before I looked at the code...] I wonder why we don't just simplify the code to do:
And avoid the interface querying... |
@mkrautz Won't this make us try to create sockets which attempts to bind the same IPv4 stuff twice for the legacy fallback? Is that ok. Also what happens if you tell it to bind to an IPv6 socket on an IPv4 only system in the non-legacy part? Definitely would love to be able to simplify it like that though. Didn't think ahead this far after my first round of refactoring. |
ISTM that Qt 4 but when I don't see how that makes us listen twice? |
You are correct. Didn't think the |
Maybe we don't need it on Qt 5? Now that there is an explicit
|
Are you sure Qt 5 handles the non-dual-stack code path transparently? I somehow doubt that as it would have to manage two sockets under the hood which have to act like one to the user. Possible but surely not easy to do with the given interface of the socket classes. |
OK, so scrap that. It seems to me we have the same problem for Qt 4 and Qt 5. If the system is not dual stack, what happens on Qt 5 when...
The same applies to Qt 4. What happens when we...
Do you agree with that? |
If the above cases are the only problems left, we could transform the code into the following (pseudo code):
|
That would make dualstack our primary method, for sane, modern systems. And non-dualstack would involve querying the interfaces, and qFatal()'ing if none are available at daemon start. |
LGTM. Just throw in a comment or two in the fallback path ;) |
I am not implementing this at the moment. @fedpop Does the above sound good to you too? |
This is my fix for issue #1629 (and #1904)
It will exit murmur if it can not find any address to bind. Then init can manage the restart. The second commit alters murmur.service so that it won't fail due to ratelimit.
It works on master and 1.2.10.
Comments from mkrautz on IRC