Ever since 0.90 I cannot get both IPv4 and IPv6 to work concurrently with ZNC. Using the Listener4 option results in a IPv4 socket. Using the Listener6 option results in a IPv6 socket. Listener only provides a IPv6 socket and thus no working IPv4.
It's no problem if fstat or netstat show znc as only listening on a ipv6 port, one can configure an ipv6 port so that it also accepts ipv4 connections. At least I thought so. :-(
Which operating system is this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is done via explicitly setting IPV6_V6ONLY to the "right" value. AFAIK this socket option is even proposed in some RFC. The only OS I know where this doesn't work is old versions of windows (XP is the first release which supports this socket option).
I'll see if I can found an openbsd shell to reproduce this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
znc.conf got:
Listener = +1235
$ telnet 127.0.0.1 1235
Trying 127.0.0.1...
Connected to 127.0.0.1.
$ telnet ::1 1235
Trying ::1...
Connected to ::1.
Escape character is '^]'.
What am I doing "wrong"?
znc.conf has..
Listener = irc_only 6669
Listener = web_only 8080
ConnectDelay = 30
LoadModule = webadmin
plus a minimal user config.
$ znc
[ ok ] Opening Config [/home/bburns/.znc/configs/znc.conf]...
[ ok ] Binding to port [6669]...
[ ok ] Binding to port [8080]...
[ ** ] Loading user [bburns]
[ ok ] Loading Global Module [webadmin]... [/usr/local/lib/znc/webadmin.so]
[ ok ] Forking into the background... [pid: 1185]
[ ** ] ZNC 0.092 - http://znc.sourceforge.net
$ fstat | grep znc
bburns znc 1185 text /usr 1091546 -rwxr-xr-x r 1643261
bburns znc 1185 wd /home 1169280 drwxr-xr-x r 512
bburns znc 1185 0 / 2671 crw-rw-rw- r null
bburns znc 1185 1 / 2671 crw-rw-rw- w null
bburns znc 1185 2 / 2671 crw-rw-rw- w null
bburns znc 1185 3 /home 1195759 -rw-r--r-- r 182
bburns znc 1185 4* internet6 stream tcp 0xfffffe809ef8c060 *:6669
bburns znc 1185 5* internet6 stream tcp 0xfffffe809ef8c900 *:8080
As you can see. No IPv4 sockets.
$ telnet -4 localhost 6669
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
$ telnet -6 localhost 6669
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Hm, that works here without any problems.
It's no problem if fstat or netstat show znc as only listening on a ipv6 port, one can configure an ipv6 port so that it also accepts ipv4 connections. At least I thought so. :-(
Which operating system is this?
No. What you said is an assumption. The only portable and proper way of supporting both address families is to open a socket for each.
OS: OpenBSD.
This is done via explicitly setting IPV6_V6ONLY to the "right" value. AFAIK this socket option is even proposed in some RFC. The only OS I know where this doesn't work is old versions of windows (XP is the first release which supports this socket option).
I'll see if I can found an openbsd shell to reproduce this.
No. That does not work with OpenBSD. There is intentionally no support for v4-mapped addresses.
Closing as Wont Fix, but will add a warning when IPV6_V6ONLY is missing. Work-around is using "Listen4" and "Listen6" instead.