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

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

gedur’s picture

The 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.

sagesolutions’s picture

Version: 7.x-2.x-dev » 3.1.1
ben coleman’s picture

Actually,IPv6 needs 128 bits for the address.

sagesolutions’s picture

The 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:

    $fields['remote_addr'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Remote IP address'))
      ->setDescription(t('The IP address of the user that submitted the webform.'))
      ->setSetting('max_length', 128);

sagesolutions changed the visibility of the branch 3481806-ignore-tracking-ip to hidden.

sagesolutions’s picture

Version: 3.1.1 » 8.x-2.x-dev
Status: Active » Needs review

sagesolutions’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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