Project

General

Profile

« Previous | Next » 

Revision 640b3a9a

Added by Seth Mos over 14 years ago

remove some debugging from filter inc, show correct ipv6 gateway from function

View differences:

etc/inc/filter.inc
2139 2139
			continue;
2140 2140

  
2141 2141
		$gw = get_interface_gateway($ifdescr);
2142
		echo "gw $gw, ip {$ifcfg['ip']} \n";
2143 2142
		if (is_ipaddr($gw) && is_ipaddr($ifcfg['ip']))
2144 2143
                	$ipfrules .= "pass out route-to ( {$ifcfg['if']} {$gw} ) from {$ifcfg['ip']} to !{$ifcfg['sa']}/{$ifcfg['sn']} keep state allow-opts label \"let out anything from firewall host itself\"\n";
2145 2144

  
2146 2145
		$gwv6 = get_interface_gateway_v6($ifdescr);
2147
		echo "gwv6 $gwv6, ip {$ifcfg['ipv6']}\n";
2148 2146
		if (is_ipaddrv6($gwv6) && is_ipaddrv6($ifcfg['ipv6']))
2149 2147
                	$ipfrules .= "pass out route-to ( {$ifcfg['if']} {$gwv6} ) from {$ifcfg['ipv6']} to !{$ifcfg['sav6']}/{$ifcfg['snv6']} keep state allow-opts label \"let out anything from firewall host itself\"\n";
2150 2148
	}
etc/inc/gwlb.inc
147 147
		}
148 148

  
149 149
		/* Interface ip is needed since apinger will bind a socket to it. */
150
		$gwifip = find_interface_ip($gateway['interface'], true);
150
		if (is_ipaddrv4($gateway['gateway'])) {
151
			$gwifip = find_interface_ip($gateway['interface'], true);
152
		}
153
		if (is_ipaddrv6($gateway['gateway'])) {
154
			$gwifip = find_interface_ipv6($gateway['interface'], true);
155
		}
151 156
		if (!is_ipaddr($gwifip))
152 157
			continue; //Skip this target
153 158

  
......
535 540
	global $config, $g;
536 541

  
537 542
	$gw = NULL;
538

  
539 543
	$gwcfg = $config['interfaces'][$interface];
540 544
	if (!empty($gwcfg['gateway']) && is_array($config['gateways']['gateway_item'])) {
541 545
		foreach($config['gateways']['gateway_item'] as $gateway) {
542
			if(($gateway['name'] == $gwcfg['gateway']) && (is_ipaddrv6($gateway['gateway']))) {
546
			if(($gateway['name'] == $gwcfg['gatewayv6']) && (is_ipaddrv6($gateway['gateway']))) {
543 547
				$gw = $gateway['gateway'];
544 548
				break;
545 549
			}

Also available in: Unified diff