Project

General

Profile

Regression #11475 » utils.inc.diff

Renato Botelho, 02/22/2021 09:35 AM

View differences:

src/etc/inc/util.inc
}
/* Get static route for specific destination */
function route_get($target, $ipprotocol = '') {
function route_get($target, $ipprotocol = '', $first_match = false) {
if (!empty($ipprotocol)) {
$family = $ipprotocol;
} else if (is_v4($target)) {
......
if ($item['destination'] == $target ||
ip_in_subnet($target, $item['destination'])) {
$result[] = $item;
if ($first_match) {
break;
}
}
}
......
return '';
}
$route = route_get('default', $ipprotocol);
$route = route_get('default', $ipprotocol, true);
if (empty($route)) {
return '';
(1-1/2)