From f40a03a45cc5394bd61861e1dcf327befac16eee Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 27 May 2011 12:01:33 -0400 Subject: Only add pppoe to the interfaces list if it both has an entry and is in server mode (i.e. not disabled.) --- etc/inc/filter.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 47a3bad..e5e173c 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -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'])) { -- cgit v1.1