VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: man.of.earth on May 02, 2022, 14:09:38 PM

Title: [for the devs] IPs v6 truncated in the DB
Post by: man.of.earth on May 02, 2022, 14:09:38 PM
Hello developers,

I noticed that the IPs are truncated in the database, in #__virtuemart_orders table, ip_address column, as its length is set to char(15) (supports only IPs v4). To remedy this, its length should be set to at least 39, or better 45 if mapped (see https://stackoverflow.com/questions/166132/maximum-length-of-the-textual-representation-of-an-ipv6-address ).

I guess the maskIP routine should also be modified/updated a bit, as the last group of digits for IPs v6 is 4 in length (compared to 3 for the IPs v4).
Title: Re: [for the devs] IPs v6 truncated in the DB
Post by: hazael on May 04, 2022, 21:47:49 PM
You can force ipv4 to be used on the server. Ipv4 is easier to control (it is less scalable than ipv6), which will increase your security.
Title: Re: [for the devs] IPs v6 truncated in the DB
Post by: man.of.earth on May 05, 2022, 10:10:32 AM
I don't wanna do that (it would defeat the purpose IPv6 exists for).

I usually do a backup of the tables that contain IP column and restore them after upgrade...