[MDEV-4051] INET6_ATON() and INET6_NTOA() Created: 2013-01-15  Updated: 2015-08-17  Resolved: 2014-06-02

Status: Closed
Project: MariaDB Server
Component/s: None
Fix Version/s: 10.0.12

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Alexander Barkov
Resolution: Fixed Votes: 9
Labels: upstream

Issue Links:
Duplicate
duplicates MDEV-784 LP:644070 - IPv6 handling functions Closed
duplicates MDEV-6036 Adding ipv6/ipv4 functions like in 5.6 Closed
Relates
relates to MDEV-274 The data type for IPv6/IPv4 addresses... Closed
relates to MDEV-7676 Update site information on IPv6 suppo... Closed

 Description   

Backport the following functions from MySQL-5.6:

  • INET6_ATON()
  • INET6_NTOA()
  • IS_IPV4()
  • IS_IPV4_COMPAT()
  • IS_IPV4_MAPPED()
  • IS_IPV6()


 Comments   
Comment by Aleai Sumity (Inactive) [ 2013-11-25 ]

Need datatype universal
store IPv4, IPv6, and MAC addresses
_________________________________
Name | Storage Size | Description
cidr | 12 or 24 bytes | IPv4 and IPv6 networks
inet | 12 or 24 bytes | IPv4 and IPv6 hosts and networks
macaddr | 6 bytes | MAC addresses

http://www.postgresql.org/docs/8.2/static/datatype-net-types.html

Comment by Joffrey MICHAIE (Inactive) [ 2013-12-17 ]

Hello,

Is there any plan to backport the feature to MariaDB 5.5 ?

Thanks in advance,
Joffrey

Comment by Sergei Golubchik [ 2014-03-03 ]

No, we cannot add new features to the 5.5-GA branch, only bug fixes can go there.

Comment by Aleai Sumity (Inactive) [ 2014-04-01 ]

https://bitbucket.org/watchmouse/mysql-udf-ipv6/overview

IPv6 and internationalized domain (IDNA) functions for MySQL
------------------------------------------------------------

======================
IMPORTANT NOTICE:

I'm very happy to see that as of MySQL 5.6.3 functions with an identical API seem to be provided by MySQL, but
with slightly different labels:

inet6_ntop() -> inet6_ntoa()
inet6_pton() -> inet6_atop()

I've created aliases towards the native functions in the latest release of this UDF, with which this
module should now provide you with a valid upgrade path. The native functions also operate on a VARBINARY(16).

When loading the functions in this UDF, all examples in the manual work out of the box on pre-5.6 versions of MySQL:

http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html#function_inet6-ntoa

======================

These are experimental runtime plug-in (UDF) for MySQL
that add basic IPv6 and IDNA functions that MySQL v5 is still lacking:

inet6_ntop and inet6_pton()
idna_to_ascii() and idna_from_ascii()

These files are experimental and provided as-is under a EUPL license.

Pieter Ennes (pieter@watchmouse.com)

Copyright ©2009-2011 WatchMouse

LICENSE
-------

Licensed under the EUPL, Version 1.1 or – as soon they will be approved
by the European Commission - subsequent versions of the EUPL (the "Licence");
You may not use this work except in compliance with the Licence. You may
obtain a copy of the Licence at:

http://ec.europa.eu/idabc/eupl

Unless required by applicable law or agreed to in writing, software
distributed under the Licence is distributed on an "AS IS" basis,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence.

Comment by Sergey Vojtovich [ 2014-04-11 ]

Additional relevant patches:

revno: 4162
committer: Alexander Nozdrin <alexander.nozdrin@oracle.com>
branch nick: 5.6
timestamp: Fri 2012-08-24 11:29:02 +0400
message:
  Patch for Bug#14483430 (RECONSIDER MYSQL 5.6.6 BIND-ADDRESS BEHAVIOUR
  WHEN CONFIGURED AS DEFAULT *).
 
  The bug was introduced by WL#6301 (Change default value for the 'bind-address' option).
 
  The user visible problem was that the server didn't start with the default value
  of bind-address, which is '*'. The star means that the server should choose
  '::' or '0.0.0.0' depending on whether IPv6 is available on the box or not.
 
  The IPv6 detection was implemented by calling getaddrinfo() for the IPv6-address.
  It turned out, it is not enough -- getaddrinfo() might successfully return, but later
  OS failed to create an IPv6-socket. This problem is platform dependent
  (reproduced on CentOS 5.2).
 
  The fix is to make the check more strict -- try to create a dummy IPv6-socket
  after getaddrinfo() succeeds.
 
  No test case for the bug since it is platform specific.
    ------------------------------------------------------------
    revno: 3690.68.26
    committer: Alexander Nozdrin <alexander.nozdrin@oracle.com>
    branch nick: trunk
    timestamp: Wed 2012-06-20 13:14:59 +0400
    message:
      Patch for WL#6301 (Change default value for the 'bind-address' option).
 
      The patch consists of two parts:
 
        - the patch introduces a new special value for the bind-address
          option: * (a star). This value means, the server should listen to
          all network addresses, both IPv6 (if available) and IPv4.
 
        - the patch changes the bind-address default value to star (*).
        ------------------------------------------------------------
        revno: 3690.50.2
        committer: Alexander Nozdrin <alexander.nozdrin@oracle.com>
        branch nick: trunk
        timestamp: Fri 2012-06-01 12:26:25 +0400
        message:
          WL#6301: Change default value for the 'bind-address' option.
 
          The patch temporarily reverts the default value to 0.0.0.0.
    ------------------------------------------------------------
    revno: 3690.34.31
    committer: Alexander Nozdrin <alexander.nozdrin@oracle.com>
    branch nick: trunk
    timestamp: Thu 2012-05-31 12:58:12 +0400
    message:
      Patch for WL#6301 (Change default value for the 'bind-address' option).
 
      The patch changes the bind-address default value (from '0.0.0.0' to '::') and
      does the following cosmetic changes:
 
        - it adds a startup warning if the server failed to reset the IPV6_V6ONLY
          flag on the server socket;
 
        - it uses vio_getnameinfo() instead of vio_get_normalized_ip_string()
          to print out IP addresses on startup. That's needed in order to output
          IPv4-mapped IPv6 addresses properly
          (vio_get_normalized_ip_string() converts an IPv4-mapped IPv6 address
          to regular IPv4 address).

Comment by Martijn Otto [ 2014-05-05 ]

I was quite surprised to find out MariaDB 10.0 does not feature the native inet6_ntoa and inet6_aton functions. It seems like such a simple feature to implement. There is even a plugin mentioned (which we have been using for the last few years) that could be incorporated into MariaDB.

Generated at Thu Feb 08 06:53:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.