Project

General

Profile

« Previous | Next » 

Revision c0f5182c

Added by Ermal Luçi over 15 years ago

Correctly configure the default route addition when interfaces are configured for pppoe/pptp. Handle in system routing configure dynamic interfaces. Also when chaning or configuring the defaultgw reconfigure the underlying interface, this helps when this interfaces are dynamics one.

View differences:

etc/inc/interfaces.inc
2034 2034
	set iface name {$realif}
2035 2035

  
2036 2036
EOD;
2037
	if ($interface == "wan")
2037
	$setdefaultgw = false;
2038
	$founddefaultgw = false;
2039
	if (is_array($config['gateways']['gateway_item'])) {
2040
		foreach($config['gateways']['gateway_item'] as $gateway) {
2041
			if($interface == $gateway['interface'] && isset($gateway['defaultgw'])) {
2042
				$setdefaultgw = true;
2043
				break;
2044
			} else if (isset($gateway['defaultgw'])) {
2045
				$founddefaultgw = true;
2046
				break;
2047
			}
2048
		}
2049
	}
2050
	if (($interface == "wan" && $founddefaultgw == false) || $setdefaultgw == true)
2038 2051
		$mpdconf .= <<<EOD
2039 2052
	set iface route default
2040 2053

  
......
2183 2196
	set iface name {$realif}
2184 2197

  
2185 2198
EOD;
2186
        if ($interface == "wan")
2199
	$setdefaultgw = false;
2200
        $founddefaultgw = false;
2201
        if (is_array($config['gateways']['gateway_item'])) {
2202
                foreach($config['gateways']['gateway_item'] as $gateway) {
2203
                        if($interface == $gateway['interface'] && isset($gateway['defaultgw'])) {
2204
                                $setdefaultgw = true;
2205
                                break;
2206
                        } else if (isset($gateway['defaultgw'])) {
2207
                                $founddefaultgw = true;
2208
                                break;
2209
                        }
2210
		}
2211
        }
2212
        if (($interface == "wan" && $founddefaultgw == false) || $setdefaultgw == true)
2187 2213
                $mpdconf .= <<<EOD
2188 2214
        set iface route default
2189 2215

  

Also available in: Unified diff