Details

    • Task
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.0.13
    • None
    • None

    Description

      If a mariadb is configured to bind to a hostname, it should be possible for it to bind to both the ipv4 and ipv6 addresses defined for that hostname if the host is set up that way. This is the standard behavior with server software (openldap, postfix, apache, etc). Most also include options to force binding only to a specific ip protocol if desired. This is helpful for dual stack systems where it may be desired to have a server bind to both the ipv4 and ipv6 addresses for serving clients.

      Attachments

        Issue Links

          Activity

            arjen Arjen Lentz added a comment - - edited

            Stock MySQL 5.5 and above has a mechanism for this.
            http://dev.mysql.com/doc/refman/5.5/en/ipv6-server-config.html

            It appears MariaDB 10.0.9 does all or most of that, but I'm not certain it's all documented.
            It's just quietly there

            arjen Arjen Lentz added a comment - - edited Stock MySQL 5.5 and above has a mechanism for this. http://dev.mysql.com/doc/refman/5.5/en/ipv6-server-config.html It appears MariaDB 10.0.9 does all or most of that, but I'm not certain it's all documented. It's just quietly there

            elenst, could you please check what of this is not merged and what of this is not documented?

            serg Sergei Golubchik added a comment - elenst , could you please check what of this is not merged and what of this is not documented?

            serg, results of the functionality check are below.

            However, I'm not sure the functionality described at http://dev.mysql.com/doc/refman/5.6/en/ipv6-server-config.html is quite the same as the reporter initially requested.

            To my understanding, the request is that if we run the server with bind-address=hostname, and we have both IPv4 and IPv6 in the host configuration for this hostname, the server should accept both IPv4 and IPv6 connections (but only those that relate to this hostname). It does not seem to be happening now; instead, upon server startup, the hostname is resolved to something, either IPv4 or IPv6, and further it works as if we provided the corresponding address upon startup.

            Regarding documentation, I haven't found anything about IPv6 support in MariaDB KB, so Arjen's comment is pretty accurate in this part.


            My /etc/hosts

            127.0.0.1	localhost
            127.0.1.1	saucy64
            ::1		saucy64
            10.0.2.15	saucy64
             
            # The following lines are desirable for IPv6 capable hosts
            ::1     ip6-localhost ip6-loopback
            fe00::0 ip6-localnet
            ff00::0 ip6-mcastprefix
            ff02::1 ip6-allnodes
            ff02::2 ip6-allrouters

            I've checked the following combinations:

            servers: mysql-5.5.37, mysql-5.6.17, mariadb-5.5.37, mariadb-10.0.10
            ipv6.disable: 0, 1
            bind-address: default, *, 0.0.0.0, ::, ::1, ::ffff:127.0.0.1, 10.0.2.15, 127.0.0.1, saucy64
            host value in client params: localhost, 127.0.0.1, 10.0.2.15, saucy64, ::1, ::ffff:127.0.0.1

            User configuration:

            +--------+-----------+
            | user   | host      |
            +--------+-----------+
            | elenst | 10.0.2.15 |
            | elenst | 127.0.0.1 |
            | elenst | ::1       |
            | elenst | localhost |
            | elenst | saucy64   |
            +--------+-----------+

            Results:

            Between MySQL 5.6 and MariaDB 10.0, there is a piece of functionality apparently not merged into 10.0.

            MySQL 5.6 has a special value '*' for bind-address:

            If the address is *, the server accepts TCP/IP connections on all server host IPv6 and IPv4 interfaces if the server host supports IPv6, or accepts TCP/IP connections on all IPv4 addresses otherwise. Use this address to permit both IPv4 and IPv6 connections on all server interfaces.

            Thus, this special value only makes sense if we want a universal configuration which would allow all possible connections, and which would work both on IPv6-enabled and IPv6-disabled machines.
            There is no such possibility in MariaDB 10.0 now. The closest one is '::', but if it's set on an IPv6-disabled host, the server won't start.

            In MySQL/MariaDB 5.5 and MariaDB 10.0, '*' works identically to 0.0.0.0 – that is, it doesn't allow IPv6 connections.

            –

            Between MySQL 5.5 and MariaDB 5.5/10.0, I haven't found any functionality that would not be merged from MySQL to MariaDB, but name resolving works differently and thus causes different results:

            In some cases, where MySQL 5.5 resolves the connecting user to elenst@saucy64, MariaDB resolves it to elenst@10.0.2.15.
            The difference is not observed with MySQL 5.6

            Also, the following is true for MySQL (both 5.5 and 5.6) vs MariaDB (both 5.5 and 10.0):

            If bind address is a host name, and the host configuration offers different variants for resolving it, MySQL intentionally prefers ipv4 over ipv6 (there is a comment about it in the code). MariaDB doesn't do it. As a result, the following combination works differently on MySQL and MariaDB:

            ipv6: enabled
            bind-address: saucy64

            MariaDB allows to connect with --host=::1, but not 127.0.1.1
            MySQL allows to connect with --host=127.0.1.1, but not ::1

            elenst Elena Stepanova added a comment - serg , results of the functionality check are below. However, I'm not sure the functionality described at http://dev.mysql.com/doc/refman/5.6/en/ipv6-server-config.html is quite the same as the reporter initially requested. To my understanding, the request is that if we run the server with bind-address=hostname , and we have both IPv4 and IPv6 in the host configuration for this hostname, the server should accept both IPv4 and IPv6 connections (but only those that relate to this hostname). It does not seem to be happening now; instead, upon server startup, the hostname is resolved to something , either IPv4 or IPv6, and further it works as if we provided the corresponding address upon startup. Regarding documentation, I haven't found anything about IPv6 support in MariaDB KB, so Arjen's comment is pretty accurate in this part. My /etc/hosts 127.0.0.1 localhost 127.0.1.1 saucy64 ::1 saucy64 10.0.2.15 saucy64   # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters I've checked the following combinations: servers: mysql-5.5.37, mysql-5.6.17, mariadb-5.5.37, mariadb-10.0.10 ipv6.disable: 0, 1 bind-address: default, *, 0.0.0.0, ::, ::1, ::ffff:127.0.0.1, 10.0.2.15, 127.0.0.1, saucy64 host value in client params: localhost, 127.0.0.1, 10.0.2.15, saucy64, ::1, ::ffff:127.0.0.1 User configuration: +--------+-----------+ | user | host | +--------+-----------+ | elenst | 10.0.2.15 | | elenst | 127.0.0.1 | | elenst | ::1 | | elenst | localhost | | elenst | saucy64 | +--------+-----------+ Results: Between MySQL 5.6 and MariaDB 10.0, there is a piece of functionality apparently not merged into 10.0. MySQL 5.6 has a special value '*' for bind-address: If the address is *, the server accepts TCP/IP connections on all server host IPv6 and IPv4 interfaces if the server host supports IPv6, or accepts TCP/IP connections on all IPv4 addresses otherwise. Use this address to permit both IPv4 and IPv6 connections on all server interfaces. Thus, this special value only makes sense if we want a universal configuration which would allow all possible connections, and which would work both on IPv6-enabled and IPv6-disabled machines. There is no such possibility in MariaDB 10.0 now. The closest one is '::', but if it's set on an IPv6-disabled host, the server won't start. In MySQL/MariaDB 5.5 and MariaDB 10.0, '*' works identically to 0.0.0.0 – that is, it doesn't allow IPv6 connections. – Between MySQL 5.5 and MariaDB 5.5/10.0, I haven't found any functionality that would not be merged from MySQL to MariaDB, but name resolving works differently and thus causes different results: In some cases, where MySQL 5.5 resolves the connecting user to elenst@saucy64, MariaDB resolves it to elenst@10.0.2.15. The difference is not observed with MySQL 5.6 Also, the following is true for MySQL (both 5.5 and 5.6) vs MariaDB (both 5.5 and 10.0): If bind address is a host name, and the host configuration offers different variants for resolving it, MySQL intentionally prefers ipv4 over ipv6 (there is a comment about it in the code). MariaDB doesn't do it. As a result, the following combination works differently on MySQL and MariaDB: ipv6: enabled bind-address: saucy64 MariaDB allows to connect with --host=::1, but not 127.0.1.1 MySQL allows to connect with --host=127.0.1.1, but not ::1

            The original feature request is not something we can do in 10.0, to listen on many addresses one would need to open many sockets and MariaDB cannot easily do that, it's a big change.

            But I can make --bind=* to work on both ipv4 and ipv6 addresses.

            serg Sergei Golubchik added a comment - The original feature request is not something we can do in 10.0, to listen on many addresses one would need to open many sockets and MariaDB cannot easily do that, it's a big change. But I can make --bind=* to work on both ipv4 and ipv6 addresses.

            Ok to push!

            svoj Sergey Vojtovich added a comment - Ok to push!

            --bind=* was already always binding to ipv4 and ipv6 last time I used it, at least as far back as mysql 5.5.

            This problem is not fixed. Please reopen

            quanah Quanah Gibson-Mount (Inactive) added a comment - --bind=* was already always binding to ipv4 and ipv6 last time I used it, at least as far back as mysql 5.5. This problem is not fixed. Please reopen

            how --bind=* works depends on the order of entries that getaddinfo() returns on your system. It might work, on my laptop it didn't, only listened on IPv4.

            I don't want to reopen, the changelog for 10.0.13 contains MDEV-4379, and we cannot change it, bzr history is immutable. I'll create a new issue for this task. See MDEV-6536.

            serg Sergei Golubchik added a comment - how --bind=* works depends on the order of entries that getaddinfo() returns on your system. It might work, on my laptop it didn't, only listened on IPv4. I don't want to reopen, the changelog for 10.0.13 contains MDEV-4379 , and we cannot change it, bzr history is immutable. I'll create a new issue for this task. See MDEV-6536 .

            People

              serg Sergei Golubchik
              quanah Quanah Gibson-Mount (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.