Commit b29146bc authored by ueli heuer's avatar ueli heuer 👾
Browse files

fix ipv4 verification

parent 93624601
......@@ -846,13 +846,15 @@ function edit_link($link_id,$param = null) {
$error = '';
$maxspeed = DVG_device::get_max_speed($device_id);
while ( count($param) > 1 ) {
if (! is_null($param)) {
while ( count($param) > 1 ) {
$value = array_pop($param);
$var = array_pop($param);
if ( $var == 'error' && $value != '') {
$error = $value;
}
}
}
$table = new DVG_table(2);
......
......@@ -36,14 +36,18 @@ class DVG_ipv4format {
}
$netmask = 0xffffffff << (32 - $m);
}
} else {
$m = 32;
$netmask = 0xffffffff << (32 - $m);
}
$ip_ = ip2long($i);
if ( $ip_ === FALSE ) { // php >= 5.0 !!!
// Address is not valid
return FALSE;
}
$ip = new stdClass();
$ip->ip = $ip_;
$ip->netmask = $netmask;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment