w funkcji brakuje sprawdzania czy dane IP nie jest brama. wysylam poprawiona funkcje
function NetworkCompress($id,$shift=0) { $nodes = array(); $network = $this->GetNetworkRecord($id); $address = $network['addresslong'] + $shift; $broadcast = $network['addresslong'] + $network['size'];
foreach($network['nodes']['id'] as $idx => $value) if($value) $nodes[] = $network['nodes']['addresslong'][$idx]; rsort($nodes);
for($i = $address+1; $i < $broadcast; $i++) { if(!sizeof($nodes)) break; $ip = array_pop($nodes); if($i==$ip or $i==ip2long($network['gateway'])) continue; else { if(!$this->DB->Execute('UPDATE nodes SET ipaddr=? WHERE ipaddr=?', array($i,$ip))) $this->DB->Execute('UPDATE nodes SET ipaddr_pub=? WHERE ipaddr_pub=?', array($i,$ip)); } } }