Regression #11475 » utils.inc.diff
| 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 '';
|
||