Red Hat Bugzilla – Bug 592850
vsftpd binds to both ipv4 and ipv6 addresses when listen_ipv6 is enabled
Last modified: 2016-06-22 05:33:42 EDT
Description of problem: The 'listen' option is described this way: ...listens on IPv4 sockets. This directive cannot be used in conjunction with the listen_ipv6 directive. And 'listen_ipv6' this way: ...enables listening on IPv6 sockets. To listen on IPv4 and IPv6 sockets, you must run two copies of vsftpd with two configuration files. However, it turns out that vsftpd is reachable via both ipv4 and ipv6 when the former is disabled and the latter enabled. This is caused by the fact that the 'net.ipv6.bindv6only' kernel parameter is set to 0 by default in RHEL, so for any process that opens an ipv6 port, the same ipv4 port number is opened automatically. vsftpd should make sure that the server is accessible via ipv6 only in this case. It can be accomplished by appropriate setsockopt() flags. Version-Release number of selected component (if applicable): vsftpd-2.2.2-3.el6
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux major release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Major release. This request is not yet committed for inclusion.
Created attachment 414499 [details] The patch sets socket option to listen on IPv6 only
Red Hat Enterprise Linux Beta 2 is now available and should resolve the problem described in this bug report. This report is therefore being closed with a resolution of CURRENTRELEASE. You may reopen this bug report if the solution does not work for you.
The way I see it, this was a *documentation* bug. The documentation lied, and we should have changed the documentation to tell the truth. Changing the code to match the documentation has *broken* vsftpd, which no longer listens for Legacy IP connections and IPv6 at the same time. See related bug 450853. We should fix the documentation so that it makes it explicit that 'listen_ipv6=YES' also listens on Legacy IP (which fixes this bug). And we should change the default vsftpd.conf to make that the default (which fixes bug 450853).
I completely agree with David. I need to serve ftp over both IPv4 and IPv6 and I currently see no other way doing that than running two separate vsftpd instances - which is lame and completely wrong! Bug 839257 open to revert that change.