Skip to content

Commit d084646

Browse files
committed
Merge pull request #92 from dkstiler/Xen-fixes
Fixing xen ip stack seperating ipv4 and ipv6
2 parents 85f8139 + 86ee014 commit d084646

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
@@ -2049,6 +2049,22 @@ public function setInternalParam($mountpoint)
20492049

20502050
$iplist = implode(" ", $iplist);
20512051

2052+
$iplistnew = preg_split('/ /', $iplist,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
2053+
//counting the elements of the array aka ip
2054+
$ipcnt = count($iplistnew);
2055+
2056+
for($i = 0; $i < $ipcnt ; $i++) {
2057+
if (isIPV6($iplistnew[$i])) {
2058+
$iplist6new[$i] = $iplistnew[$i];
2059+
$ip6list= implode(" ",$iplist6new);
2060+
}elseif (!isIPV6($iplistnew[$i])){
2061+
$iplist4new[$i] = $iplistnew[$i];
2062+
$ip4list = implode(" ",$iplist4new);
2063+
}else {
2064+
throw new lxException("The Iplist does not contain any values");
2065+
}
2066+
}
2067+
20522068
$ipadd = $result['ADD_IP'];
20532069
$sethostname = $result['SET_HOSTNAME'];
20542070
$setuserpass = $result['SET_USERPASS'];

0 commit comments

Comments
 (0)