Hi, In recent versions of openvpn, with "management localhost xxx" openvpn management interface listens on "[::1]:xxx" on most machines including windows. Looking at the code, ::1 makes sense as getaddrinfo is called with AF_UNSPEC and the first address in the list returned is used. I'm trying to support this correctly in the GUI and have a question:
Is it ok to rely on the order in which addresses are returned by getaddrinfo (with the same hints) -- especially on windows? Or, how best to make sure openvpn's interpretation of the host is the same as that of the GUI? I would prefer to avoid having to try all addresses in the list. On linux, apparently, getaddrinfo returns entries for localhost in /etc/hosts re-ordered as per RFC 3484 (as per the manpage) unless modified by gai.conf settings. How does it work on windows?[*] Previously this has not been an issue, as the GUI crafts the command line with "--management 127.0.0.1 stdin". I'm trying to support any "management .." line specified in the config file, which is useful for controlling always on connections (say, started by nssm or openvpnserv), among other things.. Even otherwise, using "localhost" instead of 127.0.0.1 looks better.. Thanks, Selva [*] No mention in MSDN of the order of addresses or whether it could be altered by some settings
