Nowadays the module transforms the IPs to integers with the ip2long function for better performance and storage on dbs.
The ip2long function is only compatible with ipv4 not ipv6. IPV6 need 64 bits for long which is not compatible with 32 bit architectures.
So it seems that store ips as integers it not an option anymore.
Approaches:
- Change to varchar
- Change to binary: http://stackoverflow.com/questions/444966/working-with-ipv6-addresses-in...
Working in a solution! Patches or more approaches are welcome!
Issue fork ip-2313819
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:
- 2313819-ipv6-not-recorded
changes, plain diff MR !8
- 3481806-ignore-tracking-ip
compare
Comments
Comment #1
gedur commentedThe drupal 7 version will not be compatible with varbinary (https://www.drupal.org/node/710940) and Drupal8 is working on the postgreSQL varbinary integration.
So the ip module schema needs to be changed to varchar to support ipv6 pro tem.
Comment #2
sagesolutions commentedComment #3
ben coleman commentedActually,IPv6 needs 128 bits for the address.
Comment #4
sagesolutions commentedThe webform module stores the remote address as a varchar(128) in the database.
The vote the IP address module use varchar as well.
From WebformSubmission.php baseFieldDefinitions function:
Comment #7
sagesolutions commentedComment #9
sagesolutions commented