Only add pppoe to the interfaces list if it both has an entry and is in server mode (i.e. not disabled.)

This commit is contained in:
jim-p 2011-05-27 12:01:33 -04:00
parent 685c977602
commit f40a03a45c

View File

@ -801,8 +801,8 @@ function filter_generate_optcfg_array() {
$oic['virtual'] = true;
$FilterIflist['l2tp'] = $oic;
}
if (is_array($config['pppoes']['pppoe'])) {
$FilterIflist['pppoe'] = array();
if (is_array($config['pppoes']['pppoe']) && (count($config['pppoes']['pppoe']) > 0)) {
$pppoeifs = array();
foreach($config['pppoes']['pppoe'] as $pppoe) {
if ($pppoe['mode'] == "server") {
$oic = array();
@ -816,9 +816,11 @@ function filter_generate_optcfg_array() {
$oic['sn'] = $pppoe['pppoe_subnet'];
else
$oic['sn'] = "32";
$FilterIflist['pppoe'][] = $oic;
$pppoeifs[] = $oic;
}
}
if (count($pppoeifs))
$FilterIflist['pppoe'] = $pppoeifs;
}
/* add ipsec interfaces */
if(isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) {