-
-
Notifications
You must be signed in to change notification settings - Fork 412
Define upsd option to LISTEN * as specifically handling both IPv4 and IPv6 "ANY" address
#2013
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
Conversation
… first [networkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…v6) due to lack of LISTEN directive [networkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… and end the loop while there seem to be more resolved addresses for it [networkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…kupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…Pv6 addresses, try to disable IPv4-mapping support [networkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Nice, nobody complained! |
…ically (for both IPv4 and IPv6 if we can) [networkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Also checked in a Windows build (MinGW x64) which out of the box is not dual-stack here: As a platform note, it seems to have had no qualms about listening several times on the same host:port though, at least for ANY addresses (here ...and can achieve even more by duplicating |
…ality of `require_IPV6_V6ONLY` for one use-case [networkupstools#2013 review, networkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Revised So it asks for IPv4 "any addr" first to check it is available on that port, then releases it, then asks for IPv6 (requesting that it only handles IPv6 - but not bailing on errors in response), then tries to take IPv4 port again (on decent OSes, this should succeed). The resulting build of somewhat simplified code works: BTW, earlier discussions did not I think stress the |
|
Finally, there were early ideas about checking if NUT was built with IPv6 support, or if the OS has So if some platform would hiccup on these, it would likely need more massaging than an |
|
I still think this is too complicated. We are asking for Vv6only=1, so it's a bug if that breaks v4. So just bind to v6 with v6only=1, and then bind to v4, and print an error if either fail, and be done with it. I don't think we have an example of where things go wrong and the sequence of try-4/release-4 is useful. There are too many lines of code in nut already, and we should be heading for fewer whenever possible. |
…orkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Yep, hence speaking of first iteration there. Taking small steps, all green :) |
|
FWIW, an artificial example (valid/invalid condition made broken) -- when one of the IP version ports IS in fact busy, but another works. Currently we do not define this as a failure - any successful port grab is okay (although we could... TOTHINK: if we wanted to get a port on an IPv6 AF but could not, and only got an IPv4 port - is it a fatal error?) |
…o see if we can, then release it, then get IPv6 and then IPv4 again [networkupstools#2013 review for networkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Normal behavior for this iteration with both AFs active is now to just take IPv6 (only=1 if OS would), then try to take IPv4: |
|
For CLI options |
…#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…h AF_INET and AF_INET6 (we have IPv4 and IPv6 capability everywhere, right?) [networkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Sorry, didn't realize that. Party on! |
…s to match current logic; drop GitHub reference [networkupstools#2013 review for networkupstools#2012] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…NY" address listener conflict, consult actual state in "canhaveAnyV6" and not the possibility via "serverAnyV6!=null" [networkupstools#2013] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
So, hopefully the small hackfest is over and the changeset is good to go? ;) |
...and fix some related issues
Closes: #2012
Testing:
CC @gdt @svarshavchik @clepple @aquette