solusio / SolusVM-WHMCS-Module

SolusVM WHMCS Module
https://documentation.solusvm.com/display/DOCS/WHMCS
62 stars 59 forks source link

Exclude IPv6 address from assigned IPs #28

Open cyber4len opened 6 years ago

cyber4len commented 6 years ago

https://github.com/OnApp/SolusVM-WHMCS-Module/blob/c1f109e090d315cec8a544867e765ae71e88678e/modules/servers/solusvmpro/solusvmpro.php#L731

SolusVM returns both IPv4 and IPv6 addresses in "extra ip" field, thus tblhosting.assignedips field contains also IPv6 addresses. So, in case the service includes 6 IPv6 addresses and client has one extra IPv4 address, then "assignedips" field contains 7 elements. Once he requests upgrade of the package (even without changing the number of extra IPs), all IPv4 addresses will be removed. Variable $num_current_ips should exclude IPv6 addresses.