The IP addresses are de/serialized using long2ip and ip2long, which only support ipv4.

inet_ntop and inet_pton work with both ipv4 and ipv6 but use a different format.

IP addresses need to be converted with long2ip to a string and then serialized with inet_pton in hook_update_N().

CommentFileSizeAuthor
#4 1936276-d7-ipv6-4.patch3.3 KBbluegeek9

Issue fork visitors-1936276

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bluegeek9’s picture

Issue summary: View changes

It looks like 45 characters are needed for IPv6.

https://stackoverflow.com/a/166157

bluegeek9’s picture

Version: 7.x-1.4 » 7.x-1.x-dev

The ip address uses long2ip and ip2long which only references IPv4.

inet_ntop and inet_pton mention both IPv4 and IPv6.

The database field should probably be a big unsigned int.

bluegeek9’s picture

Issue summary: View changes
bluegeek9’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev
Assigned: Unassigned » bluegeek9
StatusFileSize
new3.3 KB

Patch for 7.x-1.x

bluegeek9’s picture

Version: 8.x-2.x-dev » 7.x-1.x-dev

bluegeek9’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev

bluegeek9’s picture

Status: Active » Fixed

Adds ipv6 support to 8.x-2.x

  • bluegeek9 committed 7ab9823 on 8.x-2.x
    Issue #1936276 by bluegeek9: IPv6 in database
    
bluegeek9’s picture

Assigned: bluegeek9 » Unassigned

  • bluegeek9 committed f63cf34 on 7.x-1.x
    Issue #1936276 by bluegeek9: IPv6 in database
    

  • bluegeek9 committed 101f09a on 8.x-2.x
    Issue #1936276 by bluegeek9: IPv6 in database
    

  • bluegeek9 committed 1a747b8 on 8.x-2.x
    Issue #1936276 by bluegeek9: IPv6 in database
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.