Project

General

Profile

Regression #11475 » utils.inc.diff

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

View differences:

src/etc/inc/util.inc
2649 2649
}
2650 2650

  
2651 2651
/* Get static route for specific destination */
2652
function route_get($target, $ipprotocol = '') {
2652
function route_get($target, $ipprotocol = '', $first_match = false) {
2653 2653
	if (!empty($ipprotocol)) {
2654 2654
		$family = $ipprotocol;
2655 2655
	} else if (is_v4($target)) {
......
2673 2673
		if ($item['destination'] == $target ||
2674 2674
		    ip_in_subnet($target, $item['destination'])) {
2675 2675
			$result[] = $item;
2676
			if ($first_match) {
2677
				break;
2678
			}
2676 2679
		}
2677 2680
	}
2678 2681

  
......
2686 2689
		return '';
2687 2690
	}
2688 2691

  
2689
	$route = route_get('default', $ipprotocol);
2692
	$route = route_get('default', $ipprotocol, true);
2690 2693

  
2691 2694
	if (empty($route)) {
2692 2695
		return '';
(1-1/2)