#8024 fixed router ip

This commit is contained in:
Daniel Maya 2021-09-28 13:42:30 +02:00
parent 9beda8eada
commit d237fab6a6
1 changed files with 18 additions and 9 deletions

View File

@ -910,9 +910,15 @@ function netflow_get_filter_arguments($filter, $safe_input=false)
// Normal filter. // Normal filter.
if ($filter['ip_dst'] != '') { if ($filter['ip_dst'] != '') {
if ($filter_args != '') {
$filter_args .= ' AND (';
} else {
$filter_args .= ' ('; $filter_args .= ' (';
}
$val_ipdst = explode(',', io_safe_output($filter['ip_dst'])); $val_ipdst = explode(',', io_safe_output($filter['ip_dst']));
for ($i = 0; $i < count($val_ipdst); $i++) { for ($i = 0; $i < count($val_ipdst); $i++) {
if (!empty($val_ipdst[$i])) {
if ($i > 0) { if ($i > 0) {
$filter_args .= ' or '; $filter_args .= ' or ';
} }
@ -923,6 +929,7 @@ function netflow_get_filter_arguments($filter, $safe_input=false)
$filter_args .= 'dst net '.$val_ipdst[$i]; $filter_args .= 'dst net '.$val_ipdst[$i];
} }
} }
}
$filter_args .= ')'; $filter_args .= ')';
} }
@ -1734,8 +1741,10 @@ function netflow_update_second_level_filter(&$filter, $aggregate, $sources)
$filter[$extra_filter] .= ','; $filter[$extra_filter] .= ',';
} }
if (!empty($sources)) {
$filter[$extra_filter] = implode(',', $sources); $filter[$extra_filter] = implode(',', $sources);
} }
}
/** /**