Forum OpenACS Development: Re: NaviServer on Windows: [ns_info address] returns IP v6 address
The US is already out of IPv4 addresses , so IPv6 will become more visible world-wide (see e.g. ). One option seems to be to change the priorities in windows to prefer IPv4 over IPv6 [3,4]. Another option would be to add an option to naviserver "ns_info address -prefer ipv4" (and maybe simiar commands), but in cases, where there is no ipv4 address assigned, this will fail.
Nice argument, but sorry, the behavior of ns_info address is
a) incorrect according to the man page,
b) incorrect according to the last AOLserver and
c) incorrect for our use-case.
We can't get much closer to the definition of a bug. And we don't have a single customer who'd enter a IPv6 IP-Address manually in a browser.
I've had to invest another 3 hours to create a robust and multi-platform parser for ifconfig and ipconfig, because I can't wait for you to finish this stuff.
About fixing this command: Let the man page guide you: "Primary IP address of this machine" is a pretty intuitive concept that works in 95% or all cases. Otherwise you've got a pretty useless command in your API...
Why don't you revert to the code in AOLserver?
I got the "bug" - my bug. I assumed that ns_info address on AOLserver 4.5.1 Linux as intuitively required. But it doesn't. I've just installed AOLserver 4.5.1 and checked.
So both system implement ns_info address in the same way, and reverting wouldn't fix my issue.
Conclusion: You could change the implementation in NaviServer in order to prefer the IPv4 address over the IPv6 address. But otherwise everything is like it was.
=> We'll work with our own implementation of extracting the IP from ifconfig/ipconfig tool output.
ns_addrbyhost -all [ns_info hostname]