Bug 592850 - vsftpd binds to both ipv4 and ipv6 addresses when listen_ipv6 is enabled
Summary: vsftpd binds to both ipv4 and ipv6 addresses when listen_ipv6 is enabled
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: vsftpd
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Jiri Skala
QA Contact: Aleš Mareček
Depends On:
Blocks: 450853
TreeView+ depends on / blocked
Reported: 2010-05-17 07:42 UTC by Radek Bíba
Modified: 2016-06-22 09:33 UTC (History)
5 users (show)

Fixed In Version: vsftpd-2.2.2-5.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-07-02 19:57:28 UTC
Target Upstream Version:

Attachments (Terms of Use)
The patch sets socket option to listen on IPv6 only (1.60 KB, patch)
2010-05-17 09:50 UTC, Jiri Skala
mhlavink: review+
Details | Diff

Description Radek Bíba 2010-05-17 07:42:32 UTC
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):

Comment 1 RHEL Program Management 2010-05-17 07:55:15 UTC
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

Comment 2 Jiri Skala 2010-05-17 09:50:15 UTC
Created attachment 414499 [details]
The patch sets socket option to listen on IPv6 only

Comment 6 releng-rhel@redhat.com 2010-07-02 19:57:28 UTC
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.

Comment 7 David Woodhouse 2011-07-14 17:05:08 UTC
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).

Comment 8 Vadim Grinco 2012-07-11 11:48:33 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.