Skip to content

Commit 86ee014

Browse files
committed
Fixing xen ip stack seperating ipv4 and ipv6
This fix is for xen to properly handle ipv6 and ipv4 addresses by seperating them at the list level and assign them properly to the guest os systems Note the xen scripts needs to be fixed after this commit!
1 parent 119c433 commit 86ee014

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

hypervm/httpdocs/lib/vps/driver/vps__xenlib.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,22 @@ public function setInternalParam($mountpoint)
20182018

20192019
$iplist = implode(" ", $iplist);
20202020

2021+
$iplistnew = preg_split('/ /', $iplist,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
2022+
//counting the elements of the array aka ip
2023+
$ipcnt = count($iplistnew);
2024+
2025+
for($i = 0; $i < $ipcnt ; $i++) {
2026+
if (isIPV6($iplistnew[$i])) {
2027+
$iplist6new[$i] = $iplistnew[$i];
2028+
$ip6list= implode(" ",$iplist6new);
2029+
}elseif (!isIPV6($iplistnew[$i])){
2030+
$iplist4new[$i] = $iplistnew[$i];
2031+
$ip4list = implode(" ",$iplist4new);
2032+
}else {
2033+
throw new lxException("The Iplist does not contain any values");
2034+
}
2035+
}
2036+
20212037
$ipadd = $result['ADD_IP'];
20222038
$sethostname = $result['SET_HOSTNAME'];
20232039
$setuserpass = $result['SET_USERPASS'];

0 commit comments

Comments
 (0)